@agent-native/core 0.161.2 → 0.161.6

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 (42) hide show
  1. package/corpus/templates/analytics/actions/update-dashboard.ts +8 -0
  2. package/corpus/templates/clips/actions/save-browser-transcript.ts +20 -4
  3. package/corpus/templates/clips/app/components/meetings/transcript-bubbles.tsx +167 -35
  4. package/corpus/templates/clips/desktop/src/lib/transcription-capture.ts +8 -1
  5. package/corpus/templates/clips/desktop/src/lib/transcription-engine.ts +39 -2
  6. package/corpus/templates/forms/server/lib/public-form-ssr.ts +3 -0
  7. package/corpus/templates/slides/actions/list-decks.ts +36 -1
  8. package/corpus/templates/slides/app/components/editor/SlideEditor.tsx +29 -17
  9. package/corpus/templates/slides/app/context/DeckContext.tsx +17 -6
  10. package/dist/agent/engine/builder-engine.js +30 -15
  11. package/dist/agent/engine/types.d.ts +19 -0
  12. package/dist/agent/engine/types.js +3 -0
  13. package/dist/agent/production-agent.d.ts +56 -1
  14. package/dist/agent/production-agent.js +130 -3
  15. package/dist/agent/run-manager.d.ts +15 -4
  16. package/dist/agent/run-manager.js +26 -0
  17. package/dist/agent/run-store.d.ts +5 -5
  18. package/dist/agent/run-store.js +52 -15
  19. package/dist/agent/thread-data-builder.js +7 -0
  20. package/dist/agent/types.d.ts +10 -0
  21. package/dist/cli/code-agent-connector.js +6 -1
  22. package/dist/client/AssistantChat.d.ts +1 -0
  23. package/dist/client/AssistantChat.js +10 -1
  24. package/dist/client/MultiTabAssistantChat.js +33 -1
  25. package/dist/client/sse-event-processor.js +11 -7
  26. package/dist/client/use-chat-threads.js +9 -9
  27. package/dist/db/client.js +10 -2
  28. package/dist/db/create-get-db.js +42 -0
  29. package/dist/observability/routes.d.ts +3 -3
  30. package/dist/progress/routes.d.ts +1 -1
  31. package/dist/resources/handlers.d.ts +1 -1
  32. package/dist/secrets/routes.d.ts +9 -9
  33. package/dist/server/onboarding-html.js +22 -77
  34. package/dist/server/poll.d.ts +5 -5
  35. package/dist/server/poll.js +19 -26
  36. package/dist/server/realtime-token.d.ts +1 -1
  37. package/dist/server/transcribe-voice.d.ts +1 -1
  38. package/dist/shared/auth-copy.d.ts +7 -0
  39. package/dist/shared/auth-copy.js +77 -0
  40. package/dist/shared/mcp-embed-headers.js +8 -4
  41. package/dist/vite/client.js +94 -3
  42. package/package.json +1 -1
@@ -1451,6 +1451,66 @@ const EMBED_DEV_STATIC_ASSET_PATHS = new Set([
1451
1451
  "/favicon.svg",
1452
1452
  "/manifest.json",
1453
1453
  ]);
1454
+ const VITE_RUNTIME_MODULE_QUERY_KEYS = new Set([
1455
+ "commonjs-proxy",
1456
+ "direct",
1457
+ "html-proxy",
1458
+ "import",
1459
+ "inline",
1460
+ "inline-css",
1461
+ "no-inline",
1462
+ "raw",
1463
+ "sharedworker",
1464
+ "style-attr",
1465
+ "transform-only",
1466
+ "url",
1467
+ "worker",
1468
+ ]);
1469
+ const VITE_STATIC_ASSET_EXTENSIONS = new Set([
1470
+ ".aac",
1471
+ ".apng",
1472
+ ".avif",
1473
+ ".bmp",
1474
+ ".css",
1475
+ ".cur",
1476
+ ".eot",
1477
+ ".flac",
1478
+ ".gif",
1479
+ ".ico",
1480
+ ".jfif",
1481
+ ".jpeg",
1482
+ ".jpg",
1483
+ ".jxl",
1484
+ ".less",
1485
+ ".m4a",
1486
+ ".mp3",
1487
+ ".mp4",
1488
+ ".mov",
1489
+ ".ogg",
1490
+ ".otf",
1491
+ ".pjp",
1492
+ ".pjpeg",
1493
+ ".pcss",
1494
+ ".pdf",
1495
+ ".png",
1496
+ ".postcss",
1497
+ ".opus",
1498
+ ".sass",
1499
+ ".scss",
1500
+ ".svg",
1501
+ ".styl",
1502
+ ".stylus",
1503
+ ".ttf",
1504
+ ".txt",
1505
+ ".vtt",
1506
+ ".wasm",
1507
+ ".wav",
1508
+ ".webm",
1509
+ ".webp",
1510
+ ".webmanifest",
1511
+ ".woff",
1512
+ ".woff2",
1513
+ ]);
1454
1514
  function mountedPathCandidates(reqUrl, base) {
1455
1515
  if (!reqUrl)
1456
1516
  return [];
@@ -1528,9 +1588,38 @@ function mountedEmbedRuntimeModuleUrl(reqUrl, base) {
1528
1588
  if (!VITE_RUNTIME_PATH_PREFIXES.some((prefix) => url.pathname.startsWith(prefix))) {
1529
1589
  return null;
1530
1590
  }
1531
- url.searchParams.delete(EMBED_TOKEN_QUERY_PARAM);
1532
- url.searchParams.delete(MCP_APP_CHAT_BRIDGE_QUERY_PARAM);
1533
- return `${url.pathname}${url.search}${url.hash}`;
1591
+ // Vite distinguishes valueless module flags such as `?url` from `?url=`.
1592
+ // Strip only the embed controls so those flags reach Vite byte-for-byte.
1593
+ const hashStart = runtimeUrl.indexOf("#");
1594
+ const searchStart = runtimeUrl.indexOf("?");
1595
+ const search = searchStart >= 0 && (hashStart < 0 || searchStart < hashStart)
1596
+ ? runtimeUrl.slice(searchStart, hashStart < 0 ? undefined : hashStart)
1597
+ : "";
1598
+ return `${url.pathname}${stripMountedEmbedRuntimeQueryParams(search)}${url.hash}`;
1599
+ }
1600
+ function stripMountedEmbedRuntimeQueryParams(search) {
1601
+ if (!search)
1602
+ return "";
1603
+ const kept = search
1604
+ .slice(1)
1605
+ .split("&")
1606
+ .filter((pair) => {
1607
+ const key = pair.split("=", 1)[0];
1608
+ return (key !== EMBED_TOKEN_QUERY_PARAM &&
1609
+ key !== MCP_APP_CHAT_BRIDGE_QUERY_PARAM);
1610
+ });
1611
+ return kept.length > 0 ? `?${kept.join("&")}` : "";
1612
+ }
1613
+ function isMountedEmbedStaticAssetRequest(req, runtimeUrl) {
1614
+ const url = new URL(runtimeUrl, "http://agent-native.local");
1615
+ const isViteModuleQuery = [...url.searchParams.keys()].some((key) => VITE_RUNTIME_MODULE_QUERY_KEYS.has(key));
1616
+ if (isViteModuleQuery)
1617
+ return false;
1618
+ const fetchDestination = String(req.headers["sec-fetch-dest"] ?? "").toLowerCase();
1619
+ if (["audio", "font", "image", "style", "track", "video"].includes(fetchDestination)) {
1620
+ return true;
1621
+ }
1622
+ return VITE_STATIC_ASSET_EXTENSIONS.has(path.extname(url.pathname).toLowerCase());
1534
1623
  }
1535
1624
  function virtualModuleIdFromRuntimeUrl(runtimeUrl) {
1536
1625
  try {
@@ -1564,6 +1653,8 @@ function serveMountedEmbedRuntimeModule(server, req, res, base) {
1564
1653
  const runtimeUrl = mountedEmbedRuntimeModuleUrl(req.url, base);
1565
1654
  if (!runtimeUrl)
1566
1655
  return false;
1656
+ if (isMountedEmbedStaticAssetRequest(req, runtimeUrl))
1657
+ return false;
1567
1658
  void loadMountedEmbedRuntimeModule(server, runtimeUrl)
1568
1659
  .then((code) => {
1569
1660
  if (!code) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-native/core",
3
- "version": "0.161.2",
3
+ "version": "0.161.6",
4
4
  "description": "Framework for agent-native application development — where AI agents and UI share SQL state, actions, and context",
5
5
  "homepage": "https://github.com/BuilderIO/agent-native#readme",
6
6
  "bugs": {