schematex 0.3.4 → 0.4.1
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/README.md +5 -4
- package/dist/ai/ai-sdk.cjs +20 -19
- package/dist/ai/ai-sdk.cjs.map +1 -1
- package/dist/ai/ai-sdk.d.cts +2 -2
- package/dist/ai/ai-sdk.d.ts +2 -2
- package/dist/ai/ai-sdk.js +15 -14
- package/dist/ai/ai-sdk.js.map +1 -1
- package/dist/ai/index.cjs +23 -22
- package/dist/ai/index.d.cts +2 -2
- package/dist/ai/index.d.ts +2 -2
- package/dist/ai/index.js +15 -14
- package/dist/{api-BuFilDQB.d.cts → api-BIj9t4Oc.d.cts} +1 -1
- package/dist/{api-BuFilDQB.d.ts → api-BIj9t4Oc.d.ts} +1 -1
- package/dist/browser.cjs +17 -16
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.d.cts +2 -2
- package/dist/browser.d.ts +2 -2
- package/dist/browser.js +15 -14
- package/dist/browser.js.map +1 -1
- package/dist/{chunk-4THC4VUA.cjs → chunk-2Z543TC3.cjs} +7 -6
- package/dist/chunk-2Z543TC3.cjs.map +1 -0
- package/dist/{chunk-DNZV4V4R.js → chunk-4SJSIJK2.js} +831 -10
- package/dist/chunk-4SJSIJK2.js.map +1 -0
- package/dist/{chunk-ZKDL6Y3O.js → chunk-5FF2IT3C.js} +5 -4
- package/dist/chunk-5FF2IT3C.js.map +1 -0
- package/dist/chunk-5IKOLUWK.js +89 -0
- package/dist/chunk-5IKOLUWK.js.map +1 -0
- package/dist/{chunk-3RAVPXLN.js → chunk-6URNSB6G.js} +5 -4
- package/dist/chunk-6URNSB6G.js.map +1 -0
- package/dist/{chunk-MIKCKV27.cjs → chunk-BW4KGTV7.cjs} +65 -31
- package/dist/chunk-BW4KGTV7.cjs.map +1 -0
- package/dist/{chunk-DBMZEZLF.cjs → chunk-DHHVYSQX.cjs} +6229 -51
- package/dist/chunk-DHHVYSQX.cjs.map +1 -0
- package/dist/{chunk-6ULC3UHJ.cjs → chunk-E2EJRVWS.cjs} +43 -12
- package/dist/chunk-E2EJRVWS.cjs.map +1 -0
- package/dist/{chunk-5CTERELC.js → chunk-EPKIJEH7.js} +5 -4
- package/dist/chunk-EPKIJEH7.js.map +1 -0
- package/dist/{chunk-IFR34VTL.cjs → chunk-GZY4CJ23.cjs} +5 -4
- package/dist/chunk-GZY4CJ23.cjs.map +1 -0
- package/dist/{chunk-TWAC2IIS.js → chunk-I55HO32M.js} +5 -4
- package/dist/chunk-I55HO32M.js.map +1 -0
- package/dist/{chunk-5SKT7RYR.js → chunk-J7JWMQD5.js} +7 -6
- package/dist/chunk-J7JWMQD5.js.map +1 -0
- package/dist/{chunk-PWI4NFYR.js → chunk-JDBG5DU2.js} +5 -4
- package/dist/chunk-JDBG5DU2.js.map +1 -0
- package/dist/{chunk-VRE5VWDQ.js → chunk-KVP7AORH.js} +43 -12
- package/dist/chunk-KVP7AORH.js.map +1 -0
- package/dist/{chunk-IURM4ZWE.js → chunk-L3CTXXVZ.js} +65 -31
- package/dist/chunk-L3CTXXVZ.js.map +1 -0
- package/dist/chunk-NAGUZFXX.cjs +94 -0
- package/dist/chunk-NAGUZFXX.cjs.map +1 -0
- package/dist/{chunk-H5JYZ5YS.cjs → chunk-OIZ4MYSF.cjs} +5 -4
- package/dist/chunk-OIZ4MYSF.cjs.map +1 -0
- package/dist/{chunk-T47A6XUK.cjs → chunk-QUKVGHN4.cjs} +5 -4
- package/dist/chunk-QUKVGHN4.cjs.map +1 -0
- package/dist/{chunk-V4OVUBLA.cjs → chunk-RYVV5UVI.cjs} +5 -4
- package/dist/chunk-RYVV5UVI.cjs.map +1 -0
- package/dist/{chunk-CQP5YHVK.cjs → chunk-S2KJRHDZ.cjs} +4 -5
- package/dist/chunk-S2KJRHDZ.cjs.map +1 -0
- package/dist/{chunk-5COUZTVA.cjs → chunk-ST5YRTTV.cjs} +5 -4
- package/dist/chunk-ST5YRTTV.cjs.map +1 -0
- package/dist/{chunk-CS67UBP3.cjs → chunk-SUIDD2C5.cjs} +5 -4
- package/dist/chunk-SUIDD2C5.cjs.map +1 -0
- package/dist/{chunk-DHKKDIVT.js → chunk-SZK376QB.js} +5 -4
- package/dist/chunk-SZK376QB.js.map +1 -0
- package/dist/{chunk-WIFGBWET.cjs → chunk-UUBNQV2T.cjs} +4 -5
- package/dist/chunk-UUBNQV2T.cjs.map +1 -0
- package/dist/{chunk-I6VEXSUK.js → chunk-VDSYMSUY.js} +4 -5
- package/dist/chunk-VDSYMSUY.js.map +1 -0
- package/dist/{chunk-J3Y2QDJR.cjs → chunk-WCAADEXJ.cjs} +833 -12
- package/dist/chunk-WCAADEXJ.cjs.map +1 -0
- package/dist/{chunk-XSNNGYXZ.cjs → chunk-YLEVMOK2.cjs} +22 -8
- package/dist/chunk-YLEVMOK2.cjs.map +1 -0
- package/dist/{chunk-HKJRHXGZ.js → chunk-Z5NGIM4Z.js} +6217 -39
- package/dist/chunk-Z5NGIM4Z.js.map +1 -0
- package/dist/{chunk-ZQZNWAHH.js → chunk-ZX74KJPM.js} +4 -5
- package/dist/chunk-ZX74KJPM.js.map +1 -0
- package/dist/{chunk-IZMAZOQI.js → chunk-ZYRCPSBU.js} +22 -8
- package/dist/chunk-ZYRCPSBU.js.map +1 -0
- package/dist/diagrams/blockdiagram/index.cjs +6 -5
- package/dist/diagrams/blockdiagram/index.d.cts +1 -1
- package/dist/diagrams/blockdiagram/index.d.ts +1 -1
- package/dist/diagrams/blockdiagram/index.js +2 -1
- package/dist/diagrams/circuit/index.cjs +8 -7
- package/dist/diagrams/circuit/index.d.cts +1 -1
- package/dist/diagrams/circuit/index.d.ts +1 -1
- package/dist/diagrams/circuit/index.js +2 -1
- package/dist/diagrams/ecomap/index.d.cts +1 -1
- package/dist/diagrams/ecomap/index.d.ts +1 -1
- package/dist/diagrams/entity/index.cjs +6 -5
- package/dist/diagrams/entity/index.d.cts +1 -1
- package/dist/diagrams/entity/index.d.ts +1 -1
- package/dist/diagrams/entity/index.js +2 -1
- package/dist/diagrams/fishbone/index.d.cts +1 -1
- package/dist/diagrams/fishbone/index.d.ts +1 -1
- package/dist/diagrams/flowchart/index.cjs +7 -7
- package/dist/diagrams/flowchart/index.d.cts +2 -2
- package/dist/diagrams/flowchart/index.d.ts +2 -2
- package/dist/diagrams/flowchart/index.js +1 -1
- package/dist/diagrams/genogram/index.d.cts +1 -1
- package/dist/diagrams/genogram/index.d.ts +1 -1
- package/dist/diagrams/ladder/index.cjs +6 -5
- package/dist/diagrams/ladder/index.d.cts +1 -1
- package/dist/diagrams/ladder/index.d.ts +1 -1
- package/dist/diagrams/ladder/index.js +2 -1
- package/dist/diagrams/logic/index.cjs +6 -5
- package/dist/diagrams/logic/index.d.cts +1 -1
- package/dist/diagrams/logic/index.d.ts +1 -1
- package/dist/diagrams/logic/index.js +2 -1
- package/dist/diagrams/orgchart/index.cjs +7 -6
- package/dist/diagrams/orgchart/index.d.cts +1 -1
- package/dist/diagrams/orgchart/index.d.ts +1 -1
- package/dist/diagrams/orgchart/index.js +2 -1
- package/dist/diagrams/pedigree/index.d.cts +1 -1
- package/dist/diagrams/pedigree/index.d.ts +1 -1
- package/dist/diagrams/phylo/index.cjs +7 -6
- package/dist/diagrams/phylo/index.d.cts +1 -1
- package/dist/diagrams/phylo/index.d.ts +1 -1
- package/dist/diagrams/phylo/index.js +2 -1
- package/dist/diagrams/sld/index.cjs +6 -5
- package/dist/diagrams/sld/index.d.cts +1 -1
- package/dist/diagrams/sld/index.d.ts +1 -1
- package/dist/diagrams/sld/index.js +2 -1
- package/dist/diagrams/sociogram/index.cjs +6 -5
- package/dist/diagrams/sociogram/index.d.cts +1 -1
- package/dist/diagrams/sociogram/index.d.ts +1 -1
- package/dist/diagrams/sociogram/index.js +2 -1
- package/dist/diagrams/timing/index.cjs +5 -4
- package/dist/diagrams/timing/index.d.cts +1 -1
- package/dist/diagrams/timing/index.d.ts +1 -1
- package/dist/diagrams/timing/index.js +2 -1
- package/dist/diagrams/venn/index.cjs +9 -8
- package/dist/diagrams/venn/index.d.cts +1 -1
- package/dist/diagrams/venn/index.d.ts +1 -1
- package/dist/diagrams/venn/index.js +2 -1
- package/dist/{index-D3u6vcA4.d.ts → index-CGK0xVls.d.ts} +3 -3
- package/dist/{index-bdfj6FpQ.d.cts → index-OW8eDrKj.d.cts} +3 -3
- package/dist/index.cjs +32 -31
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +14 -13
- package/dist/react.cjs +15 -14
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.js +14 -13
- package/dist/react.js.map +1 -1
- package/dist/{types-DnU2UlWz.d.ts → types-Gkyab1sL.d.cts} +5 -1
- package/dist/{types-DnU2UlWz.d.cts → types-Gkyab1sL.d.ts} +5 -1
- package/package.json +2 -2
- package/dist/chunk-3RAVPXLN.js.map +0 -1
- package/dist/chunk-4THC4VUA.cjs.map +0 -1
- package/dist/chunk-5COUZTVA.cjs.map +0 -1
- package/dist/chunk-5CTERELC.js.map +0 -1
- package/dist/chunk-5SKT7RYR.js.map +0 -1
- package/dist/chunk-6ULC3UHJ.cjs.map +0 -1
- package/dist/chunk-CQP5YHVK.cjs.map +0 -1
- package/dist/chunk-CS67UBP3.cjs.map +0 -1
- package/dist/chunk-DBMZEZLF.cjs.map +0 -1
- package/dist/chunk-DHKKDIVT.js.map +0 -1
- package/dist/chunk-DNZV4V4R.js.map +0 -1
- package/dist/chunk-H5JYZ5YS.cjs.map +0 -1
- package/dist/chunk-HKJRHXGZ.js.map +0 -1
- package/dist/chunk-I6VEXSUK.js.map +0 -1
- package/dist/chunk-IFR34VTL.cjs.map +0 -1
- package/dist/chunk-IURM4ZWE.js.map +0 -1
- package/dist/chunk-IZMAZOQI.js.map +0 -1
- package/dist/chunk-J3Y2QDJR.cjs.map +0 -1
- package/dist/chunk-MIKCKV27.cjs.map +0 -1
- package/dist/chunk-PWI4NFYR.js.map +0 -1
- package/dist/chunk-T47A6XUK.cjs.map +0 -1
- package/dist/chunk-TWAC2IIS.js.map +0 -1
- package/dist/chunk-V4OVUBLA.cjs.map +0 -1
- package/dist/chunk-VRE5VWDQ.js.map +0 -1
- package/dist/chunk-WIFGBWET.cjs.map +0 -1
- package/dist/chunk-XSNNGYXZ.cjs.map +0 -1
- package/dist/chunk-ZKDL6Y3O.js.map +0 -1
- package/dist/chunk-ZQZNWAHH.js.map +0 -1
package/README.md
CHANGED
|
@@ -29,13 +29,14 @@
|
|
|
29
29
|
|
|
30
30
|
---
|
|
31
31
|
|
|
32
|
-
**Schematex** is the open-source rendering engine for the diagrams professionals actually use — medical, electrical, legal, and analytical.
|
|
32
|
+
**Schematex** is the open-source rendering engine for the diagrams professionals actually use — medical, electrical, legal, and analytical. 27 diagram families across seven domains:
|
|
33
33
|
|
|
34
34
|
- 👪 **Relationships** — genograms, ecomaps, pedigrees, sociograms, phylogenetic trees
|
|
35
|
-
- ⚡ **Electrical & Industrial** — ladder logic, single-line diagrams, circuit schematics, logic gates, timing, block diagrams, **P&ID** (ISA-5.1)
|
|
35
|
+
- ⚡ **Electrical & Industrial** — ladder logic, single-line diagrams, circuit schematics, logic gates, timing, block diagrams, **FBD**, **SFC**, breadboard, **P&ID** (ISA-5.1)
|
|
36
36
|
- 🏢 **Corporate & Legal** — entity structures, cap tables
|
|
37
37
|
- 🐟 **Causality & Analysis** — fishbone / Ishikawa, decision trees (Howard-Raiffa EV · CART/sklearn · taxonomy)
|
|
38
|
-
- 🔄 **Behavior modeling** — UML 2.5 / Harel **state diagrams** (Mermaid-compatible superset)
|
|
38
|
+
- 🔄 **Behavior modeling** — UML 2.5 / Harel **state diagrams** (Mermaid-compatible superset), **BPMN 2.0** (OMG)
|
|
39
|
+
- 🗄️ **Data modeling** — ERD crow's-foot notation
|
|
39
40
|
- 📅 **Timelines** — proportional / equidistant / log axis · swimlane · gantt · lollipop · BC dates · geological Ma scale
|
|
40
41
|
|
|
41
42
|
Mermaid draws generic flowcharts. Schematex draws the diagrams doctors, engineers, and lawyers actually use — a genogram a genetic counselor accepts clinically, ladder logic that maps 1:1 to IEC 61131-3, a cap table that survives a Series A review.
|
|
@@ -71,7 +72,7 @@ import { render } from 'schematex/genogram';
|
|
|
71
72
|
|
|
72
73
|
## Gallery
|
|
73
74
|
|
|
74
|
-
|
|
75
|
+
27 diagram types, one unified pipeline. **Try any of these live at [schematex.dev/playground](https://schematex.dev/playground).**
|
|
75
76
|
|
|
76
77
|
### 👪 Genogram — *McGoldrick family-systems standard*
|
|
77
78
|
|
package/dist/ai/ai-sdk.cjs
CHANGED
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
5
|
-
require('../chunk-
|
|
6
|
-
require('../chunk-
|
|
7
|
-
require('../chunk-
|
|
8
|
-
require('../chunk-
|
|
9
|
-
require('../chunk-
|
|
10
|
-
require('../chunk-
|
|
3
|
+
var chunkWCAADEXJ_cjs = require('../chunk-WCAADEXJ.cjs');
|
|
4
|
+
require('../chunk-DHHVYSQX.cjs');
|
|
5
|
+
require('../chunk-QUKVGHN4.cjs');
|
|
6
|
+
require('../chunk-2Z543TC3.cjs');
|
|
7
|
+
require('../chunk-SUIDD2C5.cjs');
|
|
8
|
+
require('../chunk-GZY4CJ23.cjs');
|
|
9
|
+
require('../chunk-OIZ4MYSF.cjs');
|
|
10
|
+
require('../chunk-RYVV5UVI.cjs');
|
|
11
11
|
require('../chunk-6WORZSL3.cjs');
|
|
12
|
-
require('../chunk-
|
|
13
|
-
require('../chunk-
|
|
12
|
+
require('../chunk-BW4KGTV7.cjs');
|
|
13
|
+
require('../chunk-E2EJRVWS.cjs');
|
|
14
14
|
require('../chunk-K6RAUXRQ.cjs');
|
|
15
15
|
require('../chunk-3MJKJX27.cjs');
|
|
16
16
|
require('../chunk-O5POCPXZ.cjs');
|
|
17
|
-
require('../chunk-
|
|
18
|
-
require('../chunk-
|
|
17
|
+
require('../chunk-S2KJRHDZ.cjs');
|
|
18
|
+
require('../chunk-UUBNQV2T.cjs');
|
|
19
19
|
require('../chunk-5UCXMYE7.cjs');
|
|
20
|
-
require('../chunk-
|
|
21
|
-
require('../chunk-
|
|
20
|
+
require('../chunk-ST5YRTTV.cjs');
|
|
21
|
+
require('../chunk-YLEVMOK2.cjs');
|
|
22
22
|
require('../chunk-D7EHZFK4.cjs');
|
|
23
|
+
require('../chunk-NAGUZFXX.cjs');
|
|
23
24
|
require('../chunk-3WNW5Y7P.cjs');
|
|
24
25
|
var ai = require('ai');
|
|
25
26
|
var zod = require('zod');
|
|
@@ -28,7 +29,7 @@ var schematexTools = {
|
|
|
28
29
|
listDiagrams: ai.tool({
|
|
29
30
|
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.",
|
|
30
31
|
inputSchema: zod.z.object({}),
|
|
31
|
-
execute: async () =>
|
|
32
|
+
execute: async () => chunkWCAADEXJ_cjs.listDiagrams()
|
|
32
33
|
}),
|
|
33
34
|
getSyntax: ai.tool({
|
|
34
35
|
description: "Return a compact syntax reference for one diagram type \u2014 rules, grammar (EBNF), and inline examples. Trimmed for LLM consumption (~2,000\u20134,000 tokens). Call after listDiagrams once you've chosen a type.",
|
|
@@ -37,7 +38,7 @@ var schematexTools = {
|
|
|
37
38
|
"Diagram type id from listDiagrams (e.g. 'genogram', 'sld', 'fishbone')."
|
|
38
39
|
)
|
|
39
40
|
}),
|
|
40
|
-
execute: async ({ type }) =>
|
|
41
|
+
execute: async ({ type }) => chunkWCAADEXJ_cjs.getSyntax(type)
|
|
41
42
|
}),
|
|
42
43
|
getExamples: ai.tool({
|
|
43
44
|
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.",
|
|
@@ -47,7 +48,7 @@ var schematexTools = {
|
|
|
47
48
|
preferFeatured: zod.z.boolean().optional().describe("Rank featured examples first."),
|
|
48
49
|
maxComplexity: zod.z.number().int().min(1).max(5).optional().describe("Only return examples with complexity <= this value (1=simplest).")
|
|
49
50
|
}),
|
|
50
|
-
execute: async (args) =>
|
|
51
|
+
execute: async (args) => chunkWCAADEXJ_cjs.getExamples(args.type, {
|
|
51
52
|
limit: args.limit,
|
|
52
53
|
preferFeatured: args.preferFeatured,
|
|
53
54
|
maxComplexity: args.maxComplexity
|
|
@@ -61,7 +62,7 @@ var schematexTools = {
|
|
|
61
62
|
),
|
|
62
63
|
dsl: zod.z.string().describe("The DSL source text to validate.")
|
|
63
64
|
}),
|
|
64
|
-
execute: async ({ type, dsl }) =>
|
|
65
|
+
execute: async ({ type, dsl }) => chunkWCAADEXJ_cjs.validateDsl(type, dsl)
|
|
65
66
|
}),
|
|
66
67
|
renderDsl: ai.tool({
|
|
67
68
|
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.",
|
|
@@ -76,7 +77,7 @@ var schematexTools = {
|
|
|
76
77
|
dsl,
|
|
77
78
|
theme,
|
|
78
79
|
padding
|
|
79
|
-
}) =>
|
|
80
|
+
}) => chunkWCAADEXJ_cjs.renderDsl(type, dsl, { theme, padding })
|
|
80
81
|
})
|
|
81
82
|
};
|
|
82
83
|
|
package/dist/ai/ai-sdk.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/ai/ai-sdk.ts"],"names":["tool","z","listDiagrams","getSyntax","getExamples","validateDsl","renderDsl"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/ai/ai-sdk.ts"],"names":["tool","z","listDiagrams","getSyntax","getExamples","validateDsl","renderDsl"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCO,IAAM,cAAA,GAAiB;AAAA,EAC5B,cAAcA,OAAA,CAAK;AAAA,IACjB,WAAA,EACE,8JAAA;AAAA,IACF,WAAA,EAAaC,KAAA,CAAE,MAAA,CAAO,EAAE,CAAA;AAAA,IACxB,OAAA,EAAS,YAAYC,8BAAA;AAAiB,GACvC,CAAA;AAAA,EAED,WAAWF,OAAA,CAAK;AAAA,IACd,WAAA,EACE,sNAAA;AAAA,IACF,WAAA,EAAaC,MAAE,MAAA,CAAO;AAAA,MACpB,IAAA,EAAMA,KAAA,CACH,MAAA,EAAO,CACP,QAAA;AAAA,QACC;AAAA;AACF,KACH,CAAA;AAAA,IACD,SAAS,OAAO,EAAE,IAAA,EAAK,KAAwBE,4BAAc,IAAI;AAAA,GAClE,CAAA;AAAA,EAED,aAAaH,OAAA,CAAK;AAAA,IAChB,WAAA,EACE,8IAAA;AAAA,IACF,WAAA,EAAaC,MAAE,MAAA,CAAO;AAAA,MACpB,IAAA,EAAMA,KAAA,CAAE,MAAA,EAAO,CAAE,SAAS,kBAAkB,CAAA;AAAA,MAC5C,KAAA,EAAOA,KAAA,CACJ,MAAA,EAAO,CACP,KAAI,CACJ,GAAA,CAAI,CAAC,CAAA,CACL,IAAI,EAAE,CAAA,CACN,QAAA,EAAS,CACT,SAAS,qCAAqC,CAAA;AAAA,MACjD,gBAAgBA,KAAA,CACb,OAAA,GACA,QAAA,EAAS,CACT,SAAS,+BAA+B,CAAA;AAAA,MAC3C,aAAA,EAAeA,KAAA,CACZ,MAAA,EAAO,CACP,KAAI,CACJ,GAAA,CAAI,CAAC,CAAA,CACL,IAAI,CAAC,CAAA,CACL,QAAA,EAAS,CACT,SAAS,kEAAkE;AAAA,KAC/E,CAAA;AAAA,IACD,OAAA,EAAS,OAAO,IAAA,KAMdG,6BAAA,CAAgB,KAAK,IAAA,EAAM;AAAA,MACzB,OAAO,IAAA,CAAK,KAAA;AAAA,MACZ,gBAAgB,IAAA,CAAK,cAAA;AAAA,MACrB,eAAe,IAAA,CAAK;AAAA,KACrB;AAAA,GACJ,CAAA;AAAA,EAED,aAAaJ,OAAA,CAAK;AAAA,IAChB,WAAA,EACE,6KAAA;AAAA,IACF,WAAA,EAAaC,MAAE,MAAA,CAAO;AAAA,MACpB,IAAA,EAAMA,KAAA,CACH,MAAA,EAAO,CACP,UAAS,CACT,QAAA;AAAA,QACC;AAAA,OACF;AAAA,MACF,GAAA,EAAKA,KAAA,CAAE,MAAA,EAAO,CAAE,SAAS,kCAAkC;AAAA,KAC5D,CAAA;AAAA,IACD,OAAA,EAAS,OAAO,EAAE,IAAA,EAAM,KAAI,KAC1BI,6BAAA,CAAgB,MAAM,GAAG;AAAA,GAC5B,CAAA;AAAA,EAED,WAAWL,OAAA,CAAK;AAAA,IACd,WAAA,EACE,sKAAA;AAAA,IACF,WAAA,EAAaC,MAAE,MAAA,CAAO;AAAA,MACpB,MAAMA,KAAA,CAAE,MAAA,GAAS,QAAA,EAAS,CAAE,SAAS,0CAA0C,CAAA;AAAA,MAC/E,GAAA,EAAKA,KAAA,CAAE,MAAA,EAAO,CAAE,SAAS,gCAAgC,CAAA;AAAA,MACzD,OAAOA,KAAA,CAAE,MAAA,GAAS,QAAA,EAAS,CAAE,SAAS,uCAAuC,CAAA;AAAA,MAC7E,SAASA,KAAA,CAAE,MAAA,GAAS,QAAA,EAAS,CAAE,SAAS,0BAA0B;AAAA,KACnE,CAAA;AAAA,IACD,SAAS,OAAO;AAAA,MACd,IAAA;AAAA,MACA,GAAA;AAAA,MACA,KAAA;AAAA,MACA;AAAA,UAMIK,2BAAA,CAAc,IAAA,EAAM,KAAK,EAAE,KAAA,EAAO,SAAS;AAAA,GAClD;AACH","file":"ai-sdk.cjs","sourcesContent":["/**\n * Vercel AI SDK adapter — ready-to-use `tools` object for `generateText` /\n * `streamText`.\n *\n * @example\n * ```ts\n * import { streamText } from 'ai';\n * import { schematexTools } from 'schematex/ai/sdk';\n *\n * const result = streamText({\n * model: 'anthropic/claude-opus-4-7',\n * tools: schematexTools,\n * maxSteps: 5,\n * system: `You write Schematex DSL. Discover types with listDiagrams,\n * then fetch getSyntax + getExamples before writing. Call validateDsl\n * before returning DSL to the user.`,\n * prompt: userMessage,\n * });\n * ```\n *\n * Peer-deps `ai` and `zod` are optional — this module only loads if both\n * are installed.\n */\nimport { tool } from \"ai\";\nimport { z } from \"zod\";\n\nimport {\n listDiagrams as listDiagramsImpl,\n getSyntax as getSyntaxImpl,\n getExamples as getExamplesImpl,\n validateDsl as validateDslImpl,\n renderDsl as renderDslImpl,\n} from \"./tools\";\n\nexport const schematexTools = {\n listDiagrams: tool({\n description:\n \"List every Schematex diagram type with a tagline, 'use when' hint, domain cluster, and authoritative standard. Call this first to discover what's available.\",\n inputSchema: z.object({}),\n execute: async () => listDiagramsImpl(),\n }),\n\n getSyntax: tool({\n description:\n \"Return a compact syntax reference for one diagram type — rules, grammar (EBNF), and inline examples. Trimmed for LLM consumption (~2,000–4,000 tokens). Call after listDiagrams once you've chosen a type.\",\n inputSchema: z.object({\n type: z\n .string()\n .describe(\n \"Diagram type id from listDiagrams (e.g. 'genogram', 'sld', 'fishbone').\"\n ),\n }),\n execute: async ({ type }: { type: string }) => getSyntaxImpl(type),\n }),\n\n getExamples: tool({\n description:\n \"Return curated real-world DSL examples for a diagram type, each with scenario notes and tags. Use as few-shot context before generating DSL.\",\n inputSchema: z.object({\n type: z.string().describe(\"Diagram type id.\"),\n limit: z\n .number()\n .int()\n .min(1)\n .max(10)\n .optional()\n .describe(\"Max examples to return (default 5).\"),\n preferFeatured: z\n .boolean()\n .optional()\n .describe(\"Rank featured examples first.\"),\n maxComplexity: z\n .number()\n .int()\n .min(1)\n .max(5)\n .optional()\n .describe(\"Only return examples with complexity <= this value (1=simplest).\"),\n }),\n execute: async (args: {\n type: string;\n limit?: number;\n preferFeatured?: boolean;\n maxComplexity?: number;\n }) =>\n getExamplesImpl(args.type, {\n limit: args.limit,\n preferFeatured: args.preferFeatured,\n maxComplexity: args.maxComplexity,\n }),\n }),\n\n validateDsl: tool({\n description:\n \"Validate Schematex DSL. Returns { ok: true } or { ok: false, errors: [{line, column, message, source}] }. Call before returning DSL to the user and self-correct on errors.\",\n inputSchema: z.object({\n type: z\n .string()\n .optional()\n .describe(\n \"Diagram type. Optional — Schematex auto-detects from the first line if omitted.\"\n ),\n dsl: z.string().describe(\"The DSL source text to validate.\"),\n }),\n execute: async ({ type, dsl }: { type?: string; dsl: string }) =>\n validateDslImpl(type, dsl),\n }),\n\n renderDsl: tool({\n description:\n \"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.\",\n inputSchema: z.object({\n type: z.string().optional().describe(\"Diagram type (auto-detected if omitted).\"),\n dsl: z.string().describe(\"The DSL source text to render.\"),\n theme: z.string().optional().describe(\"Theme name, e.g. 'default' or 'dark'.\"),\n padding: z.number().optional().describe(\"Outer padding in pixels.\"),\n }),\n execute: async ({\n type,\n dsl,\n theme,\n padding,\n }: {\n type?: string;\n dsl: string;\n theme?: string;\n padding?: number;\n }) => renderDslImpl(type, dsl, { theme, padding }),\n }),\n} as const;\n\nexport type SchematexTools = typeof schematexTools;\n"]}
|
package/dist/ai/ai-sdk.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as ai from 'ai';
|
|
2
2
|
import { DiagramListItem, GetSyntaxResult, GetExamplesResult, ValidateDslResult, RenderDslResult } from './index.cjs';
|
|
3
|
-
import '../api-
|
|
4
|
-
import '../types-
|
|
3
|
+
import '../api-BIj9t4Oc.cjs';
|
|
4
|
+
import '../types-Gkyab1sL.cjs';
|
|
5
5
|
|
|
6
6
|
declare const schematexTools: {
|
|
7
7
|
readonly listDiagrams: ai.Tool<{}, DiagramListItem[]>;
|
package/dist/ai/ai-sdk.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as ai from 'ai';
|
|
2
2
|
import { DiagramListItem, GetSyntaxResult, GetExamplesResult, ValidateDslResult, RenderDslResult } from './index.js';
|
|
3
|
-
import '../api-
|
|
4
|
-
import '../types-
|
|
3
|
+
import '../api-BIj9t4Oc.js';
|
|
4
|
+
import '../types-Gkyab1sL.js';
|
|
5
5
|
|
|
6
6
|
declare const schematexTools: {
|
|
7
7
|
readonly listDiagrams: ai.Tool<{}, DiagramListItem[]>;
|
package/dist/ai/ai-sdk.js
CHANGED
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
import { renderDsl, validateDsl, getExamples, getSyntax, listDiagrams } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
3
|
-
import '../chunk-
|
|
4
|
-
import '../chunk-
|
|
5
|
-
import '../chunk-
|
|
6
|
-
import '../chunk-
|
|
7
|
-
import '../chunk-
|
|
8
|
-
import '../chunk-
|
|
1
|
+
import { renderDsl, validateDsl, getExamples, getSyntax, listDiagrams } from '../chunk-4SJSIJK2.js';
|
|
2
|
+
import '../chunk-Z5NGIM4Z.js';
|
|
3
|
+
import '../chunk-I55HO32M.js';
|
|
4
|
+
import '../chunk-J7JWMQD5.js';
|
|
5
|
+
import '../chunk-EPKIJEH7.js';
|
|
6
|
+
import '../chunk-5FF2IT3C.js';
|
|
7
|
+
import '../chunk-JDBG5DU2.js';
|
|
8
|
+
import '../chunk-SZK376QB.js';
|
|
9
9
|
import '../chunk-YWDODCW2.js';
|
|
10
|
-
import '../chunk-
|
|
11
|
-
import '../chunk-
|
|
10
|
+
import '../chunk-L3CTXXVZ.js';
|
|
11
|
+
import '../chunk-KVP7AORH.js';
|
|
12
12
|
import '../chunk-WHNIK4LK.js';
|
|
13
13
|
import '../chunk-LPKVIRYT.js';
|
|
14
14
|
import '../chunk-6XGSEG3K.js';
|
|
15
|
-
import '../chunk-
|
|
16
|
-
import '../chunk-
|
|
15
|
+
import '../chunk-VDSYMSUY.js';
|
|
16
|
+
import '../chunk-ZX74KJPM.js';
|
|
17
17
|
import '../chunk-FO7BLCEW.js';
|
|
18
|
-
import '../chunk-
|
|
19
|
-
import '../chunk-
|
|
18
|
+
import '../chunk-6URNSB6G.js';
|
|
19
|
+
import '../chunk-ZYRCPSBU.js';
|
|
20
20
|
import '../chunk-2VNMKOUO.js';
|
|
21
|
+
import '../chunk-5IKOLUWK.js';
|
|
21
22
|
import '../chunk-SYYBKDL7.js';
|
|
22
23
|
import { tool } from 'ai';
|
|
23
24
|
import { z } from 'zod';
|
package/dist/ai/ai-sdk.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/ai/ai-sdk.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/ai/ai-sdk.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAkCO,IAAM,cAAA,GAAiB;AAAA,EAC5B,cAAc,IAAA,CAAK;AAAA,IACjB,WAAA,EACE,8JAAA;AAAA,IACF,WAAA,EAAa,CAAA,CAAE,MAAA,CAAO,EAAE,CAAA;AAAA,IACxB,OAAA,EAAS,YAAY,YAAA;AAAiB,GACvC,CAAA;AAAA,EAED,WAAW,IAAA,CAAK;AAAA,IACd,WAAA,EACE,sNAAA;AAAA,IACF,WAAA,EAAa,EAAE,MAAA,CAAO;AAAA,MACpB,IAAA,EAAM,CAAA,CACH,MAAA,EAAO,CACP,QAAA;AAAA,QACC;AAAA;AACF,KACH,CAAA;AAAA,IACD,SAAS,OAAO,EAAE,IAAA,EAAK,KAAwB,UAAc,IAAI;AAAA,GAClE,CAAA;AAAA,EAED,aAAa,IAAA,CAAK;AAAA,IAChB,WAAA,EACE,8IAAA;AAAA,IACF,WAAA,EAAa,EAAE,MAAA,CAAO;AAAA,MACpB,IAAA,EAAM,CAAA,CAAE,MAAA,EAAO,CAAE,SAAS,kBAAkB,CAAA;AAAA,MAC5C,KAAA,EAAO,CAAA,CACJ,MAAA,EAAO,CACP,KAAI,CACJ,GAAA,CAAI,CAAC,CAAA,CACL,IAAI,EAAE,CAAA,CACN,QAAA,EAAS,CACT,SAAS,qCAAqC,CAAA;AAAA,MACjD,gBAAgB,CAAA,CACb,OAAA,GACA,QAAA,EAAS,CACT,SAAS,+BAA+B,CAAA;AAAA,MAC3C,aAAA,EAAe,CAAA,CACZ,MAAA,EAAO,CACP,KAAI,CACJ,GAAA,CAAI,CAAC,CAAA,CACL,IAAI,CAAC,CAAA,CACL,QAAA,EAAS,CACT,SAAS,kEAAkE;AAAA,KAC/E,CAAA;AAAA,IACD,OAAA,EAAS,OAAO,IAAA,KAMd,WAAA,CAAgB,KAAK,IAAA,EAAM;AAAA,MACzB,OAAO,IAAA,CAAK,KAAA;AAAA,MACZ,gBAAgB,IAAA,CAAK,cAAA;AAAA,MACrB,eAAe,IAAA,CAAK;AAAA,KACrB;AAAA,GACJ,CAAA;AAAA,EAED,aAAa,IAAA,CAAK;AAAA,IAChB,WAAA,EACE,6KAAA;AAAA,IACF,WAAA,EAAa,EAAE,MAAA,CAAO;AAAA,MACpB,IAAA,EAAM,CAAA,CACH,MAAA,EAAO,CACP,UAAS,CACT,QAAA;AAAA,QACC;AAAA,OACF;AAAA,MACF,GAAA,EAAK,CAAA,CAAE,MAAA,EAAO,CAAE,SAAS,kCAAkC;AAAA,KAC5D,CAAA;AAAA,IACD,OAAA,EAAS,OAAO,EAAE,IAAA,EAAM,KAAI,KAC1B,WAAA,CAAgB,MAAM,GAAG;AAAA,GAC5B,CAAA;AAAA,EAED,WAAW,IAAA,CAAK;AAAA,IACd,WAAA,EACE,sKAAA;AAAA,IACF,WAAA,EAAa,EAAE,MAAA,CAAO;AAAA,MACpB,MAAM,CAAA,CAAE,MAAA,GAAS,QAAA,EAAS,CAAE,SAAS,0CAA0C,CAAA;AAAA,MAC/E,GAAA,EAAK,CAAA,CAAE,MAAA,EAAO,CAAE,SAAS,gCAAgC,CAAA;AAAA,MACzD,OAAO,CAAA,CAAE,MAAA,GAAS,QAAA,EAAS,CAAE,SAAS,uCAAuC,CAAA;AAAA,MAC7E,SAAS,CAAA,CAAE,MAAA,GAAS,QAAA,EAAS,CAAE,SAAS,0BAA0B;AAAA,KACnE,CAAA;AAAA,IACD,SAAS,OAAO;AAAA,MACd,IAAA;AAAA,MACA,GAAA;AAAA,MACA,KAAA;AAAA,MACA;AAAA,UAMI,SAAA,CAAc,IAAA,EAAM,KAAK,EAAE,KAAA,EAAO,SAAS;AAAA,GAClD;AACH","file":"ai-sdk.js","sourcesContent":["/**\n * Vercel AI SDK adapter — ready-to-use `tools` object for `generateText` /\n * `streamText`.\n *\n * @example\n * ```ts\n * import { streamText } from 'ai';\n * import { schematexTools } from 'schematex/ai/sdk';\n *\n * const result = streamText({\n * model: 'anthropic/claude-opus-4-7',\n * tools: schematexTools,\n * maxSteps: 5,\n * system: `You write Schematex DSL. Discover types with listDiagrams,\n * then fetch getSyntax + getExamples before writing. Call validateDsl\n * before returning DSL to the user.`,\n * prompt: userMessage,\n * });\n * ```\n *\n * Peer-deps `ai` and `zod` are optional — this module only loads if both\n * are installed.\n */\nimport { tool } from \"ai\";\nimport { z } from \"zod\";\n\nimport {\n listDiagrams as listDiagramsImpl,\n getSyntax as getSyntaxImpl,\n getExamples as getExamplesImpl,\n validateDsl as validateDslImpl,\n renderDsl as renderDslImpl,\n} from \"./tools\";\n\nexport const schematexTools = {\n listDiagrams: tool({\n description:\n \"List every Schematex diagram type with a tagline, 'use when' hint, domain cluster, and authoritative standard. Call this first to discover what's available.\",\n inputSchema: z.object({}),\n execute: async () => listDiagramsImpl(),\n }),\n\n getSyntax: tool({\n description:\n \"Return a compact syntax reference for one diagram type — rules, grammar (EBNF), and inline examples. Trimmed for LLM consumption (~2,000–4,000 tokens). Call after listDiagrams once you've chosen a type.\",\n inputSchema: z.object({\n type: z\n .string()\n .describe(\n \"Diagram type id from listDiagrams (e.g. 'genogram', 'sld', 'fishbone').\"\n ),\n }),\n execute: async ({ type }: { type: string }) => getSyntaxImpl(type),\n }),\n\n getExamples: tool({\n description:\n \"Return curated real-world DSL examples for a diagram type, each with scenario notes and tags. Use as few-shot context before generating DSL.\",\n inputSchema: z.object({\n type: z.string().describe(\"Diagram type id.\"),\n limit: z\n .number()\n .int()\n .min(1)\n .max(10)\n .optional()\n .describe(\"Max examples to return (default 5).\"),\n preferFeatured: z\n .boolean()\n .optional()\n .describe(\"Rank featured examples first.\"),\n maxComplexity: z\n .number()\n .int()\n .min(1)\n .max(5)\n .optional()\n .describe(\"Only return examples with complexity <= this value (1=simplest).\"),\n }),\n execute: async (args: {\n type: string;\n limit?: number;\n preferFeatured?: boolean;\n maxComplexity?: number;\n }) =>\n getExamplesImpl(args.type, {\n limit: args.limit,\n preferFeatured: args.preferFeatured,\n maxComplexity: args.maxComplexity,\n }),\n }),\n\n validateDsl: tool({\n description:\n \"Validate Schematex DSL. Returns { ok: true } or { ok: false, errors: [{line, column, message, source}] }. Call before returning DSL to the user and self-correct on errors.\",\n inputSchema: z.object({\n type: z\n .string()\n .optional()\n .describe(\n \"Diagram type. Optional — Schematex auto-detects from the first line if omitted.\"\n ),\n dsl: z.string().describe(\"The DSL source text to validate.\"),\n }),\n execute: async ({ type, dsl }: { type?: string; dsl: string }) =>\n validateDslImpl(type, dsl),\n }),\n\n renderDsl: tool({\n description:\n \"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.\",\n inputSchema: z.object({\n type: z.string().optional().describe(\"Diagram type (auto-detected if omitted).\"),\n dsl: z.string().describe(\"The DSL source text to render.\"),\n theme: z.string().optional().describe(\"Theme name, e.g. 'default' or 'dark'.\"),\n padding: z.number().optional().describe(\"Outer padding in pixels.\"),\n }),\n execute: async ({\n type,\n dsl,\n theme,\n padding,\n }: {\n type?: string;\n dsl: string;\n theme?: string;\n padding?: number;\n }) => renderDslImpl(type, dsl, { theme, padding }),\n }),\n} as const;\n\nexport type SchematexTools = typeof schematexTools;\n"]}
|
package/dist/ai/index.cjs
CHANGED
|
@@ -1,60 +1,61 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
5
|
-
require('../chunk-
|
|
6
|
-
require('../chunk-
|
|
7
|
-
require('../chunk-
|
|
8
|
-
require('../chunk-
|
|
9
|
-
require('../chunk-
|
|
10
|
-
require('../chunk-
|
|
3
|
+
var chunkWCAADEXJ_cjs = require('../chunk-WCAADEXJ.cjs');
|
|
4
|
+
require('../chunk-DHHVYSQX.cjs');
|
|
5
|
+
require('../chunk-QUKVGHN4.cjs');
|
|
6
|
+
require('../chunk-2Z543TC3.cjs');
|
|
7
|
+
require('../chunk-SUIDD2C5.cjs');
|
|
8
|
+
require('../chunk-GZY4CJ23.cjs');
|
|
9
|
+
require('../chunk-OIZ4MYSF.cjs');
|
|
10
|
+
require('../chunk-RYVV5UVI.cjs');
|
|
11
11
|
require('../chunk-6WORZSL3.cjs');
|
|
12
|
-
require('../chunk-
|
|
13
|
-
require('../chunk-
|
|
12
|
+
require('../chunk-BW4KGTV7.cjs');
|
|
13
|
+
require('../chunk-E2EJRVWS.cjs');
|
|
14
14
|
require('../chunk-K6RAUXRQ.cjs');
|
|
15
15
|
require('../chunk-3MJKJX27.cjs');
|
|
16
16
|
require('../chunk-O5POCPXZ.cjs');
|
|
17
|
-
require('../chunk-
|
|
18
|
-
require('../chunk-
|
|
17
|
+
require('../chunk-S2KJRHDZ.cjs');
|
|
18
|
+
require('../chunk-UUBNQV2T.cjs');
|
|
19
19
|
require('../chunk-5UCXMYE7.cjs');
|
|
20
|
-
require('../chunk-
|
|
21
|
-
require('../chunk-
|
|
20
|
+
require('../chunk-ST5YRTTV.cjs');
|
|
21
|
+
require('../chunk-YLEVMOK2.cjs');
|
|
22
22
|
require('../chunk-D7EHZFK4.cjs');
|
|
23
|
+
require('../chunk-NAGUZFXX.cjs');
|
|
23
24
|
require('../chunk-3WNW5Y7P.cjs');
|
|
24
25
|
|
|
25
26
|
|
|
26
27
|
|
|
27
28
|
Object.defineProperty(exports, "DIAGRAM_REGISTRY", {
|
|
28
29
|
enumerable: true,
|
|
29
|
-
get: function () { return
|
|
30
|
+
get: function () { return chunkWCAADEXJ_cjs.DIAGRAM_REGISTRY; }
|
|
30
31
|
});
|
|
31
32
|
Object.defineProperty(exports, "getAllDiagramTypes", {
|
|
32
33
|
enumerable: true,
|
|
33
|
-
get: function () { return
|
|
34
|
+
get: function () { return chunkWCAADEXJ_cjs.getAllDiagramTypes; }
|
|
34
35
|
});
|
|
35
36
|
Object.defineProperty(exports, "getDiagramMeta", {
|
|
36
37
|
enumerable: true,
|
|
37
|
-
get: function () { return
|
|
38
|
+
get: function () { return chunkWCAADEXJ_cjs.getDiagramMeta; }
|
|
38
39
|
});
|
|
39
40
|
Object.defineProperty(exports, "getExamples", {
|
|
40
41
|
enumerable: true,
|
|
41
|
-
get: function () { return
|
|
42
|
+
get: function () { return chunkWCAADEXJ_cjs.getExamples; }
|
|
42
43
|
});
|
|
43
44
|
Object.defineProperty(exports, "getSyntax", {
|
|
44
45
|
enumerable: true,
|
|
45
|
-
get: function () { return
|
|
46
|
+
get: function () { return chunkWCAADEXJ_cjs.getSyntax; }
|
|
46
47
|
});
|
|
47
48
|
Object.defineProperty(exports, "listDiagrams", {
|
|
48
49
|
enumerable: true,
|
|
49
|
-
get: function () { return
|
|
50
|
+
get: function () { return chunkWCAADEXJ_cjs.listDiagrams; }
|
|
50
51
|
});
|
|
51
52
|
Object.defineProperty(exports, "renderDsl", {
|
|
52
53
|
enumerable: true,
|
|
53
|
-
get: function () { return
|
|
54
|
+
get: function () { return chunkWCAADEXJ_cjs.renderDsl; }
|
|
54
55
|
});
|
|
55
56
|
Object.defineProperty(exports, "validateDsl", {
|
|
56
57
|
enumerable: true,
|
|
57
|
-
get: function () { return
|
|
58
|
+
get: function () { return chunkWCAADEXJ_cjs.validateDsl; }
|
|
58
59
|
});
|
|
59
60
|
//# sourceMappingURL=index.cjs.map
|
|
60
61
|
//# sourceMappingURL=index.cjs.map
|
package/dist/ai/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as SchematexConfig } from '../api-
|
|
2
|
-
import { q as DiagramType } from '../types-
|
|
1
|
+
import { S as SchematexConfig } from '../api-BIj9t4Oc.cjs';
|
|
2
|
+
import { q as DiagramType } from '../types-Gkyab1sL.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Diagram registry — metadata for every diagram type Schematex supports.
|
package/dist/ai/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as SchematexConfig } from '../api-
|
|
2
|
-
import { q as DiagramType } from '../types-
|
|
1
|
+
import { S as SchematexConfig } from '../api-BIj9t4Oc.js';
|
|
2
|
+
import { q as DiagramType } from '../types-Gkyab1sL.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Diagram registry — metadata for every diagram type Schematex supports.
|
package/dist/ai/index.js
CHANGED
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
export { DIAGRAM_REGISTRY, getAllDiagramTypes, getDiagramMeta, getExamples, getSyntax, listDiagrams, renderDsl, validateDsl } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
3
|
-
import '../chunk-
|
|
4
|
-
import '../chunk-
|
|
5
|
-
import '../chunk-
|
|
6
|
-
import '../chunk-
|
|
7
|
-
import '../chunk-
|
|
8
|
-
import '../chunk-
|
|
1
|
+
export { DIAGRAM_REGISTRY, getAllDiagramTypes, getDiagramMeta, getExamples, getSyntax, listDiagrams, renderDsl, validateDsl } from '../chunk-4SJSIJK2.js';
|
|
2
|
+
import '../chunk-Z5NGIM4Z.js';
|
|
3
|
+
import '../chunk-I55HO32M.js';
|
|
4
|
+
import '../chunk-J7JWMQD5.js';
|
|
5
|
+
import '../chunk-EPKIJEH7.js';
|
|
6
|
+
import '../chunk-5FF2IT3C.js';
|
|
7
|
+
import '../chunk-JDBG5DU2.js';
|
|
8
|
+
import '../chunk-SZK376QB.js';
|
|
9
9
|
import '../chunk-YWDODCW2.js';
|
|
10
|
-
import '../chunk-
|
|
11
|
-
import '../chunk-
|
|
10
|
+
import '../chunk-L3CTXXVZ.js';
|
|
11
|
+
import '../chunk-KVP7AORH.js';
|
|
12
12
|
import '../chunk-WHNIK4LK.js';
|
|
13
13
|
import '../chunk-LPKVIRYT.js';
|
|
14
14
|
import '../chunk-6XGSEG3K.js';
|
|
15
|
-
import '../chunk-
|
|
16
|
-
import '../chunk-
|
|
15
|
+
import '../chunk-VDSYMSUY.js';
|
|
16
|
+
import '../chunk-ZX74KJPM.js';
|
|
17
17
|
import '../chunk-FO7BLCEW.js';
|
|
18
|
-
import '../chunk-
|
|
19
|
-
import '../chunk-
|
|
18
|
+
import '../chunk-6URNSB6G.js';
|
|
19
|
+
import '../chunk-ZYRCPSBU.js';
|
|
20
20
|
import '../chunk-2VNMKOUO.js';
|
|
21
|
+
import '../chunk-5IKOLUWK.js';
|
|
21
22
|
import '../chunk-SYYBKDL7.js';
|
|
22
23
|
//# sourceMappingURL=index.js.map
|
|
23
24
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
interface SchematexConfig {
|
|
2
|
-
type?: "genogram" | "ecomap" | "pedigree" | "phylo" | "sociogram" | "timing" | "logic" | "circuit" | "blockdiagram" | "ladder" | "sld" | "entity" | "fishbone" | "venn" | "flowchart" | "mindmap" | "matrix" | "orgchart" | "decisiontree" | "timeline" | "state" | "pid";
|
|
2
|
+
type?: "genogram" | "ecomap" | "pedigree" | "phylo" | "sociogram" | "timing" | "logic" | "circuit" | "blockdiagram" | "ladder" | "sld" | "entity" | "fishbone" | "venn" | "flowchart" | "mindmap" | "matrix" | "orgchart" | "decisiontree" | "timeline" | "state" | "pid" | "erd" | "breadboard" | "bpmn" | "fbd" | "sfc";
|
|
3
3
|
width?: number;
|
|
4
4
|
height?: number;
|
|
5
5
|
padding?: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
interface SchematexConfig {
|
|
2
|
-
type?: "genogram" | "ecomap" | "pedigree" | "phylo" | "sociogram" | "timing" | "logic" | "circuit" | "blockdiagram" | "ladder" | "sld" | "entity" | "fishbone" | "venn" | "flowchart" | "mindmap" | "matrix" | "orgchart" | "decisiontree" | "timeline" | "state" | "pid";
|
|
2
|
+
type?: "genogram" | "ecomap" | "pedigree" | "phylo" | "sociogram" | "timing" | "logic" | "circuit" | "blockdiagram" | "ladder" | "sld" | "entity" | "fishbone" | "venn" | "flowchart" | "mindmap" | "matrix" | "orgchart" | "decisiontree" | "timeline" | "state" | "pid" | "erd" | "breadboard" | "bpmn" | "fbd" | "sfc";
|
|
3
3
|
width?: number;
|
|
4
4
|
height?: number;
|
|
5
5
|
padding?: number;
|
package/dist/browser.cjs
CHANGED
|
@@ -1,29 +1,30 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
5
|
-
require('./chunk-
|
|
6
|
-
require('./chunk-
|
|
7
|
-
require('./chunk-
|
|
8
|
-
require('./chunk-
|
|
9
|
-
require('./chunk-
|
|
3
|
+
var chunkDHHVYSQX_cjs = require('./chunk-DHHVYSQX.cjs');
|
|
4
|
+
require('./chunk-QUKVGHN4.cjs');
|
|
5
|
+
require('./chunk-2Z543TC3.cjs');
|
|
6
|
+
require('./chunk-SUIDD2C5.cjs');
|
|
7
|
+
require('./chunk-GZY4CJ23.cjs');
|
|
8
|
+
require('./chunk-OIZ4MYSF.cjs');
|
|
9
|
+
require('./chunk-RYVV5UVI.cjs');
|
|
10
10
|
require('./chunk-6WORZSL3.cjs');
|
|
11
|
-
require('./chunk-
|
|
12
|
-
require('./chunk-
|
|
11
|
+
require('./chunk-BW4KGTV7.cjs');
|
|
12
|
+
require('./chunk-E2EJRVWS.cjs');
|
|
13
13
|
require('./chunk-K6RAUXRQ.cjs');
|
|
14
14
|
require('./chunk-3MJKJX27.cjs');
|
|
15
15
|
require('./chunk-O5POCPXZ.cjs');
|
|
16
|
-
require('./chunk-
|
|
17
|
-
require('./chunk-
|
|
16
|
+
require('./chunk-S2KJRHDZ.cjs');
|
|
17
|
+
require('./chunk-UUBNQV2T.cjs');
|
|
18
18
|
require('./chunk-5UCXMYE7.cjs');
|
|
19
|
-
require('./chunk-
|
|
20
|
-
require('./chunk-
|
|
19
|
+
require('./chunk-ST5YRTTV.cjs');
|
|
20
|
+
require('./chunk-YLEVMOK2.cjs');
|
|
21
21
|
require('./chunk-D7EHZFK4.cjs');
|
|
22
|
+
require('./chunk-NAGUZFXX.cjs');
|
|
22
23
|
require('./chunk-3WNW5Y7P.cjs');
|
|
23
24
|
|
|
24
25
|
// src/browser.ts
|
|
25
26
|
function renderToElement(text, config) {
|
|
26
|
-
const svgString =
|
|
27
|
+
const svgString = chunkDHHVYSQX_cjs.render(text, config);
|
|
27
28
|
const parser = new DOMParser();
|
|
28
29
|
const doc = parser.parseFromString(svgString, "image/svg+xml");
|
|
29
30
|
const el = doc.documentElement;
|
|
@@ -34,12 +35,12 @@ function renderToElement(text, config) {
|
|
|
34
35
|
return el;
|
|
35
36
|
}
|
|
36
37
|
function renderToContainer(text, container, config) {
|
|
37
|
-
container.innerHTML =
|
|
38
|
+
container.innerHTML = chunkDHHVYSQX_cjs.render(text, config);
|
|
38
39
|
}
|
|
39
40
|
|
|
40
41
|
Object.defineProperty(exports, "render", {
|
|
41
42
|
enumerable: true,
|
|
42
|
-
get: function () { return
|
|
43
|
+
get: function () { return chunkDHHVYSQX_cjs.render; }
|
|
43
44
|
});
|
|
44
45
|
exports.renderToContainer = renderToContainer;
|
|
45
46
|
exports.renderToElement = renderToElement;
|
package/dist/browser.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/browser.ts"],"names":["render"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/browser.ts"],"names":["render"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAmBO,SAAS,eAAA,CACd,MACA,MAAA,EACe;AACf,EAAA,MAAM,SAAA,GAAYA,wBAAA,CAAO,IAAA,EAAM,MAAM,CAAA;AACrC,EAAA,MAAM,MAAA,GAAS,IAAI,SAAA,EAAU;AAC7B,EAAA,MAAM,GAAA,GAAM,MAAA,CAAO,eAAA,CAAgB,SAAA,EAAW,eAAe,CAAA;AAC7D,EAAA,MAAM,KAAK,GAAA,CAAI,eAAA;AACf,EAAA,MAAM,UAAA,GAAa,GAAA,CAAI,aAAA,CAAc,aAAa,CAAA;AAClD,EAAA,IAAI,UAAA,EAAY;AACd,IAAA,MAAM,IAAI,KAAA,CAAM,CAAA,iBAAA,EAAoB,UAAA,CAAW,WAAW,CAAA,CAAE,CAAA;AAAA,EAC9D;AACA,EAAA,OAAO,EAAA;AACT;AAKO,SAAS,iBAAA,CACd,IAAA,EACA,SAAA,EACA,MAAA,EACM;AACN,EAAA,SAAA,CAAU,SAAA,GAAYA,wBAAA,CAAO,IAAA,EAAM,MAAM,CAAA;AAC3C","file":"browser.cjs","sourcesContent":["/**\n * Browser-specific utilities for Schematex.\n *\n * These APIs require a DOM environment. Do not import in SSR/Node contexts.\n *\n * @example\n * ```ts\n * import { renderToElement, renderToContainer } from 'schematex/browser';\n *\n * const svg = renderToElement('genogram\\n alice [female]');\n * document.getElementById('diagram')!.appendChild(svg);\n * ```\n */\n\nimport { render, type SchematexConfig } from \"./core/api\";\n\n/**\n * Render DSL text to a live `SVGSVGElement` ready to insert into the DOM.\n */\nexport function renderToElement(\n text: string,\n config?: SchematexConfig\n): SVGSVGElement {\n const svgString = render(text, config);\n const parser = new DOMParser();\n const doc = parser.parseFromString(svgString, \"image/svg+xml\");\n const el = doc.documentElement;\n const parseError = doc.querySelector(\"parsererror\");\n if (parseError) {\n throw new Error(`SVG parse error: ${parseError.textContent}`);\n }\n return el as unknown as SVGSVGElement;\n}\n\n/**\n * Render DSL text and inject SVG into a container element (replaces innerHTML).\n */\nexport function renderToContainer(\n text: string,\n container: Element,\n config?: SchematexConfig\n): void {\n container.innerHTML = render(text, config);\n}\n\nexport { render, type SchematexConfig } from \"./core/api\";\n"]}
|
package/dist/browser.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as SchematexConfig } from './api-
|
|
2
|
-
export { r as render } from './api-
|
|
1
|
+
import { S as SchematexConfig } from './api-BIj9t4Oc.cjs';
|
|
2
|
+
export { r as render } from './api-BIj9t4Oc.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Browser-specific utilities for Schematex.
|
package/dist/browser.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as SchematexConfig } from './api-
|
|
2
|
-
export { r as render } from './api-
|
|
1
|
+
import { S as SchematexConfig } from './api-BIj9t4Oc.js';
|
|
2
|
+
export { r as render } from './api-BIj9t4Oc.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Browser-specific utilities for Schematex.
|
package/dist/browser.js
CHANGED
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
import { render } from './chunk-
|
|
2
|
-
export { render } from './chunk-
|
|
3
|
-
import './chunk-
|
|
4
|
-
import './chunk-
|
|
5
|
-
import './chunk-
|
|
6
|
-
import './chunk-
|
|
7
|
-
import './chunk-
|
|
8
|
-
import './chunk-
|
|
1
|
+
import { render } from './chunk-Z5NGIM4Z.js';
|
|
2
|
+
export { render } from './chunk-Z5NGIM4Z.js';
|
|
3
|
+
import './chunk-I55HO32M.js';
|
|
4
|
+
import './chunk-J7JWMQD5.js';
|
|
5
|
+
import './chunk-EPKIJEH7.js';
|
|
6
|
+
import './chunk-5FF2IT3C.js';
|
|
7
|
+
import './chunk-JDBG5DU2.js';
|
|
8
|
+
import './chunk-SZK376QB.js';
|
|
9
9
|
import './chunk-YWDODCW2.js';
|
|
10
|
-
import './chunk-
|
|
11
|
-
import './chunk-
|
|
10
|
+
import './chunk-L3CTXXVZ.js';
|
|
11
|
+
import './chunk-KVP7AORH.js';
|
|
12
12
|
import './chunk-WHNIK4LK.js';
|
|
13
13
|
import './chunk-LPKVIRYT.js';
|
|
14
14
|
import './chunk-6XGSEG3K.js';
|
|
15
|
-
import './chunk-
|
|
16
|
-
import './chunk-
|
|
15
|
+
import './chunk-VDSYMSUY.js';
|
|
16
|
+
import './chunk-ZX74KJPM.js';
|
|
17
17
|
import './chunk-FO7BLCEW.js';
|
|
18
|
-
import './chunk-
|
|
19
|
-
import './chunk-
|
|
18
|
+
import './chunk-6URNSB6G.js';
|
|
19
|
+
import './chunk-ZYRCPSBU.js';
|
|
20
20
|
import './chunk-2VNMKOUO.js';
|
|
21
|
+
import './chunk-5IKOLUWK.js';
|
|
21
22
|
import './chunk-SYYBKDL7.js';
|
|
22
23
|
|
|
23
24
|
// src/browser.ts
|
package/dist/browser.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/browser.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/browser.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAmBO,SAAS,eAAA,CACd,MACA,MAAA,EACe;AACf,EAAA,MAAM,SAAA,GAAY,MAAA,CAAO,IAAA,EAAM,MAAM,CAAA;AACrC,EAAA,MAAM,MAAA,GAAS,IAAI,SAAA,EAAU;AAC7B,EAAA,MAAM,GAAA,GAAM,MAAA,CAAO,eAAA,CAAgB,SAAA,EAAW,eAAe,CAAA;AAC7D,EAAA,MAAM,KAAK,GAAA,CAAI,eAAA;AACf,EAAA,MAAM,UAAA,GAAa,GAAA,CAAI,aAAA,CAAc,aAAa,CAAA;AAClD,EAAA,IAAI,UAAA,EAAY;AACd,IAAA,MAAM,IAAI,KAAA,CAAM,CAAA,iBAAA,EAAoB,UAAA,CAAW,WAAW,CAAA,CAAE,CAAA;AAAA,EAC9D;AACA,EAAA,OAAO,EAAA;AACT;AAKO,SAAS,iBAAA,CACd,IAAA,EACA,SAAA,EACA,MAAA,EACM;AACN,EAAA,SAAA,CAAU,SAAA,GAAY,MAAA,CAAO,IAAA,EAAM,MAAM,CAAA;AAC3C","file":"browser.js","sourcesContent":["/**\n * Browser-specific utilities for Schematex.\n *\n * These APIs require a DOM environment. Do not import in SSR/Node contexts.\n *\n * @example\n * ```ts\n * import { renderToElement, renderToContainer } from 'schematex/browser';\n *\n * const svg = renderToElement('genogram\\n alice [female]');\n * document.getElementById('diagram')!.appendChild(svg);\n * ```\n */\n\nimport { render, type SchematexConfig } from \"./core/api\";\n\n/**\n * Render DSL text to a live `SVGSVGElement` ready to insert into the DOM.\n */\nexport function renderToElement(\n text: string,\n config?: SchematexConfig\n): SVGSVGElement {\n const svgString = render(text, config);\n const parser = new DOMParser();\n const doc = parser.parseFromString(svgString, \"image/svg+xml\");\n const el = doc.documentElement;\n const parseError = doc.querySelector(\"parsererror\");\n if (parseError) {\n throw new Error(`SVG parse error: ${parseError.textContent}`);\n }\n return el as unknown as SVGSVGElement;\n}\n\n/**\n * Render DSL text and inject SVG into a container element (replaces innerHTML).\n */\nexport function renderToContainer(\n text: string,\n container: Element,\n config?: SchematexConfig\n): void {\n container.innerHTML = render(text, config);\n}\n\nexport { render, type SchematexConfig } from \"./core/api\";\n"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkD7EHZFK4_cjs = require('./chunk-D7EHZFK4.cjs');
|
|
4
|
+
var chunkNAGUZFXX_cjs = require('./chunk-NAGUZFXX.cjs');
|
|
4
5
|
var chunk3WNW5Y7P_cjs = require('./chunk-3WNW5Y7P.cjs');
|
|
5
6
|
|
|
6
7
|
// src/diagrams/circuit/netlist.ts
|
|
@@ -431,7 +432,7 @@ function parseCircuit(text2) {
|
|
|
431
432
|
const rawLines = text2.split("\n");
|
|
432
433
|
const firstMeaningful = rawLines.map((l) => l.replace(/#.*$/, "").trim()).find((l) => l.length > 0) ?? "";
|
|
433
434
|
if (/^circuit\b.*\bnetlist\s*$/i.test(firstMeaningful)) {
|
|
434
|
-
const
|
|
435
|
+
const netlistTitle = chunkNAGUZFXX_cjs.matchQuotedTitle(firstMeaningful);
|
|
435
436
|
let headerIdx = -1;
|
|
436
437
|
for (let i = 0; i < rawLines.length; i++) {
|
|
437
438
|
const s = rawLines[i].replace(/#.*$/, "").trim();
|
|
@@ -441,7 +442,7 @@ function parseCircuit(text2) {
|
|
|
441
442
|
}
|
|
442
443
|
}
|
|
443
444
|
const body = rawLines.slice(headerIdx + 1).join("\n");
|
|
444
|
-
return parseNetlist(body,
|
|
445
|
+
return parseNetlist(body, netlistTitle);
|
|
445
446
|
}
|
|
446
447
|
const lines = text2.split("\n").map((l) => l.replace(/\r$/, ""));
|
|
447
448
|
let title2;
|
|
@@ -455,8 +456,8 @@ function parseCircuit(text2) {
|
|
|
455
456
|
const stripped = rawLine.replace(/#.*$/, "").trim();
|
|
456
457
|
if (!stripped) continue;
|
|
457
458
|
if (/^circuit\b/i.test(stripped)) {
|
|
458
|
-
const t =
|
|
459
|
-
if (t) title2 = t
|
|
459
|
+
const t = chunkNAGUZFXX_cjs.matchQuotedTitle(stripped);
|
|
460
|
+
if (t !== void 0) title2 = t;
|
|
460
461
|
continue;
|
|
461
462
|
}
|
|
462
463
|
const atMatch = stripped.match(/^at:\s*(.+)$/i);
|
|
@@ -1901,5 +1902,5 @@ exports.layoutCircuitNetlist = layoutCircuitNetlist;
|
|
|
1901
1902
|
exports.parseCircuit = parseCircuit;
|
|
1902
1903
|
exports.parseNetlist = parseNetlist;
|
|
1903
1904
|
exports.renderCircuit = renderCircuit;
|
|
1904
|
-
//# sourceMappingURL=chunk-
|
|
1905
|
-
//# sourceMappingURL=chunk-
|
|
1905
|
+
//# sourceMappingURL=chunk-2Z543TC3.cjs.map
|
|
1906
|
+
//# sourceMappingURL=chunk-2Z543TC3.cjs.map
|