@kanonak-protocol/sdk 4.7.0 → 4.8.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.
@@ -1,4 +1,4 @@
1
- import{a as g}from"../chunk-XRXCYM3U.js";import"../chunk-QHABFCRC.js";import"../chunk-4NO7MHS7.js";import"../chunk-PEUTCG3B.js";import"../chunk-PEJALHXK.js";import"../chunk-SC5M74NM.js";import"../chunk-SHDHMKMJ.js";import"../chunk-DSHPAWJQ.js";import"../chunk-NJ3AZYQD.js";import{d as m,h as S}from"../chunk-UK2OIPAB.js";import{a as p,f as E}from"../chunk-PBNVHBS3.js";import"../chunk-VKTFLHCW.js";import{c as v}from"../chunk-T3JR2SV6.js";import"../chunk-FUUTGGJS.js";import{c as x}from"../chunk-2ACBWC7K.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{a as g}from"../chunk-OOR5SVNQ.js";import"../chunk-QHABFCRC.js";import"../chunk-4NO7MHS7.js";import"../chunk-PEUTCG3B.js";import"../chunk-PEJALHXK.js";import"../chunk-SC5M74NM.js";import"../chunk-SHDHMKMJ.js";import"../chunk-DSHPAWJQ.js";import"../chunk-NJ3AZYQD.js";import{d as m,h as S}from"../chunk-UK2OIPAB.js";import{a as p,f as E}from"../chunk-PBNVHBS3.js";import"../chunk-VKTFLHCW.js";import{c as v}from"../chunk-T3JR2SV6.js";import"../chunk-FUUTGGJS.js";import{c as x}from"../chunk-2ACBWC7K.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,6 +1,7 @@
1
1
  import type { Kanonak } from '../kanonaks/index.js';
2
2
  import type { LookRenderer } from '../look/index.js';
3
3
  import type { IPackageProducer } from '../producer/index.js';
4
+ import type { RenderStackReport } from './renderStack.js';
4
5
  import type { ServerModel } from './types.js';
5
6
  /**
6
7
  * Build the route-facing indexes for a {@link ServerModel} from an already-built
@@ -19,5 +20,6 @@ export declare function assembleServerModel(params: {
19
20
  lookRenderer: LookRenderer;
20
21
  localNamespaces: Set<string>;
21
22
  rawByNsKey: Map<string, string>;
23
+ renderStack: RenderStackReport;
22
24
  producers?: readonly IPackageProducer[];
23
25
  }): ServerModel;
@@ -5,6 +5,8 @@ export { route } from './route.js';
5
5
  export { RequestRouter, landingPage } from './requestRouter.js';
6
6
  export type { RequestRouterOptions } from './requestRouter.js';
7
7
  export { deriveImportClosure, ClosureScopedRepository } from './closure.js';
8
- export { UNIVERSAL_RENDER_BASE, resolveRenderContract, renderRefKey, } from './renderStack.js';
9
- export type { RenderPackageRef } from './renderStack.js';
8
+ export { UNIVERSAL_RENDER_BASE, resolveRenderContract, renderRefKey, buildRenderStackWarnings, } from './renderStack.js';
9
+ export type { RenderPackageRef, RenderPackageStatus, RenderStackReport, } from './renderStack.js';
10
+ export { buildRenderDiagnostics, renderDiagnosticsHtml } from './renderDiagnostics.js';
11
+ export type { RenderDiagnostics } from './renderDiagnostics.js';
10
12
  export type { ServerModel, RouteResponse, LoadServerModelOptions, PackageVersion, } from './types.js';
@@ -1,3 +1,66 @@
1
- import{j as E}from"../chunk-XRXCYM3U.js";import"../chunk-QHABFCRC.js";import{a as Z,d as A,f as te,h as N}from"../chunk-MPBNEKCQ.js";import{a as ee,b as re,c as V,d as I}from"../chunk-F26XWM5K.js";import{a as X}from"../chunk-4NO7MHS7.js";import"../chunk-PEUTCG3B.js";import{a as oe}from"../chunk-PEJALHXK.js";import"../chunk-SC5M74NM.js";import"../chunk-SHDHMKMJ.js";import{i as L}from"../chunk-DSHPAWJQ.js";import{a as D}from"../chunk-NJ3AZYQD.js";import{b as O}from"../chunk-UK2OIPAB.js";import"../chunk-PBNVHBS3.js";import"../chunk-VKTFLHCW.js";import{c as ne}from"../chunk-T3JR2SV6.js";import"../chunk-FUUTGGJS.js";import{c as F,e as z,f as K,g as Q}from"../chunk-2ACBWC7K.js";import{readFileSync as ue,existsSync as de,readdirSync as me,writeFileSync as ge,mkdirSync as fe}from"fs";import{join as q}from"path";function se(n){let e=n.metadata?.namespace_;return e?`${e.publisher}/${e.package_}`:void 0}async function M(n,e){let t=new Set,r=[...n];for(;r.length>0;){let o=r.shift(),i=se(o);if(!i||t.has(i))continue;t.add(i);let d=o.metadata?.imports;if(d)for(let[c,f]of Object.entries(d))for(let g of f)try{let l=await e.getHighestCompatibleVersionAsync(c,g);l&&r.push(l)}catch{}}return t}var j=class{constructor(e,t){this.inner=e;this.scope=t}inner;scope;async getAllDocumentsAsync(){return(await this.inner.getAllDocumentsAsync()).filter(t=>{let r=se(t);return r!==void 0&&this.scope.has(r)})}getDocumentAsync(e){return this.inner.getDocumentAsync(e)}getDocumentsByNamespaceAsync(e,t){return this.inner.getDocumentsByNamespaceAsync(e,t)}getHighestCompatibleVersionAsync(e,t){return this.inner.getHighestCompatibleVersionAsync(e,t)}saveDocumentAsync(e,t){return this.inner.saveDocumentAsync(e,t)}deleteDocumentAsync(e){return this.inner.deleteDocumentAsync(e)}clearNamespaceAsync(e,t){return this.inner.clearNamespaceAsync(e,t)}getAllDocumentReferencesAsync(){return this.inner.getAllDocumentReferencesAsync()}getDocumentContentAsync(e){return this.inner.getDocumentContentAsync(e)}getDocumentUriAsync(e){return this.inner.getDocumentUriAsync(e)}};var ae=[{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 C(n){let e=n?.render;if(e&&e.length>0){let t=[];for(let r of e)try{let o=O(r);o.kind==="package"?t.push({publisher:o.publisher,package_:o.package_}):o.kind==="resource"&&t.push({publisher:o.uri.publisher,package_:o.uri.package_})}catch{}if(t.length>0)return t}return ae}function H(n){return`${n.publisher}/${n.package_}`}function B(n){let{publisher:e,availablePublishers:t,catalog:r,lookRenderer:o,localNamespaces:i,rawByNsKey:d,producers:c}=n,f=new Map,g=new Map,l=new Map,a=new Set;for(let m of r){if(!(m instanceof ne))continue;let y=m.namespace||"";if(!i.has(y))continue;f.set(`${y}/${m.name}`,m);let v=y.split("/")[1]??"",[x,p]=v.split("@");if(!x||!p)continue;let b=Q(p);b&&(a.has(v)||(a.add(v),g.has(x)||g.set(x,[]),g.get(x).push({verStr:p,version:b})),m.name===x&&l.set(v,m))}for(let m of g.values())m.sort((y,v)=>F(v.version,y.version));return{publisher:e,availablePublishers:t,catalog:r,lookRenderer:o,localNamespaces:i,rawByNsKey:d,bySubject:f,pkgVersions:g,pkgSelfByVer:l,...c?{producers:c}:{}}}async function T(n,e={}){let t=new D,r=new X(t),o=[],i=[];for(let p of N(n)){let b;try{b=ue(p,"utf-8")}catch{continue}let w;try{w=t.parse(b).metadata?.namespace_}catch{continue}if(!w?.version)continue;let $=w.version;i.push({publisher:w.publisher,package_:w.package_,verStr:`${$.major}.${$.minor}.${$.patch}`,version:$,source:b})}i.sort((p,b)=>F(b.version,p.version));for(let p of i)await r.saveDocumentAsync(t.parse(p.source),`${p.publisher}/${p.package_}@${p.verStr}`),o.push({publisher:p.publisher,package_:p.package_,verStr:p.verStr,source:p.source});let d=[...new Set(o.map(p=>p.publisher))].sort(),c=e.publisher;if(c){if(!d.includes(c))throw new Error(`Publisher "${c}" not found in workspace. Available: ${d.join(", ")||"(none)"}`)}else if(d.length===1)c=d[0];else throw d.length===0?new Error(`No Kanonak packages found under ${n}`):new Error(`Workspace has multiple publishers (${d.join(", ")}). Pass --publisher <domain> to choose which one to serve.`);let f=new Set,g=new Map;for(let p of o)p.publisher===c&&(f.add(`${p.publisher}/${p.package_}@${p.verStr}`),g.set(`${p.package_}@${p.verStr}`,p.source));let l=new Z(A(),!0,t),a=e.repository??new te(r,l,new I(e.httpCache?{getFromCache:e.httpCache.getFromCache,onFetch:e.httpCache.onFetch}:void 0)),m=C(void 0);if(!e.repository){let p=A(),b=s=>{let h=q(p,s);return de(h)?new Set(me(h).filter(k=>k.endsWith(".kan.yml")).map(k=>k.split("@")[0])):new Set},w=(s,h)=>o.some(k=>k.publisher===s&&k.package_===h),$=new V,u=new Map;for(let s of m)if(u.has(s.publisher)||u.set(s.publisher,b(s.publisher)),!(u.get(s.publisher).has(s.package_)||w(s.publisher,s.package_)))try{let h=await $.getHighestVersion(s.publisher,s.package_);if(!h)continue;let k=await $.getPackageUrl(s.publisher,s.package_,h),_=await fetch(k);if(!_.ok)continue;let le=await _.text(),J=q(p,s.publisher);fe(J,{recursive:!0}),ge(q(J,`${s.package_}@${h}.kan.yml`),le,"utf-8")}catch{}}let y=a;if(!e.repository){let p=(await r.getAllDocumentsAsync()).filter(w=>w.metadata.namespace_?.publisher===c),b=await M(p,a);for(let w of m)b.add(H(w));y=new j(a,b)}let v=await new L(t).parseKanonaks(y),x=new E(v);return B({publisher:c,availablePublishers:d,catalog:v,lookRenderer:x,localNamespaces:f,rawByNsKey:g})}import{existsSync as he,readFileSync as ke,writeFileSync as ye,mkdirSync as ve}from"fs";import{join as ie}from"path";async function U(n,e={}){let t=new D,r=O(n),o=r.kind==="resource"?r.uri.publisher:r.publisher,i=e.cacheRoot??A(),d=(u,s,h)=>ie(i,u,`${s}@${h}.kan.yml`),c=new I({getFromCache:(u,s,h)=>{let k=d(u,s,h);return he(k)?ke(k,"utf-8"):null},onFetch:(u,s,h,k)=>{let _=ie(i,u);ve(_,{recursive:!0}),ye(d(u,s,h),k,"utf-8")},...e.fetchFn?{fetchFn:e.fetchFn}:{}}),f=new V(e.fetchFn?{fetchFn:e.fetchFn}:void 0),g;if(r.kind==="resource"){let u=r.uri.version;g=[u?{package_:r.uri.package_,version:`${u.major}.${u.minor}.${u.patch}`}:{package_:r.uri.package_}]}else if(r.kind==="package"){let u=r.version;g=[u?{package_:r.package_,version:`${u.major}.${u.minor}.${u.patch}`}:{package_:r.package_}]}else g=(await f.listLatestPackages(o)).map(s=>({package_:s.packageName}));let l=async(u,s,h)=>{try{let k=h?t.buildImport(s,"=",h,u):t.buildImport(s,"*","0.0.0",u);return await c.getHighestCompatibleVersionAsync(u,k)}catch{return null}},a=[];for(let u of g){let s=await l(o,u.package_,u.version);s&&a.push(s)}if(a.length===0)throw new Error(`Could not fetch any package for address "${n}" from publisher "${o}".`);let m=await new re().getConfig(o).catch(()=>{}),y=[];for(let u of C(m)){let s=await l(u.publisher,u.package_,void 0);s&&y.push(s)}let v=await M([...a,...y],c),x=new j(c,v),p=await new L(t).parseKanonaks(x),b=new E(p),w=new Set,$=new Map;for(let u of await c.getAllDocumentsAsync()){let s=u.metadata.namespace_;if(!s||s.publisher!==o)continue;let h=`${s.version.major}.${s.version.minor}.${s.version.patch}`,k=`${s.publisher}/${s.package_}@${h}`;w.add(k);let _=await c.getDocumentContentAsync(k);_!==null&&$.set(`${s.package_}@${h}`,_)}return B({publisher:o,availablePublishers:[o],catalog:p,lookRenderer:b,localNamespaces:w,rawByNsKey:$})}import{VersionOperator as W}from"@kanonak-protocol/types/document/models/enums";var S={".html":"text/html; charset=utf-8",".css":"text/css; charset=utf-8",".svg":"image/svg+xml",".md":"text/markdown; charset=utf-8",".kan.yml":"application/yaml; charset=utf-8",".txt":"text/plain; charset=utf-8",".json":"application/json; charset=utf-8"},R=(n,e,t,r)=>({status:n,headers:{"Content-Type":e,...r||{}},body:t}),P=n=>R(404,S[".html"],`<!doctype html><meta charset=utf-8><title>404</title><h1>404</h1><p>Not found: ${n}</p>`),be=n=>({status:301,headers:{Location:n},body:""}),we=n=>({status:302,headers:{Location:n},body:""});function Se(n){switch(n.kind){case"exact":return{operator:W.Exact,version:K(n.major,n.minor,n.patch)};case"minor-pin":return{operator:W.Compatible,version:K(n.major,n.minor,0)};case"major-pin":return{operator:W.Major,version:K(n.major,0,0)};default:return{operator:W.Any,version:K(0,0,0)}}}async function Re(n,e,t,r){if(!r)return null;let o=n.producers?.find(f=>f.canProduce(n.publisher,e));if(!o)return null;let i=await o.resolveVersion(n.publisher,e,Se(t));if(!i)return null;let d=z(i);if(t.kind!=="exact")return we(`/${e}/${d}.kan.yml`);let{source:c}=await o.produce(n.publisher,e,i);return R(200,S[".kan.yml"],c)}function ce(n,e,t){let r=n.pkgVersions.get(e);if(!r||r.length===0)return null;switch(t.kind){case"any":return r[0].verStr;case"major-pin":return r.find(o=>o.version.major===t.major)?.verStr??null;case"minor-pin":return r.find(o=>o.version.major===t.major&&o.version.minor===t.minor)?.verStr??null;case"exact":return r.find(o=>o.version.major===t.major&&o.version.minor===t.minor&&o.version.patch===t.patch)?.verStr??null;default:return null}}async function G(n,e,t=""){let{lookRenderer:r,publisher:o}=n;if(e==="/.well-known/kanonak.json"){let a=ee(o);return n.producers&&n.producers.length>0&&(a.resolveByRedirect=!0),R(200,S[".json"],JSON.stringify(a,null,2))}if(e==="/index.txt"){let a=[...n.localNamespaces].map(m=>m.split("/")[1].replace("@","/")).sort();return R(200,S[".txt"],a.join(`
1
+ import{j as ee}from"../chunk-OOR5SVNQ.js";import"../chunk-QHABFCRC.js";import{a as me,d as U,f as fe,h as J}from"../chunk-MPBNEKCQ.js";import{a as he,b as ke,c as z,d as Y}from"../chunk-F26XWM5K.js";import{a as ge}from"../chunk-4NO7MHS7.js";import"../chunk-PEUTCG3B.js";import{a as be}from"../chunk-PEJALHXK.js";import"../chunk-SC5M74NM.js";import"../chunk-SHDHMKMJ.js";import{i as Q}from"../chunk-DSHPAWJQ.js";import{a as L}from"../chunk-NJ3AZYQD.js";import{b as X}from"../chunk-UK2OIPAB.js";import{g as Z}from"../chunk-PBNVHBS3.js";import"../chunk-VKTFLHCW.js";import{c as ye}from"../chunk-T3JR2SV6.js";import"../chunk-FUUTGGJS.js";import{c as F,e as K,f as H,g as ue}from"../chunk-2ACBWC7K.js";import{readFileSync as Pe,writeFileSync as De,mkdirSync as _e}from"fs";import{join as $e}from"path";function ve(n){let e=n.metadata?.namespace_;return e?`${e.publisher}/${e.package_}`:void 0}async function T(n,e){let t=new Set,r=[...n];for(;r.length>0;){let s=r.shift(),a=ve(s);if(!a||t.has(a))continue;t.add(a);let h=s.metadata?.imports;if(h)for(let[u,f]of Object.entries(h))for(let p of f)try{let g=await e.getHighestCompatibleVersionAsync(u,p);g&&r.push(g)}catch{}}return t}var B=class{constructor(e,t){this.inner=e;this.scope=t}inner;scope;async getAllDocumentsAsync(){return(await this.inner.getAllDocumentsAsync()).filter(t=>{let r=ve(t);return r!==void 0&&this.scope.has(r)})}getDocumentAsync(e){return this.inner.getDocumentAsync(e)}getDocumentsByNamespaceAsync(e,t){return this.inner.getDocumentsByNamespaceAsync(e,t)}getHighestCompatibleVersionAsync(e,t){return this.inner.getHighestCompatibleVersionAsync(e,t)}saveDocumentAsync(e,t){return this.inner.saveDocumentAsync(e,t)}deleteDocumentAsync(e){return this.inner.deleteDocumentAsync(e)}clearNamespaceAsync(e,t){return this.inner.clearNamespaceAsync(e,t)}getAllDocumentReferencesAsync(){return this.inner.getAllDocumentReferencesAsync()}getDocumentContentAsync(e){return this.inner.getDocumentContentAsync(e)}getDocumentUriAsync(e){return this.inner.getDocumentUriAsync(e)}};var Se=[{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 W(n){let e=n?.render;if(e&&e.length>0){let t=[];for(let r of e)try{let s=X(r);s.kind==="package"?t.push({publisher:s.publisher,package_:s.package_}):s.kind==="resource"&&t.push({publisher:s.uri.publisher,package_:s.uri.package_})}catch{}if(t.length>0)return t}return Se}function C(n){return`${n.publisher}/${n.package_}`}function G(n){let e={"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"},t=[];for(let r of n)if(r.origin==="missing"){let s=C(r),a=e[s]??"whatever this package contributes to rendering is lost";t.push(`Render-stack package ${s} is MISSING (${r.reason??"unknown reason"}) \u2014 ${a}. Fix: kanonak install ${s} (as the user running the render), or restore network access to ${r.publisher}.`)}else r.resolvedButNotInCatalog&&t.push(`Render-stack package ${C(r)} resolved (${r.origin}) but is NOT in the parsed catalog \u2014 this is a closure-scoping bug; please report it.`);return t}function re(n){let{publisher:e,availablePublishers:t,catalog:r,lookRenderer:s,localNamespaces:a,rawByNsKey:h,renderStack:u,producers:f}=n,p=new Map,g=new Map,o=new Map,m=new Set;for(let k of r){if(!(k instanceof ye))continue;let S=k.namespace||"";if(!a.has(S))continue;p.set(`${S}/${k.name}`,k);let b=S.split("/")[1]??"",[D,_]=b.split("@");if(!D||!_)continue;let I=ue(_);I&&(m.has(b)||(m.add(b),g.has(D)||g.set(D,[]),g.get(D).push({verStr:_,version:I})),k.name===D&&o.set(b,k))}for(let k of g.values())k.sort((S,b)=>F(b.version,S.version));return{publisher:e,availablePublishers:t,catalog:r,lookRenderer:s,localNamespaces:a,rawByNsKey:h,bySubject:p,pkgVersions:g,pkgSelfByVer:o,renderStack:u,...f?{producers:f}:{}}}async function se(n,e={}){let t=new L,r=new ge(t),s=[],a=[];for(let l of J(n)){let d;try{d=Pe(l,"utf-8")}catch{continue}let v;try{v=t.parse(d).metadata?.namespace_}catch{continue}if(!v?.version)continue;let N=v.version;a.push({publisher:v.publisher,package_:v.package_,verStr:K(N),version:N,source:d})}a.sort((l,d)=>F(d.version,l.version));for(let l of a)await r.saveDocumentAsync(t.parse(l.source),`${l.publisher}/${l.package_}@${l.verStr}`),s.push({publisher:l.publisher,package_:l.package_,verStr:l.verStr,source:l.source});let h=[...new Set(s.map(l=>l.publisher))].sort(),u=e.publisher;if(u){if(!h.includes(u))throw new Error(`Publisher "${u}" not found in workspace. Available: ${h.join(", ")||"(none)"}`)}else if(h.length===1)u=h[0];else throw h.length===0?new Error(`No Kanonak packages found under ${n}`):new Error(`Workspace has multiple publishers (${h.join(", ")}). Pass --publisher <domain> to choose which one to serve.`);let f=new Set,p=new Map;for(let l of s)l.publisher===u&&(f.add(`${l.publisher}/${l.package_}@${l.verStr}`),p.set(`${l.package_}@${l.verStr}`,l.source));let g=U(),o=new me(g,!0,t),m=e.repository??new fe(r,o,new Y(e.httpCache?{getFromCache:e.httpCache.getFromCache,onFetch:e.httpCache.onFetch}:void 0)),k=e.log??(()=>{}),S=W(void 0),b=[],D=l=>l.map(d=>d.metadata.namespace_?.version).filter(d=>d!==void 0).sort((d,v)=>F(v,d)).map(K);if(!e.repository){k(`[render-stack] resolving ${S.length} ambient look-stack package(s); cache: ${g}`);let l=new z;for(let d of S){let v=C(d),N=await r.getDocumentsByNamespaceAsync(d.publisher,d.package_);if(N.length>0){let $=D(N);b.push({...d,origin:"workspace",versions:$}),k(`[render-stack] ${v} \u2014 workspace (${$.join(", ")})`);continue}let O=await o.getDocumentsByNamespaceAsync(d.publisher,d.package_);if(O.length>0){let $=D(O);b.push({...d,origin:"cache",versions:$}),k(`[render-stack] ${v} \u2014 cache (${$.join(", ")})`);continue}try{let $=await l.getHighestVersion(d.publisher,d.package_);if(!$){let c=`publisher ${d.publisher} reachable but its index does not list ${d.package_}`;b.push({...d,origin:"missing",reason:c}),k(`[render-stack] ${v} \u2014 MISSING: ${c}`);continue}let j=await l.getPackageUrl(d.publisher,d.package_,$),V=await fetch(j);if(!V.ok){let c=`fetch ${j} failed: HTTP ${V.status} ${V.statusText}`;b.push({...d,origin:"missing",reason:c}),k(`[render-stack] ${v} \u2014 MISSING: ${c}`);continue}let i=await V.text();await r.saveDocumentAsync(t.parse(i),`${d.publisher}/${d.package_}@${$}`);try{let c=$e(g,d.publisher);_e(c,{recursive:!0}),De($e(c,`${d.package_}@${$}.kan.yml`),i,"utf-8"),b.push({...d,origin:"fetched",versions:[$]}),k(`[render-stack] ${v}@${$} \u2014 fetched from ${j}, installed to cache`)}catch(c){b.push({...d,origin:"fetched",versions:[$]}),k(`[render-stack] ${v}@${$} \u2014 fetched from ${j}, but cache ${g} is NOT WRITABLE (${c.message}); usable for this load only \u2014 every load will re-fetch it`)}}catch($){let j=`fetch failed: ${$.message}`;b.push({...d,origin:"missing",reason:j}),k(`[render-stack] ${v} \u2014 MISSING: ${j}`)}}}let _=m;if(!e.repository){let l=(await r.getAllDocumentsAsync()).filter(v=>v.metadata.namespace_?.publisher===u),d=await T(l,m);for(let v of S)d.add(C(v));_=new B(m,d)}let I=await new Q(t).parseKanonaks(_),q=new ee(I),oe=(l,d)=>Z(I,{publisher:l,package_:d,name:d}).length>0,A;if(e.repository){A=[];for(let l of S){let d=await m.getDocumentsByNamespaceAsync(l.publisher,l.package_);A.push(d.length>0?{...l,origin:"repository",versions:D(d)}:{...l,origin:"missing",reason:"not present in the caller-supplied repository"})}}else A=b.map(l=>l.origin==="missing"||oe(l.publisher,l.package_)?l:{...l,resolvedButNotInCatalog:!0});let E=G(A);for(let l of E)k(`[render-stack] WARNING: ${l}`);return re({publisher:u,availablePublishers:h,catalog:I,lookRenderer:q,localNamespaces:f,rawByNsKey:p,renderStack:{contractSource:"universal-default",cachePath:g,packages:A,warnings:E}})}import{existsSync as je,readFileSync as Ce,writeFileSync as Ie,mkdirSync as Ae}from"fs";import{join as we}from"path";async function ae(n,e={}){let t=new L,r=X(n),s=r.kind==="resource"?r.uri.publisher:r.publisher,a=e.log??(()=>{}),h=e.cacheRoot??U(),u=(i,c,y)=>we(h,i,`${c}@${y}.kan.yml`),f=new Set,p=new Set,g=new Map,o=new Y({getFromCache:(i,c,y)=>{let P=u(i,c,y),w=je(P)?Ce(P,"utf-8"):null;return w!==null&&f.add(`${i}/${c}`),w},onFetch:(i,c,y,P)=>{p.add(`${i}/${c}`);try{let w=we(h,i);Ae(w,{recursive:!0}),Ie(u(i,c,y),P,"utf-8")}catch(w){g.set(`${i}/${c}`,w.message),a(`[render] fetched ${i}/${c}@${y} but cache ${h} is NOT WRITABLE (${w.message}); usable for this load only \u2014 every load will re-fetch it`)}},...e.fetchFn?{fetchFn:e.fetchFn}:{}}),m=new z(e.fetchFn?{fetchFn:e.fetchFn}:void 0),k;if(r.kind==="resource"){let i=r.uri.version;k=[i?{package_:r.uri.package_,version:`${i.major}.${i.minor}.${i.patch}`}:{package_:r.uri.package_}]}else if(r.kind==="package"){let i=r.version;k=[i?{package_:r.package_,version:`${i.major}.${i.minor}.${i.patch}`}:{package_:r.package_}]}else k=(await m.listLatestPackages(s)).map(c=>({package_:c.packageName}));let S=async(i,c,y)=>{try{let P=y?t.buildImport(c,"=",y,i):t.buildImport(c,"*","0.0.0",i),w=await o.getHighestCompatibleVersionAsync(i,P);return w?{doc:w}:{doc:null,error:`${i} did not resolve ${c}${y?`@${y}`:""} (not in its index, or unreachable)`}}catch(P){return{doc:null,error:P.message}}},b=[],D=[];for(let i of k){let{doc:c,error:y}=await S(s,i.package_,i.version);c?b.push(c):y&&D.push(y)}if(b.length===0)throw new Error(`Could not fetch any package for address "${n}" from publisher "${s}".`+(D.length>0?` Reasons: ${D.join("; ")}`:""));let _=await new ke().getConfig(s).catch(()=>{}),I=W(_),q=_?.render&&_.render.length>0?"publisher-well-known":"universal-default",oe=i=>i.map(c=>c.metadata.namespace_?.version).filter(c=>c!==void 0).sort((c,y)=>F(y,c)).map(K);a(`[render-stack] resolving ${I.length} ambient look-stack package(s) (contract: ${q}); cache: ${h}`);let A=[],E=[];for(let i of I){let c=C(i),{doc:y,error:P}=await S(i.publisher,i.package_,void 0);if(y){A.push(y);let w=oe([y]),pe=p.has(c)?"fetched":f.has(c)?"cache":"fetched";E.push({...i,origin:pe,versions:w}),a(`[render-stack] ${c} \u2014 ${pe} (${w.join(", ")})`+(g.has(c)?" [cache write FAILED \u2014 will re-fetch next load]":""))}else E.push({...i,origin:"missing",reason:P??"unresolved"}),a(`[render-stack] ${c} \u2014 MISSING: ${P??"unresolved"}`)}let de=await T([...b,...A],o),l=new B(o,de),d=await new Q(t).parseKanonaks(l),v=new ee(d),N=E.map(i=>i.origin==="missing"||Z(d,{publisher:i.publisher,package_:i.package_,name:i.package_}).length>0?i:{...i,resolvedButNotInCatalog:!0}),O=G(N);for(let i of O)a(`[render-stack] WARNING: ${i}`);let $={contractSource:q,cachePath:h,packages:N,warnings:O},j=new Set,V=new Map;for(let i of await o.getAllDocumentsAsync()){let c=i.metadata.namespace_;if(!c?.version||c.publisher!==s)continue;let y=K(c.version),P=`${c.publisher}/${c.package_}@${y}`;j.add(P);let w=await o.getDocumentContentAsync(P);w!==null&&V.set(`${c.package_}@${y}`,w)}return re({publisher:s,availablePublishers:[s],catalog:d,lookRenderer:v,localNamespaces:j,rawByNsKey:V,renderStack:$})}import{VersionOperator as te}from"@kanonak-protocol/types/document/models/enums";function ne(n){let{lookRenderer:e,publisher:t,renderStack:r,catalog:s}=n,a=e.explainStylesheet(e.publisherSubject(t)),h=[...a.tokens.entries()].map(([o,m])=>({name:o,value:m.value,source:`${m.sourceNamespace}/${m.sourceName}`,level:m.level})),u=a.baseStylesheet,f={present:u.css!==void 0,...u.sourceNamespace!==void 0?{source:u.sourceNamespace}:{},...u.scope!==void 0?{scope:u.scope}:{},...u.css!==void 0?{bytes:u.css.length}:{},...u.problem!==void 0?{problem:u.problem}:{},candidates:u.candidates},p=new Map;for(let o of s){let m=o.namespace;m&&p.set(m,(p.get(m)??0)+1)}let g=[...p.entries()].map(([o,m])=>({namespace:o,resources:m})).sort((o,m)=>o.namespace.localeCompare(m.namespace));return{publisher:t,renderStack:{contractSource:r.contractSource,cachePath:r.cachePath,packages:r.packages.map(o=>({package_:C(o),origin:o.origin,...o.versions!==void 0?{versions:o.versions}:{},...o.reason!==void 0?{reason:o.reason}:{},...o.resolvedButNotInCatalog!==void 0?{resolvedButNotInCatalog:o.resolvedButNotInCatalog}:{}}))},stylesheet:{tokens:h,baseStylesheet:f,...a.look?{look:{sourceClass:`${a.look.sourceClass.publisher}/${a.look.sourceClass.package_}/${a.look.sourceClass.name}`}}:{}},catalog:g,warnings:[...r.warnings,...a.warnings.filter(o=>!r.warnings.includes(o))]}}function Ne(n){return n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function ie(n){let e=Ne,t=n.warnings.length===0,r=n.warnings.length===0?'<p class="ok">\u2713 No problems detected \u2014 the render stack is fully resolved and pages should be styled.</p>':n.warnings.map(p=>`<div class="warn">\u26A0 ${e(p)}</div>`).join(`
2
+ `),s=n.renderStack.packages.map(p=>{let g=p.origin!=="missing"&&!p.resolvedButNotInCatalog,o=p.origin==="missing"?'<span class="bad">MISSING</span>':p.resolvedButNotInCatalog?`<span class="bad">${e(p.origin)} (not in catalog)</span>`:`<span class="good">${e(p.origin)}</span>`,m=p.reason?e(p.reason):e((p.versions??[]).join(", "));return`<tr class="${g?"":"row-bad"}"><td><code>${e(p.package_)}</code></td><td>${o}</td><td>${m}</td></tr>`}).join(`
3
+ `),a=n.stylesheet.baseStylesheet,h=a.present?`<p><span class="good">\u2713 present</span> \u2014 <code>${e(a.source??"")}</code> (${a.bytes} bytes, ${e(a.scope??"")})</p>`:`<p><span class="bad">\u2717 MISSING</span>${a.problem?` \u2014 ${e(a.problem)}`:""}${a.candidates.length>0?`<br>candidates considered: ${a.candidates.map(p=>`<code>${e(p)}</code>`).join(", ")}`:""}</p><p>Without the base stylesheet, generated CSS stops at the <code>:root</code> token block and pages appear unstyled.</p>`,u=n.stylesheet.tokens.map(p=>`<tr><td><code>--kan-${e(p.name)}</code></td><td><code>${e(p.value)}</code></td><td><code>${e(p.source)}</code></td><td>${e(p.level)}</td></tr>`).join(`
4
+ `),f=n.catalog.map(p=>`<tr><td><code>${e(p.namespace)}</code></td><td>${p.resources}</td></tr>`).join(`
5
+ `);return`<!doctype html>
6
+ <html lang="en">
7
+ <head>
8
+ <meta charset="utf-8">
9
+ <meta name="viewport" content="width=device-width,initial-scale=1">
10
+ <title>Render diagnostics \u2014 ${e(n.publisher)}</title>
11
+ <style>
12
+ body { font-family: system-ui, sans-serif; max-width: 64rem; margin: 2rem auto; padding: 0 1rem; line-height: 1.5; color: #1a1a1a; background: #fff; }
13
+ h1 { font-size: 1.5rem; } h2 { font-size: 1.15rem; margin-top: 2rem; border-bottom: 1px solid #ddd; padding-bottom: .25rem; }
14
+ table { border-collapse: collapse; width: 100%; font-size: .9rem; }
15
+ th, td { text-align: left; padding: .35rem .6rem; border-bottom: 1px solid #eee; vertical-align: top; }
16
+ th { background: #f6f6f6; }
17
+ code { background: #f3f3f3; padding: 0 .25rem; border-radius: 3px; font-size: .85em; }
18
+ .good { color: #0a7d33; font-weight: 600; } .bad { color: #b91c1c; font-weight: 600; }
19
+ .ok { background: #ecfdf3; border: 1px solid #0a7d33; padding: .75rem 1rem; border-radius: 6px; }
20
+ .warn { background: #fef2f2; border: 1px solid #b91c1c; padding: .75rem 1rem; border-radius: 6px; margin-bottom: .5rem; white-space: pre-wrap; }
21
+ .row-bad td { background: #fff5f5; }
22
+ .meta { color: #666; font-size: .85rem; }
23
+ .status-banner { font-size: 1.1rem; padding: .5rem 1rem; border-radius: 6px; display: inline-block; margin-bottom: 1rem;
24
+ background: ${t?"#ecfdf3":"#fef2f2"}; border: 1px solid ${t?"#0a7d33":"#b91c1c"}; }
25
+ </style>
26
+ </head>
27
+ <body>
28
+ <h1>Render diagnostics \u2014 ${e(n.publisher)}</h1>
29
+ <p class="status-banner">${t?"\u2713 Healthy":`\u2717 ${n.warnings.length} problem(s) found`}</p>
30
+ <p class="meta">Machine-readable version: <a href="/.well-known/kanonak-render.json"><code>/.well-known/kanonak-render.json</code></a></p>
31
+
32
+ <h2>Problems</h2>
33
+ ${r}
34
+
35
+ <h2>Ambient render stack</h2>
36
+ <p class="meta">The look stack is discovered, not imported \u2014 these packages must be resolvable for any publisher's pages to render styled.
37
+ Contract: <code>${e(n.renderStack.contractSource)}</code> \xB7 Package cache: <code>${e(n.renderStack.cachePath)}</code></p>
38
+ <table>
39
+ <tr><th>Package</th><th>Origin</th><th>Versions / reason</th></tr>
40
+ ${s}
41
+ </table>
42
+
43
+ <h2>Base stylesheet</h2>
44
+ <p class="meta">Everything after the <code>:root</code> block in generated CSS comes from a <code>look-styles/base-stylesheet</code> asset in the render catalog.</p>
45
+ ${h}
46
+
47
+ <h2>Design tokens (:root)</h2>
48
+ <p class="meta">Resolved for the publisher landing page. Each token shows which resource in the cascade supplied it.</p>
49
+ ${n.stylesheet.tokens.length===0?'<p><span class="bad">\u2717 No tokens resolved</span></p>':`<table>
50
+ <tr><th>Token</th><th>Value</th><th>Declared by</th><th>Cascade level</th></tr>
51
+ ${u}
52
+ </table>`}
53
+
54
+ <h2>Look (page body)</h2>
55
+ ${n.stylesheet.look?`<p><span class="good">\u2713</span> Bands resolve from <code>${e(n.stylesheet.look.sourceClass)}</code></p>`:'<p><span class="bad">\u2717 No look resolved</span> \u2014 the page body renders as an empty comment.</p>'}
56
+
57
+ <h2>Render catalog (${n.catalog.length} package version(s))</h2>
58
+ <p class="meta">Everything the renderer can see for this publisher \u2014 the served packages, their import closure, and the ambient render stack.</p>
59
+ <table>
60
+ <tr><th>Package version</th><th>Resources</th></tr>
61
+ ${f}
62
+ </table>
63
+ </body>
64
+ </html>`}var R={".html":"text/html; charset=utf-8",".css":"text/css; charset=utf-8",".svg":"image/svg+xml",".md":"text/markdown; charset=utf-8",".kan.yml":"application/yaml; charset=utf-8",".txt":"text/plain; charset=utf-8",".json":"application/json; charset=utf-8"},x=(n,e,t,r)=>({status:n,headers:{"Content-Type":e,...r||{}},body:t}),M=n=>x(404,R[".html"],`<!doctype html><meta charset=utf-8><title>404</title><h1>404</h1><p>Not found: ${n}</p>`),Ke=n=>({status:301,headers:{Location:n},body:""}),Me=n=>({status:302,headers:{Location:n},body:""});function Ve(n){switch(n.kind){case"exact":return{operator:te.Exact,version:H(n.major,n.minor,n.patch)};case"minor-pin":return{operator:te.Compatible,version:H(n.major,n.minor,0)};case"major-pin":return{operator:te.Major,version:H(n.major,0,0)};default:return{operator:te.Any,version:H(0,0,0)}}}async function Fe(n,e,t,r){if(!r)return null;let s=n.producers?.find(f=>f.canProduce(n.publisher,e));if(!s)return null;let a=await s.resolveVersion(n.publisher,e,Ve(t));if(!a)return null;let h=K(a);if(t.kind!=="exact")return Me(`/${e}/${h}.kan.yml`);let{source:u}=await s.produce(n.publisher,e,a);return x(200,R[".kan.yml"],u)}function Re(n,e,t){let r=n.pkgVersions.get(e);if(!r||r.length===0)return null;switch(t.kind){case"any":return r[0].verStr;case"major-pin":return r.find(s=>s.version.major===t.major)?.verStr??null;case"minor-pin":return r.find(s=>s.version.major===t.major&&s.version.minor===t.minor)?.verStr??null;case"exact":return r.find(s=>s.version.major===t.major&&s.version.minor===t.minor&&s.version.patch===t.patch)?.verStr??null;default:return null}}async function ce(n,e,t=""){let{lookRenderer:r,publisher:s}=n;if(e==="/.well-known/kanonak.json"){let o=he(s);return n.producers&&n.producers.length>0&&(o.resolveByRedirect=!0),x(200,R[".json"],JSON.stringify(o,null,2))}if(e==="/index.txt"){let o=[...n.localNamespaces].map(m=>m.split("/")[1].replace("@","/")).sort();return x(200,R[".txt"],o.join(`
2
65
  `)+`
3
- `)}if(e==="/"||e==="/index.html"||e==="/index.css"){let a=r.publisherSubject(o);return e==="/index.css"?R(200,S[".css"],r.renderStylesheet(a)):R(200,S[".html"],await r.renderDocument(a,{rootIndex:!0}))}let i=".html",d=!1,c=e;for(let a of[".kan.yml",".css",".svg",".md",".html"])if(e.endsWith(a)){i=a,d=!0,c=e.slice(0,-a.length);break}let f=!d&&/application\/yaml|text\/yaml/i.test(t),g=c.endsWith("/");g&&c!=="/"&&(c=c.slice(0,-1));let l=oe.parse(c,o);if(!l)return P(e);if(l.kind==="package"){let a=ce(n,l.package_,l.versionSpec);if(!a)return await Re(n,l.package_,l.versionSpec,i===".kan.yml"||f)??P(e);if(i===".kan.yml"||f){let v=n.rawByNsKey.get(`${l.package_}@${a}`);return v!==void 0?R(200,S[".kan.yml"],v):P(e)}let m=n.pkgSelfByVer.get(`${l.package_}@${a}`);if(!m)return P(e);if(i===".css")return R(200,S[".css"],r.renderStylesheet(m));if(!g)return be(c+"/");let y=l.versionSpec.kind==="any";if(y&&!r.hasDeclaredView(m)){let v=(n.pkgVersions.get(l.package_)||[]).map(x=>x.verStr);return R(200,S[".html"],r.renderPackageVersionList(l.package_,v,m))}return R(200,S[".html"],await r.renderDocument(m,y?{bareOverview:!0}:void 0))}if(l.kind==="resource"){let a=ce(n,l.package_,l.versionSpec);if(!a)return P(e);let m=n.bySubject.get(`${o}/${l.package_}@${a}/${l.name}`);if(!m)return P(e);switch(i){case".css":return R(200,S[".css"],r.renderStylesheet(m));case".svg":return R(200,S[".svg"],await r.renderSvg(m));case".md":{let y=r.renderRawMarkdown(m);return y===void 0?P(e):R(200,S[".md"],y)}default:return R(200,S[".html"],await r.renderDocument(m))}}return P(e)}import{readFileSync as xe}from"fs";var Y=class{constructor(e={}){this.options=e}options;models=new Map;workspaceIndex;clearCache(){this.models.clear(),this.workspaceIndex=void 0}getWorkspaceIndex(){if(this.workspaceIndex)return this.workspaceIndex;let e=new Set,t=new Set;if(this.options.root!==void 0){let r=new D;for(let o of N(this.options.root))try{let i=r.parse(xe(o,"utf-8")).metadata?.namespace_;if(!i?.version)continue;let d=i.version;e.add(`${i.publisher}/${i.package_}@${d.major}.${d.minor}.${d.patch}`),t.add(`${i.publisher}/${i.package_}`)}catch{}}return this.workspaceIndex={exact:e,pkgs:t},this.workspaceIndex}async modelFor(e,t,r){let o=this.getWorkspaceIndex(),i=this.options.fetchFn?{fetchFn:this.options.fetchFn}:{},d=t?r?o.exact.has(`${e}/${t}@${r}`):o.pkgs.has(`${e}/${t}`):[...o.pkgs].some(a=>a.startsWith(`${e}/`)),c,f;if(d&&this.options.root!==void 0){let a=this.options.root;c=`ws:${e}`,f=()=>T(a,{publisher:e})}else{let a=t?r?`${e}/${t}@${r}`:`${e}/${t}`:e;c=`rm:${a}`,f=()=>U(a,i)}let g=this.models.get(c);if(g)return g;let l=await f();return l.lookRenderer.setLinkMode("open-world"),this.models.set(c,l),l}async handle(e,t=""){let r=e.split("/").filter(Boolean);if(r.length===0)return{status:200,headers:{"Content-Type":"text/html; charset=utf-8"},body:pe()};let o=r[0];if(!o.includes("."))return{status:404,headers:{"Content-Type":"text/html; charset=utf-8"},body:"<!doctype html><meta charset=utf-8><title>404</title><h1>404</h1><p>Expected a publisher domain as the first path segment: <code>/{publisher}/{package}/{version}/{resource}</code></p>"};let i=r.length>=2&&(r[1]==="index.html"||r[1]==="index.css"||r[1]==="index.txt"||r[1]===".well-known"),d=!i&&r.length>=2?r[1]:void 0,c=!i&&r.length>=3&&/^\d+\.\d+\.\d+$/.test(r[2])?r[2]:void 0,f=await this.modelFor(o,d,c),g=e.endsWith("/")&&r.length>1?"/":"",l="/"+r.slice(1).join("/")+g,a=await G(f,l,t);return a.headers.Location?{...a,headers:{...a.headers,Location:`/${o}${a.headers.Location}`}}:a}};function pe(){return'<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Kanonak origin</title></head><body style="font-family:system-ui;max-width:40rem;margin:4rem auto;padding:0 1rem"><h1>Kanonak request-driven origin</h1><p>Open a resource by its address:</p><p><code>/{publisher}/{package}/{version}/{resource}</code></p><p>e.g. <code>/kanonak.org/capabilities/2.0.0/Capability</code></p></body></html>'}export{j as ClosureScopedRepository,Y as RequestRouter,ae as UNIVERSAL_RENDER_BASE,M as deriveImportClosure,pe as landingPage,U as loadResourceModel,T as loadServerModel,H as renderRefKey,C as resolveRenderContract,G as route};
66
+ `)}if(e==="/.well-known/kanonak-render.json")return x(200,R[".json"],JSON.stringify(ne(n),null,2));if(e==="/.well-known/kanonak-render")return x(200,R[".html"],ie(ne(n)));if(e==="/"||e==="/index.html"||e==="/index.css"){let o=r.publisherSubject(s);return e==="/index.css"?x(200,R[".css"],r.renderStylesheet(o)):x(200,R[".html"],await r.renderDocument(o,{rootIndex:!0}))}let a=".html",h=!1,u=e;for(let o of[".kan.yml",".css",".svg",".md",".html"])if(e.endsWith(o)){a=o,h=!0,u=e.slice(0,-o.length);break}let f=!h&&/application\/yaml|text\/yaml/i.test(t),p=u.endsWith("/");p&&u!=="/"&&(u=u.slice(0,-1));let g=be.parse(u,s);if(!g)return M(e);if(g.kind==="package"){let o=Re(n,g.package_,g.versionSpec);if(!o)return await Fe(n,g.package_,g.versionSpec,a===".kan.yml"||f)??M(e);if(a===".kan.yml"||f){let S=n.rawByNsKey.get(`${g.package_}@${o}`);return S!==void 0?x(200,R[".kan.yml"],S):M(e)}let m=n.pkgSelfByVer.get(`${g.package_}@${o}`);if(!m)return M(e);if(a===".css")return x(200,R[".css"],r.renderStylesheet(m));if(!p)return Ke(u+"/");let k=g.versionSpec.kind==="any";if(k&&!r.hasDeclaredView(m)){let S=(n.pkgVersions.get(g.package_)||[]).map(b=>b.verStr);return x(200,R[".html"],r.renderPackageVersionList(g.package_,S,m))}return x(200,R[".html"],await r.renderDocument(m,k?{bareOverview:!0}:void 0))}if(g.kind==="resource"){let o=Re(n,g.package_,g.versionSpec);if(!o)return M(e);let m=n.bySubject.get(`${s}/${g.package_}@${o}/${g.name}`);if(!m)return M(e);switch(a){case".css":return x(200,R[".css"],r.renderStylesheet(m));case".svg":return x(200,R[".svg"],await r.renderSvg(m));case".md":{let k=r.renderRawMarkdown(m);return k===void 0?M(e):x(200,R[".md"],k)}default:return x(200,R[".html"],await r.renderDocument(m))}}return M(e)}import{readFileSync as Be}from"fs";var le=class{constructor(e={}){this.options=e}options;models=new Map;workspaceIndex;clearCache(){this.models.clear(),this.workspaceIndex=void 0}getWorkspaceIndex(){if(this.workspaceIndex)return this.workspaceIndex;let e=new Set,t=new Set;if(this.options.root!==void 0){let r=new L;for(let s of J(this.options.root))try{let a=r.parse(Be(s,"utf-8")).metadata?.namespace_;if(!a?.version)continue;let h=a.version;e.add(`${a.publisher}/${a.package_}@${h.major}.${h.minor}.${h.patch}`),t.add(`${a.publisher}/${a.package_}`)}catch{}}return this.workspaceIndex={exact:e,pkgs:t},this.workspaceIndex}async modelFor(e,t,r){let s=this.getWorkspaceIndex(),a={...this.options.fetchFn?{fetchFn:this.options.fetchFn}:{},...this.options.log?{log:this.options.log}:{}},h=t?r?s.exact.has(`${e}/${t}@${r}`):s.pkgs.has(`${e}/${t}`):[...s.pkgs].some(o=>o.startsWith(`${e}/`)),u,f;if(h&&this.options.root!==void 0){let o=this.options.root;u=`ws:${e}`,f=()=>se(o,{publisher:e,...this.options.log?{log:this.options.log}:{}})}else{let o=t?r?`${e}/${t}@${r}`:`${e}/${t}`:e;u=`rm:${o}`,f=()=>ae(o,a)}let p=this.models.get(u);if(p)return p;let g=await f();return g.lookRenderer.setLinkMode("open-world"),this.models.set(u,g),g}async handle(e,t=""){let r=e.split("/").filter(Boolean);if(r.length===0)return{status:200,headers:{"Content-Type":"text/html; charset=utf-8"},body:xe()};let s=r[0];if(!s.includes("."))return{status:404,headers:{"Content-Type":"text/html; charset=utf-8"},body:"<!doctype html><meta charset=utf-8><title>404</title><h1>404</h1><p>Expected a publisher domain as the first path segment: <code>/{publisher}/{package}/{version}/{resource}</code></p>"};let a=r.length>=2&&(r[1]==="index.html"||r[1]==="index.css"||r[1]==="index.txt"||r[1]===".well-known"),h=!a&&r.length>=2?r[1]:void 0,u=!a&&r.length>=3&&/^\d+\.\d+\.\d+$/.test(r[2])?r[2]:void 0,f=await this.modelFor(s,h,u),p=e.endsWith("/")&&r.length>1?"/":"",g="/"+r.slice(1).join("/")+p,o=await ce(f,g,t);return o.headers.Location?{...o,headers:{...o.headers,Location:`/${s}${o.headers.Location}`}}:o}};function xe(){return'<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Kanonak origin</title></head><body style="font-family:system-ui;max-width:40rem;margin:4rem auto;padding:0 1rem"><h1>Kanonak request-driven origin</h1><p>Open a resource by its address:</p><p><code>/{publisher}/{package}/{version}/{resource}</code></p><p>e.g. <code>/kanonak.org/capabilities/2.0.0/Capability</code></p></body></html>'}export{B as ClosureScopedRepository,le as RequestRouter,Se as UNIVERSAL_RENDER_BASE,ne as buildRenderDiagnostics,G as buildRenderStackWarnings,T as deriveImportClosure,xe as landingPage,ae as loadResourceModel,se as loadServerModel,ie as renderDiagnosticsHtml,C as renderRefKey,W as resolveRenderContract,ce as route};
@@ -5,6 +5,11 @@ export interface LoadResourceModelOptions {
5
5
  fetchFn?: AuthenticatedFetchFn;
6
6
  /** Override the global cache directory (the untrusted download accelerator). */
7
7
  cacheRoot?: string;
8
+ /**
9
+ * Progress/observability sink — narrates render-stack resolution (where each
10
+ * ambient look package came from, every fetch failure) as it happens.
11
+ */
12
+ log?: (line: string) => void;
8
13
  }
9
14
  /**
10
15
  * Build a {@link ServerModel} seeded from a single Kanonak ADDRESS, fetching
@@ -0,0 +1,74 @@
1
+ import type { ServerModel } from './types.js';
2
+ /**
3
+ * Render diagnostics — the self-service answer to "why does my site have no
4
+ * styles?" / "what is actually contributing to this page?".
5
+ *
6
+ * The look stack is AMBIENT (discovered, not imported), so when part of it is
7
+ * missing the only symptom is a bare page — no error anywhere. This module
8
+ * turns the server model's render-stack report (load-time: where each ambient
9
+ * package came from) plus the LookRenderer's stylesheet explanation
10
+ * (request-time: what the landing page's CSS actually resolves to) into one
11
+ * structured, human- and machine-readable report, served at:
12
+ *
13
+ * - `/.well-known/kanonak-render.json` — machine (curl / tooling)
14
+ * - `/.well-known/kanonak-render` — human (self-contained HTML)
15
+ *
16
+ * The HTML page deliberately depends on NOTHING it diagnoses: all styling is
17
+ * inline, so it renders correctly precisely when the look stack is broken.
18
+ */
19
+ /** JSON-friendly render diagnostics (no Maps, no class instances). */
20
+ export interface RenderDiagnostics {
21
+ /** The served publisher. */
22
+ readonly publisher: string;
23
+ /** Load-time: how the ambient render stack resolved when the model was built. */
24
+ readonly renderStack: {
25
+ readonly contractSource: string;
26
+ readonly cachePath: string;
27
+ readonly packages: readonly {
28
+ readonly package_: string;
29
+ readonly origin: string;
30
+ readonly versions?: readonly string[];
31
+ readonly reason?: string;
32
+ readonly resolvedButNotInCatalog?: boolean;
33
+ }[];
34
+ };
35
+ /** Request-time: what the publisher landing page's stylesheet resolves to. */
36
+ readonly stylesheet: {
37
+ readonly tokens: readonly {
38
+ readonly name: string;
39
+ readonly value: string;
40
+ readonly source: string;
41
+ readonly level: string;
42
+ }[];
43
+ readonly baseStylesheet: {
44
+ readonly present: boolean;
45
+ readonly source?: string;
46
+ readonly scope?: string;
47
+ readonly bytes?: number;
48
+ readonly problem?: string;
49
+ readonly candidates: readonly string[];
50
+ };
51
+ readonly look?: {
52
+ readonly sourceClass: string;
53
+ };
54
+ };
55
+ /** Every package namespace in the parsed render catalog + its resource count. */
56
+ readonly catalog: readonly {
57
+ readonly namespace: string;
58
+ readonly resources: number;
59
+ }[];
60
+ /** All warnings: load-time (render stack) + request-time (stylesheet). */
61
+ readonly warnings: readonly string[];
62
+ }
63
+ /**
64
+ * Build the diagnostics for a served model. Pure — reads the model's
65
+ * load-time render-stack report and asks the LookRenderer to explain the
66
+ * publisher landing page's stylesheet; performs no I/O.
67
+ */
68
+ export declare function buildRenderDiagnostics(model: ServerModel): RenderDiagnostics;
69
+ /**
70
+ * The human-readable diagnostics page. Entirely self-contained (inline CSS,
71
+ * no external stylesheet, no look-stack dependency) — it must render correctly
72
+ * exactly when the thing it diagnoses is broken.
73
+ */
74
+ export declare function renderDiagnosticsHtml(diag: RenderDiagnostics): string;
@@ -40,3 +40,43 @@ export declare const UNIVERSAL_RENDER_BASE: readonly RenderPackageRef[];
40
40
  export declare function resolveRenderContract(config: PublisherConfig | undefined): readonly RenderPackageRef[];
41
41
  /** The closure-set key (`publisher/package`) for a render-stack ref. */
42
42
  export declare function renderRefKey(ref: RenderPackageRef): string;
43
+ /** How one render-stack package became available to the render catalog (or didn't). */
44
+ export interface RenderPackageStatus {
45
+ readonly publisher: string;
46
+ readonly package_: string;
47
+ /**
48
+ * Where the package came from:
49
+ * - `workspace` — authored in the served workspace
50
+ * - `cache` — already in the global package cache
51
+ * - `fetched` — fetched from its publisher during this load and installed to the cache
52
+ * - `repository` — present in a caller-supplied resolution repository
53
+ * - `missing` — NOT available anywhere; pages lose whatever this package contributes
54
+ */
55
+ readonly origin: 'workspace' | 'cache' | 'fetched' | 'repository' | 'missing';
56
+ /** Resolved version(s) found, highest first, when known. */
57
+ readonly versions?: readonly string[];
58
+ /** Why it's missing (`origin === 'missing'`) — the captured failure, never swallowed. */
59
+ readonly reason?: string;
60
+ /** True when the package resolved but did NOT make it into the parsed catalog (a scoping bug). */
61
+ readonly resolvedButNotInCatalog?: boolean;
62
+ }
63
+ /**
64
+ * The load-time render-stack resolution report, attached to the `ServerModel`.
65
+ * `warnings` are human-readable: condition + consequence + fix.
66
+ */
67
+ export interface RenderStackReport {
68
+ /** Universal kanonak.org base, or the publisher's `.well-known` `render` override. */
69
+ readonly contractSource: 'universal-default' | 'publisher-well-known';
70
+ /** The global cache directory consulted (and populated by ambient fetches). */
71
+ readonly cachePath: string;
72
+ /** Per-package resolution status, in contract order. */
73
+ readonly packages: readonly RenderPackageStatus[];
74
+ /** Derived warnings — every `missing` package and every degraded capability. */
75
+ readonly warnings: readonly string[];
76
+ }
77
+ /**
78
+ * Derive the report's warnings from per-package statuses. What each missing
79
+ * package COSTS the page is part of the message — that's the insight a person
80
+ * debugging "my site has no styles" needs, and it differs per package.
81
+ */
82
+ export declare function buildRenderStackWarnings(packages: readonly RenderPackageStatus[]): string[];
@@ -9,6 +9,12 @@ export interface RequestRouterOptions {
9
9
  root?: string;
10
10
  /** Authenticated fetch for remote publisher fetches (auth / testing). */
11
11
  fetchFn?: AuthenticatedFetchFn;
12
+ /**
13
+ * Progress/observability sink, forwarded to every model build — narrates
14
+ * render-stack resolution (where each ambient look package came from, every
15
+ * fetch failure) as it happens. The CLI passes `console.log`.
16
+ */
17
+ log?: (line: string) => void;
12
18
  }
13
19
  /**
14
20
  * The request-driven routing engine: maps a publisher-FIRST path
@@ -5,6 +5,7 @@ import { SubjectKanonak } from '../kanonaks/index.js';
5
5
  import type { LookRenderer } from '../look/index.js';
6
6
  import type { HttpCacheHooks } from '../repositories/index.js';
7
7
  import type { IPackageProducer } from '../producer/index.js';
8
+ import type { RenderStackReport } from './renderStack.js';
8
9
  /** A package version present in the served workspace. */
9
10
  export interface PackageVersion {
10
11
  /** "major.minor.patch" string form. */
@@ -45,6 +46,14 @@ export interface ServerModel {
45
46
  * `EntitlementProducer` here for a gated origin.
46
47
  */
47
48
  readonly producers?: readonly IPackageProducer[];
49
+ /**
50
+ * How the ambient render stack (look-styles, look-tokens, …) resolved when
51
+ * this model was loaded — per-package origin, captured failure reasons, and
52
+ * derived warnings. This is what serve logs at startup and what the
53
+ * `/.well-known/kanonak-render` diagnostics endpoint reports, so a styling
54
+ * failure is explainable instead of a silently bare page.
55
+ */
56
+ readonly renderStack: RenderStackReport;
48
57
  }
49
58
  /** A routed response. `body` is always a string (HTML/CSS/SVG/MD/YAML/JSON). */
50
59
  export interface RouteResponse {
@@ -67,5 +76,12 @@ export interface LoadServerModelOptions {
67
76
  repository?: IKanonakDocumentRepository;
68
77
  /** HTTP write-through cache hook for the default stack (e.g. a disk cache). */
69
78
  httpCache?: HttpCacheHooks;
79
+ /**
80
+ * Progress/observability sink. When provided, model loading narrates what it
81
+ * is doing — workspace scan results, where each render-stack package
82
+ * resolved from, every fetch and every failure — as it happens. The CLI
83
+ * passes `console.log`; embedders can capture or discard.
84
+ */
85
+ log?: (line: string) => void;
70
86
  }
71
87
  export { SubjectKanonak };
@@ -1,4 +1,4 @@
1
- import{b as Y,c as An,d as Sn,e as ce,f as Te,g as O,h as wn,i as X,j as q}from"../chunk-XRXCYM3U.js";import{a as se}from"../chunk-NV63IOB7.js";import"../chunk-QHABFCRC.js";import"../chunk-4NO7MHS7.js";import"../chunk-RYOZTXI7.js";import"../chunk-PEJALHXK.js";import{a as kn,b as bn,c as hn,d as Dn}from"../chunk-SHDHMKMJ.js";import{i as ie}from"../chunk-DSHPAWJQ.js";import{a as ae}from"../chunk-NJ3AZYQD.js";import{b as L,c as A,f as S}from"../chunk-PBNVHBS3.js";import"../chunk-VKTFLHCW.js";import{b as N,c as D,d as K,g as M,h as P,i as F,j as W,l as H}from"../chunk-T3JR2SV6.js";import"../chunk-FUUTGGJS.js";import{g as oe}from"../chunk-2ACBWC7K.js";var $e="kanonak.org",Ue="document-ast",i=e=>({publisher:$e,package_:Ue,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 ue(e,n){return e.publisher===n.publisher&&e.package_===n.package_&&e.name===n.name}var j=class{backendUri="kanonak.org/transformations/markdown-with-frontmatter";render(n,t){let r=xe(n.metadata,t),o=Le(n.children),s=["---",...r,"---","",o].join(`
1
+ import{b as Y,c as An,d as Sn,e as ce,f as Te,g as O,h as wn,i as X,j as q}from"../chunk-OOR5SVNQ.js";import{a as se}from"../chunk-NV63IOB7.js";import"../chunk-QHABFCRC.js";import"../chunk-4NO7MHS7.js";import"../chunk-RYOZTXI7.js";import"../chunk-PEJALHXK.js";import{a as kn,b as bn,c as hn,d as Dn}from"../chunk-SHDHMKMJ.js";import{i as ie}from"../chunk-DSHPAWJQ.js";import{a as ae}from"../chunk-NJ3AZYQD.js";import{b as L,c as A,f as S}from"../chunk-PBNVHBS3.js";import"../chunk-VKTFLHCW.js";import{b as N,c as D,d as K,g as M,h as P,i as F,j as W,l as H}from"../chunk-T3JR2SV6.js";import"../chunk-FUUTGGJS.js";import{g as oe}from"../chunk-2ACBWC7K.js";var $e="kanonak.org",Ue="document-ast",i=e=>({publisher:$e,package_:Ue,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 ue(e,n){return e.publisher===n.publisher&&e.package_===n.package_&&e.name===n.name}var j=class{backendUri="kanonak.org/transformations/markdown-with-frontmatter";render(n,t){let r=xe(n.metadata,t),o=Le(n.children),s=["---",...r,"---","",o].join(`
2
2
  `);return t?.trailingNewline&&(s.endsWith(`
3
3
  `)||(s+=`
4
4
  `)),s}};function xe(e,n){if(!e)return[];let t=new Map;for(let c of e.entries)t.set(I(c.key),c);let r=new Map;if(n?.metadataRenames)for(let[c,u]of n.metadataRenames)r.set(I(c),u);let a=(n?.metadataKeys??e.entries.map(c=>c.key)).map(I),s=[];for(let c of a){let u=t.get(c);if(!u)continue;let f=r.get(c),l=I(f??c),d=me(u.value,u.escapeHint);d!==void 0&&s.push(`${l}: ${d}`)}return s}function I(e){let n=e.lastIndexOf(".");return n===-1?e:e.substring(n+1)||e}function me(e,n){switch(e.kind){case"StringScalar":return Ve(e.stringValue,n);case"IntegerScalar":return String(e.integerValue);case"StructuredList":{let t=[];for(let r of e.items){let o=me(r,n);o!==void 0&&t.push(o)}return t.join(", ")}case"StructuredMap":return;default:return}}function Ve(e,n){return!n||ue(n,m.ESC_RAW)?e:ue(n,m.ESC_YAML_SAFE)?ve(e):e}function ve(e){return e.includes(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kanonak-protocol/sdk",
3
- "version": "4.7.0",
3
+ "version": "4.8.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",
@@ -125,7 +125,7 @@
125
125
  "yaml-parser"
126
126
  ],
127
127
  "dependencies": {
128
- "@kanonak-protocol/types": "^4.7.0",
128
+ "@kanonak-protocol/types": "^4.8.0",
129
129
  "ignore": "^7.0.5",
130
130
  "js-yaml": "^4.1.0",
131
131
  "yaml": "^2.7.0"