@xtrable-ltd/nanoesis 0.1.12 → 0.1.14

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 (29) hide show
  1. package/dist/adapter-azure-blob.js +1 -1
  2. package/dist/{chunk-XO3CT6GL.js → chunk-CBLBQP27.js} +275 -220
  3. package/dist/{chunk-EN5SMEWJ.js → chunk-PKCYTOHW.js} +6 -6
  4. package/dist/editor-api.js +2 -2
  5. package/dist/index.d.ts +50 -12
  6. package/dist/index.js +1 -1
  7. package/dist/mcp.js +3 -3
  8. package/editor/assets/MigrationsPane-DSiYzhDN.js +4 -0
  9. package/editor/assets/{TemplatesPane-B5hn_v0Z.js → TemplatesPane-DacDItlh.js} +172 -168
  10. package/editor/assets/{cssMode-BbIf5k6I.js → cssMode-CiAvvnrb.js} +1 -1
  11. package/editor/assets/{freemarker2-DoW0pSYV.js → freemarker2-C7G3JwfA.js} +1 -1
  12. package/editor/assets/{handlebars-DLlET-qc.js → handlebars-DsJPq-J8.js} +1 -1
  13. package/editor/assets/{html-4khbqrhe.js → html-i_wgtIMk.js} +1 -1
  14. package/editor/assets/{htmlMode-DblHkZ-k.js → htmlMode-Bx_dmHBj.js} +1 -1
  15. package/editor/assets/index-CLUiygGJ.js +138 -0
  16. package/editor/assets/{javascript-CgPO2Hmj.js → javascript-C3n1eUNo.js} +1 -1
  17. package/editor/assets/{jsonMode-BrWh2436.js → jsonMode-BpC5c5px.js} +1 -1
  18. package/editor/assets/{liquid-BsQJXwPT.js → liquid-B3_Yp2NE.js} +1 -1
  19. package/editor/assets/{mdx-AO8t67gx.js → mdx-nOh_vCzd.js} +1 -1
  20. package/editor/assets/{python-3w4sZj5c.js → python-BZXwPif_.js} +1 -1
  21. package/editor/assets/{razor-BFsvo06w.js → razor-BYwO2G_q.js} +1 -1
  22. package/editor/assets/{tsMode-QrC4ERjp.js → tsMode-CmNOLqvJ.js} +1 -1
  23. package/editor/assets/{typescript-BXJ3QLad.js → typescript-C9KU4rft.js} +1 -1
  24. package/editor/assets/{xml-CxKYn1FP.js → xml-CFRBv758.js} +1 -1
  25. package/editor/assets/{yaml-BmWLvF7Q.js → yaml-Co0yIk6T.js} +1 -1
  26. package/editor/index.html +1 -1
  27. package/package.json +1 -1
  28. package/editor/assets/MigrationsPane-BYGqWBAA.js +0 -4
  29. package/editor/assets/index-Do1drqEQ.js +0 -138
package/dist/index.d.ts CHANGED
@@ -18,6 +18,38 @@ declare function humanize(name: string): string;
18
18
  /** Best-effort content type from a path's extension; defaults to octet-stream. */
19
19
  declare function contentTypeFor(path: string): string;
20
20
 
21
+ /** Thrown when raw content JSON cannot be coerced into a {@link ContentItem}. */
22
+ declare class ContentParseError extends Error {
23
+ constructor(message: string);
24
+ }
25
+ /**
26
+ * Parse-time diagnostics that survive into the validation gate. Distinct from
27
+ * {@link ContentParseError} (which signals a *malformed* file) — diagnostics describe
28
+ * a successfully parsed item that nonetheless carried something the parser dropped.
29
+ */
30
+ interface ContentParseDiagnostics {
31
+ /**
32
+ * Top-level keys present in the JSON but not recognised by the parser. Sorted for
33
+ * deterministic message ordering. Empty when the file is clean. Typical cause: an
34
+ * author (especially an LLM) wrote a content field (`body`, `tagline`, ...) at the
35
+ * top level instead of nesting it under `fields`, or typo'd a system key
36
+ * (`IsPublished` instead of `isPublished`).
37
+ */
38
+ readonly unknownTopLevelKeys: readonly string[];
39
+ }
40
+ /**
41
+ * Validate untrusted content JSON into a typed {@link ContentItem}, the single
42
+ * boundary where content data is checked (CLAUDE.md §4). Tolerant of drift
43
+ * (unknown keys ignored, missing isPublished/fields defaulted; DESIGN §5.4) but
44
+ * strict on the system keys that carry meaning.
45
+ *
46
+ * The thin wrapper around {@link parseContentItemWithDiagnostics} for the call
47
+ * sites that don't need to know what the parser dropped (the editor, tests, …).
48
+ * The validation gate uses the diagnostics-returning variant so it can warn about
49
+ * silent drops (e.g. `body` written at the top level instead of under `fields`).
50
+ */
51
+ declare function parseContentItem(raw: unknown): ContentItem;
52
+
21
53
  /**
22
54
  * The content model (DESIGN §5). Content JSON is *pure data*: a value's type
23
55
  * comes from the template, never from the file, so these types model only the
@@ -75,6 +107,14 @@ interface ItemNode {
75
107
  /** Content path from the root, e.g. "blog/going-static". */
76
108
  readonly path: string;
77
109
  readonly item: ContentItem;
110
+ /**
111
+ * What the parser dropped while reading this item (DESIGN §5.4 tolerance). Optional
112
+ * because not every ItemNode goes through the diagnostics-returning parser (compile
113
+ * tests construct nodes directly). The validation gate uses this to surface
114
+ * `content.unknown-top-level-key` warnings rather than letting `body`-outside-`fields`
115
+ * silently ship an empty page.
116
+ */
117
+ readonly parseDiagnostics?: ContentParseDiagnostics;
78
118
  }
79
119
  /** A directory in the tree; the file/folder layout *is* the site structure. */
80
120
  interface DirNode {
@@ -92,18 +132,6 @@ interface DirNode {
92
132
  }
93
133
  type TreeNode = DirNode | ItemNode;
94
134
 
95
- /** Thrown when raw content JSON cannot be coerced into a {@link ContentItem}. */
96
- declare class ContentParseError extends Error {
97
- constructor(message: string);
98
- }
99
- /**
100
- * Validate untrusted content JSON into a typed {@link ContentItem}, the single
101
- * boundary where content data is checked (CLAUDE.md §4). Tolerant of drift
102
- * (unknown keys ignored, missing isPublished/fields defaulted; DESIGN §5.4) but
103
- * strict on the system keys that carry meaning.
104
- */
105
- declare function parseContentItem(raw: unknown): ContentItem;
106
-
107
135
  /**
108
136
  * Parse a directory's sort file (DESIGN §5.2). Deliberately tolerant: a stale or
109
137
  * malformed sort file never blocks a publish, it just falls back to defaults.
@@ -653,6 +681,16 @@ interface WriteResult {
653
681
  * stamp banner.
654
682
  */
655
683
  readonly schemaDelta?: SchemaDelta;
684
+ /**
685
+ * Parse diagnostics for content writes (smoke test 2026-05-29 silent-drop fix).
686
+ * Present only for `content/*.json` writes whose JSON parsed successfully but
687
+ * carried top-level keys the parser dropped (e.g. `body` written outside
688
+ * `fields`). Undefined when the write is not a content item, parsing threw, or
689
+ * everything was recognised. MCP `write_file` surfaces this immediately so an
690
+ * LLM author sees the silent-drop the moment it happens rather than discovering
691
+ * empty rendered pages later.
692
+ */
693
+ readonly parseDiagnostics?: ContentParseDiagnostics;
656
694
  }
657
695
  /**
658
696
  * The editor's working store (DESIGN §11c): a read {@link ContentSource} for
package/dist/index.js CHANGED
@@ -75,7 +75,7 @@ import {
75
75
  versionNumber,
76
76
  wholeValueToken,
77
77
  workingStoreRoundTripDiagnostic
78
- } from "./chunk-XO3CT6GL.js";
78
+ } from "./chunk-CBLBQP27.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-EN5SMEWJ.js";
7
- import "./chunk-XO3CT6GL.js";
6
+ } from "./chunk-PKCYTOHW.js";
7
+ import "./chunk-CBLBQP27.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.12" : "0.0.0-workspace";
59
+ var DEFAULT_VERSION = true ? "0.1.14" : "0.0.0-workspace";
60
60
  async function handleMcpRequest(deps, request, opts) {
61
61
  const server = createMcpServer(deps, {
62
62
  name: opts?.name ?? "nanoesis",
@@ -0,0 +1,4 @@
1
+ import{ae as Qe,aB as F,ac as Te,a6 as g,T as w,Q as e,f as n,a7 as Ue,o as a,N as H,aC as h,w as O,ax as o,O as _,ap as v,p as Ve,G as X,v as ze,g as He,aI as Xe,av as c,aD as A,ar as Y,as as _e,U as Ye,ao as Ze,a8 as ea}from"./index-CLUiygGJ.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
+ 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
+ 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(Le,Re){Qe(Re,!0);let j=F(null),d=F(null),Z=F(!1),C=F(null),r=F(Te({})),he=F(Te({})),D=F(!1),I=F(null);g.ensureLoaded();async function Ce(s){v(j,s,!0),v(r,{},!0),v(he,{},!0),v(d,null),v(C,null),v(Z,!0);try{v(d,await ea(s),!0);const f={};for(const l of e(d).orphans){const u=Ee(l.name,e(d).currentTemplateFields);f[l.name]=u?{rename:u}:"keep"}v(r,f,!0)}catch(f){v(C,f instanceof Error?f.message:String(f),!0)}finally{v(Z,!1)}}function ge(){v(j,null),v(d,null),v(C,null)}function Ee(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 Se(){if(!(e(j)===null||e(d)===null)){v(D,!0),v(I,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(I,s instanceof Error?s.message:String(s),!0)}finally{v(D,!1)}}}function Pe(s){return typeof s=="string"?s:JSON.stringify(s)}const Be=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 qe=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(C))),n(i,m)},re=i=>{var m=oa(),k=H(m),L=a(k),M=a(L),J=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(J,p=>{e(d).left?p(W):p($,-1)})}var ie=o(M,2),ne=a(ie),oe=o(L,2),G=a(oe),E=a(G),b=o(G,2),K=a(b),S=o(k,2);{var Q=p=>{var x=ia(),P=o(a(x),4);X(P,21,()=>e(d).orphans,B=>B.name,(B,t)=>{var y=ra(),V=a(y),ye=a(V),Ie=a(ye),Je=o(ye,2),We=a(Je),we=o(V,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 Ge=q=>{var T=sa();X(T,20,()=>e(d).currentTemplateFields,N=>N,(N,me)=>{var z=la(),Ke=a(z),Me={};h(()=>{c(Ke,me),Me!==(Me=me)&&(z.value=(z.__value=me)??"")}),n(N,z)});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(q,T)};w($e,q=>{typeof e(r)[e(t).name]=="object"&&e(r)[e(t).name]!==null&&"rename"in e(r)[e(t).name]&&q(Ge)})}h(q=>{c(Ie,e(t).name),c(We,q),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(B,y)}),n(p,x)};w(S,p=>{e(d).orphans.length>0&&p(Q)})}var U=o(S,2);{var ve=p=>{var x=na(),P=a(x);h(()=>c(P,e(I))),n(p,x)};w(U,p=>{e(I)&&p(ve)})}var pe=o(U,2),R=a(pe),ce=a(R);h(()=>{var p;c(ne,((p=e(d).left)==null?void 0:p.html)??"(no snapshot covers this item)"),c(E,`After — ${e(d).right.template??""}`),c(K,e(d).right.html),R.disabled=e(D)||e(d).orphans.length===0,c(ce,e(D)?"Migrating…":"Migrate item")}),O("click",R,Se),n(i,m)};w(te,i=>{e(Z)?i(le):e(C)?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=Ve(),k=H(m);X(k,17,()=>e(Be),L=>L.template,(L,M)=>{var J=ua(),W=a(J),$=a(W),ie=a($),ne=o($,2),oe=a(ne),G=o(W,2);X(G,21,()=>e(M).items,E=>E.path,(E,b)=>{var K=da(),S=a(K),Q=a(S),U=a(Q),ve=a(U),pe=o(Q,2),R=a(pe);{var ce=t=>{var y=A();h(V=>c(y,`${e(b).orphanFields.length??""} orphan field${e(b).orphanFields.length===1?"":"s"}:
4
+ ${V??""}`),[()=>e(b).orphanFields.join(", ")]),n(t,y)};w(R,t=>{e(b).orphanFields.length>0&&t(ce)})}var p=o(R,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 B=t=>{var y=A();h(()=>c(y,`· best-fit: ${e(b).bestFitSnapshot??""}`)),n(t,y)};w(P,t=>{e(b).bestFitSnapshot&&t(B)})}h(()=>c(ve,e(b).path)),O("click",S,()=>Ce(e(b).path)),n(E,K)}),h(()=>{c(ie,e(M).template),c(oe,`${e(M).items.length??""} item${e(M).items.length===1?"":"s"}`)}),n(L,J)}),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(qe):s(Ne,-1)})}var Ae=o(xe,2);{var De=s=>{};w(Ae,s=>{!e(j)&&g.list===null&&s(De)})}n(Le,be),Ue()}ze(["click","change"]);export{ga as default};