@agent-native/core 0.69.0 → 0.70.1
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/README.md +15 -15
- package/corpus/README.md +2 -2
- package/corpus/core/CHANGELOG.md +109 -0
- package/corpus/core/docs/design/durable-agent-runs.md +217 -0
- package/corpus/core/package.json +1 -1
- package/corpus/core/src/action.ts +89 -0
- package/corpus/core/src/agent/model-config.ts +0 -2
- package/corpus/core/src/agent/run-loop-with-resume.ts +48 -0
- package/corpus/core/src/changelog/parse.ts +245 -0
- package/corpus/core/src/cli/changelog.ts +199 -0
- package/corpus/core/src/cli/index.ts +19 -0
- package/corpus/core/src/cli/recap.ts +24 -1
- package/corpus/core/src/cli/skills.ts +74 -47
- package/corpus/core/src/client/AgentPanel.tsx +5 -3
- package/corpus/core/src/client/AssistantChat.tsx +8 -0
- package/corpus/core/src/client/CommandMenu.tsx +183 -75
- package/corpus/core/src/client/agent-chat-adapter.ts +44 -7
- package/corpus/core/src/client/analytics.ts +181 -0
- package/corpus/core/src/client/changelog/Changelog.tsx +321 -0
- package/corpus/core/src/client/client-surface.ts +41 -0
- package/corpus/core/src/client/composer/TiptapComposer.tsx +123 -12
- package/corpus/core/src/client/feedback-context.ts +4 -0
- package/corpus/core/src/client/index.ts +12 -0
- package/corpus/core/src/client/mcp-apps/McpAppRenderer.tsx +54 -0
- package/corpus/core/src/client/settings/useBuilderStatus.ts +82 -20
- package/corpus/core/src/client/sse-event-processor.ts +7 -1
- package/corpus/core/src/mcp/build-server.ts +57 -1
- package/corpus/core/src/mcp/embed-app.ts +197 -7
- package/corpus/core/src/mcp/oauth-route.ts +109 -13
- package/corpus/core/src/server/attribution.ts +211 -0
- package/corpus/core/src/server/auth.ts +6 -0
- package/corpus/core/src/server/better-auth-instance.ts +49 -5
- package/corpus/core/src/server/builder-browser.ts +27 -1
- package/corpus/core/src/server/core-routes-plugin.ts +136 -0
- package/corpus/core/src/server/google-oauth.ts +19 -6
- package/corpus/core/src/server/onboarding-html.ts +35 -0
- package/corpus/core/src/shared/mcp-embed-headers.ts +1 -1
- package/corpus/core/src/styles/agent-conversation.css +21 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/changelog/SKILL.md +111 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/reliable-mutations/SKILL.md +72 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/tracking/SKILL.md +46 -14
- package/corpus/templates/analytics/.agents/skills/dashboard-management/SKILL.md +22 -0
- package/corpus/templates/analytics/AGENTS.md +8 -1
- package/corpus/templates/analytics/CHANGELOG.md +10 -0
- package/corpus/templates/analytics/actions/install-dashboard-template.ts +99 -4
- package/corpus/templates/analytics/actions/open-traffic-dashboard.ts +1 -1
- package/corpus/templates/analytics/actions/update-dashboard.ts +39 -8
- package/corpus/templates/analytics/app/components/dashboard/SqlChart.tsx +30 -3
- package/corpus/templates/analytics/app/components/layout/CommandPalette.tsx +180 -144
- package/corpus/templates/analytics/app/components/layout/Header.tsx +2 -3
- package/corpus/templates/analytics/app/components/layout/Layout.tsx +7 -5
- package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +221 -215
- package/corpus/templates/analytics/app/hooks/use-navigation-state.ts +6 -6
- package/corpus/templates/analytics/app/lib/demo-dashboard-path.ts +1 -1
- package/corpus/templates/analytics/app/lib/last-opened.ts +2 -1
- package/corpus/templates/analytics/app/pages/Settings.tsx +4 -0
- package/corpus/templates/analytics/app/pages/adhoc/explorer-dashboard/index.tsx +3 -3
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/DashboardFilterBar.tsx +2 -2
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/SqlChartCard.tsx +32 -2
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/index.tsx +101 -99
- package/corpus/templates/analytics/app/pages/overview/OverviewPage.tsx +1 -1
- package/corpus/templates/analytics/app/routes/adhoc.$id.tsx +18 -5
- package/corpus/templates/analytics/app/routes/catalog.tsx +1 -1
- package/corpus/templates/analytics/app/routes/dashboards.$id.tsx +9 -0
- package/corpus/templates/analytics/app/routes/traffic.tsx +1 -1
- package/corpus/templates/analytics/changelog/2026-06-23-long-dashboard-and-analysis-names-in-the-sidebar-now-truncat.md +6 -0
- package/corpus/templates/analytics/changelog/2026-06-23-open-any-dashboard-chart-full-screen-in-a-modal-from-the-pan.md +6 -0
- package/corpus/templates/analytics/changelog/2026-06-23-the-dashboards-and-analyses-sidebar-settings-buttons-now-sta.md +6 -0
- package/corpus/templates/analytics/seeds/dashboards/agent-native-templates-first-party.json +145 -0
- package/corpus/templates/analytics/server/db/index.ts +1 -1
- package/corpus/templates/analytics/server/lib/dashboard-catalog.ts +9 -2
- package/corpus/templates/analytics/server/lib/demo-dashboards.ts +1 -1
- package/corpus/templates/analytics/server/plugins/agent-chat.ts +2 -2
- package/corpus/templates/analytics/server/plugins/core-routes.ts +6 -6
- package/corpus/templates/assets/CHANGELOG.md +10 -0
- package/corpus/templates/assets/actions/generate-image.ts +24 -0
- package/corpus/templates/assets/app/components/layout/Sidebar.tsx +2 -2
- package/corpus/templates/assets/app/global.css +17 -1
- package/corpus/templates/assets/app/root.tsx +7 -1
- package/corpus/templates/assets/app/routes/_index.tsx +94 -14
- package/corpus/templates/assets/app/routes/settings.tsx +6 -0
- package/corpus/templates/assets/changelog/2026-06-23-chat-dates-in-the-sidebar-no-longer-wrap-onto-two-lines.md +6 -0
- package/corpus/templates/assets/changelog/2026-06-23-clicking-image-video-or-refine-on-the-start-screen-now-drops.md +6 -0
- package/corpus/templates/assets/changelog/2026-06-23-pick-your-image-generation-model-right-from-the-chat-model-m.md +6 -0
- package/corpus/templates/brain/CHANGELOG.md +10 -0
- package/corpus/templates/brain/app/root.tsx +7 -1
- package/corpus/templates/brain/app/routes/settings.tsx +8 -1
- package/corpus/templates/calendar/CHANGELOG.md +10 -0
- package/corpus/templates/calendar/app/pages/Settings.tsx +4 -0
- package/corpus/templates/calendar/app/root.tsx +7 -1
- package/corpus/templates/chat/CHANGELOG.md +10 -0
- package/corpus/templates/chat/app/root.tsx +7 -1
- package/corpus/templates/clips/CHANGELOG.md +10 -0
- package/corpus/templates/clips/app/components/library/library-grid.tsx +1 -20
- package/corpus/templates/clips/app/components/player/share-dialog.tsx +33 -7
- package/corpus/templates/clips/app/components/player/sign-in-prompt-dialog.tsx +8 -0
- package/corpus/templates/clips/app/components/player/video-player.tsx +150 -20
- package/corpus/templates/clips/app/components/recorder/countdown-overlay.tsx +72 -48
- package/corpus/templates/clips/app/components/recorder/pre-record-panel.tsx +7 -11
- package/corpus/templates/clips/app/components/recorder/recorder-engine.ts +31 -0
- package/corpus/templates/clips/app/components/sharing/slack-share-hint.tsx +71 -0
- package/corpus/templates/clips/app/lib/countdown-audio-cue.ts +35 -17
- package/corpus/templates/clips/app/root.tsx +7 -1
- package/corpus/templates/clips/app/routes/_app.settings._index.tsx +15 -1
- package/corpus/templates/clips/app/routes/record.tsx +78 -5
- package/corpus/templates/clips/app/routes/share.$shareId.tsx +86 -5
- package/corpus/templates/clips/changelog/2026-06-23-clips-shared-in-slack-no-longer-show-a-could-not-start-playb.md +6 -0
- package/corpus/templates/clips/changelog/2026-06-23-made-the-play-button-on-shared-and-embedded-clips-scale-with.md +6 -0
- package/corpus/templates/clips/changelog/2026-06-23-public-clip-share-links-now-show-whether-they-ll-play-inline.md +6 -0
- package/corpus/templates/clips/changelog/2026-06-23-removed-select-button-from-library-hover-a-clip-to-select-it.md +6 -0
- package/corpus/templates/clips/changelog/2026-06-23-screen-camera-recordings-now-keep-the-presenter-s-face-in-th.md +6 -0
- package/corpus/templates/clips/changelog/2026-06-23-shared-video-links-now-play-for-anyone-without-signing-in.md +6 -0
- package/corpus/templates/clips/changelog/2026-06-23-skip-or-cancel-the-recording-countdown-with-buttons-beside-t.md +6 -0
- package/corpus/templates/clips/changelog/2026-06-23-the-desktop-camera-bubble-now-looks-sharp-the-instant-it-ope.md +6 -0
- package/corpus/templates/clips/changelog/2026-06-23-the-desktop-recording-widget-now-grows-downward-only-when-yo.md +6 -0
- package/corpus/templates/clips/changelog/2026-06-23-the-recording-start-sound-is-now-a-softer-more-modern-chime.md +6 -0
- package/corpus/templates/clips/chrome-extension/public/manifest.json +17 -8
- package/corpus/templates/clips/chrome-extension/src/background.ts +769 -180
- package/corpus/templates/clips/chrome-extension/src/content-script.ts +177 -0
- package/corpus/templates/clips/chrome-extension/src/offscreen.ts +466 -329
- package/corpus/templates/clips/chrome-extension/src/overlay.css +377 -0
- package/corpus/templates/clips/chrome-extension/src/overlay.html +12 -0
- package/corpus/templates/clips/chrome-extension/src/overlay.ts +330 -0
- package/corpus/templates/clips/chrome-extension/src/permission.html +227 -0
- package/corpus/templates/clips/chrome-extension/src/permission.ts +105 -0
- package/corpus/templates/clips/chrome-extension/src/popup.html +3 -0
- package/corpus/templates/clips/chrome-extension/src/popup.ts +50 -2
- package/corpus/templates/clips/chrome-extension/src/styles.css +50 -0
- package/corpus/templates/clips/chrome-extension/vite.config.ts +3 -0
- package/corpus/templates/clips/desktop/src/lib/audio-cue.ts +41 -24
- package/corpus/templates/clips/desktop/src/lib/bubble-webrtc.ts +119 -2
- package/corpus/templates/clips/desktop/src/lib/recorder.ts +20 -0
- package/corpus/templates/clips/desktop/src/main.tsx +3 -0
- package/corpus/templates/clips/desktop/src/overlays/countdown.tsx +21 -2
- package/corpus/templates/clips/desktop/src/overlays/region-record-border.tsx +76 -0
- package/corpus/templates/clips/desktop/src/styles.css +119 -2
- package/corpus/templates/clips/desktop/src-tauri/capabilities/default.json +2 -1
- package/corpus/templates/clips/desktop/src-tauri/src/clips/mod.rs +140 -1
- package/corpus/templates/clips/desktop/src-tauri/src/lib.rs +2 -0
- package/corpus/templates/clips/desktop/src-tauri/src/util.rs +4 -1
- package/corpus/templates/clips/server/routes/api/video/[recordingId].get.ts +85 -6
- package/corpus/templates/clips/shared/share-attribution.ts +79 -0
- package/corpus/templates/content/AGENTS.md +20 -3
- package/corpus/templates/content/CHANGELOG.md +10 -0
- package/corpus/templates/content/actions/_database-utils.ts +15 -0
- package/corpus/templates/content/actions/_property-utils.ts +371 -4
- package/corpus/templates/content/actions/configure-document-property.ts +35 -1
- package/corpus/templates/content/actions/create-content-database.ts +5 -1
- package/corpus/templates/content/actions/delete-document-property.ts +52 -2
- package/corpus/templates/content/actions/duplicate-document-property.ts +34 -17
- package/corpus/templates/content/actions/reorder-document-property.ts +79 -0
- package/corpus/templates/content/actions/set-document-property.ts +39 -0
- package/corpus/templates/content/app/components/editor/DocumentBlockFields.tsx +806 -0
- package/corpus/templates/content/app/components/editor/DocumentDatabase.tsx +226 -68
- package/corpus/templates/content/app/components/editor/DocumentEditor.tsx +59 -30
- package/corpus/templates/content/app/components/editor/DocumentProperties.tsx +25 -1
- package/corpus/templates/content/app/components/editor/blockFieldSaveController.ts +180 -0
- package/corpus/templates/content/app/components/editor/blockFieldSaveRegistry.ts +179 -0
- package/corpus/templates/content/app/components/editor/previewDocumentSaveController.ts +244 -0
- package/corpus/templates/content/app/components/editor/previewDocumentSaveRegistry.ts +132 -0
- package/corpus/templates/content/app/global.css +9 -0
- package/corpus/templates/content/app/hooks/use-document-properties.ts +21 -0
- package/corpus/templates/content/app/root.tsx +7 -1
- package/corpus/templates/content/server/db/schema.ts +30 -0
- package/corpus/templates/content/server/plugins/db.ts +87 -0
- package/corpus/templates/content/shared/api.ts +7 -0
- package/corpus/templates/content/shared/properties.ts +109 -0
- package/corpus/templates/design/CHANGELOG.md +10 -0
- package/corpus/templates/design/actions/generate-design.ts +4 -0
- package/corpus/templates/design/app/root.tsx +7 -1
- package/corpus/templates/design/app/routes/settings.tsx +10 -2
- package/corpus/templates/dispatch/CHANGELOG.md +10 -0
- package/corpus/templates/dispatch/app/root.tsx +7 -1
- package/corpus/templates/forms/.agents/skills/form-responses/SKILL.md +10 -0
- package/corpus/templates/forms/CHANGELOG.md +10 -0
- package/corpus/templates/forms/actions/export-responses.ts +6 -0
- package/corpus/templates/forms/actions/list-responses.ts +2 -0
- package/corpus/templates/forms/actions/response-insights.ts +2 -0
- package/corpus/templates/forms/app/pages/ResponsesPage.tsx +138 -1
- package/corpus/templates/forms/app/root.tsx +7 -1
- package/corpus/templates/forms/changelog/2026-06-23-response-tables-now-show-the-page-each-submission-came-from-.md +6 -0
- package/corpus/templates/forms/changelog/2026-06-23-response-tables-now-show-whether-feedback-came-from-the-web-.md +6 -0
- package/corpus/templates/forms/server/db/schema.ts +7 -0
- package/corpus/templates/forms/server/handlers/submissions.ts +19 -2
- package/corpus/templates/forms/server/lib/integrations.ts +76 -2
- package/corpus/templates/forms/server/plugins/db.ts +20 -0
- package/corpus/templates/forms/shared/types.ts +12 -0
- package/corpus/templates/macros/CHANGELOG.md +10 -0
- package/corpus/templates/macros/app/root.tsx +7 -1
- package/corpus/templates/mail/CHANGELOG.md +10 -0
- package/corpus/templates/mail/app/components/layout/CommandPalette.tsx +3 -0
- package/corpus/templates/mail/app/pages/SettingsPage.tsx +27 -0
- package/corpus/templates/plan/.agents/skills/visual-plan/SKILL.md +31 -17
- package/corpus/templates/plan/.agents/skills/visual-plan/references/wireframe.md +7 -4
- package/corpus/templates/plan/.agents/skills/visual-recap/SKILL.md +34 -24
- package/corpus/templates/plan/.agents/skills/visual-recap/references/wireframe.md +7 -4
- package/corpus/templates/plan/AGENTS.md +4 -0
- package/corpus/templates/plan/CHANGELOG.md +10 -0
- package/corpus/templates/plan/actions/view-screen.ts +5 -0
- package/corpus/templates/plan/app/components/layout/Sidebar.tsx +98 -1
- package/corpus/templates/plan/app/components/plan/wireframe/html-artboard.css +3 -1
- package/corpus/templates/plan/app/pages/PlansPage.tsx +107 -7
- package/corpus/templates/plan/app/root.tsx +7 -1
- package/corpus/templates/plan/changelog/2026-06-23-large-diagrams-in-a-plan-now-scroll-within-their-block-inste.md +6 -0
- package/corpus/templates/plan/shared/share-attribution.ts +72 -0
- package/corpus/templates/slides/CHANGELOG.md +10 -0
- package/corpus/templates/slides/app/root.tsx +7 -1
- package/corpus/templates/videos/CHANGELOG.md +4 -151
- package/corpus/templates/videos/app/root.tsx +7 -1
- package/dist/action.js +87 -0
- package/dist/action.js.map +1 -1
- package/dist/agent/engine/builder-engine.d.ts +1 -1
- package/dist/agent/engine/builder-engine.d.ts.map +1 -1
- package/dist/agent/model-config.d.ts +2 -2
- package/dist/agent/model-config.d.ts.map +1 -1
- package/dist/agent/model-config.js +0 -2
- package/dist/agent/model-config.js.map +1 -1
- package/dist/agent/run-loop-with-resume.d.ts +13 -0
- package/dist/agent/run-loop-with-resume.d.ts.map +1 -1
- package/dist/agent/run-loop-with-resume.js +44 -0
- package/dist/agent/run-loop-with-resume.js.map +1 -1
- package/dist/changelog/parse.d.ts +70 -0
- package/dist/changelog/parse.d.ts.map +1 -0
- package/dist/changelog/parse.js +200 -0
- package/dist/changelog/parse.js.map +1 -0
- package/dist/cli/changelog.d.ts +4 -0
- package/dist/cli/changelog.d.ts.map +1 -0
- package/dist/cli/changelog.js +166 -0
- package/dist/cli/changelog.js.map +1 -0
- package/dist/cli/index.js +18 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/recap.d.ts.map +1 -1
- package/dist/cli/recap.js +22 -1
- package/dist/cli/recap.js.map +1 -1
- package/dist/cli/skills.d.ts +3 -3
- package/dist/cli/skills.d.ts.map +1 -1
- package/dist/cli/skills.js +74 -47
- package/dist/cli/skills.js.map +1 -1
- package/dist/client/AgentPanel.d.ts.map +1 -1
- package/dist/client/AgentPanel.js +5 -3
- package/dist/client/AgentPanel.js.map +1 -1
- package/dist/client/AssistantChat.d.ts +6 -1
- package/dist/client/AssistantChat.d.ts.map +1 -1
- package/dist/client/AssistantChat.js +2 -2
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/CommandMenu.d.ts +17 -1
- package/dist/client/CommandMenu.d.ts.map +1 -1
- package/dist/client/CommandMenu.js +49 -13
- package/dist/client/CommandMenu.js.map +1 -1
- package/dist/client/agent-chat-adapter.d.ts.map +1 -1
- package/dist/client/agent-chat-adapter.js +43 -6
- package/dist/client/agent-chat-adapter.js.map +1 -1
- package/dist/client/analytics.d.ts +18 -0
- package/dist/client/analytics.d.ts.map +1 -1
- package/dist/client/analytics.js +177 -0
- package/dist/client/analytics.js.map +1 -1
- package/dist/client/changelog/Changelog.d.ts +47 -0
- package/dist/client/changelog/Changelog.d.ts.map +1 -0
- package/dist/client/changelog/Changelog.js +138 -0
- package/dist/client/changelog/Changelog.js.map +1 -0
- package/dist/client/client-surface.d.ts +17 -0
- package/dist/client/client-surface.d.ts.map +1 -0
- package/dist/client/client-surface.js +24 -0
- package/dist/client/client-surface.js.map +1 -0
- package/dist/client/composer/TiptapComposer.d.ts +26 -1
- package/dist/client/composer/TiptapComposer.d.ts.map +1 -1
- package/dist/client/composer/TiptapComposer.js +27 -5
- package/dist/client/composer/TiptapComposer.js.map +1 -1
- package/dist/client/feedback-context.d.ts +3 -0
- package/dist/client/feedback-context.d.ts.map +1 -1
- package/dist/client/feedback-context.js +2 -0
- package/dist/client/feedback-context.js.map +1 -1
- package/dist/client/index.d.ts +3 -1
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +3 -1
- package/dist/client/index.js.map +1 -1
- package/dist/client/mcp-apps/McpAppRenderer.d.ts +1 -0
- package/dist/client/mcp-apps/McpAppRenderer.d.ts.map +1 -1
- package/dist/client/mcp-apps/McpAppRenderer.js +42 -1
- package/dist/client/mcp-apps/McpAppRenderer.js.map +1 -1
- package/dist/client/settings/useBuilderStatus.d.ts +2 -0
- package/dist/client/settings/useBuilderStatus.d.ts.map +1 -1
- package/dist/client/settings/useBuilderStatus.js +58 -10
- package/dist/client/settings/useBuilderStatus.js.map +1 -1
- package/dist/client/sse-event-processor.d.ts.map +1 -1
- package/dist/client/sse-event-processor.js +7 -1
- package/dist/client/sse-event-processor.js.map +1 -1
- package/dist/mcp/build-server.d.ts +21 -0
- package/dist/mcp/build-server.d.ts.map +1 -1
- package/dist/mcp/build-server.js +43 -1
- package/dist/mcp/build-server.js.map +1 -1
- package/dist/mcp/embed-app.d.ts.map +1 -1
- package/dist/mcp/embed-app.js +197 -7
- package/dist/mcp/embed-app.js.map +1 -1
- package/dist/mcp/oauth-route.d.ts.map +1 -1
- package/dist/mcp/oauth-route.js +95 -12
- package/dist/mcp/oauth-route.js.map +1 -1
- package/dist/server/attribution.d.ts +83 -0
- package/dist/server/attribution.d.ts.map +1 -0
- package/dist/server/attribution.js +178 -0
- package/dist/server/attribution.js.map +1 -0
- package/dist/server/auth.d.ts.map +1 -1
- package/dist/server/auth.js +7 -0
- package/dist/server/auth.js.map +1 -1
- package/dist/server/better-auth-instance.d.ts +9 -1
- package/dist/server/better-auth-instance.d.ts.map +1 -1
- package/dist/server/better-auth-instance.js +32 -2
- package/dist/server/better-auth-instance.js.map +1 -1
- package/dist/server/builder-browser.d.ts +4 -0
- package/dist/server/builder-browser.d.ts.map +1 -1
- package/dist/server/builder-browser.js +20 -1
- package/dist/server/builder-browser.js.map +1 -1
- package/dist/server/core-routes-plugin.d.ts +25 -0
- package/dist/server/core-routes-plugin.d.ts.map +1 -1
- package/dist/server/core-routes-plugin.js +101 -0
- package/dist/server/core-routes-plugin.js.map +1 -1
- package/dist/server/google-oauth.d.ts.map +1 -1
- package/dist/server/google-oauth.js +16 -2
- package/dist/server/google-oauth.js.map +1 -1
- package/dist/server/onboarding-html.d.ts.map +1 -1
- package/dist/server/onboarding-html.js +35 -0
- package/dist/server/onboarding-html.js.map +1 -1
- package/dist/shared/mcp-embed-headers.js +1 -1
- package/dist/shared/mcp-embed-headers.js.map +1 -1
- package/dist/styles/agent-conversation.css +21 -0
- package/dist/templates/workspace-core/.agents/skills/changelog/SKILL.md +111 -0
- package/dist/templates/workspace-core/.agents/skills/reliable-mutations/SKILL.md +72 -0
- package/dist/templates/workspace-core/.agents/skills/tracking/SKILL.md +46 -14
- package/docs/design/durable-agent-runs.md +217 -0
- package/package.json +1 -1
- package/src/templates/workspace-core/.agents/skills/changelog/SKILL.md +111 -0
- package/src/templates/workspace-core/.agents/skills/reliable-mutations/SKILL.md +72 -0
- package/src/templates/workspace-core/.agents/skills/tracking/SKILL.md +46 -14
- package/corpus/templates/analytics/app/pages/About.tsx +0 -108
- package/corpus/templates/analytics/app/routes/about.tsx +0 -9
- /package/corpus/templates/analytics/app/routes/{dashboards.tsx → dashboards._index.tsx} +0 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: reliable-mutations
|
|
3
|
+
description: >-
|
|
4
|
+
How the agent must perform writes so they actually persist under the hosted
|
|
5
|
+
~40s run budget. Use whenever you create, update, delete, or batch-write app
|
|
6
|
+
data — especially "do this for many items" loops, or any task where the user
|
|
7
|
+
expects N things to end up saved.
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Reliable Mutations
|
|
11
|
+
|
|
12
|
+
## Rule
|
|
13
|
+
|
|
14
|
+
Make a change in **one atomic call** when the action supports it, then **verify
|
|
15
|
+
the persisted end state and report concrete proof** (counts/ids). Never drive a
|
|
16
|
+
multi-step change by looping many small writes, and never report success from a
|
|
17
|
+
tool ✓ alone.
|
|
18
|
+
|
|
19
|
+
## Why
|
|
20
|
+
|
|
21
|
+
Hosted agent runs have a ~40s soft budget (it exists to hand off cleanly under
|
|
22
|
+
the upstream gateway/function walls — it is correct and is not raisable; see the
|
|
23
|
+
durable-agent-runs design doc). When you loop many sequential writes inside one
|
|
24
|
+
turn, the budget can cut you off mid-loop. The run resumes in a new chunk, but
|
|
25
|
+
the resume often re-does earlier steps instead of advancing, so the loop churns
|
|
26
|
+
and the *saved* result ends up partial — or empty — even though each individual
|
|
27
|
+
tool call appeared to succeed. The user gets told "done" while the data says
|
|
28
|
+
otherwise. One atomic call commits or fails as a unit; verification turns a
|
|
29
|
+
hopeful ✓ into a fact.
|
|
30
|
+
|
|
31
|
+
## How
|
|
32
|
+
|
|
33
|
+
1. **Prefer a single atomic call.** If an action accepts the whole set (add
|
|
34
|
+
many, set all, bulk update), pass the full batch in one call so it commits
|
|
35
|
+
atomically. Check the action surface for a batch/plural form before reaching
|
|
36
|
+
for a loop.
|
|
37
|
+
2. **Do not loop many small writes under the run budget.** A sequence of N
|
|
38
|
+
per-item writes in one turn will race the ~40s cutoff and can leave partial
|
|
39
|
+
or no state. If no batch action exists, that is a gap in the action layer —
|
|
40
|
+
add or extend an action that accepts the batch (see the `actions` skill)
|
|
41
|
+
rather than papering over it with a loop.
|
|
42
|
+
3. **Verify the end state after writing.** Re-read the data (a list/read action,
|
|
43
|
+
a count query) and confirm the result matches intent — the right number of
|
|
44
|
+
rows, the expected ids/fields. Do this before you tell the user it worked.
|
|
45
|
+
4. **Report proof-of-done, not vibes.** State concrete evidence: "saved 12 of 12
|
|
46
|
+
panels (ids …)" or "updated 5 rows". Do not infer success from the presence
|
|
47
|
+
of a tool ✓ on an individual call.
|
|
48
|
+
5. **On a time-budget cutoff, fail loud.** If the turn is cut before the change
|
|
49
|
+
is fully committed and verified, say so explicitly and report what *did*
|
|
50
|
+
persist (M of N) and what remains. Never round a partial or unverified write
|
|
51
|
+
up to "done".
|
|
52
|
+
|
|
53
|
+
## Don't
|
|
54
|
+
|
|
55
|
+
- Don't loop `for each item: write(item)` for a large set in a single hosted
|
|
56
|
+
turn.
|
|
57
|
+
- Don't claim completion because every tool call returned ✓ — a ✓ on an aborted
|
|
58
|
+
chunk does not mean the row was committed.
|
|
59
|
+
- Don't silently shrink the scope ("I added a few of them") and present it as the
|
|
60
|
+
finished task.
|
|
61
|
+
- Don't try to "fix" this by asking for a longer run timeout — the budget is
|
|
62
|
+
correct; restructure the write instead.
|
|
63
|
+
|
|
64
|
+
## Related
|
|
65
|
+
|
|
66
|
+
- `actions` — define or extend a batch/atomic action when only per-item writes
|
|
67
|
+
exist.
|
|
68
|
+
- `storing-data` — where app data lives and how reads/writes are scoped.
|
|
69
|
+
- `performance` — avoid query waterfalls when verifying end state.
|
|
70
|
+
- Design doc: `packages/core/docs/design/durable-agent-runs.md` — the real
|
|
71
|
+
ceiling fix (checkpointed and durable runs); this skill is the agent-facing
|
|
72
|
+
mitigation that reduces how often the ceiling is hit.
|
|
@@ -31,7 +31,11 @@ Fire an analytics event.
|
|
|
31
31
|
```ts
|
|
32
32
|
import { track } from "@agent-native/core/tracking";
|
|
33
33
|
|
|
34
|
-
track(
|
|
34
|
+
track(
|
|
35
|
+
"meal.logged",
|
|
36
|
+
{ mealName: "Salad", calories: 350 },
|
|
37
|
+
{ userId: "user@example.com" },
|
|
38
|
+
);
|
|
35
39
|
```
|
|
36
40
|
|
|
37
41
|
### `identify(userId, traits?)`
|
|
@@ -73,13 +77,13 @@ Flush all providers (call before process exit).
|
|
|
73
77
|
|
|
74
78
|
Set the env var and the provider auto-registers at startup. No SDK dependencies -- all providers use raw HTTP.
|
|
75
79
|
|
|
76
|
-
| Provider
|
|
77
|
-
|
|
|
78
|
-
| PostHog
|
|
79
|
-
| Mixpanel
|
|
80
|
-
| Amplitude
|
|
80
|
+
| Provider | Env vars |
|
|
81
|
+
| ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
82
|
+
| PostHog | `POSTHOG_API_KEY` (required), `POSTHOG_HOST` (optional, defaults to `https://us.i.posthog.com`) |
|
|
83
|
+
| Mixpanel | `MIXPANEL_TOKEN` |
|
|
84
|
+
| Amplitude | `AMPLITUDE_API_KEY` |
|
|
81
85
|
| Agent Native Analytics | `AGENT_NATIVE_ANALYTICS_PUBLIC_KEY` (server), `AGENT_NATIVE_ANALYTICS_ENDPOINT` (optional, defaults to `https://analytics.agent-native.com/track`) |
|
|
82
|
-
| Webhook
|
|
86
|
+
| Webhook | `TRACKING_WEBHOOK_URL` (required), `TRACKING_WEBHOOK_AUTH` (optional, sent as `Authorization` header) |
|
|
83
87
|
|
|
84
88
|
Multiple providers can be active simultaneously. All receive every event.
|
|
85
89
|
|
|
@@ -106,10 +110,35 @@ Every browser-side `trackEvent()` POST to the Agent Native Analytics `/track` en
|
|
|
106
110
|
|
|
107
111
|
These fields land in the `analytics_events.anonymous_id`, `analytics_events.session_id`, and `analytics_events.user_id` columns in the analytics template. Storage access is wrapped in try/catch — private-browsing / blocked-storage clients silently degrade to NULL rather than crashing the page.
|
|
108
112
|
|
|
113
|
+
### Referral / viral attribution (first-touch)
|
|
114
|
+
|
|
115
|
+
`configureTracking()` also captures an anonymous visitor's **first-touch** referral context once, on first page load, and persists it across the signup boundary so the server-side `signup` event records where the user came from. This powers virality metrics for every template (Clips share links, Plans public pages, etc.).
|
|
116
|
+
|
|
117
|
+
**Share-link params** (set by whatever generates the link; read client-side only):
|
|
118
|
+
|
|
119
|
+
- `ref` — referral source bucket, e.g. `clip_share`, `plan_share`
|
|
120
|
+
- `via` — the referrer's stable user id (the clip/plan owner)
|
|
121
|
+
- `utm_source`, `utm_medium`, `utm_campaign`, `utm_content`, `utm_term`
|
|
122
|
+
|
|
123
|
+
**Client persistence** (first-write-wins — an existing value is never overwritten):
|
|
124
|
+
|
|
125
|
+
- `localStorage` key `an_attribution` and first-party cookie `an_ft` (`path=/; max-age=2592000; SameSite=Lax`, not HttpOnly — non-sensitive, written by client JS).
|
|
126
|
+
- Both store the same URL-encoded compact JSON (empty fields omitted, each value capped at 120 chars): `{ ref, via, utm_source, utm_medium, utm_campaign, utm_content, utm_term, landing_path, landing_referrer, landed_at }`. `landing_referrer` is the **host only** of `document.referrer` (scrubbed; same-origin referrers are dropped).
|
|
127
|
+
- `getFirstTouchAttribution()` (from `@agent-native/core/client`) returns the parsed object or `null`.
|
|
128
|
+
|
|
129
|
+
**Signup event enrichment** (server-side, from the `an_ft` cookie on the signup/OAuth-callback request, derived in `packages/core/src/server/attribution.ts`):
|
|
130
|
+
|
|
131
|
+
- `referral_source` — `ref` if present, else derived: `/share/…` → `clip_share`; a plan public path (`/p/`, `/plan/`, `/share-plan/`) → `plan_share`; a non-empty external referring host → `external`; otherwise `direct`.
|
|
132
|
+
- `referrer_user` (= `via`), `referral_medium` (= `utm_medium`), `referral_campaign` (= `utm_campaign`)
|
|
133
|
+
- `utm_source`, `utm_medium`, `utm_campaign`, `utm_content`, `utm_term` (raw passthrough)
|
|
134
|
+
- `first_touch_path` (= `landing_path`), `landing_referrer`
|
|
135
|
+
|
|
136
|
+
Attribution parsing is fully defensive and never blocks signup — a missing/malformed cookie falls back to `referral_source: "direct"`.
|
|
137
|
+
|
|
109
138
|
Other framework-level baseline events:
|
|
110
139
|
|
|
111
140
|
- `session status` from `useSession()`, with `signed_in`
|
|
112
|
-
- `signup` from Better Auth user creation, with `auth_provider` and `
|
|
141
|
+
- `signup` from Better Auth user creation, with `auth_provider`, `auth_user_id`, and first-touch referral attribution (`referral_source`, `referrer_user`, `referral_medium`, `referral_campaign`, `utm_*`, `first_touch_path`, `landing_referrer` — see "Referral / viral attribution" above)
|
|
113
142
|
- `builder connect clicked` and `builder connect popup blocked` from browser Connect Builder CTAs
|
|
114
143
|
- `builder connect started`, `builder connect succeeded`, `builder connect failed`, `builder disconnect succeeded`, and `builder disconnect failed` from the Builder connection routes, with LLM connection context when resolvable
|
|
115
144
|
|
|
@@ -121,7 +150,10 @@ For new lifecycle events, call `track()` server-side when the server is the sour
|
|
|
121
150
|
interface TrackingProvider {
|
|
122
151
|
name: string;
|
|
123
152
|
track(event: TrackingEvent): void | Promise<void>;
|
|
124
|
-
identify?(
|
|
153
|
+
identify?(
|
|
154
|
+
userId: string,
|
|
155
|
+
traits?: Record<string, unknown>,
|
|
156
|
+
): void | Promise<void>;
|
|
125
157
|
flush?(): void | Promise<void>;
|
|
126
158
|
}
|
|
127
159
|
|
|
@@ -142,11 +174,11 @@ interface TrackingEvent {
|
|
|
142
174
|
|
|
143
175
|
## Key Files
|
|
144
176
|
|
|
145
|
-
| File
|
|
146
|
-
|
|
|
147
|
-
| `packages/core/src/tracking/registry.ts`
|
|
148
|
-
| `packages/core/src/tracking/providers.ts`
|
|
149
|
-
| `packages/core/src/tracking/types.ts`
|
|
177
|
+
| File | Purpose |
|
|
178
|
+
| ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
|
|
179
|
+
| `packages/core/src/tracking/registry.ts` | `track()`, `identify()`, `registerTrackingProvider()`, `flushTracking()` |
|
|
180
|
+
| `packages/core/src/tracking/providers.ts` | Built-in providers (PostHog, Mixpanel, Amplitude, Agent Native Analytics, Webhook) and `registerBuiltinProviders()` |
|
|
181
|
+
| `packages/core/src/tracking/types.ts` | `TrackingEvent` and `TrackingProvider` interfaces |
|
|
150
182
|
|
|
151
183
|
## Related Skills
|
|
152
184
|
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
IconChartBar,
|
|
3
|
-
IconMessage,
|
|
4
|
-
IconLayoutDashboard,
|
|
5
|
-
IconDatabase,
|
|
6
|
-
} from "@tabler/icons-react";
|
|
7
|
-
import { dataSources, categoryLabels, categoryOrder } from "@/lib/data-sources";
|
|
8
|
-
|
|
9
|
-
const capabilities = [
|
|
10
|
-
{
|
|
11
|
-
icon: IconDatabase,
|
|
12
|
-
title: "Connect Data Sources",
|
|
13
|
-
description:
|
|
14
|
-
"Connect any of 20+ data sources — from Google Analytics and BigQuery to Stripe, HubSpot, and PostgreSQL. Each source includes a step-by-step setup guide.",
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
icon: IconLayoutDashboard,
|
|
18
|
-
title: "Create Custom Dashboards",
|
|
19
|
-
description:
|
|
20
|
-
"Describe the dashboard you want and the agent builds it — charts, tables, metrics, and all. A Google Analytics example is included to show what's possible.",
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
icon: IconChartBar,
|
|
24
|
-
title: "Query Explorer",
|
|
25
|
-
description:
|
|
26
|
-
"Use the Explorer tool to write arbitrary SQL against BigQuery and visualize results as charts or tables instantly.",
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
icon: IconMessage,
|
|
30
|
-
title: "Ask Questions in Chat",
|
|
31
|
-
description:
|
|
32
|
-
"Ask natural-language questions about any connected data source. Get answers, charts, and insights without writing SQL.",
|
|
33
|
-
},
|
|
34
|
-
];
|
|
35
|
-
|
|
36
|
-
export default function About() {
|
|
37
|
-
return (
|
|
38
|
-
<div className="mx-auto max-w-4xl space-y-10 p-6 md:p-10">
|
|
39
|
-
<header>
|
|
40
|
-
<h1 className="text-3xl font-bold tracking-tight">About This App</h1>
|
|
41
|
-
<p className="mt-2 text-muted-foreground text-lg">
|
|
42
|
-
Analytics gives you a single place to connect data sources, build
|
|
43
|
-
custom dashboards, and ask questions across all of your key metrics.
|
|
44
|
-
</p>
|
|
45
|
-
</header>
|
|
46
|
-
|
|
47
|
-
{/* Capabilities */}
|
|
48
|
-
<section>
|
|
49
|
-
<h2 className="text-xl font-semibold mb-4">What You Can Do</h2>
|
|
50
|
-
<div className="grid gap-4 sm:grid-cols-2">
|
|
51
|
-
{capabilities.map((cap) => (
|
|
52
|
-
<div
|
|
53
|
-
key={cap.title}
|
|
54
|
-
className="rounded-lg border border-border bg-card p-5 space-y-2"
|
|
55
|
-
>
|
|
56
|
-
<div className="flex items-center gap-3">
|
|
57
|
-
<div className="flex h-9 w-9 items-center justify-center rounded-md bg-primary/10 text-primary">
|
|
58
|
-
<cap.icon className="h-5 w-5" />
|
|
59
|
-
</div>
|
|
60
|
-
<h3 className="font-medium">{cap.title}</h3>
|
|
61
|
-
</div>
|
|
62
|
-
<p className="text-sm text-muted-foreground leading-relaxed">
|
|
63
|
-
{cap.description}
|
|
64
|
-
</p>
|
|
65
|
-
</div>
|
|
66
|
-
))}
|
|
67
|
-
</div>
|
|
68
|
-
</section>
|
|
69
|
-
|
|
70
|
-
{/* Available Data Sources */}
|
|
71
|
-
<section>
|
|
72
|
-
<h2 className="text-xl font-semibold mb-4">Available Data Sources</h2>
|
|
73
|
-
{categoryOrder.map((category) => {
|
|
74
|
-
const sources = dataSources.filter((s) => s.category === category);
|
|
75
|
-
if (sources.length === 0) return null;
|
|
76
|
-
return (
|
|
77
|
-
<div key={category} className="mb-4">
|
|
78
|
-
<h3 className="text-xs font-semibold text-muted-foreground uppercase tracking-wider mb-2">
|
|
79
|
-
{categoryLabels[category]}
|
|
80
|
-
</h3>
|
|
81
|
-
<div className="grid gap-2 sm:grid-cols-3">
|
|
82
|
-
{sources.map((source) => {
|
|
83
|
-
const Icon = source.icon;
|
|
84
|
-
return (
|
|
85
|
-
<div
|
|
86
|
-
key={source.id}
|
|
87
|
-
className="flex items-center gap-2.5 rounded-lg border border-border bg-card px-3 py-2.5"
|
|
88
|
-
>
|
|
89
|
-
<div className="flex h-7 w-7 shrink-0 items-center justify-center rounded-md bg-primary/10 text-primary">
|
|
90
|
-
<Icon className="h-4 w-4" />
|
|
91
|
-
</div>
|
|
92
|
-
<span className="text-sm font-medium">{source.name}</span>
|
|
93
|
-
</div>
|
|
94
|
-
);
|
|
95
|
-
})}
|
|
96
|
-
</div>
|
|
97
|
-
</div>
|
|
98
|
-
);
|
|
99
|
-
})}
|
|
100
|
-
</section>
|
|
101
|
-
|
|
102
|
-
<footer className="text-xs text-muted-foreground pt-4 border-t border-border">
|
|
103
|
-
All data is queried live from the connected sources. BigQuery queries
|
|
104
|
-
are capped at 750 GB per query for cost safety.
|
|
105
|
-
</footer>
|
|
106
|
-
</div>
|
|
107
|
-
);
|
|
108
|
-
}
|
|
File without changes
|