shadow-claw 1.59.4 → 1.59.5

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,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://modelcontextprotocol.io/schemas/server-card/v1.json",
3
3
  "name": "shadow-claw",
4
- "version": "1.59.4",
4
+ "version": "1.59.5",
5
5
  "description": "Multi-runtime AI assistant with local and remote LLM orchestration, Web Workers, OPFS storage, and agentic tool execution.",
6
6
  "title": "ShadowClaw MCP Server",
7
7
  "websiteUrl": "https://xt-ml.github.io/shadow-claw/",
@@ -13,27 +13,19 @@
13
13
  {
14
14
  "src": "https://xt-ml.github.io/shadow-claw/assets/icons/favicon.svg",
15
15
  "mimeType": "image/svg+xml",
16
- "sizes": [
17
- "any"
18
- ]
16
+ "sizes": ["any"]
19
17
  },
20
18
  {
21
19
  "src": "https://xt-ml.github.io/shadow-claw/assets/icons/512.png",
22
20
  "mimeType": "image/png",
23
- "sizes": [
24
- "512x512"
25
- ]
21
+ "sizes": ["512x512"]
26
22
  }
27
23
  ],
28
24
  "remotes": [
29
25
  {
30
26
  "type": "streamable-http",
31
27
  "url": "http://localhost:8888/mcp",
32
- "supportedProtocolVersions": [
33
- "2026-07-28",
34
- "2025-11-25",
35
- "2024-11-05"
36
- ],
28
+ "supportedProtocolVersions": ["2026-07-28", "2025-11-25", "2024-11-05"],
37
29
  "headers": [
38
30
  {
39
31
  "name": "MCP-Protocol-Version",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://modelcontextprotocol.io/schemas/server-card/v1.json",
3
3
  "name": "shadow-claw",
4
- "version": "1.59.4",
4
+ "version": "1.59.5",
5
5
  "description": "Multi-runtime AI assistant with local and remote LLM orchestration, Web Workers, OPFS storage, and agentic tool execution.",
6
6
  "title": "ShadowClaw MCP Server",
7
7
  "websiteUrl": "https://xt-ml.github.io/shadow-claw/",
@@ -13,27 +13,19 @@
13
13
  {
14
14
  "src": "https://xt-ml.github.io/shadow-claw/assets/icons/favicon.svg",
15
15
  "mimeType": "image/svg+xml",
16
- "sizes": [
17
- "any"
18
- ]
16
+ "sizes": ["any"]
19
17
  },
20
18
  {
21
19
  "src": "https://xt-ml.github.io/shadow-claw/assets/icons/512.png",
22
20
  "mimeType": "image/png",
23
- "sizes": [
24
- "512x512"
25
- ]
21
+ "sizes": ["512x512"]
26
22
  }
27
23
  ],
28
24
  "remotes": [
29
25
  {
30
26
  "type": "streamable-http",
31
27
  "url": "http://localhost:8888/mcp",
32
- "supportedProtocolVersions": [
33
- "2026-07-28",
34
- "2025-11-25",
35
- "2024-11-05"
36
- ],
28
+ "supportedProtocolVersions": ["2026-07-28", "2025-11-25", "2024-11-05"],
37
29
  "headers": [
38
30
  {
39
31
  "name": "MCP-Protocol-Version",
@@ -1 +1 @@
1
- export{t as runBuild}from"../chunk-s1uNIOTZ.js";
1
+ export{t as runBuild}from"../chunk-CBpOntTm.js";
@@ -220,5 +220,5 @@ ${o}
220
220
  `);e=ic(e,t)}if(!e.includes(`data-shadow-claw-dedent="true"`)){let t=[` <!-- Dedent embedded markdown scripts if indented by formatters (e.g. Prettier) -->`,` <script data-shadow-claw-dedent="true">`,` for (const el of document.querySelectorAll('script[type="text/markdown"][data-shadow-claw-page]')) {`,` const text = el.textContent || '';`,` const m = text.match(/^\\r?\\n([ \\t]+)/);`,` if (m) {`,` const indent = m[1].length;`," const regex = new RegExp(`^[ \\\\t]{1,${indent}}`, 'gm');",` el.textContent = text.replace(/^\\r?\\n/, '').replace(regex, '').replace(/\\r?\\n[ \\t]*$/, '\\n');`,` }`,` }`,` <\/script>`].join(`
221
221
  `);e=ic(e,t)}if(!e.includes(`data-shadow-claw-opfs-cleanup="true"`)){let t=[` <!-- Self-heal stale pre-seeded OPFS files with leading whitespace before frontmatter -->`,` <script data-shadow-claw-opfs-cleanup="true">`,` (async () => {`,` try {`,` if (!navigator.storage?.getDirectory) return;`,` const root = await navigator.storage.getDirectory();`,` const scDir = await root.getDirectoryHandle("shadowclaw", { create: false }).catch(() => null);`,` if (!scDir) return;`,` const groupsDir = await scDir.getDirectoryHandle("groups", { create: false }).catch(() => null);`,` if (!groupsDir) return;`,` for await (const [, grp] of groupsDir.entries()) {`,` if (grp.kind !== "directory") continue;`,` async function cleanDir(dir) {`,` for await (const [name, handle] of dir.entries()) {`,` if (handle.kind === "directory") {`,` await cleanDir(handle);`,` } else if (handle.kind === "file") {`,` try {`,` const file = await handle.getFile();`,` const text = await file.text();`,` if (/^(?:\\r?\\n)+[ \\t]*---/.test(text) || /^[ \\t]+---/.test(text)) {`,` await dir.removeEntry(name);`,` }`,` } catch {}`,` }`,` }`,` }`,` await cleanDir(grp);`,` }`,` } catch {}`,` })();`,` <\/script>`].join(`
222
222
  `);e=ic(e,t)}await z(t,e,`utf8`)}}async function du(e={}){let t=B.env.NODE_ENV;try{let t=e.quiet??(B.env.NODE_ENV===`test`&&!B.env.VERBOSE),n=e.stdio??(B.env.NODE_ENV===`test`&&!B.env.VERBOSE?`pipe`:`inherit`),r=(...e)=>{t||console.log(...e)},i=S(e.contentRoot||D.SHADOWCLAW_CONTENT_ROOT||B.cwd()),a=S(e.toolchainRoot||cu),o=i===a,{isProduction:s,copyAllAssets:c,prerenderPages:l,prerenderMainMemory:u}=eo({...D,...e.isProduction===void 0?{}:{NODE_ENV:e.isProduction?`production`:`development`},...e.copyAllAssets===void 0?{}:{COPY_ALL_ASSETS:String(e.copyAllAssets)},...e.prerenderPages===void 0?{}:{PRERENDER_PAGES:String(e.prerenderPages)},...e.prerenderMainMemory===void 0?{}:{PRERENDER_MAIN_MEMORY:String(e.prerenderMainMemory)}});s?B.env.NODE_ENV=`production`:e.isProduction===!1&&(B.env.NODE_ENV=`development`);async function d(e,r={}){!t&&!r.quiet&&console.log(`> ${e}`);let i=r.stdio??n,a={...B.env,...s?{NODE_ENV:`production`}:{},...r.env||{}};ee(e,{stdio:i,...r,env:a})}if(o){if(E(cu),await qa(`dist/public`),await M(`dist/public/assets`,{recursive:!0}),c)await A(`assets`,`dist/public`,{recursive:!0});else{await A(`assets/icons`,`dist/public/assets/icons`,{recursive:!0}),await A(`assets/screenshots`,`dist/public/assets/screenshots`,{recursive:!0});try{await A(`assets/fonts`,`dist/public/assets/fonts`,{recursive:!0})}catch{}}await Ja([`pages/resources`,`pages/deps`,`resources`,`deps`,`pages/assets`,`pages/main/assets`],`dist/public`);for(let e of Za())await Ya(e.sources,e.dest,e.opts||{});try{await A(`e2e/README.md`,`dist/public/e2e/README.md`)}catch{}try{await A(`pages`,`dist/public/pages`,{recursive:!0})}catch{}try{await A(`pages/main`,`dist/public/files/main`,{recursive:!0})}catch{}let n;try{let{isTestFileOrDir:e}=await import(`./chunk-zkXQUEv6.js`);n=t=>!e(_(t),t)}catch{}try{await A(`pages/main`,`dist/public/static-main`,{recursive:!0})}catch{}try{let{migrateLegacyWorkspaceLayout:e}=await import(`./chunk-CeuR-KKG.js`);await e(B.cwd())}catch{}try{await A(`.agents/skills`,`dist/public/.agents/skills`,{recursive:!0,...n?{filter:n}:{}})}catch{}try{await A(`.agents/tools`,`dist/public/.agents/tools`,{recursive:!0,...n?{filter:n}:{}})}catch{}try{await A(`.agents/scripts`,`dist/public/.agents/scripts`,{recursive:!0,...n?{filter:n}:{}})}catch{}if(await $(`.agents/skills`))try{let{generateSkillsIndex:e}=await import(`./chunk-zkXQUEv6.js`);await e(cu)}catch(e){console.warn(`Notice: Failed to auto-generate agent-skills index:`,e)}if(await $(`.well-known`))try{await A(`.well-known`,`dist/public/.well-known`,{recursive:!0,force:!0})}catch{}await d(`npm run -s rolldown`);let o=await Xa($a()),f=o||`pages/site-config.json`,p;if(o)try{p=JSON.parse(await N(o,`utf8`))}catch{}let m=e.pagesOrigin||D.PAGES_ORIGIN,h=s?Fl({basePath:e.basePath||D.PAGES_BASE_PATH,pagesOrigin:m,siteUrl:p?.branding?.siteUrl,defaultBasePath:`/shadow-claw/`}):e.basePath||D.PAGES_BASE_PATH||`/`;u?await Yc({indexPath:`dist/public/index.html`,sourcePath:`pages/main`,prerenderPages:l,siteConfigPath:f,isProduction:s,singleFile:e.singleFile}):await Yc({indexPath:`dist/public/index.html`,noSeed:!0,siteConfigPath:f,isProduction:s,singleFile:e.singleFile});try{await Zl(`dist/public`,f,{basePath:h,pagesOrigin:m,isProduction:s})}catch{}try{let e=JSON.parse(await N(`package.json`,`utf8`));if(e.version){let t=`dist/public/index.html`,n=await N(t,`utf8`);await z(t,n.replace(/<meta\s+name="version"[^>]*>/,`<meta name="version" content="${e.version}" />`),`utf8`);for(let t of[`.well-known/mcp.json`,`.well-known/mcp/server-card.json`]){let n=y(`dist/public`,t);if(await $(n))try{let t=JSON.parse(await N(n,`utf8`));t.version!==e.version&&(t.version=e.version,await z(n,JSON.stringify(t,null,2)+`
223
- `,`utf8`))}catch{}}}}catch{}try{let e=`dist/public/index.html`,t=await N(e,`utf8`);await z(e,Il(t,h),`utf8`);let n=`dist/public/share/share-target.html`;if(await $(n)){let e=await N(n,`utf8`);await z(n,Il(e,h),`utf8`)}}catch{}if(s){if(r(`Running production post-build steps...`),r(` PAGES_ORIGIN : ${m||`(relative ./)`}`),r(` PAGES_BASE_PATH: ${h}`),m)try{let e=`dist/public/manifest.json`,t=await N(e,`utf8`),n=JSON.parse(t);n.start_url&&(n.start_url=m,await z(e,JSON.stringify(n,null,2),`utf8`))}catch{}await su(`dist/public`);let e=``;try{e=ee(`npm run -s build:pkg:get:meta`,{encoding:`utf8`,stdio:[`ignore`,`pipe`,`ignore`]}).trim()}catch{}e&&await d(`npm run -s build:pkg:meta "${e}"`)}await eu({publicDir:`dist/public`,routesPath:await Xa(Qa())||`pages/routes.json`,sourcePath:`pages/main`,prerenderPages:l,siteConfigPath:f,basePath:h,pagesOrigin:m,isProduction:s,singleFile:e.singleFile}),await d(`npm run -s build:service-worker`);let g=`dist/public/service-worker.js`;if(await $(g)&&await au(g,{logImpl:()=>{}}),s)try{let{precompressAssets:e}=await import(`./chunk-C7i38c2x.js`),n=await e(`dist/public`,{silent:t});!t&&n.count>0&&r(`Pre-compressed ${n.count} assets (.br and .gz).`)}catch(e){t||console.warn(`Notice: Asset pre-compression encountered an issue:`,e)}e.singleFile&&await uu({indexPath:`dist/public/index.html`,mainSourcePath:`pages/main`,contentRoot:i,toolchainRoot:a,cdnBase:e.cdn,isQuiet:t,log:r}),r(`Build completed successfully.`);return}let f=e.outDir||`dist/public`,p=S(i,f);await qa(p),await M(p,{recursive:!0}),await M(y(p,`assets`),{recursive:!0});let m=y(a,`dist/public`);await $(y(m,`index.js`))||(r(`Building ShadowClaw core toolchain...`),await qa(y(a,`dist/public`)),await qa(y(a,`dist-electron`)),await d(`npm run -s rolldown`,{cwd:a})),await A(m,p,{recursive:!0,filter:e=>{if(e.includes(`/assets/cache/`)||e.includes(`\\assets\\cache\\`)||e.includes(`/.cache/`)||e.includes(`\\.cache\\`)||e.includes(`/cache/`)||e.includes(`\\cache\\`)||e.endsWith(`/cache`)||e.endsWith(`\\cache`))return!1;if(i!==a){let t=x(m,e).replace(/\\/g,`/`);if(t===`docs`||t.startsWith(`docs/`)||t===`main`||t.startsWith(`main/`)||t===`main.html`||t.startsWith(`main.html.`)||t===`static-main`||t.startsWith(`static-main/`)||t===`static-main-manifest.json`||t.startsWith(`static-main-manifest.json.`)||t===`static-routing.json`||t.startsWith(`static-routing.json.`)||t===`files`||t.startsWith(`files/`)||t===`pages`||t.startsWith(`pages/`)||t===`sitemap.xml`||t.startsWith(`sitemap.xml.`)||t===`sitemap.txt`||t.startsWith(`sitemap.txt.`)||t===`llms.txt`||t.startsWith(`llms.txt.`)||t===`README.md`||t.startsWith(`README.md.`)||t===`AGENTS.md`||t.startsWith(`AGENTS.md.`))return!1}return!0}}),i!==a&&(await qa(y(p,`sitemap.xml`)),await qa(y(p,`sitemap.txt`)));let h=y(i,`assets`);await $(h)&&(c?await A(h,p,{recursive:!0,force:!0}):(await $(y(h,`icons`))&&await A(y(h,`icons`),y(p,`assets/icons`),{recursive:!0,force:!0}),await $(y(h,`screenshots`))&&await A(y(h,`screenshots`),y(p,`assets/screenshots`),{recursive:!0,force:!0}),await $(y(h,`fonts`))&&await A(y(h,`fonts`),y(p,`assets/fonts`),{recursive:!0,force:!0}))),await Ja([`pages/resources`,`pages/deps`,`resources`,`deps`,`pages/assets`,`pages/main/assets`],p,{baseDir:i});let g=Za({contentRoot:i,toolchainRoot:a,distPublicDir:p});for(let e of g)await Ya(e.sources,e.dest,e.opts||{});let v=y(i,`pages`);await $(v)&&await A(v,y(p,`pages`),{recursive:!0,force:!0});let b=y(i,`pages/main`);await $(b)&&(await A(b,y(p,`files/main`),{recursive:!0,force:!0}),await A(b,y(p,`static-main`),{recursive:!0,force:!0}));try{let{migrateLegacyWorkspaceLayout:e}=await import(`./chunk-CeuR-KKG.js`);await $(y(i,`.agents`))&&await e(i),i!==a&&await $(y(a,`.agents`))&&await e(a)}catch{}let C=y(i,`.agents/skills`);await $(C)&&await A(C,y(p,`.agents/skills`),{recursive:!0,force:!0});let w=y(a,`.agents/skills`);i!==a&&await $(w)&&await A(w,y(p,`.agents/skills`),{recursive:!0,force:!1,errorOnExist:!1});let T=y(i,`.agents/tools`);if(await $(T))await A(T,y(p,`.agents/tools`),{recursive:!0,force:!0});else{let e=y(a,`.agents/tools`);await $(e)&&await A(e,y(p,`.agents/tools`),{recursive:!0,force:!0})}let O=y(i,`.agents/scripts`);if(await $(O))await A(O,y(p,`.agents/scripts`),{recursive:!0,force:!0});else{let e=y(a,`.agents/scripts`);await $(e)&&await A(e,y(p,`.agents/scripts`),{recursive:!0,force:!0})}let k=y(a,`.well-known`);await $(k)&&await A(k,y(p,`.well-known`),{recursive:!0,force:!0});let j=y(i,`.well-known`);if(i!==a&&await $(j)&&await A(j,y(p,`.well-known`),{recursive:!0,force:!0}),await $(y(p,`.agents/skills`)))try{let{generateSkillsIndex:e}=await import(`./chunk-zkXQUEv6.js`);if(await e(p,{metadataRoot:i,outDir:`.well-known/agent-skills`,toolchainRoot:a,includeBundled:!0}),await $(C))try{await e(i,{toolchainRoot:a,includeBundled:!0})}catch{}}catch(e){console.warn(`Notice: Failed to auto-generate agent-skills index:`,e)}let P=await Xa($a(i)),F=P||y(i,`pages/site-config.json`),I=u,L;if(P)try{L=JSON.parse(await N(P,`utf8`))}catch{}e.prerenderMainMemory===void 0&&L&&(L?.settings?.prerenderMainMemory===!1?(I=!1,r(` site-config: prerenderMainMemory=false — pages DSD pre-rendering disabled.`)):L?.settings?.overridePrerenderSkeleton===!1&&r(` site-config: overridePrerenderSkeleton=false — skeleton overlay disabled.`));let R=y(p,`index.html`);I&&await $(b)?await Yc({indexPath:R,sourcePath:b,prerenderPages:l,siteConfigPath:F,isProduction:s,singleFile:e.singleFile}):await Yc({indexPath:R,noSeed:!0,siteConfigPath:F,isProduction:s,singleFile:e.singleFile});let V=e.pagesOrigin||D.PAGES_ORIGIN,H=s?Fl({basePath:e.basePath||D.PAGES_BASE_PATH,pagesOrigin:V,siteUrl:L?.branding?.siteUrl,defaultBasePath:`/`}):e.basePath||D.PAGES_BASE_PATH||`/`;try{await Zl(p,F,{basePath:H,pagesOrigin:V,isProduction:s})}catch{}try{let e=await N(R,`utf8`);e=Il(e,H);let t=``;try{let e=await Xa([y(i,`package.json`),y(a,`package.json`)]);e&&(t=JSON.parse(await N(e,`utf8`)).version||``)}catch{}if(t){e=e.replace(/<meta\s+name="version"[^>]*>/,`<meta name="version" content="${t}" />`);for(let e of[`.well-known/mcp.json`,`.well-known/mcp/server-card.json`]){let n=y(p,e);if(await $(n))try{let e=JSON.parse(await N(n,`utf8`));e.version!==t&&(e.version=t,await z(n,JSON.stringify(e,null,2)+`
224
- `,`utf8`))}catch{}}}await z(R,e,`utf8`);let n=y(p,`share/share-target.html`);if(await $(n)){let e=await N(n,`utf8`);await z(n,Il(e,H),`utf8`)}}catch{}if(s){if(r(`Running production post-build steps...`),r(` PAGES_ORIGIN : ${V||`(relative ./)`}`),r(` PAGES_BASE_PATH: ${H}`),V)try{let e=y(p,`manifest.json`),t=await N(e,`utf8`),n=JSON.parse(t);n.start_url&&(n.start_url=V,await z(e,JSON.stringify(n,null,2),`utf8`))}catch{}await z(y(p,`.nojekyll`),``,`utf8`);let e=``;try{e=ee(`git rev-parse HEAD`,{cwd:i,encoding:`utf8`,stdio:[`ignore`,`pipe`,`ignore`]}).trim()}catch{try{e=ee(`git rev-parse HEAD`,{cwd:a,encoding:`utf8`,stdio:[`ignore`,`pipe`,`ignore`]}).trim()}catch{}}if(e){let t=await N(R,`utf8`);await z(R,t.replace(/<meta\s+name="revision"[^>]*>/,`<meta name="revision" content="${e}" />`),`utf8`)}}let U=await Xa(Qa(i))||y(i,`pages/routes.json`),W=await $(b)?b:y(a,`pages/main`);await eu({publicDir:p,routesPath:U,sourcePath:W,prerenderPages:l,siteConfigPath:F,basePath:H,pagesOrigin:V,isProduction:s,singleFile:e.singleFile});let te=y(p,`service-worker.js`);if(await $(te)&&await au(te,{logImpl:()=>{}}),s)try{let{precompressAssets:e}=await import(`./chunk-C7i38c2x.js`),n=await e(p,{silent:t});!t&&n.count>0&&r(`Pre-compressed ${n.count} assets (.br and .gz).`)}catch(e){t||console.warn(`Notice: Asset pre-compression encountered an issue:`,e)}e.singleFile&&await uu({indexPath:y(p,`index.html`),mainSourcePath:W,contentRoot:i,toolchainRoot:a,cdnBase:e.cdn,isQuiet:t,log:r}),r(`Build completed successfully.`)}finally{t===void 0?delete B.env.NODE_ENV:B.env.NODE_ENV=t}}B.argv[1]&&S(B.argv[1])===S(w(import.meta.url))&&du().catch(e=>{console.error(e),O(1)});export{du as t};
223
+ `,`utf8`))}catch{}}}}catch{}try{let e=`dist/public/index.html`,t=await N(e,`utf8`);await z(e,Il(t,h),`utf8`);let n=`dist/public/share/share-target.html`;if(await $(n)){let e=await N(n,`utf8`);await z(n,Il(e,h),`utf8`)}}catch{}if(s){if(r(`Running production post-build steps...`),r(` PAGES_ORIGIN : ${m||`(relative ./)`}`),r(` PAGES_BASE_PATH: ${h}`),m)try{let e=`dist/public/manifest.json`,t=await N(e,`utf8`),n=JSON.parse(t);n.start_url&&(n.start_url=m,await z(e,JSON.stringify(n,null,2),`utf8`))}catch{}await su(`dist/public`);let e=``;try{e=ee(`npm run -s build:pkg:get:meta`,{encoding:`utf8`,stdio:[`ignore`,`pipe`,`ignore`]}).trim()}catch{}e&&await d(`npm run -s build:pkg:meta "${e}"`)}await eu({publicDir:`dist/public`,routesPath:await Xa(Qa())||`pages/routes.json`,sourcePath:`pages/main`,prerenderPages:l,siteConfigPath:f,basePath:h,pagesOrigin:m,isProduction:s,singleFile:e.singleFile}),await d(`npm run -s build:service-worker`);let g=`dist/public/service-worker.js`;if(await $(g)&&await au(g,{logImpl:()=>{}}),s)try{let{precompressAssets:e}=await import(`./chunk-C7i38c2x.js`),n=await e(`dist/public`,{silent:t});!t&&n.count>0&&r(`Pre-compressed ${n.count} assets (.br and .gz).`)}catch(e){t||console.warn(`Notice: Asset pre-compression encountered an issue:`,e)}e.singleFile&&await uu({indexPath:`dist/public/index.html`,mainSourcePath:`pages/main`,contentRoot:i,toolchainRoot:a,cdnBase:e.cdn,isQuiet:t,log:r}),r(`Build completed successfully.`);return}let f=e.outDir||`dist/public`,p=S(i,f);await qa(p),await M(p,{recursive:!0}),await M(y(p,`assets`),{recursive:!0});let m=y(a,`dist/public`);await $(y(m,`index.js`))||(r(`Building ShadowClaw core toolchain...`),await qa(y(a,`dist/public`)),await qa(y(a,`dist-electron`)),await d(`npm run -s rolldown`,{cwd:a})),await A(m,p,{recursive:!0,filter:e=>{if(e.includes(`/assets/cache/`)||e.includes(`\\assets\\cache\\`)||e.includes(`/.cache/`)||e.includes(`\\.cache\\`)||e.includes(`/cache/`)||e.includes(`\\cache\\`)||e.endsWith(`/cache`)||e.endsWith(`\\cache`))return!1;if(i!==a){let t=x(m,e).replace(/\\/g,`/`);if(t===`docs`||t.startsWith(`docs/`)||t===`main`||t.startsWith(`main/`)||t===`main.html`||t.startsWith(`main.html.`)||t===`static-main`||t.startsWith(`static-main/`)||t===`static-main-manifest.json`||t.startsWith(`static-main-manifest.json.`)||t===`static-routing.json`||t.startsWith(`static-routing.json.`)||t===`files`||t.startsWith(`files/`)||t===`pages`||t.startsWith(`pages/`)||t===`sitemap.xml`||t.startsWith(`sitemap.xml.`)||t===`sitemap.txt`||t.startsWith(`sitemap.txt.`)||t===`llms.txt`||t.startsWith(`llms.txt.`)||t===`README.md`||t.startsWith(`README.md.`)||t===`AGENTS.md`||t.startsWith(`AGENTS.md.`))return!1}return!0}}),i!==a&&(await qa(y(p,`sitemap.xml`)),await qa(y(p,`sitemap.txt`)));let h=y(a,`assets`);if(i!==a&&await $(h)){let e=y(h,`icons`);await $(e)&&await A(e,y(p,`assets/icons`),{recursive:!0,force:!1,errorOnExist:!1});let t=y(h,`screenshots`);await $(t)&&await A(t,y(p,`assets/screenshots`),{recursive:!0,force:!1,errorOnExist:!1});let n=y(h,`fonts`);await $(n)&&await A(n,y(p,`assets/fonts`),{recursive:!0,force:!1,errorOnExist:!1})}let g=y(i,`assets`);await $(g)&&(c?await A(g,p,{recursive:!0,force:!0}):(await $(y(g,`icons`))&&await A(y(g,`icons`),y(p,`assets/icons`),{recursive:!0,force:!0}),await $(y(g,`screenshots`))&&await A(y(g,`screenshots`),y(p,`assets/screenshots`),{recursive:!0,force:!0}),await $(y(g,`fonts`))&&await A(y(g,`fonts`),y(p,`assets/fonts`),{recursive:!0,force:!0}))),await Ja([`pages/resources`,`pages/deps`,`resources`,`deps`,`pages/assets`,`pages/main/assets`],p,{baseDir:i});let v=Za({contentRoot:i,toolchainRoot:a,distPublicDir:p});for(let e of v)await Ya(e.sources,e.dest,e.opts||{});let b=y(i,`pages`);await $(b)&&await A(b,y(p,`pages`),{recursive:!0,force:!0});let C=y(i,`pages/main`);await $(C)&&(await A(C,y(p,`files/main`),{recursive:!0,force:!0}),await A(C,y(p,`static-main`),{recursive:!0,force:!0}));try{let{migrateLegacyWorkspaceLayout:e}=await import(`./chunk-CeuR-KKG.js`);await $(y(i,`.agents`))&&await e(i),i!==a&&await $(y(a,`.agents`))&&await e(a)}catch{}let w=y(i,`.agents/skills`);await $(w)&&await A(w,y(p,`.agents/skills`),{recursive:!0,force:!0});let T=y(a,`.agents/skills`);i!==a&&await $(T)&&await A(T,y(p,`.agents/skills`),{recursive:!0,force:!1,errorOnExist:!1});let O=y(i,`.agents/tools`);if(await $(O))await A(O,y(p,`.agents/tools`),{recursive:!0,force:!0});else{let e=y(a,`.agents/tools`);await $(e)&&await A(e,y(p,`.agents/tools`),{recursive:!0,force:!0})}let k=y(i,`.agents/scripts`);if(await $(k))await A(k,y(p,`.agents/scripts`),{recursive:!0,force:!0});else{let e=y(a,`.agents/scripts`);await $(e)&&await A(e,y(p,`.agents/scripts`),{recursive:!0,force:!0})}let j=y(a,`.well-known`);await $(j)&&await A(j,y(p,`.well-known`),{recursive:!0,force:!0});let P=y(i,`.well-known`);if(i!==a&&await $(P)&&await A(P,y(p,`.well-known`),{recursive:!0,force:!0}),await $(y(p,`.agents/skills`)))try{let{generateSkillsIndex:e}=await import(`./chunk-zkXQUEv6.js`);if(await e(p,{metadataRoot:i,outDir:`.well-known/agent-skills`,toolchainRoot:a,includeBundled:!0}),await $(w))try{await e(i,{toolchainRoot:a,includeBundled:!0})}catch{}}catch(e){console.warn(`Notice: Failed to auto-generate agent-skills index:`,e)}let F=await Xa($a(i)),I=F||y(i,`pages/site-config.json`),L=u,R;if(F)try{R=JSON.parse(await N(F,`utf8`))}catch{}e.prerenderMainMemory===void 0&&R&&(R?.settings?.prerenderMainMemory===!1?(L=!1,r(` site-config: prerenderMainMemory=false — pages DSD pre-rendering disabled.`)):R?.settings?.overridePrerenderSkeleton===!1&&r(` site-config: overridePrerenderSkeleton=false — skeleton overlay disabled.`));let V=y(p,`index.html`);L&&await $(C)?await Yc({indexPath:V,sourcePath:C,prerenderPages:l,siteConfigPath:I,isProduction:s,singleFile:e.singleFile}):await Yc({indexPath:V,noSeed:!0,siteConfigPath:I,isProduction:s,singleFile:e.singleFile});let H=e.pagesOrigin||D.PAGES_ORIGIN,U=s?Fl({basePath:e.basePath||D.PAGES_BASE_PATH,pagesOrigin:H,siteUrl:R?.branding?.siteUrl,defaultBasePath:`/`}):e.basePath||D.PAGES_BASE_PATH||`/`;try{await Zl(p,I,{basePath:U,pagesOrigin:H,isProduction:s})}catch{}try{let e=await N(V,`utf8`);e=Il(e,U);let t=``;try{let e=await Xa([y(i,`package.json`),y(a,`package.json`)]);e&&(t=JSON.parse(await N(e,`utf8`)).version||``)}catch{}if(t){e=e.replace(/<meta\s+name="version"[^>]*>/,`<meta name="version" content="${t}" />`);for(let e of[`.well-known/mcp.json`,`.well-known/mcp/server-card.json`]){let n=y(p,e);if(await $(n))try{let e=JSON.parse(await N(n,`utf8`));e.version!==t&&(e.version=t,await z(n,JSON.stringify(e,null,2)+`
224
+ `,`utf8`))}catch{}}}await z(V,e,`utf8`);let n=y(p,`share/share-target.html`);if(await $(n)){let e=await N(n,`utf8`);await z(n,Il(e,U),`utf8`)}}catch{}if(s){if(r(`Running production post-build steps...`),r(` PAGES_ORIGIN : ${H||`(relative ./)`}`),r(` PAGES_BASE_PATH: ${U}`),H)try{let e=y(p,`manifest.json`),t=await N(e,`utf8`),n=JSON.parse(t);n.start_url&&(n.start_url=H,await z(e,JSON.stringify(n,null,2),`utf8`))}catch{}await z(y(p,`.nojekyll`),``,`utf8`);let e=``;try{e=ee(`git rev-parse HEAD`,{cwd:i,encoding:`utf8`,stdio:[`ignore`,`pipe`,`ignore`]}).trim()}catch{try{e=ee(`git rev-parse HEAD`,{cwd:a,encoding:`utf8`,stdio:[`ignore`,`pipe`,`ignore`]}).trim()}catch{}}if(e){let t=await N(V,`utf8`);await z(V,t.replace(/<meta\s+name="revision"[^>]*>/,`<meta name="revision" content="${e}" />`),`utf8`)}}let W=await Xa(Qa(i))||y(i,`pages/routes.json`),te=await $(C)?C:y(a,`pages/main`);await eu({publicDir:p,routesPath:W,sourcePath:te,prerenderPages:l,siteConfigPath:I,basePath:U,pagesOrigin:H,isProduction:s,singleFile:e.singleFile});let ne=y(p,`service-worker.js`);if(await $(ne)&&await au(ne,{logImpl:()=>{}}),s)try{let{precompressAssets:e}=await import(`./chunk-C7i38c2x.js`),n=await e(p,{silent:t});!t&&n.count>0&&r(`Pre-compressed ${n.count} assets (.br and .gz).`)}catch(e){t||console.warn(`Notice: Asset pre-compression encountered an issue:`,e)}e.singleFile&&await uu({indexPath:y(p,`index.html`),mainSourcePath:te,contentRoot:i,toolchainRoot:a,cdnBase:e.cdn,isQuiet:t,log:r}),r(`Build completed successfully.`)}finally{t===void 0?delete B.env.NODE_ENV:B.env.NODE_ENV=t}}B.argv[1]&&S(B.argv[1])===S(w(import.meta.url))&&du().catch(e=>{console.error(e),O(1)});export{du as t};