@xtrable-ltd/nanoesis 0.1.17 → 0.1.19

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 (26) hide show
  1. package/dist/adapter-azure-blob.js +1 -1
  2. package/dist/{chunk-PKCYTOHW.js → chunk-26VCV3IE.js} +1 -1
  3. package/dist/{chunk-CBLBQP27.js → chunk-WHK3SBV7.js} +41 -2
  4. package/dist/editor-api.js +2 -2
  5. package/dist/index.js +1 -1
  6. package/dist/mcp.js +3 -3
  7. package/editor/assets/{MigrationsPane-i0wjSyoQ.js → MigrationsPane-i_zhrvFj.js} +1 -1
  8. package/editor/assets/{TemplatesPane-DsexK0er.js → TemplatesPane-DnLzysR8.js} +8 -8
  9. package/editor/assets/{cssMode-fc0wHMGr.js → cssMode-CUOhFn4h.js} +1 -1
  10. package/editor/assets/{freemarker2-Dw44kalV.js → freemarker2-B9rQlI0W.js} +1 -1
  11. package/editor/assets/{handlebars-CEMFICxK.js → handlebars-JoS7AGnA.js} +1 -1
  12. package/editor/assets/{html-skzxzrW2.js → html-CjA1yMmY.js} +1 -1
  13. package/editor/assets/{htmlMode-C-4dSBn8.js → htmlMode--Tr5VBAP.js} +1 -1
  14. package/editor/assets/{index-B_gM0Yjd.js → index-CIvw0Zpi.js} +2 -2
  15. package/editor/assets/{javascript-BgHXwKkG.js → javascript-D2uRuhrb.js} +1 -1
  16. package/editor/assets/{jsonMode-Lc8WrRU9.js → jsonMode-DjpB6dsQ.js} +1 -1
  17. package/editor/assets/{liquid-BQolAtSr.js → liquid-B4OzkwvS.js} +1 -1
  18. package/editor/assets/{mdx-CwISUfHN.js → mdx-CqMdTEBH.js} +1 -1
  19. package/editor/assets/{python-DhucvE8q.js → python-D0daul4G.js} +1 -1
  20. package/editor/assets/{razor-C6Qr3L5e.js → razor-DcoRvbTO.js} +1 -1
  21. package/editor/assets/{tsMode-C2Xy3bvH.js → tsMode-c9L2aVZe.js} +1 -1
  22. package/editor/assets/{typescript-D3bsPWHt.js → typescript-CMloI-91.js} +1 -1
  23. package/editor/assets/{xml-Dc0lsYpw.js → xml-Bmh9MaKg.js} +1 -1
  24. package/editor/assets/{yaml-BOMEMGOG.js → yaml-Dc9MTEH8.js} +1 -1
  25. package/editor/index.html +1 -1
  26. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  contentTypeFor
3
- } from "./chunk-CBLBQP27.js";
3
+ } from "./chunk-WHK3SBV7.js";
4
4
 
5
5
  // ../../adapters/azure-blob/src/container.ts
6
6
  var InMemoryBlobContainer = class {
@@ -15,7 +15,7 @@ import {
15
15
  renderReferenceMarkdown,
16
16
  validateSite,
17
17
  workingStoreRoundTripDiagnostic
18
- } from "./chunk-CBLBQP27.js";
18
+ } from "./chunk-WHK3SBV7.js";
19
19
 
20
20
  // ../editor-api/src/scaffold.ts
21
21
  var HOME_HTML = `<!doctype html>
@@ -3032,6 +3032,36 @@ async function listComponentFiles(source) {
3032
3032
  return out.sort();
3033
3033
  }
3034
3034
 
3035
+ // ../engine/src/compile/cache-bust.ts
3036
+ function cacheBustAssets(html, hashFor) {
3037
+ const stamp = (url) => {
3038
+ if (!isStampable(url)) return url;
3039
+ const token = hashFor(url.slice(1));
3040
+ return token === void 0 ? url : `${url}?v=${token}`;
3041
+ };
3042
+ return html.replace(
3043
+ /(\s(?:src|poster)=")([^"]*)"/g,
3044
+ (_m, pre, url) => `${pre}${stamp(url)}"`
3045
+ ).replace(
3046
+ /(<link\b[^>]*?\shref=")([^"]*)"/gi,
3047
+ (_m, pre, url) => `${pre}${stamp(url)}"`
3048
+ ).replace(/(\ssrcset=")([^"]*)"/g, (_m, pre, value) => {
3049
+ const rewritten = value.split(",").map((candidate) => {
3050
+ const trimmed = candidate.trim();
3051
+ if (trimmed === "") return "";
3052
+ const [url, ...descriptor] = trimmed.split(/\s+/);
3053
+ return [stamp(url ?? ""), ...descriptor].join(" ");
3054
+ }).filter((candidate) => candidate !== "").join(", ");
3055
+ return `${pre}${rewritten}"`;
3056
+ }).replace(
3057
+ /url\(\s*(['"]?)([^)'"]*)\1\s*\)/gi,
3058
+ (_m, quote, url) => `url(${quote}${stamp(url)}${quote})`
3059
+ );
3060
+ }
3061
+ function isStampable(url) {
3062
+ return url.startsWith("/") && !url.startsWith("//") && !url.startsWith("/api/") && !url.includes("?") && !url.includes("#");
3063
+ }
3064
+
3035
3065
  // ../engine/src/publish/purge.ts
3036
3066
  var noopPurgeService = {
3037
3067
  async purgeAll() {
@@ -3058,9 +3088,15 @@ async function publishSite(source, sink, options = {}) {
3058
3088
  }
3059
3089
  const artifacts = await compileSite(source, compileOptions);
3060
3090
  const passthrough = await collectPublic(source, publicDir);
3061
- const byPath = /* @__PURE__ */ new Map();
3091
+ const hashByPath = /* @__PURE__ */ new Map();
3062
3092
  for (const artifact of [...artifacts, ...passthrough])
3063
- byPath.set(artifact.path, artifact.contents);
3093
+ hashByPath.set(artifact.path, contentHash(asBytes(artifact.contents)));
3094
+ const hashFor = (path) => hashByPath.get(path);
3095
+ const stamped = artifacts.map(
3096
+ (artifact) => typeof artifact.contents === "string" && artifact.path.endsWith(".html") ? { path: artifact.path, contents: cacheBustAssets(artifact.contents, hashFor) } : artifact
3097
+ );
3098
+ const byPath = /* @__PURE__ */ new Map();
3099
+ for (const artifact of [...stamped, ...passthrough]) byPath.set(artifact.path, artifact.contents);
3064
3100
  await mapWithConcurrency(
3065
3101
  [...byPath],
3066
3102
  writeConcurrency,
@@ -3069,6 +3105,9 @@ async function publishSite(source, sink, options = {}) {
3069
3105
  await purge.purgeAll();
3070
3106
  return { ok: true, validation, written: [...byPath.keys()].sort(), summary };
3071
3107
  }
3108
+ function asBytes(contents) {
3109
+ return typeof contents === "string" ? new TextEncoder().encode(contents) : contents;
3110
+ }
3072
3111
  function summarizeTree(root) {
3073
3112
  let published = 0;
3074
3113
  let drafts = 0;
@@ -18,8 +18,8 @@ import {
18
18
  recreateHomeTemplateRepair,
19
19
  templateSnapshotIntegrityDiagnostic,
20
20
  templateSuffixConflictDiagnostic
21
- } from "./chunk-PKCYTOHW.js";
22
- import "./chunk-CBLBQP27.js";
21
+ } from "./chunk-26VCV3IE.js";
22
+ import "./chunk-WHK3SBV7.js";
23
23
  export {
24
24
  FileBrandingStore,
25
25
  InMemoryBrandingStore,
package/dist/index.js CHANGED
@@ -75,7 +75,7 @@ import {
75
75
  versionNumber,
76
76
  wholeValueToken,
77
77
  workingStoreRoundTripDiagnostic
78
- } from "./chunk-CBLBQP27.js";
78
+ } from "./chunk-WHK3SBV7.js";
79
79
  export {
80
80
  ContentParseError,
81
81
  DEFAULT_DIRS,
package/dist/mcp.js CHANGED
@@ -3,8 +3,8 @@ import {
3
3
  MCP_TOOLS,
4
4
  callMcpTool,
5
5
  readMcpResource
6
- } from "./chunk-PKCYTOHW.js";
7
- import "./chunk-CBLBQP27.js";
6
+ } from "./chunk-26VCV3IE.js";
7
+ import "./chunk-WHK3SBV7.js";
8
8
 
9
9
  // ../../hosts/host-mcp/src/http.ts
10
10
  import { WebStandardStreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/webStandardStreamableHttp.js";
@@ -56,7 +56,7 @@ function createMcpServer(deps, identity) {
56
56
  }
57
57
 
58
58
  // ../../hosts/host-mcp/src/http.ts
59
- var DEFAULT_VERSION = true ? "0.1.17" : "0.0.0-workspace";
59
+ var DEFAULT_VERSION = true ? "0.1.19" : "0.0.0-workspace";
60
60
  async function handleMcpRequest(deps, request, opts) {
61
61
  const server = createMcpServer(deps, {
62
62
  name: opts?.name ?? "nanoesis",
@@ -1,4 +1,4 @@
1
- import{af as Ie,aD as F,ad as Te,a7 as g,T as w,Q as e,f as n,a8 as Qe,o as a,N as H,aE as h,w as O,az as o,O as _,ar as v,p as Ue,G as X,v as Ve,g as He,aK as Xe,ax as c,aF as A,at as Y,au as _e,U as Ye,aq as Ze,a9 as ea}from"./index-B_gM0Yjd.js";var aa=_('<p class="placeholder svelte-1lpfi31">Loading preview…</p>'),ta=_('<p class="error svelte-1lpfi31" role="alert"> </p>'),la=_("<option> </option>"),sa=_('<select class="svelte-1lpfi31"></select>'),ra=_('<li class="orphan svelte-1lpfi31"><div class="orphan-head svelte-1lpfi31"><code class="orphan-name svelte-1lpfi31"> </code> <span class="orphan-value svelte-1lpfi31"> </span></div> <div class="orphan-actions svelte-1lpfi31" role="radiogroup"><label class="svelte-1lpfi31"><input type="radio" value="drop"/> Drop</label> <label class="svelte-1lpfi31"><input type="radio" value="keep"/> Keep (unrendered)</label> <label class="svelte-1lpfi31"><input type="radio" value="rename"/> Rename to</label> <!></div></li>'),ia=_(`<section class="resolutions svelte-1lpfi31" aria-label="Orphan field resolutions"><h3 class="svelte-1lpfi31">Orphan fields</h3> <p class="hint svelte-1lpfi31">These fields exist in this item's JSON but the current template doesn't render them.
1
+ import{af as Ie,aD as F,ad as Te,a7 as g,T as w,Q as e,f as n,a8 as Qe,o as a,N as H,aE as h,w as O,az as o,O as _,ar as v,p as Ue,G as X,v as Ve,g as He,aK as Xe,ax as c,aF as A,at as Y,au as _e,U as Ye,aq as Ze,a9 as ea}from"./index-CIvw0Zpi.js";var aa=_('<p class="placeholder svelte-1lpfi31">Loading preview…</p>'),ta=_('<p class="error svelte-1lpfi31" role="alert"> </p>'),la=_("<option> </option>"),sa=_('<select class="svelte-1lpfi31"></select>'),ra=_('<li class="orphan svelte-1lpfi31"><div class="orphan-head svelte-1lpfi31"><code class="orphan-name svelte-1lpfi31"> </code> <span class="orphan-value svelte-1lpfi31"> </span></div> <div class="orphan-actions svelte-1lpfi31" role="radiogroup"><label class="svelte-1lpfi31"><input type="radio" value="drop"/> Drop</label> <label class="svelte-1lpfi31"><input type="radio" value="keep"/> Keep (unrendered)</label> <label class="svelte-1lpfi31"><input type="radio" value="rename"/> Rename to</label> <!></div></li>'),ia=_(`<section class="resolutions svelte-1lpfi31" aria-label="Orphan field resolutions"><h3 class="svelte-1lpfi31">Orphan fields</h3> <p class="hint svelte-1lpfi31">These fields exist in this item's JSON but the current template doesn't render them.
2
2
  Pick what to do with each.</p> <ul class="orphans svelte-1lpfi31"></ul></section>`),na=_('<p class="error svelte-1lpfi31" role="alert"> </p>'),oa=_('<div class="diff svelte-1lpfi31"><section class="pane svelte-1lpfi31" aria-label="Previous version (left)"><header class="pane-head svelte-1lpfi31"><!></header> <pre class="source svelte-1lpfi31"> </pre></section> <section class="pane svelte-1lpfi31" aria-label="Current template (right)"><header class="pane-head svelte-1lpfi31"> </header> <pre class="source svelte-1lpfi31"> </pre></section></div> <!> <!> <div class="commit-bar svelte-1lpfi31"><button type="button" class="primary svelte-1lpfi31"> </button></div>',1),va=_('<header class="detail-head svelte-1lpfi31"><button type="button" class="back svelte-1lpfi31">← Back</button> <h2 class="svelte-1lpfi31"> </h2></header> <!>',1),pa=_('<p class="error svelte-1lpfi31" role="alert"> </p>'),ca=_('<p class="placeholder svelte-1lpfi31">Loading…</p>'),fa=_(`<div class="empty svelte-1lpfi31"><h3 class="svelte-1lpfi31">All caught up</h3> <p>Every content item's fields match its bound template. Migrations show up here when a
3
3
  destructive template edit (or a manual hand-edit) leaves an item with orphan fields.</p></div>`),da=_('<li class="item"><button class="item-row svelte-1lpfi31" type="button"><span class="item-path svelte-1lpfi31"><code> </code></span> <span class="item-summary svelte-1lpfi31"><!> <!> <!></span> <span class="open-icon svelte-1lpfi31">→</span></button></li>'),ua=_('<section class="group svelte-1lpfi31"><h3 class="group-title svelte-1lpfi31"><code class="svelte-1lpfi31"> </code> <span class="count svelte-1lpfi31"> </span></h3> <ul class="items svelte-1lpfi31"></ul></section>'),ma=_('<header class="list-head svelte-1lpfi31"><h2>Migrations</h2> <button type="button" class="svelte-1lpfi31"> </button></header> <!>',1),_a=_('<div class="migrations svelte-1lpfi31"><!> <!></div>');function ga(Ee,Le){Ie(Le,!0);let j=F(null),d=F(null),Z=F(!1),R=F(null),r=F(Te({})),he=F(Te({})),D=F(!1),J=F(null);g.ensureLoaded();async function Re(s){v(j,s,!0),v(r,{},!0),v(he,{},!0),v(d,null),v(R,null),v(Z,!0);try{v(d,await ea(s),!0);const f={};for(const l of e(d).orphans){const u=Se(l.name,e(d).currentTemplateFields);f[l.name]=u?{rename:u}:"keep"}v(r,f,!0)}catch(f){v(R,f instanceof Error?f.message:String(f),!0)}finally{v(Z,!1)}}function ge(){v(j,null),v(d,null),v(R,null)}function Se(s,f){const l=s.toLowerCase();for(const u of f)if(u.toLowerCase().startsWith(l)||u.toLowerCase().endsWith(l))return u;return null}async function Ce(){if(!(e(j)===null||e(d)===null)){v(D,!0),v(J,null);try{const s={drop:Object.entries(e(r)).filter(([,l])=>l==="drop").map(([l])=>l),keep:Object.entries(e(r)).filter(([,l])=>l==="keep").map(([l])=>l),rename:Object.fromEntries(Object.entries(e(r)).filter(([,l])=>typeof l=="object"&&l!==null&&"rename"in l).map(([l,u])=>[l,u.rename])),fill:{...e(he)}},f=await He(e(j),s);g.refresh().catch(()=>{}),ge()}catch(s){v(J,s instanceof Error?s.message:String(s),!0)}finally{v(D,!1)}}}function Pe(s){return typeof s=="string"?s:JSON.stringify(s)}const qe=Xe(()=>g.list===null?[]:Object.entries(g.list.byTemplate).map(([s,f])=>({template:s,items:[...f].sort((l,u)=>l.path.localeCompare(u.path))})));var be=_a(),xe=a(be);{var Be=s=>{var f=va(),l=H(f),u=a(l),ee=o(u,2),ae=a(ee),te=o(l,2);{var le=i=>{var m=aa();n(i,m)},se=i=>{var m=ta(),k=a(m);h(()=>c(k,e(R))),n(i,m)},re=i=>{var m=oa(),k=H(m),E=a(k),M=a(E),K=a(M);{var W=p=>{var x=A();h(()=>c(x,`Before — ${e(d).left.template??""}`)),n(p,x)},$=p=>{var x=A("Before — no snapshot available");n(p,x)};w(K,p=>{e(d).left?p(W):p($,-1)})}var ie=o(M,2),ne=a(ie),oe=o(E,2),z=a(oe),S=a(z),b=o(z,2),G=a(b),C=o(k,2);{var I=p=>{var x=ia(),P=o(a(x),4);X(P,21,()=>e(d).orphans,q=>q.name,(q,t)=>{var y=ra(),U=a(y),ye=a(U),Je=a(ye),Ke=o(ye,2),We=a(Ke),we=o(U,2),ke=a(we),fe=a(ke),Fe=o(ke,2),de=a(Fe),Oe=o(Fe,2),ue=a(Oe),$e=o(Oe,2);{var ze=B=>{var T=sa();X(T,20,()=>e(d).currentTemplateFields,N=>N,(N,me)=>{var V=la(),Ge=a(V),Me={};h(()=>{c(Ge,me),Me!==(Me=me)&&(V.value=(V.__value=me)??"")}),n(N,V)});var je;Ye(T),h(()=>{je!==(je=e(r)[e(t).name].rename)&&(T.value=(T.__value=e(r)[e(t).name].rename)??"",Ze(T,e(r)[e(t).name].rename))}),O("change",T,N=>v(r,{...e(r),[e(t).name]:{rename:N.currentTarget.value}},!0)),n(B,T)};w($e,B=>{typeof e(r)[e(t).name]=="object"&&e(r)[e(t).name]!==null&&"rename"in e(r)[e(t).name]&&B(ze)})}h(B=>{c(Je,e(t).name),c(We,B),Y(we,"aria-label",`Resolution for ${e(t).name}`),Y(fe,"name",`d-${e(t).name}`),_e(fe,e(r)[e(t).name]==="drop"),Y(de,"name",`d-${e(t).name}`),_e(de,e(r)[e(t).name]==="keep"),Y(ue,"name",`d-${e(t).name}`),_e(ue,typeof e(r)[e(t).name]=="object"&&e(r)[e(t).name]!==null&&"rename"in e(r)[e(t).name])},[()=>Pe(e(t).value)]),O("change",fe,()=>v(r,{...e(r),[e(t).name]:"drop"},!0)),O("change",de,()=>v(r,{...e(r),[e(t).name]:"keep"},!0)),O("change",ue,()=>v(r,{...e(r),[e(t).name]:{rename:e(d).currentTemplateFields[0]??""}},!0)),n(q,y)}),n(p,x)};w(C,p=>{e(d).orphans.length>0&&p(I)})}var Q=o(C,2);{var ve=p=>{var x=na(),P=a(x);h(()=>c(P,e(J))),n(p,x)};w(Q,p=>{e(J)&&p(ve)})}var pe=o(Q,2),L=a(pe),ce=a(L);h(()=>{var p;c(ne,((p=e(d).left)==null?void 0:p.html)??"(no snapshot covers this item)"),c(S,`After — ${e(d).right.template??""}`),c(G,e(d).right.html),L.disabled=e(D)||e(d).orphans.length===0,c(ce,e(D)?"Migrating…":"Migrate item")}),O("click",L,Ce),n(i,m)};w(te,i=>{e(Z)?i(le):e(R)?i(se,1):e(d)&&i(re,2)})}h(()=>c(ae,e(j))),O("click",u,ge),n(s,f)},Ne=s=>{var f=ma(),l=H(f),u=o(a(l),2),ee=a(u),ae=o(l,2);{var te=i=>{var m=pa(),k=a(m);h(()=>c(k,g.error)),n(i,m)},le=i=>{var m=ca();n(i,m)},se=i=>{var m=fa();n(i,m)},re=i=>{var m=Ue(),k=H(m);X(k,17,()=>e(qe),E=>E.template,(E,M)=>{var K=ua(),W=a(K),$=a(W),ie=a($),ne=o($,2),oe=a(ne),z=o(W,2);X(z,21,()=>e(M).items,S=>S.path,(S,b)=>{var G=da(),C=a(G),I=a(C),Q=a(I),ve=a(Q),pe=o(I,2),L=a(pe);{var ce=t=>{var y=A();h(U=>c(y,`${e(b).orphanFields.length??""} orphan field${e(b).orphanFields.length===1?"":"s"}:
4
4
  ${U??""}`),[()=>e(b).orphanFields.join(", ")]),n(t,y)};w(L,t=>{e(b).orphanFields.length>0&&t(ce)})}var p=o(L,2);{var x=t=>{var y=A();h(()=>c(y,`· ${e(b).missingRequiredFields.length??""} missing required`)),n(t,y)};w(p,t=>{e(b).missingRequiredFields.length>0&&t(x)})}var P=o(p,2);{var q=t=>{var y=A();h(()=>c(y,`· best-fit: ${e(b).bestFitSnapshot??""}`)),n(t,y)};w(P,t=>{e(b).bestFitSnapshot&&t(q)})}h(()=>c(ve,e(b).path)),O("click",C,()=>Re(e(b).path)),n(S,G)}),h(()=>{c(ie,e(M).template),c(oe,`${e(M).items.length??""} item${e(M).items.length===1?"":"s"}`)}),n(E,K)}),n(i,m)};w(ae,i=>{g.error?i(te):g.loading&&g.list===null?i(le,1):g.count===0?i(se,2):i(re,-1)})}h(()=>{u.disabled=g.loading,c(ee,g.loading?"Refreshing…":"Refresh")}),O("click",u,()=>g.refresh()),n(s,f)};w(xe,s=>{e(j)!==null?s(Be):s(Ne,-1)})}var Ae=o(xe,2);{var De=s=>{};w(Ae,s=>{!e(j)&&g.list===null&&s(De)})}n(Ee,be),Qe()}Ve(["click","change"]);export{ga as default};