@agent-native/core 0.26.1 → 0.26.3

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 +1 @@
1
- {"version":3,"file":"PoweredByBadge.d.ts","sourceRoot":"","sources":["../../src/client/PoweredByBadge.tsx"],"names":[],"mappings":"AAIA,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,EAAE,cAAc,GAAG,aAAa,CAAC;CAC3C;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,aAAa,GAAG,cAAc,CAAC;CAC3C;AA+BD;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,EAC7B,QAAyB,GAC1B,EAAE,mBAAmB,2CAwGrB;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,EAC9B,QAAwB,GACzB,EAAE,oBAAoB,2CAoEtB"}
1
+ {"version":3,"file":"PoweredByBadge.d.ts","sourceRoot":"","sources":["../../src/client/PoweredByBadge.tsx"],"names":[],"mappings":"AAIA,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,EAAE,cAAc,GAAG,aAAa,CAAC;CAC3C;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,aAAa,GAAG,cAAc,CAAC;CAC3C;AA+BD;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,EAC7B,QAAyB,GAC1B,EAAE,mBAAmB,2CAwGrB;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,EAC9B,QAAwB,GACzB,EAAE,oBAAoB,2CAuEtB"}
@@ -133,6 +133,9 @@ export function OpenSourceBadge({ position = "bottom-left", }) {
133
133
  border-color: transparent !important;
134
134
  backdrop-filter: none !important;
135
135
  -webkit-backdrop-filter: none !important;
136
+ color: #00B5FF !important;
137
+ font-weight: 600 !important;
138
+ opacity: 0.95 !important;
136
139
  }
137
140
  @media (max-width: 640px) {
138
141
  .an-open-source-badge {
@@ -143,30 +146,30 @@ export function OpenSourceBadge({ position = "bottom-left", }) {
143
146
  }
144
147
  }
145
148
  .dark .an-open-source-badge {
146
- color: rgba(215, 215, 215, 0.94) !important;
149
+ color: #00B5FF !important;
147
150
  }
148
151
  @media ${darkQuery} {
149
152
  .an-open-source-badge {
150
- color: rgba(215, 215, 215, 0.94) !important;
153
+ color: #00B5FF !important;
151
154
  }
152
155
  }
153
156
  .light .an-open-source-badge {
154
- color: rgba(95, 95, 95, 0.95) !important;
157
+ color: #00B5FF !important;
155
158
  }
156
159
  .an-open-source-badge:hover {
157
160
  opacity: 1 !important;
158
- color: rgba(70, 70, 70, 1) !important;
161
+ color: #33C4FF !important;
159
162
  }
160
163
  @media ${darkQuery} {
161
164
  .an-open-source-badge:hover {
162
- color: rgba(238, 238, 238, 1) !important;
165
+ color: #33C4FF !important;
163
166
  }
164
167
  }
165
168
  .dark .an-open-source-badge:hover {
166
- color: rgba(238, 238, 238, 1) !important;
169
+ color: #33C4FF !important;
167
170
  }
168
171
  .light .an-open-source-badge:hover {
169
- color: rgba(70, 70, 70, 1) !important;
172
+ color: #33C4FF !important;
170
173
  }
171
174
  ` }), _jsxs("a", { href: "https://github.com/BuilderIO/agent-native", target: "_blank", rel: "noopener noreferrer", className: "an-open-source-badge", style: containerStyle(position), children: [_jsx(IconBrandGithub, { "aria-hidden": "true", stroke: 1.8 }), _jsx("span", { children: "100% free and open source" })] })] }));
172
175
  }
@@ -1 +1 @@
1
- {"version":3,"file":"PoweredByBadge.js","sourceRoot":"","sources":["../../src/client/PoweredByBadge.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAUxC,MAAM,cAAc,GAAG,CACrB,QAAwC,EACzB,EAAE,CAAC,CAAC;IACnB,QAAQ,EAAE,OAAO;IACjB,MAAM,EAAE,EAAE;IACV,GAAG,CAAC,QAAQ,KAAK,cAAc,CAAC,CAAC,CAAC,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CAAC,gBACpB,yBAAyB,aAEpC,wCAAuB,EACvB,cACE,GAAG,EAAE,WAAW,EAChB,GAAG,EAAC,cAAc,EAClB,SAAS,EAAC,uCAAuC,GACjD,EACF,cACE,GAAG,EAAE,UAAU,EACf,GAAG,EAAC,cAAc,EAClB,SAAS,EAAC,sCAAsC,GAChD,IACA,IACH,CACJ,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,EAC9B,QAAQ,GAAG,aAAa,GACH;IACrB,MAAM,MAAM,GACT,MAAM,CAAC,IAAI,CAAC,GAA0C;QACrD,EAAE,kBAAkB,KAAK,MAAM,CAAC;IAEpC,IAAI,MAAM;QAAE,OAAO,IAAI,CAAC;IAExB,OAAO,CACL,8BACE,0BAAQ;;;;;;;;;;;;;;;;;;;;;;;iBAuBG,SAAS;;;;;;;;;;;;iBAYT,SAAS;;;;;;;;;;;OAWnB,GAAS,EACV,aACE,IAAI,EAAC,2CAA2C,EAChD,MAAM,EAAC,QAAQ,EACf,GAAG,EAAC,qBAAqB,EACzB,SAAS,EAAC,sBAAsB,EAChC,KAAK,EAAE,cAAc,CAAC,QAAQ,CAAC,aAE/B,KAAC,eAAe,mBAAa,MAAM,EAAC,MAAM,EAAE,GAAG,GAAI,EACnD,uDAAsC,IACpC,IACH,CACJ,CAAC;AACJ,CAAC","sourcesContent":["import type { CSSProperties } from \"react\";\nimport { IconBrandGithub } from \"@tabler/icons-react\";\nimport { appPath } from \"./api-path.js\";\n\nexport interface PoweredByBadgeProps {\n position?: \"bottom-right\" | \"bottom-left\";\n}\n\nexport interface OpenSourceBadgeProps {\n position?: \"bottom-left\" | \"bottom-right\";\n}\n\nconst containerStyle = (\n position: \"bottom-right\" | \"bottom-left\",\n): CSSProperties => ({\n position: \"fixed\",\n bottom: 16,\n ...(position === \"bottom-right\" ? { right: 16 } : { left: 16 }),\n zIndex: 50,\n display: \"flex\",\n alignItems: \"center\",\n gap: 6,\n padding: \"6px 12px\",\n borderRadius: 8,\n fontSize: 12,\n fontFamily:\n '-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif',\n fontWeight: 500,\n lineHeight: 1,\n color: \"rgba(95, 95, 95, 0.95)\",\n background: \"rgba(0, 0, 0, 0.05)\",\n backdropFilter: \"blur(8px)\",\n WebkitBackdropFilter: \"blur(8px)\",\n border: \"1px solid rgba(0, 0, 0, 0.06)\",\n textDecoration: \"none\",\n transition: \"opacity 0.2s, color 0.2s\",\n opacity: 0.82,\n});\n\nconst darkQuery = \"(prefers-color-scheme: dark)\";\n\n/**\n * Small branding badge: \"Built with [Agent Native logo]\"\n *\n * - Fixed position in the corner\n * - Subtle, semi-transparent\n * - Links to https://agent-native.com\n * - Respects prefers-color-scheme\n * - Can be hidden via HIDE_BRANDING=true env var (for white-label)\n */\nexport function PoweredByBadge({\n position = \"bottom-right\",\n}: PoweredByBadgeProps) {\n // Allow hiding via env var\n const hidden =\n (import.meta.env as Record<string, string | undefined>)\n ?.VITE_HIDE_BRANDING === \"true\";\n\n if (hidden) return null;\n\n const logoOnLight = appPath(\"/agent-native-logo-light.svg\");\n const logoOnDark = appPath(\"/agent-native-logo-dark.svg\");\n\n return (\n <>\n <style>{`\n .an-powered-logo {\n display: block;\n height: 14px;\n width: auto;\n flex: none;\n }\n .an-powered-logo-dark {\n display: none;\n }\n @media (max-width: 640px) {\n .an-powered-badge {\n position: static !important;\n margin: 0.75rem auto 0 !important;\n width: max-content;\n max-width: calc(100vw - 2rem);\n }\n }\n .dark .an-powered-badge {\n background: rgba(255, 255, 255, 0.06) !important;\n border-color: rgba(255, 255, 255, 0.08) !important;\n color: rgba(215, 215, 215, 0.94) !important;\n }\n .dark .an-powered-logo-light {\n display: none;\n }\n .dark .an-powered-logo-dark {\n display: block;\n }\n @media ${darkQuery} {\n .an-powered-badge {\n background: rgba(255, 255, 255, 0.06) !important;\n border-color: rgba(255, 255, 255, 0.08) !important;\n color: rgba(215, 215, 215, 0.94) !important;\n }\n .an-powered-logo-light {\n display: none;\n }\n .an-powered-logo-dark {\n display: block;\n }\n }\n .light .an-powered-badge {\n background: rgba(0, 0, 0, 0.05) !important;\n border-color: rgba(0, 0, 0, 0.06) !important;\n color: rgba(95, 95, 95, 0.95) !important;\n }\n .light .an-powered-logo-light {\n display: block;\n }\n .light .an-powered-logo-dark {\n display: none;\n }\n .an-powered-badge:hover {\n opacity: 1 !important;\n color: rgba(70, 70, 70, 1) !important;\n }\n @media ${darkQuery} {\n .an-powered-badge:hover {\n color: rgba(238, 238, 238, 1) !important;\n }\n }\n .dark .an-powered-badge:hover {\n color: rgba(238, 238, 238, 1) !important;\n }\n .light .an-powered-badge:hover {\n color: rgba(70, 70, 70, 1) !important;\n }\n `}</style>\n <a\n href=\"https://agent-native.com\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"an-powered-badge\"\n style={containerStyle(position)}\n aria-label=\"Built with Agent Native\"\n >\n <span>Built with</span>\n <img\n src={logoOnLight}\n alt=\"Agent Native\"\n className=\"an-powered-logo an-powered-logo-light\"\n />\n <img\n src={logoOnDark}\n alt=\"Agent Native\"\n className=\"an-powered-logo an-powered-logo-dark\"\n />\n </a>\n </>\n );\n}\n\n/**\n * Small GitHub badge: \"100% free and open source\"\n *\n * Intended to pair with PoweredByBadge on public pages.\n */\nexport function OpenSourceBadge({\n position = \"bottom-left\",\n}: OpenSourceBadgeProps) {\n const hidden =\n (import.meta.env as Record<string, string | undefined>)\n ?.VITE_HIDE_BRANDING === \"true\";\n\n if (hidden) return null;\n\n return (\n <>\n <style>{`\n .an-open-source-badge svg {\n width: 15px;\n height: 15px;\n flex: none;\n }\n .an-open-source-badge {\n background: transparent !important;\n border-color: transparent !important;\n backdrop-filter: none !important;\n -webkit-backdrop-filter: none !important;\n }\n @media (max-width: 640px) {\n .an-open-source-badge {\n position: static !important;\n margin: 1rem auto 0 !important;\n width: max-content;\n max-width: calc(100vw - 2rem);\n }\n }\n .dark .an-open-source-badge {\n color: rgba(215, 215, 215, 0.94) !important;\n }\n @media ${darkQuery} {\n .an-open-source-badge {\n color: rgba(215, 215, 215, 0.94) !important;\n }\n }\n .light .an-open-source-badge {\n color: rgba(95, 95, 95, 0.95) !important;\n }\n .an-open-source-badge:hover {\n opacity: 1 !important;\n color: rgba(70, 70, 70, 1) !important;\n }\n @media ${darkQuery} {\n .an-open-source-badge:hover {\n color: rgba(238, 238, 238, 1) !important;\n }\n }\n .dark .an-open-source-badge:hover {\n color: rgba(238, 238, 238, 1) !important;\n }\n .light .an-open-source-badge:hover {\n color: rgba(70, 70, 70, 1) !important;\n }\n `}</style>\n <a\n href=\"https://github.com/BuilderIO/agent-native\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"an-open-source-badge\"\n style={containerStyle(position)}\n >\n <IconBrandGithub aria-hidden=\"true\" stroke={1.8} />\n <span>100% free and open source</span>\n </a>\n </>\n );\n}\n"]}
1
+ {"version":3,"file":"PoweredByBadge.js","sourceRoot":"","sources":["../../src/client/PoweredByBadge.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAUxC,MAAM,cAAc,GAAG,CACrB,QAAwC,EACzB,EAAE,CAAC,CAAC;IACnB,QAAQ,EAAE,OAAO;IACjB,MAAM,EAAE,EAAE;IACV,GAAG,CAAC,QAAQ,KAAK,cAAc,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;IAC/D,MAAM,EAAE,EAAE;IACV,OAAO,EAAE,MAAM;IACf,UAAU,EAAE,QAAQ;IACpB,GAAG,EAAE,CAAC;IACN,OAAO,EAAE,UAAU;IACnB,YAAY,EAAE,CAAC;IACf,QAAQ,EAAE,EAAE;IACZ,UAAU,EACR,mEAAmE;IACrE,UAAU,EAAE,GAAG;IACf,UAAU,EAAE,CAAC;IACb,KA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,GACT,MAAM,CAAC,IAAI,CAAC,GAA0C;QACrD,EAAE,kBAAkB,KAAK,MAAM,CAAC;IAEpC,IAAI,MAAM;QAAE,OAAO,IAAI,CAAC;IAExB,OAAO,CACL,8BACE,0BAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;iBA0BG,SAAS;;;;;;;;;;;;iBAYT,SAAS;;;;;;;;;;;OAWnB,GAAS,EACV,aACE,IAAI,EAAC,2CAA2C,EAChD,MAAM,EAAC,QAAQ,EACf,GAAG,EAAC,qBAAqB,EACzB,SAAS,EAAC,sBAAsB,EAChC,KAAK,EAAE,cAAc,CAAC,QAAQ,CAAC,aAE/B,KAAC,eAAe,mBAAa,MAAM,EAAC,MAAM,EAAE,GAAG,GAAI,EACnD,uDAAsC,IACpC,IACH,CACJ,CAAC;AACJ,CAAC","sourcesContent":["import type { CSSProperties } from \"react\";\nimport { IconBrandGithub } from \"@tabler/icons-react\";\nimport { appPath } from \"./api-path.js\";\n\nexport interface PoweredByBadgeProps {\n position?: \"bottom-right\" | \"bottom-left\";\n}\n\nexport interface OpenSourceBadgeProps {\n position?: \"bottom-left\" | \"bottom-right\";\n}\n\nconst containerStyle = (\n position: \"bottom-right\" | \"bottom-left\",\n): CSSProperties => ({\n position: \"fixed\",\n bottom: 16,\n ...(position === \"bottom-right\" ? { right: 16 } : { left: 16 }),\n zIndex: 50,\n display: \"flex\",\n alignItems: \"center\",\n gap: 6,\n padding: \"6px 12px\",\n borderRadius: 8,\n fontSize: 12,\n fontFamily:\n '-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif',\n fontWeight: 500,\n lineHeight: 1,\n color: \"rgba(95, 95, 95, 0.95)\",\n background: \"rgba(0, 0, 0, 0.05)\",\n backdropFilter: \"blur(8px)\",\n WebkitBackdropFilter: \"blur(8px)\",\n border: \"1px solid rgba(0, 0, 0, 0.06)\",\n textDecoration: \"none\",\n transition: \"opacity 0.2s, color 0.2s\",\n opacity: 0.82,\n});\n\nconst darkQuery = \"(prefers-color-scheme: dark)\";\n\n/**\n * Small branding badge: \"Built with [Agent Native logo]\"\n *\n * - Fixed position in the corner\n * - Subtle, semi-transparent\n * - Links to https://agent-native.com\n * - Respects prefers-color-scheme\n * - Can be hidden via HIDE_BRANDING=true env var (for white-label)\n */\nexport function PoweredByBadge({\n position = \"bottom-right\",\n}: PoweredByBadgeProps) {\n // Allow hiding via env var\n const hidden =\n (import.meta.env as Record<string, string | undefined>)\n ?.VITE_HIDE_BRANDING === \"true\";\n\n if (hidden) return null;\n\n const logoOnLight = appPath(\"/agent-native-logo-light.svg\");\n const logoOnDark = appPath(\"/agent-native-logo-dark.svg\");\n\n return (\n <>\n <style>{`\n .an-powered-logo {\n display: block;\n height: 14px;\n width: auto;\n flex: none;\n }\n .an-powered-logo-dark {\n display: none;\n }\n @media (max-width: 640px) {\n .an-powered-badge {\n position: static !important;\n margin: 0.75rem auto 0 !important;\n width: max-content;\n max-width: calc(100vw - 2rem);\n }\n }\n .dark .an-powered-badge {\n background: rgba(255, 255, 255, 0.06) !important;\n border-color: rgba(255, 255, 255, 0.08) !important;\n color: rgba(215, 215, 215, 0.94) !important;\n }\n .dark .an-powered-logo-light {\n display: none;\n }\n .dark .an-powered-logo-dark {\n display: block;\n }\n @media ${darkQuery} {\n .an-powered-badge {\n background: rgba(255, 255, 255, 0.06) !important;\n border-color: rgba(255, 255, 255, 0.08) !important;\n color: rgba(215, 215, 215, 0.94) !important;\n }\n .an-powered-logo-light {\n display: none;\n }\n .an-powered-logo-dark {\n display: block;\n }\n }\n .light .an-powered-badge {\n background: rgba(0, 0, 0, 0.05) !important;\n border-color: rgba(0, 0, 0, 0.06) !important;\n color: rgba(95, 95, 95, 0.95) !important;\n }\n .light .an-powered-logo-light {\n display: block;\n }\n .light .an-powered-logo-dark {\n display: none;\n }\n .an-powered-badge:hover {\n opacity: 1 !important;\n color: rgba(70, 70, 70, 1) !important;\n }\n @media ${darkQuery} {\n .an-powered-badge:hover {\n color: rgba(238, 238, 238, 1) !important;\n }\n }\n .dark .an-powered-badge:hover {\n color: rgba(238, 238, 238, 1) !important;\n }\n .light .an-powered-badge:hover {\n color: rgba(70, 70, 70, 1) !important;\n }\n `}</style>\n <a\n href=\"https://agent-native.com\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"an-powered-badge\"\n style={containerStyle(position)}\n aria-label=\"Built with Agent Native\"\n >\n <span>Built with</span>\n <img\n src={logoOnLight}\n alt=\"Agent Native\"\n className=\"an-powered-logo an-powered-logo-light\"\n />\n <img\n src={logoOnDark}\n alt=\"Agent Native\"\n className=\"an-powered-logo an-powered-logo-dark\"\n />\n </a>\n </>\n );\n}\n\n/**\n * Small GitHub badge: \"100% free and open source\"\n *\n * Intended to pair with PoweredByBadge on public pages.\n */\nexport function OpenSourceBadge({\n position = \"bottom-left\",\n}: OpenSourceBadgeProps) {\n const hidden =\n (import.meta.env as Record<string, string | undefined>)\n ?.VITE_HIDE_BRANDING === \"true\";\n\n if (hidden) return null;\n\n return (\n <>\n <style>{`\n .an-open-source-badge svg {\n width: 15px;\n height: 15px;\n flex: none;\n }\n .an-open-source-badge {\n background: transparent !important;\n border-color: transparent !important;\n backdrop-filter: none !important;\n -webkit-backdrop-filter: none !important;\n color: #00B5FF !important;\n font-weight: 600 !important;\n opacity: 0.95 !important;\n }\n @media (max-width: 640px) {\n .an-open-source-badge {\n position: static !important;\n margin: 1rem auto 0 !important;\n width: max-content;\n max-width: calc(100vw - 2rem);\n }\n }\n .dark .an-open-source-badge {\n color: #00B5FF !important;\n }\n @media ${darkQuery} {\n .an-open-source-badge {\n color: #00B5FF !important;\n }\n }\n .light .an-open-source-badge {\n color: #00B5FF !important;\n }\n .an-open-source-badge:hover {\n opacity: 1 !important;\n color: #33C4FF !important;\n }\n @media ${darkQuery} {\n .an-open-source-badge:hover {\n color: #33C4FF !important;\n }\n }\n .dark .an-open-source-badge:hover {\n color: #33C4FF !important;\n }\n .light .an-open-source-badge:hover {\n color: #33C4FF !important;\n }\n `}</style>\n <a\n href=\"https://github.com/BuilderIO/agent-native\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"an-open-source-badge\"\n style={containerStyle(position)}\n >\n <IconBrandGithub aria-hidden=\"true\" stroke={1.8} />\n <span>100% free and open source</span>\n </a>\n </>\n );\n}\n"]}
@@ -14,6 +14,10 @@
14
14
  */
15
15
  import { type DiscoveredRoute, type DiscoveredAction } from "./route-discovery.js";
16
16
  import { type WorkspaceCoreExports } from "./workspace-core.js";
17
+ type RouteRules = Record<string, {
18
+ headers?: Record<string, string>;
19
+ }>;
20
+ export declare function addImmutableAssetRouteRulesForClientBuild(routeRules: RouteRules, clientDir: string, appBasePath?: string): void;
17
21
  /**
18
22
  * Generate the worker entry source code that wires up H3 + React Router SSR.
19
23
  *
@@ -23,7 +27,7 @@ import { type WorkspaceCoreExports } from "./workspace-core.js";
23
27
  * `@agent-native/core/server`. This is the middle layer of the three-layer
24
28
  * inheritance model: app local > workspace core > framework default.
25
29
  */
26
- export declare function generateWorkerEntry(routes: DiscoveredRoute[], pluginPaths: string[], defaultPluginStems?: string[], actions?: DiscoveredAction[], workspaceCore?: WorkspaceCoreExports | null): string;
30
+ export declare function generateWorkerEntry(routes: DiscoveredRoute[], pluginPaths: string[], defaultPluginStems?: string[], actions?: DiscoveredAction[], workspaceCore?: WorkspaceCoreExports | null, immutableAssetPaths?: string[]): string;
27
31
  export declare function getNodeBuiltinNames(): string[];
28
32
  /**
29
33
  * Build for any non-Cloudflare preset using Nitro's programmatic build API.
@@ -55,4 +59,5 @@ export interface NitroBuildPipelineOptions {
55
59
  * anything with a file extension.
56
60
  */
57
61
  export declare function runNitroBuildPipeline(opts: NitroBuildPipelineOptions): Promise<void>;
62
+ export {};
58
63
  //# sourceMappingURL=build.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/deploy/build.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;GAYG;AAOH,OAAO,EAML,KAA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22
  import { generateActionRegistryForProject } from "../vite/action-types-plugin.js";
23
23
  import { mcpEmbedStaticAssetRouteRules } from "../shared/mcp-embed-headers.js";
24
24
  import { AGENT_NATIVE_DEFAULT_SOCIAL_IMAGE } from "../shared/social-meta.js";
25
+ import { collectImmutableAssetPaths, IMMUTABLE_ASSET_CACHE_CONTROL, IMMUTABLE_ASSET_CACHE_HEADERS, prefixAssetPath, } from "./immutable-assets.js";
25
26
  const cwd = process.cwd();
26
27
  const preset = process.env.NITRO_PRESET || "node";
27
28
  const DEFAULT_SSR_CACHE_CONTROL = "public, max-age=5, stale-while-revalidate=604800, stale-if-error=3600";
@@ -48,6 +49,25 @@ function isNodeOnlyPlugin(filePath) {
48
49
  const basename = path.basename(filePath, path.extname(filePath));
49
50
  return NODE_ONLY_PLUGINS.has(basename);
50
51
  }
52
+ function addImmutableAssetRouteRule(routeRules, pathname) {
53
+ const existing = routeRules[pathname] ?? {};
54
+ routeRules[pathname] = {
55
+ ...existing,
56
+ headers: {
57
+ ...(existing.headers ?? {}),
58
+ ...IMMUTABLE_ASSET_CACHE_HEADERS,
59
+ },
60
+ };
61
+ }
62
+ export function addImmutableAssetRouteRulesForClientBuild(routeRules, clientDir, appBasePath = "") {
63
+ for (const assetPath of collectImmutableAssetPaths(clientDir)) {
64
+ addImmutableAssetRouteRule(routeRules, assetPath);
65
+ const mountedPath = prefixAssetPath(assetPath, appBasePath);
66
+ if (mountedPath !== assetPath) {
67
+ addImmutableAssetRouteRule(routeRules, mountedPath);
68
+ }
69
+ }
70
+ }
51
71
  /**
52
72
  * Generate the worker entry source code that wires up H3 + React Router SSR.
53
73
  *
@@ -57,7 +77,7 @@ function isNodeOnlyPlugin(filePath) {
57
77
  * `@agent-native/core/server`. This is the middle layer of the three-layer
58
78
  * inheritance model: app local > workspace core > framework default.
59
79
  */
60
- export function generateWorkerEntry(routes, pluginPaths, defaultPluginStems = [], actions = [], workspaceCore = null) {
80
+ export function generateWorkerEntry(routes, pluginPaths, defaultPluginStems = [], actions = [], workspaceCore = null, immutableAssetPaths = []) {
61
81
  const routeImports = [];
62
82
  const routeRegistrations = [];
63
83
  for (let i = 0; i < routes.length; i++) {
@@ -263,6 +283,8 @@ function injectHeadScript(html, script) {
263
283
  }
264
284
 
265
285
  const DEFAULT_SSR_CACHE_CONTROL = ${JSON.stringify(DEFAULT_SSR_CACHE_CONTROL)};
286
+ const IMMUTABLE_ASSET_CACHE_CONTROL = ${JSON.stringify(IMMUTABLE_ASSET_CACHE_CONTROL)};
287
+ const IMMUTABLE_ASSET_PATHS = new Set(${JSON.stringify([...new Set(immutableAssetPaths)].sort())});
266
288
  const AGENT_NATIVE_DEFAULT_SOCIAL_IMAGE = ${JSON.stringify(AGENT_NATIVE_DEFAULT_SOCIAL_IMAGE)};
267
289
  const OG_IMAGE_META_RE = /<meta\\b(?=[^>]*\\bproperty=(["'])og:image\\1)[^>]*>/i;
268
290
  const TWITTER_CARD_META_RE = /<meta\\b(?=[^>]*\\bname=(["'])twitter:card\\1)[^>]*>/i;
@@ -300,6 +322,26 @@ function applyDefaultSsrCacheHeader(headers, status) {
300
322
  headers.set("cache-control", DEFAULT_SSR_CACHE_CONTROL);
301
323
  }
302
324
 
325
+ function isImmutableAssetRequest(request) {
326
+ const pathname = stripAppBasePath(new URL(request.url).pathname);
327
+ return IMMUTABLE_ASSET_PATHS.has(pathname);
328
+ }
329
+
330
+ function applyImmutableAssetCacheHeaders(response, request) {
331
+ if (!isImmutableAssetRequest(request)) return response;
332
+ if (!((response.status >= 200 && response.status < 300) || response.status === 304)) {
333
+ return response;
334
+ }
335
+ const headers = new Headers(response.headers);
336
+ headers.set("Cache-Control", IMMUTABLE_ASSET_CACHE_CONTROL);
337
+ headers.set("CDN-Cache-Control", IMMUTABLE_ASSET_CACHE_CONTROL);
338
+ return new Response(response.body, {
339
+ status: response.status,
340
+ statusText: response.statusText,
341
+ headers,
342
+ });
343
+ }
344
+
303
345
  async function rewriteMountedResponse(response, basePath) {
304
346
  const sentryClientConfigScript = getSentryClientConfigScript();
305
347
  const headers = new Headers(response.headers);
@@ -458,7 +500,7 @@ export default {
458
500
  try {
459
501
  const assetResponse = await env.ASSETS.fetch(request);
460
502
  if (assetResponse.status !== 404) {
461
- return assetResponse;
503
+ return applyImmutableAssetCacheHeaders(assetResponse, request);
462
504
  }
463
505
  } catch {
464
506
  // Asset fetch failed — fall through to SSR
@@ -517,7 +559,8 @@ async function buildCloudflarePages() {
517
559
  : 0;
518
560
  console.log(`[deploy] ${routes.length} API routes, ${actions.length} actions, ${plugins.length} plugins (${plugins.filter((p) => isNodeOnlyPlugin(p)).length} skipped as Node-only), ${missingDefaults.length} auto-mounted defaults${workspaceCore ? `, workspace-core ${workspaceCore.packageName} (${workspaceSlotCount} plugin slots)` : ""}`);
519
561
  // Generate the worker entry
520
- const entrySource = generateWorkerEntry(routes, plugins, missingDefaults, actions, workspaceCore);
562
+ const immutableAssetPaths = collectImmutableAssetPaths(clientDir);
563
+ const entrySource = generateWorkerEntry(routes, plugins, missingDefaults, actions, workspaceCore, immutableAssetPaths);
521
564
  // Create _worker.js output directory
522
565
  const workerOutDir = path.join(distDir, "_worker.js");
523
566
  fs.mkdirSync(workerOutDir, { recursive: true });
@@ -1064,6 +1107,8 @@ export async function runNitroBuildPipeline(opts) {
1064
1107
  if (appBasePath) {
1065
1108
  copyDir(clientDir, path.join(publicOutputDir, appBasePath.slice(1)));
1066
1109
  }
1110
+ nitro.options.routeRules ??= {};
1111
+ addImmutableAssetRouteRulesForClientBuild(nitro.options.routeRules, clientDir, appBasePath);
1067
1112
  console.log(`[deploy] Copied client assets to ${path.relative(cwd, publicOutputDir)}`);
1068
1113
  }
1069
1114
  await hooks.nitroBuild(nitro);