@agent-native/core 0.175.4 → 0.175.5-nightly-20260827014436

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 (202) hide show
  1. package/corpus/templates/analytics/actions/get-explorer-dashboard.ts +1 -0
  2. package/corpus/templates/analytics/app/components/auth/AuthProvider.tsx +8 -6
  3. package/corpus/templates/analytics/app/components/dashboard/SqlChart.tsx +32 -0
  4. package/corpus/templates/analytics/app/components/layout/Layout.tsx +1 -1
  5. package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +66 -7
  6. package/corpus/templates/analytics/app/lib/prefetch-keys.ts +10 -0
  7. package/corpus/templates/analytics/app/pages/adhoc/explorer-dashboard/index.tsx +9 -7
  8. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/index.tsx +10 -11
  9. package/corpus/templates/analytics/changelog/2026-08-24-feature-flag-changes-recover-from-temporary-workspace-direct.md +6 -0
  10. package/corpus/templates/analytics/changelog/2026-08-26-analytics-distinguishes-daily-from-weekly-activity-shows-sta.md +6 -0
  11. package/corpus/templates/analytics/changelog/2026-08-26-dashboard-metadata-now-shows-the-original-creator-separately.md +6 -0
  12. package/corpus/templates/analytics/changelog/2026-08-26-dashboard-names-stay-editable-when-the-analytics-sidebar-ref.md +6 -0
  13. package/corpus/templates/analytics/changelog/2026-08-26-fixed-the-agent-re-asking-dashboard-scope-questions-you-had-.md +6 -0
  14. package/corpus/templates/analytics/server/db/schema.ts +2 -0
  15. package/corpus/templates/analytics/server/lib/agent-readable-resource-context.ts +8 -2
  16. package/corpus/templates/analytics/server/lib/dashboards-store.ts +5 -0
  17. package/corpus/templates/analytics/server/lib/first-party-metric-catalog.ts +6 -4
  18. package/corpus/templates/analytics/server/lib/migrate-analytics-artifacts.ts +19 -1
  19. package/corpus/templates/analytics/server/lib/workspace-feature-flags.ts +40 -9
  20. package/corpus/templates/analytics/server/plugins/db.ts +10 -0
  21. package/corpus/templates/analytics/server/routes/api/dashboard-agent-context.json.get.ts +1 -0
  22. package/corpus/templates/analytics/shared/feature-flags.ts +11 -1
  23. package/corpus/templates/calendar/app/components/calendar/GoogleConnectBanner.tsx +2 -9
  24. package/corpus/templates/clips/.agents/skills/ai-video-tools/SKILL.md +8 -7
  25. package/corpus/templates/clips/.agents/skills/recording/SKILL.md +9 -8
  26. package/corpus/templates/clips/actions/import-loom-recording.ts +1 -1
  27. package/corpus/templates/clips/actions/lib/loom-import-job.ts +52 -35
  28. package/corpus/templates/clips/actions/request-transcript.ts +6 -183
  29. package/corpus/templates/clips/app/components/clips-avatar.tsx +46 -0
  30. package/corpus/templates/clips/app/components/library/recording-card.tsx +8 -7
  31. package/corpus/templates/clips/app/components/library/space-card.tsx +8 -5
  32. package/corpus/templates/clips/app/components/meetings/attendee-stack.tsx +7 -8
  33. package/corpus/templates/clips/app/components/meetings/transcript-bubbles.tsx +19 -12
  34. package/corpus/templates/clips/app/components/player/transcript-panel.tsx +128 -94
  35. package/corpus/templates/clips/app/components/recorder/microphone-visualizer.tsx +25 -104
  36. package/corpus/templates/clips/app/components/workspace/members-list.tsx +8 -6
  37. package/corpus/templates/clips/app/components/workspace/notifications-list.tsx +8 -6
  38. package/corpus/templates/clips/app/components/workspace/top-creators-table.tsx +8 -6
  39. package/corpus/templates/clips/app/routes/_app.meetings.$meetingId.tsx +8 -7
  40. package/corpus/templates/clips/app/routes/_app.settings._index.tsx +0 -26
  41. package/corpus/templates/clips/app/routes/r.$recordingId.tsx +1 -4
  42. package/corpus/templates/clips/changelog/2026-08-26-detected-calls-no-longer-duplicate-meetings-or-strand-the-prompt.md +6 -0
  43. package/corpus/templates/clips/desktop/src/app.tsx +8 -10
  44. package/corpus/templates/clips/desktop/src/components/live-waveform.tsx +99 -0
  45. package/corpus/templates/clips/desktop/src/hooks/useMeetingTranscription.ts +248 -55
  46. package/corpus/templates/clips/desktop/src/lib/agent-steps.ts +477 -0
  47. package/corpus/templates/clips/desktop/src/lib/ask-sheet-layout.ts +71 -0
  48. package/corpus/templates/clips/desktop/src/lib/meeting-ask.ts +297 -0
  49. package/corpus/templates/clips/desktop/src/lib/url.ts +24 -0
  50. package/corpus/templates/clips/desktop/src/overlays/ask-steps.tsx +155 -0
  51. package/corpus/templates/clips/desktop/src/overlays/flow-bar.tsx +7 -81
  52. package/corpus/templates/clips/desktop/src/overlays/live-transcript.tsx +29 -2
  53. package/corpus/templates/clips/desktop/src/overlays/meeting-notification.tsx +80 -22
  54. package/corpus/templates/clips/desktop/src/overlays/record-pill.tsx +13 -53
  55. package/corpus/templates/clips/desktop/src/overlays/recording-pill.tsx +1017 -82
  56. package/corpus/templates/clips/desktop/src/styles.css +796 -57
  57. package/corpus/templates/clips/desktop/src/tailwind.css +23 -2
  58. package/corpus/templates/clips/desktop/src-tauri/src/adhoc_meetings_watcher.rs +1765 -219
  59. package/corpus/templates/clips/desktop/src-tauri/src/lib.rs +6 -0
  60. package/corpus/templates/clips/desktop/src-tauri/src/meetings_watcher.rs +45 -30
  61. package/corpus/templates/clips/desktop/src-tauri/src/native_screen/custom_capture.rs +5 -3
  62. package/corpus/templates/clips/desktop/src-tauri/src/notifications.rs +91 -0
  63. package/corpus/templates/clips/desktop/src-tauri/src/recording_indicator.rs +123 -27
  64. package/corpus/templates/clips/server/routes/_agent-native/google/callback.get.ts +16 -0
  65. package/corpus/templates/clips/shared/audio-meter.ts +145 -0
  66. package/corpus/templates/clips/shared/clips-ai-prefs.ts +0 -1
  67. package/corpus/templates/clips/shared/live-waveform.tsx +119 -0
  68. package/corpus/templates/content/app/components/editor/CommentsSidebar.tsx +44 -22
  69. package/corpus/templates/content/app/components/ui/avatar.tsx +1 -0
  70. package/corpus/templates/design/app/components/visual-editor/ReviewCanvasPins.tsx +4 -1
  71. package/corpus/templates/design/app/hooks/use-question-flow.ts +9 -2
  72. package/corpus/templates/design/app/pages/DesignSystemSetup.tsx +111 -37
  73. package/corpus/templates/design/changelog/2026-08-26-design-no-longer-asks-users-to-confirm-guided-questions-they-have-already-answered.md +6 -0
  74. package/corpus/templates/dispatch/changelog/2026-08-26-signing-out-goes-straight-to-the-sign-in-page.md +5 -0
  75. package/corpus/templates/dispatch/server/lib/org-apps-directory.ts +96 -47
  76. package/corpus/templates/dispatch/server/plugins/org-apps-directory.ts +73 -29
  77. package/corpus/templates/factory/.env.example +6 -2
  78. package/corpus/templates/factory/AGENTS.md +3 -3
  79. package/corpus/templates/factory/README.md +4 -2
  80. package/corpus/templates/factory/server/connectors/credentials.ts +70 -4
  81. package/corpus/templates/mail/actions/get-email.ts +68 -21
  82. package/corpus/templates/mail/actions/get-thread.ts +92 -51
  83. package/corpus/templates/mail/app/components/GoogleConnectBanner.tsx +2 -9
  84. package/corpus/templates/mail/app/hooks/use-emails.ts +7 -4
  85. package/corpus/templates/mail/server/lib/mail-connector-catalog.ts +7 -4
  86. package/corpus/templates/plan/app/pages/PlansPage.tsx +23 -15
  87. package/corpus/templates/slides/actions/add-deck.ts +20 -0
  88. package/corpus/templates/slides/actions/create-deck.ts +17 -7
  89. package/corpus/templates/slides/actions/delete-deck.ts +45 -5
  90. package/corpus/templates/slides/actions/get-deck.ts +77 -11
  91. package/corpus/templates/slides/actions/patch-deck.ts +14 -2
  92. package/corpus/templates/slides/actions/save-deck.ts +20 -0
  93. package/corpus/templates/slides/app/components/comments/SlideCommentsPanel.tsx +18 -7
  94. package/corpus/templates/slides/app/components/design-system/DesignSystemSetup.tsx +38 -14
  95. package/corpus/templates/slides/app/components/editor/EditorToolbar.tsx +2 -2
  96. package/corpus/templates/slides/app/components/ui/avatar.tsx +1 -0
  97. package/corpus/templates/slides/server/handlers/decks.ts +10 -0
  98. package/corpus/templates/slides/shared/slide-ids.ts +133 -0
  99. package/corpus/templates/tasks/DEVELOPING.md +8 -0
  100. package/corpus/templates/tasks/drizzle.config.ts +3 -1
  101. package/corpus/templates/tasks/drizzle.local.config.ts +6 -0
  102. package/corpus/templates/tasks/package.json +2 -1
  103. package/corpus/templates/tasks/server/db/migrations/meta/0000_snapshot.json +234 -0
  104. package/corpus/templates/tasks/server/db/migrations/meta/_journal.json +13 -0
  105. package/corpus/templates/tasks/server/db/migrations.ts +110 -0
  106. package/corpus/templates/tasks/server/plugins/db.ts +3 -87
  107. package/dist/client/AssistantChat.js +3 -10
  108. package/dist/client/guided-questions.d.ts +11 -1
  109. package/dist/client/guided-questions.js +24 -7
  110. package/dist/client/hooks/index.d.ts +2 -1
  111. package/dist/client/hooks/index.js +2 -1
  112. package/dist/client/org/OrgSwitcher.js +3 -17
  113. package/dist/client/review/ReviewThreadPanel.js +4 -2
  114. package/dist/client/sign-out.d.ts +15 -0
  115. package/dist/client/sign-out.js +82 -0
  116. package/dist/client/use-action.d.ts +2 -0
  117. package/dist/client/use-action.js +4 -2
  118. package/dist/client/use-session.d.ts +23 -1
  119. package/dist/client/use-session.js +46 -0
  120. package/dist/collab/client.js +20 -5
  121. package/dist/collab/presence.d.ts +3 -1
  122. package/dist/collab/presence.js +48 -45
  123. package/dist/collab/routes.d.ts +1 -1
  124. package/dist/db/drizzle-config.d.ts +7 -0
  125. package/dist/db/drizzle-config.js +35 -9
  126. package/dist/db/drizzle-migrations.d.ts +28 -0
  127. package/dist/db/drizzle-migrations.js +81 -0
  128. package/dist/db/index.d.ts +1 -1
  129. package/dist/db/migrations.d.ts +13 -1
  130. package/dist/db/migrations.js +60 -31
  131. package/dist/db/schema.js +4 -1
  132. package/dist/deploy/build.d.ts +6 -0
  133. package/dist/deploy/build.js +41 -0
  134. package/dist/file-upload/actions/upload-image.d.ts +1 -1
  135. package/dist/mcp/index.d.ts +1 -1
  136. package/dist/mcp/index.js +1 -1
  137. package/dist/mcp/org-directory.d.ts +19 -7
  138. package/dist/mcp/org-directory.js +92 -68
  139. package/dist/mcp/screen-memory-stdio.d.ts +7 -7
  140. package/dist/notifications/routes.d.ts +3 -3
  141. package/dist/org/context.d.ts +6 -0
  142. package/dist/org/context.js +22 -0
  143. package/dist/org/index.d.ts +1 -1
  144. package/dist/org/index.js +1 -1
  145. package/dist/resources/store.d.ts +12 -0
  146. package/dist/resources/store.js +55 -0
  147. package/dist/server/agent-discovery.d.ts +18 -2
  148. package/dist/server/agent-discovery.js +191 -22
  149. package/dist/server/auth.js +3 -2
  150. package/dist/server/builder-browser.d.ts +0 -4
  151. package/dist/server/builder-browser.js +23 -8
  152. package/dist/server/google-oauth.d.ts +18 -0
  153. package/dist/server/google-oauth.js +3 -3
  154. package/dist/server/onboarding-html.js +3 -3
  155. package/dist/server/poll.d.ts +4 -2
  156. package/dist/server/poll.js +8 -3
  157. package/dist/server/realtime-token.d.ts +1 -1
  158. package/dist/server/short-lived-token.d.ts +1 -1
  159. package/dist/server/short-lived-token.js +1 -1
  160. package/dist/shared/environment-lanes.d.ts +1 -0
  161. package/dist/shared/environment-lanes.js +1 -0
  162. package/dist/shared/google-profile-image.d.ts +2 -0
  163. package/dist/shared/google-profile-image.js +24 -0
  164. package/dist/shared/index.d.ts +1 -0
  165. package/dist/shared/index.js +1 -0
  166. package/dist/styles/agent-conversation.css +13 -0
  167. package/docs/content/creating-templates.mdx +10 -1
  168. package/docs/content/server-database.mdx +49 -3
  169. package/docs/content/server-plugins.mdx +39 -3
  170. package/docs/content/webmcp.mdx +2 -0
  171. package/package.json +2 -1
  172. package/corpus/templates/analytics/data/explorer-configs/_autosave.json +0 -18
  173. package/corpus/templates/analytics/data/explorer-configs/steve-chart.json +0 -18
  174. package/corpus/templates/analytics/data/explorer-dashboards/dashboard-1773260837897.json +0 -10
  175. package/corpus/templates/analytics/data/sync-config.json +0 -8
  176. package/corpus/templates/brain/data/sync-config.json +0 -1
  177. package/corpus/templates/calendar/data/availability.json +0 -32
  178. package/corpus/templates/calendar/data/settings.json +0 -6
  179. package/corpus/templates/calendar/data/sync-config.json +0 -10
  180. package/corpus/templates/chat/data/sync-config.json +0 -1
  181. package/corpus/templates/clips/data/sync-config.json +0 -1
  182. package/corpus/templates/clips/desktop/src/lib/audio-meter.ts +0 -80
  183. package/corpus/templates/clips/desktop/src/overlays/live-audio-bars.tsx +0 -113
  184. package/corpus/templates/design/data/sync-config.json +0 -1
  185. package/corpus/templates/factory/data/sync-config.json +0 -1
  186. package/corpus/templates/forms/data/settings.json +0 -8
  187. package/corpus/templates/forms/data/sync-config.json +0 -3
  188. package/corpus/templates/macros/data/sync-config.json +0 -4
  189. package/corpus/templates/mail/data/emails.defaults.json +0 -1
  190. package/corpus/templates/mail/data/labels.defaults.json +0 -59
  191. package/corpus/templates/mail/data/settings.defaults.json +0 -9
  192. package/corpus/templates/mail/data/sync-config.json +0 -8
  193. package/corpus/templates/slides/data/sync-config.json +0 -8
  194. package/corpus/templates/tasks/data/sync-config.json +0 -1
  195. package/dist/templates/chat/data/.gitkeep +0 -0
  196. package/dist/templates/chat/data/sync-config.json +0 -1
  197. package/dist/templates/default/data/.gitkeep +0 -0
  198. package/dist/templates/default/data/sync-config.json +0 -1
  199. package/src/templates/chat/data/.gitkeep +0 -0
  200. package/src/templates/chat/data/sync-config.json +0 -1
  201. package/src/templates/default/data/.gitkeep +0 -0
  202. package/src/templates/default/data/sync-config.json +0 -1
@@ -816,19 +816,24 @@ export class AppSyncState {
816
816
  return (this.getChangeVisibilityForUser(event, userEmail, orgId) === "visible");
817
817
  }
818
818
  getChangeVisibilityForUser(event, userEmail, orgId) {
819
+ const normalizedUserEmail = userEmail.trim().toLowerCase();
819
820
  // Global / unowned events: every authenticated user gets them. Events that
820
821
  // predate resource tagging (owner/org only, no resourceType) keep the exact
821
822
  // conservative contract they had before.
822
823
  if (!event.owner && !event.orgId && !event.resourceType)
823
824
  return "visible";
824
- if (event.owner && event.owner === userEmail)
825
+ if (typeof event.owner === "string" &&
826
+ event.owner.trim().toLowerCase() === normalizedUserEmail) {
825
827
  return "visible";
828
+ }
826
829
  if (event.orgId && orgId && event.orgId === orgId)
827
830
  return "visible";
831
+ if (event.visibility === "public")
832
+ return "visible";
828
833
  // Access-aware branch: only when the event carries BOTH resourceType and
829
834
  // resourceId and the owner/org fast paths above did not already grant.
830
835
  if (event.resourceType && event.resourceId) {
831
- const key = accessCacheKey(userEmail, orgId, event.resourceType, event.resourceId);
836
+ const key = accessCacheKey(normalizedUserEmail, orgId, event.resourceType, event.resourceId);
832
837
  const cached = this.accessCache.get(key);
833
838
  const now = Date.now();
834
839
  if (cached &&
@@ -838,7 +843,7 @@ export class AppSyncState {
838
843
  }
839
844
  // Miss or expired: do NOT deliver this event, but schedule the async check
840
845
  // so the user's next event (or poll cycle) resolves correctly.
841
- this.scheduleAccessCheck(key, event.resourceType, event.resourceId, userEmail, orgId);
846
+ this.scheduleAccessCheck(key, event.resourceType, event.resourceId, normalizedUserEmail, orgId);
842
847
  return "pending";
843
848
  }
844
849
  return "hidden";
@@ -26,8 +26,8 @@ export declare function createRealtimeTokenHandler(): import("h3").EventHandlerW
26
26
  expiresAt?: undefined;
27
27
  ttlSeconds?: undefined;
28
28
  } | {
29
- error?: undefined;
30
29
  token: string;
31
30
  expiresAt: string;
32
31
  ttlSeconds: number;
32
+ error?: undefined;
33
33
  }>>;
@@ -10,7 +10,7 @@
10
10
  * payload = base64url(JSON.stringify({ resourceId, viewerEmail?, exp }))
11
11
  * sig = base64url(HMAC-SHA256(payload, key))
12
12
  *
13
- * Key resolution mirrors `google-oauth.ts:getStateSigningKey`:
13
+ * Key resolution mirrors `google-oauth.ts:getOAuthStateSigningKey`:
14
14
  * 1. OAUTH_STATE_SECRET (preferred — dedicated to short-lived signing)
15
15
  * 2. BETTER_AUTH_SECRET (already used as a server secret)
16
16
  * 3. Hosted workspace deploys derive a per-purpose key from A2A_SECRET
@@ -10,7 +10,7 @@
10
10
  * payload = base64url(JSON.stringify({ resourceId, viewerEmail?, exp }))
11
11
  * sig = base64url(HMAC-SHA256(payload, key))
12
12
  *
13
- * Key resolution mirrors `google-oauth.ts:getStateSigningKey`:
13
+ * Key resolution mirrors `google-oauth.ts:getOAuthStateSigningKey`:
14
14
  * 1. OAUTH_STATE_SECRET (preferred — dedicated to short-lived signing)
15
15
  * 2. BETTER_AUTH_SECRET (already used as a server secret)
16
16
  * 3. Hosted workspace deploys derive a per-purpose key from A2A_SECRET
@@ -5,6 +5,7 @@ export declare const BETA_FORCE_QUERY_PARAM = "force";
5
5
  export declare const BETA_FORCE_SESSION_STORAGE_KEY = "agent-native:force-production";
6
6
  export declare const ENVIRONMENT_BETA_HOSTS: {
7
7
  readonly "agent-workspace.builder.io": "beta.agent-workspace.builder.io";
8
+ readonly "builder-agent-native-workspace.netlify.app": "beta.agent-workspace.builder.io";
8
9
  readonly "analytics.agent-native.com": "beta.analytics.agent-native.com";
9
10
  readonly "assets.agent-native.com": "beta.assets.agent-native.com";
10
11
  readonly "brain.agent-native.com": "beta.brain.agent-native.com";
@@ -5,6 +5,7 @@ export const BETA_FORCE_QUERY_PARAM = "force";
5
5
  export const BETA_FORCE_SESSION_STORAGE_KEY = "agent-native:force-production";
6
6
  export const ENVIRONMENT_BETA_HOSTS = {
7
7
  "agent-workspace.builder.io": "beta.agent-workspace.builder.io",
8
+ "builder-agent-native-workspace.netlify.app": "beta.agent-workspace.builder.io",
8
9
  "analytics.agent-native.com": "beta.analytics.agent-native.com",
9
10
  "assets.agent-native.com": "beta.assets.agent-native.com",
10
11
  "brain.agent-native.com": "beta.brain.agent-native.com",
@@ -0,0 +1,2 @@
1
+ /** Accept only HTTPS images served from Google's profile-image CDN. */
2
+ export declare function isGoogleProfileImageUrl(value: unknown): value is string;
@@ -0,0 +1,24 @@
1
+ const GOOGLE_PROFILE_IMAGE_HOST = "googleusercontent.com";
2
+ /** Accept only HTTPS images served from Google's profile-image CDN. */
3
+ export function isGoogleProfileImageUrl(value) {
4
+ if (typeof value !== "string")
5
+ return false;
6
+ const candidate = value.trim();
7
+ if (!candidate)
8
+ return false;
9
+ let url;
10
+ try {
11
+ url = new URL(candidate);
12
+ }
13
+ catch {
14
+ // coercion-ok: malformed profile URLs are invalid input, not a successful value
15
+ return false;
16
+ }
17
+ const hostname = url.hostname.toLowerCase();
18
+ return (url.protocol === "https:" &&
19
+ !url.username &&
20
+ !url.password &&
21
+ !url.port &&
22
+ (hostname === GOOGLE_PROFILE_IMAGE_HOST ||
23
+ hostname.endsWith(`.${GOOGLE_PROFILE_IMAGE_HOST}`)));
24
+ }
@@ -1,6 +1,7 @@
1
1
  export { agentChat, type AgentChatMessage, type AgentChatCallOptions, type AgentChatResponse, } from "./agent-chat.js";
2
2
  export { agentEnv, type EnvVar } from "./agent-env.js";
3
3
  export { extractOAuthStateAppId } from "./oauth-state.js";
4
+ export { isGoogleProfileImageUrl } from "./google-profile-image.js";
4
5
  export { SIGN_IN_CONTINUATION_MAX_LENGTH, SIGN_IN_CONTINUATION_PARAM, SIGN_IN_ENTRY_PATH, SIGN_IN_LEGACY_ENTRY_PATH, SIGN_IN_LEGACY_RETURN_PARAM, decodeContinuation, encodeContinuation, normalizeAppPath, signInJourney, signInJourneyInlineScript, type SignInJourney, type SignInJourneyInput, } from "./sign-in-journey.js";
5
6
  export { truncate } from "./truncate.js";
6
7
  export { isHumanReadableDocumentTitle, normalizeDocumentTitle, } from "./document-title.js";
@@ -1,6 +1,7 @@
1
1
  export { agentChat, } from "./agent-chat.js";
2
2
  export { agentEnv } from "./agent-env.js";
3
3
  export { extractOAuthStateAppId } from "./oauth-state.js";
4
+ export { isGoogleProfileImageUrl } from "./google-profile-image.js";
4
5
  export { SIGN_IN_CONTINUATION_MAX_LENGTH, SIGN_IN_CONTINUATION_PARAM, SIGN_IN_ENTRY_PATH, SIGN_IN_LEGACY_ENTRY_PATH, SIGN_IN_LEGACY_RETURN_PARAM, decodeContinuation, encodeContinuation, normalizeAppPath, signInJourney, signInJourneyInlineScript, } from "./sign-in-journey.js";
5
6
  export { truncate } from "./truncate.js";
6
7
  export { isHumanReadableDocumentTitle, normalizeDocumentTitle, } from "./document-title.js";
@@ -124,6 +124,19 @@
124
124
  padding-inline-start: 20px;
125
125
  }
126
126
 
127
+ .agent-conversation-markdown ul:not(.contains-task-list) {
128
+ list-style-type: disc;
129
+ }
130
+
131
+ .agent-conversation-markdown ol:not(.contains-task-list) {
132
+ list-style-type: decimal;
133
+ }
134
+
135
+ .agent-conversation-markdown ul.contains-task-list,
136
+ .agent-conversation-markdown ol.contains-task-list {
137
+ list-style-type: none;
138
+ }
139
+
127
140
  .agent-conversation-markdown li {
128
141
  margin: 3px 0;
129
142
  padding-inline-start: 2px;
@@ -212,7 +212,16 @@ export const projects = table("projects", {
212
212
  export const projectShares = createSharesTable("project_shares");
213
213
  ```
214
214
 
215
- Schema changes must be additive. Add tables and columns through `runMigrations()` in `server/plugins/db.ts`; never use destructive SQL, `drizzle-kit push`, table renames, or column drops.
215
+ Schema changes must be additive. For new app-owned tables and columns, use
216
+ `drizzle-kit generate` to create reviewed SQL under
217
+ `server/db/migrations/<id_name>.sql`, then load it through
218
+ `runDrizzleMigrations()` from the release migration command on Node.js
219
+ deployments. Cloudflare Workers/Pages and D1 have no deployable filesystem, so
220
+ keep generated SQL in entries embedded in the worker bundle and pass them to
221
+ `runMigrations()`. Keep using `runMigrations()` for existing handwritten history
222
+ and cases that need dialect-specific SQL, D1-specific behavior, data backfills,
223
+ or deferred JavaScript steps. Never use destructive SQL, `drizzle-kit push`,
224
+ table renames, or column drops.
216
225
 
217
226
  For app reads and writes, use Drizzle's query builder and portable operators from `drizzle-orm`. Do not write product code with raw SQL when Drizzle can express the query, and do not import from `drizzle-orm/sqlite-core` or `drizzle-orm/pg-core` in templates.
218
227
 
@@ -5,7 +5,7 @@ description: "Connect a portable SQL database to your agent-native app: schema h
5
5
 
6
6
  # Database
7
7
 
8
- <!-- i18n-copy-ignore: Agent-Native is a proper name; punctuation is locale-invariant. -->
8
+ <!-- i18n-copy-ignore: Agent-Native is a proper name; punctuation is locale-invariant, including migration runner references. -->
9
9
 
10
10
  Every agent-native app stores its state in SQL. The UI and the agent both read and write the same tables through the same actions, using the same [Drizzle ORM](https://orm.drizzle.team) client. Live sync uses SSE with polling fallback, so changes appear in the other surface without a manual refresh.
11
11
 
@@ -249,6 +249,52 @@ For local development, schema changes can run through a Nitro plugin in
249
249
  skips it on later runs. Give new entries a stable `name`; named migrations are
250
250
  tracked independently of their version number.
251
251
 
252
+ ### Generate new app migrations with Drizzle Kit {#drizzle-migrations}
253
+
254
+ For new app-owned schema changes, use Drizzle Kit to generate reviewed SQL:
255
+
256
+ ```bash
257
+ pnpm db:generate
258
+ ```
259
+
260
+ <!-- i18n-copy-ignore: Agent-Native punctuation is locale-invariant; formatting-only blank line, no translated prose changed. -->
261
+
262
+ This creates `server/db/migrations/<id_name>.sql`. Commit the generated file and
263
+ review its SQL before shipping it. `runDrizzleMigrations`
264
+ loads those files into the shared Agent-Native runner on Node.js and Node-based
265
+ serverless runtimes, so release authorization, dialect handling, and bookkeeping
266
+ stay in one place:
267
+
268
+ ```ts filename="server/db/migrations.ts"
269
+ import { runDrizzleMigrations } from "@agent-native/core/db/drizzle-migrations";
270
+
271
+ export default runDrizzleMigrations(new URL("./migrations", import.meta.url), {
272
+ table: "my_app_migrations",
273
+ dialect: "postgresql",
274
+ });
275
+ ```
276
+
277
+ Re-export that plugin from `server/plugins/db.ts` so the same `./migrations`
278
+ path works from source and from the emitted server bundle:
279
+
280
+ ```ts filename="server/plugins/db.ts"
281
+ export { default } from "../db/migrations.js";
282
+ ```
283
+
284
+ The filesystem-backed loader is not available in Cloudflare Workers/Pages or
285
+ other filesystem-free edge runtimes, including D1. Keep using `runMigrations()`
286
+ there with SQL entries embedded in the worker bundle. A single Drizzle output
287
+ folder has one dialect-specific metadata baseline, so generate against the
288
+ primary deployment dialect and do not switch the same folder between SQLite and
289
+ PostgreSQL.
290
+
291
+ If an app already has handwritten entries, keep that history and load generated
292
+ entries into the same `runMigrations()` source after it. Do not give one schema
293
+ two independent migration owners. Generate against the primary deployment
294
+ dialect and keep using handwritten `runMigrations()` entries for framework
295
+ tables, D1-only or dialect-specific SQL, data backfills, and deferred JavaScript
296
+ steps.
297
+
252
298
  <Callout tone="warning">
253
299
  For production or serverless deployments, run migrations in a release or
254
300
  deploy step instead of on the first request. The Chat template provides `pnpm
@@ -277,14 +323,14 @@ tracked independently of their version number.
277
323
  drop them, causing immediate data loss.
278
324
  </Callout>
279
325
 
280
- `drizzle.config.ts` at the root of each app configures drizzle-kit for local development schema inspection:
326
+ `drizzle.config.ts` at the root of each app configures drizzle-kit for local development schema inspection and migration generation. If one migration folder serves multiple runtime backends, pass its primary dialect explicitly, for example `createDrizzleConfig({ dialect: "postgresql" })`:
281
327
 
282
328
  ```ts filename="drizzle.config.ts"
283
329
  import { createDrizzleConfig } from "@agent-native/core/db/drizzle-config";
284
330
  export default createDrizzleConfig();
285
331
  ```
286
332
 
287
- Use `pnpm db:generate` to inspect your schema and `pnpm db:push` against a local database only.
333
+ Use `pnpm db:generate` to create reviewed migration files and `pnpm db:push` against a local database only. Production schema changes go through the release migration command.
288
334
 
289
335
  ### 4. Query in actions {#querying}
290
336
 
@@ -21,7 +21,7 @@ Apps that need custom database tables add a third:
21
21
 
22
22
  ```text
23
23
  server/plugins/
24
- db.ts -> register app-owned migrations for local startup
24
+ db.ts -> register app-owned migrations for local startup and releases
25
25
  ```
26
26
 
27
27
  ## Auth Plugin {#auth-plugin}
@@ -80,7 +80,33 @@ screen when context matters.`,
80
80
 
81
81
  ## Database Plugin {#database-plugin}
82
82
 
83
- If your app defines custom database tables, add `server/plugins/db.ts` to register schema migrations for local startup. It uses `runMigrations` from `@agent-native/core/db`:
83
+ If your app defines custom database tables, add `server/plugins/db.ts` to register schema migrations. For new app-owned tables and columns, prefer Drizzle Kit generated SQL with `runDrizzleMigrations`:
84
+
85
+ ```ts filename="server/db/migrations.ts"
86
+ import { runDrizzleMigrations } from "@agent-native/core/db/drizzle-migrations";
87
+
88
+ export default runDrizzleMigrations(new URL("./migrations", import.meta.url), {
89
+ table: "my_app_migrations",
90
+ dialect: "postgresql",
91
+ });
92
+ ```
93
+
94
+ Keep this loader module under `server/db/` and re-export it from
95
+ `server/plugins/db.ts` so `./migrations` resolves correctly from source and
96
+ from the emitted server bundle:
97
+
98
+ ```ts filename="server/plugins/db.ts"
99
+ export { default } from "../db/migrations.js";
100
+ ```
101
+
102
+ This filesystem-backed helper is for Node.js and Node-based serverless
103
+ deployments. Cloudflare Workers/Pages and D1 do not provide a deployable
104
+ filesystem, so use `runMigrations()` with SQL entries embedded in the worker
105
+ bundle instead.
106
+
107
+ Use `runMigrations` from `@agent-native/core/db` for handwritten entries and
108
+ cases that need dialect-specific SQL, D1-specific behavior, data backfills, or
109
+ deferred JavaScript steps:
84
110
 
85
111
  ```ts filename="server/plugins/db.ts"
86
112
  import { runMigrations } from "@agent-native/core/db";
@@ -103,7 +129,17 @@ export default runMigrations(
103
129
  );
104
130
  ```
105
131
 
106
- Each entry needs a `version` number and a `sql` string. Give it a stable `name` too — `runMigrations` tracks named entries independently of `version`, so it still applies exactly once even if another branch reuses the same version number for unrelated DDL. The `table` option names the migration tracking table. Use a name unique to your app so it does not collide with framework migrations. See [Database](/docs/server-database#migrations) for the full schema authoring guide and the name-based tracking rationale.
132
+ Each handwritten entry needs a `version` number and a `sql` string. Give it a
133
+ stable `name` too. `runMigrations` tracks named entries independently of
134
+ `version`, so it still applies exactly once even if another branch reuses the
135
+ same version number for unrelated DDL. The `table` option names the migration
136
+ tracking table. Use a name unique to your app so it does not collide with
137
+ framework migrations. See [Database](/docs/server-database#migrations) for the
138
+ full schema authoring guide and the name-based tracking rationale.
139
+
140
+ On Node.js runtimes, `runDrizzleMigrations` reads each committed `<id_name>.sql`
141
+ file lazily after the shared request guard. Both helpers remain release-safe. The explicit
142
+ `migrate:production` command is the production owner of schema changes.
107
143
 
108
144
  <Callout tone="warning">
109
145
  Migrations must be additive. Never put destructive SQL (`DROP TABLE`, `ALTER
@@ -15,6 +15,8 @@ discover them, and the browser mediates execution.
15
15
 
16
16
  The framework supports both directions:
17
17
 
18
+ <!-- i18n-copy-ignore: oxfmt-only table alignment; no translated prose changed. -->
19
+
18
20
  | You want to... | Use |
19
21
  | ------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------- |
20
22
  | Make selected actions in your app available to a browser agent | `createAgentNativeWebMcpRegistration` |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-native/core",
3
- "version": "0.175.4",
3
+ "version": "0.175.5-nightly-20260827014436",
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": {
@@ -109,6 +109,7 @@
109
109
  "./db-admin": "./dist/db-admin/index.js",
110
110
  "./db/schema": "./dist/db/schema.js",
111
111
  "./db/drizzle-config": "./dist/db/drizzle-config.js",
112
+ "./db/drizzle-migrations": "./dist/db/drizzle-migrations.js",
112
113
  "./client": "./dist/client/index.js",
113
114
  "./client/agent-chat": "./dist/client/agent-chat/index.js",
114
115
  "./client/chat-first": "./dist/client/chat-first/index.js",
@@ -1,18 +0,0 @@
1
- {
2
- "name": "Example chart",
3
- "events": [
4
- {
5
- "event": "agent chat message submitted",
6
- "filters": [
7
- {
8
- "property": "org_subscription",
9
- "operator": "=",
10
- "value": ""
11
- }
12
- ],
13
- "groupBy": ["org_subscription"]
14
- }
15
- ],
16
- "chartType": "line",
17
- "dateRange": "30d"
18
- }
@@ -1,18 +0,0 @@
1
- {
2
- "name": "Example chart",
3
- "events": [
4
- {
5
- "event": "agent chat message submitted",
6
- "filters": [
7
- {
8
- "property": "org_subscription",
9
- "operator": "=",
10
- "value": ""
11
- }
12
- ],
13
- "groupBy": ["org_subscription"]
14
- }
15
- ],
16
- "chartType": "line",
17
- "dateRange": "30d"
18
- }
@@ -1,10 +0,0 @@
1
- {
2
- "name": "Cool test",
3
- "charts": [
4
- {
5
- "id": "steve-chart-1773260840790",
6
- "configId": "steve-chart",
7
- "width": 1
8
- }
9
- ]
10
- }
@@ -1,8 +0,0 @@
1
- {
2
- "syncFilePatterns": [
3
- "data/explorer-configs/**/*.json",
4
- "data/explorer-dashboards/**/*.json",
5
- "!data/sync-config.json"
6
- ],
7
- "privateSyncFilePatterns": []
8
- }
@@ -1 +0,0 @@
1
- { "patterns": ["data/**/*.json"] }
@@ -1,32 +0,0 @@
1
- {
2
- "timezone": "America/New_York",
3
- "weeklySchedule": {
4
- "monday": {
5
- "enabled": true,
6
- "slots": [{ "start": "09:00", "end": "17:00" }]
7
- },
8
- "tuesday": {
9
- "enabled": true,
10
- "slots": [{ "start": "09:00", "end": "17:00" }]
11
- },
12
- "wednesday": {
13
- "enabled": true,
14
- "slots": [{ "start": "09:00", "end": "17:00" }]
15
- },
16
- "thursday": {
17
- "enabled": true,
18
- "slots": [{ "start": "09:00", "end": "17:00" }]
19
- },
20
- "friday": {
21
- "enabled": true,
22
- "slots": [{ "start": "09:00", "end": "17:00" }]
23
- },
24
- "saturday": { "enabled": false, "slots": [] },
25
- "sunday": { "enabled": false, "slots": [] }
26
- },
27
- "bufferMinutes": 15,
28
- "minNoticeHours": 1,
29
- "maxAdvanceDays": 60,
30
- "slotDurationMinutes": 30,
31
- "bookingPageSlug": "meeting"
32
- }
@@ -1,6 +0,0 @@
1
- {
2
- "timezone": "America/New_York",
3
- "bookingPageTitle": "Book a Meeting",
4
- "bookingPageDescription": "Pick a time that works for you.",
5
- "defaultEventDuration": 30
6
- }
@@ -1,10 +0,0 @@
1
- {
2
- "syncFilePatterns": [
3
- "data/events/**/*.json",
4
- "data/bookings/**/*.json",
5
- "data/availability.json",
6
- "data/settings.json",
7
- "!data/sync-config.json",
8
- "!data/google-auth.json"
9
- ]
10
- }
@@ -1 +0,0 @@
1
- { "patterns": ["data/**/*.json"] }
@@ -1 +0,0 @@
1
- { "patterns": ["data/**/*.json"] }
@@ -1,80 +0,0 @@
1
- /**
2
- * Level math for the Granola-style waveform meter on the recording pill.
3
- *
4
- * Kept separate from the React overlay so the "bars must track how loud people
5
- * are talking" behaviour is unit-testable without a DOM.
6
- */
7
-
8
- /** Per-bar scale. The middle bar swings widest, like Granola's meter. */
9
- export const METER_BAR_GAINS = [0.72, 1, 0.84];
10
- export const METER_BAR_COUNT = METER_BAR_GAINS.length;
11
- /** Height (0-1) each bar keeps at silence, so the meter idles as three dots. */
12
- export const METER_IDLE_HEIGHT = 0.14;
13
- /** Multiplier applied on every sample tick when no louder audio arrives. */
14
- export const METER_LEVEL_DECAY = 0.82;
15
- /** Floor a new sample must clear, so the meter falls smoothly instead of snapping. */
16
- export const METER_ATTACK_DECAY = 0.55;
17
- /**
18
- * How long the meter waits for the next capture buffer before decaying on its
19
- * own. Capture drives the bars; this only covers pause / teardown, where the
20
- * events stop and a frozen tall bar would claim someone is still talking.
21
- */
22
- export const METER_IDLE_MS = 120;
23
-
24
- /** Fold an incoming 0-1 audio level into the current level. */
25
- export function nextMeterLevel(current: number, incoming: number): number {
26
- if (!Number.isFinite(incoming)) return current;
27
- const clamped = Math.max(0, Math.min(1, incoming));
28
- return Math.max(current * METER_ATTACK_DECAY, clamped);
29
- }
30
-
31
- export type MeterSource = "mic" | "system";
32
- export type MeterSourceLevels = Record<MeterSource, number>;
33
-
34
- export const EMPTY_METER_SOURCES: MeterSourceLevels = { mic: 0, system: 0 };
35
-
36
- /**
37
- * Fold one capture buffer into the per-source levels. Mic and system audio
38
- * interleave on a single event, so each stream has to decay on its own frames
39
- * only — one shared level lets a silent mic halve the level of whoever is
40
- * actually talking on every other event, which pins the meter to its floor.
41
- */
42
- export function foldMeterSources(
43
- levels: MeterSourceLevels,
44
- source: MeterSource,
45
- incoming: number,
46
- ): MeterSourceLevels {
47
- return { ...levels, [source]: nextMeterLevel(levels[source], incoming) };
48
- }
49
-
50
- /** What the bars show: whichever side of the conversation is louder. */
51
- export function combinedMeterLevel(levels: MeterSourceLevels): number {
52
- return Math.max(levels.mic, levels.system);
53
- }
54
-
55
- /** One decay tick. Snaps to silence below a threshold so bars settle at rest. */
56
- export function decayMeterLevel(current: number): number {
57
- const decayed = current * METER_LEVEL_DECAY;
58
- return decayed < 0.01 ? 0 : decayed;
59
- }
60
-
61
- /**
62
- * Push the newest sample onto the front of the meter's history. Bar 0 shows
63
- * the newest level and older levels travel outward, so the bars ripple against
64
- * each other instead of moving as one block.
65
- */
66
- export function advanceMeterLevels(levels: number[], sample: number): number[] {
67
- return [sample, ...levels.slice(0, METER_BAR_COUNT - 1)];
68
- }
69
-
70
- /**
71
- * Bar height as a percentage of the meter's box. Peak levels from speech taps
72
- * are often quiet even when speech is clear, so a gentle curve keeps the meter
73
- * responsive without turning background noise into a full-height signal.
74
- */
75
- export function meterBarHeight(level: number, barIndex: number): number {
76
- const gain = METER_BAR_GAINS[barIndex] ?? 1;
77
- const safe = Number.isFinite(level) ? Math.max(0, Math.min(1, level)) : 0;
78
- const shaped = safe > 0 ? Math.min(1, Math.pow(safe, 0.45) * 1.25) : 0;
79
- return (METER_IDLE_HEIGHT + shaped * gain * (1 - METER_IDLE_HEIGHT)) * 100;
80
- }