@kanonak-protocol/sdk 5.35.0 → 5.36.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.
Files changed (37) hide show
  1. package/dist/browser.d.ts +3 -1
  2. package/dist/browser.js +1 -1
  3. package/dist/{chunk-26SO3A4B.js → chunk-4QXD6HKI.js} +1 -1
  4. package/dist/chunk-6TEJENCD.js +68 -0
  5. package/dist/chunk-7TU55KLO.js +1 -0
  6. package/dist/{chunk-O35Y6QUW.js → chunk-H7SX57L7.js} +1 -1
  7. package/dist/{chunk-ZYDJUGIA.js → chunk-IN5VVPYH.js} +1 -1
  8. package/dist/chunk-Q2FG7DME.js +1 -0
  9. package/dist/chunk-ROKDCCJN.js +155 -0
  10. package/dist/{chunk-2Y6R3K5A.js → chunk-VENZTHCC.js} +1 -1
  11. package/dist/chunk-XNEWQEB6.js +1 -0
  12. package/dist/{chunk-VEGFYZXG.js → chunk-YBHIELES.js} +1 -1
  13. package/dist/index.d.ts +3 -1
  14. package/dist/index.js +1 -1
  15. package/dist/kanonaks/LiteralKanonak.d.ts +10 -0
  16. package/dist/kanonaks/walkDefinedKanonaks.d.ts +23 -18
  17. package/dist/parsing/KanonakObjectParser.d.ts +8 -0
  18. package/dist/parsing/index.js +1 -1
  19. package/dist/producer/index.js +1 -1
  20. package/dist/reasoning/index.js +1 -1
  21. package/dist/resolution/index.js +1 -1
  22. package/dist/search/index.js +1 -1
  23. package/dist/server/index.js +1 -1
  24. package/dist/transformations/index.js +1 -1
  25. package/dist/transformations/v3/TransformationLoaderV3.d.ts +8 -2
  26. package/dist/uri-helpers/PropertyValues.d.ts +34 -3
  27. package/dist/uri-helpers/UriHelpers.d.ts +3 -0
  28. package/dist/uri-helpers/index.d.ts +1 -1
  29. package/dist/uri-helpers/index.js +1 -1
  30. package/dist/validation/index.js +1 -1
  31. package/dist/validation/rules/repository/MarkdownLinkRule.d.ts +1 -0
  32. package/package.json +2 -2
  33. package/dist/chunk-54D47DLS.js +0 -1
  34. package/dist/chunk-AVVLDZAZ.js +0 -68
  35. package/dist/chunk-D7QLWVPK.js +0 -155
  36. package/dist/chunk-JHQPXEMA.js +0 -1
  37. package/dist/chunk-MQBWSCNY.js +0 -1
@@ -0,0 +1 @@
1
+ import{a as S}from"./chunk-FUUTGGJS.js";import{c as A,g as v}from"./chunk-QILEJIFU.js";var p=class{};var f=class extends p{statement=[];unresolvedPredicates=[];sourceDoc=""};var l=class extends f{namespace;name;icon};var k=class extends f{name;rangeType};var s=class e extends p{subject;static parse(n){let t=new e;return t.subject=S.parse(n),t}};var $=class extends p{value;carrier;lexical;links};var m=class{predicate;object};var d=class extends m{carrier;lexical};var b=class e extends d{static parse(n,t){let r=new e;return r.predicate=s.parse(n),r.object=t,r}};var K=class e extends d{static parse(n,t){let r=new e;return r.predicate=s.parse(n),r.object=t,r}};var x=class extends d{};var y=class e extends m{static parse(n,t){let r=new e;return r.predicate=s.parse(n),r.object=s.parse(t),r}};var h=class extends m{};var j=class extends m{};var U=class extends b{links=[]};function E(e){return`${e.publisher}/${e.package_}/${e.name}`}function w(e,n){return e.publisher===n.publisher&&e.package_===n.package_&&e.name===n.name}function C(e){let n=e.version;return n&&typeof n.major=="number"?`https://${e.publisher}/${e.package_}/${n.major}.${n.minor}.${n.patch}/${e.name}`:`https://${e.publisher}/${e.package_}/${e.name}`}function T(e){return L(e,B)}var B={publisher:"kanonak.org",package_:"core-rdf",name:"type"};function L(e,n){let t=[];for(let r of D(e,n))r.item instanceof s&&t.push(r.item.subject);return t}function D(e,n){if(!(e instanceof f))return[];let t=[];for(let r of e.statement){let a=r.predicate;if(!(!a?.subject||!w(a.subject,n)))if(r instanceof y)t.push({item:r.object,fromList:!1});else if(r instanceof h)t.push({item:r.object,fromList:!1});else if(r instanceof U)t.push({item:{literal:!0,value:r.object,carrier:r.carrier,lexical:r.lexical,links:r.links},fromList:!1});else if(r instanceof b||r instanceof K||r instanceof x)t.push({item:{literal:!0,value:r.object,carrier:r.carrier,lexical:r.lexical},fromList:!1});else if(r instanceof j)for(let o of r.object??[])if(o instanceof s||o instanceof k)t.push({item:o,fromList:!0});else if(o instanceof $)t.push({item:{literal:!0,value:o.value,carrier:o.carrier,lexical:o.lexical,links:o.links},fromList:!0});else throw new Error(`rawValuesOf: a list value of '${n.name}' is a ${o?.constructor?.name??typeof o}; list items are references, embedded values or literals.`);else throw new Error(`rawValuesOf: '${n.name}' has a statement of unknown kind ${r?.constructor?.name??typeof r}.`)}return t}function I(e,n){if(!(e instanceof f))return!1;for(let t of e.statement)if(t.predicate?.subject?.name==="type"&&t instanceof y){let a=t.object;if(w(a.subject,n))return!0}return!1}function N(e,n){let t=[];for(let r of e)r instanceof l&&I(r,n)&&t.push(r);return t}function H(e,n){let t=n.version,r=t&&typeof t.major=="number"?`${n.publisher}/${n.package_}@${t.major}.${t.minor}.${t.patch}`:void 0;for(let a of e){if(!(a instanceof l)||a.name!==n.name)continue;let o=a.namespace||"";if(r!==void 0){if(o===r)return a}else if(o.startsWith(`${n.publisher}/${n.package_}@`))return a}}function W(e,n){let t=[];for(let r of e){if(!(r instanceof l)||r.name!==n.name)continue;(r.namespace||"").startsWith(`${n.publisher}/${n.package_}@`)&&t.push(r)}return t.sort((r,a)=>{let o=v((r.namespace||"").split("@")[1]??""),i=v((a.namespace||"").split("@")[1]??"");return o?i?A(i,o):-1:i?1:0}),t}function g(e,n){for(let t of e.statement){let r=t.predicate;if(r?.subject&&w(r.subject,n))return t}}function q(e,n){return g(e,n)!==void 0}function M(e,n){let t=g(e,n);if(t&&(t instanceof b||t instanceof K||t instanceof x))return t.object}function F(e,n){let t=M(e,n);return typeof t=="string"?t:void 0}function Y(e,n){let t=g(e,n);if(t instanceof y)return t.object.subject}function z(e,n){let t=g(e,n);if(t instanceof h)return t.object}function G(e,n){let t=g(e,n);return t instanceof j?t.object??[]:[]}function _(e){if(!e||e.trim().length===0)throw new Error("Kanonak address string cannot be null or empty");let n=e.trim(),t=n.split("/");if(t.length===1){let r=t[0];if(!r)throw new Error(`Invalid Kanonak address: "${e}". Expected publisher, publisher/package[@version], or publisher/package[@version]/name.`);if(r.includes("@"))throw new Error(`Invalid Kanonak address: "${e}". A bare publisher cannot carry an @version qualifier \u2014 versions belong to packages.`);return{kind:"publisher",publisher:r}}if(t.length===2){let[r,a]=t;if(!r||!a)throw new Error(`Invalid Kanonak address: "${e}". Expected publisher/package[@version].`);let o=a.indexOf("@");if(o===-1)return{kind:"package",publisher:r,package_:a};let i=a.substring(0,o),c=a.substring(o+1);if(!i||!c)throw new Error(`Invalid Kanonak address: "${e}". Expected publisher/package[@version].`);let u=J(c);return{kind:"package",publisher:r,package_:i,version:u}}return{kind:"resource",uri:S.parse(n)}}function Ge(e){switch(e.kind){case"publisher":return e.publisher;case"package":return e.version?`${e.publisher}/${e.package_}@${e.version.major}.${e.version.minor}.${e.version.patch}`:`${e.publisher}/${e.package_}`;case"resource":return e.uri.toString()}}function J(e){let n=e.split(".").map(Number);return Q(n[0]||0,n[1]||0,n[2]||0)}function Q(e,n,t){return{major:e,minor:n,patch:t,toString:()=>`${e}.${n}.${t}`,equals:r=>!r||typeof r!="object"?!1:r.major===e&&r.minor===n&&r.patch===t,getHashCode:()=>e<<20|n<<10|t,compareTo:r=>e!==r.major?e-r.major:n!==r.minor?n-r.minor:t-r.patch}}function X(e,n,t,r){let a=ee(e,n,r);if(a.length===0)return[];let o=ne(t);return a.map(({value:i,address:c})=>{let u=i.fromList;if(i.item instanceof s){let P=o.resolve(i.item.subject);return P?{kind:"subject",node:P,uri:i.item.subject,address:c,fromList:u}:{kind:"unresolved",uri:i.item.subject,address:c,fromList:u}}if(i.item instanceof k)return{kind:"embedded",node:i.item,address:c,fromList:u};let V={kind:"literal",value:i.item.value,carrier:i.item.carrier,lexical:i.item.lexical,address:c,fromList:u};return i.item.links&&(V.links=i.item.links),V})}function Z(e){let n=_(`${e.namespace}/${e.name}`);if(n.kind!=="resource")throw new Error(`subjectAddress: '${e.namespace}/${e.name}' is not a resource address`);return E(n.uri)}function ee(e,n,t){let r=D(e,n);if(r.length===0)return[];let a=t.includes("#")?`${t}.${n.name}`:`${t}#${n.name}`,o=r.length>1||r.some(i=>i.fromList);return r.map((i,c)=>({value:i,address:i.item instanceof k&&i.item.name?`${a}.${i.item.name}`:o?`${a}[${c}]`:a}))}var O=new WeakMap;function ne(e){let n=O.get(e);if(n)return n;let t=new Map,r=new Map;for(let a of e){if(!(a instanceof l))continue;let o=a.namespace||"",i=`${o}\0${a.name}`;t.has(i)||t.set(i,a);let c=o.indexOf("@");if(c>=0){let u=`${o.slice(0,c)}\0${a.name}`;r.has(u)||r.set(u,a)}}return n={resolve(a){let o=a.version;return o&&typeof o.major=="number"?t.get(`${a.publisher}/${a.package_}@${o.major}.${o.minor}.${o.patch}\0${a.name}`):r.get(`${a.publisher}/${a.package_}\0${a.name}`)}},O.set(e,n),n}var R=class{constructor(n,t){this.doc=n;this.broader=t}doc;broader;async getAllDocumentsAsync(){return[this.doc]}async getDocumentAsync(n){return this.broader.getDocumentAsync(n)}async getDocumentsByNamespaceAsync(n,t){return this.broader.getDocumentsByNamespaceAsync(n,t)}async getHighestCompatibleVersionAsync(n,t){return this.broader.getHighestCompatibleVersionAsync(n,t)}async saveDocumentAsync(){throw new Error("SingleDocumentRepository is read-only")}async deleteDocumentAsync(){throw new Error("SingleDocumentRepository is read-only")}async clearNamespaceAsync(){throw new Error("SingleDocumentRepository is read-only")}async getAllDocumentReferencesAsync(){return[]}async getDocumentContentAsync(n){return this.broader.getDocumentContentAsync(n)}async getDocumentUriAsync(n){return this.broader.getDocumentUriAsync(n)}};export{p as a,f as b,l as c,k as d,s as e,$ as f,m as g,d as h,b as i,K as j,x as k,y as l,h as m,j as n,U as o,_ as p,Ge as q,E as r,w as s,C as t,T as u,L as v,D as w,I as x,N as y,H as z,W as A,g as B,q as C,M as D,F as E,Y as F,z as G,G as H,X as I,Z as J,ee as K,R as L};
@@ -1,2 +1,2 @@
1
- import{j as V}from"./chunk-JHQPXEMA.js";import{a as E}from"./chunk-HF5FJBS2.js";var L=class{propertyUri;propertyType;range;rangeUri;isImported;definedInNamespace};import{parseDocument as O,LineCounter as R,isMap as h,isPair as f,isScalar as g,isSeq as I}from"yaml";var K=class i{entities=new Map;entityBlocks=new Map;properties=new Map;propertyValues=new Map;valueListItems=new Map;importPackages=new Map;nestedKeys=new Map;nestedValues=new Map;static fromContent(e){let t=new i,n=new R,r=O(e,{lineCounter:n});if(r.errors.length>0||!h(r.contents))return t;N(r.contents,[],n,t);for(let o of r.contents.items){if(!f(o)||!g(o.key))continue;let a=String(o.key.value),u=o.key.range;if(!u)continue;t.entities.set(a,d(u,n));let s=o.value,c=s&&typeof s=="object"&&"range"in s?s.range:void 0;if(c?t.entityBlocks.set(a,d([u[0],u[1],c[2]],n)):t.entityBlocks.set(a,d(u,n)),h(o.value)){let k=new Map,m=new Map,l=new Map;for(let P of o.value.items){if(!f(P)||!g(P.key))continue;let b=String(P.key.value),p=P.key.range;p&&k.set(b,d(p,n));let S=P.value;if(S&&typeof S=="object"&&"range"in S&&Array.isArray(S.range)){let v=S.range;m.set(b,d(v,n))}if(I(S)){let v=[];for(let M of S.items)M&&typeof M=="object"&&"range"in M&&Array.isArray(M.range)&&v.push(d(M.range,n));v.length>0&&l.set(b,v)}}k.size>0&&t.properties.set(a,k),m.size>0&&t.propertyValues.set(a,m),l.size>0&&t.valueListItems.set(a,l);let y=j(o.value,n);y.length>0&&t.importPackages.set(a,y)}}return t}getEntityPosition(e){return this.entities.get(e)}getEntityBlockPosition(e){return this.entityBlocks.get(e)}findEntityAtPosition(e,t){for(let[n,r]of this.entityBlocks)if(w(r,e,t))return n}findPropertyAtPosition(e,t){let n=this.findEntityAtPosition(e,t);if(!n)return;let r=this.properties.get(n),o=this.propertyValues.get(n);if(!r&&!o)return{entityName:n};let a,u;if(o)for(let[s,c]of o)w(c,e,t)&&(!u||C(c,u))&&(a=s,u=c);if(r)for(let[s,c]of r)w(c,e,t)&&(!u||C(c,u))&&(a=s,u=c);return a?{entityName:n,propertyName:a}:{entityName:n}}getPropertyPosition(e,t){return this.properties.get(e)?.get(t)}getPropertyValuePosition(e,t){return this.propertyValues.get(e)?.get(t)}getImportPackages(e){return this.importPackages.get(e)??[]}getAllImportPackages(){let e=[];for(let[t,n]of this.importPackages)for(let r of n)e.push({entityName:t,entry:r});return e}findPropertySourceName(e,t){let n=this.properties.get(e);if(n){if(n.has(t))return t;for(let r of n.keys()){let o=r.lastIndexOf(".");if((o===-1?r:r.substring(o+1))===t)return r}}}getListItemPosition(e,t,n){let r=this.valueListItems.get(e)?.get(t);if(!(!r||n<0||n>=r.length))return r[n]}getNodeKeyPosition(e){return this.nestedKeys.get(JSON.stringify(e))}getNodeValuePosition(e){return this.nestedValues.get(JSON.stringify(e))}setNestedKeyPosition(e,t){this.nestedKeys.set(e,t)}setNestedValuePosition(e,t){this.nestedValues.set(e,t)}getMostSpecificPosition(e,t,n){if(e){if(t!==void 0){if(n!==void 0){let a=this.getListItemPosition(e,t,n);if(a)return a}let r=this.getPropertyValuePosition(e,t);if(r)return r;let o=this.getPropertyPosition(e,t);if(o)return o}return this.getEntityPosition(e)}}};function j(i,e){let t=[];if(!h(i))return t;let n=i.items.find(r=>f(r)&&g(r.key)&&String(r.key.value)==="imports");if(!n||!f(n)||!I(n.value))return t;for(let r of n.value.items){if(!h(r))continue;let o=r.items.find(s=>f(s)&&g(s.key)&&String(s.key.value)==="publisher");if(!o||!f(o)||!g(o.value))continue;let a=String(o.value.value),u=r.items.find(s=>f(s)&&g(s.key)&&String(s.key.value)==="packages");if(!(!u||!f(u)||!I(u.value)))for(let s of u.value.items){if(!h(s))continue;let c=s.items.find(p=>f(p)&&g(p.key)&&String(p.key.value)==="package");if(!c||!f(c)||!g(c.value)||!c.value.range)continue;let k=String(c.value.value),m=s.items.find(p=>f(p)&&g(p.key)&&String(p.key.value)==="version"),l=m&&f(m)&&g(m.value)?String(m.value.value):"",y=s.items.find(p=>f(p)&&g(p.key)&&String(p.key.value)==="alias"),P=y&&f(y)&&g(y.value)?String(y.value.value):void 0,b=P!==void 0?{publisher:a,package_:k,version:l,alias:P,position:d(c.value.range,e)}:{publisher:a,package_:k,version:l,position:d(c.value.range,e)};t.push(b)}}return t}function w(i,e,t){return!(e<i.line||e>i.endLine||e===i.line&&t<i.column||e===i.endLine&&t>i.endColumn)}function C(i,e){let t=i.endLine-i.line,n=e.endLine-e.line;if(t!==n)return t<n;let r=i.endLine===i.line?i.endColumn-i.column:Number.MAX_SAFE_INTEGER,o=e.endLine===e.line?e.endColumn-e.column:Number.MAX_SAFE_INTEGER;return r<o}function N(i,e,t,n){if(h(i)){for(let r of i.items){if(!f(r)||!g(r.key))continue;let o=String(r.key.value),a=[...e,o],u=JSON.stringify(a);r.key.range&&n.setNestedKeyPosition(u,d(r.key.range,t));let s=r.value,c=D(s);c&&n.setNestedValuePosition(u,d(c,t)),N(s,a,t,n)}return}if(I(i)){for(let r=0;r<i.items.length;r++){let o=i.items[r],a=[...e,r],u=JSON.stringify(a),s=D(o);s&&n.setNestedValuePosition(u,d(s,t)),N(o,a,t,n)}return}}function D(i){if(!i||typeof i!="object"||!("range"in i))return;let e=i.range;return Array.isArray(e)&&e.length>=3?e:void 0}function d(i,e){let t=e.linePos(i[0]),n=e.linePos(i[2]);return{line:t.line-1,column:t.col-1,endLine:n.line-1,endColumn:n.col-1}}function x(i,e){let n=(e??new E).parse(i),r=K.fromContent(i);return{document:n,positions:r}}function W(i,e,t,n,r){if(e<n.line||e>n.endLine||e===n.line&&t<n.column||e===n.endLine&&t>=n.endColumn)return;let o=A(r,n.line,n.column),a=A(r,n.endLine,n.endColumn);if(o<0||a<0)return;let u=r.substring(o,a),s=V(u);if(s.length!==i.links.length)return;let c=e-n.line,k=e===n.line?t-n.column:t,m=A(u,c,k);if(!(m<0))for(let l=0;l<s.length;l++){let y=s[l];if(m>=y.startOffset&&m<y.endOffset)return i.links[l]}}function A(i,e,t){let n=0,r=0;for(let o=0;o<i.length;o++){if(n===e)return Math.min(r+t,i.length);i[o]===`
1
+ import{i as V}from"./chunk-Q2FG7DME.js";import{a as E}from"./chunk-HF5FJBS2.js";var L=class{propertyUri;propertyType;range;rangeUri;isImported;definedInNamespace};import{parseDocument as O,LineCounter as R,isMap as h,isPair as f,isScalar as g,isSeq as I}from"yaml";var K=class i{entities=new Map;entityBlocks=new Map;properties=new Map;propertyValues=new Map;valueListItems=new Map;importPackages=new Map;nestedKeys=new Map;nestedValues=new Map;static fromContent(e){let t=new i,n=new R,r=O(e,{lineCounter:n});if(r.errors.length>0||!h(r.contents))return t;N(r.contents,[],n,t);for(let o of r.contents.items){if(!f(o)||!g(o.key))continue;let a=String(o.key.value),u=o.key.range;if(!u)continue;t.entities.set(a,d(u,n));let s=o.value,c=s&&typeof s=="object"&&"range"in s?s.range:void 0;if(c?t.entityBlocks.set(a,d([u[0],u[1],c[2]],n)):t.entityBlocks.set(a,d(u,n)),h(o.value)){let k=new Map,m=new Map,l=new Map;for(let P of o.value.items){if(!f(P)||!g(P.key))continue;let b=String(P.key.value),p=P.key.range;p&&k.set(b,d(p,n));let S=P.value;if(S&&typeof S=="object"&&"range"in S&&Array.isArray(S.range)){let v=S.range;m.set(b,d(v,n))}if(I(S)){let v=[];for(let M of S.items)M&&typeof M=="object"&&"range"in M&&Array.isArray(M.range)&&v.push(d(M.range,n));v.length>0&&l.set(b,v)}}k.size>0&&t.properties.set(a,k),m.size>0&&t.propertyValues.set(a,m),l.size>0&&t.valueListItems.set(a,l);let y=j(o.value,n);y.length>0&&t.importPackages.set(a,y)}}return t}getEntityPosition(e){return this.entities.get(e)}getEntityBlockPosition(e){return this.entityBlocks.get(e)}findEntityAtPosition(e,t){for(let[n,r]of this.entityBlocks)if(w(r,e,t))return n}findPropertyAtPosition(e,t){let n=this.findEntityAtPosition(e,t);if(!n)return;let r=this.properties.get(n),o=this.propertyValues.get(n);if(!r&&!o)return{entityName:n};let a,u;if(o)for(let[s,c]of o)w(c,e,t)&&(!u||C(c,u))&&(a=s,u=c);if(r)for(let[s,c]of r)w(c,e,t)&&(!u||C(c,u))&&(a=s,u=c);return a?{entityName:n,propertyName:a}:{entityName:n}}getPropertyPosition(e,t){return this.properties.get(e)?.get(t)}getPropertyValuePosition(e,t){return this.propertyValues.get(e)?.get(t)}getImportPackages(e){return this.importPackages.get(e)??[]}getAllImportPackages(){let e=[];for(let[t,n]of this.importPackages)for(let r of n)e.push({entityName:t,entry:r});return e}findPropertySourceName(e,t){let n=this.properties.get(e);if(n){if(n.has(t))return t;for(let r of n.keys()){let o=r.lastIndexOf(".");if((o===-1?r:r.substring(o+1))===t)return r}}}getListItemPosition(e,t,n){let r=this.valueListItems.get(e)?.get(t);if(!(!r||n<0||n>=r.length))return r[n]}getNodeKeyPosition(e){return this.nestedKeys.get(JSON.stringify(e))}getNodeValuePosition(e){return this.nestedValues.get(JSON.stringify(e))}setNestedKeyPosition(e,t){this.nestedKeys.set(e,t)}setNestedValuePosition(e,t){this.nestedValues.set(e,t)}getMostSpecificPosition(e,t,n){if(e){if(t!==void 0){if(n!==void 0){let a=this.getListItemPosition(e,t,n);if(a)return a}let r=this.getPropertyValuePosition(e,t);if(r)return r;let o=this.getPropertyPosition(e,t);if(o)return o}return this.getEntityPosition(e)}}};function j(i,e){let t=[];if(!h(i))return t;let n=i.items.find(r=>f(r)&&g(r.key)&&String(r.key.value)==="imports");if(!n||!f(n)||!I(n.value))return t;for(let r of n.value.items){if(!h(r))continue;let o=r.items.find(s=>f(s)&&g(s.key)&&String(s.key.value)==="publisher");if(!o||!f(o)||!g(o.value))continue;let a=String(o.value.value),u=r.items.find(s=>f(s)&&g(s.key)&&String(s.key.value)==="packages");if(!(!u||!f(u)||!I(u.value)))for(let s of u.value.items){if(!h(s))continue;let c=s.items.find(p=>f(p)&&g(p.key)&&String(p.key.value)==="package");if(!c||!f(c)||!g(c.value)||!c.value.range)continue;let k=String(c.value.value),m=s.items.find(p=>f(p)&&g(p.key)&&String(p.key.value)==="version"),l=m&&f(m)&&g(m.value)?String(m.value.value):"",y=s.items.find(p=>f(p)&&g(p.key)&&String(p.key.value)==="alias"),P=y&&f(y)&&g(y.value)?String(y.value.value):void 0,b=P!==void 0?{publisher:a,package_:k,version:l,alias:P,position:d(c.value.range,e)}:{publisher:a,package_:k,version:l,position:d(c.value.range,e)};t.push(b)}}return t}function w(i,e,t){return!(e<i.line||e>i.endLine||e===i.line&&t<i.column||e===i.endLine&&t>i.endColumn)}function C(i,e){let t=i.endLine-i.line,n=e.endLine-e.line;if(t!==n)return t<n;let r=i.endLine===i.line?i.endColumn-i.column:Number.MAX_SAFE_INTEGER,o=e.endLine===e.line?e.endColumn-e.column:Number.MAX_SAFE_INTEGER;return r<o}function N(i,e,t,n){if(h(i)){for(let r of i.items){if(!f(r)||!g(r.key))continue;let o=String(r.key.value),a=[...e,o],u=JSON.stringify(a);r.key.range&&n.setNestedKeyPosition(u,d(r.key.range,t));let s=r.value,c=D(s);c&&n.setNestedValuePosition(u,d(c,t)),N(s,a,t,n)}return}if(I(i)){for(let r=0;r<i.items.length;r++){let o=i.items[r],a=[...e,r],u=JSON.stringify(a),s=D(o);s&&n.setNestedValuePosition(u,d(s,t)),N(o,a,t,n)}return}}function D(i){if(!i||typeof i!="object"||!("range"in i))return;let e=i.range;return Array.isArray(e)&&e.length>=3?e:void 0}function d(i,e){let t=e.linePos(i[0]),n=e.linePos(i[2]);return{line:t.line-1,column:t.col-1,endLine:n.line-1,endColumn:n.col-1}}function x(i,e){let n=(e??new E).parse(i),r=K.fromContent(i);return{document:n,positions:r}}function W(i,e,t,n,r){if(e<n.line||e>n.endLine||e===n.line&&t<n.column||e===n.endLine&&t>=n.endColumn)return;let o=A(r,n.line,n.column),a=A(r,n.endLine,n.endColumn);if(o<0||a<0)return;let u=r.substring(o,a),s=V(u);if(s.length!==i.links.length)return;let c=e-n.line,k=e===n.line?t-n.column:t,m=A(u,c,k);if(!(m<0))for(let l=0;l<s.length;l++){let y=s[l];if(m>=y.startOffset&&m<y.endOffset)return i.links[l]}}function A(i,e,t){let n=0,r=0;for(let o=0;o<i.length;o++){if(n===e)return Math.min(r+t,i.length);i[o]===`
2
2
  `&&(n++,r=o+1)}return n===e?Math.min(r+t,i.length):-1}export{L as a,K as b,x as c,W as d};
package/dist/index.d.ts CHANGED
@@ -42,5 +42,7 @@ export { canonicalForm, canonicalHash, CANONICAL_FORM_VERSION, Carrier, carrierO
42
42
  export type { CanonicalInput, CanonicalInputSubject, CanonicalInputStatement, CanonicalInputValue, } from './canonical/index.js';
43
43
  export { buildOntologyModel } from './introspection/index.js';
44
44
  export type { OntologyModel, ClassDef, PropertyDef, ClassRef, TypeRef, EnumDef, EnumMember, BuildOntologyModelOptions, } from './introspection/index.js';
45
- export { valuesOf, referenceUris, typeReferenceUris } from './uri-helpers/index.js';
45
+ export { valuesOf, referenceUris, typeReferenceUris, subjectAddress } from './uri-helpers/index.js';
46
46
  export type { PropertyValue } from './uri-helpers/index.js';
47
+ export { walkDefinedKanonaks } from './kanonaks/walkDefinedKanonaks.js';
48
+ export type { WalkNode } from './kanonaks/walkDefinedKanonaks.js';
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{a as it,b as st,c as ct,d as ut,e as B}from"./chunk-26SO3A4B.js";import{a as In,b as Vn,c as Ln}from"./chunk-V3DH67P3.js";import{a as tt,b as rt,c as at,d as mr,e as hr,f as kr,g as Sr,h as yr,i as gr}from"./chunk-O35Y6QUW.js";import{a as br}from"./chunk-ZYDJUGIA.js";import{a as ur,b as dr,c as lr,d as G,e as pr,f as fr,g as xe,h as Er,i as Rr,j as Cr,k as Kr,l as xr}from"./chunk-2Y6R3K5A.js";import{a as lo,b as po,c as fo,d as mo,e as ho,f as _o,g as Po,h as vo,i as Io}from"./chunk-IS3AQKB4.js";import{a as ko,b as So,c as yo,d as go,e as bo,f as Eo,h as Ro,i as Ae,j as $e,k as Me,l as je,m as Co,n as xo}from"./chunk-BZ3YTI3C.js";import{a as lt,b as pt,c as ft,d as mt}from"./chunk-VEGFYZXG.js";import{a as ht}from"./chunk-XK24CN3C.js";import{a as Ko}from"./chunk-SC5M74NM.js";import{A as Tt,B as qt,C as Wt,D as Bt,E as Gt,F as zt,G as or,H as tr,I as rr,J as ar,K as ir,L as sr,M as cr,a as St,b as yt,c as gt,d as bt,e as Et,f as Rt,g as Ct,h as Kt,i as xt,j as _t,k as Pt,l as vt,m as It,n as Vt,o as Lt,p as Nt,q as Ot,r as wt,s as Ut,t as At,u as $t,v as Mt,w as jt,x as Dt,y as Ft,z as Ht}from"./chunk-AVVLDZAZ.js";import"./chunk-KIBR3HAT.js";import{c as _n,d as Qt,e as Xt,g as Yt,h as Jt,k as Zt,m as Ke,o as Pn,p as vn,r as er,s as nr}from"./chunk-D7QLWVPK.js";import"./chunk-QHABFCRC.js";import{a as fe}from"./chunk-6VIUXP4N.js";import{a as Ho,g as L,h as Ce,i as nt,j as ot,k as A}from"./chunk-JHQPXEMA.js";import{a as j}from"./chunk-HF5FJBS2.js";import{a as kt}from"./chunk-PEJALHXK.js";import{$ as ge,A as Ye,B as Je,C as Ze,D as en,E as nn,F as on,G as tn,H as rn,I as an,J as sn,K as cn,L as un,M as ye,N as dn,O as ln,P as pn,Q as fn,R as mn,S as hn,T as kn,U as Sn,V as yn,W as gn,X as bn,Y as En,Z as Rn,_ as Cn,a as To,aa as Kn,b as qo,ba as ae,c as Wo,ca as be,d as Bo,da as Ee,e as F,ea as ie,f as zo,fa as T,g as Qo,ga as q,i as Xo,j as oe,k as te,ka as Yo,l as De,m as H,ma as Jo,n as re,na as k,o as Fe,oa as Re,p as He,q as ke,r as Te,s as qe,t as We,ta as Zo,u as Be,ua as et,v as Se,va as U,w as Ge,x as ze,y as Qe,z as Xe}from"./chunk-MQBWSCNY.js";import{A as C,B as ne,C as h,D,E as he,F as W,G as xn,a as Vo,b as Lo,c as S,d as N,e as v,f as Oo,g as wo,h as Uo,i as Ao,j as $o,k as Mo,l as jo,m as Do,n as Fo,o as l,r as Go,s as O,t as me,u as ee,w as x,z as w}from"./chunk-54D47DLS.js";import{a as No}from"./chunk-FUUTGGJS.js";import"./chunk-F67UH4FD.js";import{a as no,b as oo,c as Z,d as to,e as V,f as ro,g as ao,h as io,i as so,j as co,k as uo}from"./chunk-QILEJIFU.js";import{a as dt}from"./chunk-ODIECDN7.js";async function Nn(n){let e=await new A().parseKanonaks(n),t=await new B().reason(n);return{kind:"merged",catalog:e,reasoning:t}}function On(n,e){return{kind:"merged",catalog:n,reasoning:e}}async function wn(n,e){let t=e??new fe(new j);return{kind:"standalone",catalog:await new A().parseKanonaks(new xn(n,t))}}function I(n){return typeof n=="number"?n:void 0}function _r(n){if(!n)return;let e=l(n);if(e===l(sn))return"IRI";if(e===l(cn))return"BlankNode";if(e===l(un))return"Literal"}function An(n){if(!n)return;let e=l(n);if(e===l(dn))return"Violation";if(e===l(ln))return"Warning";if(e===l(pn))return"Info"}function $n(n,e,t,o){let r=h(e,ke);if(!r)return;let a={path:r},u=I(C(e,Te)),s=I(C(e,qe));u!==void 0&&(a.minCount=u),s!==void 0&&(a.maxCount=s);let i=I(C(e,Qe)),d=I(C(e,Xe));i!==void 0&&(a.minLength=i),d!==void 0&&(a.maxLength=d);let c=I(C(e,Ye)),p=I(C(e,Je));c!==void 0&&(a.minInclusive=c),p!==void 0&&(a.maxInclusive=p);let f=ne(e,Ge);if(f!==void 0){let m=ne(e,ze);a.pattern=m!==void 0?{regex:f,flags:m}:{regex:f}}if(w(e,Se)){let m=[],P=[];for(let{item:y}of me(e,Se))"literal"in y?m.push(y.value):y instanceof v&&P.push(y.subject);m.length>0&&(a.inValues=m),P.length>0&&(a.inRefs=P)}let R=h(e,We);R&&(a.datatype=R);let $=h(e,Be);$&&(a.classRef=$);let M=_r(h(e,an));M&&(a.nodeKind=M);let Q=h(e,Kn);if(Q&&(a.hasValue=Q),w(e,ae)||w(e,be)||w(e,Ee)){let m={},P=I(C(e,be)),y=I(C(e,Ee));P!==void 0&&(m.minCount=P),y!==void 0&&(m.maxCount=y);let K=Pr(n,e,o);"problem"in K?m.problem=K.problem:m.shape=K.shape,a.qualified=m}let X=ne(e,Ze);X!==void 0&&(a.message=X);let Y=An(h(e,ye))??t;return Y&&(a.severity=Y),a}function Pr(n,e,t){let o=D(e,ae);if(o)return Un(n,o,void 0,t);let r=h(e,ae);if(!r)return{problem:"sh:qualifiedValueShape is missing"};let a=l(r);if(t.has(a))return{problem:`sh:qualifiedValueShape '${r.name}' leads back to itself (a cycle through named shapes)`};let u=x(n,r);return u?Un(n,u,a,t):{problem:`sh:qualifiedValueShape '${r.name}' does not resolve`}}function Un(n,e,t,o){let r=t?new Set([...o,t]):o,a=ee(e,H);if((ee(e,re)||w(e,ke))&&!a){let i=$n(n,e,void 0,r);return i?{shape:{kind:"property",constraint:i}}:{problem:"the qualified property shape has no sh:path"}}return e instanceof S&&!a?{problem:`sh:qualifiedValueShape '${e.name}' is not a shape`}:{shape:{kind:"node",shape:Mn(n,e,r)}}}function Mn(n,e,t){let o=An(h(e,ye)),r={name:e instanceof S?e.name:"(inline shape)",uri:e instanceof S?k(e):void 0,targetClass:h(e,Fe),targetNodes:O(e,en),targetSubjectsOf:O(e,nn),targetObjectsOf:O(e,on),closed:C(e,tn)===!0,ignoredProperties:[],severity:o,properties:[]};r.ignoredProperties.push(...O(e,rn));for(let{item:a}of me(e,He)){let u;if(a instanceof N?u=a:a instanceof v&&(u=x(n,a.subject)),!u)continue;let s=$n(n,u,o,t);s&&r.properties.push(s)}return r}function se(n){let e=[];for(let t of n){if(!(t instanceof S)||!ee(t,H))continue;let o=k(t);e.push(Mn(n,t,new Set(o?[l(o)]:[])))}return e}var b="kanonak.org/transformations",z="values";var ce="allowed",Pe="expected",g=n=>({type:`${b}/VarRef`,varName:n}),_e=n=>({type:`${b}/IntegerLiteral`,integerLiteral:n}),vr=n=>({type:`${b}/DecimalLiteral`,decimalLiteral:n}),jn=n=>Number.isInteger(n)?_e(n):vr(n),Dn=n=>({type:`${b}/Count`,source:n}),Fn=(n,e)=>({type:`${b}/GreaterThanOrEqual`,compareLeft:n,compareRight:e}),Hn=(n,e)=>({type:`${b}/LessThanOrEqual`,compareLeft:n,compareRight:e});function ve(n,e){if(!e||e.length===0)return n;let t=new Set(["i","m","s"]),o=[...new Set(e.split(""))];if(o.filter(a=>!t.has(a)).length>0)throw new Error(`sh:flags '${e}' is outside the pinned regex subset (supported: i, m, s)`);return`(?${o.sort().join("")})${n}`}function ue(n){let e=[];return n.minCount!==void 0&&e.push({component:"minCount",per:"node",expr:Fn(Dn(g(z)),_e(n.minCount))}),n.maxCount!==void 0&&e.push({component:"maxCount",per:"node",expr:Hn(Dn(g(z)),_e(n.maxCount))}),n.hasValue!==void 0&&e.push({component:"hasValue",per:"node",expr:{type:`${b}/Contains`,haystack:g(z),needle:g(Pe)}}),(n.inValues!==void 0||n.inRefs!==void 0)&&e.push({component:"in",per:"value",expr:{type:`${b}/Contains`,haystack:g(ce),needle:g("v")}}),n.pattern!==void 0&&e.push({component:"pattern",per:"value",expr:{type:`${b}/Matches`,matchSource:g("v"),pattern:ve(n.pattern.regex,n.pattern.flags)}}),n.minLength!==void 0&&e.push({component:"minLength",per:"value",expr:{type:`${b}/Matches`,matchSource:g("v"),pattern:`(?s)^.{${n.minLength},}$`}}),n.maxLength!==void 0&&e.push({component:"maxLength",per:"value",expr:{type:`${b}/Matches`,matchSource:g("v"),pattern:`(?s)^.{0,${n.maxLength}}$`}}),n.minInclusive!==void 0&&e.push({component:"minInclusive",per:"value",expr:Fn(g("v"),jn(n.minInclusive))}),n.maxInclusive!==void 0&&e.push({component:"maxInclusive",per:"value",expr:Hn(g("v"),jn(n.maxInclusive))}),e}import{evaluate as Vr,ExpressionError as Lr}from"@kanonak-protocol/expression";function qn(n,e){let t=Nr(e)?e:se(e),o=[],r=n.catalog.filter(s=>s instanceof S).map(de),a=new Map;for(let s of r)Wn(s,n.catalog,a);let u={scope:n,membership:new Ie(n),embeddedFocus:a};for(let s of t)for(let i of wr(u,s,r))Bn(u,s,i,o);return{conforms:!o.some(s=>s.severity==="Violation"),results:o}}function Nr(n){return n.length>0&&!(n[0]instanceof Object&&"statement"in n[0])&&typeof n[0].name=="string"&&"properties"in n[0]}function Le(n){let e=n.predicate;return e instanceof v?e:void 0}function de(n){let e=k(n);return{node:n,key:e?l(e):`${n.namespace}/${n.name}`,uri:e,label:n.name}}function Ne(n,e){return{node:n,key:e,label:e.includes("#")?e.slice(e.indexOf("#")):e}}function Or(n){let e=new Map;for(let t of n.statement){let o=Le(t);o&&!e.has(l(o.subject))&&e.set(l(o.subject),o.subject)}return[...e.values()]}function Wn(n,e,t){if(n.node)for(let o of Or(n.node))for(let r of W(n.node,o,e,n.key)){if(r.kind!=="embedded"||t.has(r.node))continue;let a=Ne(r.node,r.address);t.set(r.node,a),Wn(a,e,t)}}var Ie=class{constructor(e){this.scope=e}scope;ancestors=new Map;isInstance(e,t){let o=l(t);return e.some(r=>l(r)===o||this.ancestorsOf(r).has(o))}ancestorsOf(e){let t=e.version&&typeof e.version.major=="number"?`${l(e)}@${V(e.version)}`:l(e),o=this.ancestors.get(t);return o||(o=this.scope.reasoning?new Set(this.scope.reasoning.getSuperclasses(e)):new Set(Re(this.scope.catalog,e).map(r=>l(r))),this.ancestors.set(t,o)),o}};function wr(n,e,t){let{scope:o}=n,r=new Map,a=s=>{r.set(s.key,s)},u=()=>[...t,...n.embeddedFocus.values()];if(e.targetClass){let s=e.targetClass;if(o.reasoning){let i=new Set(o.reasoning.getInstancesOfClass(s));for(let d of t)d.uri&&i.has(l(d.uri))&&a(d)}else for(let i of t)n.membership.isInstance(U(i.node),s)&&a(i);for(let i of n.embeddedFocus.values())n.membership.isInstance(U(i.node),s)&&a(i)}for(let s of e.targetNodes){let i=x(o.catalog,s);i instanceof S&&a(de(i))}for(let s of e.targetSubjectsOf){let i=l(s);for(let d of u())d.node.statement.some(c=>{let p=Le(c);return p&&l(p.subject)===i})&&a(d)}for(let s of e.targetObjectsOf)for(let i of u())for(let d of W(i.node,s,o.catalog,i.key))d.kind==="subject"?a(de(d.node)):d.kind==="embedded"&&a(n.embeddedFocus.get(d.node)??Ne(d.node,d.address));return[...r.values()]}function Ur(n,e,t){return e.node?W(e.node,t,n.scope.catalog,e.key).map(o=>Ar(n,o)):[]}function Ar(n,e){switch(e.kind){case"subject":return{kernel:{ref:l(e.uri)},kind:"reference",ref:e.uri,subject:e.node};case"unresolved":return{kernel:{ref:l(e.uri)},kind:"reference",ref:e.uri};case"embedded":{let t=n.embeddedFocus.get(e.node)??Ne(e.node,e.address);return{kernel:{ref:t.key},kind:"embedded",embedded:t}}case"literal":return typeof e.value=="boolean"?{kernel:e.value?1:0,kind:"boolean",literal:e.value}:{kernel:e.value,kind:typeof e.value=="number"?"number":"string",literal:e.value}}}function Bn(n,e,t,o){for(let r of e.properties)zn(n,e,t,r,o);e.closed&&Gr(e,t,o)}function Ve(n,e,t,o,r={},a){return{focusNode:e.key,focusUri:e.uri,constraintComponent:t,severity:a??Gn(n),message:o,sourceShape:n.name,sourceShapeUri:n.uri,...r}}function Gn(n){return n.severity??"Violation"}var $r={minCount:fn,maxCount:mn,hasValue:ie,in:Sn,pattern:yn,minLength:gn,maxLength:bn,minInclusive:En,maxInclusive:Rn};function zn(n,e,t,o,r){let a=Ur(n,t,o.path),u=o.severity??Gn(e),s=o.path.name,i=[...(o.inValues??[]).map(c=>typeof c=="boolean"?c?1:0:c),...(o.inRefs??[]).map(c=>({ref:l(c)}))],d=(c,p,f)=>{let R=Ve(e,t,c,o.message??p,{resultPath:o.path,value:f?.literal,valueRef:f?.ref},u);return r.push(R),R};for(let c of ue(o)){let p=$r[c.component];if(c.per==="node"){let f={[z]:a.map(R=>R.kernel),[ce]:i};o.hasValue&&(f[Pe]={ref:l(o.hasValue)}),Tn(c,f)||d(p,Mr(c,s,o,a.length));continue}for(let f of a){if((c.component==="pattern"||c.component==="minLength"||c.component==="maxLength")&&f.kind!=="string"){d(p,`'${s}' value is not a string; ${c.component} applies to string values.`,f);continue}Tn(c,{v:f.kernel,[ce]:i})||d(p,Tr(c,s,o,f),f)}}if(o.nodeKind)for(let c of a)qr(o.nodeKind,c)||d(Cn,`'${s}' value is ${c.kind}; nodeKind requires ${o.nodeKind}.`,c);if(o.datatype)for(let c of a){let p=Wr(o.datatype,c);p&&d(hn,`'${s}' ${p}`,c)}if(o.classRef)for(let c of a){let p=Br(n,o.classRef,c);p&&d(kn,`'${s}' ${p}`,c)}o.qualified&&jr(n,o,a,s,d)}function Mr(n,e,t,o){switch(n.component){case"minCount":return`'${e}' has ${o} value(s); minCount is ${t.minCount}.`;case"maxCount":return`'${e}' has ${o} value(s); maxCount is ${t.maxCount}.`;case"hasValue":return`'${e}' has no value equal to ${t.hasValue?l(t.hasValue):"(unset)"}.`;default:return`'${e}' violates ${n.component}.`}}function jr(n,e,t,o,r){let a=e.qualified,u=a.maxCount!==void 0?q:T,s=(d,c)=>{Qn.add(r(u,d,c))};if(!a.shape){s(`'${o}' qualified value shape cannot be evaluated: ${a.problem??"it could not be built"}.`);return}let i=0;for(let d of t){let c=d.ref?l(d.ref):d.embedded?d.embedded.label:JSON.stringify(d.literal),p=Dr(n,d);if(!p){s(`'${o}' value ${c} does not resolve in this scope; whether it conforms to the qualified shape cannot be decided.`,d);continue}let f=Hr(n,a.shape,p);if(f.kind==="undecided"){s(`'${o}' value ${c}: whether it conforms to the qualified shape cannot be decided \u2014 ${f.reason}`,d);continue}f.kind==="conforms"&&i++}a.minCount!==void 0&&i<a.minCount&&r(T,`'${o}' has ${i} value(s) that conform to the qualified shape; qualifiedMinCount is ${a.minCount}.`),a.maxCount!==void 0&&i>a.maxCount&&r(q,`'${o}' has ${i} value(s) that conform to the qualified shape; qualifiedMaxCount is ${a.maxCount}.`)}function Dr(n,e){switch(e.kind){case"reference":return e.subject?de(e.subject):void 0;case"embedded":return e.embedded;default:{let t=JSON.stringify(e.literal);return{key:t,label:t}}}}var Fr={name:"(qualified value shape)",targetNodes:[],targetSubjectsOf:[],targetObjectsOf:[],closed:!1,ignoredProperties:[],properties:[]},Qn=new WeakSet;function Hr(n,e,t){let o=[];e.kind==="property"?zn(n,Fr,t,e.constraint,o):Bn(n,e.shape,t,o);let r=o.find(a=>Qn.has(a));return r?{kind:"undecided",reason:r.message}:o.length===0?{kind:"conforms"}:{kind:"fails"}}function Tr(n,e,t,o){let r=o.ref?l(o.ref):o.embedded?o.embedded.label:JSON.stringify(o.literal);switch(n.component){case"in":return`'${e}' value ${r} is not in the permitted set.`;case"pattern":return`'${e}' value ${r} does not match pattern ${t.pattern?.regex}.`;case"minLength":return`'${e}' value ${r} is shorter than minLength ${t.minLength}.`;case"maxLength":return`'${e}' value ${r} is longer than maxLength ${t.maxLength}.`;case"minInclusive":return`'${e}' value ${r} is below minInclusive ${t.minInclusive} (or not numeric).`;case"maxInclusive":return`'${e}' value ${r} is above maxInclusive ${t.maxInclusive} (or not numeric).`;default:return`'${e}' value ${r} violates ${n.component}.`}}function Tn(n,e){let t=o=>{let r=o.varName;if(o.type==="kanonak.org/transformations/VarRef"&&typeof r=="string"&&r in e)return e[r];throw new Lr(`Conformance lowering produced an unexpected leaf '${o.type}'`)};return Vr(n.expr,void 0,t)===1}function qr(n,e){switch(n){case"IRI":return e.kind==="reference";case"BlankNode":return e.kind==="embedded";case"Literal":return e.kind==="string"||e.kind==="number"||e.kind==="boolean"}}function Wr(n,e){if(e.kind==="reference"||e.kind==="embedded")return`value is a ${e.kind}; sh:datatype requires a literal of ${n.name}.`;let t=Ce(n);if(t!==void 0)switch(t){case L.Boolean:return e.kind==="boolean"?void 0:`value is not a boolean (${n.name}).`;case L.Integer:return e.kind!=="number"?`value is not a number (${n.name}).`:Number.isInteger(e.literal)?void 0:`value is not an integer (${n.name}).`;case L.Decimal:case L.Double:case L.Float:return e.kind==="number"?void 0:`value is not a number (${n.name}).`;default:return e.kind==="string"?void 0:`value is not a string-carried literal (${n.name}).`}}function Br(n,e,t){if(t.kind==="embedded"&&t.embedded?.node){let r=U(t.embedded.node);return r.length===0?`value ${t.embedded.label} has no type; sh:class requires an instance of ${e.name}.`:n.membership.isInstance(r,e)?void 0:`value ${t.embedded.label} is not an instance of ${e.name}.`}if(t.kind!=="reference"||!t.ref)return`value is not a reference; sh:class requires an instance of ${e.name}.`;if(n.scope.reasoning)return n.scope.reasoning.isInstanceOf(t.ref,e)?void 0:`value ${l(t.ref)} is not an instance of ${e.name}.`;let o=t.subject;return o?n.membership.isInstance(U(o),e)?void 0:`value ${l(t.ref)} is not an instance of ${e.name}.`:`value ${l(t.ref)} does not resolve in this scope (sh:class ${e.name}).`}function Gr(n,e,t){if(!e.node)return;let o=new Set([...n.properties.map(a=>l(a.path)),...n.ignoredProperties.map(a=>l(a))]),r=new Set;for(let a of e.node.statement){let u=Le(a);if(!u)continue;let s=l(u.subject);o.has(s)||r.has(s)||(r.add(s),t.push(Ve(n,e,ge,`'${e.label}' carries undeclared property '${u.subject.name}' (closed shape).`,{resultPath:u.subject})))}for(let a of e.node.unresolvedPredicates)r.has(a.key)||(r.add(a.key),t.push(Ve(n,e,ge,`'${e.label}' carries unresolvable property '${a.key}' (closed shape).`,{value:a.key})))}var zr="1.1.0",Qr=new Set([ie,T,q].map(n=>n.name));async function Xn(n){let e=new G(n.repository),t=e.imports(),o=n.result.results.some(i=>Qr.has(i.constraintComponent.name))?"1.2.0":zr,r=t.ensure(oe,te,o,"sh"),a=(i,d)=>i&&i.version&&typeof i.version.major=="number"?`${t.ensure(i.publisher,i.package_,V(i.version),i.package_)}.${i.name}`:d,u={},s=[];return n.result.results.forEach((i,d)=>{let c=`result-${d+1}`;s.push(c);let p={type:`${r}.ValidationResult`,[`${r}.focusNode`]:a(i.focusUri,i.focusNode),[`${r}.resultMessage`]:i.message,[`${r}.resultSeverity`]:`${r}.${i.severity}`,[`${r}.sourceConstraintComponent`]:`${r}.${i.constraintComponent.name}`};i.resultPath&&(p[`${r}.resultPath`]=a(i.resultPath,l(i.resultPath))),i.sourceShapeUri&&(p[`${r}.sourceShape`]=a(i.sourceShapeUri,i.sourceShape)),i.valueRef?p[`${r}.value`]=a(i.valueRef,l(i.valueRef)):i.value!==void 0&&(p[`${r}.value`]=i.value),u[c]=p}),u.report={type:`${r}.ValidationReport`,[`${r}.conforms`]:n.result.conforms,...s.length>0?{[`${r}.result`]:s}:{}},e.buildContentAddressed({publisher:n.publisher,book:t,body:u,...n.header!==void 0?{header:n.header}:{},contentHashProperty:"contentHash"})}import{VersionOperator as Ki}from"@kanonak-protocol/types/document/models/enums";var E="kanonak.org",_="view",Yn="core-kanonak",Xr={publisher:E,package_:_,name:"rootView"},Yr={publisher:E,package_:_,name:"bind"},Jr={publisher:E,package_:_,name:"produces"},Zr={publisher:E,package_:_,name:"projections"},ea={publisher:E,package_:_,name:"where"},na={publisher:E,package_:_,name:"value"},oa={publisher:E,package_:_,name:"as"},le=class{constructor(e,t=new j){this.repository=e;this.parser=t;this.objectParser=new A(this.parser),this.builder=new G(this.repository,this.parser,this.objectParser)}repository;parser;objectParser;builder;async materialize(e,t={}){let o=await this.objectParser.parseKanonaks(this.repository),r=this.resolveView(o,e),a=h(r,Yr);if(!a)throw new Error(`View ${r.namespace}/${r.name} declares no view.bind; cannot materialize.`);let u=h(r,Jr);if(!u)throw new Error(`View ${r.namespace}/${r.name} is a selection view (no view.produces). In-graph materialization of selection views is not yet supported \u2014 declare a view.produces output class to reshape the result.`);let s=ta(r),i=Jn(o,E,Yn),d=Jn(o,E,_),c=this.builder.imports(),p=c.ensure(E,Yn,i,"ck"),f=c.ensure(E,_,d,"v"),R=c.ref(u),$=new vn(this.repository,this.parser,this.objectParser),M=new Pn($,o),Q=this.readProjections(o,r),X=ia(r,ea),Y=this.findInstances(o,a,await this.reason(t)),m={},P=new Set;for(let J of Y){if(!await this.passesWhere(M,o,X,J))continue;let pe={type:R};for(let we of Q){let eo=await this.evaluateValue(M,o,we.value,J),Ue=this.builder.serializeValue(Zn(eo),c);Ue!==void 0&&(pe[c.ref(we.as)]=Ue)}let Oe=k(J);Oe&&(pe[`${f}.derivedFrom`]=c.ref(Oe)),m[this.rowName(J,P)]=pe}let y={};t.resolvedAt&&(y[`${p}.resolvedAt`]=t.resolvedAt),t.invocationId&&(y[`${p}.id`]=t.invocationId);let K=await this.builder.buildContentAddressed({publisher:s,book:c,body:m,contentHashProperty:`${p}.contentHash`,header:y});return{yaml:K.yaml,contentHash:K.contentHash,packageName:K.packageName,publisher:K.publisher,rowCount:K.resourceCount}}resolveView(e,t){let o=x(e,t);if(!o)throw new Error(`View ${t.publisher}/${t.package_}/${t.name} not found in the catalog.`);let r=h(o,Xr);if(r){let a=x(e,r);if(!a)throw new Error(`ViewPackage ${t.name} names rootView ${r.name}, which is not in the catalog.`);return a}return o}readProjections(e,t){let o=[];for(let r of he(t,Zr)){let a=r instanceof N?r:r instanceof v?x(e,r.subject):void 0;if(!a)continue;let u=D(a,na),s=h(a,oa);u&&s&&o.push({value:u,as:s})}return o}async reason(e){return new B({profile:e.reasoningProfile??"owl-rl-classification"}).reason(this.repository)}findInstances(e,t,o){let r=aa(e),a=[],u=new Set;for(let s of o.getInstancesOfClass(t)){if(u.has(s))continue;u.add(s);let i=r.get(s);i&&a.push(i)}return a.sort((s,i)=>{let d=F(k(s)),c=F(k(i));return d<c?-1:d>c?1:0}),a}async passesWhere(e,t,o,r){for(let a of o){let u=await this.evaluateValue(e,t,a,r);if(!sa(u))return!1}return!0}async evaluateValue(e,t,o,r){let a=_n(o,"view-projection",{catalog:t,depth:0}),u=new Map([["input",r]]);return e.evaluate(a,u)}rowName(e,t){let o=xe(e.name)||"row",r=o,a=2;for(;t.has(r);)r=`${o}-${a++}`;return t.add(r),r}};function Zn(n){return Ke(n)?n.value:Array.isArray(n)?n.map(Zn):n}function ta(n){let e=k(n);if(!e)throw new Error(`Could not derive a publisher from view ${n.namespace}/${n.name}.`);return e.publisher}function Jn(n,e,t){let o=ra(n,e,t);if(!o)throw new Error(`Package ${e}/${t} is not in the catalog; it must be importable to materialize a view.`);return o}function ra(n,e,t){let o;for(let r of n){if(!(r instanceof S))continue;let a=k(r);!a||a.publisher!==e||a.package_!==t||!a.version||(!o||Z(a.version,o)>0)&&(o=a.version)}return o?V(o):void 0}function aa(n){let e=new Map,t=new Map;for(let o of n){if(!(o instanceof S))continue;let r=k(o);if(!r||!r.version)continue;let a=F(r),u=t.get(a);(!u||Z(r.version,u)>0)&&(t.set(a,r.version),e.set(a,o))}return e}function ia(n,e){let t=D(n,e);return t?[t]:he(n,e).filter(o=>o instanceof N)}function sa(n){return n===!0?!0:n===!1||n===void 0||n===null?!1:typeof n=="string"?n.length>0:typeof n=="number"?n!==0:Ke(n)?n.value.length>0:Array.isArray(n)?n.length>0:!!n}export{Mt as AmbiguousReferenceRule,Mo as BooleanStatement,lr as CANONICAL_FORM_VERSION,L as Carrier,qt as ClassDefinitionRule,Lt as ClassHierarchyCycleRule,fo as CompositeKanonakDocumentRepository,hr as DEFAULT_CONSENT_BINDING_PARAM,Lo as DefinedKanonak,sr as DiamondNameClashRule,Bt as DisplayLensScopeRule,po as DocumentLocation,rt as EdgeType,N as EmbeddedKanonak,vt as EmbeddedKanonakTypeRule,Do as EmbeddedStatement,Kr as EntitlementDeniedError,xr as EntitlementProducer,lo as FileSystemKanonakDocumentRepository,dt as GitIgnoreFilter,at as GraphBuilder,xo as HttpKanonakDocumentRepository,Ae as INTEGRITY_PREFIX,fr as ImportBook,It as ImportExistenceRule,fe as InMemoryKanonakDocumentRepository,ko as KANONAK_USER_AGENT,Vo as Kanonak,pt as KanonakDocumentPositions,A as KanonakObjectParser,cr as KanonakObjectValidator,j as KanonakParser,No as KanonakUri,ht as KanonakUriBuilder,kt as KanonakUrlResolver,Yo as KanonakVocabulary,Xt as LINE_STYLES,Rt as LinkTargetRule,Fo as ListStatement,Oo as LiteralKanonak,_o as LocalFirstRepository,Po as LockAwareRepository,tr as LookBandPathRule,er as LookRenderer,Gt as LookSemanticSvgPathRule,Wt as MarkdownLinkRule,Ho as MarkdownStatement,At as NamespaceImportCycleRule,Ct as NamespacePrefixRule,tt as NodeType,$o as NumberStatement,kr as OAuthDiscovery,ct as OWL_RL_CLASSIFICATION_RULES,Dt as ObjectPropertyValueValidationRule,gt as OntologyValidationError,St as OntologyValidationResult,ir as OwlOneOfRule,G as PackageBuilder,Pt as PackageHeaderRule,Er as ProducerRepository,Ft as PropertyDomainRule,Nt as PropertyHierarchyCycleRule,Ht as PropertyKindRangeConsistencyRule,lt as PropertyMetadata,jt as PropertyRangeReferenceRule,Ot as PropertyRangeRequiredRule,xt as PropertyTypeSpecificityRule,Ro as PublisherConfigResolver,Co as PublisherIndex,st as RDFS_RULES,B as Reasoner,ut as ReasoningResult,v as ReferenceKanonak,jo as ReferenceStatement,ho as RepositoryFactory,Tt as ReservedNameShadowRule,Kt as ResourceNamingRule,To as ResourceResolver,Jo as ResourceTypeClassifier,te as SHACL_PACKAGE,oe as SHACL_PUBLISHER,H as SH_NODE_SHAPE,re as SH_PROPERTY_SHAPE,De as SH_SHAPE,Uo as ScalarStatement,or as SequenceNarrativeRule,ar as ShaclShapeRule,wo as Statement,Ao as StringStatement,wt as SubClassOfReferenceRule,Ut as SubPropertyOfReferenceRule,S as SubjectKanonak,_t as SubjectKanonakTypeRequiredRule,gr as TokenCredentialProvider,it as TripleStore,zt as TxExpressionCompilesRule,rr as TxExpressionPathRule,qo as TypeResolver,$t as UnresolvedPredicateRule,Vt as UnresolvedReferenceRule,Et as ValidationCache,bt as ValidationContext,yt as ValidationSeverity,Ki as VersionOperator,le as ViewMaterializer,Rr as allowAllPolicy,go as assertHttpsUrl,Ko as assertPackageIdentity,Io as buildLocalFirstRepository,Zt as buildOntologyModel,Xn as buildReportPackageAsync,se as buildShapesModel,ur as canonicalForm,dr as canonicalHash,Ce as carrierOf,vo as collectKanonakFiles,Z as compareVersions,Ln as computeIntegrity,je as computeIntegrityAsync,pr as contentAddressedName,U as contextTypesOf,yr as createCredentialedFetch,ro as createVersion,qn as evaluateConformance,ot as extractMarkdownLinks,br as findDerivation,nt as findMalformedReferences,mt as findMarkdownLinkAt,ve as foldFlagsIntoPattern,Bo as formatKanonakAddress,V as formatVersion,mo as getGlobalCachePath,yo as getKanonakUserAgent,io as isCompatibleVersion,so as isMajorCompatible,bo as kanonakFetch,In as loadLockFile,ue as lowerConstraint,zo as makeUriKey,Cr as noopMeter,mr as normalizeHost,Sr as parseAuthChallenge,Wo as parseKanonakAddress,$e as parseLockFile,ao as parseVersionString,ft as parseWithPositions,uo as pickHighestDocument,Zo as propertiesInScope,Yt as readSequenceConnectors,O as referenceUris,Qt as resolveDisplayValue,et as resolvePropertyStep,xe as sanitizeName,co as satisfiesVersionOperator,Vn as saveLockFile,On as scopeFromCatalog,wn as scopeFromDocumentAsync,Nn as scopeFromRepositoryAsync,Me as serializeLockFile,Eo as setKanonakFetchRetries,So as setKanonakUserAgent,k as subjectUri,Re as superClassChain,nr as supportedBandKeys,Qo as tripleKey,Go as typeReferenceUris,F as uriKey,Xo as uriTriple,W as valuesOf,no as versionOperatorFromChar,oo as versionOperatorToChar,to as versionsEqual,Jt as walkSequence};
1
+ import{a as st,b as ct,c as ut,d as dt,e as W}from"./chunk-4QXD6HKI.js";import{a as Vn,b as Ln,c as Nn}from"./chunk-V3DH67P3.js";import{a as rt,b as at,c as it,d as hr,e as kr,f as Sr,g as yr,h as gr,i as br}from"./chunk-H7SX57L7.js";import{a as Er}from"./chunk-IN5VVPYH.js";import{a as dr,b as lr,c as pr,d as B,e as fr,f as mr,g as Pe,h as Rr,i as Cr,j as Kr,k as xr,l as _r}from"./chunk-VENZTHCC.js";import{a as po,b as fo,c as mo,d as ho,e as ko,f as Po,g as vo,h as Io,i as Vo}from"./chunk-IS3AQKB4.js";import{a as So,b as yo,c as go,d as bo,e as Eo,f as Ro,h as Co,i as $e,j as Me,k as je,l as De,m as Ko,n as _o}from"./chunk-BZ3YTI3C.js";import{a as pt,b as ft,c as mt,d as ht}from"./chunk-YBHIELES.js";import{a as kt}from"./chunk-XK24CN3C.js";import{a as xo}from"./chunk-SC5M74NM.js";import{A as qt,B as Wt,C as Bt,D as Gt,E as zt,F as Qt,G as tr,H as rr,I as ar,J as ir,K as sr,L as cr,M as ur,a as yt,b as gt,c as bt,d as Et,e as Rt,f as Ct,g as Kt,h as xt,i as _t,j as Pt,k as vt,l as It,m as Vt,n as Lt,o as Nt,p as Ot,q as wt,r as At,s as Ut,t as $t,u as Mt,v as jt,w as Dt,x as Ft,y as Ht,z as Tt}from"./chunk-6TEJENCD.js";import"./chunk-KIBR3HAT.js";import{c as Pn,d as Xt,e as Yt,g as Jt,h as Zt,k as er,m as _e,o as vn,p as In,r as nr,s as or}from"./chunk-ROKDCCJN.js";import"./chunk-QHABFCRC.js";import{a as fe}from"./chunk-6VIUXP4N.js";import{a as Ke,f as N,g as xe,h as ot,i as tt,j as U}from"./chunk-Q2FG7DME.js";import{a as j}from"./chunk-HF5FJBS2.js";import{a as St}from"./chunk-PEJALHXK.js";import{$ as re,A as en,B as nn,C as on,D as tn,E as rn,F as an,G as sn,H as cn,I as un,J as dn,K as ye,L as ln,M as pn,N as fn,O as mn,P as hn,Q as kn,R as Sn,S as yn,T as gn,U as bn,V as En,W as Rn,X as Cn,Y as Kn,Z as ge,_ as xn,a as qo,aa as be,b as Wo,ba as Ee,c as F,ca as ae,d as Qo,da as T,e as Xo,ea as q,g as Yo,h as ne,i as oe,ia as Jo,j as Fe,k as H,ka as Zo,l as te,la as k,m as He,ma as Ce,n as Te,o as ke,p as qe,q as We,r as Be,ra as et,s as Ge,sa as nt,t as Se,ta as A,u as ze,v as Qe,w as Xe,x as Ye,y as Je,z as Ze}from"./chunk-7TU55KLO.js";import{C as w,D as C,E as ee,F as h,G as D,H as he,I as ie,J as Re,L as _n,a as Lo,b as No,c as S,d as v,e as I,f as wo,g as Ao,h as Uo,i as $o,j as Mo,k as jo,l as Do,m as Fo,n as Ho,o as To,p as Bo,q as Go,r as l,u as zo,v as O,w as me,x as Z,z as x}from"./chunk-XNEWQEB6.js";import{a as Oo}from"./chunk-FUUTGGJS.js";import"./chunk-F67UH4FD.js";import{a as oo,b as to,c as J,d as ro,e as L,f as ao,g as io,h as so,i as co,j as uo,k as lo}from"./chunk-QILEJIFU.js";import{a as lt}from"./chunk-ODIECDN7.js";async function On(n){let e=await new U().parseKanonaks(n),t=await new W().reason(n);return{kind:"merged",catalog:e,reasoning:t}}function wn(n,e){return{kind:"merged",catalog:n,reasoning:e}}async function An(n,e){let t=e??new fe(new j);return{kind:"standalone",catalog:await new U().parseKanonaks(new _n(n,t))}}function V(n){return typeof n=="number"?n:void 0}function Pr(n){if(!n)return;let e=l(n);if(e===l(cn))return"IRI";if(e===l(un))return"BlankNode";if(e===l(dn))return"Literal"}function $n(n){if(!n)return;let e=l(n);if(e===l(ln))return"Violation";if(e===l(pn))return"Warning";if(e===l(fn))return"Info"}function Mn(n,e,t,o){let r=h(e,ke);if(!r)return;let a={path:r},u=V(C(e,qe)),s=V(C(e,We));u!==void 0&&(a.minCount=u),s!==void 0&&(a.maxCount=s);let i=V(C(e,Xe)),d=V(C(e,Ye));i!==void 0&&(a.minLength=i),d!==void 0&&(a.maxLength=d);let c=V(C(e,Je)),p=V(C(e,Ze));c!==void 0&&(a.minInclusive=c),p!==void 0&&(a.maxInclusive=p);let f=ee(e,ze);if(f!==void 0){let m=ee(e,Qe);a.pattern=m!==void 0?{regex:f,flags:m}:{regex:f}}if(w(e,Se)){let m=[],P=[];for(let{item:y}of me(e,Se))"literal"in y?m.push(y.value):y instanceof I&&P.push(y.subject);m.length>0&&(a.inValues=m),P.length>0&&(a.inRefs=P)}let R=h(e,Be);R&&(a.datatype=R);let $=h(e,Ge);$&&(a.classRef=$);let M=Pr(h(e,sn));M&&(a.nodeKind=M);let z=h(e,xn);if(z&&(a.hasValue=z),w(e,re)||w(e,be)||w(e,Ee)){let m={},P=V(C(e,be)),y=V(C(e,Ee));P!==void 0&&(m.minCount=P),y!==void 0&&(m.maxCount=y);let K=vr(n,e,o);"problem"in K?m.problem=K.problem:m.shape=K.shape,a.qualified=m}let Q=ee(e,en);Q!==void 0&&(a.message=Q);let X=$n(h(e,ye))??t;return X&&(a.severity=X),a}function vr(n,e,t){let o=D(e,re);if(o)return Un(n,o,void 0,t);let r=h(e,re);if(!r)return{problem:"sh:qualifiedValueShape is missing"};let a=l(r);if(t.has(a))return{problem:`sh:qualifiedValueShape '${r.name}' leads back to itself (a cycle through named shapes)`};let u=x(n,r);return u?Un(n,u,a,t):{problem:`sh:qualifiedValueShape '${r.name}' does not resolve`}}function Un(n,e,t,o){let r=t?new Set([...o,t]):o,a=Z(e,H);if((Z(e,te)||w(e,ke))&&!a){let i=Mn(n,e,void 0,r);return i?{shape:{kind:"property",constraint:i}}:{problem:"the qualified property shape has no sh:path"}}return e instanceof S&&!a?{problem:`sh:qualifiedValueShape '${e.name}' is not a shape`}:{shape:{kind:"node",shape:jn(n,e,r)}}}function jn(n,e,t){let o=$n(h(e,ye)),r={name:e instanceof S?e.name:"(inline shape)",uri:e instanceof S?k(e):void 0,targetClass:h(e,He),targetNodes:O(e,nn),targetSubjectsOf:O(e,on),targetObjectsOf:O(e,tn),closed:C(e,rn)===!0,ignoredProperties:[],severity:o,properties:[]};r.ignoredProperties.push(...O(e,an));for(let{item:a}of me(e,Te)){let u;if(a instanceof v?u=a:a instanceof I&&(u=x(n,a.subject)),!u)continue;let s=Mn(n,u,o,t);s&&r.properties.push(s)}return r}function se(n){let e=[];for(let t of n){if(!(t instanceof S)||!Z(t,H))continue;let o=k(t);e.push(jn(n,t,new Set(o?[l(o)]:[])))}return e}var b="kanonak.org/transformations",G="values";var ce="allowed",Ie="expected",g=n=>({type:`${b}/VarRef`,varName:n}),ve=n=>({type:`${b}/IntegerLiteral`,integerLiteral:n}),Ir=n=>({type:`${b}/DecimalLiteral`,decimalLiteral:n}),Dn=n=>Number.isInteger(n)?ve(n):Ir(n),Fn=n=>({type:`${b}/Count`,source:n}),Hn=(n,e)=>({type:`${b}/GreaterThanOrEqual`,compareLeft:n,compareRight:e}),Tn=(n,e)=>({type:`${b}/LessThanOrEqual`,compareLeft:n,compareRight:e});function Ve(n,e){if(!e||e.length===0)return n;let t=new Set(["i","m","s"]),o=[...new Set(e.split(""))];if(o.filter(a=>!t.has(a)).length>0)throw new Error(`sh:flags '${e}' is outside the pinned regex subset (supported: i, m, s)`);return`(?${o.sort().join("")})${n}`}function ue(n){let e=[];return n.minCount!==void 0&&e.push({component:"minCount",per:"node",expr:Hn(Fn(g(G)),ve(n.minCount))}),n.maxCount!==void 0&&e.push({component:"maxCount",per:"node",expr:Tn(Fn(g(G)),ve(n.maxCount))}),n.hasValue!==void 0&&e.push({component:"hasValue",per:"node",expr:{type:`${b}/Contains`,haystack:g(G),needle:g(Ie)}}),(n.inValues!==void 0||n.inRefs!==void 0)&&e.push({component:"in",per:"value",expr:{type:`${b}/Contains`,haystack:g(ce),needle:g("v")}}),n.pattern!==void 0&&e.push({component:"pattern",per:"value",expr:{type:`${b}/Matches`,matchSource:g("v"),pattern:Ve(n.pattern.regex,n.pattern.flags)}}),n.minLength!==void 0&&e.push({component:"minLength",per:"value",expr:{type:`${b}/Matches`,matchSource:g("v"),pattern:`(?s)^.{${n.minLength},}$`}}),n.maxLength!==void 0&&e.push({component:"maxLength",per:"value",expr:{type:`${b}/Matches`,matchSource:g("v"),pattern:`(?s)^.{0,${n.maxLength}}$`}}),n.minInclusive!==void 0&&e.push({component:"minInclusive",per:"value",expr:Hn(g("v"),Dn(n.minInclusive))}),n.maxInclusive!==void 0&&e.push({component:"maxInclusive",per:"value",expr:Tn(g("v"),Dn(n.maxInclusive))}),e}import{evaluate as Lr,ExpressionError as Nr}from"@kanonak-protocol/expression";function Wn(n,e){let t=Or(e)?e:se(e),o=[],r=n.catalog.filter(s=>s instanceof S).map(de),a=new Map;wr(r,a);let u={scope:n,membership:new Le(n),embeddedFocus:a};for(let s of t)for(let i of Ar(u,s,r))Gn(u,s,i,o);return{conforms:!o.some(s=>s.severity==="Violation"),results:o}}function Or(n){return n.length>0&&!(n[0]instanceof Object&&"statement"in n[0])&&typeof n[0].name=="string"&&"properties"in n[0]}function Bn(n){let e=n.predicate;return e instanceof I?e:void 0}function de(n){return{node:n,key:Re(n),uri:k(n),label:n.name}}function Oe(n,e){return{node:n,key:e,label:e.includes("#")?e.slice(e.indexOf("#")):e}}function wr(n,e){Ke(n.map(t=>t.node),({kanonak:t,address:o})=>{t instanceof v&&!e.has(t)&&e.set(t,Oe(t,o))})}var Le=class{constructor(e){this.scope=e}scope;ancestors=new Map;isInstance(e,t){let o=l(t);return e.some(r=>l(r)===o||this.ancestorsOf(r).has(o))}ancestorsOf(e){let t=e.version&&typeof e.version.major=="number"?`${l(e)}@${L(e.version)}`:l(e),o=this.ancestors.get(t);return o||(o=this.scope.reasoning?new Set(this.scope.reasoning.getSuperclasses(e)):new Set(Ce(this.scope.catalog,e).map(r=>l(r))),this.ancestors.set(t,o)),o}};function Ar(n,e,t){let{scope:o}=n,r=new Map,a=s=>{r.set(s.key,s)},u=()=>[...t,...n.embeddedFocus.values()];if(e.targetClass){let s=e.targetClass;if(o.reasoning){let i=new Set(o.reasoning.getInstancesOfClass(s));for(let d of t)d.uri&&i.has(l(d.uri))&&a(d)}else for(let i of t)n.membership.isInstance(A(i.node),s)&&a(i);for(let i of n.embeddedFocus.values())n.membership.isInstance(A(i.node),s)&&a(i)}for(let s of e.targetNodes){let i=x(o.catalog,s);i instanceof S&&a(de(i))}for(let s of e.targetSubjectsOf){let i=l(s);for(let d of u())d.node.statement.some(c=>{let p=Bn(c);return p&&l(p.subject)===i})&&a(d)}for(let s of e.targetObjectsOf)for(let i of u())for(let d of ie(i.node,s,o.catalog,i.key))d.kind==="subject"?a(de(d.node)):d.kind==="embedded"&&a(n.embeddedFocus.get(d.node)??Oe(d.node,d.address));return[...r.values()]}function Ur(n,e,t){return e.node?ie(e.node,t,n.scope.catalog,e.key).map(o=>$r(n,o)):[]}function $r(n,e){switch(e.kind){case"subject":return{kernel:{ref:l(e.uri)},kind:"reference",ref:e.uri,subject:e.node};case"unresolved":return{kernel:{ref:l(e.uri)},kind:"reference",ref:e.uri};case"embedded":{let t=n.embeddedFocus.get(e.node)??Oe(e.node,e.address);return{kernel:{ref:t.key},kind:"embedded",embedded:t}}case"literal":return typeof e.value=="boolean"?{kernel:e.value?1:0,kind:"boolean",literal:e.value}:{kernel:e.value,kind:typeof e.value=="number"?"number":"string",literal:e.value}}}function Gn(n,e,t,o){for(let r of e.properties)Qn(n,e,t,r,o);e.closed&&zr(e,t,o)}function Ne(n,e,t,o,r={},a){return{focusNode:e.key,focusUri:e.uri,constraintComponent:t,severity:a??zn(n),message:o,sourceShape:n.name,sourceShapeUri:n.uri,...r}}function zn(n){return n.severity??"Violation"}var Mr={minCount:mn,maxCount:hn,hasValue:ae,in:yn,pattern:gn,minLength:bn,maxLength:En,minInclusive:Rn,maxInclusive:Cn};function Qn(n,e,t,o,r){let a=Ur(n,t,o.path),u=o.severity??zn(e),s=o.path.name,i=[...(o.inValues??[]).map(c=>typeof c=="boolean"?c?1:0:c),...(o.inRefs??[]).map(c=>({ref:l(c)}))],d=(c,p,f)=>{let R=Ne(e,t,c,o.message??p,{resultPath:o.path,value:f?.literal,valueRef:f?.ref},u);return r.push(R),R};for(let c of ue(o)){let p=Mr[c.component];if(c.per==="node"){let f={[G]:a.map(R=>R.kernel),[ce]:i};o.hasValue&&(f[Ie]={ref:l(o.hasValue)}),qn(c,f)||d(p,jr(c,s,o,a.length));continue}for(let f of a){if((c.component==="pattern"||c.component==="minLength"||c.component==="maxLength")&&f.kind!=="string"){d(p,`'${s}' value is not a string; ${c.component} applies to string values.`,f);continue}qn(c,{v:f.kernel,[ce]:i})||d(p,qr(c,s,o,f),f)}}if(o.nodeKind)for(let c of a)Wr(o.nodeKind,c)||d(Kn,`'${s}' value is ${c.kind}; nodeKind requires ${o.nodeKind}.`,c);if(o.datatype)for(let c of a){let p=Br(o.datatype,c);p&&d(kn,`'${s}' ${p}`,c)}if(o.classRef)for(let c of a){let p=Gr(n,o.classRef,c);p&&d(Sn,`'${s}' ${p}`,c)}o.qualified&&Dr(n,o,a,s,d)}function jr(n,e,t,o){switch(n.component){case"minCount":return`'${e}' has ${o} value(s); minCount is ${t.minCount}.`;case"maxCount":return`'${e}' has ${o} value(s); maxCount is ${t.maxCount}.`;case"hasValue":return`'${e}' has no value equal to ${t.hasValue?l(t.hasValue):"(unset)"}.`;default:return`'${e}' violates ${n.component}.`}}function Dr(n,e,t,o,r){let a=e.qualified,u=a.maxCount!==void 0?q:T,s=(d,c)=>{Xn.add(r(u,d,c))};if(!a.shape){s(`'${o}' qualified value shape cannot be evaluated: ${a.problem??"it could not be built"}.`);return}let i=0;for(let d of t){let c=d.ref?l(d.ref):d.embedded?d.embedded.label:JSON.stringify(d.literal),p=Fr(n,d);if(!p){s(`'${o}' value ${c} does not resolve in this scope; whether it conforms to the qualified shape cannot be decided.`,d);continue}let f=Tr(n,a.shape,p);if(f.kind==="undecided"){s(`'${o}' value ${c}: whether it conforms to the qualified shape cannot be decided \u2014 ${f.reason}`,d);continue}f.kind==="conforms"&&i++}a.minCount!==void 0&&i<a.minCount&&r(T,`'${o}' has ${i} value(s) that conform to the qualified shape; qualifiedMinCount is ${a.minCount}.`),a.maxCount!==void 0&&i>a.maxCount&&r(q,`'${o}' has ${i} value(s) that conform to the qualified shape; qualifiedMaxCount is ${a.maxCount}.`)}function Fr(n,e){switch(e.kind){case"reference":return e.subject?de(e.subject):void 0;case"embedded":return e.embedded;default:{let t=JSON.stringify(e.literal);return{key:t,label:t}}}}var Hr={name:"(qualified value shape)",targetNodes:[],targetSubjectsOf:[],targetObjectsOf:[],closed:!1,ignoredProperties:[],properties:[]},Xn=new WeakSet;function Tr(n,e,t){let o=[];e.kind==="property"?Qn(n,Hr,t,e.constraint,o):Gn(n,e.shape,t,o);let r=o.find(a=>Xn.has(a));return r?{kind:"undecided",reason:r.message}:o.length===0?{kind:"conforms"}:{kind:"fails"}}function qr(n,e,t,o){let r=o.ref?l(o.ref):o.embedded?o.embedded.label:JSON.stringify(o.literal);switch(n.component){case"in":return`'${e}' value ${r} is not in the permitted set.`;case"pattern":return`'${e}' value ${r} does not match pattern ${t.pattern?.regex}.`;case"minLength":return`'${e}' value ${r} is shorter than minLength ${t.minLength}.`;case"maxLength":return`'${e}' value ${r} is longer than maxLength ${t.maxLength}.`;case"minInclusive":return`'${e}' value ${r} is below minInclusive ${t.minInclusive} (or not numeric).`;case"maxInclusive":return`'${e}' value ${r} is above maxInclusive ${t.maxInclusive} (or not numeric).`;default:return`'${e}' value ${r} violates ${n.component}.`}}function qn(n,e){let t=o=>{let r=o.varName;if(o.type==="kanonak.org/transformations/VarRef"&&typeof r=="string"&&r in e)return e[r];throw new Nr(`Conformance lowering produced an unexpected leaf '${o.type}'`)};return Lr(n.expr,void 0,t)===1}function Wr(n,e){switch(n){case"IRI":return e.kind==="reference";case"BlankNode":return e.kind==="embedded";case"Literal":return e.kind==="string"||e.kind==="number"||e.kind==="boolean"}}function Br(n,e){if(e.kind==="reference"||e.kind==="embedded")return`value is a ${e.kind}; sh:datatype requires a literal of ${n.name}.`;let t=xe(n);if(t!==void 0)switch(t){case N.Boolean:return e.kind==="boolean"?void 0:`value is not a boolean (${n.name}).`;case N.Integer:return e.kind!=="number"?`value is not a number (${n.name}).`:Number.isInteger(e.literal)?void 0:`value is not an integer (${n.name}).`;case N.Decimal:case N.Double:case N.Float:return e.kind==="number"?void 0:`value is not a number (${n.name}).`;default:return e.kind==="string"?void 0:`value is not a string-carried literal (${n.name}).`}}function Gr(n,e,t){if(t.kind==="embedded"&&t.embedded?.node){let r=A(t.embedded.node);return r.length===0?`value ${t.embedded.label} has no type; sh:class requires an instance of ${e.name}.`:n.membership.isInstance(r,e)?void 0:`value ${t.embedded.label} is not an instance of ${e.name}.`}if(t.kind!=="reference"||!t.ref)return`value is not a reference; sh:class requires an instance of ${e.name}.`;if(n.scope.reasoning)return n.scope.reasoning.isInstanceOf(t.ref,e)?void 0:`value ${l(t.ref)} is not an instance of ${e.name}.`;let o=t.subject;return o?n.membership.isInstance(A(o),e)?void 0:`value ${l(t.ref)} is not an instance of ${e.name}.`:`value ${l(t.ref)} does not resolve in this scope (sh:class ${e.name}).`}function zr(n,e,t){if(!e.node)return;let o=new Set([...n.properties.map(a=>l(a.path)),...n.ignoredProperties.map(a=>l(a))]),r=new Set;for(let a of e.node.statement){let u=Bn(a);if(!u)continue;let s=l(u.subject);o.has(s)||r.has(s)||(r.add(s),t.push(Ne(n,e,ge,`'${e.label}' carries undeclared property '${u.subject.name}' (closed shape).`,{resultPath:u.subject})))}for(let a of e.node.unresolvedPredicates)r.has(a.key)||(r.add(a.key),t.push(Ne(n,e,ge,`'${e.label}' carries unresolvable property '${a.key}' (closed shape).`,{value:a.key})))}var Qr="1.1.0",Xr=new Set([ae,T,q].map(n=>n.name));async function Yn(n){let e=new B(n.repository),t=e.imports(),o=n.result.results.some(i=>Xr.has(i.constraintComponent.name))?"1.2.0":Qr,r=t.ensure(ne,oe,o,"sh"),a=(i,d)=>i&&i.version&&typeof i.version.major=="number"?`${t.ensure(i.publisher,i.package_,L(i.version),i.package_)}.${i.name}`:d,u={},s=[];return n.result.results.forEach((i,d)=>{let c=`result-${d+1}`;s.push(c);let p={type:`${r}.ValidationResult`,[`${r}.focusNode`]:a(i.focusUri,i.focusNode),[`${r}.resultMessage`]:i.message,[`${r}.resultSeverity`]:`${r}.${i.severity}`,[`${r}.sourceConstraintComponent`]:`${r}.${i.constraintComponent.name}`};i.resultPath&&(p[`${r}.resultPath`]=a(i.resultPath,l(i.resultPath))),i.sourceShapeUri&&(p[`${r}.sourceShape`]=a(i.sourceShapeUri,i.sourceShape)),i.valueRef?p[`${r}.value`]=a(i.valueRef,l(i.valueRef)):i.value!==void 0&&(p[`${r}.value`]=i.value),u[c]=p}),u.report={type:`${r}.ValidationReport`,[`${r}.conforms`]:n.result.conforms,...s.length>0?{[`${r}.result`]:s}:{}},e.buildContentAddressed({publisher:n.publisher,book:t,body:u,...n.header!==void 0?{header:n.header}:{},contentHashProperty:"contentHash"})}import{VersionOperator as Pi}from"@kanonak-protocol/types/document/models/enums";var E="kanonak.org",_="view",Jn="core-kanonak",Yr={publisher:E,package_:_,name:"rootView"},Jr={publisher:E,package_:_,name:"bind"},Zr={publisher:E,package_:_,name:"produces"},ea={publisher:E,package_:_,name:"projections"},na={publisher:E,package_:_,name:"where"},oa={publisher:E,package_:_,name:"value"},ta={publisher:E,package_:_,name:"as"},le=class{constructor(e,t=new j){this.repository=e;this.parser=t;this.objectParser=new U(this.parser),this.builder=new B(this.repository,this.parser,this.objectParser)}repository;parser;objectParser;builder;async materialize(e,t={}){let o=await this.objectParser.parseKanonaks(this.repository),r=this.resolveView(o,e),a=h(r,Jr);if(!a)throw new Error(`View ${r.namespace}/${r.name} declares no view.bind; cannot materialize.`);let u=h(r,Zr);if(!u)throw new Error(`View ${r.namespace}/${r.name} is a selection view (no view.produces). In-graph materialization of selection views is not yet supported \u2014 declare a view.produces output class to reshape the result.`);let s=ra(r),i=Zn(o,E,Jn),d=Zn(o,E,_),c=this.builder.imports(),p=c.ensure(E,Jn,i,"ck"),f=c.ensure(E,_,d,"v"),R=c.ref(u),$=new In(this.repository,this.parser,this.objectParser),M=new vn($,o),z=this.readProjections(o,r),Q=sa(r,na),X=this.findInstances(o,a,await this.reason(t)),m={},P=new Set;for(let Y of X){if(!await this.passesWhere(M,o,Q,Y))continue;let pe={type:R};for(let Ae of z){let no=await this.evaluateValue(M,o,Ae.value,Y),Ue=this.builder.serializeValue(eo(no),c);Ue!==void 0&&(pe[c.ref(Ae.as)]=Ue)}let we=k(Y);we&&(pe[`${f}.derivedFrom`]=c.ref(we)),m[this.rowName(Y,P)]=pe}let y={};t.resolvedAt&&(y[`${p}.resolvedAt`]=t.resolvedAt),t.invocationId&&(y[`${p}.id`]=t.invocationId);let K=await this.builder.buildContentAddressed({publisher:s,book:c,body:m,contentHashProperty:`${p}.contentHash`,header:y});return{yaml:K.yaml,contentHash:K.contentHash,packageName:K.packageName,publisher:K.publisher,rowCount:K.resourceCount}}resolveView(e,t){let o=x(e,t);if(!o)throw new Error(`View ${t.publisher}/${t.package_}/${t.name} not found in the catalog.`);let r=h(o,Yr);if(r){let a=x(e,r);if(!a)throw new Error(`ViewPackage ${t.name} names rootView ${r.name}, which is not in the catalog.`);return a}return o}readProjections(e,t){let o=[];for(let r of he(t,ea)){let a=r instanceof v?r:r instanceof I?x(e,r.subject):void 0;if(!a)continue;let u=D(a,oa),s=h(a,ta);u&&s&&o.push({value:u,as:s})}return o}async reason(e){return new W({profile:e.reasoningProfile??"owl-rl-classification"}).reason(this.repository)}findInstances(e,t,o){let r=ia(e),a=[],u=new Set;for(let s of o.getInstancesOfClass(t)){if(u.has(s))continue;u.add(s);let i=r.get(s);i&&a.push(i)}return a.sort((s,i)=>{let d=F(k(s)),c=F(k(i));return d<c?-1:d>c?1:0}),a}async passesWhere(e,t,o,r){for(let a of o){let u=await this.evaluateValue(e,t,a,r);if(!ca(u))return!1}return!0}async evaluateValue(e,t,o,r){let a=Pn(o,"view-projection",{catalog:t,depth:0}),u=new Map([["input",r]]);return e.evaluate(a,u)}rowName(e,t){let o=Pe(e.name)||"row",r=o,a=2;for(;t.has(r);)r=`${o}-${a++}`;return t.add(r),r}};function eo(n){return _e(n)?n.value:Array.isArray(n)?n.map(eo):n}function ra(n){let e=k(n);if(!e)throw new Error(`Could not derive a publisher from view ${n.namespace}/${n.name}.`);return e.publisher}function Zn(n,e,t){let o=aa(n,e,t);if(!o)throw new Error(`Package ${e}/${t} is not in the catalog; it must be importable to materialize a view.`);return o}function aa(n,e,t){let o;for(let r of n){if(!(r instanceof S))continue;let a=k(r);!a||a.publisher!==e||a.package_!==t||!a.version||(!o||J(a.version,o)>0)&&(o=a.version)}return o?L(o):void 0}function ia(n){let e=new Map,t=new Map;for(let o of n){if(!(o instanceof S))continue;let r=k(o);if(!r||!r.version)continue;let a=F(r),u=t.get(a);(!u||J(r.version,u)>0)&&(t.set(a,r.version),e.set(a,o))}return e}function sa(n,e){let t=D(n,e);return t?[t]:he(n,e).filter(o=>o instanceof v)}function ca(n){return n===!0?!0:n===!1||n===void 0||n===null?!1:typeof n=="string"?n.length>0:typeof n=="number"?n!==0:_e(n)?n.value.length>0:Array.isArray(n)?n.length>0:!!n}export{jt as AmbiguousReferenceRule,jo as BooleanStatement,pr as CANONICAL_FORM_VERSION,N as Carrier,Wt as ClassDefinitionRule,Nt as ClassHierarchyCycleRule,mo as CompositeKanonakDocumentRepository,kr as DEFAULT_CONSENT_BINDING_PARAM,No as DefinedKanonak,cr as DiamondNameClashRule,Gt as DisplayLensScopeRule,fo as DocumentLocation,at as EdgeType,v as EmbeddedKanonak,It as EmbeddedKanonakTypeRule,Fo as EmbeddedStatement,xr as EntitlementDeniedError,_r as EntitlementProducer,po as FileSystemKanonakDocumentRepository,lt as GitIgnoreFilter,it as GraphBuilder,_o as HttpKanonakDocumentRepository,$e as INTEGRITY_PREFIX,mr as ImportBook,Vt as ImportExistenceRule,fe as InMemoryKanonakDocumentRepository,So as KANONAK_USER_AGENT,Lo as Kanonak,ft as KanonakDocumentPositions,U as KanonakObjectParser,ur as KanonakObjectValidator,j as KanonakParser,Oo as KanonakUri,kt as KanonakUriBuilder,St as KanonakUrlResolver,Jo as KanonakVocabulary,Yt as LINE_STYLES,Ct as LinkTargetRule,Ho as ListStatement,wo as LiteralKanonak,Po as LocalFirstRepository,vo as LockAwareRepository,rr as LookBandPathRule,nr as LookRenderer,zt as LookSemanticSvgPathRule,Bt as MarkdownLinkRule,To as MarkdownStatement,$t as NamespaceImportCycleRule,Kt as NamespacePrefixRule,rt as NodeType,Mo as NumberStatement,Sr as OAuthDiscovery,ut as OWL_RL_CLASSIFICATION_RULES,Ft as ObjectPropertyValueValidationRule,bt as OntologyValidationError,yt as OntologyValidationResult,sr as OwlOneOfRule,B as PackageBuilder,vt as PackageHeaderRule,Rr as ProducerRepository,Ht as PropertyDomainRule,Ot as PropertyHierarchyCycleRule,Tt as PropertyKindRangeConsistencyRule,pt as PropertyMetadata,Dt as PropertyRangeReferenceRule,wt as PropertyRangeRequiredRule,_t as PropertyTypeSpecificityRule,Co as PublisherConfigResolver,Ko as PublisherIndex,ct as RDFS_RULES,W as Reasoner,dt as ReasoningResult,I as ReferenceKanonak,Do as ReferenceStatement,ko as RepositoryFactory,qt as ReservedNameShadowRule,xt as ResourceNamingRule,qo as ResourceResolver,Zo as ResourceTypeClassifier,oe as SHACL_PACKAGE,ne as SHACL_PUBLISHER,H as SH_NODE_SHAPE,te as SH_PROPERTY_SHAPE,Fe as SH_SHAPE,Uo as ScalarStatement,tr as SequenceNarrativeRule,ir as ShaclShapeRule,Ao as Statement,$o as StringStatement,At as SubClassOfReferenceRule,Ut as SubPropertyOfReferenceRule,S as SubjectKanonak,Pt as SubjectKanonakTypeRequiredRule,br as TokenCredentialProvider,st as TripleStore,Qt as TxExpressionCompilesRule,ar as TxExpressionPathRule,Wo as TypeResolver,Mt as UnresolvedPredicateRule,Lt as UnresolvedReferenceRule,Rt as ValidationCache,Et as ValidationContext,gt as ValidationSeverity,Pi as VersionOperator,le as ViewMaterializer,Cr as allowAllPolicy,bo as assertHttpsUrl,xo as assertPackageIdentity,Vo as buildLocalFirstRepository,er as buildOntologyModel,Yn as buildReportPackageAsync,se as buildShapesModel,dr as canonicalForm,lr as canonicalHash,xe as carrierOf,Io as collectKanonakFiles,J as compareVersions,Nn as computeIntegrity,De as computeIntegrityAsync,fr as contentAddressedName,A as contextTypesOf,gr as createCredentialedFetch,ao as createVersion,Wn as evaluateConformance,tt as extractMarkdownLinks,Er as findDerivation,ot as findMalformedReferences,ht as findMarkdownLinkAt,Ve as foldFlagsIntoPattern,Go as formatKanonakAddress,L as formatVersion,ho as getGlobalCachePath,go as getKanonakUserAgent,so as isCompatibleVersion,co as isMajorCompatible,Eo as kanonakFetch,Vn as loadLockFile,ue as lowerConstraint,Qo as makeUriKey,Kr as noopMeter,hr as normalizeHost,yr as parseAuthChallenge,Bo as parseKanonakAddress,Me as parseLockFile,io as parseVersionString,mt as parseWithPositions,lo as pickHighestDocument,et as propertiesInScope,Jt as readSequenceConnectors,O as referenceUris,Xt as resolveDisplayValue,nt as resolvePropertyStep,Pe as sanitizeName,uo as satisfiesVersionOperator,Ln as saveLockFile,wn as scopeFromCatalog,An as scopeFromDocumentAsync,On as scopeFromRepositoryAsync,je as serializeLockFile,Ro as setKanonakFetchRetries,yo as setKanonakUserAgent,Re as subjectAddress,k as subjectUri,Ce as superClassChain,or as supportedBandKeys,Xo as tripleKey,zo as typeReferenceUris,F as uriKey,Yo as uriTriple,ie as valuesOf,oo as versionOperatorFromChar,to as versionOperatorToChar,ro as versionsEqual,Ke as walkDefinedKanonaks,Zt as walkSequence};
@@ -1,4 +1,5 @@
1
1
  import { Kanonak } from './Kanonak.js';
2
+ import type { MarkdownLink } from '../statements/MarkdownStatement.js';
2
3
  /**
3
4
  * A literal value (string, number, or boolean) that appears in the
4
5
  * object position of a list-valued DatatypeProperty.
@@ -25,4 +26,13 @@ export declare class LiteralKanonak extends Kanonak {
25
26
  carrier?: string;
26
27
  /** Raw lexical token, the precise canonicalization input; `value` may be a lossy native projection. */
27
28
  lexical?: string;
29
+ /**
30
+ * The `[[reference]]` placeholders of a core-prose value (Markdown /
31
+ * SubstitutableString), resolved through the document's import closure —
32
+ * exactly what a single prose value carries on its `MarkdownStatement`.
33
+ * Present (possibly empty) only when the list's range is a prose datatype,
34
+ * so its presence marks a prose literal. Derived from the text, so it is not
35
+ * part of the value's canonical identity.
36
+ */
37
+ links?: MarkdownLink[];
28
38
  }
@@ -1,31 +1,36 @@
1
1
  import type { Kanonak } from './Kanonak.js';
2
2
  import type { DefinedKanonak } from './DefinedKanonak.js';
3
- /** A DefinedKanonak visited during a walk, with a human-facing locator path. */
3
+ /** A DefinedKanonak visited during a walk, with its address and a locator path. */
4
4
  export interface WalkNode {
5
5
  readonly kanonak: DefinedKanonak;
6
6
  /**
7
- * Authored locator: `subjectName` for a subject, then a dotted PROPERTY
8
- * path into the embeddeds — `Position.look.bands[0].stats[0]`.
9
- *
10
- * Named by the predicate that carries each embedded rather than the
11
- * embedded's own name, because an expression node (and most embeddeds)
12
- * is anonymous: naming those `<embedded>/<embedded>/<embedded>` located
13
- * nothing. Matches the path format the property-shaped rules already
14
- * build by hand.
7
+ * The node's address — exactly what `valuesOf` gives the same node: a
8
+ * subject's canonical key (`publisher/package/name`), an embedded value's
9
+ * key plus its uri-fragments path (`…/Position#look.bands[0].stats[0]`).
10
+ */
11
+ readonly address: string;
12
+ /**
13
+ * The subject-relative locator the validation messages use: the subject's
14
+ * name, then the same fragment path (`Position.look.bands[0].stats[0]`).
15
+ * Derived from {@link address}, so the two never disagree.
15
16
  */
16
17
  readonly path: string;
17
18
  }
18
19
  /**
19
20
  * Depth-first visit of every DefinedKanonak reachable from `roots`: each
20
- * subject, then every embedded kanonak nested in its statements (single
21
- * embeddeds and embedded list items), at any depth. The visitor sees one node
22
- * at a time and should inspect only that node's OWN statements — the walk
23
- * handles the recursion.
21
+ * subject, then every embedded value nested in it — single embeddeds, list
22
+ * items and dict-keyed entries, across every statement for each property —
23
+ * at any depth. The visitor sees one node at a time and should inspect only
24
+ * that node's OWN statements; the walk handles the recursion.
25
+ *
26
+ * Addresses come from `addressedValuesOf`, the computation `valuesOf` uses,
27
+ * so a node reached by this walk and the same node read through `valuesOf`
28
+ * have one address (typescript#124). A property carrying several statements
29
+ * (the open-world merge) gets addresses that stay unique across them.
24
30
  *
25
- * Lives here rather than beside the validation helpers that first used it
26
- * because it is a pure object-model traversal with no validation dependency,
27
- * and the parser needs it too (its second-chance property pass scans
28
- * `unresolvedPredicates` at every depth). `validation/documentModel` re-exports
29
- * it, so this stays the single walk.
31
+ * A pure object-model traversal: the parser uses it (its second-chance
32
+ * property pass scans `unresolvedPredicates` at every depth), the validation
33
+ * rules use it, and it is exported so a consumer never writes its own
34
+ * recursion over the statement model.
30
35
  */
31
36
  export declare function walkDefinedKanonaks(roots: Kanonak[], visit: (node: WalkNode) => void): void;
@@ -111,6 +111,14 @@ export declare class KanonakObjectParser implements IKanonakObjectParser {
111
111
  * left undefined, so MarkdownLinkRule can report it.
112
112
  */
113
113
  private parseSubstitutableValue;
114
+ /**
115
+ * Every `[[reference]]` placeholder in a prose value, resolved through the
116
+ * document's import closure — the ONE link resolution for a single prose
117
+ * value (its `MarkdownStatement`) and each prose list item (its
118
+ * `LiteralKanonak`). A placeholder that does not resolve is still recorded,
119
+ * with `target` left undefined, so MarkdownLinkRule can report it.
120
+ */
121
+ private resolveMarkdownLinks;
114
122
  private parseObjectValue;
115
123
  /**
116
124
  * Build the embedded `tx.StringLiteral` that a `tx.Expression`-ranged object
@@ -1 +1 @@
1
- import{a as c,b as d,c as e,d as f}from"../chunk-VEGFYZXG.js";import{k as b}from"../chunk-JHQPXEMA.js";import{a}from"../chunk-HF5FJBS2.js";import"../chunk-MQBWSCNY.js";import"../chunk-54D47DLS.js";import"../chunk-FUUTGGJS.js";import"../chunk-F67UH4FD.js";import"../chunk-QILEJIFU.js";export{d as KanonakDocumentPositions,b as KanonakObjectParser,a as KanonakParser,c as PropertyMetadata,f as findMarkdownLinkAt,e as parseWithPositions};
1
+ import{a as c,b as d,c as e,d as f}from"../chunk-YBHIELES.js";import{j as b}from"../chunk-Q2FG7DME.js";import{a}from"../chunk-HF5FJBS2.js";import"../chunk-7TU55KLO.js";import"../chunk-XNEWQEB6.js";import"../chunk-FUUTGGJS.js";import"../chunk-F67UH4FD.js";import"../chunk-QILEJIFU.js";export{d as KanonakDocumentPositions,b as KanonakObjectParser,a as KanonakParser,c as PropertyMetadata,f as findMarkdownLinkAt,e as parseWithPositions};
@@ -1 +1 @@
1
- import{d as a,e as b,f as c,g as d,h as e,i as f,j as g,k as h,l as i}from"../chunk-2Y6R3K5A.js";import"../chunk-QHABFCRC.js";import"../chunk-JHQPXEMA.js";import"../chunk-HF5FJBS2.js";import"../chunk-MQBWSCNY.js";import"../chunk-54D47DLS.js";import"../chunk-FUUTGGJS.js";import"../chunk-F67UH4FD.js";import"../chunk-QILEJIFU.js";export{h as EntitlementDeniedError,i as EntitlementProducer,c as ImportBook,a as PackageBuilder,e as ProducerRepository,f as allowAllPolicy,b as contentAddressedName,g as noopMeter,d as sanitizeName};
1
+ import{d as a,e as b,f as c,g as d,h as e,i as f,j as g,k as h,l as i}from"../chunk-VENZTHCC.js";import"../chunk-QHABFCRC.js";import"../chunk-Q2FG7DME.js";import"../chunk-HF5FJBS2.js";import"../chunk-7TU55KLO.js";import"../chunk-XNEWQEB6.js";import"../chunk-FUUTGGJS.js";import"../chunk-F67UH4FD.js";import"../chunk-QILEJIFU.js";export{h as EntitlementDeniedError,i as EntitlementProducer,c as ImportBook,a as PackageBuilder,e as ProducerRepository,f as allowAllPolicy,b as contentAddressedName,g as noopMeter,d as sanitizeName};
@@ -1 +1 @@
1
- import{a as g,b as h,c as i,d as j,e as k}from"../chunk-26SO3A4B.js";import"../chunk-JHQPXEMA.js";import"../chunk-HF5FJBS2.js";import{e as a,f as b,g as c,i as d,ja as e,ka as f}from"../chunk-MQBWSCNY.js";import"../chunk-54D47DLS.js";import"../chunk-FUUTGGJS.js";import"../chunk-F67UH4FD.js";import"../chunk-QILEJIFU.js";export{f as KanonakVocabulary,i as OWL_RL_CLASSIFICATION_RULES,h as RDFS_RULES,k as Reasoner,j as ReasoningResult,g as TripleStore,e as canonicalizeBuiltinUri,b as makeUriKey,c as tripleKey,a as uriKey,d as uriTriple};
1
+ import{a as g,b as h,c as i,d as j,e as k}from"../chunk-4QXD6HKI.js";import"../chunk-Q2FG7DME.js";import"../chunk-HF5FJBS2.js";import{c as a,d as b,e as c,g as d,ha as e,ia as f}from"../chunk-7TU55KLO.js";import"../chunk-XNEWQEB6.js";import"../chunk-FUUTGGJS.js";import"../chunk-F67UH4FD.js";import"../chunk-QILEJIFU.js";export{f as KanonakVocabulary,i as OWL_RL_CLASSIFICATION_RULES,h as RDFS_RULES,k as Reasoner,j as ReasoningResult,g as TripleStore,e as canonicalizeBuiltinUri,b as makeUriKey,c as tripleKey,a as uriKey,d as uriTriple};
@@ -1 +1 @@
1
- import{a as F}from"../chunk-XK24CN3C.js";import{a as o}from"../chunk-SC5M74NM.js";import{a as G}from"../chunk-PEJALHXK.js";import{a as q,b as r,c as s,d as t,la as u,ma as v,na as w,oa as x,pa as y,qa as z,ra as A,sa as B,ta as C,ua as D,va as E}from"../chunk-MQBWSCNY.js";import"../chunk-54D47DLS.js";import{a as p}from"../chunk-FUUTGGJS.js";import{a as l,b as m,c as n}from"../chunk-F67UH4FD.js";import{a,b,c,d,e,f,g,h,i,j,k}from"../chunk-QILEJIFU.js";export{l as IMPORT_MODES,p as KanonakUri,F as KanonakUriBuilder,G as KanonakUrlResolver,q as ResourceResolver,v as ResourceTypeClassifier,r as TypeResolver,o as assertPackageIdentity,c as compareVersions,E as contextTypesOf,u as corePropertyClassOf,f as createVersion,t as formatKanonakAddress,e as formatVersion,h as isCompatibleVersion,B as isDatatypePropertySubject,m as isLinkImport,i as isMajorCompatible,A as isObjectPropertySubject,z as isPropertySubject,n as linkedPackages,s as parseKanonakAddress,g as parseVersionString,k as pickHighestDocument,C as propertiesInScope,y as propertyClassOf,D as resolvePropertyStep,j as satisfiesVersionOperator,w as subjectUri,x as superClassChain,a as versionOperatorFromChar,b as versionOperatorToChar,d as versionsEqual};
1
+ import{a as F}from"../chunk-XK24CN3C.js";import{a as o}from"../chunk-SC5M74NM.js";import{a as G}from"../chunk-PEJALHXK.js";import{a as q,b as r,ja as u,ka as v,la as w,ma as x,na as y,oa as z,pa as A,qa as B,ra as C,sa as D,ta as E}from"../chunk-7TU55KLO.js";import{p as s,q as t}from"../chunk-XNEWQEB6.js";import{a as p}from"../chunk-FUUTGGJS.js";import{a as l,b as m,c as n}from"../chunk-F67UH4FD.js";import{a,b,c,d,e,f,g,h,i,j,k}from"../chunk-QILEJIFU.js";export{l as IMPORT_MODES,p as KanonakUri,F as KanonakUriBuilder,G as KanonakUrlResolver,q as ResourceResolver,v as ResourceTypeClassifier,r as TypeResolver,o as assertPackageIdentity,c as compareVersions,E as contextTypesOf,u as corePropertyClassOf,f as createVersion,t as formatKanonakAddress,e as formatVersion,h as isCompatibleVersion,B as isDatatypePropertySubject,m as isLinkImport,i as isMajorCompatible,A as isObjectPropertySubject,z as isPropertySubject,n as linkedPackages,s as parseKanonakAddress,g as parseVersionString,k as pickHighestDocument,C as propertiesInScope,y as propertyClassOf,D as resolvePropertyStep,j as satisfiesVersionOperator,w as subjectUri,x as superClassChain,a as versionOperatorFromChar,b as versionOperatorToChar,d as versionsEqual};
@@ -1,4 +1,4 @@
1
- import"../chunk-XK24CN3C.js";import"../chunk-SC5M74NM.js";import{d as g}from"../chunk-D7QLWVPK.js";import"../chunk-QHABFCRC.js";import"../chunk-6VIUXP4N.js";import"../chunk-JHQPXEMA.js";import"../chunk-HF5FJBS2.js";import"../chunk-PEJALHXK.js";import{na as m,va as S}from"../chunk-MQBWSCNY.js";import{c as v,o as p,w as E}from"../chunk-54D47DLS.js";import"../chunk-FUUTGGJS.js";import"../chunk-F67UH4FD.js";import{c as x}from"../chunk-QILEJIFU.js";import{homedir as P}from"os";import{join as d}from"path";import{existsSync as M,mkdirSync as D,readFileSync as j,writeFileSync as O}from"fs";import{createHash as C}from"crypto";import{pathToFileURL as B}from"url";var h="Xenova/all-MiniLM-L6-v2",w="q8",b=32;async function F(r){let{pipeline:e,env:t}=r.transformers;t.cacheDir=r.modelCacheDir??d(P(),".kanonak","models");let n=await e("feature-extraction",h,{dtype:w});return async s=>(await n(s,{pooling:"mean",normalize:!0})).tolist()}async function z(r){let e=d(r,"node_modules","@huggingface","transformers"),t=JSON.parse(j(d(e,"package.json"),"utf-8")),n=I(t);if(!n)throw new Error(`@huggingface/transformers at ${e} exposes no resolvable ESM entry.`);let s=await import(B(d(e,n)).href);return typeof s.pipeline=="function"?s:s.default}function I(r){let e=r.exports,t=n=>typeof n=="string"?n:n?.default;return typeof e=="string"?e:t(e?.node?.import)??t(e?.import)??t(e?.default)??r.module??r.main}var y=null;async function U(){return y||(y=(async()=>{let r;try{r=await import("@huggingface/transformers")}catch(e){throw new Error(`Semantic search requires the embedding runtime, which is an optional dependency.
1
+ import"../chunk-XK24CN3C.js";import"../chunk-SC5M74NM.js";import{d as g}from"../chunk-ROKDCCJN.js";import"../chunk-QHABFCRC.js";import"../chunk-6VIUXP4N.js";import"../chunk-Q2FG7DME.js";import"../chunk-HF5FJBS2.js";import"../chunk-PEJALHXK.js";import{la as m,ta as S}from"../chunk-7TU55KLO.js";import{c as v,r as p,z as E}from"../chunk-XNEWQEB6.js";import"../chunk-FUUTGGJS.js";import"../chunk-F67UH4FD.js";import{c as x}from"../chunk-QILEJIFU.js";import{homedir as P}from"os";import{join as d}from"path";import{existsSync as M,mkdirSync as D,readFileSync as j,writeFileSync as O}from"fs";import{createHash as C}from"crypto";import{pathToFileURL as B}from"url";var h="Xenova/all-MiniLM-L6-v2",w="q8",b=32;async function F(r){let{pipeline:e,env:t}=r.transformers;t.cacheDir=r.modelCacheDir??d(P(),".kanonak","models");let n=await e("feature-extraction",h,{dtype:w});return async s=>(await n(s,{pooling:"mean",normalize:!0})).tolist()}async function z(r){let e=d(r,"node_modules","@huggingface","transformers"),t=JSON.parse(j(d(e,"package.json"),"utf-8")),n=I(t);if(!n)throw new Error(`@huggingface/transformers at ${e} exposes no resolvable ESM entry.`);let s=await import(B(d(e,n)).href);return typeof s.pipeline=="function"?s:s.default}function I(r){let e=r.exports,t=n=>typeof n=="string"?n:n?.default;return typeof e=="string"?e:t(e?.node?.import)??t(e?.import)??t(e?.default)??r.module??r.main}var y=null;async function U(){return y||(y=(async()=>{let r;try{r=await import("@huggingface/transformers")}catch(e){throw new Error(`Semantic search requires the embedding runtime, which is an optional dependency.
2
2
  Install it with:
3
3
  npm install @huggingface/transformers
4
4
  (underlying import error: ${e.message})`)}return F({transformers:r})})()),y}function H(r,e){let t=0;for(let n=0;n<r.length;n++)t+=r[n]*e[n];return t}function R(r,e){return e?r.version?e.version?x(r.version,e.version)>0:!0:!1:!0}function K(r,e){let t=g(r,e),n=[t.label],s=S(e);if(s.length>0){let i=E(r,s[0]),a=i?g(r,i).label:s[0].name;a&&n.push(`\u2014 a ${a}.`)}return t.summary&&n.push(t.summary),n.join(" ")}function q(r){let e=new Map;for(let t of r){if(!(t instanceof v))continue;let n=m(t);if(!n)continue;let s=p(n),i=e.get(s);(!i||R(n,m(i)))&&e.set(s,t)}return[...e.values()].sort((t,n)=>{let s=m(t)?p(m(t)):t.name,i=m(n)?p(m(n)):n.name;return s.localeCompare(i)})}var k=class{entries=[];embedder;constructor(e={}){this.embedder=e.embedder}resolveEmbedder(){return this.embedder?Promise.resolve(this.embedder):U()}get size(){return this.entries.length}async build(e,t={}){let n=q(e);if(t.include&&(n=n.filter(t.include)),n.length===0)return this.entries=[],{size:0,cached:!1};let s=n.map(o=>K(e,o)),i=t.cacheDir,a;if(i){let o=C("sha256").update(h+"|"+w+`
@@ -1,4 +1,4 @@
1
- import{c as Pe}from"../chunk-V3DH67P3.js";import{a as be,d as X,f as Se,h as ee}from"../chunk-IS3AQKB4.js";import{e as ve,g as $e,m as U,n as Z}from"../chunk-BZ3YTI3C.js";import"../chunk-XK24CN3C.js";import"../chunk-SC5M74NM.js";import{a as H,b as G}from"../chunk-KIBR3HAT.js";import{r as te}from"../chunk-D7QLWVPK.js";import"../chunk-QHABFCRC.js";import{a as ye}from"../chunk-6VIUXP4N.js";import{k as oe}from"../chunk-JHQPXEMA.js";import{a as O}from"../chunk-HF5FJBS2.js";import{a as xe}from"../chunk-PEJALHXK.js";import{c as Re}from"../chunk-MQBWSCNY.js";import{c as we,x as re}from"../chunk-54D47DLS.js";import"../chunk-FUUTGGJS.js";import"../chunk-F67UH4FD.js";import{c as V,e as E,f as W,g as ke}from"../chunk-QILEJIFU.js";import{readFileSync as de,writeFileSync as Ie,mkdirSync as Me}from"fs";import{join as se}from"path";import Fe from"js-yaml";var _e=[{publisher:"kanonak.org",package_:"core-kanonak"},{publisher:"kanonak.org",package_:"site"},{publisher:"kanonak.org",package_:"link"},{publisher:"kanonak.org",package_:"look-tokens"},{publisher:"kanonak.org",package_:"look-styles"},{publisher:"kanonak.org",package_:"look"},{publisher:"kanonak.org",package_:"universal-look"}];function q(o){return _e}function C(o){return`${o.publisher}/${o.package_}`}function z(o,e=[]){let c={"kanonak.org/look-styles":"pages render UNSTYLED \u2014 generated CSS stops at the :root token block","kanonak.org/look-tokens":"the :root block loses the universal design-token floor (colors, fonts, spacing)","kanonak.org/universal-look":"resources without their own look render as an empty HTML comment","kanonak.org/look":"band vocabulary (Hero, PropertyList, \u2026) is unresolvable \u2014 declared looks cannot render","kanonak.org/site":"the site vocabulary (content, navigation) is unresolvable \u2014 the base stylesheet cannot bind","kanonak.org/core-kanonak":"the Package/Publisher classes are unresolvable \u2014 package and publisher pages degrade","kanonak.org/link":"link vocabulary is unresolvable \u2014 cross-reference styling degrades"},r=[];for(let t of o)if(t.origin==="missing"){let a=C(t),u=c[a]??"whatever this package contributes to rendering is lost";r.push(`Render-stack package ${a} is MISSING (${t.reason??"unknown reason"}) \u2014 ${u}. Fix: kanonak install ${a} (as the user running the render), or restore network access to ${t.publisher}.`)}else t.resolvedButNotInCatalog&&r.push(`Render-stack package ${C(t)} resolved (${t.origin}) but is NOT in the parsed catalog \u2014 this is a closure-scoping bug; please report it.`);for(let t of e)r.push(`Import edge ${t.fromNamespace} \u2192 ${t.publisher}/${t.packageName} ${t.constraint} did NOT resolve (${t.reason==="no-compatible-version"?"no compatible version in the repository":"resolution threw"}) \u2014 every statement ${t.fromNamespace} authors against ${t.publisher}/${t.packageName} entities is dropped from the parse as an unresolved predicate (a look declaration loses its bands and pages render empty; see typescript#91). Fix: add a ${t.constraint}-compatible version of ${t.publisher}/${t.packageName} to the workspace or cache (kanonak install ${t.publisher}/${t.packageName}), or bump the import in ${t.fromNamespace}.`);return r}function ne(o){let{publisher:e,availablePublishers:c,catalog:r,lookRenderer:t,localNamespaces:a,rawByNsKey:u,renderStack:d,producers:k,lockSource:y,configSource:s}=o,l=new Map,f=new Map,p=new Map,m=new Set;for(let S of r){if(!(S instanceof we))continue;let w=S.namespace||"";if(!a.has(w))continue;l.set(`${w}/${S.name}`,S);let P=w.split("/")[1]??"",[_,F]=P.split("@");if(!_||!F)continue;let D=ke(F);D&&(m.has(P)||(m.add(P),f.has(_)||f.set(_,[]),f.get(_).push({verStr:F,version:D})),S.name===_&&p.set(P,S))}for(let S of f.values())S.sort((w,P)=>V(P.version,w.version));return{publisher:e,availablePublishers:c,catalog:r,lookRenderer:t,localNamespaces:a,rawByNsKey:u,bySubject:l,pkgVersions:f,pkgSelfByVer:p,renderStack:d,...k?{producers:k}:{},...y?{lockSource:y}:{},...s?{configSource:s}:{}}}async function pe(o,e={}){let c=new O,r=new ye(c),t=[],a=[];for(let i of ee(o)){let h;try{h=de(i,"utf-8")}catch{continue}let n;try{n=c.parse(h).metadata?.namespace_}catch{continue}if(!n?.version)continue;let g=n.version;a.push({publisher:n.publisher,package_:n.package_,verStr:E(g),version:g,source:h})}a.sort((i,h)=>V(h.version,i.version));for(let i of a)await r.saveDocumentAsync(c.parse(i.source),`${i.publisher}/${i.package_}@${i.verStr}`),t.push({publisher:i.publisher,package_:i.package_,verStr:i.verStr,source:i.source});let u=[...new Set(t.map(i=>i.publisher))].sort(),d=e.publisher;if(d){if(!u.includes(d))throw new Error(`Publisher "${d}" not found in workspace. Available: ${u.join(", ")||"(none)"}`)}else if(u.length===1)d=u[0];else throw u.length===0?new Error(`No Kanonak packages found under ${o}`):new Error(`Workspace has multiple publishers (${u.join(", ")}). Pass --publisher <domain> to choose which one to serve.`);let k=new Set,y=new Map;for(let i of t)i.publisher===d&&(k.add(`${i.publisher}/${i.package_}@${i.verStr}`),y.set(`${i.package_}@${i.verStr}`,i.source));let s=X(),l=new be(s,!0,c),f={};e.httpCache&&(f.getFromCache=e.httpCache.getFromCache,f.onFetch=e.httpCache.onFetch),e.fetchFn&&(f.fetchFn=e.fetchFn);let p=e.repository??new Se(r,l,new Z(f)),m=e.log??(()=>{}),S=q(void 0),w=[],P=i=>i.map(h=>h.metadata.namespace_?.version).filter(h=>h!==void 0).sort((h,n)=>V(n,h)).map(E);if(!e.repository){m(`[render-stack] resolving ${S.length} ambient look-stack package(s); cache: ${s}`);let i=e.fetchFn?new U({fetchFn:e.fetchFn}):new U;for(let h of S){let n=C(h),g=await r.getDocumentsByNamespaceAsync(h.publisher,h.package_);if(g.length>0){let v=P(g);w.push({...h,origin:"workspace",versions:v}),m(`[render-stack] ${n} \u2014 workspace (${v.join(", ")})`);continue}let b=await l.getDocumentsByNamespaceAsync(h.publisher,h.package_);if(b.length>0){let v=P(b);w.push({...h,origin:"cache",versions:v}),m(`[render-stack] ${n} \u2014 cache (${v.join(", ")})`);continue}try{let $=(await i.getLock(h.publisher))?.packages[`${h.publisher}/${h.package_}`];if(!$){let j=`publisher ${h.publisher} reachable but its lock does not pin ${h.package_}`;w.push({...h,origin:"missing",reason:j}),m(`[render-stack] ${n} \u2014 MISSING: ${j}`);continue}let I=$.version,T=$.resolved,Q=await(e.fetchFn?e.fetchFn(T,h.publisher):ve(T));if(!Q.ok){let j=`fetch ${T} failed: HTTP ${Q.status} ${Q.statusText}`;w.push({...h,origin:"missing",reason:j}),m(`[render-stack] ${n} \u2014 MISSING: ${j}`);continue}let fe=await Q.text();await r.saveDocumentAsync(c.parse(fe),`${h.publisher}/${h.package_}@${I}`);try{let j=se(s,h.publisher);Me(j,{recursive:!0}),Ie(se(j,`${h.package_}@${I}.kan.yml`),fe,"utf-8"),w.push({...h,origin:"fetched",versions:[I]}),m(`[render-stack] ${n}@${I} \u2014 fetched from ${T}, installed to cache`)}catch(j){w.push({...h,origin:"fetched",versions:[I]}),m(`[render-stack] ${n}@${I} \u2014 fetched from ${T}, but cache ${s} is NOT WRITABLE (${j.message}); usable for this load only \u2014 every load will re-fetch it`)}}catch(v){let $=`fetch failed: ${v.message}`;w.push({...h,origin:"missing",reason:$}),m(`[render-stack] ${n} \u2014 MISSING: ${$}`)}}}let _=(await r.getAllDocumentsAsync()).filter(i=>i.metadata.namespace_?.publisher===d);for(let i of S)_.push(...await p.getDocumentsByNamespaceAsync(i.publisher,i.package_));let F=[],D=await H(_,p,{onUnresolvedEdge:i=>F.push(i)}),A=p;if(!e.repository){for(let i of S)D.add(C(i));A=new G(p,D)}let B=await new oe(c).parseKanonaks(A),ce=new te(B),le=(i,h)=>re(B,{publisher:i,package_:h,name:h}).length>0,N;if(e.repository){N=[];for(let i of S){let h=await p.getDocumentsByNamespaceAsync(i.publisher,i.package_);N.push(h.length>0?{...i,origin:"repository",versions:P(h)}:{...i,origin:"missing",reason:"not present in the caller-supplied repository"})}}else N=w.map(i=>i.origin==="missing"||le(i.publisher,i.package_)?i:{...i,resolvedButNotInCatalog:!0});let Y=z(N,F);for(let i of Y)m(`[render-stack] WARNING: ${i}`);let J={contractSource:"universal-default",cachePath:s,packages:N,warnings:Y},K;try{K=de(se(o,"kanonak.lock"),"utf-8")}catch{K=De(d,t,c)}let L;try{L=de(se(o,".well-known","kanonak.json"),"utf-8")}catch{L=void 0}return ne({publisher:d,availablePublishers:u,catalog:B,lookRenderer:ce,localNamespaces:k,rawByNsKey:y,renderStack:J,...K?{lockSource:K}:{},...L?{configSource:L}:{}})}function De(o,e,c){let r=new Map;for(let a of e)a.publisher===o&&(r.has(a.package_)||r.set(a.package_,{verStr:a.verStr,source:a.source}));if(r.size===0)return;let t={};for(let a of[...r.keys()].sort()){let{verStr:u,source:d}=r.get(a),k={},y;try{y=c.parse(d).metadata?.imports}catch{y=void 0}for(let l of y?.[o]??[]){let f=r.get(l.packageName);f&&(k[`${o}/${l.packageName}`]=f.verStr)}let s={};for(let l of Object.keys(k).sort())s[l]=k[l];t[`${o}/${a}`]={version:u,resolved:`https://${o}/${a}/${u}.kan.yml`,integrity:Pe(d),dependencies:s}}return Fe.dump({version:"1",lastUpdated:"",packages:t},{lineWidth:-1,sortKeys:!1,quotingType:'"'})}import{existsSync as Ee,readFileSync as Ke,writeFileSync as Ve,mkdirSync as Ae}from"fs";import{join as je}from"path";async function ue(o,e={}){let c=new O,r=Re(o),t=r.kind==="resource"?r.uri.publisher:r.publisher,a=e.log??(()=>{}),u=e.cacheRoot??X(),d=(n,g,b)=>je(u,n,`${g}@${b}.kan.yml`),k=new Set,y=new Set,s=new Map,l=new Z({getFromCache:(n,g,b)=>{let v=d(n,g,b),$=Ee(v)?Ke(v,"utf-8"):null;return $!==null&&k.add(`${n}/${g}`),$},onFetch:(n,g,b,v)=>{y.add(`${n}/${g}`);try{let $=je(u,n);Ae($,{recursive:!0}),Ve(d(n,g,b),v,"utf-8")}catch($){s.set(`${n}/${g}`,$.message),a(`[render] fetched ${n}/${g}@${b} but cache ${u} is NOT WRITABLE (${$.message}); usable for this load only \u2014 every load will re-fetch it`)}},...e.fetchFn?{fetchFn:e.fetchFn}:{}}),f=new U(e.fetchFn?{fetchFn:e.fetchFn}:void 0),p;if(r.kind==="resource"){let n=r.uri.version;p=[n?{package_:r.uri.package_,version:`${n.major}.${n.minor}.${n.patch}`}:{package_:r.uri.package_}]}else if(r.kind==="package"){let n=r.version;p=[n?{package_:r.package_,version:`${n.major}.${n.minor}.${n.patch}`}:{package_:r.package_}]}else p=((await f.getConfig(t)).featured_packages??[]).map(g=>({package_:g}));let m=async(n,g,b)=>{try{let v=b?c.buildImport(g,"=",b,n):c.buildImport(g,"*","0.0.0",n),$=await l.getHighestCompatibleVersionAsync(n,v);return $?{doc:$}:{doc:null,error:`${n} did not resolve ${g}${b?`@${b}`:""} (not in its index, or unreachable)`}}catch(v){return{doc:null,error:v.message}}},S=[],w=[];for(let n of p){let{doc:g,error:b}=await m(t,n.package_,n.version);g?S.push(g):b&&w.push(b)}if(S.length===0)throw new Error(`Could not fetch any package for address "${o}" from publisher "${t}".`+(w.length>0?` Reasons: ${w.join("; ")}`:""));let P=q(),_="universal-default",F=n=>n.map(g=>g.metadata.namespace_?.version).filter(g=>g!==void 0).sort((g,b)=>V(b,g)).map(E);a(`[render-stack] resolving ${P.length} ambient look-stack package(s) (contract: ${_}); cache: ${u}`);let D=[],A=[];for(let n of P){let g=C(n),{doc:b,error:v}=await m(n.publisher,n.package_,void 0);if(b){D.push(b);let $=F([b]),I=y.has(g)?"fetched":k.has(g)?"cache":"fetched";A.push({...n,origin:I,versions:$}),a(`[render-stack] ${g} \u2014 ${I} (${$.join(", ")})`+(s.has(g)?" [cache write FAILED \u2014 will re-fetch next load]":""))}else A.push({...n,origin:"missing",reason:v??"unresolved"}),a(`[render-stack] ${g} \u2014 MISSING: ${v??"unresolved"}`)}let B=[],ce=await H([...S,...D],l,{onUnresolvedEdge:n=>B.push(n)}),le=new G(l,ce),N=await new oe(c).parseKanonaks(le),Y=new te(N),J=A.map(n=>n.origin==="missing"||re(N,{publisher:n.publisher,package_:n.package_,name:n.package_}).length>0?n:{...n,resolvedButNotInCatalog:!0}),K=z(J,B);for(let n of K)a(`[render-stack] WARNING: ${n}`);let L={contractSource:_,cachePath:u,packages:J,warnings:K},i=new Set,h=new Map;for(let n of await l.getAllDocumentsAsync()){let g=n.metadata.namespace_;if(!g?.version||g.publisher!==t)continue;let b=E(g.version),v=`${g.publisher}/${g.package_}@${b}`;i.add(v);let $=await l.getDocumentContentAsync(v);$!==null&&h.set(`${g.package_}@${b}`,$)}return ne({publisher:t,availablePublishers:[t],catalog:N,lookRenderer:Y,localNamespaces:i,rawByNsKey:h,renderStack:L})}import{VersionOperator as ie}from"@kanonak-protocol/types/document/models/enums";function ae(o){let{lookRenderer:e,publisher:c,renderStack:r,catalog:t}=o,a=e.explainStylesheet(e.publisherSubject(c)),u=[...a.tokens.entries()].map(([p,m])=>({name:p,value:m.value,source:`${m.sourceNamespace}/${m.sourceName}`,level:m.level})),d=a.baseStylesheet,k={present:d.css!==void 0,...d.sourceNamespace!==void 0?{source:d.sourceNamespace}:{},...d.scope!==void 0?{scope:d.scope}:{},...d.css!==void 0?{bytes:d.css.length}:{},...d.problem!==void 0?{problem:d.problem}:{},candidates:d.candidates},y=new Map;for(let p of t){let m=p.namespace;m&&y.set(m,(y.get(m)??0)+1)}let s=[...y.entries()].map(([p,m])=>({namespace:p,resources:m})).sort((p,m)=>p.namespace.localeCompare(m.namespace)),l=e.expressionFailures().map(p=>({carrier:p.carrier,reason:p.reason})),f=l.map(p=>`Expression carrier "${p.carrier}" did not compile: ${p.reason} Consequence: that value renders as nothing (and a parent operation consuming it may drop its whole tier). Fix: use a tx.Expression node class the runner implements, or remove the carrier.`);return{publisher:c,renderStack:{contractSource:r.contractSource,cachePath:r.cachePath,packages:r.packages.map(p=>({package_:C(p),origin:p.origin,...p.versions!==void 0?{versions:p.versions}:{},...p.reason!==void 0?{reason:p.reason}:{},...p.resolvedButNotInCatalog!==void 0?{resolvedButNotInCatalog:p.resolvedButNotInCatalog}:{}}))},stylesheet:{tokens:u,baseStylesheet:k,...a.look?{look:{sourceClass:`${a.look.sourceClass.publisher}/${a.look.sourceClass.package_}/${a.look.sourceClass.name}`}}:{}},expressionCarriers:l,catalog:s,warnings:[...r.warnings,...a.warnings.filter(p=>!r.warnings.includes(p)),...f]}}function Be(o){return o.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function ge(o){let e=Be,c=o.warnings.length===0,r=o.expressionCarriers.map(s=>`<tr><td><code>${e(s.carrier)}</code></td><td>${e(s.reason)}</td></tr>`).join(`
1
+ import{c as Pe}from"../chunk-V3DH67P3.js";import{a as be,d as X,f as Se,h as ee}from"../chunk-IS3AQKB4.js";import{e as ve,g as $e,m as U,n as Z}from"../chunk-BZ3YTI3C.js";import"../chunk-XK24CN3C.js";import"../chunk-SC5M74NM.js";import{a as H,b as G}from"../chunk-KIBR3HAT.js";import{r as te}from"../chunk-ROKDCCJN.js";import"../chunk-QHABFCRC.js";import{a as ye}from"../chunk-6VIUXP4N.js";import{j as oe}from"../chunk-Q2FG7DME.js";import{a as O}from"../chunk-HF5FJBS2.js";import{a as xe}from"../chunk-PEJALHXK.js";import"../chunk-7TU55KLO.js";import{A as re,c as we,p as Re}from"../chunk-XNEWQEB6.js";import"../chunk-FUUTGGJS.js";import"../chunk-F67UH4FD.js";import{c as V,e as E,f as W,g as ke}from"../chunk-QILEJIFU.js";import{readFileSync as de,writeFileSync as Ie,mkdirSync as Me}from"fs";import{join as se}from"path";import Fe from"js-yaml";var _e=[{publisher:"kanonak.org",package_:"core-kanonak"},{publisher:"kanonak.org",package_:"site"},{publisher:"kanonak.org",package_:"link"},{publisher:"kanonak.org",package_:"look-tokens"},{publisher:"kanonak.org",package_:"look-styles"},{publisher:"kanonak.org",package_:"look"},{publisher:"kanonak.org",package_:"universal-look"}];function q(o){return _e}function C(o){return`${o.publisher}/${o.package_}`}function z(o,e=[]){let c={"kanonak.org/look-styles":"pages render UNSTYLED \u2014 generated CSS stops at the :root token block","kanonak.org/look-tokens":"the :root block loses the universal design-token floor (colors, fonts, spacing)","kanonak.org/universal-look":"resources without their own look render as an empty HTML comment","kanonak.org/look":"band vocabulary (Hero, PropertyList, \u2026) is unresolvable \u2014 declared looks cannot render","kanonak.org/site":"the site vocabulary (content, navigation) is unresolvable \u2014 the base stylesheet cannot bind","kanonak.org/core-kanonak":"the Package/Publisher classes are unresolvable \u2014 package and publisher pages degrade","kanonak.org/link":"link vocabulary is unresolvable \u2014 cross-reference styling degrades"},r=[];for(let t of o)if(t.origin==="missing"){let a=C(t),u=c[a]??"whatever this package contributes to rendering is lost";r.push(`Render-stack package ${a} is MISSING (${t.reason??"unknown reason"}) \u2014 ${u}. Fix: kanonak install ${a} (as the user running the render), or restore network access to ${t.publisher}.`)}else t.resolvedButNotInCatalog&&r.push(`Render-stack package ${C(t)} resolved (${t.origin}) but is NOT in the parsed catalog \u2014 this is a closure-scoping bug; please report it.`);for(let t of e)r.push(`Import edge ${t.fromNamespace} \u2192 ${t.publisher}/${t.packageName} ${t.constraint} did NOT resolve (${t.reason==="no-compatible-version"?"no compatible version in the repository":"resolution threw"}) \u2014 every statement ${t.fromNamespace} authors against ${t.publisher}/${t.packageName} entities is dropped from the parse as an unresolved predicate (a look declaration loses its bands and pages render empty; see typescript#91). Fix: add a ${t.constraint}-compatible version of ${t.publisher}/${t.packageName} to the workspace or cache (kanonak install ${t.publisher}/${t.packageName}), or bump the import in ${t.fromNamespace}.`);return r}function ne(o){let{publisher:e,availablePublishers:c,catalog:r,lookRenderer:t,localNamespaces:a,rawByNsKey:u,renderStack:d,producers:k,lockSource:y,configSource:s}=o,l=new Map,f=new Map,p=new Map,m=new Set;for(let S of r){if(!(S instanceof we))continue;let w=S.namespace||"";if(!a.has(w))continue;l.set(`${w}/${S.name}`,S);let P=w.split("/")[1]??"",[_,F]=P.split("@");if(!_||!F)continue;let D=ke(F);D&&(m.has(P)||(m.add(P),f.has(_)||f.set(_,[]),f.get(_).push({verStr:F,version:D})),S.name===_&&p.set(P,S))}for(let S of f.values())S.sort((w,P)=>V(P.version,w.version));return{publisher:e,availablePublishers:c,catalog:r,lookRenderer:t,localNamespaces:a,rawByNsKey:u,bySubject:l,pkgVersions:f,pkgSelfByVer:p,renderStack:d,...k?{producers:k}:{},...y?{lockSource:y}:{},...s?{configSource:s}:{}}}async function pe(o,e={}){let c=new O,r=new ye(c),t=[],a=[];for(let i of ee(o)){let h;try{h=de(i,"utf-8")}catch{continue}let n;try{n=c.parse(h).metadata?.namespace_}catch{continue}if(!n?.version)continue;let g=n.version;a.push({publisher:n.publisher,package_:n.package_,verStr:E(g),version:g,source:h})}a.sort((i,h)=>V(h.version,i.version));for(let i of a)await r.saveDocumentAsync(c.parse(i.source),`${i.publisher}/${i.package_}@${i.verStr}`),t.push({publisher:i.publisher,package_:i.package_,verStr:i.verStr,source:i.source});let u=[...new Set(t.map(i=>i.publisher))].sort(),d=e.publisher;if(d){if(!u.includes(d))throw new Error(`Publisher "${d}" not found in workspace. Available: ${u.join(", ")||"(none)"}`)}else if(u.length===1)d=u[0];else throw u.length===0?new Error(`No Kanonak packages found under ${o}`):new Error(`Workspace has multiple publishers (${u.join(", ")}). Pass --publisher <domain> to choose which one to serve.`);let k=new Set,y=new Map;for(let i of t)i.publisher===d&&(k.add(`${i.publisher}/${i.package_}@${i.verStr}`),y.set(`${i.package_}@${i.verStr}`,i.source));let s=X(),l=new be(s,!0,c),f={};e.httpCache&&(f.getFromCache=e.httpCache.getFromCache,f.onFetch=e.httpCache.onFetch),e.fetchFn&&(f.fetchFn=e.fetchFn);let p=e.repository??new Se(r,l,new Z(f)),m=e.log??(()=>{}),S=q(void 0),w=[],P=i=>i.map(h=>h.metadata.namespace_?.version).filter(h=>h!==void 0).sort((h,n)=>V(n,h)).map(E);if(!e.repository){m(`[render-stack] resolving ${S.length} ambient look-stack package(s); cache: ${s}`);let i=e.fetchFn?new U({fetchFn:e.fetchFn}):new U;for(let h of S){let n=C(h),g=await r.getDocumentsByNamespaceAsync(h.publisher,h.package_);if(g.length>0){let v=P(g);w.push({...h,origin:"workspace",versions:v}),m(`[render-stack] ${n} \u2014 workspace (${v.join(", ")})`);continue}let b=await l.getDocumentsByNamespaceAsync(h.publisher,h.package_);if(b.length>0){let v=P(b);w.push({...h,origin:"cache",versions:v}),m(`[render-stack] ${n} \u2014 cache (${v.join(", ")})`);continue}try{let $=(await i.getLock(h.publisher))?.packages[`${h.publisher}/${h.package_}`];if(!$){let j=`publisher ${h.publisher} reachable but its lock does not pin ${h.package_}`;w.push({...h,origin:"missing",reason:j}),m(`[render-stack] ${n} \u2014 MISSING: ${j}`);continue}let I=$.version,T=$.resolved,Q=await(e.fetchFn?e.fetchFn(T,h.publisher):ve(T));if(!Q.ok){let j=`fetch ${T} failed: HTTP ${Q.status} ${Q.statusText}`;w.push({...h,origin:"missing",reason:j}),m(`[render-stack] ${n} \u2014 MISSING: ${j}`);continue}let fe=await Q.text();await r.saveDocumentAsync(c.parse(fe),`${h.publisher}/${h.package_}@${I}`);try{let j=se(s,h.publisher);Me(j,{recursive:!0}),Ie(se(j,`${h.package_}@${I}.kan.yml`),fe,"utf-8"),w.push({...h,origin:"fetched",versions:[I]}),m(`[render-stack] ${n}@${I} \u2014 fetched from ${T}, installed to cache`)}catch(j){w.push({...h,origin:"fetched",versions:[I]}),m(`[render-stack] ${n}@${I} \u2014 fetched from ${T}, but cache ${s} is NOT WRITABLE (${j.message}); usable for this load only \u2014 every load will re-fetch it`)}}catch(v){let $=`fetch failed: ${v.message}`;w.push({...h,origin:"missing",reason:$}),m(`[render-stack] ${n} \u2014 MISSING: ${$}`)}}}let _=(await r.getAllDocumentsAsync()).filter(i=>i.metadata.namespace_?.publisher===d);for(let i of S)_.push(...await p.getDocumentsByNamespaceAsync(i.publisher,i.package_));let F=[],D=await H(_,p,{onUnresolvedEdge:i=>F.push(i)}),A=p;if(!e.repository){for(let i of S)D.add(C(i));A=new G(p,D)}let B=await new oe(c).parseKanonaks(A),ce=new te(B),le=(i,h)=>re(B,{publisher:i,package_:h,name:h}).length>0,N;if(e.repository){N=[];for(let i of S){let h=await p.getDocumentsByNamespaceAsync(i.publisher,i.package_);N.push(h.length>0?{...i,origin:"repository",versions:P(h)}:{...i,origin:"missing",reason:"not present in the caller-supplied repository"})}}else N=w.map(i=>i.origin==="missing"||le(i.publisher,i.package_)?i:{...i,resolvedButNotInCatalog:!0});let Y=z(N,F);for(let i of Y)m(`[render-stack] WARNING: ${i}`);let J={contractSource:"universal-default",cachePath:s,packages:N,warnings:Y},K;try{K=de(se(o,"kanonak.lock"),"utf-8")}catch{K=De(d,t,c)}let L;try{L=de(se(o,".well-known","kanonak.json"),"utf-8")}catch{L=void 0}return ne({publisher:d,availablePublishers:u,catalog:B,lookRenderer:ce,localNamespaces:k,rawByNsKey:y,renderStack:J,...K?{lockSource:K}:{},...L?{configSource:L}:{}})}function De(o,e,c){let r=new Map;for(let a of e)a.publisher===o&&(r.has(a.package_)||r.set(a.package_,{verStr:a.verStr,source:a.source}));if(r.size===0)return;let t={};for(let a of[...r.keys()].sort()){let{verStr:u,source:d}=r.get(a),k={},y;try{y=c.parse(d).metadata?.imports}catch{y=void 0}for(let l of y?.[o]??[]){let f=r.get(l.packageName);f&&(k[`${o}/${l.packageName}`]=f.verStr)}let s={};for(let l of Object.keys(k).sort())s[l]=k[l];t[`${o}/${a}`]={version:u,resolved:`https://${o}/${a}/${u}.kan.yml`,integrity:Pe(d),dependencies:s}}return Fe.dump({version:"1",lastUpdated:"",packages:t},{lineWidth:-1,sortKeys:!1,quotingType:'"'})}import{existsSync as Ee,readFileSync as Ke,writeFileSync as Ve,mkdirSync as Ae}from"fs";import{join as je}from"path";async function ue(o,e={}){let c=new O,r=Re(o),t=r.kind==="resource"?r.uri.publisher:r.publisher,a=e.log??(()=>{}),u=e.cacheRoot??X(),d=(n,g,b)=>je(u,n,`${g}@${b}.kan.yml`),k=new Set,y=new Set,s=new Map,l=new Z({getFromCache:(n,g,b)=>{let v=d(n,g,b),$=Ee(v)?Ke(v,"utf-8"):null;return $!==null&&k.add(`${n}/${g}`),$},onFetch:(n,g,b,v)=>{y.add(`${n}/${g}`);try{let $=je(u,n);Ae($,{recursive:!0}),Ve(d(n,g,b),v,"utf-8")}catch($){s.set(`${n}/${g}`,$.message),a(`[render] fetched ${n}/${g}@${b} but cache ${u} is NOT WRITABLE (${$.message}); usable for this load only \u2014 every load will re-fetch it`)}},...e.fetchFn?{fetchFn:e.fetchFn}:{}}),f=new U(e.fetchFn?{fetchFn:e.fetchFn}:void 0),p;if(r.kind==="resource"){let n=r.uri.version;p=[n?{package_:r.uri.package_,version:`${n.major}.${n.minor}.${n.patch}`}:{package_:r.uri.package_}]}else if(r.kind==="package"){let n=r.version;p=[n?{package_:r.package_,version:`${n.major}.${n.minor}.${n.patch}`}:{package_:r.package_}]}else p=((await f.getConfig(t)).featured_packages??[]).map(g=>({package_:g}));let m=async(n,g,b)=>{try{let v=b?c.buildImport(g,"=",b,n):c.buildImport(g,"*","0.0.0",n),$=await l.getHighestCompatibleVersionAsync(n,v);return $?{doc:$}:{doc:null,error:`${n} did not resolve ${g}${b?`@${b}`:""} (not in its index, or unreachable)`}}catch(v){return{doc:null,error:v.message}}},S=[],w=[];for(let n of p){let{doc:g,error:b}=await m(t,n.package_,n.version);g?S.push(g):b&&w.push(b)}if(S.length===0)throw new Error(`Could not fetch any package for address "${o}" from publisher "${t}".`+(w.length>0?` Reasons: ${w.join("; ")}`:""));let P=q(),_="universal-default",F=n=>n.map(g=>g.metadata.namespace_?.version).filter(g=>g!==void 0).sort((g,b)=>V(b,g)).map(E);a(`[render-stack] resolving ${P.length} ambient look-stack package(s) (contract: ${_}); cache: ${u}`);let D=[],A=[];for(let n of P){let g=C(n),{doc:b,error:v}=await m(n.publisher,n.package_,void 0);if(b){D.push(b);let $=F([b]),I=y.has(g)?"fetched":k.has(g)?"cache":"fetched";A.push({...n,origin:I,versions:$}),a(`[render-stack] ${g} \u2014 ${I} (${$.join(", ")})`+(s.has(g)?" [cache write FAILED \u2014 will re-fetch next load]":""))}else A.push({...n,origin:"missing",reason:v??"unresolved"}),a(`[render-stack] ${g} \u2014 MISSING: ${v??"unresolved"}`)}let B=[],ce=await H([...S,...D],l,{onUnresolvedEdge:n=>B.push(n)}),le=new G(l,ce),N=await new oe(c).parseKanonaks(le),Y=new te(N),J=A.map(n=>n.origin==="missing"||re(N,{publisher:n.publisher,package_:n.package_,name:n.package_}).length>0?n:{...n,resolvedButNotInCatalog:!0}),K=z(J,B);for(let n of K)a(`[render-stack] WARNING: ${n}`);let L={contractSource:_,cachePath:u,packages:J,warnings:K},i=new Set,h=new Map;for(let n of await l.getAllDocumentsAsync()){let g=n.metadata.namespace_;if(!g?.version||g.publisher!==t)continue;let b=E(g.version),v=`${g.publisher}/${g.package_}@${b}`;i.add(v);let $=await l.getDocumentContentAsync(v);$!==null&&h.set(`${g.package_}@${b}`,$)}return ne({publisher:t,availablePublishers:[t],catalog:N,lookRenderer:Y,localNamespaces:i,rawByNsKey:h,renderStack:L})}import{VersionOperator as ie}from"@kanonak-protocol/types/document/models/enums";function ae(o){let{lookRenderer:e,publisher:c,renderStack:r,catalog:t}=o,a=e.explainStylesheet(e.publisherSubject(c)),u=[...a.tokens.entries()].map(([p,m])=>({name:p,value:m.value,source:`${m.sourceNamespace}/${m.sourceName}`,level:m.level})),d=a.baseStylesheet,k={present:d.css!==void 0,...d.sourceNamespace!==void 0?{source:d.sourceNamespace}:{},...d.scope!==void 0?{scope:d.scope}:{},...d.css!==void 0?{bytes:d.css.length}:{},...d.problem!==void 0?{problem:d.problem}:{},candidates:d.candidates},y=new Map;for(let p of t){let m=p.namespace;m&&y.set(m,(y.get(m)??0)+1)}let s=[...y.entries()].map(([p,m])=>({namespace:p,resources:m})).sort((p,m)=>p.namespace.localeCompare(m.namespace)),l=e.expressionFailures().map(p=>({carrier:p.carrier,reason:p.reason})),f=l.map(p=>`Expression carrier "${p.carrier}" did not compile: ${p.reason} Consequence: that value renders as nothing (and a parent operation consuming it may drop its whole tier). Fix: use a tx.Expression node class the runner implements, or remove the carrier.`);return{publisher:c,renderStack:{contractSource:r.contractSource,cachePath:r.cachePath,packages:r.packages.map(p=>({package_:C(p),origin:p.origin,...p.versions!==void 0?{versions:p.versions}:{},...p.reason!==void 0?{reason:p.reason}:{},...p.resolvedButNotInCatalog!==void 0?{resolvedButNotInCatalog:p.resolvedButNotInCatalog}:{}}))},stylesheet:{tokens:u,baseStylesheet:k,...a.look?{look:{sourceClass:`${a.look.sourceClass.publisher}/${a.look.sourceClass.package_}/${a.look.sourceClass.name}`}}:{}},expressionCarriers:l,catalog:s,warnings:[...r.warnings,...a.warnings.filter(p=>!r.warnings.includes(p)),...f]}}function Be(o){return o.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function ge(o){let e=Be,c=o.warnings.length===0,r=o.expressionCarriers.map(s=>`<tr><td><code>${e(s.carrier)}</code></td><td>${e(s.reason)}</td></tr>`).join(`
2
2
  `),t=o.warnings.length===0?'<p class="ok">\u2713 No problems detected \u2014 the render stack is fully resolved and pages should be styled.</p>':o.warnings.map(s=>`<div class="warn">\u26A0 ${e(s)}</div>`).join(`
3
3
  `),a=o.renderStack.packages.map(s=>{let l=s.origin!=="missing"&&!s.resolvedButNotInCatalog,f=s.origin==="missing"?'<span class="bad">MISSING</span>':s.resolvedButNotInCatalog?`<span class="bad">${e(s.origin)} (not in catalog)</span>`:`<span class="good">${e(s.origin)}</span>`,p=s.reason?e(s.reason):e((s.versions??[]).join(", "));return`<tr class="${l?"":"row-bad"}"><td><code>${e(s.package_)}</code></td><td>${f}</td><td>${p}</td></tr>`}).join(`
4
4
  `),u=o.stylesheet.baseStylesheet,d=u.present?`<p><span class="good">\u2713 present</span> \u2014 <code>${e(u.source??"")}</code> (${u.bytes} bytes, ${e(u.scope??"")})</p>`:`<p><span class="bad">\u2717 MISSING</span>${u.problem?` \u2014 ${e(u.problem)}`:""}${u.candidates.length>0?`<br>candidates considered: ${u.candidates.map(s=>`<code>${e(s)}</code>`).join(", ")}`:""}</p><p>Without the base stylesheet, generated CSS stops at the <code>:root</code> token block and pages appear unstyled.</p>`,k=o.stylesheet.tokens.map(s=>`<tr><td><code>--kan-${e(s.name)}</code></td><td><code>${e(s.value)}</code></td><td><code>${e(s.source)}</code></td><td>${e(s.level)}</td></tr>`).join(`
@@ -1,4 +1,4 @@
1
- import{a as pe}from"../chunk-ZYDJUGIA.js";import"../chunk-VEGFYZXG.js";import{a as ve,b as M,c as Un,l as X,m as Vn,n as Rn,o as le,p as q,r as G}from"../chunk-D7QLWVPK.js";import"../chunk-QHABFCRC.js";import"../chunk-6VIUXP4N.js";import{a as de,c as $n,d as Tn,e as Bn,f as xn,k as fe}from"../chunk-JHQPXEMA.js";import{a as se}from"../chunk-HF5FJBS2.js";import"../chunk-PEJALHXK.js";import{e as U}from"../chunk-MQBWSCNY.js";import{b as Y,c as D,d as ce,e as E,f as ue,i as $,j as T,k as B,l as w,m as me,n as x,p as N,q as S,w as A}from"../chunk-54D47DLS.js";import"../chunk-FUUTGGJS.js";import"../chunk-F67UH4FD.js";import{g as ie}from"../chunk-QILEJIFU.js";var Le="kanonak.org",Oe="document-ast",i=e=>({publisher:Le,package_:Oe,name:e}),m={Document:i("Document"),Block:i("Block"),Inline:i("Inline"),StructuredValue:i("StructuredValue"),Heading:i("Heading"),Paragraph:i("Paragraph"),RawBlock:i("RawBlock"),Text:i("Text"),StructuredMap:i("StructuredMap"),StructuredEntry:i("StructuredEntry"),StructuredList:i("StructuredList"),StringScalar:i("StringScalar"),IntegerScalar:i("IntegerScalar"),EscapeHint:i("EscapeHint"),MediaType:i("MediaType"),metadata:i("metadata"),children:i("children"),level:i("level"),inlines:i("inlines"),text:i("text"),entries:i("entries"),key:i("key"),value:i("value"),escapeHint:i("escapeHint"),items:i("items"),stringValue:i("stringValue"),integerValue:i("integerValue"),rawContent:i("rawContent"),mediaType:i("mediaType"),mimeType:i("mimeType"),ESC_RAW:i("esc-raw"),ESC_YAML_SAFE:i("esc-yaml-safe"),ESC_TOML_STRING:i("esc-toml-string"),ESC_TOML_MULTILINE:i("esc-toml-multiline"),ESC_JSON:i("esc-json"),ESC_DYNAMODB_BOOL:i("esc-dynamodb-bool"),ESC_DYNAMODB_NUMBER:i("esc-dynamodb-number"),ESC_DYNAMODB_NULL:i("esc-dynamodb-null"),TEXT_PLAIN:i("text-plain"),TEXT_MARKDOWN:i("text-markdown"),TEXT_HTML:i("text-html"),TEXT_CSS:i("text-css"),APPLICATION_JSON:i("application-json"),TEXT_YAML:i("text-yaml"),IMAGE_SVG_XML:i("image-svg-xml"),ResourceLink:i("ResourceLink"),target:i("target"),linkLabel:i("linkLabel"),PropertyList:i("PropertyList"),propertyEntries:i("propertyEntries"),PropertyEntry:i("PropertyEntry"),propertyKey:i("propertyKey"),propertyValue:i("propertyValue"),Table:i("Table"),tableColumnLabels:i("tableColumnLabels"),tableRows:i("tableRows"),TableRow:i("TableRow"),tableCells:i("tableCells")};function ge(e,n){return e.publisher===n.publisher&&e.package_===n.package_&&e.name===n.name}var V=class{backendUri="kanonak.org/transformations/markdown-with-frontmatter";render(n,t){let r=Ie(n.metadata,t),o=Ke(n.children),s=["---",...r,"---","",o].join(`
1
+ import{a as pe}from"../chunk-IN5VVPYH.js";import"../chunk-YBHIELES.js";import{a as ve,b as M,c as Un,l as X,m as Vn,n as Rn,o as le,p as q,r as G}from"../chunk-ROKDCCJN.js";import"../chunk-QHABFCRC.js";import"../chunk-6VIUXP4N.js";import{b as $n,c as Tn,d as Bn,e as xn,j as fe}from"../chunk-Q2FG7DME.js";import{a as se}from"../chunk-HF5FJBS2.js";import"../chunk-PEJALHXK.js";import{c as U}from"../chunk-7TU55KLO.js";import{b as Y,c as D,d as ce,e as E,f as ue,i as $,j as T,k as B,l as w,m as me,n as x,o as de,s as N,t as S,z as A}from"../chunk-XNEWQEB6.js";import"../chunk-FUUTGGJS.js";import"../chunk-F67UH4FD.js";import{g as ie}from"../chunk-QILEJIFU.js";var Le="kanonak.org",Oe="document-ast",i=e=>({publisher:Le,package_:Oe,name:e}),m={Document:i("Document"),Block:i("Block"),Inline:i("Inline"),StructuredValue:i("StructuredValue"),Heading:i("Heading"),Paragraph:i("Paragraph"),RawBlock:i("RawBlock"),Text:i("Text"),StructuredMap:i("StructuredMap"),StructuredEntry:i("StructuredEntry"),StructuredList:i("StructuredList"),StringScalar:i("StringScalar"),IntegerScalar:i("IntegerScalar"),EscapeHint:i("EscapeHint"),MediaType:i("MediaType"),metadata:i("metadata"),children:i("children"),level:i("level"),inlines:i("inlines"),text:i("text"),entries:i("entries"),key:i("key"),value:i("value"),escapeHint:i("escapeHint"),items:i("items"),stringValue:i("stringValue"),integerValue:i("integerValue"),rawContent:i("rawContent"),mediaType:i("mediaType"),mimeType:i("mimeType"),ESC_RAW:i("esc-raw"),ESC_YAML_SAFE:i("esc-yaml-safe"),ESC_TOML_STRING:i("esc-toml-string"),ESC_TOML_MULTILINE:i("esc-toml-multiline"),ESC_JSON:i("esc-json"),ESC_DYNAMODB_BOOL:i("esc-dynamodb-bool"),ESC_DYNAMODB_NUMBER:i("esc-dynamodb-number"),ESC_DYNAMODB_NULL:i("esc-dynamodb-null"),TEXT_PLAIN:i("text-plain"),TEXT_MARKDOWN:i("text-markdown"),TEXT_HTML:i("text-html"),TEXT_CSS:i("text-css"),APPLICATION_JSON:i("application-json"),TEXT_YAML:i("text-yaml"),IMAGE_SVG_XML:i("image-svg-xml"),ResourceLink:i("ResourceLink"),target:i("target"),linkLabel:i("linkLabel"),PropertyList:i("PropertyList"),propertyEntries:i("propertyEntries"),PropertyEntry:i("PropertyEntry"),propertyKey:i("propertyKey"),propertyValue:i("propertyValue"),Table:i("Table"),tableColumnLabels:i("tableColumnLabels"),tableRows:i("tableRows"),TableRow:i("TableRow"),tableCells:i("tableCells")};function ge(e,n){return e.publisher===n.publisher&&e.package_===n.package_&&e.name===n.name}var V=class{backendUri="kanonak.org/transformations/markdown-with-frontmatter";render(n,t){let r=Ie(n.metadata,t),o=Ke(n.children),s=["---",...r,"---","",o].join(`
2
2
  `);return t?.trailingNewline&&(s.endsWith(`
3
3
  `)||(s+=`
4
4
  `)),s}};function Ie(e,n){if(!e)return[];let t=new Map;for(let c of e.entries)t.set(P(c.key),c);let r=new Map;if(n?.metadataRenames)for(let[c,u]of n.metadataRenames)r.set(P(c),u);let a=(n?.metadataKeys??e.entries.map(c=>c.key)).map(P),s=[];for(let c of a){let u=t.get(c);if(!u)continue;let f=r.get(c),l=P(f??c),d=ye(u.value,u.escapeHint);d!==void 0&&s.push(`${l}: ${d}`)}return s}function P(e){let n=e.lastIndexOf(".");return n===-1?e:e.substring(n+1)||e}function ye(e,n){switch(e.kind){case"StringScalar":return _e(e.stringValue,n);case"IntegerScalar":return String(e.integerValue);case"StructuredList":{let t=[];for(let r of e.items){let o=ye(r,n);o!==void 0&&t.push(o)}return t.join(", ")}case"StructuredMap":return;default:return}}function _e(e,n){return!n||ge(n,m.ESC_RAW)?e:ge(n,m.ESC_YAML_SAFE)?Ce(e):e}function Ce(e){return e.includes(`
@@ -8,7 +8,7 @@
8
8
  * Throws `TransformationLoadErrorV3` with a breadcrumb path on the
9
9
  * first shape violation.
10
10
  */
11
- import { EmbeddedKanonak, SubjectKanonak, type Kanonak } from '../../kanonaks/index.js';
11
+ import { DefinedKanonak, SubjectKanonak, type Kanonak } from '../../kanonaks/index.js';
12
12
  import type { CompiledTransformationV3, CompiledExpressionV3 } from './CompiledTransformationV3.js';
13
13
  export declare class TransformationLoadErrorV3 extends Error {
14
14
  readonly path: string;
@@ -17,6 +17,12 @@ export declare class TransformationLoadErrorV3 extends Error {
17
17
  export interface CompileContext {
18
18
  readonly catalog: Kanonak[];
19
19
  readonly depth: number;
20
+ /**
21
+ * The named expressions being compiled on the current path, by canonical
22
+ * key — how a cycle through references (A uses B uses A) is reported
23
+ * instead of recursing forever. Callers leave it unset.
24
+ */
25
+ readonly visiting?: ReadonlySet<string> | undefined;
20
26
  }
21
27
  /**
22
28
  * Top-level entry point. Determines whether the SubjectKanonak is an
@@ -36,4 +42,4 @@ export declare function compileTransformationV3(transformation: SubjectKanonak,
36
42
  * must contain every class/property the Expression references so the
37
43
  * loader can resolve URI references.
38
44
  */
39
- export declare function compileExpression(emb: EmbeddedKanonak, path: string, ctx: CompileContext): CompiledExpressionV3;
45
+ export declare function compileExpression(node: DefinedKanonak, path: string, ctx: CompileContext): CompiledExpressionV3;
@@ -3,7 +3,8 @@ import { SubjectKanonak } from '../kanonaks/SubjectKanonak.js';
3
3
  import { EmbeddedKanonak } from '../kanonaks/EmbeddedKanonak.js';
4
4
  import type { DefinedKanonak } from '../kanonaks/DefinedKanonak.js';
5
5
  import type { KanonakUri } from '../resolution/KanonakUri.js';
6
- import { type EntityUri } from './UriHelpers.js';
6
+ import type { MarkdownLink } from '../statements/MarkdownStatement.js';
7
+ import { type EntityUri, type RawPropertyValue } from './UriHelpers.js';
7
8
  /**
8
9
  * One value of a property, whatever form it was authored in (typescript#123).
9
10
  *
@@ -19,22 +20,28 @@ import { type EntityUri } from './UriHelpers.js';
19
20
  * the validator reports — returned all the same, so a consumer that wants
20
21
  * only resources filters by kind in its own code.
21
22
  *
22
- * Every value carries its ADDRESS: the node's address plus the protocol's
23
- * fragment path for this value (see {@link valuesOf}).
23
+ * Every value carries its ADDRESS — the node's address plus the protocol's
24
+ * fragment path for this value (see {@link valuesOf}) — and `fromList`:
25
+ * whether it was authored as an item of a list rather than as the property's
26
+ * single value. An editor writing a value back needs the second (editing a
27
+ * list item vs setting a single value); the address already reflects it.
24
28
  */
25
29
  export type PropertyValue = {
26
30
  kind: 'subject';
27
31
  node: SubjectKanonak;
28
32
  uri: KanonakUri;
29
33
  address: string;
34
+ fromList: boolean;
30
35
  } | {
31
36
  kind: 'embedded';
32
37
  node: EmbeddedKanonak;
33
38
  address: string;
39
+ fromList: boolean;
34
40
  } | {
35
41
  kind: 'unresolved';
36
42
  uri: KanonakUri;
37
43
  address: string;
44
+ fromList: boolean;
38
45
  } | {
39
46
  kind: 'literal';
40
47
  value: string | number | boolean;
@@ -42,7 +49,15 @@ export type PropertyValue = {
42
49
  carrier?: string | undefined;
43
50
  /** The raw lexical token as authored. */
44
51
  lexical?: string | undefined;
52
+ /**
53
+ * A prose value's `[[reference]]` placeholders, resolved through the
54
+ * import closure by the parser (single values and list items alike).
55
+ * Present exactly when the value is prose (core-prose Markdown /
56
+ * SubstitutableString).
57
+ */
58
+ links?: readonly MarkdownLink[] | undefined;
45
59
  address: string;
60
+ fromList: boolean;
46
61
  };
47
62
  /**
48
63
  * Every value of a property on a node, in authored order, each resolved and
@@ -72,3 +87,19 @@ export type PropertyValue = {
72
87
  * (`alice#address`).
73
88
  */
74
89
  export declare function valuesOf(node: DefinedKanonak, property: EntityUri, catalog: Kanonak[], nodeAddress: string): PropertyValue[];
90
+ /**
91
+ * A subject's own address — its canonical key `publisher/package/name` —
92
+ * the root that every value address under it extends (`valuesOf`,
93
+ * `walkDefinedKanonaks`, and a conformance finding's focus node).
94
+ */
95
+ export declare function subjectAddress(subject: SubjectKanonak): string;
96
+ /**
97
+ * THE address computation: every raw value of a property with its fragment
98
+ * address under `nodeAddress`, per the protocol's uri-fragments convention
99
+ * (see {@link valuesOf}). Shared by `valuesOf` and `walkDefinedKanonaks`, so
100
+ * one node has one address whichever way it is reached.
101
+ */
102
+ export declare function addressedValuesOf(node: DefinedKanonak, property: EntityUri, nodeAddress: string): {
103
+ value: RawPropertyValue;
104
+ address: string;
105
+ }[];
@@ -4,6 +4,7 @@ import { DefinedKanonak } from '../kanonaks/DefinedKanonak.js';
4
4
  import { ReferenceKanonak } from '../kanonaks/ReferenceKanonak.js';
5
5
  import { Kanonak } from '../kanonaks/Kanonak.js';
6
6
  import { KanonakUri } from '../resolution/KanonakUri.js';
7
+ import { type MarkdownLink } from '../statements/MarkdownStatement.js';
7
8
  import type { IStatement } from '../statements/IStatement.js';
8
9
  /**
9
10
  * Canonical URI identity for an ontology entity.
@@ -93,6 +94,8 @@ export interface RawLiteral {
93
94
  value: string | number | boolean;
94
95
  carrier?: string | undefined;
95
96
  lexical?: string | undefined;
97
+ /** A prose value's resolved `[[links]]` — present exactly when the value is prose. */
98
+ links?: readonly MarkdownLink[] | undefined;
96
99
  }
97
100
  /**
98
101
  * Every value of a property on a defined kanonak, in statement order — THE
@@ -1,5 +1,5 @@
1
1
  export { typeReferenceUris, referenceUris, rawValuesOf, uriKey, uriMatches, toCanonicalUrl, hasType, hasProperty, findSubjectsByType, findSubjectByUri, findAllResourcesByCanonicalUri, getDatatypeValue, getStringValue, getReferenceUri, getEmbeddedValue, getListValues, findStatement, } from './UriHelpers.js';
2
2
  export type { EntityUri, CanonicalUriParts, RawPropertyValue, RawLiteral } from './UriHelpers.js';
3
- export { valuesOf } from './PropertyValues.js';
3
+ export { valuesOf, subjectAddress } from './PropertyValues.js';
4
4
  export type { PropertyValue } from './PropertyValues.js';
5
5
  export { SingleDocumentRepository } from './SingleDocumentRepository.js';
@@ -1 +1 @@
1
- import{A as m,B as n,C as o,D as p,E as q,F as r,G as s,o as a,p as b,q as c,r as d,s as e,t as f,u as g,v as h,w as i,x as j,y as k,z as l}from"../chunk-54D47DLS.js";import"../chunk-FUUTGGJS.js";import"../chunk-QILEJIFU.js";export{s as SingleDocumentRepository,j as findAllResourcesByCanonicalUri,k as findStatement,i as findSubjectByUri,h as findSubjectsByType,m as getDatatypeValue,p as getEmbeddedValue,q as getListValues,o as getReferenceUri,n as getStringValue,l as hasProperty,g as hasType,f as rawValuesOf,e as referenceUris,c as toCanonicalUrl,d as typeReferenceUris,a as uriKey,b as uriMatches,r as valuesOf};
1
+ import{A as j,B as k,C as l,D as m,E as n,F as o,G as p,H as q,I as r,J as s,L as t,r as a,s as b,t as c,u as d,v as e,w as f,x as g,y as h,z as i}from"../chunk-XNEWQEB6.js";import"../chunk-FUUTGGJS.js";import"../chunk-QILEJIFU.js";export{t as SingleDocumentRepository,j as findAllResourcesByCanonicalUri,k as findStatement,i as findSubjectByUri,h as findSubjectsByType,m as getDatatypeValue,p as getEmbeddedValue,q as getListValues,o as getReferenceUri,n as getStringValue,l as hasProperty,g as hasType,f as rawValuesOf,e as referenceUris,s as subjectAddress,c as toCanonicalUrl,d as typeReferenceUris,a as uriKey,b as uriMatches,r as valuesOf};
@@ -1 +1 @@
1
- import{A,B,C,D,E,F,G,H,I,J,K,L,M,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"../chunk-AVVLDZAZ.js";import"../chunk-KIBR3HAT.js";import"../chunk-D7QLWVPK.js";import"../chunk-QHABFCRC.js";import"../chunk-6VIUXP4N.js";import"../chunk-JHQPXEMA.js";import"../chunk-HF5FJBS2.js";import"../chunk-PEJALHXK.js";import"../chunk-MQBWSCNY.js";import"../chunk-54D47DLS.js";import"../chunk-FUUTGGJS.js";import"../chunk-F67UH4FD.js";import"../chunk-QILEJIFU.js";export{v as AmbiguousReferenceRule,B as ClassDefinitionRule,o as ClassHierarchyCycleRule,L as DiamondNameClashRule,D as DisplayLensScopeRule,l as EmbeddedKanonakTypeRule,m as ImportExistenceRule,M as KanonakObjectValidator,f as LinkTargetRule,H as LookBandPathRule,E as LookSemanticSvgPathRule,C as MarkdownLinkRule,t as NamespaceImportCycleRule,g as NamespacePrefixRule,x as ObjectPropertyValueValidationRule,c as OntologyValidationError,a as OntologyValidationResult,K as OwlOneOfRule,k as PackageHeaderRule,y as PropertyDomainRule,p as PropertyHierarchyCycleRule,z as PropertyKindRangeConsistencyRule,w as PropertyRangeReferenceRule,q as PropertyRangeRequiredRule,i as PropertyTypeSpecificityRule,A as ReservedNameShadowRule,h as ResourceNamingRule,G as SequenceNarrativeRule,J as ShaclShapeRule,r as SubClassOfReferenceRule,s as SubPropertyOfReferenceRule,j as SubjectKanonakTypeRequiredRule,F as TxExpressionCompilesRule,I as TxExpressionPathRule,u as UnresolvedPredicateRule,n as UnresolvedReferenceRule,e as ValidationCache,d as ValidationContext,b as ValidationSeverity};
1
+ import{A,B,C,D,E,F,G,H,I,J,K,L,M,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"../chunk-6TEJENCD.js";import"../chunk-KIBR3HAT.js";import"../chunk-ROKDCCJN.js";import"../chunk-QHABFCRC.js";import"../chunk-6VIUXP4N.js";import"../chunk-Q2FG7DME.js";import"../chunk-HF5FJBS2.js";import"../chunk-PEJALHXK.js";import"../chunk-7TU55KLO.js";import"../chunk-XNEWQEB6.js";import"../chunk-FUUTGGJS.js";import"../chunk-F67UH4FD.js";import"../chunk-QILEJIFU.js";export{v as AmbiguousReferenceRule,B as ClassDefinitionRule,o as ClassHierarchyCycleRule,L as DiamondNameClashRule,D as DisplayLensScopeRule,l as EmbeddedKanonakTypeRule,m as ImportExistenceRule,M as KanonakObjectValidator,f as LinkTargetRule,H as LookBandPathRule,E as LookSemanticSvgPathRule,C as MarkdownLinkRule,t as NamespaceImportCycleRule,g as NamespacePrefixRule,x as ObjectPropertyValueValidationRule,c as OntologyValidationError,a as OntologyValidationResult,K as OwlOneOfRule,k as PackageHeaderRule,y as PropertyDomainRule,p as PropertyHierarchyCycleRule,z as PropertyKindRangeConsistencyRule,w as PropertyRangeReferenceRule,q as PropertyRangeRequiredRule,i as PropertyTypeSpecificityRule,A as ReservedNameShadowRule,h as ResourceNamingRule,G as SequenceNarrativeRule,J as ShaclShapeRule,r as SubClassOfReferenceRule,s as SubPropertyOfReferenceRule,j as SubjectKanonakTypeRequiredRule,F as TxExpressionCompilesRule,I as TxExpressionPathRule,u as UnresolvedPredicateRule,n as UnresolvedReferenceRule,e as ValidationCache,d as ValidationContext,b as ValidationSeverity};