@agent-native/core 0.146.8 → 0.148.0
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/README.md +1 -1
- package/corpus/templates/analytics/.agents/skills/frontend-design/SKILL.md +115 -68
- package/corpus/templates/analytics/.agents/skills/turn-into-app/SKILL.md +18 -6
- package/corpus/templates/analytics/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
- package/corpus/templates/analytics/DEVELOPING.md +50 -3
- package/corpus/templates/analytics/actions/purge-first-party-analytics-postgres.ts +190 -0
- package/corpus/templates/analytics/app/i18n/index.ts +14 -29
- package/corpus/templates/analytics/app/i18n-data.ts +10 -10
- package/corpus/templates/analytics/app/pages/Settings.tsx +5 -21
- package/corpus/templates/analytics/app/pages/sessions/SessionsPage.tsx +1 -3
- package/corpus/templates/analytics/app/routes/status.$slug.tsx +4 -2
- package/corpus/templates/analytics/scripts/first-party-analytics-bigquery-backfill.ts +253 -24
- package/corpus/templates/analytics/server/db/schema.ts +23 -0
- package/corpus/templates/analytics/server/handlers/first-party-analytics.ts +3 -1
- package/corpus/templates/analytics/server/jobs/analytics-bigquery-backfill.ts +1 -1
- package/corpus/templates/analytics/server/lib/first-party-analytics-backend.ts +113 -13
- package/corpus/templates/analytics/server/lib/first-party-analytics-purge.ts +140 -0
- package/corpus/templates/analytics/server/lib/first-party-analytics-volume.ts +207 -0
- package/corpus/templates/analytics/server/lib/first-party-analytics.ts +40 -9
- package/corpus/templates/analytics/server/lib/gcloud.ts +148 -20
- package/corpus/templates/analytics/server/plugins/db.ts +42 -0
- package/corpus/templates/assets/.agents/skills/frontend-design/SKILL.md +115 -68
- package/corpus/templates/assets/.agents/skills/turn-into-app/SKILL.md +18 -6
- package/corpus/templates/assets/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
- package/corpus/templates/assets/app/i18n/index.ts +14 -29
- package/corpus/templates/brain/.agents/skills/adding-a-feature/SKILL.md +9 -0
- package/corpus/templates/brain/.agents/skills/frontend-design/SKILL.md +115 -68
- package/corpus/templates/brain/.agents/skills/turn-into-app/SKILL.md +18 -6
- package/corpus/templates/brain/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
- package/corpus/templates/brain/app/i18n/index.ts +14 -29
- package/corpus/templates/calendar/.agents/skills/frontend-design/SKILL.md +115 -68
- package/corpus/templates/calendar/.agents/skills/turn-into-app/SKILL.md +18 -6
- package/corpus/templates/calendar/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
- package/corpus/templates/chat/.agents/skills/adding-a-feature/SKILL.md +9 -0
- package/corpus/templates/chat/.agents/skills/frontend-design/SKILL.md +115 -68
- package/corpus/templates/chat/.agents/skills/turn-into-app/SKILL.md +18 -6
- package/corpus/templates/chat/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
- package/corpus/templates/chat/app/i18n/index.ts +14 -29
- package/corpus/templates/clips/.agents/skills/frontend-design/SKILL.md +115 -68
- package/corpus/templates/clips/.agents/skills/turn-into-app/SKILL.md +18 -6
- package/corpus/templates/clips/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
- package/corpus/templates/clips/app/components/player/transcript-panel.tsx +2 -7
- package/corpus/templates/clips/app/components/recorder/storage-setup-card.tsx +18 -13
- package/corpus/templates/clips/app/components/settings/ai-setup-section.tsx +87 -370
- package/corpus/templates/clips/app/components/settings/slack-section.tsx +59 -101
- package/corpus/templates/clips/app/components/settings/video-storage-section.tsx +136 -213
- package/corpus/templates/clips/app/i18n/en-US.ts +11 -8
- package/corpus/templates/clips/app/routes/r.$recordingId.tsx +16 -4
- package/corpus/templates/clips/app/routes/share.meeting.$meetingId.tsx +14 -5
- package/corpus/templates/clips/desktop/src/app.tsx +1 -1
- package/corpus/templates/clips/package.json +1 -0
- package/corpus/templates/clips/react-router.config.ts +7 -0
- package/corpus/templates/clips/server/plugins/auth.ts +6 -1
- package/corpus/templates/clips/shared/prerendered-public-paths.ts +21 -0
- package/corpus/templates/clips/shared/share-meta.ts +8 -3
- package/corpus/templates/content/.agents/skills/frontend-design/SKILL.md +115 -68
- package/corpus/templates/content/.agents/skills/turn-into-app/SKILL.md +18 -6
- package/corpus/templates/content/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
- package/corpus/templates/content/app/i18n/index.ts +14 -29
- package/corpus/templates/crm/.agents/skills/turn-into-app/SKILL.md +18 -6
- package/corpus/templates/crm/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
- package/corpus/templates/crm/app/i18n/index.ts +14 -29
- package/corpus/templates/design/.agents/skills/frontend-design/SKILL.md +115 -68
- package/corpus/templates/design/.agents/skills/turn-into-app/SKILL.md +18 -6
- package/corpus/templates/design/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
- package/corpus/templates/design/actions/analyze-brand-assets.ts +15 -15
- package/corpus/templates/design/actions/import-code.ts +2 -43
- package/corpus/templates/design/app/i18n/index.ts +14 -29
- package/corpus/templates/dispatch/.agents/skills/frontend-design/SKILL.md +115 -68
- package/corpus/templates/dispatch/.agents/skills/turn-into-app/SKILL.md +18 -6
- package/corpus/templates/dispatch/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
- package/corpus/templates/dispatch/app/chat-first-pages.ts +747 -0
- package/corpus/templates/dispatch/app/i18n-data.ts +182 -1
- package/corpus/templates/dispatch/app/routes/settings.tsx +62 -1
- package/corpus/templates/dispatch/changelog/2026-08-08-chat-first-navigation-keeps-conversations-central-while-open.md +6 -0
- package/corpus/templates/factory/.agents/skills/adding-a-feature/SKILL.md +9 -0
- package/corpus/templates/factory/.agents/skills/frontend-design/SKILL.md +115 -68
- package/corpus/templates/factory/.agents/skills/turn-into-app/SKILL.md +18 -6
- package/corpus/templates/factory/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
- package/corpus/templates/factory/AGENTS.md +40 -49
- package/corpus/templates/factory/actions/babysit-agent-native-pull-request.ts +66 -0
- package/corpus/templates/factory/actions/evaluate-triage-item.ts +37 -0
- package/corpus/templates/factory/actions/get-slack-feedback-context.ts +20 -0
- package/corpus/templates/factory/actions/get-triage-item.ts +25 -4
- package/corpus/templates/factory/actions/govern-agent-native-pull-request.ts +55 -0
- package/corpus/templates/factory/actions/ingest-github-observation.ts +21 -0
- package/corpus/templates/factory/actions/list-factory-audit.ts +118 -0
- package/corpus/templates/factory/actions/list-factory-automations.ts +2 -1
- package/corpus/templates/factory/actions/list-triage-items.ts +24 -2
- package/corpus/templates/factory/actions/poll-github-sources.ts +60 -0
- package/corpus/templates/factory/actions/poll-sentry-errors.ts +39 -0
- package/corpus/templates/factory/actions/poll-slack-channel.ts +45 -1
- package/corpus/templates/factory/actions/run-factory-automation.ts +1 -1
- package/corpus/templates/factory/actions/save-factory-automation.ts +2 -2
- package/corpus/templates/factory/actions/start-builder-for-item.ts +51 -0
- package/corpus/templates/factory/app/components/factory/FactoryAuditView.tsx +685 -0
- package/corpus/templates/factory/app/hooks/use-navigation-state.ts +6 -0
- package/corpus/templates/factory/app/i18n/en-US.ts +25 -0
- package/corpus/templates/factory/app/routes/factory.tsx +203 -118
- package/corpus/templates/factory/changelog/2026-08-08-scheduler-health-moves-to-settings.md +6 -0
- package/corpus/templates/factory/server/db/schema.ts +37 -0
- package/corpus/templates/factory/server/lib/require-factory-automation.ts +5 -1
- package/corpus/templates/factory/server/plugins/factory-migrations.ts +29 -0
- package/corpus/templates/factory/server/triage/audit.ts +79 -0
- package/corpus/templates/forms/.agents/skills/frontend-design/SKILL.md +115 -68
- package/corpus/templates/forms/.agents/skills/turn-into-app/SKILL.md +18 -6
- package/corpus/templates/forms/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
- package/corpus/templates/forms/app/i18n/index.ts +14 -29
- package/corpus/templates/macros/.agents/skills/frontend-design/SKILL.md +115 -68
- package/corpus/templates/macros/.agents/skills/turn-into-app/SKILL.md +18 -6
- package/corpus/templates/macros/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
- package/corpus/templates/macros/app/i18n/index.ts +14 -29
- package/corpus/templates/mail/.agents/skills/frontend-design/SKILL.md +115 -68
- package/corpus/templates/mail/.agents/skills/turn-into-app/SKILL.md +18 -6
- package/corpus/templates/mail/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
- package/corpus/templates/mail/app/i18n/index.ts +14 -29
- package/corpus/templates/plan/.agents/skills/adding-a-feature/SKILL.md +9 -0
- package/corpus/templates/plan/.agents/skills/frontend-design/SKILL.md +115 -68
- package/corpus/templates/plan/.agents/skills/turn-into-app/SKILL.md +18 -6
- package/corpus/templates/plan/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
- package/corpus/templates/plan/app/components/plan/wireframe/Wireframe.tsx +7 -7
- package/corpus/templates/plan/app/i18n/index.ts +14 -29
- package/corpus/templates/plan/app/lib/plan-document-title.ts +3 -1
- package/corpus/templates/plan/app/root.tsx +1 -0
- package/corpus/templates/slides/.agents/skills/frontend-design/SKILL.md +115 -68
- package/corpus/templates/slides/.agents/skills/turn-into-app/SKILL.md +18 -6
- package/corpus/templates/slides/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
- package/corpus/templates/slides/actions/analyze-brand-assets.ts +15 -15
- package/corpus/templates/slides/actions/import-code.ts +2 -43
- package/corpus/templates/slides/app/i18n/index.ts +14 -29
- package/corpus/templates/slides/server/routes/api/preview-images.get.ts +4 -1
- package/corpus/templates/tasks/.agents/skills/adding-a-feature/SKILL.md +9 -0
- package/corpus/templates/tasks/.agents/skills/frontend-design/SKILL.md +115 -68
- package/corpus/templates/tasks/.agents/skills/turn-into-app/SKILL.md +18 -6
- package/corpus/templates/tasks/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
- package/corpus/templates/tasks/app/components/layout/HeaderActions.tsx +1 -84
- package/corpus/templates/tasks/app/hooks/use-mobile.tsx +1 -21
- package/corpus/templates/tasks/app/i18n/index.ts +14 -29
- package/dist/agent/engine/ai-sdk-engine.js +2 -1
- package/dist/agent/engine/builder-engine.d.ts +11 -1
- package/dist/agent/engine/builder-engine.js +11 -4
- package/dist/agent/engine/openai-compatible-endpoint.d.ts +2 -0
- package/dist/agent/engine/openai-compatible-endpoint.js +5 -1
- package/dist/agent/engine/provider-endpoint-validation.d.ts +9 -0
- package/dist/agent/engine/provider-endpoint-validation.js +26 -0
- package/dist/agent/engine/provider-env-vars.d.ts +1 -1
- package/dist/agent/engine/provider-env-vars.js +1 -1
- package/dist/agent/engine/registry.d.ts +8 -6
- package/dist/agent/engine/registry.js +37 -24
- package/dist/agent/tool-search.d.ts +1 -0
- package/dist/agent/tool-search.js +17 -1
- package/dist/automations/service.js +4 -10
- package/dist/brand-kit/brand-signals.d.ts +13 -0
- package/dist/brand-kit/brand-signals.js +15 -0
- package/dist/brand-kit/index.d.ts +2 -2
- package/dist/brand-kit/index.js +1 -1
- package/dist/chat-threads/store.d.ts +2 -0
- package/dist/chat-threads/store.js +1 -1
- package/dist/cli/agent-plugin.d.ts +5 -2
- package/dist/cli/agent-plugin.js +17 -9
- package/dist/cli/code-agent-executor.js +25 -5
- package/dist/cli/code-agent-mcp-config.d.ts +21 -0
- package/dist/cli/code-agent-mcp-config.js +103 -0
- package/dist/cli/plan-blocks.d.ts +3 -18
- package/dist/cli/plan-blocks.js +2 -95
- package/dist/cli/plan-publish-store.d.ts +2 -61
- package/dist/cli/plan-publish-store.js +2 -127
- package/dist/cli/skills-content/connection.d.ts +1 -1
- package/dist/cli/skills-content/connection.js +1 -52
- package/dist/cli/skills-content/visual-recap-skill.d.ts +1 -1
- package/dist/cli/skills-content/visual-recap-skill.js +1 -553
- package/dist/client/NewWorkspaceAppFlow.js +4 -1
- package/dist/client/agent-chat/index.d.ts +4 -1
- package/dist/client/agent-chat/index.js +4 -1
- package/dist/client/agent-engine-key.d.ts +14 -4
- package/dist/client/agent-engine-key.js +51 -5
- package/dist/client/agent-page/AgentTabsPage.d.ts +1 -0
- package/dist/client/agent-page/AgentTabsPage.js +4 -3
- package/dist/client/agent-provider-catalog.d.ts +20 -0
- package/dist/client/agent-provider-catalog.js +100 -0
- package/dist/client/app-providers.d.ts +3 -1
- package/dist/client/app-providers.js +50 -5
- package/dist/client/blocks/index.d.ts +1 -0
- package/dist/client/blocks/index.js +1 -0
- package/dist/client/chat/run-recovery.js +4 -48
- package/dist/client/chat/runtime.js +63 -0
- package/dist/client/chat-first/agents-pane.d.ts +2 -0
- package/dist/client/chat-first/agents-pane.js +6 -0
- package/dist/client/chat-first/app-pane.d.ts +2 -0
- package/dist/client/chat-first/app-pane.js +6 -0
- package/dist/client/chat-first/apps-rail.d.ts +2 -0
- package/dist/client/chat-first/apps-rail.js +103 -0
- package/dist/client/chat-first/browser-pane.d.ts +2 -0
- package/dist/client/chat-first/browser-pane.js +64 -0
- package/dist/client/chat-first/chat-history.d.ts +12 -0
- package/dist/client/chat-first/chat-history.js +10 -0
- package/dist/client/chat-first/copy.d.ts +2 -0
- package/dist/client/chat-first/copy.js +117 -0
- package/dist/client/chat-first/index.d.ts +13 -0
- package/dist/client/chat-first/index.js +12 -0
- package/dist/client/chat-first/primary-nav.d.ts +8 -0
- package/dist/client/chat-first/primary-nav.js +6 -0
- package/dist/client/chat-first/session-watch-pane.d.ts +2 -0
- package/dist/client/chat-first/session-watch-pane.js +9 -0
- package/dist/client/chat-first/surface-panel.d.ts +9 -0
- package/dist/client/chat-first/surface-panel.js +9 -0
- package/dist/client/chat-first/surface-tabs.d.ts +9 -0
- package/dist/client/chat-first/surface-tabs.js +74 -0
- package/dist/client/chat-first/types.d.ts +74 -0
- package/dist/client/chat-first/types.js +1 -0
- package/dist/client/chat-first-agent-activity.d.ts +11 -0
- package/dist/client/chat-first-agent-activity.js +51 -0
- package/dist/client/chat-first-surface-panel-toggle.d.ts +5 -0
- package/dist/client/chat-first-surface-panel-toggle.js +6 -0
- package/dist/client/chat-first.d.ts +208 -0
- package/dist/client/chat-first.js +817 -0
- package/dist/client/extensions/ExtensionViewer.js +8 -1
- package/dist/client/i18n.d.ts +14 -0
- package/dist/client/i18n.js +18 -0
- package/dist/client/resources/McpIntegrationDialog.js +3 -2
- package/dist/client/resources/McpServerDetail.js +6 -11
- package/dist/client/resources/index.d.ts +1 -0
- package/dist/client/resources/index.js +1 -0
- package/dist/client/resources/use-mcp-servers.d.ts +20 -0
- package/dist/client/resources/use-mcp-servers.js +82 -46
- package/dist/client/settings/ProviderSetupForm.d.ts +21 -0
- package/dist/client/settings/ProviderSetupForm.js +145 -0
- package/dist/client/settings/SettingsPanel.js +52 -49
- package/dist/client/settings/index.d.ts +3 -0
- package/dist/client/settings/index.js +3 -0
- package/dist/coding-tools/run-code.d.ts +5 -0
- package/dist/coding-tools/run-code.js +196 -36
- package/dist/coding-tools/tool-orchestration.d.ts +10 -0
- package/dist/coding-tools/tool-orchestration.js +107 -0
- package/dist/collab/routes.d.ts +1 -1
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/jobs/background-automation-runner.js +19 -2
- package/dist/jobs/frontmatter.d.ts +9 -0
- package/dist/jobs/frontmatter.js +16 -0
- package/dist/jobs/scheduler-health.d.ts +20 -0
- package/dist/jobs/scheduler-health.js +86 -1
- package/dist/jobs/scheduler.js +46 -9
- package/dist/jobs/tools.d.ts +1 -1
- package/dist/jobs/tools.js +2 -7
- package/dist/localization/default-messages.d.ts +20 -0
- package/dist/localization/default-messages.js +25 -5
- package/dist/mcp-client/routes.d.ts +3 -0
- package/dist/mcp-client/routes.js +14 -0
- package/dist/notifications/routes.d.ts +1 -1
- package/dist/observability/routes.d.ts +3 -3
- package/dist/onboarding/app-profile.js +1 -1
- package/dist/provider-api/actions/custom-provider-registration.d.ts +8 -8
- package/dist/provider-api/actions/provider-api.d.ts +11 -11
- package/dist/scripts/agent-engines/test-agent-engine.js +34 -10
- package/dist/secrets/routes.d.ts +6 -6
- package/dist/server/agent-chat/run-code-tools.d.ts +1 -1
- package/dist/server/agent-chat/run-code-tools.js +3 -1
- package/dist/server/agent-chat-plugin.js +6 -6
- package/dist/server/agent-engine-api-key-route.js +43 -12
- package/dist/server/agents-bundle.d.ts +2 -0
- package/dist/server/agents-bundle.js +32 -2
- package/dist/server/auth.js +21 -5
- package/dist/server/credential-provider.d.ts +8 -2
- package/dist/server/credential-provider.js +14 -9
- package/dist/server/design-token-utils.d.ts +18 -0
- package/dist/server/design-token-utils.js +31 -0
- package/dist/server/onboarding-html.js +22 -2
- package/dist/server/transcribe-voice.d.ts +1 -1
- package/dist/shared/chat-first-app-creation.d.ts +19 -0
- package/dist/shared/chat-first-app-creation.js +75 -0
- package/dist/shared/document-title.d.ts +7 -0
- package/dist/shared/document-title.js +29 -0
- package/dist/shared/index.d.ts +2 -0
- package/dist/shared/index.js +2 -0
- package/dist/styles/chat-history-list.css +16 -0
- package/dist/templates/chat/.agents/skills/adding-a-feature/SKILL.md +9 -0
- package/dist/templates/chat/.agents/skills/frontend-design/SKILL.md +115 -68
- package/dist/templates/chat/.agents/skills/turn-into-app/SKILL.md +18 -6
- package/dist/templates/chat/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
- package/dist/templates/chat/app/i18n/index.ts +14 -29
- package/dist/templates/default/.agents/skills/adding-a-feature/SKILL.md +9 -0
- package/dist/templates/default/.agents/skills/frontend-design/SKILL.md +115 -68
- package/dist/templates/default/.agents/skills/turn-into-app/SKILL.md +18 -6
- package/dist/templates/default/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
- package/dist/templates/default/app/i18n/index.ts +14 -29
- package/dist/templates/default/react-router.config.ts +18 -0
- package/dist/templates/headless/.agents/skills/turn-into-app/SKILL.md +18 -6
- package/dist/templates/headless/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
- package/dist/templates/workspace-core/.agents/skills/adding-a-feature/SKILL.md +9 -0
- package/dist/templates/workspace-core/.agents/skills/address-feedback/SKILL.md +22 -9
- package/dist/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +115 -68
- package/dist/templates/workspace-core/.agents/skills/turn-into-app/SKILL.md +18 -6
- package/dist/templates/workspace-core/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
- package/dist/templates/workspace-core/.agents/skills/workspace-conventions/SKILL.md +7 -0
- package/dist/triggers/dispatcher.js +1 -8
- package/docs/content/environment-variables.mdx +39 -38
- package/package.json +5 -4
- package/src/templates/chat/.agents/skills/adding-a-feature/SKILL.md +9 -0
- package/src/templates/chat/.agents/skills/frontend-design/SKILL.md +115 -68
- package/src/templates/chat/.agents/skills/turn-into-app/SKILL.md +18 -6
- package/src/templates/chat/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
- package/src/templates/chat/app/i18n/index.ts +14 -29
- package/src/templates/default/.agents/skills/adding-a-feature/SKILL.md +9 -0
- package/src/templates/default/.agents/skills/frontend-design/SKILL.md +115 -68
- package/src/templates/default/.agents/skills/turn-into-app/SKILL.md +18 -6
- package/src/templates/default/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
- package/src/templates/default/app/i18n/index.ts +14 -29
- package/src/templates/default/react-router.config.ts +18 -0
- package/src/templates/headless/.agents/skills/turn-into-app/SKILL.md +18 -6
- package/src/templates/headless/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
- package/src/templates/workspace-core/.agents/skills/adding-a-feature/SKILL.md +9 -0
- package/src/templates/workspace-core/.agents/skills/address-feedback/SKILL.md +22 -9
- package/src/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +115 -68
- package/src/templates/workspace-core/.agents/skills/turn-into-app/SKILL.md +18 -6
- package/src/templates/workspace-core/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
- package/src/templates/workspace-core/.agents/skills/workspace-conventions/SKILL.md +7 -0
- package/corpus/templates/plan/app/components/plan/wireframe/sanitize-html.ts +0 -343
|
@@ -22,6 +22,22 @@ export declare const SECONDARY_PATHS: string[];
|
|
|
22
22
|
export declare const CODE_MAX_FILES = 20;
|
|
23
23
|
/** Maximum total bytes accepted in import-code. */
|
|
24
24
|
export declare const CODE_MAX_TOTAL_BYTES: number;
|
|
25
|
+
export interface CodeAnalysisFile {
|
|
26
|
+
filename: string;
|
|
27
|
+
content: string;
|
|
28
|
+
}
|
|
29
|
+
export interface CodeAnalysisResult {
|
|
30
|
+
source: "code";
|
|
31
|
+
fileCount: number;
|
|
32
|
+
filesAnalyzed: string[];
|
|
33
|
+
colors: Record<string, string>;
|
|
34
|
+
cssCustomProperties: Record<string, string>;
|
|
35
|
+
fonts: CodeAnalysisState["fonts"];
|
|
36
|
+
spacing: CodeAnalysisState["spacing"];
|
|
37
|
+
borderRadius: CodeAnalysisState["borderRadius"];
|
|
38
|
+
stylingFramework: CodeAnalysisState["stylingFramework"];
|
|
39
|
+
rawExtracts: CodeAnalysisState["rawExtracts"];
|
|
40
|
+
}
|
|
25
41
|
/** Regex for hex colors (3-8 digit, including alpha). */
|
|
26
42
|
export declare const HEX_COLOR_RE: RegExp;
|
|
27
43
|
/** Regex for well-known named CSS colors. */
|
|
@@ -140,6 +156,8 @@ export declare function analyzePackageJson(state: CodeAnalysisState, content: st
|
|
|
140
156
|
export declare function analyzeThemeSourceFile(state: CodeAnalysisState, content: string, filename: string): void;
|
|
141
157
|
/** Route a file to the correct analyzer based on filename. */
|
|
142
158
|
export declare function analyzeCodeFile(state: CodeAnalysisState, filename: string, content: string): void;
|
|
159
|
+
/** Analyze the bounded code-file payload accepted by the import-code actions. */
|
|
160
|
+
export declare function analyzeCodeFiles(files: CodeAnalysisFile[]): CodeAnalysisResult;
|
|
143
161
|
/** Deduplicate and trim an array of strings. */
|
|
144
162
|
export declare function unique(arr: string[]): string[];
|
|
145
163
|
/** Extract hex and named colors from plain text. */
|
|
@@ -595,6 +595,37 @@ export function analyzeCodeFile(state, filename, content) {
|
|
|
595
595
|
}
|
|
596
596
|
}
|
|
597
597
|
}
|
|
598
|
+
/** Analyze the bounded code-file payload accepted by the import-code actions. */
|
|
599
|
+
export function analyzeCodeFiles(files) {
|
|
600
|
+
const truncated = files.slice(0, CODE_MAX_FILES);
|
|
601
|
+
let totalBytes = 0;
|
|
602
|
+
const accepted = [];
|
|
603
|
+
for (const file of truncated) {
|
|
604
|
+
const size = new TextEncoder().encode(file.content).byteLength;
|
|
605
|
+
if (totalBytes + size > CODE_MAX_TOTAL_BYTES)
|
|
606
|
+
break;
|
|
607
|
+
totalBytes += size;
|
|
608
|
+
accepted.push(file);
|
|
609
|
+
}
|
|
610
|
+
const state = createCodeAnalysisState();
|
|
611
|
+
const filesAnalyzed = [];
|
|
612
|
+
for (const file of accepted) {
|
|
613
|
+
filesAnalyzed.push(file.filename);
|
|
614
|
+
analyzeCodeFile(state, file.filename, file.content);
|
|
615
|
+
}
|
|
616
|
+
return {
|
|
617
|
+
source: "code",
|
|
618
|
+
fileCount: accepted.length,
|
|
619
|
+
filesAnalyzed,
|
|
620
|
+
colors: Object.fromEntries(Object.entries(state.colors).slice(0, 60)),
|
|
621
|
+
cssCustomProperties: Object.fromEntries(Object.entries(state.cssCustomProperties).slice(0, 80)),
|
|
622
|
+
fonts: state.fonts.slice(0, 20),
|
|
623
|
+
spacing: state.spacing,
|
|
624
|
+
borderRadius: state.borderRadius,
|
|
625
|
+
stylingFramework: state.stylingFramework,
|
|
626
|
+
rawExtracts: state.rawExtracts,
|
|
627
|
+
};
|
|
628
|
+
}
|
|
598
629
|
// ---------------------------------------------------------------------------
|
|
599
630
|
// Document analysis helpers (import-document)
|
|
600
631
|
// ---------------------------------------------------------------------------
|
|
@@ -47,6 +47,17 @@ function withAppBasePath(path) {
|
|
|
47
47
|
}
|
|
48
48
|
const AGENT_NATIVE_TERMS_URL = "https://www.agent-native.com/terms";
|
|
49
49
|
const AGENT_NATIVE_PRIVACY_URL = "https://www.agent-native.com/privacy";
|
|
50
|
+
const BUILDER_PREVIEW_LOCAL_DEV_ENV = "AGENT_NATIVE_ALLOW_BUILDER_PREVIEW_LOCAL_DEV";
|
|
51
|
+
function isBuilderPreviewLocalDevEnabled() {
|
|
52
|
+
if (process.env.NODE_ENV !== "development" &&
|
|
53
|
+
process.env.NODE_ENV !== "test") {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
const value = process.env[BUILDER_PREVIEW_LOCAL_DEV_ENV]
|
|
57
|
+
?.trim()
|
|
58
|
+
.toLowerCase();
|
|
59
|
+
return value === "1" || value === "true";
|
|
60
|
+
}
|
|
50
61
|
const EN_AUTH_COPY = {
|
|
51
62
|
languageLabel: "Language",
|
|
52
63
|
systemLanguage: "System",
|
|
@@ -1296,6 +1307,7 @@ export function getOnboardingHtml(opts = {}) {
|
|
|
1296
1307
|
const publicOAuthOrigin = getPublicOAuthOrigin();
|
|
1297
1308
|
const workspaceGatewayReturnOrigin = getWorkspaceGatewayReturnOrigin();
|
|
1298
1309
|
const googleAuthMode = resolveGoogleAuthMode(opts.googleAuthMode);
|
|
1310
|
+
const builderPreviewLocalDevEnabled = isBuilderPreviewLocalDevEnabled();
|
|
1299
1311
|
const localeInitScript = getLocaleInitScript();
|
|
1300
1312
|
const marketing = opts.marketing ??
|
|
1301
1313
|
resolveBuiltInAuthMarketing({
|
|
@@ -2828,6 +2840,7 @@ ${signInJourneyInlineScript()}
|
|
|
2828
2840
|
var __AN_PUBLIC_OAUTH_ORIGIN = ${JSON.stringify(publicOAuthOrigin)};
|
|
2829
2841
|
var __AN_WORKSPACE_GATEWAY_RETURN_ORIGIN = ${JSON.stringify(workspaceGatewayReturnOrigin)};
|
|
2830
2842
|
var __AN_GOOGLE_AUTH_MODE = ${JSON.stringify(googleAuthMode)};
|
|
2843
|
+
var __AN_BUILDER_PREVIEW_LOCAL_DEV_ENABLED = ${JSON.stringify(builderPreviewLocalDevEnabled)};
|
|
2831
2844
|
function __anConfiguredOAuthOrigin() {
|
|
2832
2845
|
if (!__AN_PUBLIC_OAUTH_ORIGIN) return '';
|
|
2833
2846
|
try {
|
|
@@ -2957,8 +2970,15 @@ ${signInJourneyInlineScript()}
|
|
|
2957
2970
|
var hostname = (window.location.hostname || '').toLowerCase();
|
|
2958
2971
|
return hostname === 'localhost' || hostname === '::1' || hostname === '127.0.0.1' || hostname.indexOf('127.') === 0;
|
|
2959
2972
|
}
|
|
2973
|
+
function __anIsBuilderPreviewHost() {
|
|
2974
|
+
var hostname = (window.location.hostname || '').toLowerCase();
|
|
2975
|
+
return hostname.endsWith('.builderio.xyz') || hostname.endsWith('.builderio.dev') || hostname.endsWith('.builder.codes') || hostname.endsWith('.builder.my');
|
|
2976
|
+
}
|
|
2977
|
+
function __anCanUseLocalDevSignin() {
|
|
2978
|
+
return __anIsLoopbackHostname() || (__AN_BUILDER_PREVIEW_LOCAL_DEV_ENABLED && __anIsBuilderPreviewHost());
|
|
2979
|
+
}
|
|
2960
2980
|
function __anShouldStartWithLocalDev() {
|
|
2961
|
-
if (!
|
|
2981
|
+
if (!__anCanUseLocalDevSignin()) return false;
|
|
2962
2982
|
var params = new URLSearchParams(window.location.search);
|
|
2963
2983
|
var explicitTab = params.get('tab');
|
|
2964
2984
|
var verifiedRedirect = typeof __anIsVerifiedRedirectSuccess === 'function' && __anIsVerifiedRedirectSuccess();
|
|
@@ -2981,7 +3001,7 @@ ${signInJourneyInlineScript()}
|
|
|
2981
3001
|
var button = document.getElementById('local-dev-btn');
|
|
2982
3002
|
var fullOptionsButton = document.getElementById('local-dev-full-options');
|
|
2983
3003
|
var message = document.getElementById('local-dev-msg');
|
|
2984
|
-
if (!container || !button || !
|
|
3004
|
+
if (!container || !button || !__anCanUseLocalDevSignin()) return;
|
|
2985
3005
|
container.hidden = false;
|
|
2986
3006
|
var startWithLocalDev = __anShouldStartWithLocalDev();
|
|
2987
3007
|
__anSetFullAuthOptionsVisible(!startWithLocalDev);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type ChatFirstAppCreationVaultAccessMode = "all-apps" | "manual";
|
|
2
|
+
export interface ChatFirstAppCreationResource {
|
|
3
|
+
name: string;
|
|
4
|
+
kind: string;
|
|
5
|
+
path: string;
|
|
6
|
+
}
|
|
7
|
+
export interface ChatFirstAppCreationPromptInput {
|
|
8
|
+
appId: string;
|
|
9
|
+
prompt: string;
|
|
10
|
+
selectedKeys: string[];
|
|
11
|
+
selectedResources: ChatFirstAppCreationResource[];
|
|
12
|
+
vaultAccessMode: ChatFirstAppCreationVaultAccessMode;
|
|
13
|
+
appRoot?: string;
|
|
14
|
+
mountPath?: string;
|
|
15
|
+
scaffoldCommand?: string;
|
|
16
|
+
additionalInstructions?: string[];
|
|
17
|
+
}
|
|
18
|
+
export declare function titleFromChatFirstAppPrompt(prompt: string): string;
|
|
19
|
+
export declare function buildChatFirstAppCreationPrompt(input: ChatFirstAppCreationPromptInput): string;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
function slugify(value) {
|
|
2
|
+
return value
|
|
3
|
+
.toLowerCase()
|
|
4
|
+
.replace(/[^a-z0-9]+/g, "-")
|
|
5
|
+
.replace(/^-+|-+$/g, "")
|
|
6
|
+
.replace(/^[^a-z]+/, "")
|
|
7
|
+
.slice(0, 48);
|
|
8
|
+
}
|
|
9
|
+
export function titleFromChatFirstAppPrompt(prompt) {
|
|
10
|
+
const cleaned = prompt
|
|
11
|
+
.replace(/\b(build|create|make|an?|the|app|tool|dashboard)\b/gi, " ")
|
|
12
|
+
.replace(/\s+/g, " ")
|
|
13
|
+
.trim();
|
|
14
|
+
return slugify(cleaned || "new-app") || "new-app";
|
|
15
|
+
}
|
|
16
|
+
export function buildChatFirstAppCreationPrompt(input) {
|
|
17
|
+
const appRoot = input.appRoot?.trim() || `apps/${input.appId}`;
|
|
18
|
+
const mountPath = input.mountPath?.trim() || `/${input.appId}`;
|
|
19
|
+
const packagePath = `${appRoot.replace(/\/+$/, "")}/package.json`;
|
|
20
|
+
const keyList = input.selectedKeys.join(", ");
|
|
21
|
+
const grantRequest = input.vaultAccessMode === "all-apps"
|
|
22
|
+
? "Dispatch vault access: all saved vault keys are available to every workspace app by default. No per-app vault grants are needed."
|
|
23
|
+
: keyList
|
|
24
|
+
? `Requested Dispatch vault key grants for this app: ${keyList}`
|
|
25
|
+
: "Requested Dispatch vault key grants for this app: none";
|
|
26
|
+
const resourceList = input.selectedResources.length
|
|
27
|
+
? input.selectedResources
|
|
28
|
+
.map((resource) => `- ${resource.name} (${resource.kind}, ${resource.path})`)
|
|
29
|
+
.join("\n")
|
|
30
|
+
: "none";
|
|
31
|
+
const scaffoldInstructions = input.scaffoldCommand
|
|
32
|
+
? ["", "Scaffold instructions:", input.scaffoldCommand]
|
|
33
|
+
: [];
|
|
34
|
+
return [
|
|
35
|
+
"Create a new agent-native app in this workspace.",
|
|
36
|
+
"This is a new workspace app request, not a feature request for the current app.",
|
|
37
|
+
...scaffoldInstructions,
|
|
38
|
+
"",
|
|
39
|
+
`Suggested app name: ${input.appId} (you may adjust the slug if it conflicts)`,
|
|
40
|
+
`User prompt: ${input.prompt.trim()}`,
|
|
41
|
+
`Generate a concise one-sentence app description from the user prompt before coding; save it in ${packagePath} \"description\" so Dispatch and A2A can describe the app.`,
|
|
42
|
+
"If the user mentions a product or company such as Granola, Loom, Superhuman, Linear, or Notion, treat it as product inspiration unless they explicitly ask to connect to that service. Do not invent or require third-party API keys like GRANOLA_API_KEY just because a product is named.",
|
|
43
|
+
grantRequest,
|
|
44
|
+
`Requested Dispatch workspace resources for this app:\n${resourceList}`,
|
|
45
|
+
"Dispatch workspace resources with scope=all are inherited workspace context. Do not copy or sync them into the new app; every workspace app reads them at runtime and may override with app shared or personal resources.",
|
|
46
|
+
"",
|
|
47
|
+
"Pick a UI template that fits the user's prompt - analytics, assets, brain, calendar, chat, content, design, dispatch, forms, mail, slides, or clips when none of the others fit.",
|
|
48
|
+
'If you use the chat template, treat it as scaffolding only: the finished app must use the requested app\'s real name, home screen, navigation, package metadata, and manifest, and it must not leave visible "Chat", "Starter", "Blank app", or "New app" UI behind.',
|
|
49
|
+
`Use the workspace app layout: create it under ${appRoot}, mount it at ${mountPath}, keep it on the shared workspace database/hosting model, and avoid table-name collisions by namespacing any new domain tables to the app.`,
|
|
50
|
+
`Important routing rule: from outside the app, link to ${mountPath}; inside ${appRoot}, React Router routes are app-local. Use <Link to=\"/review\"> and navigate(\"/review\"), not \"${mountPath}/review\"; APP_BASE_PATH supplies the mounted prefix, and hardcoding it causes doubled URLs.`,
|
|
51
|
+
'Prefer useActionQuery/useActionMutation for actions. If you must raw-fetch framework endpoints, wrap them with agentNativePath("/_agent-native/actions/<name>") so mounted apps call the right URL.',
|
|
52
|
+
`Use relative workspace links like ${mountPath}. Do not hardcode localhost, 127.0.0.1, 8080, 8100, or any dev port; the active workspace gateway or Desktop shell owns the port.`,
|
|
53
|
+
"Use the framework/template UI stack: shadcn/ui components and @tabler/icons-react. Do not add lucide-react or another icon library for standard UI.",
|
|
54
|
+
"Existing first-party apps are neighbors, not implementation details for this app. If the user's prompt mentions Mail, Calendar, Analytics, Brain, Assets, Dispatch, or other templates, treat them as existing hosted/connected apps that this app can link to or call through A2A/default connected agents. For example, Mail, Calendar, Analytics, Brain, and Assets already exist at https://mail.agent-native.com, https://calendar.agent-native.com, https://analytics.agent-native.com, https://brain.agent-native.com, and https://assets.agent-native.com.",
|
|
55
|
+
`Do not create wrapper apps or scaffold child apps/routes for Mail, Calendar, Analytics, Brain, Assets, etc. inside ${appRoot} just so this app can access them. If the request is a cross-app dashboard or overview, build only the new dashboard/overview app and delegate to the existing apps for domain work.`,
|
|
56
|
+
"Only create another first-party app when the user explicitly asks for a customized app from that template; otherwise keep using the hosted/shared app so improvements to the base app keep flowing to users.",
|
|
57
|
+
"Do not satisfy this by adding a route, page, component, or file inside apps/chat or another existing app unless the user explicitly asks to modify that existing app.",
|
|
58
|
+
input.vaultAccessMode === "all-apps"
|
|
59
|
+
? "Do not create per-app Dispatch vault grants unless the workspace switches vault access to manual or the user explicitly asks for manual grants."
|
|
60
|
+
: keyList
|
|
61
|
+
? `After the app exists, grant the selected Dispatch vault keys to appId "${input.appId}" and sync them once the app server is available. Treat these as requested grants, not active grants before creation succeeds.`
|
|
62
|
+
: "Do not grant any Dispatch vault keys unless the user asks later.",
|
|
63
|
+
input.selectedResources.length
|
|
64
|
+
? `After the app exists, grant the selected Dispatch workspace resources to appId "${input.appId}". Do not sync All-app workspace resources; they are inherited.`
|
|
65
|
+
: "Do not grant any selected-only Dispatch workspace resources unless the user asks later.",
|
|
66
|
+
"",
|
|
67
|
+
"App readiness requirements before handing off:",
|
|
68
|
+
`- Ensure ${packagePath} exists with displayName/name and a concise description; Dispatch discovers workspace apps from the workspace filesystem and app metadata.`,
|
|
69
|
+
"- Update the app manifest/package/deploy metadata needed by the existing workspace deployment model.",
|
|
70
|
+
`- Ensure the React Router client entry preserves APP_BASE_PATH/VITE_APP_BASE_PATH so ${mountPath} hydrates correctly.`,
|
|
71
|
+
"- Verify the app's agent card/A2A metadata is ready so Dispatch can discover and delegate to the app after deployment. Every sibling workspace app is available over A2A by default through call-agent, with names and descriptions from the workspace app registry.",
|
|
72
|
+
`When it is ready, start or update the workspace dev server and navigate the user to ${mountPath} on the workspace origin. Do not prefix it with /dispatch/, /apps/, /workspace/, or any other Dispatch tab.`,
|
|
73
|
+
...(input.additionalInstructions ?? []),
|
|
74
|
+
].join("\n");
|
|
75
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Browser titles must be human-readable strings. React Router stringifies a
|
|
3
|
+
* structured `title` value, which otherwise leaks the whole payload into the
|
|
4
|
+
* browser tab.
|
|
5
|
+
*/
|
|
6
|
+
export declare function isHumanReadableDocumentTitle(value: unknown): value is string;
|
|
7
|
+
export declare function normalizeDocumentTitle(value: unknown, fallbackTitle: string): string;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const STRUCTURED_TITLE_START = /^[\[{]/;
|
|
2
|
+
/**
|
|
3
|
+
* Browser titles must be human-readable strings. React Router stringifies a
|
|
4
|
+
* structured `title` value, which otherwise leaks the whole payload into the
|
|
5
|
+
* browser tab.
|
|
6
|
+
*/
|
|
7
|
+
export function isHumanReadableDocumentTitle(value) {
|
|
8
|
+
if (typeof value !== "string")
|
|
9
|
+
return false;
|
|
10
|
+
const title = value.trim();
|
|
11
|
+
if (!title)
|
|
12
|
+
return false;
|
|
13
|
+
if (!STRUCTURED_TITLE_START.test(title))
|
|
14
|
+
return true;
|
|
15
|
+
try {
|
|
16
|
+
const parsed = JSON.parse(title);
|
|
17
|
+
return parsed === null || typeof parsed !== "object";
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export function normalizeDocumentTitle(value, fallbackTitle) {
|
|
24
|
+
if (isHumanReadableDocumentTitle(value))
|
|
25
|
+
return value.trim();
|
|
26
|
+
if (isHumanReadableDocumentTitle(fallbackTitle))
|
|
27
|
+
return fallbackTitle.trim();
|
|
28
|
+
return "Agent Native";
|
|
29
|
+
}
|
package/dist/shared/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export { agentEnv, type EnvVar } from "./agent-env.js";
|
|
|
3
3
|
export { extractOAuthStateAppId } from "./oauth-state.js";
|
|
4
4
|
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
5
|
export { truncate } from "./truncate.js";
|
|
6
|
+
export { isHumanReadableDocumentTitle, normalizeDocumentTitle, } from "./document-title.js";
|
|
6
7
|
export { injectDocumentMarkup } from "./html-document.js";
|
|
7
8
|
export { withBuilderUtmTrackingParams } from "./builder-link-tracking.js";
|
|
8
9
|
export { buildRuntimeConfigPrompt, formatRuntimeConfigReport, getRuntimeConfigReport, parseRuntimeConfigReport, runtimeConfigRequirementsFromSearchParams, type RuntimeConfigEnvironment, type RuntimeConfigIssue, type RuntimeConfigIssueCode, type RuntimeConfigIssueSeverity, type RuntimeConfigPhase, type RuntimeConfigReport, type RuntimeConfigRequirements, } from "./runtime-config.js";
|
|
@@ -10,6 +11,7 @@ export { llmConnectionTrackingProperties, normalizeLlmConnection, type LlmConnec
|
|
|
10
11
|
export { DISPATCH_WORKSPACE_ROOT_REDIRECTS, RESERVED_WORKSPACE_APP_IDS, assertValidWorkspaceAppId, getWorkspaceAppIdValidationError, isValidWorkspaceAppIdFormat, } from "./workspace-app-id.js";
|
|
11
12
|
export { DEFAULT_WORKSPACE_APP_AUDIENCE, WORKSPACE_APP_AUDIENCES, normalizeWorkspaceAppAudience, normalizeWorkspaceAppPathList, workspaceAppAudienceFromEnv, workspaceAppAudienceFromPackageJson, workspaceAppRouteAccessFromEnv, workspaceAppRouteAccessFromPackageJson, type WorkspaceAppRouteAccess, type WorkspaceAppRouteAccessFromConfig, type WorkspaceAppAudience, } from "./workspace-app-audience.js";
|
|
12
13
|
export { AGENT_NATIVE_OPEN_PATH, AGENT_SIDEBAR_QUERY_PARAM, AGENT_SIDEBAR_QUERY_VALUE_CLOSED, isAgentNativeOpenDeepLink, withCollapsedAgentSidebarParam, } from "./agent-sidebar-url.js";
|
|
14
|
+
export { buildChatFirstAppCreationPrompt, titleFromChatFirstAppPrompt, type ChatFirstAppCreationPromptInput, type ChatFirstAppCreationResource, type ChatFirstAppCreationVaultAccessMode, } from "./chat-first-app-creation.js";
|
|
13
15
|
export { createPollEngine, type PollEngineOptions, type PollEngineHandle, } from "./poll-engine.js";
|
|
14
16
|
export { AGENT_NATIVE_DEFAULT_SOCIAL_IMAGE, AGENT_NATIVE_SOCIAL_IMAGE_CACHE_BUSTER, AGENT_NATIVE_SOCIAL_IMAGE_ALT, AGENT_NATIVE_SOCIAL_IMAGE_HEIGHT, AGENT_NATIVE_SOCIAL_IMAGE_PATH, AGENT_NATIVE_SOCIAL_IMAGE_TYPE, AGENT_NATIVE_SOCIAL_IMAGE_WIDTH, defaultSocialImageMeta, withAgentNativeSocialImageCacheBuster, withDefaultSocialImage, type SocialMetaDescriptor, } from "./social-meta.js";
|
|
15
17
|
export { EMBED_MODE_QUERY_PARAM, EMBED_SESSION_COOKIE, EMBED_START_PATH, EMBED_TOKEN_QUERY_PARAM, } from "./embed-auth.js";
|
package/dist/shared/index.js
CHANGED
|
@@ -3,6 +3,7 @@ export { agentEnv } from "./agent-env.js";
|
|
|
3
3
|
export { extractOAuthStateAppId } from "./oauth-state.js";
|
|
4
4
|
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
5
|
export { truncate } from "./truncate.js";
|
|
6
|
+
export { isHumanReadableDocumentTitle, normalizeDocumentTitle, } from "./document-title.js";
|
|
6
7
|
export { injectDocumentMarkup } from "./html-document.js";
|
|
7
8
|
export { withBuilderUtmTrackingParams } from "./builder-link-tracking.js";
|
|
8
9
|
export { buildRuntimeConfigPrompt, formatRuntimeConfigReport, getRuntimeConfigReport, parseRuntimeConfigReport, runtimeConfigRequirementsFromSearchParams, } from "./runtime-config.js";
|
|
@@ -10,6 +11,7 @@ export { llmConnectionTrackingProperties, normalizeLlmConnection, } from "./llm-
|
|
|
10
11
|
export { DISPATCH_WORKSPACE_ROOT_REDIRECTS, RESERVED_WORKSPACE_APP_IDS, assertValidWorkspaceAppId, getWorkspaceAppIdValidationError, isValidWorkspaceAppIdFormat, } from "./workspace-app-id.js";
|
|
11
12
|
export { DEFAULT_WORKSPACE_APP_AUDIENCE, WORKSPACE_APP_AUDIENCES, normalizeWorkspaceAppAudience, normalizeWorkspaceAppPathList, workspaceAppAudienceFromEnv, workspaceAppAudienceFromPackageJson, workspaceAppRouteAccessFromEnv, workspaceAppRouteAccessFromPackageJson, } from "./workspace-app-audience.js";
|
|
12
13
|
export { AGENT_NATIVE_OPEN_PATH, AGENT_SIDEBAR_QUERY_PARAM, AGENT_SIDEBAR_QUERY_VALUE_CLOSED, isAgentNativeOpenDeepLink, withCollapsedAgentSidebarParam, } from "./agent-sidebar-url.js";
|
|
14
|
+
export { buildChatFirstAppCreationPrompt, titleFromChatFirstAppPrompt, } from "./chat-first-app-creation.js";
|
|
13
15
|
export { createPollEngine, } from "./poll-engine.js";
|
|
14
16
|
export { AGENT_NATIVE_DEFAULT_SOCIAL_IMAGE, AGENT_NATIVE_SOCIAL_IMAGE_CACHE_BUSTER, AGENT_NATIVE_SOCIAL_IMAGE_ALT, AGENT_NATIVE_SOCIAL_IMAGE_HEIGHT, AGENT_NATIVE_SOCIAL_IMAGE_PATH, AGENT_NATIVE_SOCIAL_IMAGE_TYPE, AGENT_NATIVE_SOCIAL_IMAGE_WIDTH, defaultSocialImageMeta, withAgentNativeSocialImageCacheBuster, withDefaultSocialImage, } from "./social-meta.js";
|
|
15
17
|
export { EMBED_MODE_QUERY_PARAM, EMBED_SESSION_COOKIE, EMBED_START_PATH, EMBED_TOKEN_QUERY_PARAM, } from "./embed-auth.js";
|
|
@@ -1 +1,17 @@
|
|
|
1
1
|
@import "@agent-native/toolkit/chat-history.css";
|
|
2
|
+
|
|
3
|
+
/* Chat-first rails share this geometry across Dispatch and Electron. Keep
|
|
4
|
+
the row at the same compact rhythm as the primary nav and app list. */
|
|
5
|
+
section[data-chat-first-chat-history]
|
|
6
|
+
.an-chat-history--rail
|
|
7
|
+
.an-chat-history-row {
|
|
8
|
+
margin-inline: 0;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
section[data-chat-first-chat-history]
|
|
12
|
+
.an-chat-history--rail
|
|
13
|
+
.an-chat-history-row__button {
|
|
14
|
+
min-height: 28px;
|
|
15
|
+
padding-block: 4px;
|
|
16
|
+
padding-inline: 8px 32px;
|
|
17
|
+
}
|
|
@@ -81,6 +81,13 @@ or other file-like payloads, design the upload path in the same change:
|
|
|
81
81
|
provider upload first, then URL/id/blob handle in SQL. Do not add base64/binary
|
|
82
82
|
columns or stuff files into `application_state`.
|
|
83
83
|
|
|
84
|
+
If the feature adds a server-side dependency carrying a native binary or heavy
|
|
85
|
+
runtime — headless browser, ffmpeg, image/video processing, ML runtime — read
|
|
86
|
+
the `performance` skill §9 before adding it. A deployed app has one `/*` page
|
|
87
|
+
function that every visitor's cache miss wakes, and it ships whatever the server
|
|
88
|
+
bundle depends on. Run that work from a background function or a job so the page
|
|
89
|
+
function never carries the weight.
|
|
90
|
+
|
|
84
91
|
**If the action produces or lists a navigable resource**, add a `link` builder that returns `{ url: buildDeepLink({ app, view, params }), label }`. External coding agents and MCP hosts (Claude / ChatGPT / Claude Code / Cowork / Codex, over MCP/A2A) then surface an "Open in … →" deep link that drops the user back into the running UI focused on the record — for free. If a compatible MCP host should render an inline review/edit surface, also add `mcpApp` with `embedApp()` so the action embeds the real React app route instead of a one-off HTML UI. The `link` builder and `mcpApp` metadata must be pure and synchronous (no I/O). Any external-agent read/ingest action must be `http: { method: "GET" }` + `readOnly: true` + `publicAgent: { expose: true, readOnly: true, requiresAuth: true }`. See the `external-agents` skill.
|
|
85
92
|
|
|
86
93
|
### 3. Skills / Instructions
|
|
@@ -195,4 +202,6 @@ TL;DR: declare the vocabulary once with `defineAppRoles({ appId, roles, defaultR
|
|
|
195
202
|
- **create-skill** — How to create skills for new patterns (area 3 in detail)
|
|
196
203
|
- **storing-data** — Where to store the feature's data
|
|
197
204
|
- **real-time-sync** — How the UI stays in sync when the agent writes data
|
|
205
|
+
- **performance** — Query/load cost, and (§9) cold-start artifact size when a
|
|
206
|
+
feature adds a server-side dependency
|
|
198
207
|
- **internationalization** — How to update localized UI copy and catalogs
|
|
@@ -2,16 +2,19 @@
|
|
|
2
2
|
name: frontend-design
|
|
3
3
|
description: >-
|
|
4
4
|
Sets the visual direction for a new or redesigned surface, with production
|
|
5
|
-
quality that avoids generic AI aesthetics. Use when building
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
quality that avoids generic AI aesthetics. Use when building, redesigning, or
|
|
6
|
+
cleaning up any user-facing UI, including screenshot-driven feedback, copy or
|
|
7
|
+
density reduction, settings, control placement, or a design pass ("make this
|
|
8
|
+
look good"). Do not load it only for purely mechanical wiring or formatting.
|
|
9
9
|
scope: dev
|
|
10
10
|
license: Complete terms in LICENSE.txt
|
|
11
11
|
source: https://github.com/anthropics/skills/blob/main/skills/frontend-design/SKILL.md
|
|
12
12
|
local-changes: >-
|
|
13
|
-
Description
|
|
14
|
-
|
|
13
|
+
Description deliberately widened on 2026-08-09 because the previous narrow
|
|
14
|
+
trigger excluded routine UI edits, including screenshot-driven cleanup, copy
|
|
15
|
+
and density changes, settings, and control placement. An upstream sync must
|
|
16
|
+
not re-narrow it. Verification remains deliberately rescoped; an upstream
|
|
17
|
+
sync must not restore screenshot-everything or broad browser-automation steps.
|
|
15
18
|
metadata:
|
|
16
19
|
internal: true
|
|
17
20
|
---
|
|
@@ -26,10 +29,12 @@ The user may ask for a component, page, full app, dashboard, marketing surface,
|
|
|
26
29
|
|
|
27
30
|
Before coding, decide:
|
|
28
31
|
|
|
29
|
-
- **Purpose**: What workflow does this surface make easier? What
|
|
32
|
+
- **Purpose**: What workflow does this surface make easier? What does the user
|
|
33
|
+
need to understand, decide, or do next?
|
|
30
34
|
- **Audience**: Who will use it repeatedly, and what should feel fast, calm, playful, premium, editorial, technical, or utilitarian?
|
|
31
35
|
- **Tone**: Choose a concrete aesthetic direction: refined minimal, dense operations console, editorial, playful, industrial, warm handmade, high-contrast data tool, etc.
|
|
32
|
-
- **Information hierarchy**: What must be visible
|
|
36
|
+
- **Information hierarchy**: What must be visible to orient and act, and what
|
|
37
|
+
can wait until context or intent makes it relevant?
|
|
33
38
|
- **Differentiation**: What makes this feel designed for this exact domain?
|
|
34
39
|
|
|
35
40
|
Then implement working code that is cohesive, accessible, responsive, and polished in small details: typography, spacing, copy, motion, empty states, loading states, focus states, and error states.
|
|
@@ -50,46 +55,80 @@ before selecting its accent family. Shared behavior and semantic token names
|
|
|
50
55
|
should stay consistent; palette, density, composition, type contrast, and
|
|
51
56
|
shape language should not be identical by default.
|
|
52
57
|
|
|
53
|
-
## Minimalism And Progressive Disclosure
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
- **
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
- **
|
|
92
|
-
|
|
58
|
+
## High-Signal Minimalism And Progressive Disclosure
|
|
59
|
+
|
|
60
|
+
Minimalism means fewer competing kinds of UI, not less useful information. Keep
|
|
61
|
+
surfaces dense and scannable: reduce redundant prose, decorative containers,
|
|
62
|
+
borders, badges, accent colors, and persistent controls before removing content
|
|
63
|
+
that helps the user orient, compare, decide, or recover. The reference class is
|
|
64
|
+
calm productivity software such as ChatGPT/Codex, Linear, and Vercel, not empty
|
|
65
|
+
whitespace.
|
|
66
|
+
|
|
67
|
+
### Product UX Philosophy
|
|
68
|
+
|
|
69
|
+
Apply these principles as binding decision rules:
|
|
70
|
+
|
|
71
|
+
- **Purpose over presence**: Every visible element must support orientation,
|
|
72
|
+
state comprehension, a decision, an action, or recovery. Before adding one,
|
|
73
|
+
name which; if it supports none or duplicates another element, remove or
|
|
74
|
+
defer it.
|
|
75
|
+
- **Clarity over cleverness**: Use plain language, familiar patterns, explicit
|
|
76
|
+
hierarchy, and visible state. Do not make decoration or invented terminology
|
|
77
|
+
carry meaning. Preserve the labels, hit targets, focus states, and recovery
|
|
78
|
+
paths required for accessible use.
|
|
79
|
+
- **Simple first, powerful on demand**: Keep the current task and state in the
|
|
80
|
+
default presentation. Put advanced, rare, diagnostic, and secondary work
|
|
81
|
+
behind contextual disclosure, menus, or Settings. Do not turn a discoverability
|
|
82
|
+
concern into permanent chrome, and do not hide information needed for the
|
|
83
|
+
current decision.
|
|
84
|
+
- **Hierarchy over chrome**: Use typography, spacing, alignment, and restrained
|
|
85
|
+
emphasis to organize information. Treat prose, controls, borders, cards,
|
|
86
|
+
badges, and accent colors as a competition budget: reduce competing kinds of
|
|
87
|
+
elements before reducing useful information. When a surface has one clear
|
|
88
|
+
next decision, give it dominant emphasis and move secondary actions out of
|
|
89
|
+
the default path. Do not wrap every section in a card or add borders for
|
|
90
|
+
grouping alone; use spacing, alignment, typography, or dividers first. A
|
|
91
|
+
container must communicate grouping, state, or interaction.
|
|
92
|
+
- **Coherence over novelty**: Reuse the product's primitives, interaction
|
|
93
|
+
patterns, and language. When given a screenshot or reference product, match
|
|
94
|
+
its underlying hierarchy, density, and behavior; do not copy decoration or
|
|
95
|
+
introduce a second visual language without a product reason.
|
|
96
|
+
- **Quiet continuity**: Feedback must be immediate, contextual, and honest.
|
|
97
|
+
Preserve the user's place and layout, make loading, empty, and error states
|
|
98
|
+
understandable, and use motion only to explain a change.
|
|
99
|
+
- **Respect repeated use**: Optimize for the hundredth use, not the first
|
|
100
|
+
impression. If a control repeats an explanation, occupies persistent space
|
|
101
|
+
for an occasional task, or turns routine work into ceremony, remove it or
|
|
102
|
+
move it to the contextual surface that owns it.
|
|
103
|
+
|
|
104
|
+
### Progressive Disclosure And Information Timing
|
|
105
|
+
|
|
106
|
+
Expose information and controls according to relevance, frequency, and
|
|
107
|
+
consequence. Before coding, inventory the content and actions and assign them to
|
|
108
|
+
the smallest useful visibility layer:
|
|
109
|
+
|
|
110
|
+
1. **Orient and act**: location, current state, and context needed for the next
|
|
111
|
+
meaningful choice.
|
|
112
|
+
2. **Support active work**: details and controls for the selected item or
|
|
113
|
+
current workflow.
|
|
114
|
+
3. **Available on demand**: advanced settings, diagnostics, credentials,
|
|
115
|
+
metadata, destructive actions, documentation, and rare tools.
|
|
116
|
+
|
|
117
|
+
Use a disclosure pattern that matches the task. Keep independent concerns easy
|
|
118
|
+
to scan inside an expanded area instead of dumping every form, explanation,
|
|
119
|
+
and secondary action into the first reveal. A collapsed row must retain its
|
|
120
|
+
label and essential state; remove explanatory subtext unless it changes the
|
|
121
|
+
next decision. For configuration with a known current state, show that state
|
|
122
|
+
first and expose editing contextually instead of defaulting to a full form.
|
|
123
|
+
|
|
124
|
+
Before shipping, verify collapsed, expanded, loading, empty, error, and
|
|
125
|
+
narrow-width states. The default state fails review when its first viewport
|
|
126
|
+
contains multiple unrelated forms, repeated explanatory copy, documentation
|
|
127
|
+
links, or controls for unrelated tasks. It also fails when useful information
|
|
128
|
+
has been replaced with empty whitespace or extra clicks solely to look minimal.
|
|
129
|
+
The default state passes when users can identify their location, current state,
|
|
130
|
+
current task, and relevant next choice without reading documentation, while
|
|
131
|
+
the useful information remains dense and scannable.
|
|
93
132
|
|
|
94
133
|
## Aesthetic Guidelines
|
|
95
134
|
|
|
@@ -166,26 +205,28 @@ passed this requirement yet.
|
|
|
166
205
|
|
|
167
206
|
### Product Surface Review
|
|
168
207
|
|
|
169
|
-
Before shipping a new app or a substantial redesign, review the
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
208
|
+
Before shipping a new app or a substantial redesign, review the surface as an
|
|
209
|
+
operator would use it repeatedly:
|
|
210
|
+
|
|
211
|
+
- Can users identify where they are, what state they are in, and what
|
|
212
|
+
meaningful choices or next steps are available?
|
|
213
|
+
- Remove competing or redundant elements, then place optional inputs, provider
|
|
214
|
+
choices, diagnostics, long explanations, and secondary actions where they
|
|
215
|
+
remain discoverable without crowding the current task.
|
|
216
|
+
- Match the composition to the workflow. Use a focused page or step flow when
|
|
217
|
+
the work is sequential; use an overview when comparing or monitoring several
|
|
218
|
+
things is genuinely the job. Preserve the user's progress in either case.
|
|
179
219
|
- Remove generic hero copy, feature tours, repeated helper text, nested cards,
|
|
180
220
|
status-chip soup, and decorative AI treatment before adding more styling.
|
|
181
|
-
- For review flows,
|
|
182
|
-
|
|
183
|
-
|
|
221
|
+
- For review flows, choose stacking, side-by-side comparison, or another
|
|
222
|
+
composition based on content length, scanability, and the user's comparison
|
|
223
|
+
task.
|
|
184
224
|
- Compare the result with sibling apps. Shared toolkit behavior should feel
|
|
185
225
|
consistent, but a repeated palette, hero composition, type pairing, and
|
|
186
226
|
radius language without a product reason is visual drift, not consistency.
|
|
187
|
-
- Check the result at the target desktop width and a
|
|
188
|
-
|
|
227
|
+
- Check the result with realistic content at the target desktop width and a
|
|
228
|
+
narrow width. If it feels like documentation instead of a tool, reduce noise
|
|
229
|
+
or clarify the hierarchy.
|
|
189
230
|
|
|
190
231
|
## shadcn/ui Design Rules
|
|
191
232
|
|
|
@@ -203,18 +244,24 @@ as an operator would use it repeatedly:
|
|
|
203
244
|
not show generic "Loading..." text for content loads; reserve `Spinner` for
|
|
204
245
|
brief mutations, uploads, and progress actions. Use the app's existing
|
|
205
246
|
loading primitive when it is a genuine design-system adapter. Empty states
|
|
206
|
-
should
|
|
247
|
+
should communicate the state and offer the appropriate next step or small set
|
|
248
|
+
of choices.
|
|
207
249
|
|
|
208
250
|
## Anti-Patterns
|
|
209
251
|
|
|
210
|
-
Avoid
|
|
252
|
+
Avoid patterns that add visual noise, obscure state, or compete with the user's
|
|
253
|
+
task without a clear product reason:
|
|
211
254
|
|
|
212
255
|
- Generic AI aesthetics: purple gradients, glassy cards everywhere, vague sparkle language, decorative blobs, and context-free hero sections.
|
|
213
256
|
- Custom reimplementations of shadcn primitives.
|
|
214
257
|
- Raw color overrides on shared components when semantic tokens or variants would work.
|
|
215
|
-
- New always-visible controls for rare actions
|
|
216
|
-
|
|
217
|
-
-
|
|
258
|
+
- New always-visible controls for rare actions when a contextual surface would
|
|
259
|
+
preserve discoverability and reduce noise.
|
|
260
|
+
- Full-width banners, persistent helper rows, decorative cards, or explanatory
|
|
261
|
+
chrome for status that could be communicated more clearly with less weight.
|
|
262
|
+
- Hiding essential meaning or operability behind progressive disclosure. Defer
|
|
263
|
+
complexity when it is contextual or infrequent, but preserve labels, focus,
|
|
264
|
+
hit targets, accessibility, and recovery paths.
|
|
218
265
|
- UI cards nested inside other cards.
|
|
219
266
|
- Text or icons that resize or shift fixed-format UI on hover/loading.
|
|
220
267
|
|