@kanonak-protocol/sdk 5.28.0 → 5.29.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 (36) hide show
  1. package/dist/browser.js +1 -1
  2. package/dist/chunk-3DWEBQSD.js +68 -0
  3. package/dist/{chunk-GJAYU443.js → chunk-4SMQ7G23.js} +1 -1
  4. package/dist/chunk-ANJAHB4N.js +155 -0
  5. package/dist/{chunk-N3XODYH5.js → chunk-CJMVIOZX.js} +1 -1
  6. package/dist/{chunk-SUXSCSHO.js → chunk-F3SGXIDP.js} +1 -1
  7. package/dist/chunk-G3GKOJ5E.js +1 -0
  8. package/dist/{chunk-S2VGNHHF.js → chunk-GMK4YL3X.js} +1 -1
  9. package/dist/{chunk-RJK6Y4HS.js → chunk-HBG6SC5L.js} +1 -1
  10. package/dist/chunk-ZRCJGTEV.js +2 -0
  11. package/dist/index.d.ts +3 -1
  12. package/dist/index.js +1 -1
  13. package/dist/introspection/OntologyModel.d.ts +11 -0
  14. package/dist/introspection/index.d.ts +1 -1
  15. package/dist/look/LookRenderer.d.ts +37 -0
  16. package/dist/look/index.d.ts +1 -0
  17. package/dist/look/sequenceWalk.d.ts +94 -0
  18. package/dist/parsing/index.js +1 -1
  19. package/dist/reasoning/index.js +1 -1
  20. package/dist/resolution/TypeResolver.d.ts +11 -0
  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/uri-helpers/UriHelpers.d.ts +12 -0
  26. package/dist/uri-helpers/index.d.ts +1 -1
  27. package/dist/uri-helpers/index.js +1 -1
  28. package/dist/validation/index.d.ts +1 -1
  29. package/dist/validation/index.js +1 -1
  30. package/dist/validation/rules/repository/SequenceNarrativeRule.d.ts +44 -0
  31. package/dist/validation/rules/repository/index.d.ts +1 -0
  32. package/package.json +2 -2
  33. package/dist/chunk-BA4HAURJ.js +0 -1
  34. package/dist/chunk-KDMBMX3J.js +0 -2
  35. package/dist/chunk-SR6I5ZSI.js +0 -68
  36. package/dist/chunk-TW7NJDMW.js +0 -152
@@ -0,0 +1,94 @@
1
+ import type { Kanonak } from '../kanonaks/Kanonak.js';
2
+ import type { SubjectKanonak } from '../kanonaks/SubjectKanonak.js';
3
+ import type { DefinedKanonak } from '../kanonaks/DefinedKanonak.js';
4
+ import type { KanonakUri } from '../resolution/KanonakUri.js';
5
+ import { type EntityUri } from '../uri-helpers/index.js';
6
+ /** How an edge draws. Shared by every diagram band that draws edges. */
7
+ export type LineStyle = 'solid' | 'dotted' | 'open' | 'thick';
8
+ export declare const LINE_STYLES: ReadonlySet<string>;
9
+ export interface SequenceConnector {
10
+ /** The property that constitutes the message. */
11
+ readonly relation: KanonakUri;
12
+ /** Its subject in the catalog, when it resolves. */
13
+ readonly subject: SubjectKanonak | undefined;
14
+ /** The authored `lineStyle`, when present and one of {@link LINE_STYLES}. */
15
+ readonly declaredStyle: LineStyle | undefined;
16
+ /** The authored `lineStyle` text when it is NOT a supported value. */
17
+ readonly invalidStyle: string | undefined;
18
+ }
19
+ export interface SequenceMessage {
20
+ readonly from: SubjectKanonak;
21
+ readonly to: SubjectKanonak;
22
+ readonly relation: KanonakUri;
23
+ readonly style: LineStyle;
24
+ readonly undirected: boolean;
25
+ }
26
+ export interface SequenceGap {
27
+ /** The two participants the prose placed consecutively. */
28
+ readonly prev: SubjectKanonak;
29
+ readonly next: SubjectKanonak;
30
+ /** The connector the prose selected for the pair, if any. */
31
+ readonly selected: KanonakUri | undefined;
32
+ }
33
+ export interface SequenceWalk {
34
+ readonly messages: readonly SequenceMessage[];
35
+ /** Consecutive participant pairs joined by no declared connector. The graph is the filter — but a gap is usually drift between prose and graph. */
36
+ readonly gaps: readonly SequenceGap[];
37
+ /** Participants that took part in a message, in first-mention order (explicit `participants` first). */
38
+ readonly lifelines: readonly SubjectKanonak[];
39
+ /** How many participant mentions the prose made (a mention that resolves to a non-property resource). */
40
+ readonly mentions: number;
41
+ /** Prose references to a property that is NOT a declared connector — a selector that selects nothing. */
42
+ readonly strayPropertyRefs: readonly KanonakUri[];
43
+ /** True when the instance carries no value at all for the band's `source` — nothing to walk. */
44
+ readonly sourceAbsent: boolean;
45
+ /** Why the walk could not run, when the BAND is misconfigured. Never set for a data condition. */
46
+ readonly problem?: string;
47
+ }
48
+ /** The band's `source` property URI. */
49
+ export declare function readSequenceSource(band: DefinedKanonak): KanonakUri | undefined;
50
+ /**
51
+ * The band's `connectors`. Each is an embedded Connector carrying a `relation`
52
+ * and an optional `lineStyle`; the relation is resolved to its subject so the
53
+ * ontology's own structure can be consulted.
54
+ */
55
+ export declare function readSequenceConnectors(catalog: Kanonak[], band: DefinedKanonak): SequenceConnector[];
56
+ /** The band's explicit `participants`, resolved, in authored order. */
57
+ export declare function readSequenceParticipants(catalog: Kanonak[], band: DefinedKanonak): SubjectKanonak[];
58
+ /** Does this property subject carry an OWL characteristic — by identity, through the SDK's one `subClassOf` traversal. */
59
+ export declare function hasPropertyCharacteristic(catalog: Kanonak[], prop: SubjectKanonak, characteristic: EntityUri): boolean;
60
+ /**
61
+ * How an edge for `connector` draws — structure first, overlay second,
62
+ * default last:
63
+ * - owl.SymmetricProperty → undirected (no arrowhead), whatever else is set
64
+ * - a declared `lineStyle`
65
+ * - owl.inverseOf naming another connector's relation → `dotted` (a reply)
66
+ * - `solid`
67
+ */
68
+ export declare function edgeStyleFor(catalog: Kanonak[], connector: SequenceConnector, all: readonly SequenceConnector[]): {
69
+ style: LineStyle;
70
+ undirected: boolean;
71
+ };
72
+ /**
73
+ * Walk an instance's narrative against the band's connectors.
74
+ *
75
+ * 1. The `source` property's MarkdownStatement supplies `links` — every
76
+ * `[[reference]]`, resolved, in document order. Nothing is parsed here.
77
+ * 2. Each link is classified through the object model: a resource that
78
+ * `propertyClassOf` recognises as a property is an EDGE SELECTOR; any
79
+ * other resolved resource is a PARTICIPANT mention.
80
+ * 3. For each consecutive pair of participants, every candidate connector
81
+ * (all of them, or the one a selector named) that HOLDS in the graph is
82
+ * a message. Direction is the triple's, never the sentence's — but the
83
+ * sentence chooses WHICH true edge is meant: a call and its reply both
84
+ * hold between one pair, and "A asks B" wants A→B while "B answers A"
85
+ * wants B→A. So edges running in prose order are taken, and the opposite
86
+ * direction only when nothing runs forward. Every drawn edge exists in
87
+ * the graph either way.
88
+ * 4. Lifelines are the participants that took part in a message, in
89
+ * first-mention order; explicit `participants` come first and always get
90
+ * a lifeline.
91
+ */
92
+ export declare function walkSequence(catalog: Kanonak[], instance: SubjectKanonak, band: DefinedKanonak): SequenceWalk;
93
+ /** Identity of a participant for ordering and self-message detection. */
94
+ export declare function participantKey(s: SubjectKanonak): string;
@@ -1 +1 @@
1
- import{a as c,b as d,c as e,d as f}from"../chunk-RJK6Y4HS.js";import{m as b}from"../chunk-SUXSCSHO.js";import{a}from"../chunk-KOWDHKBN.js";import"../chunk-BA4HAURJ.js";import"../chunk-N3XODYH5.js";import"../chunk-FUUTGGJS.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-HBG6SC5L.js";import{m as b}from"../chunk-F3SGXIDP.js";import{a}from"../chunk-KOWDHKBN.js";import"../chunk-G3GKOJ5E.js";import"../chunk-CJMVIOZX.js";import"../chunk-FUUTGGJS.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{a as g,b as h,c as i,d as j,e as k}from"../chunk-GJAYU443.js";import"../chunk-SUXSCSHO.js";import"../chunk-KOWDHKBN.js";import{ca as e,da as f,e as a,f as b,g as c,i as d}from"../chunk-BA4HAURJ.js";import"../chunk-N3XODYH5.js";import"../chunk-FUUTGGJS.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-4SMQ7G23.js";import"../chunk-F3SGXIDP.js";import"../chunk-KOWDHKBN.js";import{ca as e,da as f,e as a,f as b,g as c,i as d}from"../chunk-G3GKOJ5E.js";import"../chunk-CJMVIOZX.js";import"../chunk-FUUTGGJS.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};
@@ -19,6 +19,17 @@ export declare class TypeResolver {
19
19
  * differ only in how derivations render the surrounding text.
20
20
  */
21
21
  isSubstitutableDatatype(uri: KanonakUri | null | undefined): boolean;
22
+ /**
23
+ * The same question by URI alone, for callers that hold no resolver — a
24
+ * validation rule deciding whether a property's declared range can carry
25
+ * `[[references]]`. ONE definition of "prose datatype"; the instance method
26
+ * delegates here.
27
+ */
28
+ static isSubstitutableDatatypeUri(uri: {
29
+ publisher: string;
30
+ package_: string;
31
+ name: string;
32
+ } | null | undefined): boolean;
22
33
  isKnownXsdDatatypeName(typeName: string): boolean;
23
34
  isClassTypeAsync(typeName: string, currentDocument: KanonakDocument): Promise<boolean>;
24
35
  getPropertyTypeClassification(propertyType: string | null | undefined): string;
@@ -1 +1 @@
1
- import{a as C}from"../chunk-PEB52US5.js";import{a as l}from"../chunk-SC5M74NM.js";import{a as D}from"../chunk-PEJALHXK.js";import{a as n,b as o,c as p,d as q,ea as r,fa as s,ga as t,ha as u,ia as v,ja as w,ka as x,la as y,ma as z,na as A,oa as B}from"../chunk-BA4HAURJ.js";import"../chunk-N3XODYH5.js";import{a as m}from"../chunk-FUUTGGJS.js";import{a,b,c,d,e,f,g,h,i,j,k}from"../chunk-QILEJIFU.js";export{m as KanonakUri,C as KanonakUriBuilder,D as KanonakUrlResolver,n as ResourceResolver,s as ResourceTypeClassifier,o as TypeResolver,l as assertPackageIdentity,c as compareVersions,B as contextTypesOf,r as corePropertyClassOf,f as createVersion,q as formatKanonakAddress,e as formatVersion,h as isCompatibleVersion,y as isDatatypePropertySubject,i as isMajorCompatible,x as isObjectPropertySubject,w as isPropertySubject,p as parseKanonakAddress,g as parseVersionString,k as pickHighestDocument,z as propertiesInScope,v as propertyClassOf,A as resolvePropertyStep,j as satisfiesVersionOperator,t as subjectUri,u as superClassChain,a as versionOperatorFromChar,b as versionOperatorToChar,d as versionsEqual};
1
+ import{a as C}from"../chunk-PEB52US5.js";import{a as l}from"../chunk-SC5M74NM.js";import{a as D}from"../chunk-PEJALHXK.js";import{a as n,b as o,c as p,d as q,ea as r,fa as s,ga as t,ha as u,ia as v,ja as w,ka as x,la as y,ma as z,na as A,oa as B}from"../chunk-G3GKOJ5E.js";import"../chunk-CJMVIOZX.js";import{a as m}from"../chunk-FUUTGGJS.js";import{a,b,c,d,e,f,g,h,i,j,k}from"../chunk-QILEJIFU.js";export{m as KanonakUri,C as KanonakUriBuilder,D as KanonakUrlResolver,n as ResourceResolver,s as ResourceTypeClassifier,o as TypeResolver,l as assertPackageIdentity,c as compareVersions,B as contextTypesOf,r as corePropertyClassOf,f as createVersion,q as formatKanonakAddress,e as formatVersion,h as isCompatibleVersion,y as isDatatypePropertySubject,i as isMajorCompatible,x as isObjectPropertySubject,w as isPropertySubject,p as parseKanonakAddress,g as parseVersionString,k as pickHighestDocument,z as propertiesInScope,v as propertyClassOf,A as resolvePropertyStep,j as satisfiesVersionOperator,t as subjectUri,u as superClassChain,a as versionOperatorFromChar,b as versionOperatorToChar,d as versionsEqual};
@@ -1,4 +1,4 @@
1
- import"../chunk-PEB52US5.js";import"../chunk-SC5M74NM.js";import{d as g}from"../chunk-TW7NJDMW.js";import"../chunk-6VIUXP4N.js";import"../chunk-SUXSCSHO.js";import"../chunk-KOWDHKBN.js";import"../chunk-PEJALHXK.js";import{ga as m,oa as S}from"../chunk-BA4HAURJ.js";import{c as v,m as p,t as E}from"../chunk-N3XODYH5.js";import"../chunk-FUUTGGJS.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-PEB52US5.js";import"../chunk-SC5M74NM.js";import{d as g}from"../chunk-ANJAHB4N.js";import"../chunk-6VIUXP4N.js";import"../chunk-F3SGXIDP.js";import"../chunk-KOWDHKBN.js";import"../chunk-PEJALHXK.js";import{ga as m,oa as S}from"../chunk-G3GKOJ5E.js";import{c as v,m as p,t as E}from"../chunk-CJMVIOZX.js";import"../chunk-FUUTGGJS.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-D66LUZDB.js";import{a as be,d as X,f as Se,h as ee}from"../chunk-JFBPQN6T.js";import{e as ve,g as $e,m as U,n as Z}from"../chunk-P5VQEDBS.js";import"../chunk-PEB52US5.js";import"../chunk-SC5M74NM.js";import{a as H,b as G}from"../chunk-BRCVOR7A.js";import{j as te}from"../chunk-TW7NJDMW.js";import{a as ye}from"../chunk-6VIUXP4N.js";import{m as oe}from"../chunk-SUXSCSHO.js";import{a as O}from"../chunk-KOWDHKBN.js";import{a as xe}from"../chunk-PEJALHXK.js";import{c as Re}from"../chunk-BA4HAURJ.js";import{c as we,u as re}from"../chunk-N3XODYH5.js";import"../chunk-FUUTGGJS.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-D66LUZDB.js";import{a as be,d as X,f as Se,h as ee}from"../chunk-JFBPQN6T.js";import{e as ve,g as $e,m as U,n as Z}from"../chunk-P5VQEDBS.js";import"../chunk-PEB52US5.js";import"../chunk-SC5M74NM.js";import{a as H,b as G}from"../chunk-BRCVOR7A.js";import{r as te}from"../chunk-ANJAHB4N.js";import{a as ye}from"../chunk-6VIUXP4N.js";import{m as oe}from"../chunk-F3SGXIDP.js";import{a as O}from"../chunk-KOWDHKBN.js";import{a as xe}from"../chunk-PEJALHXK.js";import{c as Re}from"../chunk-G3GKOJ5E.js";import{c as we,u as re}from"../chunk-CJMVIOZX.js";import"../chunk-FUUTGGJS.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-S2VGNHHF.js";import"../chunk-RJK6Y4HS.js";import{a as ve,b as M,c as Un,e as X,f as Vn,g as Rn,h as le,i as q,j as G}from"../chunk-TW7NJDMW.js";import"../chunk-6VIUXP4N.js";import{a as ce,b as ue,c as de,e as $n,f as Tn,g as Bn,h as xn,m as fe}from"../chunk-SUXSCSHO.js";import{a as se}from"../chunk-KOWDHKBN.js";import"../chunk-PEJALHXK.js";import{e as U}from"../chunk-BA4HAURJ.js";import{b as Y,c as D,d as E,g as $,h as T,i as B,j as w,k as me,l as x,n as N,o as S,t as A}from"../chunk-N3XODYH5.js";import"../chunk-FUUTGGJS.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-GMK4YL3X.js";import"../chunk-HBG6SC5L.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-ANJAHB4N.js";import"../chunk-6VIUXP4N.js";import{a as ce,b as ue,c as de,e as $n,f as Tn,g as Bn,h as xn,m as fe}from"../chunk-F3SGXIDP.js";import{a as se}from"../chunk-KOWDHKBN.js";import"../chunk-PEJALHXK.js";import{e as U}from"../chunk-G3GKOJ5E.js";import{b as Y,c as D,d as E,g as $,h as T,i as B,j as w,k as me,l as x,n as N,o as S,t as A}from"../chunk-CJMVIOZX.js";import"../chunk-FUUTGGJS.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(`
@@ -3,6 +3,7 @@ import { EmbeddedKanonak } from '../kanonaks/EmbeddedKanonak.js';
3
3
  import { DefinedKanonak } from '../kanonaks/DefinedKanonak.js';
4
4
  import { Kanonak } from '../kanonaks/Kanonak.js';
5
5
  import { KanonakUri } from '../resolution/KanonakUri.js';
6
+ import type { IStatement } from '../statements/IStatement.js';
6
7
  /**
7
8
  * Canonical URI identity for an ontology entity.
8
9
  *
@@ -123,6 +124,17 @@ export declare function findAllResourcesByCanonicalUri(catalog: Kanonak[], uri:
123
124
  package_: string;
124
125
  name: string;
125
126
  }): SubjectKanonak[];
127
+ /**
128
+ * Find the first statement on a `DefinedKanonak` whose predicate URI
129
+ * matches a property URI.
130
+ */
131
+ /**
132
+ * The statement a defined kanonak carries for a property, by URI identity —
133
+ * the primitive under every `get*` reader here. Exported for the readers that
134
+ * need the STATEMENT rather than a value (a `MarkdownStatement`'s `links`,
135
+ * say); prefer the typed getters when a value is all you need.
136
+ */
137
+ export declare function findStatement(defined: DefinedKanonak, property: EntityUri): IStatement | undefined;
126
138
  /**
127
139
  * True when a defined kanonak carries any statement for the given property
128
140
  * URI — regardless of value. Distinguishes "property present (e.g. an empty
@@ -1,3 +1,3 @@
1
- export { typeReferenceUris, referenceUris, uriKey, uriMatches, toCanonicalUrl, hasType, hasProperty, findSubjectsByType, findSubjectByUri, findAllResourcesByCanonicalUri, getDatatypeValue, getStringValue, getReferenceUri, getEmbeddedValue, getListValues, } from './UriHelpers.js';
1
+ export { typeReferenceUris, referenceUris, uriKey, uriMatches, toCanonicalUrl, hasType, hasProperty, findSubjectsByType, findSubjectByUri, findAllResourcesByCanonicalUri, getDatatypeValue, getStringValue, getReferenceUri, getEmbeddedValue, getListValues, findStatement, } from './UriHelpers.js';
2
2
  export type { EntityUri, CanonicalUriParts } from './UriHelpers.js';
3
3
  export { SingleDocumentRepository } from './SingleDocumentRepository.js';
@@ -1 +1 @@
1
- import{A as o,B as p,m as a,n as b,o as c,p as d,q as e,r as f,s as g,t as h,u as i,v as j,w as k,x as l,y as m,z as n}from"../chunk-N3XODYH5.js";import"../chunk-FUUTGGJS.js";import"../chunk-QILEJIFU.js";export{p as SingleDocumentRepository,i as findAllResourcesByCanonicalUri,h as findSubjectByUri,g as findSubjectsByType,k as getDatatypeValue,n as getEmbeddedValue,o as getListValues,m as getReferenceUri,l as getStringValue,j as hasProperty,f as hasType,e as referenceUris,c as toCanonicalUrl,d as typeReferenceUris,a as uriKey,b as uriMatches};
1
+ import{A as o,B as p,C as q,m as a,n as b,o as c,p as d,q as e,r as f,s as g,t as h,u as i,v as j,w as k,x as l,y as m,z as n}from"../chunk-CJMVIOZX.js";import"../chunk-FUUTGGJS.js";import"../chunk-QILEJIFU.js";export{q as SingleDocumentRepository,i as findAllResourcesByCanonicalUri,j as findStatement,h as findSubjectByUri,g as findSubjectsByType,l as getDatatypeValue,o as getEmbeddedValue,p as getListValues,n as getReferenceUri,m as getStringValue,k as hasProperty,f as hasType,e as referenceUris,c as toCanonicalUrl,d as typeReferenceUris,a as uriKey,b as uriMatches};
@@ -8,4 +8,4 @@ export { KanonakObjectValidator } from './KanonakObjectValidator.js';
8
8
  export type { IDocumentValidationRule } from './rules/document/IDocumentValidationRule.js';
9
9
  export type { IRepositoryValidationRule } from './rules/repository/IRepositoryValidationRule.js';
10
10
  export { NamespacePrefixRule, ResourceNamingRule, PropertyTypeSpecificityRule, SubjectKanonakTypeRequiredRule, PackageHeaderRule } from './rules/document/index.js';
11
- export { ImportExistenceRule, UnresolvedReferenceRule, ClassHierarchyCycleRule, PropertyHierarchyCycleRule, PropertyRangeRequiredRule, SubClassOfReferenceRule, SubPropertyOfReferenceRule, NamespaceImportCycleRule, UnresolvedPredicateRule, AmbiguousReferenceRule, PropertyRangeReferenceRule, ObjectPropertyValueValidationRule, PropertyDomainRule, PropertyKindRangeConsistencyRule, ReservedNameShadowRule, ClassDefinitionRule, EmbeddedKanonakTypeRule, MarkdownLinkRule, DisplayLensScopeRule, LookSemanticSvgPathRule, TxExpressionCompilesRule, LookBandPathRule, TxExpressionPathRule, ShaclShapeRule, OwlOneOfRule, DiamondNameClashRule } from './rules/repository/index.js';
11
+ export { ImportExistenceRule, UnresolvedReferenceRule, ClassHierarchyCycleRule, PropertyHierarchyCycleRule, PropertyRangeRequiredRule, SubClassOfReferenceRule, SubPropertyOfReferenceRule, NamespaceImportCycleRule, UnresolvedPredicateRule, AmbiguousReferenceRule, PropertyRangeReferenceRule, ObjectPropertyValueValidationRule, PropertyDomainRule, PropertyKindRangeConsistencyRule, ReservedNameShadowRule, ClassDefinitionRule, EmbeddedKanonakTypeRule, MarkdownLinkRule, DisplayLensScopeRule, LookSemanticSvgPathRule, TxExpressionCompilesRule, SequenceNarrativeRule, LookBandPathRule, TxExpressionPathRule, ShaclShapeRule, OwlOneOfRule, DiamondNameClashRule } from './rules/repository/index.js';
@@ -1 +1 @@
1
- import{A,B,C,D,E,F,G,H,I,L as J,M as K,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-SR6I5ZSI.js";import"../chunk-BRCVOR7A.js";import"../chunk-TW7NJDMW.js";import"../chunk-6VIUXP4N.js";import"../chunk-SUXSCSHO.js";import"../chunk-KOWDHKBN.js";import"../chunk-PEJALHXK.js";import"../chunk-BA4HAURJ.js";import"../chunk-N3XODYH5.js";import"../chunk-FUUTGGJS.js";import"../chunk-QILEJIFU.js";export{u as AmbiguousReferenceRule,A as ClassDefinitionRule,n as ClassHierarchyCycleRule,J as DiamondNameClashRule,C as DisplayLensScopeRule,k as EmbeddedKanonakTypeRule,l as ImportExistenceRule,K as KanonakObjectValidator,F as LookBandPathRule,D as LookSemanticSvgPathRule,B as MarkdownLinkRule,s as NamespaceImportCycleRule,f as NamespacePrefixRule,w as ObjectPropertyValueValidationRule,c as OntologyValidationError,a as OntologyValidationResult,I as OwlOneOfRule,j as PackageHeaderRule,x as PropertyDomainRule,o as PropertyHierarchyCycleRule,y as PropertyKindRangeConsistencyRule,v as PropertyRangeReferenceRule,p as PropertyRangeRequiredRule,h as PropertyTypeSpecificityRule,z as ReservedNameShadowRule,g as ResourceNamingRule,H as ShaclShapeRule,q as SubClassOfReferenceRule,r as SubPropertyOfReferenceRule,i as SubjectKanonakTypeRequiredRule,E as TxExpressionCompilesRule,G as TxExpressionPathRule,t as UnresolvedPredicateRule,m 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,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-3DWEBQSD.js";import"../chunk-BRCVOR7A.js";import"../chunk-ANJAHB4N.js";import"../chunk-6VIUXP4N.js";import"../chunk-F3SGXIDP.js";import"../chunk-KOWDHKBN.js";import"../chunk-PEJALHXK.js";import"../chunk-G3GKOJ5E.js";import"../chunk-CJMVIOZX.js";import"../chunk-FUUTGGJS.js";import"../chunk-QILEJIFU.js";export{u as AmbiguousReferenceRule,A as ClassDefinitionRule,n as ClassHierarchyCycleRule,K as DiamondNameClashRule,C as DisplayLensScopeRule,k as EmbeddedKanonakTypeRule,l as ImportExistenceRule,L as KanonakObjectValidator,G as LookBandPathRule,D as LookSemanticSvgPathRule,B as MarkdownLinkRule,s as NamespaceImportCycleRule,f as NamespacePrefixRule,w as ObjectPropertyValueValidationRule,c as OntologyValidationError,a as OntologyValidationResult,J as OwlOneOfRule,j as PackageHeaderRule,x as PropertyDomainRule,o as PropertyHierarchyCycleRule,y as PropertyKindRangeConsistencyRule,v as PropertyRangeReferenceRule,p as PropertyRangeRequiredRule,h as PropertyTypeSpecificityRule,z as ReservedNameShadowRule,g as ResourceNamingRule,F as SequenceNarrativeRule,I as ShaclShapeRule,q as SubClassOfReferenceRule,r as SubPropertyOfReferenceRule,i as SubjectKanonakTypeRequiredRule,E as TxExpressionCompilesRule,H as TxExpressionPathRule,t as UnresolvedPredicateRule,m as UnresolvedReferenceRule,e as ValidationCache,d as ValidationContext,b as ValidationSeverity};
@@ -0,0 +1,44 @@
1
+ import type { IKanonakDocumentRepository } from '@kanonak-protocol/types/document/models';
2
+ import type { KanonakDocument } from '@kanonak-protocol/types/document/models/types';
3
+ import { OntologyValidationError } from '../../OntologyValidationError.js';
4
+ import type { IRepositoryValidationRule } from './IRepositoryValidationRule.js';
5
+ import type { ValidationCache } from '../../ValidationCache.js';
6
+ /**
7
+ * A `look.Sequence` band (look@2.4.0) takes its ORDER from prose
8
+ * `[[references]]` and its EDGES from the graph. The two are authored
9
+ * separately, so they can drift — and when they do, the renderer draws less
10
+ * than the prose says and leaves an HTML comment nobody reads. This rule runs
11
+ * the renderer's own walk (`walkSequence`, shared — never re-derived) at
12
+ * `kanonak validate` time, so drift is a diagnostic with a name in it.
13
+ *
14
+ * Two questions, in order:
15
+ *
16
+ * 1. Is the BAND well-formed? Checked on the class that declares it:
17
+ * `source` present and prose-ranged (the order comes from
18
+ * `[[references]]`, so a non-prose source can never sequence anything),
19
+ * `connectors` present, every connector's `relation` a property, every
20
+ * `lineStyle` one of the supported values, `nodeTier` (if set) a tier.
21
+ * Each is an Error — the band cannot render as authored.
22
+ *
23
+ * 2. Does each INSTANCE's narrative match its graph? Found by the same
24
+ * cascade the renderer uses (`findCascadedLook`), so an instance is
25
+ * walked exactly when it would be drawn:
26
+ * - a prose reference to a property the band never declared as a
27
+ * connector: Error — a selector that selects nothing is a typo or a
28
+ * missing connector, and either way the sentence draws nothing;
29
+ * - a narrative with participants that joins nothing: Error — the band
30
+ * renders empty;
31
+ * - a consecutive pair no connector holds between: Warning — the graph
32
+ * is the filter by design, but a pair the prose names and the graph
33
+ * does not join is usually a missing triple or a misordered sentence;
34
+ * - no value for `source` at all: Warning — the band renders nothing.
35
+ */
36
+ export declare class SequenceNarrativeRule implements IRepositoryValidationRule {
37
+ readonly ruleName = "SequenceNarrative";
38
+ validateAsync(document: KanonakDocument, repository: IKanonakDocumentRepository, cache?: ValidationCache): Promise<OntologyValidationError[]>;
39
+ /** Is the band itself renderable? Every finding is an Error on the declaring subject. */
40
+ private checkBand;
41
+ /** Does the instance's narrative match its graph? */
42
+ private checkInstance;
43
+ private toError;
44
+ }
@@ -20,6 +20,7 @@ export { MarkdownLinkRule } from './MarkdownLinkRule.js';
20
20
  export { DisplayLensScopeRule } from './DisplayLensScopeRule.js';
21
21
  export { LookSemanticSvgPathRule } from './LookSemanticSvgPathRule.js';
22
22
  export { TxExpressionCompilesRule } from './TxExpressionCompilesRule.js';
23
+ export { SequenceNarrativeRule } from './SequenceNarrativeRule.js';
23
24
  export { LookBandPathRule } from './LookBandPathRule.js';
24
25
  export { UnrenderableBandRule } from './UnrenderableBandRule.js';
25
26
  export { TxExpressionPathRule } from './TxExpressionPathRule.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kanonak-protocol/sdk",
3
- "version": "5.28.0",
3
+ "version": "5.29.0",
4
4
  "description": "TypeScript SDK for the Kanonak Protocol — parse, resolve, validate, reason over, and render .kan.yml packages.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -126,7 +126,7 @@
126
126
  ],
127
127
  "dependencies": {
128
128
  "@kanonak-protocol/canonical": "^0.1.3",
129
- "@kanonak-protocol/types": "^5.28.0",
129
+ "@kanonak-protocol/types": "^5.29.0",
130
130
  "ignore": "^7.0.5",
131
131
  "js-yaml": "^4.1.0",
132
132
  "yaml": "^2.7.0",
@@ -1 +0,0 @@
1
- import{A as q,c as B,d as G,m as h,n as X,t as Y,u as T,x as v,y as j}from"./chunk-N3XODYH5.js";import{a as P}from"./chunk-FUUTGGJS.js";var W=class{cache=new Map;repository;logger;constructor(e,t){this.repository=e,this.logger=t}async resolveEntityAsync(e,t){let r=t.metadata?.namespace_?.toString()??"unknown",o=this.cache.get(r);if(o){let i=o.get(e);if(i)return i}let a=await this.buildEntityIndexAsyncInternal(t,new Set,"",new Map);return this.cache.set(r,a),a.get(e)??null}async resolveAllEntitiesAsync(e,t){let r=await this.buildAllEntitiesIndexAsync(t,new Set,"");if(e.includes(".")){let o=e.split("."),a=o[0],i=o[1],u=await this.findDocumentForAlias(t,a);return u?await this.resolveAllEntitiesAsync(i,u):[]}return r.filter(o=>o.entityName===e)}async buildAllEntitiesIndexAsync(e,t,r){let o=[],a=e.metadata?.namespace_?.toString()??"unknown";if(this.logger?.debug?.(`Building ALL entities index for namespace: ${a}`),t.has(a))return this.logger?.debug?.(`Skipping ${a} - already visited (circular import prevention)`),o;t.add(a);let i=r.length===0?a:`${r} \u2192 ${a}`;for(let[u,c]of Object.entries(e.body))if(!u.includes(".")&&c&&typeof c=="object"&&!Array.isArray(c)){if(!e.metadata.namespace_)continue;let g=e.metadata.namespace_.version??{major:1,minor:0,patch:0,toString:()=>"1.0.0",equals:()=>!1,getHashCode:()=>0,compareTo:()=>0};o.push({entityName:u,uri:new P(e.metadata.namespace_.publisher,e.metadata.namespace_.package_,u,g),entity:c,definedInNamespace:a,isImported:r.length>0,importPath:i})}if(this.logger?.debug?.(`Collected ${o.length} entities from ${a}`),e.metadata?.imports){let u=Object.values(e.metadata.imports).reduce((c,g)=>c+g.length,0);this.logger?.debug?.(`Processing ${u} import(s) for ${a}`);for(let[c,g]of Object.entries(e.metadata.imports))for(let m of g)try{this.logger?.debug?.(`Resolving import: ${c}/${m.packageName}`);let d=await this.repository.getHighestCompatibleVersionAsync(c,m);if(d){this.logger?.debug?.(`Successfully loaded import: ${d.metadata?.namespace_?.toString()}`);let k=await this.buildAllEntitiesIndexAsync(d,t,i);o.push(...k),this.logger?.debug?.(`Added ${k.length} entities from import ${d.metadata?.namespace_?.toString()}`)}else this.logger?.warn?.(`Failed to load import: ${c}/${m.packageName}`)}catch(d){let k=d;throw this.logger?.error?.(`Failed to process import ${c}/${m.packageName} for namespace ${a}. Error: ${k.message}`,k),new Error(`Failed to process import ${c}/${m.packageName} for namespace ${a}. See inner exception for details.`,{cause:d})}}return o}async buildEntityIndexAsync(e){return await this.buildEntityIndexAsyncInternal(e,new Set,"",new Map)}async buildEntityIndexAsyncInternal(e,t,r,o){let a=new Map,i=e.metadata?.namespace_?.toString()??"unknown";if(this.logger?.debug?.(`Building entity index for namespace: ${i}`),t.has(i))return this.logger?.debug?.(`Skipping ${i} - circular import in progress`),a;let u=o.get(i);if(u)return u;t.add(i);let c=r.length===0?i:`${r} \u2192 ${i}`,g=0;for(let[m,d]of Object.entries(e.body))if(!m.includes(".")&&d&&typeof d=="object"&&!Array.isArray(d)){if(!e.metadata.namespace_)continue;if(!a.has(m)){let k=e.metadata.namespace_.version??{major:1,minor:0,patch:0,toString:()=>"1.0.0",equals:()=>!1,getHashCode:()=>0,compareTo:()=>0};a.set(m,{entityName:m,uri:new P(e.metadata.namespace_.publisher,e.metadata.namespace_.package_,m,k),entity:d,definedInNamespace:i,isImported:r.length>0,importPath:c}),g++}}if(this.logger?.debug?.(`Indexed ${g} entities from ${i}`),e.metadata?.imports){let m=Object.values(e.metadata.imports).reduce((d,k)=>d+k.length,0);this.logger?.debug?.(`Processing ${m} import(s) for ${i}`);for(let[d,k]of Object.entries(e.metadata.imports))for(let K of k)try{this.logger?.debug?.(`Resolving import: ${d}/${K.packageName}`);let E=await this.repository.getHighestCompatibleVersionAsync(d,K);if(E){this.logger?.debug?.(`Successfully loaded import: ${E.metadata?.namespace_?.toString()}`);let U=await this.buildEntityIndexAsyncInternal(E,t,c,o),$=0;for(let[O,C]of U.entries()){let _=a.get(O);if(!_)a.set(O,C),$++;else if(_.isImported&&C.isImported&&(_.uri.publisher!==C.uri.publisher||_.uri.package_!==C.uri.package_)){let A=_.isAmbiguous?_:{..._,isAmbiguous:!0,ambiguousNamespaces:[_.definedInNamespace]};A.ambiguousNamespaces.includes(C.definedInNamespace)||A.ambiguousNamespaces.push(C.definedInNamespace),a.set(O,A),this.logger?.warn?.(`Ambiguous reference '${O}': defined in ${A.ambiguousNamespaces.join(", ")}`)}if(K.alias&&!O.includes(".")){let A=`${K.alias}.${O}`;a.has(A)||(a.set(A,C),$++)}}this.logger?.debug?.(`Merged ${$} entities from import ${E.metadata?.namespace_?.toString()}`)}else this.logger?.warn?.(`Failed to load import: ${d}/${K.packageName}`)}catch(E){let U=E;throw this.logger?.error?.(`Failed to process import ${d}/${K.packageName} for namespace ${i}. Error: ${U.message}`,U),new Error(`Failed to process import ${d}/${K.packageName} for namespace ${i}. See inner exception for details.`,{cause:E})}}return t.delete(i),o.set(i,a),a}async findDocumentForAlias(e,t){if(!e.metadata?.imports)return null;for(let[r,o]of Object.entries(e.metadata.imports))for(let a of o){if(a.alias===t)return await this.repository.getHighestCompatibleVersionAsync(r,a);if(!a.alias&&a.packageName===t)return await this.repository.getHighestCompatibleVersionAsync(r,a)}return null}clearCache(){this.cache.clear()}clearCacheForDocument(e){this.cache.delete(e)}};var z=class n{static KNOWN_XSD_DATATYPES=new Set(["string","integer","int","boolean","decimal","float","double","date","datetime","time","duration","anyuri","base64binary","hexbinary","long","short","byte","nonnegativeinteger","positiveinteger","negativeinteger","nonpositiveinteger","unsignedint","unsignedlong","unsignedshort","unsignedbyte"]);resourceResolver;constructor(e){this.resourceResolver=e}isXsdDatatype(e){return e?e.publisher==="kanonak.org"&&e.package_==="core-xsd"&&n.KNOWN_XSD_DATATYPES.has(e.name.toLowerCase()):!1}isLiteralType(e){return e?e.publisher==="kanonak.org"&&e.package_==="core-rdf"&&e.name==="Literal":!1}isMarkdownDatatype(e){return e?e.publisher==="kanonak.org"&&e.package_==="core-prose"&&e.name==="Markdown":!1}isSubstitutableDatatype(e){return e?e.publisher==="kanonak.org"&&e.package_==="core-prose"&&(e.name==="SubstitutableString"||e.name==="Markdown"):!1}isKnownXsdDatatypeName(e){let t=e.includes(".")?e.split(".")[1]:e;return n.KNOWN_XSD_DATATYPES.has(t.toLowerCase())}async isClassTypeAsync(e,t){if(this.isKnownXsdDatatypeName(e))return!1;let r=await this.resourceResolver.resolveEntityAsync(e,t);if(r){let o=r.entity.type;if(o){let a=String(o);return a==="Class"||a==="rdfs.Class"||a.endsWith(".Class")}}return!0}getPropertyTypeClassification(e){if(!e||e.trim().length===0)return"Property";switch(e.includes(".")?e.split(".")[1]:e){case"DatatypeProperty":return"DatatypeProperty";case"ObjectProperty":return"ObjectProperty";case"AnnotationProperty":return"AnnotationProperty";case"Property":return"Property";default:return"Property"}}isEffectiveDatatypeProperty(e,t){return!!(e==="DatatypeProperty"||e==="Property"&&this.isXsdDatatype(t)||e==="Property"&&this.isLiteralType(t))}isEffectiveObjectProperty(e,t){return!!(e==="ObjectProperty"||e==="Property"&&t&&!this.isXsdDatatype(t)&&!this.isLiteralType(t))}};function J(n){if(!n||n.trim().length===0)throw new Error("Kanonak address string cannot be null or empty");let e=n.trim(),t=e.split("/");if(t.length===1){let r=t[0];if(!r)throw new Error(`Invalid Kanonak address: "${n}". Expected publisher, publisher/package[@version], or publisher/package[@version]/name.`);if(r.includes("@"))throw new Error(`Invalid Kanonak address: "${n}". A bare publisher cannot carry an @version qualifier \u2014 versions belong to packages.`);return{kind:"publisher",publisher:r}}if(t.length===2){let[r,o]=t;if(!r||!o)throw new Error(`Invalid Kanonak address: "${n}". Expected publisher/package[@version].`);let a=o.indexOf("@");if(a===-1)return{kind:"package",publisher:r,package_:o};let i=o.substring(0,a),u=o.substring(a+1);if(!i||!u)throw new Error(`Invalid Kanonak address: "${n}". Expected publisher/package[@version].`);let c=re(u);return{kind:"package",publisher:r,package_:i,version:c}}return{kind:"resource",uri:P.parse(e)}}function Oe(n){switch(n.kind){case"publisher":return n.publisher;case"package":return n.version?`${n.publisher}/${n.package_}@${n.version.major}.${n.version.minor}.${n.version.patch}`:`${n.publisher}/${n.package_}`;case"resource":return n.uri.toString()}}function re(n){let e=n.split(".").map(Number);return oe(e[0]||0,e[1]||0,e[2]||0)}function oe(n,e,t){return{major:n,minor:e,patch:t,toString:()=>`${n}.${e}.${t}`,equals:r=>!r||typeof r!="object"?!1:r.major===n&&r.minor===e&&r.patch===t,getHashCode:()=>n<<20|e<<10|t,compareTo:r=>n!==r.major?n-r.major:e!==r.minor?e-r.minor:t-r.patch}}function Ne(n){return`${n.publisher}/${n.package_}/${n.name}`}function y(n,e,t){return`${n}/${e}/${t}`}function He(n){return`${n.s}|${n.p}|${ae(n.o)}`}function ae(n){switch(n.kind){case"uri":return`u:${n.key}`;case"literal":return`l:${n.datatype}:${n.lexical}`;case"blank":return`b:${n.id}`}}function Ie(n,e,t){return{s:n,p:e,o:{kind:"uri",key:t}}}var se="kanonak.org",ie="core-shacl",s=n=>({publisher:se,package_:ie,name:n}),N=s("Shape"),H=s("NodeShape"),I=s("PropertyShape"),$e=s("targetClass"),Te=s("property"),ve=s("path"),je=s("minCount"),we=s("maxCount"),Me=s("datatype"),Le=s("class"),Ve=s("in"),Fe=s("pattern"),Be=s("flags"),Ge=s("minLength"),Xe=s("maxLength"),Ye=s("minInclusive"),qe=s("maxInclusive"),We=s("message"),ze=s("targetNode"),Je=s("targetSubjectsOf"),Qe=s("targetObjectsOf"),Ze=s("closed"),et=s("ignoredProperties"),tt=s("nodeKind"),nt=s("IRI"),rt=s("BlankNode"),ot=s("Literal"),at=s("severity"),st=s("Violation"),it=s("Warning"),pt=s("Info"),ct=s("ValidationReport"),lt=s("conforms"),ut=s("result"),yt=s("ValidationResult"),dt=s("focusNode"),gt=s("resultPath"),mt=s("resultMessage"),ft=s("resultSeverity"),kt=s("sourceShape"),bt=s("value"),ht=s("sourceConstraintComponent"),St=s("MinCountConstraintComponent"),_t=s("MaxCountConstraintComponent"),Pt=s("DatatypeConstraintComponent"),Kt=s("ClassConstraintComponent"),Et=s("InConstraintComponent"),Ct=s("PatternConstraintComponent"),At=s("MinLengthConstraintComponent"),xt=s("MaxLengthConstraintComponent"),Rt=s("MinInclusiveConstraintComponent"),Ot=s("MaxInclusiveConstraintComponent"),Ut=s("NodeKindConstraintComponent"),Nt=s("ClosedConstraintComponent");var l="kanonak.org",p="core-rdf",f="core-owl",Z="core-kanonak",M=new Map([["type",p],["subClassOf",p],["subPropertyOf",p],["domain",p],["range",p],["label",p],["comment",p],["seeAlso",p],["isDefinedBy",p],["member",p],["Resource",p],["Class",p],["Property",p],["Datatype",p],["Literal",p],["List",p],["ObjectProperty",f],["DatatypeProperty",f],["AnnotationProperty",f],["Thing",f],["Nothing",f],["Package",Z]]),pe=new Set(["type","subClassOf","subPropertyOf","domain","range"]);function $t(n){return M.has(n)}function Tt(n){let e=M.get(n);return e?{publisher:l,package_:e}:void 0}function L(n,e,t){if(!n||!n.name)return;let r=M.get(n.name);if(!r)return;let o=()=>{n.publisher=l,n.package_=r,t&&(n.version=t.get(r))};if(pe.has(n.name)){let a=n.publisher===l&&n.package_===r;n.publisher=l,n.package_=r,!a&&t&&(n.version=t.get(r));return}n.publisher===l&&n.package_===r||n.publisher&&n.publisher.length>0&&(!e||e(n))||o()}var Q=class{type=y(l,p,"type");subClassOf=y(l,p,"subClassOf");subPropertyOf=y(l,p,"subPropertyOf");domain=y(l,p,"domain");range=y(l,p,"range");label=y(l,p,"label");comment=y(l,p,"comment");resource=y(l,p,"Resource");class_=y(l,p,"Class");datatype=y(l,p,"Datatype");literal=y(l,p,"Literal");equivalentClass=y(l,f,"equivalentClass");equivalentProperty=y(l,f,"equivalentProperty");inverseOf=y(l,f,"inverseOf");sameAs=y(l,f,"sameAs");transitiveProperty=y(l,f,"TransitiveProperty");symmetricProperty=y(l,f,"SymmetricProperty");objectProperty=y(l,f,"ObjectProperty");datatypeProperty=y(l,f,"DatatypeProperty");annotationProperty=y(l,f,"AnnotationProperty");package_=y(l,Z,"Package");shape=w(N);nodeShape=w(H);propertyShape=w(I)};function w(n){return y(n.publisher,n.package_,n.name)}var ce=new Set(["kanonak.org/core-rdf","kanonak.org/core-owl","kanonak.org/core-xsd","kanonak.org/core-kanonak"]);function b(n){let e=n;if(e.entity&&typeof e.entity=="object"){let t=e.entity.type;if(typeof t=="string"){let o={publisher:"",package_:"",name:t.includes(".")?t.substring(t.lastIndexOf(".")+1):t};return L(o),{publisher:o.publisher,package_:o.package_,name:o.name}}}if(e.statement&&Array.isArray(e.statement)){for(let t of e.statement)if(t.predicate?.subject?.name==="type"&&t.object?.subject){let r=t.object.subject,o={publisher:r.publisher??"",package_:r.package_??"",name:r.name};return L(o),{publisher:o.publisher,package_:o.package_,name:o.name}}}return null}var le=[N,H,I];function S(n,e){return ce.has(`${n}/${e}`)}var ue=new Set(["Property","ObjectProperty","DatatypeProperty","AnnotationProperty"]);function V(n){if(S(n.publisher,n.package_))return ue.has(n.name)?n.name:void 0}var ee=class n{static getTypeUri(e){return b(e)}static isCoreOntologyType(e){return S(e.publisher,e.package_)}static isClassType(e){let t=b(e);return t?S(t.publisher,t.package_)&&t.name==="Class":!1}static isDatatypeType(e){let t=b(e);return t?S(t.publisher,t.package_)&&t.name==="Datatype":!1}static isDatatypePropertyType(e){let t=b(e);return t?S(t.publisher,t.package_)&&t.name==="DatatypeProperty":!1}static isObjectPropertyType(e){let t=b(e);return t?S(t.publisher,t.package_)&&t.name==="ObjectProperty":!1}static isAnnotationPropertyType(e){let t=b(e);return t?S(t.publisher,t.package_)&&t.name==="AnnotationProperty":!1}static isGenericPropertyType(e){let t=b(e);return t?S(t.publisher,t.package_)&&t.name==="Property":!1}static isAnyPropertyType(e){let t=b(e);return!t||!S(t.publisher,t.package_)?!1:t.name==="Property"||t.name==="DatatypeProperty"||t.name==="ObjectProperty"||t.name==="AnnotationProperty"}static isShapeType(e){let t=b(e);return t?le.some(r=>X(t,r)):!1}static isSchemaDefinitionType(e){if(n.isShapeType(e))return!0;let t=b(e);return!t||!S(t.publisher,t.package_)?!1:t.name==="Class"||t.name==="Property"||t.name==="DatatypeProperty"||t.name==="ObjectProperty"||t.name==="AnnotationProperty"||t.name==="Datatype"}static isInstanceOfKnownClass(e,t){if(n.isSchemaDefinitionType(e))return!1;let r=b(e);return r?t.has(r.name):!1}};var x="kanonak.org",R="core-rdf",ye={publisher:x,package_:R,name:"domain"},de={publisher:x,package_:R,name:"range"},ge={publisher:x,package_:R,name:"subClassOf"},me={publisher:x,package_:R,name:"type"},fe={publisher:x,package_:R,name:"label"},ke={publisher:x,package_:R,name:"comment"},be=new P(x,R,"Resource");function he(n){try{let e=J(`${n.namespace}/${n.name}`);return e.kind==="resource"?e.uri:void 0}catch{return}}function F(n,e){let t=j(n,e);if(t)return[t];let r=[];for(let o of q(n,e))o instanceof G&&r.push(o.subject);return r}function ne(n,e){let t=[],r=new Set,o="version"in e?e.version:void 0,a=[new P(e.publisher,e.package_,e.name,o??void 0)];for(;a.length>0;){let i=a.shift(),u=h(i);if(r.has(u))continue;r.add(u),t.push(i);let c=Se(n,i);c&&a.push(...F(c,ge))}return t}function Se(n,e){return e.version&&typeof e.version.major=="number"?Y(n,e)??T(n,e)[0]:T(n,e)[0]}function D(n,e){let t;for(let r of Ee(e)){let o=_e(n,r);if(o){if(o!=="Property")return o;t??=o}}return t}function _e(n,e){let t=V(e);if(t)return t;let r=te.get(n);r||(r=new Map,te.set(n,r));let o=e.version,a=o&&typeof o.major=="number"?`${h(e)}@${o.major}.${o.minor}.${o.patch}`:h(e),i=r.get(a);if(i!==void 0)return i??void 0;let u;for(let c of ne(n,e)){let g=V(c);if(g){if(g!=="Property"){u=g;break}u??="Property"}}return r.set(a,u??null),u}var te=new WeakMap;function qt(n,e){return D(n,e)!==void 0}function Wt(n,e){return D(n,e)==="ObjectProperty"}function zt(n,e){return D(n,e)==="DatatypeProperty"}function Pe(n,e){let t=new Set([h(be)]);for(let r of ne(n,e))t.add(h(r));return t}function Ke(n,e){let t=Pe(n,e),r=[],o=new Set;for(let a of n){if(!(a instanceof B))continue;let i=D(n,a);if(!i)continue;let u=F(a,ye);if(!u.some(m=>t.has(h(m))))continue;let c=he(a);if(!c)continue;let g=h(c);o.has(g)||(o.add(g),r.push({uri:c,label:v(a,fe),comment:v(a,ke),kind:i==="ObjectProperty"?"object":i==="DatatypeProperty"?"datatype":"other",range:j(a,de),domains:u}))}return r}function Jt(n,e,t){let r=Ke(n,e).find(o=>h(o.uri)===h(t));return r?{ok:!0,descriptor:r}:{ok:!1,message:`Property ${t.publisher}/${t.package_}/${t.name} is not in scope for ${e.publisher}/${e.package_}/${e.name}.`}}function Ee(n){return F(n,me)}export{W as a,z as b,J as c,Oe as d,Ne as e,y as f,He as g,ae as h,Ie as i,se as j,ie as k,N as l,H as m,I as n,$e as o,Te as p,ve as q,je as r,we as s,Me as t,Le as u,Ve as v,Fe as w,Be as x,Ge as y,Xe as z,Ye as A,qe as B,We as C,ze as D,Je as E,Qe as F,Ze as G,et as H,tt as I,nt as J,rt as K,ot as L,at as M,st as N,it as O,pt as P,St as Q,_t as R,Pt as S,Kt as T,Et as U,Ct as V,At as W,xt as X,Rt as Y,Ot as Z,Ut as _,Nt as $,$t as aa,Tt as ba,L as ca,Q as da,V as ea,ee as fa,he as ga,ne as ha,D as ia,qt as ja,Wt as ka,zt as la,Ke as ma,Jt as na,Ee as oa};
@@ -1,2 +0,0 @@
1
- import{e as F}from"./chunk-P5VQEDBS.js";import{J as me,K as he}from"./chunk-SR6I5ZSI.js";import{a as te,b as $,c as le,i as z,m as D}from"./chunk-SUXSCSHO.js";import{ba as ue,fa as O,ga as x,ha as ge,ia as B,ma as ye}from"./chunk-BA4HAURJ.js";import{A as V,b as ne,c as E,d as _,f as oe,g as ae,h as se,i as ie,j as ce,k as pe,l as L,m as K,t as G,v as de,x as I,y as fe}from"./chunk-N3XODYH5.js";import{a as re}from"./chunk-FUUTGGJS.js";import{d as ee}from"./chunk-QILEJIFU.js";var Ce=(s=>(s.Class="Class",s.DatatypeProperty="DatatypeProperty",s.ObjectProperty="ObjectProperty",s.AnnotationProperty="AnnotationProperty",s.Instance="Instance",s.Datatype="Datatype",s.Shape="Shape",s.Unknown="Unknown",s))(Ce||{}),Se=(s=>(s.InstanceOf="instanceOf",s.SubClassOf="subClassOf",s.Domain="domain",s.Range="range",s.ObjectRelationship="objectRelationship",s.SubPropertyOf="subPropertyOf",s.PropertyValue="propertyValue",s.EmbeddedLink="embeddedLink",s))(Se||{}),H=class{static async buildFromRepository(n,t){let o=await new D().parseKanonaks(n),a=await n.getAllDocumentsAsync(),c=[],i=[],s=new Set,d=new Set,f=new Map;for(let g of o){let u=g;if(u.name&&(O.isClassType(u)&&s.add(u.name),g instanceof E)){let l=B(o,g);(l==="ObjectProperty"||l==="Property")&&d.add(u.name)}}for(let g of a)for(let[u,l]of Object.entries(g.body))d.has(u)&&l?.range&&typeof l.range=="string"&&f.set(u,l.range);let p=new Map;for(let g of o){let u=g;u.name&&p.set(u.name,u)}for(let g of a){let u=g.metadata.namespace_,l=u?`${u.publisher}/${u.package_}`:"",m=u?.version?`${u.version.major}.${u.version.minor}.${u.version.patch}`:"",b=ke(g);for(let[h,y]of Object.entries(g.body)){if(!y||typeof y!="object")continue;let C=p.get(h),k="Unknown";if(C){let T=C,j=C instanceof E?B(o,C):void 0;O.isClassType(T)?k="Class":j==="ObjectProperty"?k="ObjectProperty":j==="DatatypeProperty"?k="DatatypeProperty":j==="AnnotationProperty"?k="AnnotationProperty":O.isDatatypeType(T)?k="Datatype":j==="Property"?k="ObjectProperty":O.isShapeType(T)?k="Shape":O.isInstanceOfKnownClass(T,s)&&(k="Instance")}let S=l&&m?`${l}/${h}@${m}`:h,Z={};for(let[T,j]of Object.entries(y))T!=="type"&&(typeof j!="object"||j===null)&&(Z[T]=j);c.push({id:S,label:y.label??h,type:k,namespace:l,properties:Z}),be(S,y,k,s,d,i,l,m,b,t),q(S,y,d,f,c,i,l,m,b),Le(S,C,i)}}return{nodes:c,edges:i}}static buildFromDocument(n,t){let r=[],o=[],a=n.metadata.namespace_,c=a?.version?`${a.version.major}.${a.version.minor}.${a.version.patch}`:"",i=a?`${a.publisher}/${a.package_}`:"",s=new Set,d=new Set,f=new Map,p=ke(n);for(let[l,m]of Object.entries(n.body)){let b=m?.type;b&&(Me(b,p)&&s.add(l),Ue(b,p)&&(d.add(l),m.range&&typeof m.range=="string"&&f.set(l,m.range)))}for(let[l,m]of Object.entries(n.body)){if(!m||typeof m!="object")continue;let b=m.type,h=Fe(b,l,s,p),y=i&&c?`${i}/${l}@${c}`:l,C={};for(let[k,S]of Object.entries(m))k!=="type"&&(typeof S!="object"||S===null)&&(C[k]=S);r.push({id:y,label:m.label??l,type:h,namespace:i,properties:C}),be(y,m,h,s,d,o,i,c,p,t),q(y,m,d,f,r,o,i,c,p)}let g=new Set(r.map(l=>l.id)),u=o.filter(l=>g.has(l.source)&&g.has(l.target));return{nodes:r,edges:u}}};function ke(e,n){let t=new Map;if(e.metadata?.imports)for(let[r,o]of Object.entries(e.metadata.imports))for(let a of o){let c=a.alias??a.packageName,i=a.version,s=`${i.major}.${i.minor}.${i.patch}`;t.set(c,{publisher:r,package_:a.packageName,version:s})}return t}var Oe={"kanonak.org/core-rdf/Class":"Class","kanonak.org/core-owl/Class":"Class","kanonak.org/core-rdfs/Class":"Class","kanonak.org/core-owl/ObjectProperty":"ObjectProperty","kanonak.org/core-owl/DatatypeProperty":"DatatypeProperty","kanonak.org/core-owl/AnnotationProperty":"AnnotationProperty","kanonak.org/core-rdf/Property":"ObjectProperty","kanonak.org/core-rdfs/Datatype":"Datatype"},De=new Set(["kanonak.org/core-owl/ObjectProperty","kanonak.org/core-owl/DatatypeProperty","kanonak.org/core-owl/AnnotationProperty","kanonak.org/core-rdf/Property"]);function W(e,n){if(e.includes(".")){let t=e.indexOf("."),r=e.substring(0,t),o=e.substring(t+1),a=n.get(r);if(a)return`${a.publisher}/${a.package_}/${o}`}return null}function Me(e,n){let t=W(e,n);return t?Oe[t]==="Class":!1}function Ue(e,n){let t=W(e,n);return t?De.has(t):!1}function Fe(e,n,t,r){if(!e||e==="Package")return"Unknown";let o=W(e,r);if(o){let c=Oe[o];if(c)return c;let i=o.split("/").pop()?.split("@")[0]??"";return t.has(i)?"Instance":"Unknown"}let a=e.split(".").pop()??e;return t.has(a)?"Instance":"Unknown"}var ve=new Set(["type","label","comment","version","publisher","imports","license","match","alias","package"]);function be(e,n,t,r,o,a,c,i,s,d){let f=n.type,p=n.subClassOf;if(p){let h=Array.isArray(p)?p:[p];for(let y of h)typeof y=="string"&&a.push({source:e,target:v(y,c,i,s),type:"subClassOf",label:"subClassOf"})}let g=n.subPropertyOf;if(g){let h=Array.isArray(g)?g:[g];for(let y of h)typeof y=="string"&&a.push({source:e,target:v(y,c,i,s),type:"subPropertyOf",label:"subPropertyOf"})}let u=n.domain,l=n.range;if(d?.includePropertyEdges){let h=[[u,"domain","domain"],[l,"range","range"]];for(let[y,C,k]of h)if(y!=null)for(let S of Array.isArray(y)?y:[y])typeof S=="string"&&a.push({source:e,target:v(S,c,i,s),type:C,label:k})}if(t==="Instance"&&f){let h=f.split(".").pop()??f;a.push({source:e,target:v(h,c,i,s),type:"instanceOf",label:"type"})}if(t==="Instance")for(let[h,y]of Object.entries(n)){if(ve.has(h)||!o.has(h))continue;let C=Array.isArray(y)?y:[y];for(let k of C)typeof k=="string"&&Ge(k)&&a.push({source:e,target:v(k,c,i,s),type:"propertyValue",label:h,propertyId:v(h,c,i,s)})}if((t==="ObjectProperty"||t==="DatatypeProperty"||u&&l)&&u&&l){let h=typeof u=="string"?u:null,y=typeof l=="string"?l:null;h&&y&&a.push({source:v(h,c,i,s),target:v(y,c,i,s),type:"objectRelationship",label:n.label??e.split("/").pop()??"",propertyId:e})}}function q(e,n,t,r,o,a,c,i,s){for(let[d,f]of Object.entries(n)){if(ve.has(d)||typeof f!="object"||f===null||Array.isArray(f))continue;let p=f,g=`${e}/${d}`,u=r.get(d),l=u?u.split(".").pop()??u:"Unknown",m={};for(let[h,y]of Object.entries(p))(typeof y!="object"||y===null)&&(m[h]=y);o.push({id:g,label:`${l} (embedded)`,type:"Instance",namespace:c,properties:m});let b=c&&i?`${c}/${d}@${i}`:d;a.push({source:e,target:g,type:"propertyValue",label:d,propertyId:t.has(d)?b:void 0}),u&&a.push({source:g,target:v(l,c,i,s),type:"instanceOf",label:"type (inferred)"}),q(g,p,t,r,o,a,c,i,s)}}function Le(e,n,t){let r=n?.statement;if(Array.isArray(r))for(let o of r){if(!(o instanceof le))continue;let a=o.predicate?.subject?.name??"";for(let c of o.links){let i=c.target?.subject;if(!i)continue;let s=i.version,d=s&&typeof s.major=="number"?`@${s.major}.${s.minor}.${s.patch}`:"";t.push({source:e,target:`${i.publisher}/${i.package_}/${i.name}${d}`,type:"embeddedLink",label:a})}}}function Ge(e){return!(!e||e.includes(" ")||e.includes(`
2
- `)||e.startsWith("http://")||e.startsWith("https://")||/^\d{4}-\d{2}/.test(e)||/^\d+(\.\d+)?$/.test(e))}function v(e,n,t,r){if(e.includes("@")&&e.includes("/"))return e;if(e.includes(".")){let o=e.indexOf("."),a=e.substring(0,o),c=e.substring(o+1);if(r){let i=r.get(a);if(i)return`${i.publisher}/${i.package_}/${c}@${i.version}`}return n&&t?`${n}/${c}@${t}`:c}return n&&t?`${n}/${e}@${t}`:e}import{canonicalForm as Ve,canonicalHash as Be}from"@kanonak-protocol/canonical";function X(e){return typeof e=="object"&&e!==null&&Array.isArray(e.subjects)}import{CANONICAL_FORM_VERSION as en}from"@kanonak-protocol/canonical";function ze(e){return Ve(X(e)?e:Pe(e))}function He(e){return Be(X(e)?e:Pe(e))}function Pe(e){let n=[];for(let t of e)t instanceof E&&n.push({uri:Ze(t),statements:Y(t.statement)});return{subjects:n}}function Y(e){let n=[];for(let t of e){let r=Qe(t);if(!r)continue;if(t instanceof L&&qe(t.predicate.subject)){n.push(...Xe(t,r));continue}let o=Ye(t);o&&n.push({predicate:r,value:o})}return n}function qe(e){let n=ue("type");return n!==void 0&&e.name==="type"&&e.publisher===n.publisher&&e.package_===n.package_}var we=new TextEncoder;function We(e,n){let t=we.encode(e),r=we.encode(n),o=Math.min(t.length,r.length);for(let a=0;a<o;a++)if(t[a]!==r[a])return t[a]-r[a];return t.length-r.length}function Xe(e,n){let t=[];for(let r of e.object){if(!(r instanceof _))throw new Error(`canonicalForm: a multi-valued type statement must contain only entity references, got ${r.constructor?.name??typeof r}`);t.push(J(r))}t.sort(We);for(let r=1;r<t.length;r++)if(t[r-1]===t[r])throw new Error(`canonicalForm: duplicate type ${t[r]} in a multi-valued type statement`);return t.map(r=>({predicate:n,value:{ref:r}}))}function Ye(e){if(e instanceof oe&&e.carrier)return{lit:e.lexical??String(e.object),datatype:Te(e.carrier)};if(e instanceof ae)return{raw:e.object};if(e instanceof se)return{raw:e.lexical??String(e.object)};if(e instanceof ie)return{raw:e.lexical??String(e.object)};if(e instanceof ce)return{ref:J(e.object)};if(e instanceof pe)return je(e.object);if(e instanceof L)return{list:e.object.map(Je)}}function je(e){let n=Y(e.statement);return e.name&&e.name.length>0?{embed:{name:e.name,statements:n}}:{embed:{statements:n}}}function Je(e){if(e instanceof _)return{ref:J(e)};if(e instanceof te)return je(e);if(e instanceof $){if(e.carrier)return{lit:e.lexical??String(e.value),datatype:Te(e.carrier)};let n=e.value;if(typeof n=="string")return{raw:n};if(typeof n=="number")return{raw:String(n)};if(typeof n=="boolean")return{raw:String(n)}}if(e instanceof ne)return{embed:{statements:Y(e.statement)}};throw new Error(`canonicalForm: list item of unrecognized kind (${e.constructor?.name??typeof e}); add canonicalization support before hashing data that contains it`)}function Te(e){return e===z.LangString?"kanonak.org/core-rdf/langString":`kanonak.org/core-xsd/${e}`}function Qe(e){let n=e.predicate;if(n)return Ee(n.subject)}function Ze(e){let n=e.namespace??"",t=e.name??"";return`${n}/${t}`}function J(e){return Ee(e.subject)}function Ee(e){let n=e.version;return n&&typeof n.major=="number"?`${e.publisher}/${e.package_}@${n.major}.${n.minor}.${n.patch}/${e.name}`:`${e.publisher}/${e.package_}/${e.name}`}function A(e){let n=e.replace(/^https?:\/\//,"").replace(/^git:\/\//,"").replace(/\/+$/,"").trim();if(!n)throw new Error("Publisher host cannot be empty");return n}var nn="key_thumbprint",N=class{cache=new Map;prCache=new Map;async discoverProtectedResource(n){let t=A(n);if(this.prCache.has(t))return this.prCache.get(t);let r=`https://${t}/.well-known/oauth-protected-resource`,o=await tn(r),a=o&&Array.isArray(o.authorization_servers)?o.authorization_servers.filter(i=>typeof i=="string"):[],c=a.length>0?a:null;return this.prCache.set(t,c),c}async discover(n){let t=A(n);if(this.cache.has(t))return this.cache.get(t);let r=`https://${t}/.well-known/oauth-authorization-server`,o=await this.tryEndpoint(r);if(!o){let a=`https://${t}/.well-known/openid-configuration`;o=await this.tryEndpoint(a)}return this.cache.set(t,o),o}async supportsOAuth(n){return await this.discover(n)!==null}static supportsPkceS256(n){return n.codeChallengeMethodsSupported?.some(t=>t.toUpperCase()==="S256")??!1}static supportsDynamicRegistration(n){return!!n.registrationEndpoint}static supportsAuthorizationCode(n){return n.responseTypesSupported?.some(t=>t.toLowerCase()==="code")??!1}static supportsEnrollment(n){return!!n.enrollmentEndpoint}static supportsSession(n){return!!n.sessionEndpoint}async tryEndpoint(n){let t;try{t=await fetch(n)}catch(o){let a=o instanceof Error?o.message:String(o);return a.includes("ENOTFOUND")||a.includes("ECONNREFUSED")?(console.error(` OAuth discovery: ${n} \u2014 host unreachable (${a})`),console.error(" If the server is behind a VPN, ensure you are connected.")):a.includes("CERT")||a.includes("SSL")||a.includes("TLS")?(console.error(` OAuth discovery: ${n} \u2014 TLS error (${a})`),console.error(" If using a custom CA certificate, set NODE_EXTRA_CA_CERTS=/path/to/ca.pem")):console.error(` OAuth discovery: ${n} \u2014 network error: ${a}`),null}if(!t.ok)return t.status===404||(t.status===403?(console.error(` OAuth discovery: ${n} \u2014 HTTP 403 Forbidden`),console.error(" Access may be blocked by a firewall, proxy, or WAF.")):t.status>=500&&(console.error(` OAuth discovery: ${n} \u2014 HTTP ${t.status} server error`),console.error(" The authorization server returned an internal error. Contact your IDP administrator."))),null;let r;try{r=await t.json()}catch{return console.error(` OAuth discovery: ${n} \u2014 response is not valid JSON`),console.error(" The endpoint may be returning HTML instead of JSON. Check IDP configuration."),null}return{issuer:w(r.issuer),authorizationEndpoint:w(r.authorization_endpoint),tokenEndpoint:w(r.token_endpoint),registrationEndpoint:w(r.registration_endpoint),revocationEndpoint:w(r.revocation_endpoint),scopesSupported:P(r.scopes_supported),responseTypesSupported:P(r.response_types_supported),grantTypesSupported:P(r.grant_types_supported),codeChallengeMethodsSupported:P(r.code_challenge_methods_supported),tokenEndpointAuthMethodsSupported:P(r.token_endpoint_auth_methods_supported),dpopSigningAlgValuesSupported:P(r.dpop_signing_alg_values_supported),enrollmentEndpoint:w(r.enrollment_endpoint),enrollmentIssuanceProtocols:P(r.enrollment_issuance_protocols),enrollmentKeyTypes:P(r.enrollment_key_types),enrollmentScopesSupported:P(r.enrollment_scopes_supported),enrollmentConsentBindingParam:w(r.enrollment_consent_binding_param),sessionEndpoint:w(r.session_endpoint),sessionEndpointAuthMethod:w(r.session_endpoint_auth_method)}}};async function tn(e){try{let n=await fetch(e);return n.ok?await n.json():null}catch{return null}}function w(e){return typeof e=="string"?e:null}function P(e){return Array.isArray(e)?e.filter(n=>typeof n=="string"):null}function Re(e){let n=e.headers.get("WWW-Authenticate")??void 0,t=e.headers.get("DPoP-Nonce")??void 0;if(!n&&!t)return;let r={wwwAuthenticate:n??""};if(t&&(r.nonce=t),n){let o=n.match(/acr_values\s*=\s*"([^"]*)"/i);o&&(r.acrValues=o[1])}return r}function rn(e){try{return new URL(e).host}catch{return null}}function on(e,n={}){let t=n.discovery??new N,r=new Map,o=new Map,a=async s=>{let d=r.get(s);if(d!==void 0)return d;let f=null,p=await t.discoverProtectedResource(s).catch(()=>null);return p&&p.length>0&&(f=rn(p[0])),r.set(s,f),f},c=async(s,d)=>{if(!e)return null;if(!(d.forceRefresh||d.challenge)&&o.has(s))return o.get(s);let p=await e.resolve(s,d).catch(()=>null);return o.set(s,p),p},i=async(s,d,f,p)=>{let g=await a(d);if(!g)return{res:await F(s,{method:f,redirect:"manual"}),authed:!1};let u=await c(g,{method:f,url:s,...p}),l=u?.headers??{};return{res:await F(s,{method:f,redirect:"manual",headers:l}),authed:!!u}};return async(s,d,f="GET")=>{let p=await i(s,d,f,{});if((p.res.status===401||p.res.status===403)&&p.authed){let g=Re(p.res),u={forceRefresh:g===void 0};return g&&(u.challenge=g),(await i(s,d,f,u)).res}return p.res}}var _e="KANONAK_TOKEN";function an(){return typeof process<"u"&&process.env?process.env:{}}function sn(e){return`${_e}_${e.toUpperCase().replace(/[^A-Z0-9]+/g,"_")}`}var Q=class{tokens;env;constructor(n={}){this.tokens=n.tokens??{},this.env=n.env??an()}async resolve(n,t){let r=A(n),o=this.tokens[r]??this.env[sn(r)]??this.env[_e];return o?{headers:{Authorization:`Bearer ${o}`}}:null}};var R="kanonak.org",U="core-rdf",Ie="core-xsd",Ae={publisher:R,package_:U,name:"subClassOf"},Ne={publisher:R,package_:U,name:"label"},$e={publisher:R,package_:U,name:"comment"},Ke={publisher:R,package_:"core-owl",name:"oneOf"},xe=e=>e;function cn(e){let n=fe(e,Ae);if(n)return[n];let t=[];for(let r of V(e,Ae))r instanceof _&&t.push(r.subject);return t}function pn(e,n,t){if(n.publisher===R&&n.package_===U&&n.name==="Literal")return{kind:"datatype",uri:n};let o=G(e,n);if(o){let a=xe(o);if(O.isDatatypeType(a))return{kind:"datatype",uri:n};if(O.isClassType(a))return{kind:"class",uri:x(o)??n,localName:o.name}}return n.publisher===R&&n.package_===Ie?{kind:"datatype",uri:n}:t==="datatype"?{kind:"datatype",uri:n}:{kind:"class",uri:n,localName:n.name}}function ln(e,n,t){if(!n.range)throw new Error(`Property ${n.uri.publisher}/${n.uri.package_}/${n.uri.name} has no rdfs.range; every property must declare a range. Validate the ontology before introspecting it.`);let r=pn(e,n.range,n.kind),o=n.kind==="object"?"object":n.kind==="datatype"?"datatype":r.kind==="class"?"object":"datatype";return{uri:n.uri,localName:n.uri.name,kind:o,range:r,...n.label!==void 0?{label:n.label}:{},...n.comment!==void 0?{comment:n.comment}:{},...t??{}}}var M=e=>new re(R,Ie,e);function un(e){return typeof e=="boolean"?M("boolean"):typeof e=="number"?Number.isInteger(e)?M("integer"):M("decimal"):M("string")}function dn(e,n){let t=[];for(let r of V(n,Ke))if(r instanceof _){let o=G(e,r.subject),a=(o?x(o):void 0)??r.subject,c=o?I(o,Ne):void 0,i=o?I(o,$e):void 0;t.push({kind:"individual",uri:a,localName:a.name,...c!==void 0?{label:c}:{},...i!==void 0?{comment:i}:{}})}else r instanceof $&&t.push({kind:"literal",value:r.value,datatype:un(r.value)});return t}function fn(e,n,t,r){let o=ge(e,n),a=K(n);return ye(e,n).filter(i=>t?!0:i.domains.some(s=>K(s)===a)).map(i=>ln(e,i,he(r,o,i.uri)))}async function gn(e,n,t){let r=e.metadata?.namespace_;if(!r)throw new Error("buildOntologyModel: document has no namespace (publisher/package/version).");let o=t?.includeInherited??!1,a=await new D().parseKanonaks(n),c=me(a),i=[],s=[],d=new Set;for(let f of a){if(!(f instanceof E)||!O.isClassType(xe(f)))continue;let p=x(f);if(!p||p.publisher!==r.publisher||p.package_!==r.package_||p.version&&r.version&&!ee(p.version,r.version))continue;let g=K(p);if(d.has(g))continue;d.add(g);let u=cn(f).map(b=>({uri:b,localName:b.name})),l=I(f,Ne),m=I(f,$e);i.push({uri:p,localName:p.name,superClasses:u,properties:fn(a,p,o,c),...l!==void 0?{label:l}:{},...m!==void 0?{comment:m}:{}}),de(f,Ke)&&s.push({uri:p,localName:p.name,members:dn(a,f),...l!==void 0?{label:l}:{},...m!==void 0?{comment:m}:{}})}return{classes:i,enums:s}}export{Ce as a,Se as b,H as c,ze as d,He as e,en as f,A as g,nn as h,N as i,Re as j,on as k,Q as l,gn as m};