@agent-native/core 0.7.82 → 0.7.83

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 (57) hide show
  1. package/dist/cli/create.d.ts +1 -1
  2. package/dist/cli/create.d.ts.map +1 -1
  3. package/dist/cli/create.js +35 -10
  4. package/dist/cli/create.js.map +1 -1
  5. package/dist/client/FeedbackButton.d.ts +3 -2
  6. package/dist/client/FeedbackButton.d.ts.map +1 -1
  7. package/dist/client/FeedbackButton.js +18 -14
  8. package/dist/client/FeedbackButton.js.map +1 -1
  9. package/dist/client/builder-frame.d.ts +11 -0
  10. package/dist/client/builder-frame.d.ts.map +1 -1
  11. package/dist/client/builder-frame.js +40 -9
  12. package/dist/client/builder-frame.js.map +1 -1
  13. package/dist/client/composer/PromptComposer.d.ts +2 -0
  14. package/dist/client/composer/PromptComposer.d.ts.map +1 -1
  15. package/dist/client/composer/PromptComposer.js +2 -2
  16. package/dist/client/composer/PromptComposer.js.map +1 -1
  17. package/dist/client/composer/TiptapComposer.d.ts +3 -1
  18. package/dist/client/composer/TiptapComposer.d.ts.map +1 -1
  19. package/dist/client/composer/TiptapComposer.js +17 -5
  20. package/dist/client/composer/TiptapComposer.js.map +1 -1
  21. package/dist/client/integrations/IntegrationsPanel.d.ts.map +1 -1
  22. package/dist/client/integrations/IntegrationsPanel.js +4 -1
  23. package/dist/client/integrations/IntegrationsPanel.js.map +1 -1
  24. package/dist/client/tools/ToolsSidebarSection.js +1 -1
  25. package/dist/client/tools/ToolsSidebarSection.js.map +1 -1
  26. package/dist/server/action-discovery.d.ts +15 -0
  27. package/dist/server/action-discovery.d.ts.map +1 -1
  28. package/dist/server/action-discovery.js +45 -0
  29. package/dist/server/action-discovery.js.map +1 -1
  30. package/dist/server/auth.d.ts +5 -4
  31. package/dist/server/auth.d.ts.map +1 -1
  32. package/dist/server/auth.js +80 -28
  33. package/dist/server/auth.js.map +1 -1
  34. package/dist/server/core-routes-plugin.d.ts.map +1 -1
  35. package/dist/server/core-routes-plugin.js +1 -3
  36. package/dist/server/core-routes-plugin.js.map +1 -1
  37. package/dist/server/google-oauth.d.ts.map +1 -1
  38. package/dist/server/google-oauth.js +15 -3
  39. package/dist/server/google-oauth.js.map +1 -1
  40. package/dist/server/index.d.ts +2 -2
  41. package/dist/server/index.d.ts.map +1 -1
  42. package/dist/server/index.js +1 -1
  43. package/dist/server/index.js.map +1 -1
  44. package/dist/vite/client.d.ts.map +1 -1
  45. package/dist/vite/client.js +7 -0
  46. package/dist/vite/client.js.map +1 -1
  47. package/docs/content/template-analytics.md +10 -0
  48. package/docs/content/template-calendar.md +10 -0
  49. package/docs/content/template-clips.md +10 -0
  50. package/docs/content/template-content.md +10 -0
  51. package/docs/content/template-dispatch.md +10 -0
  52. package/docs/content/template-forms.md +10 -0
  53. package/docs/content/template-mail.md +10 -0
  54. package/docs/content/template-slides.md +11 -1
  55. package/docs/content/template-starter.md +10 -0
  56. package/docs/content/template-video.md +10 -0
  57. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/vite/client.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAEvC,OAAO,EAAE,KAAK,IAAI,eAAe,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC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J,CAAC","sourcesContent":["import path from \"path\";\nimport fs from \"fs\";\nimport { createRequire } from \"module\";\nimport type { Plugin, UserConfig } from \"vite\";\nimport { nitro as nitroVitePlugin } from \"nitro/vite\";\nimport { actionTypesPlugin } from \"./action-types-plugin.js\";\nimport { agentsBundlePlugin } from \"./agents-bundle-plugin.js\";\nimport { findWorkspaceRoot } from \"../scripts/utils.js\";\n\nimport { fileURLToPath } from \"url\";\n\nconst require = createRequire(import.meta.url);\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\n\n/**\n * Sync discovery for the workspace-core in an enterprise monorepo.\n *\n * Mirrors `getWorkspaceCoreExports` in deploy/workspace-core.ts but stays\n * synchronous so it can run inline in `defineConfig`. Returns the workspace\n * core's package name + absolute directory, or null if no workspace core is\n * declared in the ancestor chain.\n *\n * Walks up from `startDir` looking for a package.json with\n * `agent-native.workspaceCore`. Resolves the declared package name through\n * `<workspaceRoot>/node_modules/<name>` (pnpm symlink, fastest) or by\n * scanning `packages/*` for a matching `name` field (fallback for\n * pre-install scenarios).\n */\nfunction findWorkspaceCoreSync(\n startDir: string,\n): { packageName: string; packageDir: string } | null {\n // 1) Walk up looking for the root package.json that declares workspaceCore.\n let dir = path.resolve(startDir);\n let workspaceRoot: string | null = null;\n let packageName: string | null = null;\n for (let i = 0; i < 20; i++) {\n const pkgPath = path.join(dir, \"package.json\");\n if (fs.existsSync(pkgPath)) {\n try {\n const pkg = JSON.parse(fs.readFileSync(pkgPath, \"utf-8\"));\n const declared = pkg?.[\"agent-native\"]?.workspaceCore;\n if (typeof declared === \"string\" && declared.length > 0) {\n workspaceRoot = dir;\n packageName = declared;\n break;\n }\n } catch {\n // Malformed package.json — keep walking up.\n }\n }\n const parent = path.dirname(dir);\n if (parent === dir) break;\n dir = parent;\n }\n if (!workspaceRoot || !packageName) return null;\n\n // 2a) pnpm/npm symlink under workspaceRoot/node_modules.\n const nm = path.join(workspaceRoot, \"node_modules\", packageName);\n if (fs.existsSync(path.join(nm, \"package.json\"))) {\n return { packageName, packageDir: fs.realpathSync(nm) };\n }\n\n // 2b) Scan packages/* and packages/@scope/* for a matching `name`.\n const packagesDir = path.join(workspaceRoot, \"packages\");\n if (fs.existsSync(packagesDir)) {\n const candidates: string[] = [];\n for (const entry of fs.readdirSync(packagesDir, { withFileTypes: true })) {\n if (!entry.isDirectory()) continue;\n candidates.push(path.join(packagesDir, entry.name));\n if (entry.name.startsWith(\"@\")) {\n const scopeDir = path.join(packagesDir, entry.name);\n for (const sub of fs.readdirSync(scopeDir, { withFileTypes: true })) {\n if (sub.isDirectory()) candidates.push(path.join(scopeDir, sub.name));\n }\n }\n }\n for (const c of candidates) {\n const p = path.join(c, \"package.json\");\n if (!fs.existsSync(p)) continue;\n try {\n const pkg = JSON.parse(fs.readFileSync(p, \"utf-8\"));\n if (pkg?.name === packageName)\n return { packageName, packageDir: fs.realpathSync(c) };\n } catch {\n // ignore malformed package.json\n }\n }\n }\n return null;\n}\n\n/** Escape a string so it can be embedded as a regex literal. */\nfunction escapeRegex(s: string): string {\n return s.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n}\n\n/** Check if a package is installed in the project */\nfunction hasDep(pkg: string, cwd: string): boolean {\n try {\n const pkgJson = JSON.parse(\n fs.readFileSync(path.join(cwd, \"package.json\"), \"utf-8\"),\n );\n return !!(\n pkgJson.dependencies?.[pkg] ||\n pkgJson.devDependencies?.[pkg] ||\n pkgJson.peerDependencies?.[pkg]\n );\n } catch {\n return false;\n }\n}\n\n/**\n * Build the `resolve.dedupe` list dynamically. Reads core's package.json and\n * collects every peerDependency that the consuming app also declares. This\n * ensures Vite resolves them from the app root, not from core's own\n * node_modules — preventing duplicate React context / singleton issues.\n */\nfunction getClientDedupe(cwd: string): string[] {\n // Always dedupe React internals (sub-path exports aren't in peerDeps)\n const always = new Set([\"react\", \"react-dom\", \"react-dom/client\"]);\n\n // Server-only packages that never run in the browser — no point deduping.\n const serverOnly = new Set([\n \"drizzle-kit\",\n \"node-pty\",\n \"postgres\",\n \"ws\",\n \"typescript\",\n \"vite\",\n \"@vitejs/plugin-react-swc\",\n \"tailwindcss\",\n \"@tailwindcss/vite\",\n ]);\n\n try {\n const corePkgPath = path.resolve(__dirname, \"../../package.json\");\n const corePkg = JSON.parse(fs.readFileSync(corePkgPath, \"utf-8\"));\n\n // Scan both peerDependencies and dependencies. Direct deps like\n // @radix-ui/* use React internally — they must resolve against the\n // app's React, not a second copy inside core's node_modules.\n const coreDeps = new Set([\n ...Object.keys(corePkg.peerDependencies ?? {}),\n ...Object.keys(corePkg.dependencies ?? {}),\n ]);\n\n // Read the consuming app's dependencies\n const appPkg = JSON.parse(\n fs.readFileSync(path.join(cwd, \"package.json\"), \"utf-8\"),\n );\n const appDeps = new Set([\n ...Object.keys(appPkg.dependencies ?? {}),\n ...Object.keys(appPkg.devDependencies ?? {}),\n ]);\n\n for (const dep of coreDeps) {\n if (serverOnly.has(dep)) continue;\n // Dedupe if the app also declares it, OR if it's a React-based\n // UI library (Radix, Tanstack) that must share the app's React.\n if (\n appDeps.has(dep) ||\n dep.startsWith(\"@radix-ui/\") ||\n dep.startsWith(\"@tanstack/\")\n ) {\n always.add(dep);\n }\n }\n } catch {\n // Can't read package.json — fall back to known singletons\n }\n\n return [...always];\n}\n\nfunction getDefaultOptimizeDeps(cwd: string): string[] {\n const entries: Array<{ specifier: string; packageName?: string }> = [\n { specifier: \"@agent-native/core\" },\n {\n specifier: \"@agent-native/core/client\",\n packageName: \"@agent-native/core\",\n },\n {\n specifier: \"@agent-native/core/client/org\",\n packageName: \"@agent-native/core\",\n },\n {\n specifier: \"@agent-native/core/client/tools\",\n packageName: \"@agent-native/core\",\n },\n { specifier: \"@libsql/client\" },\n { specifier: \"@radix-ui/react-accordion\" },\n { specifier: \"@radix-ui/react-alert-dialog\" },\n { specifier: \"@radix-ui/react-avatar\" },\n { specifier: \"@radix-ui/react-checkbox\" },\n { specifier: \"@radix-ui/react-collapsible\" },\n { specifier: \"@radix-ui/react-context-menu\" },\n { specifier: \"@radix-ui/react-dialog\" },\n { specifier: \"@radix-ui/react-dropdown-menu\" },\n { specifier: \"@radix-ui/react-hover-card\" },\n { specifier: \"@radix-ui/react-label\" },\n { specifier: \"@radix-ui/react-menubar\" },\n { specifier: \"@radix-ui/react-navigation-menu\" },\n { specifier: \"@radix-ui/react-popover\" },\n { specifier: \"@radix-ui/react-progress\" },\n { specifier: \"@radix-ui/react-radio-group\" },\n { specifier: \"@radix-ui/react-scroll-area\" },\n { specifier: \"@radix-ui/react-select\" },\n { specifier: \"@radix-ui/react-separator\" },\n { specifier: \"@radix-ui/react-slider\" },\n { specifier: \"@radix-ui/react-slot\" },\n { specifier: \"@radix-ui/react-switch\" },\n { specifier: \"@radix-ui/react-tabs\" },\n { specifier: \"@radix-ui/react-toast\" },\n { specifier: \"@radix-ui/react-toggle\" },\n { specifier: \"@radix-ui/react-toggle-group\" },\n { specifier: \"@radix-ui/react-tooltip\" },\n { specifier: \"@tanstack/react-query\" },\n { specifier: \"@tabler/icons-react\" },\n { specifier: \"class-variance-authority\" },\n { specifier: \"clsx\" },\n { specifier: \"cmdk\" },\n { specifier: \"drizzle-orm\" },\n { specifier: \"drizzle-orm/pg-core\", packageName: \"drizzle-orm\" },\n { specifier: \"drizzle-orm/sqlite-core\", packageName: \"drizzle-orm\" },\n { specifier: \"h3\" },\n { specifier: \"next-themes\" },\n { specifier: \"react-hook-form\" },\n { specifier: \"sonner\" },\n { specifier: \"tailwind-merge\" },\n { specifier: \"zod\" },\n ];\n\n return entries\n .filter(({ specifier, packageName }) =>\n hasDep(packageName ?? specifier, cwd),\n )\n .map(({ specifier }) => specifier);\n}\n\n/**\n * In monorepo dev mode, resolve @agent-native/core imports to source (src/)\n * instead of dist/ so that Vite HMR picks up changes without rebuilding.\n *\n * Returns Vite array-style aliases with exact matching (regex anchored with $)\n * to prevent `@agent-native/core` from prefix-matching and swallowing\n * sub-path imports like `@agent-native/core/client`.\n */\nfunction getCoreSourceAliases(\n cwd: string,\n): Array<{ find: RegExp; replacement: string }> {\n // Detect monorepo: walk up to find packages/core/src/\n const candidates = [\n path.resolve(cwd, \"../../packages/core\"), // templates/<name>/\n path.resolve(cwd, \"../core\"), // packages/<name>/\n ];\n\n let coreSrc = \"\";\n for (const candidate of candidates) {\n if (fs.existsSync(path.join(candidate, \"src/index.ts\"))) {\n coreSrc = path.join(candidate, \"src\");\n break;\n }\n }\n\n if (!coreSrc) return []; // Not in monorepo — use dist as normal\n\n // Map every @agent-native/core/* export to its src/ equivalent.\n // Each entry uses a regex with $ anchor for exact matching.\n const entries: Record<string, string> = {\n \"@agent-native/core\": path.join(coreSrc, \"index.browser.ts\"),\n \"@agent-native/core/server\": path.join(coreSrc, \"server/index.ts\"),\n \"@agent-native/core/client\": path.join(coreSrc, \"client/index.ts\"),\n \"@agent-native/core/client/tools\": path.join(\n coreSrc,\n \"client/tools/index.ts\",\n ),\n \"@agent-native/core/client/org\": path.join(coreSrc, \"client/org/index.ts\"),\n \"@agent-native/core/client/observability\": path.join(\n coreSrc,\n \"client/observability/index.ts\",\n ),\n \"@agent-native/core/client/onboarding\": path.join(\n coreSrc,\n \"client/onboarding/index.ts\",\n ),\n \"@agent-native/core/client/sharing\": path.join(\n coreSrc,\n \"client/sharing/index.ts\",\n ),\n \"@agent-native/core/client/notifications\": path.join(\n coreSrc,\n \"client/notifications/index.ts\",\n ),\n \"@agent-native/core/client/progress\": path.join(\n coreSrc,\n \"client/progress/index.ts\",\n ),\n \"@agent-native/core/db\": path.join(coreSrc, \"db/index.ts\"),\n \"@agent-native/core/db/schema\": path.join(coreSrc, \"db/schema.ts\"),\n \"@agent-native/core/shared\": path.join(coreSrc, \"shared/index.ts\"),\n \"@agent-native/core/scripts\": path.join(coreSrc, \"scripts/index.ts\"),\n \"@agent-native/core/application-state\": path.join(\n coreSrc,\n \"application-state/index.ts\",\n ),\n \"@agent-native/core/settings\": path.join(coreSrc, \"settings/index.ts\"),\n \"@agent-native/core/credentials\": path.join(\n coreSrc,\n \"credentials/index.ts\",\n ),\n \"@agent-native/core/resources\": path.join(coreSrc, \"resources/index.ts\"),\n \"@agent-native/core/oauth-tokens\": path.join(\n coreSrc,\n \"oauth-tokens/index.ts\",\n ),\n \"@agent-native/core/a2a\": path.join(coreSrc, \"a2a/index.ts\"),\n \"@agent-native/core/router\": path.join(coreSrc, \"router/index.ts\"),\n \"@agent-native/core/terminal\": path.join(\n coreSrc,\n \"client/terminal/index.ts\",\n ),\n \"@agent-native/core/terminal/server\": path.join(\n coreSrc,\n \"terminal/index.ts\",\n ),\n \"@agent-native/core/adapters/cli\": path.join(\n coreSrc,\n \"adapters/cli/index.ts\",\n ),\n };\n\n // Escape special regex chars in the key and anchor with $\n return Object.entries(entries).map(([find, replacement]) => ({\n find: new RegExp(`^${find.replace(/[/]/g, \"\\\\/\")}$`),\n replacement,\n }));\n}\n\nexport interface NitroOptions {\n /** Nitro deployment preset (e.g. \"node\", \"vercel\", \"netlify\", \"cloudflare_pages\"). Default: \"node\" */\n preset?: string;\n /** Source directory for server files. Default: \"./server\" */\n srcDir?: string;\n /** Routes directory name (relative to srcDir). Default: \"routes\" */\n routesDir?: string;\n /** Any additional Nitro config overrides */\n [key: string]: unknown;\n}\n\nexport interface ClientConfigOptions {\n /** Port for dev server. Default: 8080 */\n port?: number;\n /** Additional Vite plugins */\n plugins?: any[];\n /** Nitro plugin options (preset, srcDir, etc) */\n nitro?: NitroOptions;\n /** Override resolve aliases */\n aliases?: Record<string, string>;\n /** Override build.outDir. Default: \"dist/spa\" */\n outDir?: string;\n /** Additional fs.allow paths */\n fsAllow?: string[];\n /** Additional fs.deny patterns */\n fsDeny?: string[];\n /** Additional Vite optimizeDeps configuration */\n optimizeDeps?: { include?: string[]; exclude?: string[] };\n /**\n * Whether to auto-inject the Tailwind v4 Vite plugin (`@tailwindcss/vite`).\n * Defaults to true — set to `false` if a template wants to manage Tailwind\n * itself (e.g. the legacy v3 PostCSS pipeline).\n */\n tailwind?: boolean;\n /**\n * Package names to stub in the SSR bundle with an empty proxy object.\n *\n * Use this for dependencies that only run in the browser (canvas / diagram\n * libraries, editors, WebGL) but would otherwise get pulled into the\n * server bundle via SSR's noExternal policy — pushing the CF Pages\n * Functions bundle over the 25 MiB limit.\n *\n * Only add packages that are provably never called during SSR. If the\n * server imports one, it will receive a Proxy that throws on any real\n * use (which is better than bundling a 10 MiB dep the worker never calls).\n *\n * @example\n * ssrStubs: [\"mermaid\", \"@excalidraw/excalidraw\"]\n */\n ssrStubs?: string[];\n /**\n * @deprecated Pass `reactRouter()` directly in the `plugins` array instead.\n * Previously used to auto-load the React Router Vite plugin via require(),\n * but this fails in ESM contexts. Templates should now do:\n * ```ts\n * import { reactRouter } from \"@react-router/dev/vite\";\n * defineConfig({ plugins: [reactRouter()] })\n * ```\n */\n reactRouter?: boolean | Record<string, unknown>;\n}\n\n/**\n * Vite plugin that recovers the page when Vite's dependency optimizer\n * invalidates modules mid-load (the \"504 Outdated Optimize Dep\" error).\n *\n * Without this, the page silently fails: <script type=\"module\"> tags 504,\n * React never mounts, and the user is stuck on a blank screen until they\n * manually refresh. We catch the failure modes and auto-reload, with a\n * visible overlay so the user knows what's happening, and a loop guard\n * so we never thrash forever.\n *\n * CRITICAL: this must be a SYNCHRONOUS (non-module) script injected at\n * `head-prepend`. Module scripts are deferred — the browser starts fetching\n * all module scripts in parallel during HTML parsing, so a module listener\n * registers AFTER sibling modules have already started loading and\n * possibly errored out. A regular <script> blocks parsing and runs\n * synchronously, so the listener is registered before ANY module fetch\n * begins.\n *\n * Catches two failure modes (both window-level, no HMR needed):\n * 1. <script type=\"module\"> / <link> 504 — window \"error\" event, capture phase\n * 2. Dynamic import 504 — \"unhandledrejection\" with \"dynamically imported module\"\n */\nfunction autoReloadOnOptimizeDep(): Plugin {\n return {\n name: \"agent-native-auto-reload-optimize-dep\",\n apply: \"serve\",\n transformIndexHtml() {\n return [\n {\n tag: \"script\",\n // NOTE: no `type: \"module\"` — this must be a synchronous script.\n children: `\n(function() {\n var RELOAD_KEY = \"__an_optimize_reload\";\n var MAX_RELOADS = 3;\n var RESET_AFTER_MS = 8000;\n\n var reloadTimer = null;\n var overlayShown = false;\n\n // Track recent reloads in sessionStorage. If we reload too many times\n // in a short window, stop and show a manual-refresh message instead of\n // looping forever.\n function readReloadHistory() {\n try {\n var raw = sessionStorage.getItem(RELOAD_KEY);\n if (!raw) return [];\n var arr = JSON.parse(raw);\n var cutoff = Date.now() - 30000;\n return Array.isArray(arr) ? arr.filter(function(t) { return t > cutoff; }) : [];\n } catch (e) { return []; }\n }\n function recordReload() {\n try {\n var history = readReloadHistory();\n history.push(Date.now());\n sessionStorage.setItem(RELOAD_KEY, JSON.stringify(history));\n } catch (e) {}\n }\n // Reset the counter after a stable period (page didn't fail again).\n setTimeout(function() {\n try { sessionStorage.removeItem(RELOAD_KEY); } catch (e) {}\n }, RESET_AFTER_MS);\n\n function showOverlay(title, subtitle) {\n if (overlayShown) return;\n overlayShown = true;\n var mount = function() {\n if (!document.body) { setTimeout(mount, 16); return; }\n var el = document.createElement(\"div\");\n el.id = \"__an-reload-overlay\";\n el.style.cssText = [\n \"position:fixed\",\"inset:0\",\"z-index:2147483647\",\n \"display:flex\",\"align-items:center\",\"justify-content:center\",\n \"background:rgba(0,0,0,0.6)\",\"backdrop-filter:blur(8px)\",\n \"-webkit-backdrop-filter:blur(8px)\",\n \"font-family:-apple-system,BlinkMacSystemFont,system-ui,sans-serif\",\n \"color:#fff\",\"font-size:14px\"\n ].join(\";\");\n el.innerHTML =\n '<div style=\"background:#171717;padding:20px 24px;border-radius:12px;' +\n 'border:1px solid rgba(255,255,255,0.1);max-width:340px;text-align:center;' +\n 'box-shadow:0 20px 60px rgba(0,0,0,0.5)\">' +\n '<div style=\"font-weight:600;margin-bottom:6px\">' + title + '</div>' +\n '<div style=\"font-size:12px;opacity:0.7\">' + subtitle + '</div>' +\n '</div>';\n document.body.appendChild(el);\n };\n mount();\n }\n\n function scheduleReload(reason) {\n if (reloadTimer) return;\n var history = readReloadHistory();\n if (history.length >= MAX_RELOADS) {\n console.warn(\"[agent-native] Dev server keeps re-bundling. Manual refresh needed.\", reason);\n showOverlay(\n \"Dev server out of sync\",\n \"Auto-reload gave up after \" + MAX_RELOADS + \" tries. Refresh the page (\\u2318R / Ctrl+R).\"\n );\n return;\n }\n console.log(\"[agent-native] Vite re-bundled deps (\" + reason + \"), reloading\\u2026\");\n recordReload();\n // First reload is silent — one refresh almost always fixes it and the\n // overlay flash is more disruptive than the reload itself. Only show\n // the overlay starting on the second attempt, when something is clearly\n // taking longer than expected.\n if (history.length >= 1) {\n showOverlay(\"Updating dev server\\u2026\", \"Reloading the page\");\n }\n reloadTimer = setTimeout(function() { window.location.reload(); }, 300);\n }\n\n function looksLikeViteDep(url) {\n if (!url) return false;\n // Only treat same-origin URLs as Vite deps — don't reload the page\n // because some third-party CDN script 404'd.\n try {\n var u = new URL(url, window.location.href);\n if (u.origin !== window.location.origin) return false;\n } catch (e) { return false; }\n return url.indexOf(\"/node_modules/.vite/deps/\") !== -1\n || url.indexOf(\"/@fs/\") !== -1\n || url.indexOf(\"/@id/\") !== -1\n || url.indexOf(\"?v=\") !== -1\n || url.indexOf(\"?import\") !== -1\n || /\\\\.(m?js|ts|tsx|jsx)(\\\\?|$)/.test(url);\n }\n\n // 1) <script type=\"module\"> / <link> 504 — fires on the element, not window,\n // so we use capture phase to catch resource load errors.\n window.addEventListener(\"error\", function(e) {\n var t = e.target;\n if (!t || t === window) return;\n var tag = t.tagName;\n if (tag !== \"SCRIPT\" && tag !== \"LINK\") return;\n var url = t.src || t.href || \"\";\n if (looksLikeViteDep(url)) {\n var name = url.split(\"/\").pop();\n scheduleReload(\"script 504: \" + name);\n }\n }, true);\n\n // 2) Dynamic import failures (React Router code splitting, lazy components)\n window.addEventListener(\"unhandledrejection\", function(e) {\n var msg = String((e.reason && (e.reason.message || e.reason)) || \"\");\n if (\n msg.indexOf(\"Failed to fetch dynamically imported module\") !== -1 ||\n msg.indexOf(\"error loading dynamically imported module\") !== -1 ||\n msg.indexOf(\"Importing a module script failed\") !== -1 ||\n msg.indexOf(\"Outdated Optimize Dep\") !== -1 ||\n (msg.indexOf(\"504\") !== -1 && msg.indexOf(\".vite/deps\") !== -1)\n ) {\n scheduleReload(\"dynamic import\");\n }\n });\n})();`,\n injectTo: \"head-prepend\",\n },\n ];\n },\n };\n}\n\n/**\n * Vite plugin that prevents the built-in base middleware from redirecting\n * \"/\" → \"/app/\" (or whatever the base is). When agent-native apps run with\n * --base /app/ in single-port mode, Vite's baseMiddleware sends a 302 from\n * \"/\" to the base path. This breaks Electron webview and iframe embeds\n * that load the app at the root. Instead, we rewrite \"/\" to the base path\n * internally so the app serves without a visible redirect.\n */\nfunction baseRedirectGuard(): Plugin {\n return {\n name: \"agent-native-base-redirect-guard\",\n apply: \"serve\",\n configureServer(server) {\n // Return a function so the middleware is added AFTER Vite's internal\n // middleware is built — but we insert BEFORE by using the pre-hook\n // approach: configureServer hooks that return nothing run before\n // internal middleware.\n server.middlewares.use((req, res, next) => {\n const base = server.config.base;\n if (base && base !== \"/\" && req.url?.startsWith(base)) {\n const relativeUrl = req.url.slice(base.length - 1);\n try {\n const url = new URL(relativeUrl, \"http://agent-native.local\");\n const publicDir = server.config.publicDir;\n if (typeof publicDir !== \"string\") {\n return next();\n }\n const publicPath = path.normalize(\n path.join(publicDir, decodeURIComponent(url.pathname)),\n );\n if (\n publicPath.startsWith(publicDir + path.sep) &&\n fs.existsSync(publicPath) &&\n fs.statSync(publicPath).isFile()\n ) {\n const contentType = contentTypeForPublicFile(publicPath);\n if (contentType) res.setHeader(\"content-type\", contentType);\n if (req.method === \"HEAD\") {\n res.statusCode = 200;\n res.end();\n return;\n }\n fs.createReadStream(publicPath).pipe(res);\n return;\n }\n } catch {\n // Fall through to Vite/Nitro. Malformed URLs should keep their\n // original path so the normal dev-server error handling applies.\n }\n }\n req.url = stripMountedDevApiPath(req.url, base);\n if (\n req.method === \"HEAD\" &&\n req.url &&\n !isFrameworkDevPath(req.url, base)\n ) {\n req.method = \"GET\";\n }\n if (\n base &&\n base !== \"/\" &&\n (req.url === \"/\" || req.url === \"/index.html\")\n ) {\n // Rewrite to the base path so Vite serves the app directly\n req.url = base;\n }\n next();\n });\n },\n };\n}\n\nfunction contentTypeForPublicFile(filePath: string): string | null {\n switch (path.extname(filePath).toLowerCase()) {\n case \".css\":\n return \"text/css\";\n case \".html\":\n return \"text/html\";\n case \".ico\":\n return \"image/x-icon\";\n case \".json\":\n case \".webmanifest\":\n return \"application/json\";\n case \".js\":\n case \".mjs\":\n return \"text/javascript\";\n case \".png\":\n return \"image/png\";\n case \".svg\":\n return \"image/svg+xml\";\n case \".txt\":\n return \"text/plain\";\n case \".xml\":\n return \"application/xml\";\n default:\n return null;\n }\n}\n\nfunction devPathname(reqUrl: string): string {\n return new URL(reqUrl, \"http://agent-native.local\").pathname;\n}\n\nfunction isApiDevPath(reqUrl: string): boolean {\n const pathname = devPathname(reqUrl);\n return pathname === \"/api\" || pathname.startsWith(\"/api/\");\n}\n\nexport function stripMountedDevApiPath(\n reqUrl: string | undefined,\n base: string | undefined,\n): string | undefined {\n if (!reqUrl || !base || base === \"/\") return reqUrl;\n const normalizedBase = base.endsWith(\"/\") ? base : `${base}/`;\n if (!reqUrl.startsWith(normalizedBase)) return reqUrl;\n const stripped = reqUrl.slice(normalizedBase.length - 1) || \"/\";\n return isApiDevPath(stripped) ? stripped : reqUrl;\n}\n\nexport function isFrameworkDevPath(\n reqUrl: string,\n base: string | undefined,\n): boolean {\n const pathname = devPathname(reqUrl);\n if (pathname === \"/_agent-native\" || pathname.startsWith(\"/_agent-native/\")) {\n return true;\n }\n if (!base || base === \"/\") return false;\n const normalizedBase = base.endsWith(\"/\") ? base.slice(0, -1) : base;\n return (\n pathname === `${normalizedBase}/_agent-native` ||\n pathname.startsWith(`${normalizedBase}/_agent-native/`)\n );\n}\n\n/**\n * Work around a Rolldown bug where Nitro passes service entries as objects\n * ({index: \"path\"}) but Rolldown expects strings. This plugin normalizes\n * rollupOptions.input entries in the SSR environment.\n */\nfunction rolldownInputFix(): Plugin {\n return {\n name: \"agent-native-rolldown-input-fix\",\n configEnvironment(name, config) {\n const input = config.build?.rollupOptions?.input;\n if (!Array.isArray(input)) return;\n // Flatten any object entries to just their string values\n const fixed = input.map((entry: any) => {\n if (typeof entry === \"string\") return entry;\n if (typeof entry === \"object\" && entry !== null) {\n const values = Object.values(entry);\n return values[0] as string;\n }\n return entry;\n });\n config.build!.rollupOptions!.input = fixed;\n },\n };\n}\n\n/**\n * Expose the resolved Vite dev server port as process.env.PORT so that\n * in-process scripts (which use localFetch → http://localhost:${PORT}/api/...)\n * hit the right address even when Vite auto-increments the port.\n */\n/**\n * Replace caller-specified packages with an empty proxy stub during SSR\n * builds. For apps whose heavy browser-only deps would otherwise bloat the\n * edge worker past CF Pages' 25 MiB Functions limit.\n *\n * The template lists the packages in its `defineConfig({ ssrStubs })` call —\n * the framework never hardcodes package names.\n */\nfunction ssrStubPlugin(packages: string[]): Plugin | null {\n if (!packages.length) return null;\n const stubbed = new Set(packages);\n const STUB_ID = \"\\0agent-native-ssr-stub\";\n return {\n name: \"agent-native-ssr-stub-heavy-libs\",\n enforce: \"pre\",\n resolveId(id, _importer, opts) {\n if (!opts?.ssr) return null;\n // Match the bare package name or any subpath\n const pkg = id\n .split(\"/\")\n .slice(0, id.startsWith(\"@\") ? 2 : 1)\n .join(\"/\");\n if (stubbed.has(pkg)) return STUB_ID;\n return null;\n },\n load(id) {\n if (id !== STUB_ID) return null;\n // Proxy that answers any property access with itself — lets dead\n // import/re-export chains parse without blowing up, and still throws\n // if code actually tries to call any of it on the server.\n return (\n \"const handler = { get(_, p) { \" +\n \"if (p === Symbol.toPrimitive) return () => ''; \" +\n \"if (p === 'then') return undefined; \" +\n \"return new Proxy(() => {}, handler); \" +\n \"} };\" +\n \"const stub = new Proxy(() => {}, handler);\" +\n \"export default stub;\"\n );\n },\n };\n}\n\nfunction portExposer(): Plugin {\n return {\n name: \"agent-native-port-exposer\",\n apply: \"serve\",\n configureServer(server) {\n server.httpServer?.once(\"listening\", () => {\n const addr = server.httpServer?.address();\n if (addr && typeof addr === \"object\" && addr.port) {\n process.env.PORT = String(addr.port); // guard:allow-env-mutation — Vite dev server port published once at boot before any request\n }\n });\n },\n };\n}\n\n/**\n * Silence benign `read ECONNRESET` noise from Vite's dev middleware.\n * Fires when a browser closes/reloads/navigates mid-request — the peer has\n * already gone away, there's nothing to fix, and Vite's error middleware\n * spams the terminal with \"Internal server error: read ECONNRESET\". Our H3\n * server layer already swallows this (create-server.ts onError); this plugin\n * does the same for Vite's own connect pipeline.\n */\nfunction silenceConnectionResets(): Plugin {\n const isBenign = (err: unknown) => {\n const e = err as NodeJS.ErrnoException | undefined;\n const code = e?.code || (e?.cause as NodeJS.ErrnoException)?.code;\n return (\n code === \"ECONNRESET\" ||\n code === \"ECONNABORTED\" ||\n code === \"EPIPE\" ||\n e?.message === \"aborted\"\n );\n };\n return {\n name: \"agent-native-silence-connection-resets\",\n apply: \"serve\",\n configureServer(server) {\n // Swallow socket-level resets so Node doesn't surface them as uncaught.\n server.httpServer?.on(\"connection\", (socket) => {\n socket.on(\"error\", (err) => {\n if (!isBenign(err)) throw err;\n });\n });\n // Drop Vite's \"Internal server error: read ECONNRESET\" log lines.\n const origError = server.config.logger.error.bind(server.config.logger);\n server.config.logger.error = (msg, opts) => {\n const text = typeof msg === \"string\" ? msg : String(msg ?? \"\");\n if (\n (opts?.error && isBenign(opts.error)) ||\n /Internal server error:\\s*(read ECONNRESET|aborted|EPIPE)/i.test(text)\n ) {\n return;\n }\n origError(msg, opts);\n };\n },\n };\n}\n\n/**\n * Create the client Vite config with sensible agent-native defaults.\n * Supports two modes:\n * - Legacy SPA mode (default): React SWC plugin, client-only routing\n * - React Router framework mode: SSR-capable with file-based routing\n *\n * Both modes include Nitro for API routes, path aliases, and fs restrictions.\n */\nexport function defineConfig(options: ClientConfigOptions = {}): UserConfig {\n // Check if React Router plugin was passed directly in plugins array\n const hasReactRouterPlugin = options.plugins?.some(\n (p: any) =>\n p?.name === \"react-router\" ||\n (Array.isArray(p) && p.some((pp: any) => pp?.name === \"react-router\")),\n );\n\n let reactTransformPlugin: any;\n\n if (!hasReactRouterPlugin && !options.reactRouter) {\n // Legacy SPA mode — use React SWC plugin (only when React Router is not used)\n try {\n reactTransformPlugin = require(\"@vitejs/plugin-react-swc\");\n if (reactTransformPlugin.default)\n reactTransformPlugin = reactTransformPlugin.default;\n } catch {\n // Will be resolved at runtime by Vite\n }\n }\n\n const cwd = process.cwd();\n\n // Workspace env fallback. If this app is inside a workspace, tell Vite to\n // also look for .env files at the workspace root. Per-app .env still wins\n // (Vite's loadEnv merges in precedence order — app dir is loaded after).\n const workspaceRoot = findWorkspaceRoot(cwd);\n const envDir = workspaceRoot && workspaceRoot !== cwd ? workspaceRoot : cwd;\n\n // Preload workspace-root .env into process.env so Nitro server code sees\n // shared keys during dev (Nitro reads process.env, not vite's envDir).\n if (workspaceRoot && workspaceRoot !== cwd) {\n try {\n const dotenv = require(\"dotenv\");\n dotenv.config({\n path: path.join(workspaceRoot, \".env\"),\n override: false,\n // Suppress the dotenv v17 tip line — this loader fires alongside\n // utils.ts loadEnv() during dev startup and would otherwise emit a\n // duplicate \"[dotenv] injecting env\" message.\n quiet: true,\n });\n } catch {}\n }\n\n // Build the React transform plugin (only for legacy SPA mode)\n const reactPluginInstance = reactTransformPlugin?.();\n\n // Auto-inject the Tailwind v4 Vite plugin if `@tailwindcss/vite` is\n // installed (which it is by default for all agent-native templates).\n // Templates can opt out by setting `options.tailwind = false`.\n let tailwindPluginInstance: any = null;\n if (options.tailwind !== false) {\n try {\n let tailwindPlugin = require(\"@tailwindcss/vite\");\n if (tailwindPlugin.default) tailwindPlugin = tailwindPlugin.default;\n tailwindPluginInstance = tailwindPlugin();\n } catch {\n // Plugin not installed — silently skip. Old templates may still be on v3.\n }\n }\n\n // APP_BASE_PATH lets this app be mounted under a prefix (e.g. \"/mail\") as\n // part of a unified workspace deploy. Defaults to \"/\" for standalone apps.\n const appBasePath =\n process.env.VITE_APP_BASE_PATH || process.env.APP_BASE_PATH || \"/\";\n const base = appBasePath.endsWith(\"/\") ? appBasePath : `${appBasePath}/`;\n const monorepoCoreAllow = [\n path.resolve(cwd, \"../../packages/core\"),\n path.resolve(cwd, \"../core\"),\n ].filter((candidate) => fs.existsSync(path.join(candidate, \"package.json\")));\n\n // Workspace-core (enterprise monorepo): pull its directory into Vite's\n // file watcher + module graph so edits to its TS sources hot-reload the\n // dev server, and its package name into ssr.noExternal so the dynamic\n // import in framework-request-handler.ts goes through Vite's transform\n // pipeline (TypeScript, SSR HMR, the works).\n const workspaceCore = findWorkspaceCoreSync(cwd);\n const workspaceCoreFsAllow = workspaceCore ? [workspaceCore.packageDir] : [];\n const workspaceCoreNoExternal = workspaceCore\n ? [new RegExp(`^${escapeRegex(workspaceCore.packageName)}(/.*)?$`)]\n : [];\n\n return {\n envDir,\n base,\n server: {\n host: \"::\",\n port: options.port ?? 8080,\n fs: {\n allow: [\n \".\",\n ...monorepoCoreAllow,\n ...workspaceCoreFsAllow,\n ...(options.fsAllow ?? []),\n ],\n deny: [\n \".env\",\n \".env.*\",\n \"*.{crt,pem}\",\n \"**/.git/**\",\n ...(options.fsDeny ?? []),\n ],\n },\n },\n build: {\n outDir: options.outDir ?? \"dist/spa\",\n // Safari 18+ so esbuild's CSS minifier keeps the standard\n // backdrop-filter. Targeting older Safari caused it to drop the\n // unprefixed version (Safari only got unprefixed backdrop-filter in\n // 18.0, Sept 2024) and keep just -webkit-backdrop-filter, which broke\n // the blur in prod where the unprefixed form was expected.\n cssTarget: [\"es2020\", \"safari18\"],\n },\n // Bundle all non-Node.js deps into the production SSR server build.\n // Edge runtimes (CF Workers, Deno) don't have node_modules at runtime.\n // In dev, React Router's Vite Environment runner expects CJS packages\n // like React to stay external; forcing them through the module runner\n // raises `module is not defined`.\n ssr: process.argv.includes(\"build\")\n ? {\n noExternal: /^(?!node:)/,\n // Pick the workspace-core's compiled `dist/` exports in prod —\n // Node-style `default` condition matches what edge runtimes (CF\n // Workers, Deno) can actually load. Without this, Vite's prod\n // build inherits the dev-condition src/ entry and ships unbuilt\n // TypeScript into the worker.\n resolve: {\n conditions: [\"node\", \"module\", \"import\", \"default\"],\n externalConditions: [\"node\", \"module\", \"import\", \"default\"],\n },\n }\n : {\n // Vite already sets `development` in the dev resolve conditions,\n // so the workspace-core template's exports.development → src/\n // entry is picked automatically — Vite handles TS compilation\n // and triggers a server restart when those files change.\n noExternal: [\n /^@agent-native\\/core(\\/.*)?$/,\n // scheduling ships tsc-compiled dist files that contain literal\n // `@/` path-alias imports (e.g. `import { Input } from\n // \"@/components/ui/input\"`). In standalone (published) mode Node\n // treats the package as an external CJS dep and can't resolve\n // `@/components`. Adding it to noExternal makes Vite process it\n // through the module pipeline, where the consumer app's `@` →\n // `./app` alias is already registered.\n ...(hasDep(\"@agent-native/scheduling\", cwd)\n ? [/^@agent-native\\/scheduling(\\/.*)?$/]\n : []),\n ...workspaceCoreNoExternal,\n ],\n external: [\n \"react\",\n \"react-dom\",\n \"react-dom/server\",\n \"react-router\",\n \"react-router/dom\",\n \"react-router-dom\",\n ],\n },\n plugins: [\n // Stub packages from `options.ssrStubs` in the SSR bundle so they\n // don't bloat the edge worker. Opt-in per template — the framework\n // hardcodes nothing (e.g. docs sites legitimately import `shiki` on\n // the server, so we can't blanket-stub it here).\n ...(() => {\n const p = ssrStubPlugin(options.ssrStubs ?? []);\n return p ? [p] : [];\n })(),\n ...(options.plugins ?? []),\n actionTypesPlugin(),\n agentsBundlePlugin(),\n autoReloadOnOptimizeDep(),\n baseRedirectGuard(),\n portExposer(),\n silenceConnectionResets(),\n rolldownInputFix(),\n // Nitro Vite plugin for dev-mode API route serving and HMR.\n // Disabled during build — React Router's build handles production.\n ...(process.argv.includes(\"build\")\n ? []\n : [\n nitroVitePlugin({\n serverDir: \"./server\",\n ...(options.nitro ?? {}),\n } as any),\n ]),\n reactPluginInstance,\n tailwindPluginInstance,\n ].filter(Boolean),\n optimizeDeps: {\n include: [\n ...getDefaultOptimizeDeps(cwd),\n ...(hasDep(\"@agent-native/pinpoint\", cwd)\n ? [\"@agent-native/pinpoint/react\"]\n : []),\n ...(options.optimizeDeps?.include ?? []),\n ],\n ...(options.optimizeDeps?.exclude\n ? { exclude: options.optimizeDeps.exclude }\n : {}),\n },\n resolve: {\n // Dedupe all client-side packages that core shares with the consuming\n // app. In pnpm monorepos, core's devDependencies can install separate\n // copies (linked to different React versions). Without deduping, each\n // copy creates its own React context — QueryClientProvider, RouterProvider,\n // Radix, etc. — causing \"No provider\" crashes at runtime.\n dedupe: getClientDedupe(cwd),\n alias: [\n // In monorepo dev: resolve @agent-native/core to source for HMR.\n // Uses regex with $ anchor for exact matching to prevent\n // @agent-native/core from prefix-matching @agent-native/core/client.\n ...getCoreSourceAliases(cwd),\n // Standard path aliases (prefix matching is fine here)\n { find: \"@\", replacement: path.resolve(cwd, \"./app\") },\n { find: \"@shared\", replacement: path.resolve(cwd, \"./shared\") },\n ...Object.entries(options.aliases ?? {}).map(([find, replacement]) => ({\n find,\n replacement,\n })),\n ],\n },\n };\n}\n"]}
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/vite/client.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAEvC,OAAO,EAAE,KAAK,IAAI,eAAe,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAA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AAO,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,WAAW,CAAC,EAAE,EAAE,CAAC,CAAC;oBACrE,IAAI;oBACJ,WAAW;iBACZ,CAAC,CAAC;aACJ;SACF;KACF,CAAC;AACJ,CAAC","sourcesContent":["import path from \"path\";\nimport fs from \"fs\";\nimport { createRequire } from \"module\";\nimport type { Plugin, UserConfig } from \"vite\";\nimport { nitro as nitroVitePlugin } from \"nitro/vite\";\nimport { actionTypesPlugin } from \"./action-types-plugin.js\";\nimport { agentsBundlePlugin } from \"./agents-bundle-plugin.js\";\nimport { findWorkspaceRoot } from \"../scripts/utils.js\";\n\nimport { fileURLToPath } from \"url\";\n\nconst require = createRequire(import.meta.url);\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\n\n/**\n * Sync discovery for the workspace-core in an enterprise monorepo.\n *\n * Mirrors `getWorkspaceCoreExports` in deploy/workspace-core.ts but stays\n * synchronous so it can run inline in `defineConfig`. Returns the workspace\n * core's package name + absolute directory, or null if no workspace core is\n * declared in the ancestor chain.\n *\n * Walks up from `startDir` looking for a package.json with\n * `agent-native.workspaceCore`. Resolves the declared package name through\n * `<workspaceRoot>/node_modules/<name>` (pnpm symlink, fastest) or by\n * scanning `packages/*` for a matching `name` field (fallback for\n * pre-install scenarios).\n */\nfunction findWorkspaceCoreSync(\n startDir: string,\n): { packageName: string; packageDir: string } | null {\n // 1) Walk up looking for the root package.json that declares workspaceCore.\n let dir = path.resolve(startDir);\n let workspaceRoot: string | null = null;\n let packageName: string | null = null;\n for (let i = 0; i < 20; i++) {\n const pkgPath = path.join(dir, \"package.json\");\n if (fs.existsSync(pkgPath)) {\n try {\n const pkg = JSON.parse(fs.readFileSync(pkgPath, \"utf-8\"));\n const declared = pkg?.[\"agent-native\"]?.workspaceCore;\n if (typeof declared === \"string\" && declared.length > 0) {\n workspaceRoot = dir;\n packageName = declared;\n break;\n }\n } catch {\n // Malformed package.json — keep walking up.\n }\n }\n const parent = path.dirname(dir);\n if (parent === dir) break;\n dir = parent;\n }\n if (!workspaceRoot || !packageName) return null;\n\n // 2a) pnpm/npm symlink under workspaceRoot/node_modules.\n const nm = path.join(workspaceRoot, \"node_modules\", packageName);\n if (fs.existsSync(path.join(nm, \"package.json\"))) {\n return { packageName, packageDir: fs.realpathSync(nm) };\n }\n\n // 2b) Scan packages/* and packages/@scope/* for a matching `name`.\n const packagesDir = path.join(workspaceRoot, \"packages\");\n if (fs.existsSync(packagesDir)) {\n const candidates: string[] = [];\n for (const entry of fs.readdirSync(packagesDir, { withFileTypes: true })) {\n if (!entry.isDirectory()) continue;\n candidates.push(path.join(packagesDir, entry.name));\n if (entry.name.startsWith(\"@\")) {\n const scopeDir = path.join(packagesDir, entry.name);\n for (const sub of fs.readdirSync(scopeDir, { withFileTypes: true })) {\n if (sub.isDirectory()) candidates.push(path.join(scopeDir, sub.name));\n }\n }\n }\n for (const c of candidates) {\n const p = path.join(c, \"package.json\");\n if (!fs.existsSync(p)) continue;\n try {\n const pkg = JSON.parse(fs.readFileSync(p, \"utf-8\"));\n if (pkg?.name === packageName)\n return { packageName, packageDir: fs.realpathSync(c) };\n } catch {\n // ignore malformed package.json\n }\n }\n }\n return null;\n}\n\n/** Escape a string so it can be embedded as a regex literal. */\nfunction escapeRegex(s: string): string {\n return s.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n}\n\n/** Check if a package is installed in the project */\nfunction hasDep(pkg: string, cwd: string): boolean {\n try {\n const pkgJson = JSON.parse(\n fs.readFileSync(path.join(cwd, \"package.json\"), \"utf-8\"),\n );\n return !!(\n pkgJson.dependencies?.[pkg] ||\n pkgJson.devDependencies?.[pkg] ||\n pkgJson.peerDependencies?.[pkg]\n );\n } catch {\n return false;\n }\n}\n\n/**\n * Build the `resolve.dedupe` list dynamically. Reads core's package.json and\n * collects every peerDependency that the consuming app also declares. This\n * ensures Vite resolves them from the app root, not from core's own\n * node_modules — preventing duplicate React context / singleton issues.\n */\nfunction getClientDedupe(cwd: string): string[] {\n // Always dedupe React internals (sub-path exports aren't in peerDeps)\n const always = new Set([\"react\", \"react-dom\", \"react-dom/client\"]);\n\n // Server-only packages that never run in the browser — no point deduping.\n const serverOnly = new Set([\n \"drizzle-kit\",\n \"node-pty\",\n \"postgres\",\n \"ws\",\n \"typescript\",\n \"vite\",\n \"@vitejs/plugin-react-swc\",\n \"tailwindcss\",\n \"@tailwindcss/vite\",\n ]);\n\n try {\n const corePkgPath = path.resolve(__dirname, \"../../package.json\");\n const corePkg = JSON.parse(fs.readFileSync(corePkgPath, \"utf-8\"));\n\n // Scan both peerDependencies and dependencies. Direct deps like\n // @radix-ui/* use React internally — they must resolve against the\n // app's React, not a second copy inside core's node_modules.\n const coreDeps = new Set([\n ...Object.keys(corePkg.peerDependencies ?? {}),\n ...Object.keys(corePkg.dependencies ?? {}),\n ]);\n\n // Read the consuming app's dependencies\n const appPkg = JSON.parse(\n fs.readFileSync(path.join(cwd, \"package.json\"), \"utf-8\"),\n );\n const appDeps = new Set([\n ...Object.keys(appPkg.dependencies ?? {}),\n ...Object.keys(appPkg.devDependencies ?? {}),\n ]);\n\n for (const dep of coreDeps) {\n if (serverOnly.has(dep)) continue;\n // Dedupe if the app also declares it, OR if it's a React-based\n // UI library (Radix, Tanstack) that must share the app's React.\n if (\n appDeps.has(dep) ||\n dep.startsWith(\"@radix-ui/\") ||\n dep.startsWith(\"@tanstack/\")\n ) {\n always.add(dep);\n }\n }\n } catch {\n // Can't read package.json — fall back to known singletons\n }\n\n return [...always];\n}\n\nfunction getDefaultOptimizeDeps(cwd: string): string[] {\n const entries: Array<{ specifier: string; packageName?: string }> = [\n { specifier: \"@agent-native/core\" },\n {\n specifier: \"@agent-native/core/client\",\n packageName: \"@agent-native/core\",\n },\n {\n specifier: \"@agent-native/core/client/org\",\n packageName: \"@agent-native/core\",\n },\n {\n specifier: \"@agent-native/core/client/tools\",\n packageName: \"@agent-native/core\",\n },\n { specifier: \"@libsql/client\" },\n { specifier: \"@radix-ui/react-accordion\" },\n { specifier: \"@radix-ui/react-alert-dialog\" },\n { specifier: \"@radix-ui/react-avatar\" },\n { specifier: \"@radix-ui/react-checkbox\" },\n { specifier: \"@radix-ui/react-collapsible\" },\n { specifier: \"@radix-ui/react-context-menu\" },\n { specifier: \"@radix-ui/react-dialog\" },\n { specifier: \"@radix-ui/react-dropdown-menu\" },\n { specifier: \"@radix-ui/react-hover-card\" },\n { specifier: \"@radix-ui/react-label\" },\n { specifier: \"@radix-ui/react-menubar\" },\n { specifier: \"@radix-ui/react-navigation-menu\" },\n { specifier: \"@radix-ui/react-popover\" },\n { specifier: \"@radix-ui/react-progress\" },\n { specifier: \"@radix-ui/react-radio-group\" },\n { specifier: \"@radix-ui/react-scroll-area\" },\n { specifier: \"@radix-ui/react-select\" },\n { specifier: \"@radix-ui/react-separator\" },\n { specifier: \"@radix-ui/react-slider\" },\n { specifier: \"@radix-ui/react-slot\" },\n { specifier: \"@radix-ui/react-switch\" },\n { specifier: \"@radix-ui/react-tabs\" },\n { specifier: \"@radix-ui/react-toast\" },\n { specifier: \"@radix-ui/react-toggle\" },\n { specifier: \"@radix-ui/react-toggle-group\" },\n { specifier: \"@radix-ui/react-tooltip\" },\n { specifier: \"@tanstack/react-query\" },\n { specifier: \"@tabler/icons-react\" },\n { specifier: \"class-variance-authority\" },\n { specifier: \"clsx\" },\n { specifier: \"cmdk\" },\n { specifier: \"drizzle-orm\" },\n { specifier: \"drizzle-orm/pg-core\", packageName: \"drizzle-orm\" },\n { specifier: \"drizzle-orm/sqlite-core\", packageName: \"drizzle-orm\" },\n { specifier: \"h3\" },\n { specifier: \"next-themes\" },\n { specifier: \"react-hook-form\" },\n { specifier: \"sonner\" },\n { specifier: \"tailwind-merge\" },\n { specifier: \"zod\" },\n ];\n\n return entries\n .filter(({ specifier, packageName }) =>\n hasDep(packageName ?? specifier, cwd),\n )\n .map(({ specifier }) => specifier);\n}\n\n/**\n * In monorepo dev mode, resolve @agent-native/core imports to source (src/)\n * instead of dist/ so that Vite HMR picks up changes without rebuilding.\n *\n * Returns Vite array-style aliases with exact matching (regex anchored with $)\n * to prevent `@agent-native/core` from prefix-matching and swallowing\n * sub-path imports like `@agent-native/core/client`.\n */\nfunction getCoreSourceAliases(\n cwd: string,\n): Array<{ find: RegExp; replacement: string }> {\n // Detect monorepo: walk up to find packages/core/src/\n const candidates = [\n path.resolve(cwd, \"../../packages/core\"), // templates/<name>/\n path.resolve(cwd, \"../core\"), // packages/<name>/\n ];\n\n let coreSrc = \"\";\n for (const candidate of candidates) {\n if (fs.existsSync(path.join(candidate, \"src/index.ts\"))) {\n coreSrc = path.join(candidate, \"src\");\n break;\n }\n }\n\n if (!coreSrc) return []; // Not in monorepo — use dist as normal\n\n // Map every @agent-native/core/* export to its src/ equivalent.\n // Each entry uses a regex with $ anchor for exact matching.\n const entries: Record<string, string> = {\n \"@agent-native/core\": path.join(coreSrc, \"index.browser.ts\"),\n \"@agent-native/core/server\": path.join(coreSrc, \"server/index.ts\"),\n \"@agent-native/core/client\": path.join(coreSrc, \"client/index.ts\"),\n \"@agent-native/core/client/tools\": path.join(\n coreSrc,\n \"client/tools/index.ts\",\n ),\n \"@agent-native/core/client/org\": path.join(coreSrc, \"client/org/index.ts\"),\n \"@agent-native/core/client/observability\": path.join(\n coreSrc,\n \"client/observability/index.ts\",\n ),\n \"@agent-native/core/client/onboarding\": path.join(\n coreSrc,\n \"client/onboarding/index.ts\",\n ),\n \"@agent-native/core/client/sharing\": path.join(\n coreSrc,\n \"client/sharing/index.ts\",\n ),\n \"@agent-native/core/client/notifications\": path.join(\n coreSrc,\n \"client/notifications/index.ts\",\n ),\n \"@agent-native/core/client/progress\": path.join(\n coreSrc,\n \"client/progress/index.ts\",\n ),\n \"@agent-native/core/db\": path.join(coreSrc, \"db/index.ts\"),\n \"@agent-native/core/db/schema\": path.join(coreSrc, \"db/schema.ts\"),\n \"@agent-native/core/shared\": path.join(coreSrc, \"shared/index.ts\"),\n \"@agent-native/core/scripts\": path.join(coreSrc, \"scripts/index.ts\"),\n \"@agent-native/core/application-state\": path.join(\n coreSrc,\n \"application-state/index.ts\",\n ),\n \"@agent-native/core/settings\": path.join(coreSrc, \"settings/index.ts\"),\n \"@agent-native/core/credentials\": path.join(\n coreSrc,\n \"credentials/index.ts\",\n ),\n \"@agent-native/core/resources\": path.join(coreSrc, \"resources/index.ts\"),\n \"@agent-native/core/oauth-tokens\": path.join(\n coreSrc,\n \"oauth-tokens/index.ts\",\n ),\n \"@agent-native/core/a2a\": path.join(coreSrc, \"a2a/index.ts\"),\n \"@agent-native/core/router\": path.join(coreSrc, \"router/index.ts\"),\n \"@agent-native/core/terminal\": path.join(\n coreSrc,\n \"client/terminal/index.ts\",\n ),\n \"@agent-native/core/terminal/server\": path.join(\n coreSrc,\n \"terminal/index.ts\",\n ),\n \"@agent-native/core/adapters/cli\": path.join(\n coreSrc,\n \"adapters/cli/index.ts\",\n ),\n };\n\n // Escape special regex chars in the key and anchor with $\n return Object.entries(entries).map(([find, replacement]) => ({\n find: new RegExp(`^${find.replace(/[/]/g, \"\\\\/\")}$`),\n replacement,\n }));\n}\n\nexport interface NitroOptions {\n /** Nitro deployment preset (e.g. \"node\", \"vercel\", \"netlify\", \"cloudflare_pages\"). Default: \"node\" */\n preset?: string;\n /** Source directory for server files. Default: \"./server\" */\n srcDir?: string;\n /** Routes directory name (relative to srcDir). Default: \"routes\" */\n routesDir?: string;\n /** Any additional Nitro config overrides */\n [key: string]: unknown;\n}\n\nexport interface ClientConfigOptions {\n /** Port for dev server. Default: 8080 */\n port?: number;\n /** Additional Vite plugins */\n plugins?: any[];\n /** Nitro plugin options (preset, srcDir, etc) */\n nitro?: NitroOptions;\n /** Override resolve aliases */\n aliases?: Record<string, string>;\n /** Override build.outDir. Default: \"dist/spa\" */\n outDir?: string;\n /** Additional fs.allow paths */\n fsAllow?: string[];\n /** Additional fs.deny patterns */\n fsDeny?: string[];\n /** Additional Vite optimizeDeps configuration */\n optimizeDeps?: { include?: string[]; exclude?: string[] };\n /**\n * Whether to auto-inject the Tailwind v4 Vite plugin (`@tailwindcss/vite`).\n * Defaults to true — set to `false` if a template wants to manage Tailwind\n * itself (e.g. the legacy v3 PostCSS pipeline).\n */\n tailwind?: boolean;\n /**\n * Package names to stub in the SSR bundle with an empty proxy object.\n *\n * Use this for dependencies that only run in the browser (canvas / diagram\n * libraries, editors, WebGL) but would otherwise get pulled into the\n * server bundle via SSR's noExternal policy — pushing the CF Pages\n * Functions bundle over the 25 MiB limit.\n *\n * Only add packages that are provably never called during SSR. If the\n * server imports one, it will receive a Proxy that throws on any real\n * use (which is better than bundling a 10 MiB dep the worker never calls).\n *\n * @example\n * ssrStubs: [\"mermaid\", \"@excalidraw/excalidraw\"]\n */\n ssrStubs?: string[];\n /**\n * @deprecated Pass `reactRouter()` directly in the `plugins` array instead.\n * Previously used to auto-load the React Router Vite plugin via require(),\n * but this fails in ESM contexts. Templates should now do:\n * ```ts\n * import { reactRouter } from \"@react-router/dev/vite\";\n * defineConfig({ plugins: [reactRouter()] })\n * ```\n */\n reactRouter?: boolean | Record<string, unknown>;\n}\n\n/**\n * Vite plugin that recovers the page when Vite's dependency optimizer\n * invalidates modules mid-load (the \"504 Outdated Optimize Dep\" error).\n *\n * Without this, the page silently fails: <script type=\"module\"> tags 504,\n * React never mounts, and the user is stuck on a blank screen until they\n * manually refresh. We catch the failure modes and auto-reload, with a\n * visible overlay so the user knows what's happening, and a loop guard\n * so we never thrash forever.\n *\n * CRITICAL: this must be a SYNCHRONOUS (non-module) script injected at\n * `head-prepend`. Module scripts are deferred — the browser starts fetching\n * all module scripts in parallel during HTML parsing, so a module listener\n * registers AFTER sibling modules have already started loading and\n * possibly errored out. A regular <script> blocks parsing and runs\n * synchronously, so the listener is registered before ANY module fetch\n * begins.\n *\n * Catches two failure modes (both window-level, no HMR needed):\n * 1. <script type=\"module\"> / <link> 504 — window \"error\" event, capture phase\n * 2. Dynamic import 504 — \"unhandledrejection\" with \"dynamically imported module\"\n */\nfunction autoReloadOnOptimizeDep(): Plugin {\n return {\n name: \"agent-native-auto-reload-optimize-dep\",\n apply: \"serve\",\n transformIndexHtml() {\n return [\n {\n tag: \"script\",\n // NOTE: no `type: \"module\"` — this must be a synchronous script.\n children: `\n(function() {\n var RELOAD_KEY = \"__an_optimize_reload\";\n var MAX_RELOADS = 3;\n var RESET_AFTER_MS = 8000;\n\n var reloadTimer = null;\n var overlayShown = false;\n\n // Track recent reloads in sessionStorage. If we reload too many times\n // in a short window, stop and show a manual-refresh message instead of\n // looping forever.\n function readReloadHistory() {\n try {\n var raw = sessionStorage.getItem(RELOAD_KEY);\n if (!raw) return [];\n var arr = JSON.parse(raw);\n var cutoff = Date.now() - 30000;\n return Array.isArray(arr) ? arr.filter(function(t) { return t > cutoff; }) : [];\n } catch (e) { return []; }\n }\n function recordReload() {\n try {\n var history = readReloadHistory();\n history.push(Date.now());\n sessionStorage.setItem(RELOAD_KEY, JSON.stringify(history));\n } catch (e) {}\n }\n // Reset the counter after a stable period (page didn't fail again).\n setTimeout(function() {\n try { sessionStorage.removeItem(RELOAD_KEY); } catch (e) {}\n }, RESET_AFTER_MS);\n\n function showOverlay(title, subtitle) {\n if (overlayShown) return;\n overlayShown = true;\n var mount = function() {\n if (!document.body) { setTimeout(mount, 16); return; }\n var el = document.createElement(\"div\");\n el.id = \"__an-reload-overlay\";\n el.style.cssText = [\n \"position:fixed\",\"inset:0\",\"z-index:2147483647\",\n \"display:flex\",\"align-items:center\",\"justify-content:center\",\n \"background:rgba(0,0,0,0.6)\",\"backdrop-filter:blur(8px)\",\n \"-webkit-backdrop-filter:blur(8px)\",\n \"font-family:-apple-system,BlinkMacSystemFont,system-ui,sans-serif\",\n \"color:#fff\",\"font-size:14px\"\n ].join(\";\");\n el.innerHTML =\n '<div style=\"background:#171717;padding:20px 24px;border-radius:12px;' +\n 'border:1px solid rgba(255,255,255,0.1);max-width:340px;text-align:center;' +\n 'box-shadow:0 20px 60px rgba(0,0,0,0.5)\">' +\n '<div style=\"font-weight:600;margin-bottom:6px\">' + title + '</div>' +\n '<div style=\"font-size:12px;opacity:0.7\">' + subtitle + '</div>' +\n '</div>';\n document.body.appendChild(el);\n };\n mount();\n }\n\n function scheduleReload(reason) {\n if (reloadTimer) return;\n var history = readReloadHistory();\n if (history.length >= MAX_RELOADS) {\n console.warn(\"[agent-native] Dev server keeps re-bundling. Manual refresh needed.\", reason);\n showOverlay(\n \"Dev server out of sync\",\n \"Auto-reload gave up after \" + MAX_RELOADS + \" tries. Refresh the page (\\u2318R / Ctrl+R).\"\n );\n return;\n }\n console.log(\"[agent-native] Vite re-bundled deps (\" + reason + \"), reloading\\u2026\");\n recordReload();\n // First reload is silent — one refresh almost always fixes it and the\n // overlay flash is more disruptive than the reload itself. Only show\n // the overlay starting on the second attempt, when something is clearly\n // taking longer than expected.\n if (history.length >= 1) {\n showOverlay(\"Updating dev server\\u2026\", \"Reloading the page\");\n }\n reloadTimer = setTimeout(function() { window.location.reload(); }, 300);\n }\n\n function looksLikeViteDep(url) {\n if (!url) return false;\n // Only treat same-origin URLs as Vite deps — don't reload the page\n // because some third-party CDN script 404'd.\n try {\n var u = new URL(url, window.location.href);\n if (u.origin !== window.location.origin) return false;\n } catch (e) { return false; }\n return url.indexOf(\"/node_modules/.vite/deps/\") !== -1\n || url.indexOf(\"/@fs/\") !== -1\n || url.indexOf(\"/@id/\") !== -1\n || url.indexOf(\"?v=\") !== -1\n || url.indexOf(\"?import\") !== -1\n || /\\\\.(m?js|ts|tsx|jsx)(\\\\?|$)/.test(url);\n }\n\n // 1) <script type=\"module\"> / <link> 504 — fires on the element, not window,\n // so we use capture phase to catch resource load errors.\n window.addEventListener(\"error\", function(e) {\n var t = e.target;\n if (!t || t === window) return;\n var tag = t.tagName;\n if (tag !== \"SCRIPT\" && tag !== \"LINK\") return;\n var url = t.src || t.href || \"\";\n if (looksLikeViteDep(url)) {\n var name = url.split(\"/\").pop();\n scheduleReload(\"script 504: \" + name);\n }\n }, true);\n\n // 2) Dynamic import failures (React Router code splitting, lazy components)\n window.addEventListener(\"unhandledrejection\", function(e) {\n var msg = String((e.reason && (e.reason.message || e.reason)) || \"\");\n if (\n msg.indexOf(\"Failed to fetch dynamically imported module\") !== -1 ||\n msg.indexOf(\"error loading dynamically imported module\") !== -1 ||\n msg.indexOf(\"Importing a module script failed\") !== -1 ||\n msg.indexOf(\"Outdated Optimize Dep\") !== -1 ||\n (msg.indexOf(\"504\") !== -1 && msg.indexOf(\".vite/deps\") !== -1)\n ) {\n scheduleReload(\"dynamic import\");\n }\n });\n})();`,\n injectTo: \"head-prepend\",\n },\n ];\n },\n };\n}\n\n/**\n * Vite plugin that prevents the built-in base middleware from redirecting\n * \"/\" → \"/app/\" (or whatever the base is). When agent-native apps run with\n * --base /app/ in single-port mode, Vite's baseMiddleware sends a 302 from\n * \"/\" to the base path. This breaks Electron webview and iframe embeds\n * that load the app at the root. Instead, we rewrite \"/\" to the base path\n * internally so the app serves without a visible redirect.\n */\nfunction baseRedirectGuard(): Plugin {\n return {\n name: \"agent-native-base-redirect-guard\",\n apply: \"serve\",\n configureServer(server) {\n // Return a function so the middleware is added AFTER Vite's internal\n // middleware is built — but we insert BEFORE by using the pre-hook\n // approach: configureServer hooks that return nothing run before\n // internal middleware.\n server.middlewares.use((req, res, next) => {\n const base = server.config.base;\n if (base && base !== \"/\" && req.url?.startsWith(base)) {\n const relativeUrl = req.url.slice(base.length - 1);\n try {\n const url = new URL(relativeUrl, \"http://agent-native.local\");\n const publicDir = server.config.publicDir;\n if (typeof publicDir !== \"string\") {\n return next();\n }\n const publicPath = path.normalize(\n path.join(publicDir, decodeURIComponent(url.pathname)),\n );\n if (\n publicPath.startsWith(publicDir + path.sep) &&\n fs.existsSync(publicPath) &&\n fs.statSync(publicPath).isFile()\n ) {\n const contentType = contentTypeForPublicFile(publicPath);\n if (contentType) res.setHeader(\"content-type\", contentType);\n if (req.method === \"HEAD\") {\n res.statusCode = 200;\n res.end();\n return;\n }\n fs.createReadStream(publicPath).pipe(res);\n return;\n }\n } catch {\n // Fall through to Vite/Nitro. Malformed URLs should keep their\n // original path so the normal dev-server error handling applies.\n }\n }\n req.url = stripMountedDevApiPath(req.url, base);\n if (\n req.method === \"HEAD\" &&\n req.url &&\n !isFrameworkDevPath(req.url, base)\n ) {\n req.method = \"GET\";\n }\n if (\n base &&\n base !== \"/\" &&\n (req.url === \"/\" || req.url === \"/index.html\")\n ) {\n // Rewrite to the base path so Vite serves the app directly\n req.url = base;\n }\n next();\n });\n },\n };\n}\n\nfunction contentTypeForPublicFile(filePath: string): string | null {\n switch (path.extname(filePath).toLowerCase()) {\n case \".css\":\n return \"text/css\";\n case \".html\":\n return \"text/html\";\n case \".ico\":\n return \"image/x-icon\";\n case \".json\":\n case \".webmanifest\":\n return \"application/json\";\n case \".js\":\n case \".mjs\":\n return \"text/javascript\";\n case \".png\":\n return \"image/png\";\n case \".svg\":\n return \"image/svg+xml\";\n case \".txt\":\n return \"text/plain\";\n case \".xml\":\n return \"application/xml\";\n default:\n return null;\n }\n}\n\nfunction devPathname(reqUrl: string): string {\n return new URL(reqUrl, \"http://agent-native.local\").pathname;\n}\n\nfunction isApiDevPath(reqUrl: string): boolean {\n const pathname = devPathname(reqUrl);\n return pathname === \"/api\" || pathname.startsWith(\"/api/\");\n}\n\nexport function stripMountedDevApiPath(\n reqUrl: string | undefined,\n base: string | undefined,\n): string | undefined {\n if (!reqUrl || !base || base === \"/\") return reqUrl;\n const normalizedBase = base.endsWith(\"/\") ? base : `${base}/`;\n if (!reqUrl.startsWith(normalizedBase)) return reqUrl;\n const stripped = reqUrl.slice(normalizedBase.length - 1) || \"/\";\n return isApiDevPath(stripped) ? stripped : reqUrl;\n}\n\nexport function isFrameworkDevPath(\n reqUrl: string,\n base: string | undefined,\n): boolean {\n const pathname = devPathname(reqUrl);\n if (pathname === \"/_agent-native\" || pathname.startsWith(\"/_agent-native/\")) {\n return true;\n }\n if (!base || base === \"/\") return false;\n const normalizedBase = base.endsWith(\"/\") ? base.slice(0, -1) : base;\n return (\n pathname === `${normalizedBase}/_agent-native` ||\n pathname.startsWith(`${normalizedBase}/_agent-native/`)\n );\n}\n\n/**\n * Work around a Rolldown bug where Nitro passes service entries as objects\n * ({index: \"path\"}) but Rolldown expects strings. This plugin normalizes\n * rollupOptions.input entries in the SSR environment.\n */\nfunction rolldownInputFix(): Plugin {\n return {\n name: \"agent-native-rolldown-input-fix\",\n configEnvironment(name, config) {\n const input = config.build?.rollupOptions?.input;\n if (!Array.isArray(input)) return;\n // Flatten any object entries to just their string values\n const fixed = input.map((entry: any) => {\n if (typeof entry === \"string\") return entry;\n if (typeof entry === \"object\" && entry !== null) {\n const values = Object.values(entry);\n return values[0] as string;\n }\n return entry;\n });\n config.build!.rollupOptions!.input = fixed;\n },\n };\n}\n\n/**\n * Expose the resolved Vite dev server port as process.env.PORT so that\n * in-process scripts (which use localFetch → http://localhost:${PORT}/api/...)\n * hit the right address even when Vite auto-increments the port.\n */\n/**\n * Replace caller-specified packages with an empty proxy stub during SSR\n * builds. For apps whose heavy browser-only deps would otherwise bloat the\n * edge worker past CF Pages' 25 MiB Functions limit.\n *\n * The template lists the packages in its `defineConfig({ ssrStubs })` call —\n * the framework never hardcodes package names.\n */\nfunction ssrStubPlugin(packages: string[]): Plugin | null {\n if (!packages.length) return null;\n const stubbed = new Set(packages);\n const STUB_ID = \"\\0agent-native-ssr-stub\";\n return {\n name: \"agent-native-ssr-stub-heavy-libs\",\n enforce: \"pre\",\n resolveId(id, _importer, opts) {\n if (!opts?.ssr) return null;\n // Match the bare package name or any subpath\n const pkg = id\n .split(\"/\")\n .slice(0, id.startsWith(\"@\") ? 2 : 1)\n .join(\"/\");\n if (stubbed.has(pkg)) return STUB_ID;\n return null;\n },\n load(id) {\n if (id !== STUB_ID) return null;\n // Proxy that answers any property access with itself — lets dead\n // import/re-export chains parse without blowing up, and still throws\n // if code actually tries to call any of it on the server.\n return (\n \"const handler = { get(_, p) { \" +\n \"if (p === Symbol.toPrimitive) return () => ''; \" +\n \"if (p === 'then') return undefined; \" +\n \"return new Proxy(() => {}, handler); \" +\n \"} };\" +\n \"const stub = new Proxy(() => {}, handler);\" +\n \"export default stub;\"\n );\n },\n };\n}\n\nfunction portExposer(): Plugin {\n return {\n name: \"agent-native-port-exposer\",\n apply: \"serve\",\n configureServer(server) {\n server.httpServer?.once(\"listening\", () => {\n const addr = server.httpServer?.address();\n if (addr && typeof addr === \"object\" && addr.port) {\n process.env.PORT = String(addr.port); // guard:allow-env-mutation — Vite dev server port published once at boot before any request\n }\n });\n },\n };\n}\n\n/**\n * Silence benign `read ECONNRESET` noise from Vite's dev middleware.\n * Fires when a browser closes/reloads/navigates mid-request — the peer has\n * already gone away, there's nothing to fix, and Vite's error middleware\n * spams the terminal with \"Internal server error: read ECONNRESET\". Our H3\n * server layer already swallows this (create-server.ts onError); this plugin\n * does the same for Vite's own connect pipeline.\n */\nfunction silenceConnectionResets(): Plugin {\n const isBenign = (err: unknown) => {\n const e = err as NodeJS.ErrnoException | undefined;\n const code = e?.code || (e?.cause as NodeJS.ErrnoException)?.code;\n return (\n code === \"ECONNRESET\" ||\n code === \"ECONNABORTED\" ||\n code === \"EPIPE\" ||\n e?.message === \"aborted\"\n );\n };\n return {\n name: \"agent-native-silence-connection-resets\",\n apply: \"serve\",\n configureServer(server) {\n // Swallow socket-level resets so Node doesn't surface them as uncaught.\n server.httpServer?.on(\"connection\", (socket) => {\n socket.on(\"error\", (err) => {\n if (!isBenign(err)) throw err;\n });\n });\n // Drop Vite's \"Internal server error: read ECONNRESET\" log lines.\n const origError = server.config.logger.error.bind(server.config.logger);\n server.config.logger.error = (msg, opts) => {\n const text = typeof msg === \"string\" ? msg : String(msg ?? \"\");\n if (\n (opts?.error && isBenign(opts.error)) ||\n /Internal server error:\\s*(read ECONNRESET|aborted|EPIPE)/i.test(text)\n ) {\n return;\n }\n origError(msg, opts);\n };\n },\n };\n}\n\n/**\n * Create the client Vite config with sensible agent-native defaults.\n * Supports two modes:\n * - Legacy SPA mode (default): React SWC plugin, client-only routing\n * - React Router framework mode: SSR-capable with file-based routing\n *\n * Both modes include Nitro for API routes, path aliases, and fs restrictions.\n */\nexport function defineConfig(options: ClientConfigOptions = {}): UserConfig {\n // Check if React Router plugin was passed directly in plugins array\n const hasReactRouterPlugin = options.plugins?.some(\n (p: any) =>\n p?.name === \"react-router\" ||\n (Array.isArray(p) && p.some((pp: any) => pp?.name === \"react-router\")),\n );\n\n let reactTransformPlugin: any;\n\n if (!hasReactRouterPlugin && !options.reactRouter) {\n // Legacy SPA mode — use React SWC plugin (only when React Router is not used)\n try {\n reactTransformPlugin = require(\"@vitejs/plugin-react-swc\");\n if (reactTransformPlugin.default)\n reactTransformPlugin = reactTransformPlugin.default;\n } catch {\n // Will be resolved at runtime by Vite\n }\n }\n\n const cwd = process.cwd();\n\n // Workspace env fallback. If this app is inside a workspace, tell Vite to\n // also look for .env files at the workspace root. Per-app .env still wins\n // (Vite's loadEnv merges in precedence order — app dir is loaded after).\n const workspaceRoot = findWorkspaceRoot(cwd);\n const envDir = workspaceRoot && workspaceRoot !== cwd ? workspaceRoot : cwd;\n\n // Preload workspace-root .env into process.env so Nitro server code sees\n // shared keys during dev (Nitro reads process.env, not vite's envDir).\n if (workspaceRoot && workspaceRoot !== cwd) {\n try {\n const dotenv = require(\"dotenv\");\n dotenv.config({\n path: path.join(workspaceRoot, \".env\"),\n override: false,\n // Suppress the dotenv v17 tip line — this loader fires alongside\n // utils.ts loadEnv() during dev startup and would otherwise emit a\n // duplicate \"[dotenv] injecting env\" message.\n quiet: true,\n });\n } catch {}\n }\n\n // Build the React transform plugin (only for legacy SPA mode)\n const reactPluginInstance = reactTransformPlugin?.();\n\n // Auto-inject the Tailwind v4 Vite plugin if `@tailwindcss/vite` is\n // installed (which it is by default for all agent-native templates).\n // Templates can opt out by setting `options.tailwind = false`.\n let tailwindPluginInstance: any = null;\n if (options.tailwind !== false) {\n try {\n let tailwindPlugin = require(\"@tailwindcss/vite\");\n if (tailwindPlugin.default) tailwindPlugin = tailwindPlugin.default;\n tailwindPluginInstance = tailwindPlugin();\n } catch {\n // Plugin not installed — silently skip. Old templates may still be on v3.\n }\n }\n\n // APP_BASE_PATH lets this app be mounted under a prefix (e.g. \"/mail\") as\n // part of a unified workspace deploy. Defaults to \"/\" for standalone apps.\n const appBasePath =\n process.env.VITE_APP_BASE_PATH || process.env.APP_BASE_PATH || \"/\";\n const base = appBasePath.endsWith(\"/\") ? appBasePath : `${appBasePath}/`;\n const monorepoCoreAllow = [\n path.resolve(cwd, \"../../packages/core\"),\n path.resolve(cwd, \"../core\"),\n ].filter((candidate) => fs.existsSync(path.join(candidate, \"package.json\")));\n\n // Workspace-core (enterprise monorepo): pull its directory into Vite's\n // file watcher + module graph so edits to its TS sources hot-reload the\n // dev server, and its package name into ssr.noExternal so the dynamic\n // import in framework-request-handler.ts goes through Vite's transform\n // pipeline (TypeScript, SSR HMR, the works).\n const workspaceCore = findWorkspaceCoreSync(cwd);\n const workspaceCoreFsAllow = workspaceCore ? [workspaceCore.packageDir] : [];\n const workspaceCoreNoExternal = workspaceCore\n ? [new RegExp(`^${escapeRegex(workspaceCore.packageName)}(/.*)?$`)]\n : [];\n\n return {\n envDir,\n base,\n server: {\n host: \"::\",\n port: options.port ?? 8080,\n fs: {\n allow: [\n \".\",\n ...monorepoCoreAllow,\n ...workspaceCoreFsAllow,\n ...(options.fsAllow ?? []),\n ],\n deny: [\n \".env\",\n \".env.*\",\n \"*.{crt,pem}\",\n \"**/.git/**\",\n ...(options.fsDeny ?? []),\n ],\n },\n },\n build: {\n outDir: options.outDir ?? \"dist/spa\",\n // Safari 18+ so esbuild's CSS minifier keeps the standard\n // backdrop-filter. Targeting older Safari caused it to drop the\n // unprefixed version (Safari only got unprefixed backdrop-filter in\n // 18.0, Sept 2024) and keep just -webkit-backdrop-filter, which broke\n // the blur in prod where the unprefixed form was expected.\n cssTarget: [\"es2020\", \"safari18\"],\n },\n // Bundle all non-Node.js deps into the production SSR server build.\n // Edge runtimes (CF Workers, Deno) don't have node_modules at runtime.\n // In dev, React Router's Vite Environment runner expects CJS packages\n // like React to stay external; forcing them through the module runner\n // raises `module is not defined`.\n ssr: process.argv.includes(\"build\")\n ? {\n noExternal: /^(?!node:)/,\n // Pick the workspace-core's compiled `dist/` exports in prod —\n // Node-style `default` condition matches what edge runtimes (CF\n // Workers, Deno) can actually load. Without this, Vite's prod\n // build inherits the dev-condition src/ entry and ships unbuilt\n // TypeScript into the worker.\n resolve: {\n conditions: [\"node\", \"module\", \"import\", \"default\"],\n externalConditions: [\"node\", \"module\", \"import\", \"default\"],\n },\n }\n : {\n // Vite already sets `development` in the dev resolve conditions,\n // so the workspace-core template's exports.development → src/\n // entry is picked automatically — Vite handles TS compilation\n // and triggers a server restart when those files change.\n noExternal: [\n /^@agent-native\\/core(\\/.*)?$/,\n // Radix UI primitives are transitive deps of @agent-native/core\n // (used by FeedbackButton, AgentSidebar, ShareDialog, etc.). When\n // a consumer app SSRs a component that imports Radix, Node's\n // externalized resolver can't find @radix-ui/* from the app cwd\n // because pnpm doesn't hoist transitive deps. Bundling them\n // through Vite resolves them via the workspace store.\n /^@radix-ui\\//,\n // scheduling ships tsc-compiled dist files that contain literal\n // `@/` path-alias imports (e.g. `import { Input } from\n // \"@/components/ui/input\"`). In standalone (published) mode Node\n // treats the package as an external CJS dep and can't resolve\n // `@/components`. Adding it to noExternal makes Vite process it\n // through the module pipeline, where the consumer app's `@` →\n // `./app` alias is already registered.\n ...(hasDep(\"@agent-native/scheduling\", cwd)\n ? [/^@agent-native\\/scheduling(\\/.*)?$/]\n : []),\n ...workspaceCoreNoExternal,\n ],\n external: [\n \"react\",\n \"react-dom\",\n \"react-dom/server\",\n \"react-router\",\n \"react-router/dom\",\n \"react-router-dom\",\n ],\n },\n plugins: [\n // Stub packages from `options.ssrStubs` in the SSR bundle so they\n // don't bloat the edge worker. Opt-in per template — the framework\n // hardcodes nothing (e.g. docs sites legitimately import `shiki` on\n // the server, so we can't blanket-stub it here).\n ...(() => {\n const p = ssrStubPlugin(options.ssrStubs ?? []);\n return p ? [p] : [];\n })(),\n ...(options.plugins ?? []),\n actionTypesPlugin(),\n agentsBundlePlugin(),\n autoReloadOnOptimizeDep(),\n baseRedirectGuard(),\n portExposer(),\n silenceConnectionResets(),\n rolldownInputFix(),\n // Nitro Vite plugin for dev-mode API route serving and HMR.\n // Disabled during build — React Router's build handles production.\n ...(process.argv.includes(\"build\")\n ? []\n : [\n nitroVitePlugin({\n serverDir: \"./server\",\n ...(options.nitro ?? {}),\n } as any),\n ]),\n reactPluginInstance,\n tailwindPluginInstance,\n ].filter(Boolean),\n optimizeDeps: {\n include: [\n ...getDefaultOptimizeDeps(cwd),\n ...(hasDep(\"@agent-native/pinpoint\", cwd)\n ? [\"@agent-native/pinpoint/react\"]\n : []),\n ...(options.optimizeDeps?.include ?? []),\n ],\n ...(options.optimizeDeps?.exclude\n ? { exclude: options.optimizeDeps.exclude }\n : {}),\n },\n resolve: {\n // Dedupe all client-side packages that core shares with the consuming\n // app. In pnpm monorepos, core's devDependencies can install separate\n // copies (linked to different React versions). Without deduping, each\n // copy creates its own React context — QueryClientProvider, RouterProvider,\n // Radix, etc. — causing \"No provider\" crashes at runtime.\n dedupe: getClientDedupe(cwd),\n alias: [\n // In monorepo dev: resolve @agent-native/core to source for HMR.\n // Uses regex with $ anchor for exact matching to prevent\n // @agent-native/core from prefix-matching @agent-native/core/client.\n ...getCoreSourceAliases(cwd),\n // Standard path aliases (prefix matching is fine here)\n { find: \"@\", replacement: path.resolve(cwd, \"./app\") },\n { find: \"@shared\", replacement: path.resolve(cwd, \"./shared\") },\n ...Object.entries(options.aliases ?? {}).map(([find, replacement]) => ({\n find,\n replacement,\n })),\n ],\n },\n };\n}\n"]}
@@ -7,6 +7,16 @@ description: "Ask analytics questions in plain English, get charts and dashboard
7
7
 
8
8
  Ask analytics questions in plain English, get charts and dashboards back. The agent connects to BigQuery, GA4, Amplitude, the built-in first-party event collector, HubSpot, Jira, and a dozen other sources, writes the query for you, validates it, and renders the answer as a chart, table, or saved dashboard panel.
9
9
 
10
+ <!-- screenshot:
11
+ app: analytics
12
+ view: /adhoc/<dashboard-id>
13
+ shows: Adhoc dashboard with 3 KPI cards (Weekly active users 24,318 / New signups 1,842 / Revenue MRR $48,210), Weekly active users line chart and Revenue over time area chart side by side, Signups by source bar chart below
14
+ account: screenshot-account (dashboard authored on this account against a seeded warehouse)
15
+ capture: 1400x800 viewport, cropped 90px from bottom (final 1400x710)
16
+ -->
17
+
18
+ ![Analytics dashboard with KPIs and charts](/screenshots/analytics.png)
19
+
10
20
  It's an open-source replacement for Amplitude, Mixpanel, and Looker — for teams that want to own the code, the queries, and the data.
11
21
 
12
22
  ## What you can do with it
@@ -7,6 +7,16 @@ description: "An agent-powered calendar with Google Calendar sync and Calendly-s
7
7
 
8
8
  An agent-powered calendar app. Connect your Google Calendar and the agent can read your schedule, find free slots, create events, and manage Calendly-style booking links — all in plain English. It replaces the Google Calendar + Calendly combo with one app you own.
9
9
 
10
+ <!-- screenshot:
11
+ app: calendar
12
+ view: / (week)
13
+ shows: Calendar week view (May 3-9) with ~17 events scattered across the week (All-hands kickoff, Q3 launch sync, Design review, 1:1 with Marcus, Coffee w/ Hannah, Eng standup, Lunch block, Customer call - Acme, Design crit, Focus block, Roadmap planning, Skip-level w/ Priya, Friday demo, All-hands) — events render in the default blue tone — and the agent sidebar with calendar-aware suggestions
14
+ account: screenshot-account (Google Calendar connected and a representative week populated via create-event)
15
+ capture: 1400x800 viewport, cropped 90px from bottom (final 1400x710)
16
+ -->
17
+
18
+ ![Calendar week view with a populated week and the agent sidebar](/screenshots/calendar.png)
19
+
10
20
  When you open the app, you'll see your calendar in the middle and the agent in the sidebar. The agent always knows which day, week, or event you're looking at, so you can say "schedule a 30-minute call with Alex on this day" without spelling everything out.
11
21
 
12
22
  ## What you can do with it
@@ -7,6 +7,16 @@ description: "Async screen recording (Loom-style), calendar-synced meeting notes
7
7
 
8
8
  A capture-everything app: screen recordings (Loom-style), meeting notes from your calendar (Granola-style), and Fn-hold voice dictation (Wisprflow-style). The agent transcribes, titles, summarizes, and indexes all of it — then lets you ask "find the clip where we discussed the rollout plan" and searches across every transcript you've ever made.
9
9
 
10
+ <!-- screenshot:
11
+ app: clips
12
+ view: /library
13
+ shows: Library with Acme Co. organization, folders (Onboarding videos / Customer calls / Bug repros) and spaces (Engineering / Design / Sales) in the sidebar, six recordings in a 3-column grid (Q3 OKRs review meeting, Walkthrough of new onboarding flow, Eng standup May 4, Dictation - Ideas for landing page copy, Customer call - Acme Corp pricing review, Bug repro - drag-and-drop in Safari)
14
+ account: screenshot-account (recordings imported into this org via the standard upload + meetings flow)
15
+ capture: 1400x800 viewport, cropped 90px from bottom (final 1400x710)
16
+ -->
17
+
18
+ ![Clips library with recordings, folders, and spaces](/screenshots/clips.png)
19
+
10
20
  Think along the lines of Loom + Granola + Wisprflow rolled into one app — but the agent is a first-class editor across every surface, and the recordings, meetings, and dictations are yours, not a SaaS vendor's.
11
21
 
12
22
  ## What you can do with it
@@ -7,6 +7,16 @@ description: "A Notion-style document editor with an AI agent that can read, wri
7
7
 
8
8
  A Notion-style document workspace where the agent can read, write, reorganize, and publish pages for you. Open a doc, ask "rewrite this paragraph to be more concise" or "create a page called Q4 Planning with sub-pages for Goals, Metrics, and Risks" — same result whether you do it yourself or ask.
9
9
 
10
+ <!-- screenshot:
11
+ app: content
12
+ view: /<doc-id>
13
+ shows: Workspace with sidebar tree (Q3 Roadmap favorited and expanded with Goals/Metrics/Risks, Engineering Wiki with On-call playbook + Architecture overview + Deployment guide, Personal section with Reading list and Ideas, Weekly sync — May 1) and the Q3 Roadmap document open in the editor with the agent sidebar
14
+ account: screenshot-account (page tree authored on this account; the doc body should NOT begin with the page title — the page chrome already renders it)
15
+ capture: 1400x800 viewport, cropped 90px from bottom (final 1400x710)
16
+ -->
17
+
18
+ ![Content workspace with the page tree, an open document, and the agent sidebar](/screenshots/content.png)
19
+
10
20
  When you open the app, you'll see a sidebar tree of pages on the left, the editor in the middle, and the agent in the sidebar on the right. The agent always knows which page you're viewing and what text you have selected.
11
21
 
12
22
  ## What you can do with it
@@ -9,6 +9,16 @@ description: "Dispatch is the workspace control plane — central inbox, cross-a
9
9
 
10
10
  Dispatch is the **workspace control plane**. Where other templates are domain apps (Mail, Calendar, Analytics), Dispatch is the app you run _alongside_ them to coordinate everything: a central inbox, a secrets vault, scheduled jobs, Slack/Telegram integration, and an orchestrator agent that delegates domain work to the right specialist app over [A2A](/docs/a2a-protocol).
11
11
 
12
+ <!-- screenshot:
13
+ app: dispatch
14
+ view: /overview
15
+ shows: Overview with "What should we do next?" composer, prompt suggestions (Create a lightweight customer onboarding app / Ask Slides to draft a board update from our latest metrics / Schedule a Monday morning analytics digest), and the Workspace apps grid (Mail / Calendar / Slides / Analytics / Forms / Content + Create app placeholder) showing each mounted path + description
16
+ account: screenshot-account (workspace seeded with the six sibling apps registered as A2A peers)
17
+ capture: 1400x900 viewport, cropped 90px from bottom (final 1400x810)
18
+ -->
19
+
20
+ ![Dispatch overview with the orchestrator chat and workspace apps grid](/screenshots/dispatch.png)
21
+
12
22
  If you're running an [multi-app workspace](/docs/multi-app-workspace) with many apps, Dispatch is the glue.
13
23
 
14
24
  ## What it does {#what-it-does}
@@ -7,6 +7,16 @@ description: "Agent-native form builder — create, edit, publish, and route for
7
7
 
8
8
  Forms is an agent-native form builder. Describe the form you want, refine it in the editor, and publish a public form that stores submissions in your own SQL database.
9
9
 
10
+ <!-- screenshot:
11
+ app: forms
12
+ view: /forms/<id>
13
+ shows: Editor for a "Beta signup" form — sidebar with 5 forms (Beta signup selected, Customer feedback Q3, Job application Engineering, Event RSVP, New customer onboarding); editor pane with title, description, and field cards (Full name, Work email, Your role, Team size, What problem are you hoping to solve?); Edit/Results/Settings/Integrations tabs and Share + Unpublish buttons; agent sidebar with form-related suggestions
14
+ account: screenshot-account (forms authored on this account via the standard build flow, with realistic response counts seeded by submitting through the public URL)
15
+ capture: 1400x800 viewport, cropped 90px from bottom (final 1400x710)
16
+ -->
17
+
18
+ ![Forms editor with a form open and the agent sidebar](/screenshots/forms.png)
19
+
10
20
  When you open the app, you see your forms, the current editor, and a live preview. The agent can create a form from a prompt, update field labels and options, change validation, and connect submission destinations using the same actions the UI uses.
11
21
 
12
22
  ## What you can do with it
@@ -7,6 +7,16 @@ description: "An agent-powered email client. Connect your Gmail and the agent ca
7
7
 
8
8
  An agent-powered email client. Connect your Gmail account and the agent can read, draft, send, and organize email for you — alongside a fast, keyboard-first inbox you can drive yourself. Think Superhuman, but the agent is a first-class citizen and the codebase is yours to own.
9
9
 
10
+ <!-- screenshot:
11
+ app: mail
12
+ view: /inbox
13
+ shows: Inbox listing (Priya Mehta, Acme Billing, Marcus Tang, GitHub, Sasha Park, Linear, Hannah Reyes, Acme Recruiting, Notion, Stripe, Vercel, Calendly, Olivia Brennan, AWS Billing, Dan Kim, Figma) with the agent sidebar open and suggestion chips visible
14
+ account: screenshot-account (seeded with the email set above via the standard inbound flow)
15
+ capture: 1400x800 viewport, cropped 90px from bottom (final 1400x710)
16
+ -->
17
+
18
+ ![Mail inbox with the agent sidebar](/screenshots/mail.png)
19
+
10
20
  When you open the app, you'll see your inbox on the left, the open thread in the middle, and the agent in the sidebar on the right. The agent always knows which view you're in and which thread you have open, so you can say "archive this" or "draft a friendly decline" without explaining what "this" is.
11
21
 
12
22
  ## What you can do with it
@@ -7,7 +7,17 @@ description: "Generate decks from a prompt, edit visually, and present full-scre
7
7
 
8
8
  Generate full presentation decks from a prompt, edit slides visually, and present full-screen. Ask the agent for "a 10-slide pitch deck for a coffee subscription service" and watch it stream slide-by-slide into the editor in seconds. An open-source replacement for Google Slides, Pitch, and PowerPoint.
9
9
 
10
- When you open the app, you'll see your deck list. Click into a deck and you get a slide editor in the middle, a sidebar of slides on the left, and the agent on the right.
10
+ <!-- screenshot:
11
+ app: slides
12
+ view: /deck/<id>
13
+ shows: Deck editor with a "Q3 Board Update" deck open — collapsed left icon rail (Decks / Design Systems / Team), slides thumbnail strip (6 slides — title, agenda, metrics, what we shipped, what we're watching), main slide preview showing the title slide by Maya Chen CEO, speaker notes pane, and the agent chat sidebar with deck-aware suggestions
14
+ account: screenshot-account (deck authored on this account via the standard create-deck + add-slide flow)
15
+ capture: 1400x800 viewport, cropped 90px from bottom (final 1400x710); collapse the left rail before capture
16
+ -->
17
+
18
+ ![Slides deck editor with a deck open and slide thumbnails on the left](/screenshots/slides.png)
19
+
20
+ When you open a deck, you get a slide editor in the middle, a sidebar of slides on the left, and the agent on the right.
11
21
 
12
22
  ## What you can do with it
13
23
 
@@ -7,6 +7,16 @@ description: "The minimal agent-native scaffold — agent chat, actions, applica
7
7
 
8
8
  Starter is the minimum viable agent-native app. You get the six-rules architecture, the agent sidebar, the workspace tab, polling sync, auth, and exactly one example action. Nothing else. Build from there.
9
9
 
10
+ <!-- screenshot:
11
+ app: starter
12
+ view: /
13
+ shows: Blank-slate app with sidebar (Starter brand, Home / New App / Observability), centered "Blank app" card with Start building prompt button + 3 quick-action tiles (New app / Documentation / Theme), agent chat panel on the right
14
+ account: screenshot-account (no domain data needed — starter ships with no seed schema)
15
+ capture: 1400x800 viewport, cropped 90px from bottom (final 1400x710)
16
+ -->
17
+
18
+ ![Starter scaffold with the agent sidebar and a clean blank-slate UI](/screenshots/starter.png)
19
+
10
20
  Pick Starter when you're not sure which domain template fits, or when you want to learn the framework by doing — there's almost nothing to delete.
11
21
 
12
22
  ## What's in it {#whats-in-it}
@@ -7,6 +7,16 @@ description: "A programmatic video studio for motion graphics, product demos, an
7
7
 
8
8
  A programmatic video studio for the kind of motion graphics, product demos, and kinetic-text videos that are a pain to keyframe by hand. Ask the agent for "a 6-second logo reveal that fades in at 2 seconds" and it builds the animation. Tune timing, easing, and camera moves on a timeline, then render to MP4 or WebM.
9
9
 
10
+ <!-- screenshot:
11
+ app: video
12
+ view: /c/<composition-id>
13
+ shows: Video studio with 4 compositions (Logo reveal, Q3 product demo, Pricing animation, Onboarding walkthrough) in the sidebar; Logo reveal loaded with timeline + Remotion preview + camera tools and the agent chat sidebar
14
+ account: screenshot-account (compositions authored on this account)
15
+ capture: 1400x800 viewport, cropped 90px from bottom (final 1400x710)
16
+ -->
17
+
18
+ ![Video studio with timeline, composition, and agent sidebar](/screenshots/videos.png)
19
+
10
20
  When you open the studio, you'll see a list of compositions on the home screen. Click into one and you get a player on top, a timeline at the bottom, and a properties panel on the right. The agent always knows which composition you have open.
11
21
 
12
22
  ## What you can do with it
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-native/core",
3
- "version": "0.7.82",
3
+ "version": "0.7.83",
4
4
  "type": "module",
5
5
  "description": "Framework for agent-native application development — where AI agents and UI share state via files",
6
6
  "license": "MIT",