@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.
- package/corpus/templates/analytics/actions/get-explorer-dashboard.ts +1 -0
- package/corpus/templates/analytics/app/components/auth/AuthProvider.tsx +8 -6
- package/corpus/templates/analytics/app/components/dashboard/SqlChart.tsx +32 -0
- package/corpus/templates/analytics/app/components/layout/Layout.tsx +1 -1
- package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +66 -7
- package/corpus/templates/analytics/app/lib/prefetch-keys.ts +10 -0
- package/corpus/templates/analytics/app/pages/adhoc/explorer-dashboard/index.tsx +9 -7
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/index.tsx +10 -11
- package/corpus/templates/analytics/changelog/2026-08-24-feature-flag-changes-recover-from-temporary-workspace-direct.md +6 -0
- package/corpus/templates/analytics/changelog/2026-08-26-analytics-distinguishes-daily-from-weekly-activity-shows-sta.md +6 -0
- package/corpus/templates/analytics/changelog/2026-08-26-dashboard-metadata-now-shows-the-original-creator-separately.md +6 -0
- package/corpus/templates/analytics/changelog/2026-08-26-dashboard-names-stay-editable-when-the-analytics-sidebar-ref.md +6 -0
- package/corpus/templates/analytics/changelog/2026-08-26-fixed-the-agent-re-asking-dashboard-scope-questions-you-had-.md +6 -0
- package/corpus/templates/analytics/server/db/schema.ts +2 -0
- package/corpus/templates/analytics/server/lib/agent-readable-resource-context.ts +8 -2
- package/corpus/templates/analytics/server/lib/dashboards-store.ts +5 -0
- package/corpus/templates/analytics/server/lib/first-party-metric-catalog.ts +6 -4
- package/corpus/templates/analytics/server/lib/migrate-analytics-artifacts.ts +19 -1
- package/corpus/templates/analytics/server/lib/workspace-feature-flags.ts +40 -9
- package/corpus/templates/analytics/server/plugins/db.ts +10 -0
- package/corpus/templates/analytics/server/routes/api/dashboard-agent-context.json.get.ts +1 -0
- package/corpus/templates/analytics/shared/feature-flags.ts +11 -1
- package/corpus/templates/calendar/app/components/calendar/GoogleConnectBanner.tsx +2 -9
- package/corpus/templates/clips/.agents/skills/ai-video-tools/SKILL.md +8 -7
- package/corpus/templates/clips/.agents/skills/recording/SKILL.md +9 -8
- package/corpus/templates/clips/actions/import-loom-recording.ts +1 -1
- package/corpus/templates/clips/actions/lib/loom-import-job.ts +52 -35
- package/corpus/templates/clips/actions/request-transcript.ts +6 -183
- package/corpus/templates/clips/app/components/clips-avatar.tsx +46 -0
- package/corpus/templates/clips/app/components/library/recording-card.tsx +8 -7
- package/corpus/templates/clips/app/components/library/space-card.tsx +8 -5
- package/corpus/templates/clips/app/components/meetings/attendee-stack.tsx +7 -8
- package/corpus/templates/clips/app/components/meetings/transcript-bubbles.tsx +19 -12
- package/corpus/templates/clips/app/components/player/transcript-panel.tsx +128 -94
- package/corpus/templates/clips/app/components/recorder/microphone-visualizer.tsx +25 -104
- package/corpus/templates/clips/app/components/workspace/members-list.tsx +8 -6
- package/corpus/templates/clips/app/components/workspace/notifications-list.tsx +8 -6
- package/corpus/templates/clips/app/components/workspace/top-creators-table.tsx +8 -6
- package/corpus/templates/clips/app/routes/_app.meetings.$meetingId.tsx +8 -7
- package/corpus/templates/clips/app/routes/_app.settings._index.tsx +0 -26
- package/corpus/templates/clips/app/routes/r.$recordingId.tsx +1 -4
- package/corpus/templates/clips/changelog/2026-08-26-detected-calls-no-longer-duplicate-meetings-or-strand-the-prompt.md +6 -0
- package/corpus/templates/clips/desktop/src/app.tsx +8 -10
- package/corpus/templates/clips/desktop/src/components/live-waveform.tsx +99 -0
- package/corpus/templates/clips/desktop/src/hooks/useMeetingTranscription.ts +248 -55
- package/corpus/templates/clips/desktop/src/lib/agent-steps.ts +477 -0
- package/corpus/templates/clips/desktop/src/lib/ask-sheet-layout.ts +71 -0
- package/corpus/templates/clips/desktop/src/lib/meeting-ask.ts +297 -0
- package/corpus/templates/clips/desktop/src/lib/url.ts +24 -0
- package/corpus/templates/clips/desktop/src/overlays/ask-steps.tsx +155 -0
- package/corpus/templates/clips/desktop/src/overlays/flow-bar.tsx +7 -81
- package/corpus/templates/clips/desktop/src/overlays/live-transcript.tsx +29 -2
- package/corpus/templates/clips/desktop/src/overlays/meeting-notification.tsx +80 -22
- package/corpus/templates/clips/desktop/src/overlays/record-pill.tsx +13 -53
- package/corpus/templates/clips/desktop/src/overlays/recording-pill.tsx +1017 -82
- package/corpus/templates/clips/desktop/src/styles.css +796 -57
- package/corpus/templates/clips/desktop/src/tailwind.css +23 -2
- package/corpus/templates/clips/desktop/src-tauri/src/adhoc_meetings_watcher.rs +1765 -219
- package/corpus/templates/clips/desktop/src-tauri/src/lib.rs +6 -0
- package/corpus/templates/clips/desktop/src-tauri/src/meetings_watcher.rs +45 -30
- package/corpus/templates/clips/desktop/src-tauri/src/native_screen/custom_capture.rs +5 -3
- package/corpus/templates/clips/desktop/src-tauri/src/notifications.rs +91 -0
- package/corpus/templates/clips/desktop/src-tauri/src/recording_indicator.rs +123 -27
- package/corpus/templates/clips/server/routes/_agent-native/google/callback.get.ts +16 -0
- package/corpus/templates/clips/shared/audio-meter.ts +145 -0
- package/corpus/templates/clips/shared/clips-ai-prefs.ts +0 -1
- package/corpus/templates/clips/shared/live-waveform.tsx +119 -0
- package/corpus/templates/content/app/components/editor/CommentsSidebar.tsx +44 -22
- package/corpus/templates/content/app/components/ui/avatar.tsx +1 -0
- package/corpus/templates/design/app/components/visual-editor/ReviewCanvasPins.tsx +4 -1
- package/corpus/templates/design/app/hooks/use-question-flow.ts +9 -2
- package/corpus/templates/design/app/pages/DesignSystemSetup.tsx +111 -37
- package/corpus/templates/design/changelog/2026-08-26-design-no-longer-asks-users-to-confirm-guided-questions-they-have-already-answered.md +6 -0
- package/corpus/templates/dispatch/changelog/2026-08-26-signing-out-goes-straight-to-the-sign-in-page.md +5 -0
- package/corpus/templates/dispatch/server/lib/org-apps-directory.ts +96 -47
- package/corpus/templates/dispatch/server/plugins/org-apps-directory.ts +73 -29
- package/corpus/templates/factory/.env.example +6 -2
- package/corpus/templates/factory/AGENTS.md +3 -3
- package/corpus/templates/factory/README.md +4 -2
- package/corpus/templates/factory/server/connectors/credentials.ts +70 -4
- package/corpus/templates/mail/actions/get-email.ts +68 -21
- package/corpus/templates/mail/actions/get-thread.ts +92 -51
- package/corpus/templates/mail/app/components/GoogleConnectBanner.tsx +2 -9
- package/corpus/templates/mail/app/hooks/use-emails.ts +7 -4
- package/corpus/templates/mail/server/lib/mail-connector-catalog.ts +7 -4
- package/corpus/templates/plan/app/pages/PlansPage.tsx +23 -15
- package/corpus/templates/slides/actions/add-deck.ts +20 -0
- package/corpus/templates/slides/actions/create-deck.ts +17 -7
- package/corpus/templates/slides/actions/delete-deck.ts +45 -5
- package/corpus/templates/slides/actions/get-deck.ts +77 -11
- package/corpus/templates/slides/actions/patch-deck.ts +14 -2
- package/corpus/templates/slides/actions/save-deck.ts +20 -0
- package/corpus/templates/slides/app/components/comments/SlideCommentsPanel.tsx +18 -7
- package/corpus/templates/slides/app/components/design-system/DesignSystemSetup.tsx +38 -14
- package/corpus/templates/slides/app/components/editor/EditorToolbar.tsx +2 -2
- package/corpus/templates/slides/app/components/ui/avatar.tsx +1 -0
- package/corpus/templates/slides/server/handlers/decks.ts +10 -0
- package/corpus/templates/slides/shared/slide-ids.ts +133 -0
- package/corpus/templates/tasks/DEVELOPING.md +8 -0
- package/corpus/templates/tasks/drizzle.config.ts +3 -1
- package/corpus/templates/tasks/drizzle.local.config.ts +6 -0
- package/corpus/templates/tasks/package.json +2 -1
- package/corpus/templates/tasks/server/db/migrations/meta/0000_snapshot.json +234 -0
- package/corpus/templates/tasks/server/db/migrations/meta/_journal.json +13 -0
- package/corpus/templates/tasks/server/db/migrations.ts +110 -0
- package/corpus/templates/tasks/server/plugins/db.ts +3 -87
- package/dist/client/AssistantChat.js +3 -10
- package/dist/client/guided-questions.d.ts +11 -1
- package/dist/client/guided-questions.js +24 -7
- package/dist/client/hooks/index.d.ts +2 -1
- package/dist/client/hooks/index.js +2 -1
- package/dist/client/org/OrgSwitcher.js +3 -17
- package/dist/client/review/ReviewThreadPanel.js +4 -2
- package/dist/client/sign-out.d.ts +15 -0
- package/dist/client/sign-out.js +82 -0
- package/dist/client/use-action.d.ts +2 -0
- package/dist/client/use-action.js +4 -2
- package/dist/client/use-session.d.ts +23 -1
- package/dist/client/use-session.js +46 -0
- package/dist/collab/client.js +20 -5
- package/dist/collab/presence.d.ts +3 -1
- package/dist/collab/presence.js +48 -45
- package/dist/collab/routes.d.ts +1 -1
- package/dist/db/drizzle-config.d.ts +7 -0
- package/dist/db/drizzle-config.js +35 -9
- package/dist/db/drizzle-migrations.d.ts +28 -0
- package/dist/db/drizzle-migrations.js +81 -0
- package/dist/db/index.d.ts +1 -1
- package/dist/db/migrations.d.ts +13 -1
- package/dist/db/migrations.js +60 -31
- package/dist/db/schema.js +4 -1
- package/dist/deploy/build.d.ts +6 -0
- package/dist/deploy/build.js +41 -0
- package/dist/file-upload/actions/upload-image.d.ts +1 -1
- package/dist/mcp/index.d.ts +1 -1
- package/dist/mcp/index.js +1 -1
- package/dist/mcp/org-directory.d.ts +19 -7
- package/dist/mcp/org-directory.js +92 -68
- package/dist/mcp/screen-memory-stdio.d.ts +7 -7
- package/dist/notifications/routes.d.ts +3 -3
- package/dist/org/context.d.ts +6 -0
- package/dist/org/context.js +22 -0
- package/dist/org/index.d.ts +1 -1
- package/dist/org/index.js +1 -1
- package/dist/resources/store.d.ts +12 -0
- package/dist/resources/store.js +55 -0
- package/dist/server/agent-discovery.d.ts +18 -2
- package/dist/server/agent-discovery.js +191 -22
- package/dist/server/auth.js +3 -2
- package/dist/server/builder-browser.d.ts +0 -4
- package/dist/server/builder-browser.js +23 -8
- package/dist/server/google-oauth.d.ts +18 -0
- package/dist/server/google-oauth.js +3 -3
- package/dist/server/onboarding-html.js +3 -3
- package/dist/server/poll.d.ts +4 -2
- package/dist/server/poll.js +8 -3
- package/dist/server/realtime-token.d.ts +1 -1
- package/dist/server/short-lived-token.d.ts +1 -1
- package/dist/server/short-lived-token.js +1 -1
- package/dist/shared/environment-lanes.d.ts +1 -0
- package/dist/shared/environment-lanes.js +1 -0
- package/dist/shared/google-profile-image.d.ts +2 -0
- package/dist/shared/google-profile-image.js +24 -0
- package/dist/shared/index.d.ts +1 -0
- package/dist/shared/index.js +1 -0
- package/dist/styles/agent-conversation.css +13 -0
- package/docs/content/creating-templates.mdx +10 -1
- package/docs/content/server-database.mdx +49 -3
- package/docs/content/server-plugins.mdx +39 -3
- package/docs/content/webmcp.mdx +2 -0
- package/package.json +2 -1
- package/corpus/templates/analytics/data/explorer-configs/_autosave.json +0 -18
- package/corpus/templates/analytics/data/explorer-configs/steve-chart.json +0 -18
- package/corpus/templates/analytics/data/explorer-dashboards/dashboard-1773260837897.json +0 -10
- package/corpus/templates/analytics/data/sync-config.json +0 -8
- package/corpus/templates/brain/data/sync-config.json +0 -1
- package/corpus/templates/calendar/data/availability.json +0 -32
- package/corpus/templates/calendar/data/settings.json +0 -6
- package/corpus/templates/calendar/data/sync-config.json +0 -10
- package/corpus/templates/chat/data/sync-config.json +0 -1
- package/corpus/templates/clips/data/sync-config.json +0 -1
- package/corpus/templates/clips/desktop/src/lib/audio-meter.ts +0 -80
- package/corpus/templates/clips/desktop/src/overlays/live-audio-bars.tsx +0 -113
- package/corpus/templates/design/data/sync-config.json +0 -1
- package/corpus/templates/factory/data/sync-config.json +0 -1
- package/corpus/templates/forms/data/settings.json +0 -8
- package/corpus/templates/forms/data/sync-config.json +0 -3
- package/corpus/templates/macros/data/sync-config.json +0 -4
- package/corpus/templates/mail/data/emails.defaults.json +0 -1
- package/corpus/templates/mail/data/labels.defaults.json +0 -59
- package/corpus/templates/mail/data/settings.defaults.json +0 -9
- package/corpus/templates/mail/data/sync-config.json +0 -8
- package/corpus/templates/slides/data/sync-config.json +0 -8
- package/corpus/templates/tasks/data/sync-config.json +0 -1
- package/dist/templates/chat/data/.gitkeep +0 -0
- package/dist/templates/chat/data/sync-config.json +0 -1
- package/dist/templates/default/data/.gitkeep +0 -0
- package/dist/templates/default/data/sync-config.json +0 -1
- package/src/templates/chat/data/.gitkeep +0 -0
- package/src/templates/chat/data/sync-config.json +0 -1
- package/src/templates/default/data/.gitkeep +0 -0
- package/src/templates/default/data/sync-config.json +0 -1
package/dist/server/poll.js
CHANGED
|
@@ -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 (
|
|
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(
|
|
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,
|
|
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:
|
|
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:
|
|
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,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
|
+
}
|
package/dist/shared/index.d.ts
CHANGED
|
@@ -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";
|
package/dist/shared/index.js
CHANGED
|
@@ -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.
|
|
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
|
|
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
|
|
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
|
|
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
|
package/docs/content/webmcp.mdx
CHANGED
|
@@ -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.
|
|
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 +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 +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
|
-
}
|