@zh-xx/antu 0.13.1 → 0.15.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/lib/html.mjs CHANGED
@@ -1,4 +1,4 @@
1
- // Antu 0.13.1
1
+ // Antu 0.15.0
2
2
  // Copyright (C) 2026 Ji Cheng
3
3
  //
4
4
  // Antu is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public
@@ -12,9 +12,9 @@
12
12
  // publish them, or sell them on any terms you like. This licence covers Antu's code in the page, and the notices in
13
13
  // the page must stay with it.
14
14
  //
15
- // Corresponding Source of this version: https://github.com/zh-xx/Antu/tree/v0.13.1
16
- // The licence: https://github.com/zh-xx/Antu/blob/v0.13.1/LICENSE
17
- // Third-party notices: https://github.com/zh-xx/Antu/blob/v0.13.1/skills/antu/THIRD-PARTY-NOTICES.md
15
+ // Corresponding Source of this version: https://github.com/zh-xx/Antu/tree/v0.15.0
16
+ // The licence: https://github.com/zh-xx/Antu/blob/v0.15.0/LICENSE
17
+ // Third-party notices: https://github.com/zh-xx/Antu/blob/v0.15.0/skills/antu/THIRD-PARTY-NOTICES.md
18
18
  //
19
19
  // === The licence of Antu ===
20
20
  //
@@ -1422,4 +1422,4 @@
1422
1422
  // SOFTWARE.
1423
1423
  // ````
1424
1424
  //
1425
- import{a as e,n as t,o as n,s as r}from"./chunks/report-BTsYMUG2.mjs";import{readFileSync as i}from"node:fs";import{dirname as a,join as o,resolve as s}from"node:path";import{fileURLToPath as c}from"node:url";var l=`/*ANTU_SPEC*/null`;function u(e){return String(e).replace(/</g,`\\u003c`)}function d(e,t,{preset:n}={}){if(e.split(`/*ANTU_SPEC*/null`).length!==2)throw Error(`the viewer template does not hold exactly one ${l}`);let r=u(JSON.stringify(t)),i=n?`;window.__ANTU_PRESET__ = ${u(JSON.stringify(n))}`:``;return e.replace(l,()=>r+i)}s(a(c(import.meta.url)),`../..`);var f=s(a(c(import.meta.url)),`..`);o(f,`dist-engine/engine.js`),o(f,`dist-engine/engine.css`);function p(e){return String(e).replace(/[&<>"]/g,e=>({"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`})[e])}function m(e,{preset:t,force:n=!1,quiet:r=!1}={}){{let n=p(e?.title||`Antu`);return d(i(o(f,`assets/viewer.html`),`utf8`),e,{preset:t}).replace(/<title>[^<]*<\/title>/,()=>`<title>${n} · Antu</title>`)}}var h=[`document`,`modern`,`legal`],g={equity:{width:r.normal},control:{width:r.heavy},contract:{width:r.normal,dash:n.longDash},debt:{width:r.strong,dash:n.dashDot},guarantee:{width:r.normal,dash:n.dashed},kinship:{width:3.6,double:!0},employment:{width:r.normal,dash:n.dotted},agency:{width:r.strong,dash:`1 4`,round:!0},other:{width:r.hair,dash:`3 3`}},_={equity:{width:.85},control:{width:1.9},contract:{width:.85,dash:`5 3`},debt:{width:1.3,dash:`5 2 1.5 2`},guarantee:{width:.85,dash:`4 3`},kinship:{width:3.2,double:!0},employment:{width:.85,dash:n.dotted},agency:{width:1.3,dash:`1 4`,round:!0},other:{width:.6,dash:`3 3`}},v=(e,t)=>Object.fromEntries(Object.entries(e).map(([e,n])=>[e,{...n,stroke:t}])),y={neutral:{width:r.normal},positive:{width:r.strong},negative:{width:r.normal,dash:n.dashed}},b={main:{width:r.strong},plain:{width:r.normal},back:{width:r.normal,dash:n.dashed}},x={conclusion:{width:r.heavy},norm:{width:r.normal},element:{width:r.normal},fact:{width:r.hair},inference:{width:r.normal,dash:n.dotted},judgement:{width:r.strong}},S={for:{width:r.normal},against:{width:r.strong,dash:n.dashed},basis:{width:r.normal,dash:n.dotted}},C=(e,t)=>Object.fromEntries(Object.entries(e).map(([e,n])=>[e,{...n,...t[e]}])),w={document:{id:`document`,shadowRgb:`17, 17, 17`,chrome:{radius:2,capsule:2,chip:2,bg:`#ffffff`,bgPop:`#ffffff`,border:`1px solid #111111`,shadow:`none`,blur:`none`},labelKey:`theme.document`,font:{body:`"FangSong", "STFangsong", "FangSong_GB2312", "Songti SC", "SimSun", "Noto Serif CJK SC", "Source Han Serif SC", serif`,head:`"SimHei", "Heiti SC", "STHeiti", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif`},color:{ink:`#111111`,ink2:`#2b2b2b`,ink3:`#4d4d4d`,ink4:`#767676`,bg:`#ffffff`,canvas:`#ffffff`,frame:`#111111`,line:`#c9c9c9`,chip:`#f0f0f0`,side1:`#111111`,side2:`#555555`,axis:`#767676`},radius:{person:18,company:3,organization:3,government:3,other:3,pill:2,group:0},entity:{person:{stroke:`#111111`,fill:`#ffffff`,width:1.3},company:{stroke:`#111111`,fill:`#ffffff`,width:1.6},organization:{stroke:`#111111`,fill:`#ffffff`,width:1.3,dash:n.dashed},government:{stroke:`#111111`,fill:`#ffffff`,width:1.3},other:{stroke:`#555555`,fill:`#ffffff`,width:1.1,dash:n.dotted}},relation:v(_,`#767676`),camp:[{fill:`#ffffff`,stroke:`#111111`,text:`#111111`},{fill:`#ececec`,stroke:`#111111`,text:`#111111`},{fill:`#f7f7f7`,stroke:`#8a8a8a`,text:`#4d4d4d`}],group:{fill:`#f5f5f5`,stroke:`#8a8a8a`,title:`#111111`},campBox:{fill:`none`,stroke:`#111111`,width:.75,dash:`2 3`},flow:{outcome:C(y,{neutral:{stroke:`#111111`,fill:`#ffffff`},positive:{stroke:`#111111`,fill:`#ffffff`},negative:{stroke:`#111111`,fill:`#ececec`}}),start:{stroke:`#111111`,fill:`#e2e2e2`},note:{stroke:`none`,fill:`#f5f5f5`,fold:`#767676`},stage:{fill:`#f5f5f5`,stroke:`#8a8a8a`,title:`#111111`},stageLit:{fill:`#e2e2e2`,stroke:`#111111`,title:`#111111`},link:C(b,{main:{stroke:`#111111`},plain:{stroke:`#2b2b2b`},back:{stroke:`#4d4d4d`}})},justify:{node:C(x,{conclusion:{stroke:`#111111`,fill:`#ffffff`},norm:{stroke:`#111111`,fill:`#ececec`},element:{stroke:`#111111`,fill:`#ffffff`},fact:{stroke:`#111111`,fill:`#ffffff`},inference:{stroke:`#111111`,fill:`#ffffff`},judgement:{stroke:`#111111`,fill:`#ececec`}}),stance:C(S,{for:{stroke:`#2b2b2b`},against:{stroke:`#111111`},basis:{stroke:`#4d4d4d`}})},pill:{colored:!1,border:`#111111`}},modern:{id:`modern`,shadowRgb:`15, 23, 42`,chrome:{radius:14,capsule:999,chip:999,bg:`rgba(255, 255, 255, 0.78)`,bgPop:`rgba(255, 255, 255, 0.94)`,border:`1px solid rgba(15, 23, 42, 0.07)`,shadow:`0 4px 18px rgba(15, 23, 42, 0.10), 0 1px 2px rgba(15, 23, 42, 0.06)`,blur:`blur(16px) saturate(1.8)`},labelKey:`theme.modern`,font:{body:`system-ui, "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif`,head:`system-ui, "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif`},color:{ink:`#0f172a`,ink2:`#475569`,ink3:`#64748b`,ink4:`#94a3b8`,bg:`#fbfcfd`,canvas:`#fbfcfd`,frame:`#e2e8f0`,line:`#e8ebef`,chip:`#f1f4f8`,side1:`#475569`,side2:`#64748b`,axis:`#94a3b8`},radius:{person:14,company:8,organization:8,government:6,other:8,pill:12,group:12},entity:{person:{stroke:`#94a3b8`,fill:`#f1f5f9`,width:1},company:{stroke:`#334155`,fill:`#ffffff`,width:1.25},organization:{stroke:`#94a3b8`,fill:`#ffffff`,width:1,dash:n.dashed},government:{stroke:`#64748b`,fill:`#f8fafc`,width:1},other:{stroke:`#94a3b8`,fill:`#f8fafc`,width:.9,dash:n.dotted}},relation:v(g,`#475569`),camp:[{fill:`#f1f5f9`,stroke:`#94a3b8`,text:`#334155`},{fill:`#ffffff`,stroke:`#94a3b8`,text:`#334155`},{fill:`#f8fafc`,stroke:`#e2e8f0`,text:`#64748b`}],group:{fill:`#f8fafc`,stroke:`#e2e8f0`,title:`#475569`},campBox:{fill:`#f8fafc`,stroke:`#e2e8f0`,width:1},flow:{outcome:C(y,{neutral:{stroke:`#64748b`,fill:`#f8fafc`},positive:{stroke:`#334155`,fill:`#f1f5f9`},negative:{stroke:`#64748b`,fill:`#f1f5f9`}}),start:{stroke:`#334155`,fill:`#e2e8f0`},note:{stroke:`none`,fill:`#f1f5f9`,fold:`#94a3b8`},stage:{fill:`#f8fafc`,stroke:`#e2e8f0`,title:`#475569`},stageLit:{fill:`#f1f5f9`,stroke:`#64748b`,title:`#334155`},link:C(b,{main:{stroke:`#0f172a`},plain:{stroke:`#475569`},back:{stroke:`#64748b`}})},justify:{node:C(x,{conclusion:{stroke:`#0f172a`,fill:`#f1f5f9`},norm:{stroke:`#475569`,fill:`#e2e8f0`},element:{stroke:`#64748b`,fill:`#f8fafc`},fact:{stroke:`#94a3b8`,fill:`#ffffff`},inference:{stroke:`#64748b`,fill:`#f8fafc`},judgement:{stroke:`#334155`,fill:`#e2e8f0`}}),stance:C(S,{for:{stroke:`#475569`},against:{stroke:`#334155`},basis:{stroke:`#94a3b8`}})},pill:{colored:!1,border:`#cbd5e1`}},legal:{id:`legal`,shadowRgb:`19, 35, 63`,chrome:{radius:6,capsule:6,chip:4,bg:`#ffffff`,bgPop:`#ffffff`,border:`1px solid #c7d2e4`,shadow:`0 2px 10px rgba(19, 35, 63, 0.10)`,blur:`none`},labelKey:`theme.legal`,font:{body:`system-ui, "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif`,head:`system-ui, "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif`},color:{ink:`#13233f`,ink2:`#2d4366`,ink3:`#5b6f8f`,ink4:`#8aa0c4`,bg:`#ffffff`,canvas:`#ffffff`,frame:`#c7d2e4`,line:`#dbe3f0`,chip:`#eef3fb`,side1:`#1f3f7f`,side2:`#9a1b1b`,axis:`#8aa0c4`},radius:{person:14,company:3,organization:4,government:3,other:4,pill:4,group:6},entity:{person:{stroke:`#2f5aa8`,fill:`#eef3fb`,width:1},company:{stroke:`#1f3f7f`,fill:`#e3ecfa`,width:1.5},organization:{stroke:`#2f5aa8`,fill:`#f4f7fc`,width:1,dash:n.dashed},government:{stroke:`#13233f`,fill:`#eef3fb`,width:1.1},other:{stroke:`#8aa0c4`,fill:`#f8fafd`,width:.9,dash:n.dotted}},relation:{equity:{...g.equity,stroke:`#1f3f7f`},control:{...g.control,stroke:`#13233f`},contract:{...g.contract,stroke:`#5b6f8f`},debt:{...g.debt,stroke:`#9a1b1b`},guarantee:{...g.guarantee,stroke:`#2f5aa8`},kinship:{...g.kinship,stroke:`#4b3a8c`},employment:{...g.employment,stroke:`#1d6b6b`},agency:{...g.agency,stroke:`#1d6b6b`},other:{...g.other,stroke:`#8aa0c4`}},camp:[{fill:`#eaf0fb`,stroke:`#9fb6e0`,text:`#1f3f7f`},{fill:`#fbecec`,stroke:`#e3b4b4`,text:`#9a1b1b`},{fill:`#f4f7fc`,stroke:`#c7d2e4`,text:`#5b6f8f`}],group:{fill:`#f4f7fc`,stroke:`#c7d2e4`,title:`#2d4366`},campBox:{fill:`#f4f7fc`,stroke:`#c7d2e4`,width:1},flow:{outcome:C(y,{neutral:{stroke:`#2f5aa8`,fill:`#eef3fb`},positive:{stroke:`#1f3f7f`,fill:`#e3ecfa`},negative:{stroke:`#9a1b1b`,fill:`#fbecec`}}),start:{stroke:`#13233f`,fill:`#dbe5f5`},note:{stroke:`none`,fill:`#f4f7fc`,fold:`#8aa0c4`},stage:{fill:`#f4f7fc`,stroke:`#c7d2e4`,title:`#2d4366`},stageLit:{fill:`#eaf0fb`,stroke:`#1f3f7f`,title:`#1f3f7f`},link:C(b,{main:{stroke:`#13233f`},plain:{stroke:`#2d4366`},back:{stroke:`#5b6f8f`}})},justify:{node:C(x,{conclusion:{stroke:`#1f3f7f`,fill:`#e3ecfa`},norm:{stroke:`#4b3a8c`,fill:`#efecf8`},element:{stroke:`#2f5aa8`,fill:`#eef3fb`},fact:{stroke:`#8aa0c4`,fill:`#f8fafd`},inference:{stroke:`#1d6b6b`,fill:`#e8f4f4`},judgement:{stroke:`#13233f`,fill:`#dbe5f5`}}),stance:C(S,{for:{stroke:`#2d4366`},against:{stroke:`#9a1b1b`},basis:{stroke:`#4b3a8c`}})},pill:{colored:!0,border:`#c7d2e4`}}},T=e=>Object.prototype.hasOwnProperty.call(w,e);function E(n,{kind:r,theme:i}={}){let a=e(n);if(a.length)throw Object.assign(Error(`antu: the spec is not valid (${a.length} problem(s)): ${a[0]}`),{errors:[...a]});let o=t(n,r);if(o)throw Error(`antu: ${o}`);if(i!==void 0&&!T(i))throw Error(`antu: the theme is one of ${h.join(`, `)}`);return m(n,{preset:r||i?{...r&&{defaultKind:r},...i&&{theme:i}}:void 0,quiet:!0})}export{E as renderHtml};
1425
+ import{a as e,n as t,o as n,s as r}from"./chunks/report-2s3R1IjI.mjs";import{readFileSync as i}from"node:fs";import{dirname as a,join as o,resolve as s}from"node:path";import{fileURLToPath as c}from"node:url";var l=`/*ANTU_SPEC*/null`;function u(e){return String(e).replace(/</g,`\\u003c`)}function d(e,t,{preset:n}={}){if(e.split(`/*ANTU_SPEC*/null`).length!==2)throw Error(`the viewer template does not hold exactly one ${l}`);let r=u(JSON.stringify(t)),i=n?`;window.__ANTU_PRESET__ = ${u(JSON.stringify(n))}`:``;return e.replace(l,()=>r+i)}s(a(c(import.meta.url)),`../..`);var f=s(a(c(import.meta.url)),`..`);o(f,`dist-engine/engine.js`),o(f,`dist-engine/engine.css`);function p(e){return String(e).replace(/[&<>"]/g,e=>({"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`})[e])}function m(e,{preset:t,force:n=!1,quiet:r=!1}={}){{let n=p(e?.title||`Antu`);return d(i(o(f,`assets/viewer.html`),`utf8`),e,{preset:t}).replace(/<title>[^<]*<\/title>/,()=>`<title>${n} · Antu</title>`)}}var h=[`document`,`modern`,`legal`],g={equity:{width:r.normal},control:{width:r.heavy},contract:{width:r.normal,dash:n.longDash},debt:{width:r.strong,dash:n.dashDot},guarantee:{width:r.normal,dash:n.dashed},kinship:{width:3.6,double:!0},employment:{width:r.normal,dash:n.dotted},agency:{width:r.strong,dash:`1 4`,round:!0},other:{width:r.hair,dash:`3 3`}},_={equity:{width:.85},control:{width:1.9},contract:{width:.85,dash:`5 3`},debt:{width:1.3,dash:`5 2 1.5 2`},guarantee:{width:.85,dash:`4 3`},kinship:{width:3.2,double:!0},employment:{width:.85,dash:n.dotted},agency:{width:1.3,dash:`1 4`,round:!0},other:{width:.6,dash:`3 3`}},v=(e,t)=>Object.fromEntries(Object.entries(e).map(([e,n])=>[e,{...n,stroke:t}])),y={neutral:{width:r.normal},positive:{width:r.strong},negative:{width:r.normal,dash:n.dashed}},b={main:{width:r.strong},plain:{width:r.normal},back:{width:r.normal,dash:n.dashed}},x={conclusion:{width:r.heavy},norm:{width:r.normal},element:{width:r.normal},fact:{width:r.hair},inference:{width:r.normal,dash:n.dotted},judgement:{width:r.strong}},S={for:{width:r.normal},against:{width:r.strong,dash:n.dashed},basis:{width:r.normal,dash:n.dotted}},C=(e,t)=>Object.fromEntries(Object.entries(e).map(([e,n])=>[e,{...n,...t[e]}])),w={document:{id:`document`,shadowRgb:`17, 17, 17`,chrome:{radius:2,capsule:2,chip:2,bg:`#ffffff`,bgPop:`#ffffff`,border:`1px solid #111111`,shadow:`none`,blur:`none`},labelKey:`theme.document`,font:{body:`"FangSong", "STFangsong", "FangSong_GB2312", "Songti SC", "SimSun", "Noto Serif CJK SC", "Source Han Serif SC", serif`,head:`"SimHei", "Heiti SC", "STHeiti", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif`},color:{ink:`#111111`,ink2:`#2b2b2b`,ink3:`#4d4d4d`,ink4:`#767676`,bg:`#ffffff`,canvas:`#ffffff`,frame:`#111111`,line:`#c9c9c9`,chip:`#f0f0f0`,side1:`#111111`,side2:`#555555`,axis:`#767676`},radius:{person:18,company:3,organization:3,government:3,other:3,pill:2,group:12},entity:{person:{stroke:`#111111`,fill:`#ffffff`,width:1.3},company:{stroke:`#111111`,fill:`#ffffff`,width:1.6},organization:{stroke:`#111111`,fill:`#ffffff`,width:1.3,dash:n.dashed},government:{stroke:`#111111`,fill:`#ffffff`,width:1.3},other:{stroke:`#555555`,fill:`#ffffff`,width:1.1,dash:n.dotted}},relation:v(_,`#767676`),camp:[{fill:`#ffffff`,stroke:`#111111`,text:`#111111`},{fill:`#ececec`,stroke:`#111111`,text:`#111111`},{fill:`#f7f7f7`,stroke:`#8a8a8a`,text:`#4d4d4d`}],group:{fill:`#f5f5f5`,stroke:`#8a8a8a`,title:`#111111`},campBox:{fill:`none`,stroke:`#111111`,width:.75,dash:`2 3`},flow:{outcome:C(y,{neutral:{stroke:`#111111`,fill:`#ffffff`},positive:{stroke:`#111111`,fill:`#ffffff`},negative:{stroke:`#111111`,fill:`#ececec`}}),start:{stroke:`#111111`,fill:`#e2e2e2`},state:{warn:{stroke:`#a16207`,fill:`#fef3c7`},stop:{stroke:`#b91c1c`,fill:`#fee2e2`},done:{stroke:`#15803d`,fill:`#dcfce7`}},note:{stroke:`none`,fill:`#f5f5f5`,fold:`#767676`},stage:{fill:`#f5f5f5`,stroke:`#8a8a8a`,title:`#111111`},stageLit:{fill:`#e2e2e2`,stroke:`#111111`,title:`#111111`},link:C(b,{main:{stroke:`#111111`},plain:{stroke:`#2b2b2b`},back:{stroke:`#4d4d4d`}})},justify:{node:C(x,{conclusion:{stroke:`#111111`,fill:`#ffffff`},norm:{stroke:`#111111`,fill:`#ececec`},element:{stroke:`#111111`,fill:`#ffffff`},fact:{stroke:`#111111`,fill:`#ffffff`},inference:{stroke:`#111111`,fill:`#ffffff`},judgement:{stroke:`#111111`,fill:`#ececec`}}),stance:C(S,{for:{stroke:`#2b2b2b`},against:{stroke:`#111111`},basis:{stroke:`#4d4d4d`}})},pill:{colored:!1,border:`#111111`}},modern:{id:`modern`,shadowRgb:`15, 23, 42`,chrome:{radius:14,capsule:999,chip:999,bg:`rgba(255, 255, 255, 0.78)`,bgPop:`rgba(255, 255, 255, 0.94)`,border:`1px solid rgba(15, 23, 42, 0.07)`,shadow:`0 4px 18px rgba(15, 23, 42, 0.10), 0 1px 2px rgba(15, 23, 42, 0.06)`,blur:`blur(16px) saturate(1.8)`},labelKey:`theme.modern`,font:{body:`system-ui, "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif`,head:`system-ui, "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif`},color:{ink:`#0f172a`,ink2:`#475569`,ink3:`#64748b`,ink4:`#94a3b8`,bg:`#fbfcfd`,canvas:`#fbfcfd`,frame:`#e2e8f0`,line:`#e8ebef`,chip:`#f1f4f8`,side1:`#475569`,side2:`#64748b`,axis:`#94a3b8`},radius:{person:14,company:8,organization:8,government:6,other:8,pill:12,group:12},entity:{person:{stroke:`#94a3b8`,fill:`#f1f5f9`,width:1},company:{stroke:`#334155`,fill:`#ffffff`,width:1.25},organization:{stroke:`#94a3b8`,fill:`#ffffff`,width:1,dash:n.dashed},government:{stroke:`#64748b`,fill:`#f8fafc`,width:1},other:{stroke:`#94a3b8`,fill:`#f8fafc`,width:.9,dash:n.dotted}},relation:v(g,`#475569`),camp:[{fill:`#f1f5f9`,stroke:`#94a3b8`,text:`#334155`},{fill:`#ffffff`,stroke:`#94a3b8`,text:`#334155`},{fill:`#f8fafc`,stroke:`#e2e8f0`,text:`#64748b`}],group:{fill:`#f8fafc`,stroke:`#e2e8f0`,title:`#475569`},campBox:{fill:`#f8fafc`,stroke:`#e2e8f0`,width:1},flow:{outcome:C(y,{neutral:{stroke:`#64748b`,fill:`#f8fafc`},positive:{stroke:`#334155`,fill:`#f1f5f9`},negative:{stroke:`#64748b`,fill:`#f1f5f9`}}),start:{stroke:`#334155`,fill:`#e2e8f0`},state:{warn:{stroke:`#b45309`,fill:`#fffbeb`},stop:{stroke:`#be123c`,fill:`#fff1f2`},done:{stroke:`#047857`,fill:`#ecfdf5`}},note:{stroke:`none`,fill:`#f1f5f9`,fold:`#94a3b8`},stage:{fill:`#f8fafc`,stroke:`#e2e8f0`,title:`#475569`},stageLit:{fill:`#f1f5f9`,stroke:`#64748b`,title:`#334155`},link:C(b,{main:{stroke:`#0f172a`},plain:{stroke:`#475569`},back:{stroke:`#64748b`}})},justify:{node:C(x,{conclusion:{stroke:`#0f172a`,fill:`#f1f5f9`},norm:{stroke:`#475569`,fill:`#e2e8f0`},element:{stroke:`#64748b`,fill:`#f8fafc`},fact:{stroke:`#94a3b8`,fill:`#ffffff`},inference:{stroke:`#64748b`,fill:`#f8fafc`},judgement:{stroke:`#334155`,fill:`#e2e8f0`}}),stance:C(S,{for:{stroke:`#475569`},against:{stroke:`#334155`},basis:{stroke:`#94a3b8`}})},pill:{colored:!1,border:`#cbd5e1`}},legal:{id:`legal`,shadowRgb:`19, 35, 63`,chrome:{radius:6,capsule:6,chip:4,bg:`#ffffff`,bgPop:`#ffffff`,border:`1px solid #c7d2e4`,shadow:`0 2px 10px rgba(19, 35, 63, 0.10)`,blur:`none`},labelKey:`theme.legal`,font:{body:`system-ui, "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif`,head:`system-ui, "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif`},color:{ink:`#13233f`,ink2:`#2d4366`,ink3:`#5b6f8f`,ink4:`#8aa0c4`,bg:`#ffffff`,canvas:`#ffffff`,frame:`#c7d2e4`,line:`#dbe3f0`,chip:`#eef3fb`,side1:`#1f3f7f`,side2:`#9a1b1b`,axis:`#8aa0c4`},radius:{person:14,company:3,organization:4,government:3,other:4,pill:4,group:6},entity:{person:{stroke:`#2f5aa8`,fill:`#eef3fb`,width:1},company:{stroke:`#1f3f7f`,fill:`#e3ecfa`,width:1.5},organization:{stroke:`#2f5aa8`,fill:`#f4f7fc`,width:1,dash:n.dashed},government:{stroke:`#13233f`,fill:`#eef3fb`,width:1.1},other:{stroke:`#8aa0c4`,fill:`#f8fafd`,width:.9,dash:n.dotted}},relation:{equity:{...g.equity,stroke:`#1f3f7f`},control:{...g.control,stroke:`#13233f`},contract:{...g.contract,stroke:`#5b6f8f`},debt:{...g.debt,stroke:`#9a1b1b`},guarantee:{...g.guarantee,stroke:`#2f5aa8`},kinship:{...g.kinship,stroke:`#4b3a8c`},employment:{...g.employment,stroke:`#1d6b6b`},agency:{...g.agency,stroke:`#1d6b6b`},other:{...g.other,stroke:`#8aa0c4`}},camp:[{fill:`#eaf0fb`,stroke:`#9fb6e0`,text:`#1f3f7f`},{fill:`#fbecec`,stroke:`#e3b4b4`,text:`#9a1b1b`},{fill:`#f4f7fc`,stroke:`#c7d2e4`,text:`#5b6f8f`}],group:{fill:`#f4f7fc`,stroke:`#c7d2e4`,title:`#2d4366`},campBox:{fill:`#f4f7fc`,stroke:`#c7d2e4`,width:1},flow:{outcome:C(y,{neutral:{stroke:`#2f5aa8`,fill:`#eef3fb`},positive:{stroke:`#1f3f7f`,fill:`#e3ecfa`},negative:{stroke:`#9a1b1b`,fill:`#fbecec`}}),start:{stroke:`#13233f`,fill:`#dbe5f5`},state:{warn:{stroke:`#a16207`,fill:`#fdf6e3`},stop:{stroke:`#9a1b1b`,fill:`#fbecec`},done:{stroke:`#1f6f43`,fill:`#e8f4ec`}},note:{stroke:`none`,fill:`#f4f7fc`,fold:`#8aa0c4`},stage:{fill:`#f4f7fc`,stroke:`#c7d2e4`,title:`#2d4366`},stageLit:{fill:`#eaf0fb`,stroke:`#1f3f7f`,title:`#1f3f7f`},link:C(b,{main:{stroke:`#13233f`},plain:{stroke:`#2d4366`},back:{stroke:`#5b6f8f`}})},justify:{node:C(x,{conclusion:{stroke:`#1f3f7f`,fill:`#e3ecfa`},norm:{stroke:`#4b3a8c`,fill:`#efecf8`},element:{stroke:`#2f5aa8`,fill:`#eef3fb`},fact:{stroke:`#8aa0c4`,fill:`#f8fafd`},inference:{stroke:`#1d6b6b`,fill:`#e8f4f4`},judgement:{stroke:`#13233f`,fill:`#dbe5f5`}}),stance:C(S,{for:{stroke:`#2d4366`},against:{stroke:`#9a1b1b`},basis:{stroke:`#4b3a8c`}})},pill:{colored:!0,border:`#c7d2e4`}}},T=e=>Object.prototype.hasOwnProperty.call(w,e);function E(n,{kind:r,theme:i}={}){let a=e(n);if(a.length)throw Object.assign(Error(`antu: the spec is not valid (${a.length} problem(s)): ${a[0]}`),{errors:[...a]});let o=t(n,r);if(o)throw Error(`antu: ${o}`);if(i!==void 0&&!T(i))throw Error(`antu: the theme is one of ${h.join(`, `)}`);return m(n,{preset:r||i?{...r&&{defaultKind:r},...i&&{theme:i}}:void 0,quiet:!0})}export{E as renderHtml};
package/lib/validate.d.ts CHANGED
@@ -33,6 +33,8 @@ export interface NormalizeResult {
33
33
 
34
34
  /** Repair what is inconsistent in the marks of a spec but not in its content (a procedure's main line). Call it before `validate` */
35
35
  export function normalize(spec: unknown): NormalizeResult
36
+ /** The field table of one type, the text `antu_schema` serves; `reason` names the available types when the type is unknown */
37
+ export function describe(type?: string): { ok: true; text: string } | { ok: false; reason: string }
36
38
  /** Each type and its kinds, the first kind being the one a diagram opens in */
37
39
  export function kinds(): Record<string, string[]>
38
40
  export function versions(): VersionsReport
package/lib/validate.mjs CHANGED
@@ -1,4 +1,4 @@
1
- // Antu 0.13.1
1
+ // Antu 0.15.0
2
2
  // Copyright (C) 2026 Ji Cheng
3
3
  //
4
4
  // Antu is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public
@@ -12,9 +12,9 @@
12
12
  // publish them, or sell them on any terms you like. This licence covers Antu's code in the page, and the notices in
13
13
  // the page must stay with it.
14
14
  //
15
- // Corresponding Source of this version: https://github.com/zh-xx/Antu/tree/v0.13.1
16
- // The licence: https://github.com/zh-xx/Antu/blob/v0.13.1/LICENSE
17
- // Third-party notices: https://github.com/zh-xx/Antu/blob/v0.13.1/skills/antu/THIRD-PARTY-NOTICES.md
15
+ // Corresponding Source of this version: https://github.com/zh-xx/Antu/tree/v0.15.0
16
+ // The licence: https://github.com/zh-xx/Antu/blob/v0.15.0/LICENSE
17
+ // Third-party notices: https://github.com/zh-xx/Antu/blob/v0.15.0/skills/antu/THIRD-PARTY-NOTICES.md
18
18
  //
19
19
  // === The licence of Antu ===
20
20
  //
@@ -1422,4 +1422,4 @@
1422
1422
  // SOFTWARE.
1423
1423
  // ````
1424
1424
  //
1425
- import{a as e,c as t,d as n,i as r,l as i,n as a,r as o,t as s,u as c}from"./chunks/report-BTsYMUG2.mjs";function l(e,r){return{release:e,types:n().map(e=>e.type).filter(e=>!r||e===r).map(e=>({type:e,specVersion:i(e).specVersion,diagrams:t(e).map(({kind:e,version:t,status:n,since:r})=>({kind:e,version:t,status:n,since:r}))}))}}function u(e){if(typeof e!=`object`||!e||Array.isArray(e))return{spec:e,changes:[]};let t=structuredClone(e),n=typeof t.type==`string`?i(t.type)?.normalize:void 0;return{spec:t,changes:n?[...n(t)]:[]}}var d=`0.13.1`;function f(t){let n=e(t);return{ok:n.length===0,errors:[...n],notes:n.length?[]:[...r(t)]}}function p(t,{kind:n,orientation:r}={}){let i=e(t);if(i.length)return{ok:!1,reason:`the spec is not valid`,errors:[...i]};let c=a(t,n);if(c)return{ok:!1,reason:c};let l=o(t,{kind:n,orientation:r});return l.ok?{...l,text:s(l)}:l}function m(e){return u(e)}function h(){return Object.fromEntries(n().map(({type:e})=>[e,c(e)]))}function g(){return l(d)}export{h as kinds,p as layout,m as normalize,f as validate,g as versions};
1425
+ import{a as e,c as t,d as n,f as r,i,l as a,n as o,r as s,t as c,u as l}from"./chunks/report-2s3R1IjI.mjs";function u(e,t){return{release:e,types:r().map(e=>e.type).filter(e=>!t||e===t).map(e=>({type:e,specVersion:l(e).specVersion,diagrams:a(e).map(({kind:e,version:t,status:n,since:r})=>({kind:e,version:t,status:n,since:r}))}))}}function d(e){if(typeof e!=`object`||!e||Array.isArray(e))return{spec:e,changes:[]};let t=structuredClone(e),n=typeof t.type==`string`?l(t.type)?.normalize:void 0;return{spec:t,changes:n?[...n(t)]:[]}}var f=`0.15.0`;function p(t){let n=e(t);return{ok:n.length===0,errors:[...n],notes:n.length?[]:[...i(t)]}}function m(t,{kind:n,orientation:r}={}){let i=e(t);if(i.length)return{ok:!1,reason:`the spec is not valid`,errors:[...i]};let a=o(t,n);if(a)return{ok:!1,reason:a};let l=s(t,{kind:n,orientation:r});return l.ok?{...l,text:c(l)}:l}function h(e){return d(e)}function g(e=`fact`){let t=l(e);return t?{ok:!0,text:t.describe()}:{ok:!1,reason:_(e)}}function _(e){return`no reference material for type "${e}" yet. Available: ${r().map(e=>`${e.type} (${t(e.labelKey)})`).join(`, `)||`(none)`}.`}function v(){return Object.fromEntries(r().map(({type:e})=>[e,n(e)]))}function y(){return u(f)}export{g as describe,v as kinds,m as layout,h as normalize,p as validate,y as versions};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zh-xx/antu",
3
- "version": "0.13.1",
3
+ "version": "0.15.0",
4
4
  "description": "Antu: legal diagrams (fact, procedure, relationship, justification) from JSON, as one offline HTML page. The command line, the MCP server, and the entries to embed a diagram in an application.",
5
5
  "license": "AGPL-3.0-or-later",
6
6
  "author": "Ji Cheng",
package/server.json CHANGED
@@ -6,12 +6,12 @@
6
6
  "url": "https://github.com/zh-xx/Antu",
7
7
  "source": "github"
8
8
  },
9
- "version": "0.13.1",
9
+ "version": "0.15.0",
10
10
  "packages": [
11
11
  {
12
12
  "registryType": "npm",
13
13
  "identifier": "@zh-xx/antu",
14
- "version": "0.13.1",
14
+ "version": "0.15.0",
15
15
  "transport": {
16
16
  "type": "stdio"
17
17
  }
@@ -99,8 +99,8 @@ delivering.
99
99
 
100
100
  - **Referenced ids must exist**: `stageId`, `actorIds`, `sourceIds`, an edge's `from` /
101
101
  `to`, a rule's `stageIds` / `endId`.
102
- - **Keep labels short.** A node shows about three lines of `label`; put the rest in
103
- `detail` (its first line shows under the label, all of it on click).
102
+ - **A `note` explains, it is not a step** (why an argument fails, what the evidence lacked): one full sentence, in `detail` when long. It is drawn dashed with a small tag; `validate` hints at a bare short phrase with no `detail`.
103
+ - **Keep labels short.** A node shows two lines of `label` (about 20 Chinese characters), the rest is cut (`validate` hints, `⋯` marks it). Put amounts, periods and conditions in `detail`: its first line (about 16 Chinese characters) shows, all of it on click.
104
104
 
105
105
  ## Another way to look at it
106
106