@agent-native/core 0.128.4 → 0.129.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 +2 -2
- package/corpus/core/CHANGELOG.md +84 -0
- package/corpus/core/docs/content/template-design-collaboration-and-full-apps.mdx +3 -1
- package/corpus/core/package.json +6 -3
- package/corpus/core/src/a2a/client.ts +18 -4
- package/corpus/core/src/a2a/server.ts +19 -3
- package/corpus/core/src/a2a/types.ts +7 -0
- package/corpus/core/src/action.ts +43 -16
- package/corpus/core/src/agent/engine/ai-sdk-engine.ts +14 -10
- package/corpus/core/src/agent/production-agent.ts +41 -3
- package/corpus/core/src/agent/thread-data-builder.ts +5 -0
- package/corpus/core/src/chat-threads/migrations.ts +53 -0
- package/corpus/core/src/cli/create.ts +4 -0
- package/corpus/core/src/cli/skills-content/design-visual-edit-skill.ts +36 -16
- package/corpus/core/src/cli/skills.ts +16 -0
- package/corpus/core/src/client/AgentPanel.tsx +9 -5
- package/corpus/core/src/client/AssistantChat.tsx +138 -46
- package/corpus/core/src/client/MultiTabAssistantChat.tsx +16 -10
- package/corpus/core/src/client/agent-chat-adapter.ts +21 -3
- package/corpus/core/src/client/analytics.ts +159 -102
- package/corpus/core/src/client/chat/message-components.tsx +12 -5
- package/corpus/core/src/client/chat/runtime.ts +2 -1
- package/corpus/core/src/client/chat/tool-call-display.tsx +25 -2
- package/corpus/core/src/client/chat-model-groups.ts +3 -0
- package/corpus/core/src/client/client-status-requests.ts +161 -0
- package/corpus/core/src/client/settings/VoiceTranscriptionSection.tsx +2 -2
- package/corpus/core/src/client/sse-event-processor.ts +15 -3
- package/corpus/core/src/client/use-agent-engine-configured.ts +54 -50
- package/corpus/core/src/client/use-chat-models.ts +16 -11
- package/corpus/core/src/client/use-chat-threads.ts +32 -9
- package/corpus/core/src/client/use-session.ts +4 -5
- package/corpus/core/src/db/client.ts +83 -8
- package/corpus/core/src/db/ensure-additive-columns.ts +31 -20
- package/corpus/core/src/db/migrations.ts +22 -2
- package/corpus/core/src/mcp/approval-store.ts +99 -0
- package/corpus/core/src/mcp/build-server.ts +579 -303
- package/corpus/core/src/mcp/embed-app.ts +1 -1
- package/corpus/core/src/mcp/oauth-client-metadata.ts +380 -0
- package/corpus/core/src/mcp/oauth-route.ts +57 -52
- package/corpus/core/src/mcp/screen-memory-stdio.ts +400 -378
- package/corpus/core/src/mcp/server.ts +29 -145
- package/corpus/core/src/mcp/stdio.ts +72 -80
- package/corpus/core/src/mcp-client/manager.ts +6 -10
- package/corpus/core/src/mcp-client/oauth-client.ts +127 -36
- package/corpus/core/src/mcp-client/oauth-routes.ts +16 -6
- package/corpus/core/src/mcp-client/routes.ts +6 -5
- package/corpus/core/src/server/agent-capabilities.ts +20 -0
- package/corpus/core/src/server/agent-chat/action-filters-a2a.ts +27 -0
- package/corpus/core/src/server/agent-chat-plugin.ts +18 -0
- package/corpus/core/src/server/transcribe-voice.ts +14 -5
- package/corpus/core/src/templates/default/.agents/skills/security/SKILL.md +13 -2
- package/corpus/core/src/templates/workspace-core/.agents/skills/authentication/SKILL.md +5 -2
- package/corpus/core/src/templates/workspace-core/.agents/skills/external-agents/SKILL.md +18 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/security/SKILL.md +13 -2
- package/corpus/templates/analytics/.agents/skills/security/SKILL.md +13 -2
- package/corpus/templates/analytics/app/components/dashboard/DashboardPanelSkeleton.tsx +1 -10
- package/corpus/templates/analytics/app/global.css +0 -31
- package/corpus/templates/analytics/app/lib/sql-query.ts +46 -20
- package/corpus/templates/analytics/changelog/2026-07-28-analytics-dashboard-loading-states-now-use-a-simpler-standar.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-28-analytics-dashboards-now-load-first-party-charts-reliably-in.md +6 -0
- package/corpus/templates/analytics/server/lib/first-party-analytics-cache.ts +42 -16
- package/corpus/templates/analytics/server/lib/first-party-analytics.ts +4 -2
- package/corpus/templates/analytics/shared/sql-query-limits.ts +1 -0
- package/corpus/templates/assets/.agents/skills/security/SKILL.md +13 -2
- package/corpus/templates/brain/.agents/skills/security/SKILL.md +13 -2
- package/corpus/templates/calendar/.agents/skills/security/SKILL.md +13 -2
- package/corpus/templates/chat/.agents/skills/security/SKILL.md +13 -2
- package/corpus/templates/chat/README.md +0 -2
- package/corpus/templates/clips/.agents/skills/security/SKILL.md +13 -2
- package/corpus/templates/clips/app/components/player/player-controls.tsx +3 -6
- package/corpus/templates/clips/app/routes/r.$recordingId.tsx +6 -2
- package/corpus/templates/clips/app/routes/share.$shareId.tsx +3 -1
- package/corpus/templates/clips/changelog/2026-07-28-copied-share-links-no-longer-leave-an-unnecessary-confirmati.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-28-playback-skip-controls-no-longer-show-overlapping-numbers.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-28-public-clips-share-buttons-now-use-a-clean-text-only-label.md +6 -0
- package/corpus/templates/clips/desktop/src/app.tsx +14 -17
- package/corpus/templates/clips/desktop/src/overlays/live-audio-bars.tsx +3 -1
- package/corpus/templates/clips/desktop/src/styles.css +13 -10
- package/corpus/templates/clips/desktop/src-tauri/src/recording_indicator.rs +2 -2
- package/corpus/templates/clips/desktop/src-tauri/src/whisper_speech.rs +36 -0
- package/corpus/templates/content/.agents/skills/security/SKILL.md +13 -2
- package/corpus/templates/content/actions/_builder-cms-read-client.ts +155 -34
- package/corpus/templates/content/actions/_builder-docs-client.ts +151 -30
- package/corpus/templates/content/actions/stage-builder-source-bulk-update.ts +5 -2
- package/corpus/templates/content/app/root.tsx +35 -14
- package/corpus/templates/content/changelog/2026-07-28-builder-backed-files-media-fields-now-accept-direct-file-url.md +6 -0
- package/corpus/templates/content/changelog/2026-07-28-builder-content-reads-now-negotiate-the-newest-mcp-protocol-.md +6 -0
- package/corpus/templates/content/changelog/2026-07-28-public-content-pages-load-faster-before-the-optional-ask-sid.md +6 -0
- package/corpus/templates/design/.agents/skills/security/SKILL.md +13 -2
- package/corpus/templates/design/.agents/skills/visual-edit/SKILL.md +36 -16
- package/corpus/templates/design/.generated/bridge/editor-chrome.generated.ts +42 -3
- package/corpus/templates/design/actions/open-visual-edit.ts +2 -1
- package/corpus/templates/design/app/components/design/CanvasContextMenu.tsx +2 -2
- package/corpus/templates/design/app/components/design/DesignCanvas.tsx +14 -15
- package/corpus/templates/design/app/components/design/ResponsiveInteractBar.tsx +314 -0
- package/corpus/templates/design/app/components/design/bridge/editor-chrome.bridge.ts +88 -3
- package/corpus/templates/design/app/components/design/keyboard-shortcuts.ts +1 -1
- package/corpus/templates/design/app/hooks/useDesignHotkeys.ts +7 -6
- package/corpus/templates/design/app/i18n-data.ts +56 -11
- package/corpus/templates/design/app/i18n-responsive-interact.ts +183 -0
- package/corpus/templates/design/app/lib/agent-chat.ts +60 -0
- package/corpus/templates/design/app/pages/design-editor/responsive-interact.ts +89 -0
- package/corpus/templates/design/changelog/2026-07-28-design-edits-can-be-applied-through-the-host-coding-agent-fr.md +6 -0
- package/corpus/templates/design/changelog/2026-07-28-interact-mode-can-preview-designs-in-responsive-device-sizes.md +6 -0
- package/corpus/templates/design/changelog/2026-07-28-interact-mode-now-opens-a-full-screen-responsive-preview-wit.md +6 -0
- package/corpus/templates/design/changelog/2026-07-28-show-or-hide-design-editing-chrome-with-cmd-on-apple-devices.md +2 -2
- package/corpus/templates/design/changelog/2026-07-28-visual-edit-now-always-shows-the-live-running-app-in-the-can.md +6 -0
- package/corpus/templates/dispatch/.agents/skills/security/SKILL.md +13 -2
- package/corpus/templates/forms/.agents/skills/security/SKILL.md +13 -2
- package/corpus/templates/macros/.agents/skills/security/SKILL.md +13 -2
- package/corpus/templates/mail/.agents/skills/security/SKILL.md +13 -2
- package/corpus/templates/plan/.agents/skills/security/SKILL.md +13 -2
- package/corpus/templates/slides/.agents/skills/security/SKILL.md +13 -2
- package/corpus/templates/tasks/.agents/skills/security/SKILL.md +13 -2
- package/corpus/toolkit/CHANGELOG.md +13 -0
- package/corpus/toolkit/package.json +1 -1
- package/corpus/toolkit/src/chat-history.css +1 -2
- package/corpus/toolkit/src/composer/TiptapComposer.tsx +45 -0
- package/dist/a2a/client.d.ts +7 -0
- package/dist/a2a/client.d.ts.map +1 -1
- package/dist/a2a/client.js +8 -3
- package/dist/a2a/client.js.map +1 -1
- package/dist/a2a/server.d.ts.map +1 -1
- package/dist/a2a/server.js +18 -3
- package/dist/a2a/server.js.map +1 -1
- package/dist/a2a/types.d.ts +7 -0
- package/dist/a2a/types.d.ts.map +1 -1
- package/dist/a2a/types.js.map +1 -1
- package/dist/action.d.ts +15 -1
- package/dist/action.d.ts.map +1 -1
- package/dist/action.js +39 -16
- package/dist/action.js.map +1 -1
- package/dist/agent/engine/ai-sdk-engine.d.ts.map +1 -1
- package/dist/agent/engine/ai-sdk-engine.js +14 -10
- package/dist/agent/engine/ai-sdk-engine.js.map +1 -1
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +35 -7
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/agent/thread-data-builder.d.ts +2 -0
- package/dist/agent/thread-data-builder.d.ts.map +1 -1
- package/dist/agent/thread-data-builder.js +3 -0
- package/dist/agent/thread-data-builder.js.map +1 -1
- package/dist/chat-threads/migrations.d.ts +21 -0
- package/dist/chat-threads/migrations.d.ts.map +1 -0
- package/dist/chat-threads/migrations.js +45 -0
- package/dist/chat-threads/migrations.js.map +1 -0
- package/dist/cli/create.d.ts.map +1 -1
- package/dist/cli/create.js +4 -0
- package/dist/cli/create.js.map +1 -1
- package/dist/cli/skills-content/design-visual-edit-skill.d.ts +1 -1
- package/dist/cli/skills-content/design-visual-edit-skill.d.ts.map +1 -1
- package/dist/cli/skills-content/design-visual-edit-skill.js +36 -16
- package/dist/cli/skills-content/design-visual-edit-skill.js.map +1 -1
- package/dist/cli/skills.d.ts.map +1 -1
- package/dist/cli/skills.js +15 -0
- package/dist/cli/skills.js.map +1 -1
- package/dist/client/AgentPanel.d.ts.map +1 -1
- package/dist/client/AgentPanel.js +6 -5
- package/dist/client/AgentPanel.js.map +1 -1
- package/dist/client/AssistantChat.d.ts +37 -0
- package/dist/client/AssistantChat.d.ts.map +1 -1
- package/dist/client/AssistantChat.js +41 -8
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/MultiTabAssistantChat.d.ts.map +1 -1
- package/dist/client/MultiTabAssistantChat.js +11 -10
- package/dist/client/MultiTabAssistantChat.js.map +1 -1
- package/dist/client/agent-chat-adapter.d.ts.map +1 -1
- package/dist/client/agent-chat-adapter.js +19 -3
- package/dist/client/agent-chat-adapter.js.map +1 -1
- package/dist/client/analytics.d.ts.map +1 -1
- package/dist/client/analytics.js +150 -101
- package/dist/client/analytics.js.map +1 -1
- package/dist/client/chat/message-components.d.ts +2 -1
- package/dist/client/chat/message-components.d.ts.map +1 -1
- package/dist/client/chat/message-components.js +11 -4
- package/dist/client/chat/message-components.js.map +1 -1
- package/dist/client/chat/runtime.d.ts.map +1 -1
- package/dist/client/chat/runtime.js +2 -1
- package/dist/client/chat/runtime.js.map +1 -1
- package/dist/client/chat/tool-call-display.d.ts +4 -1
- package/dist/client/chat/tool-call-display.d.ts.map +1 -1
- package/dist/client/chat/tool-call-display.js +14 -8
- package/dist/client/chat/tool-call-display.js.map +1 -1
- package/dist/client/chat-model-groups.d.ts.map +1 -1
- package/dist/client/chat-model-groups.js +3 -0
- package/dist/client/chat-model-groups.js.map +1 -1
- package/dist/client/client-status-requests.d.ts +14 -0
- package/dist/client/client-status-requests.d.ts.map +1 -0
- package/dist/client/client-status-requests.js +126 -0
- package/dist/client/client-status-requests.js.map +1 -0
- package/dist/client/settings/VoiceTranscriptionSection.js +1 -1
- package/dist/client/settings/VoiceTranscriptionSection.js.map +1 -1
- package/dist/client/sse-event-processor.d.ts +7 -0
- package/dist/client/sse-event-processor.d.ts.map +1 -1
- package/dist/client/sse-event-processor.js +8 -3
- package/dist/client/sse-event-processor.js.map +1 -1
- package/dist/client/use-agent-engine-configured.d.ts.map +1 -1
- package/dist/client/use-agent-engine-configured.js +29 -43
- package/dist/client/use-agent-engine-configured.js.map +1 -1
- package/dist/client/use-chat-models.d.ts.map +1 -1
- package/dist/client/use-chat-models.js +11 -11
- package/dist/client/use-chat-models.js.map +1 -1
- package/dist/client/use-chat-threads.d.ts.map +1 -1
- package/dist/client/use-chat-threads.js +23 -7
- package/dist/client/use-chat-threads.js.map +1 -1
- package/dist/client/use-session.d.ts.map +1 -1
- package/dist/client/use-session.js +4 -4
- package/dist/client/use-session.js.map +1 -1
- package/dist/collab/awareness.d.ts +2 -2
- package/dist/collab/awareness.d.ts.map +1 -1
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/db/client.d.ts.map +1 -1
- package/dist/db/client.js +48 -4
- package/dist/db/client.js.map +1 -1
- package/dist/db/ensure-additive-columns.d.ts.map +1 -1
- package/dist/db/ensure-additive-columns.js +32 -21
- package/dist/db/ensure-additive-columns.js.map +1 -1
- package/dist/db/migrations.d.ts +9 -0
- package/dist/db/migrations.d.ts.map +1 -1
- package/dist/db/migrations.js +14 -3
- package/dist/db/migrations.js.map +1 -1
- package/dist/file-upload/actions/upload-image.d.ts +1 -1
- package/dist/mcp/approval-store.d.ts +16 -0
- package/dist/mcp/approval-store.d.ts.map +1 -0
- package/dist/mcp/approval-store.js +85 -0
- package/dist/mcp/approval-store.js.map +1 -0
- package/dist/mcp/build-server.d.ts +1 -34
- package/dist/mcp/build-server.d.ts.map +1 -1
- package/dist/mcp/build-server.js +220 -23
- package/dist/mcp/build-server.js.map +1 -1
- package/dist/mcp/embed-app.js +1 -1
- package/dist/mcp/embed-app.js.map +1 -1
- package/dist/mcp/oauth-client-metadata.d.ts +15 -0
- package/dist/mcp/oauth-client-metadata.d.ts.map +1 -0
- package/dist/mcp/oauth-client-metadata.js +297 -0
- package/dist/mcp/oauth-client-metadata.js.map +1 -0
- package/dist/mcp/oauth-route.d.ts.map +1 -1
- package/dist/mcp/oauth-route.js +39 -53
- package/dist/mcp/oauth-route.js.map +1 -1
- package/dist/mcp/screen-memory-stdio.d.ts.map +1 -1
- package/dist/mcp/screen-memory-stdio.js +304 -296
- package/dist/mcp/screen-memory-stdio.js.map +1 -1
- package/dist/mcp/server.d.ts +12 -25
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +24 -133
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/stdio.d.ts.map +1 -1
- package/dist/mcp/stdio.js +36 -35
- package/dist/mcp/stdio.js.map +1 -1
- package/dist/mcp-client/manager.d.ts.map +1 -1
- package/dist/mcp-client/manager.js +6 -6
- package/dist/mcp-client/manager.js.map +1 -1
- package/dist/mcp-client/oauth-client.d.ts +13 -17
- package/dist/mcp-client/oauth-client.d.ts.map +1 -1
- package/dist/mcp-client/oauth-client.js +74 -16
- package/dist/mcp-client/oauth-client.js.map +1 -1
- package/dist/mcp-client/oauth-routes.d.ts +2 -2
- package/dist/mcp-client/oauth-routes.d.ts.map +1 -1
- package/dist/mcp-client/oauth-routes.js +16 -6
- package/dist/mcp-client/oauth-routes.js.map +1 -1
- package/dist/mcp-client/routes.js +5 -5
- package/dist/mcp-client/routes.js.map +1 -1
- package/dist/notifications/routes.d.ts +1 -1
- package/dist/observability/routes.d.ts +3 -3
- package/dist/progress/routes.d.ts +1 -1
- package/dist/provider-api/actions/custom-provider-registration.d.ts +14 -14
- package/dist/provider-api/actions/provider-api.d.ts +8 -8
- package/dist/resources/handlers.d.ts +1 -1
- package/dist/secrets/routes.d.ts +9 -9
- package/dist/server/agent-capabilities.d.ts.map +1 -1
- package/dist/server/agent-capabilities.js +21 -0
- package/dist/server/agent-capabilities.js.map +1 -1
- package/dist/server/agent-chat/action-filters-a2a.d.ts +14 -0
- package/dist/server/agent-chat/action-filters-a2a.d.ts.map +1 -1
- package/dist/server/agent-chat/action-filters-a2a.js +16 -0
- package/dist/server/agent-chat/action-filters-a2a.js.map +1 -1
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +11 -1
- package/dist/server/agent-chat-plugin.js.map +1 -1
- package/dist/server/realtime-token.d.ts +1 -1
- package/dist/server/transcribe-voice.d.ts +1 -1
- package/dist/server/transcribe-voice.js +12 -6
- package/dist/server/transcribe-voice.js.map +1 -1
- package/dist/templates/chat/.agents/skills/security/SKILL.md +13 -2
- package/dist/templates/chat/README.md +0 -2
- package/dist/templates/default/.agents/skills/security/SKILL.md +13 -2
- package/dist/templates/workspace-core/.agents/skills/authentication/SKILL.md +5 -2
- package/dist/templates/workspace-core/.agents/skills/external-agents/SKILL.md +18 -0
- package/dist/templates/workspace-core/.agents/skills/security/SKILL.md +13 -2
- package/docs/content/template-design-collaboration-and-full-apps.mdx +3 -1
- package/package.json +7 -4
- package/src/a2a/client.ts +18 -4
- package/src/a2a/server.ts +19 -3
- package/src/a2a/types.ts +7 -0
- package/src/action.ts +43 -16
- package/src/agent/engine/ai-sdk-engine.ts +14 -10
- package/src/agent/production-agent.ts +41 -3
- package/src/agent/thread-data-builder.ts +5 -0
- package/src/chat-threads/migrations.ts +53 -0
- package/src/cli/create.ts +4 -0
- package/src/cli/skills-content/design-visual-edit-skill.ts +36 -16
- package/src/cli/skills.ts +16 -0
- package/src/client/AgentPanel.tsx +9 -5
- package/src/client/AssistantChat.tsx +138 -46
- package/src/client/MultiTabAssistantChat.tsx +16 -10
- package/src/client/agent-chat-adapter.ts +21 -3
- package/src/client/analytics.ts +159 -102
- package/src/client/chat/message-components.tsx +12 -5
- package/src/client/chat/runtime.ts +2 -1
- package/src/client/chat/tool-call-display.tsx +25 -2
- package/src/client/chat-model-groups.ts +3 -0
- package/src/client/client-status-requests.ts +161 -0
- package/src/client/settings/VoiceTranscriptionSection.tsx +2 -2
- package/src/client/sse-event-processor.ts +15 -3
- package/src/client/use-agent-engine-configured.ts +54 -50
- package/src/client/use-chat-models.ts +16 -11
- package/src/client/use-chat-threads.ts +32 -9
- package/src/client/use-session.ts +4 -5
- package/src/db/client.ts +83 -8
- package/src/db/ensure-additive-columns.ts +31 -20
- package/src/db/migrations.ts +22 -2
- package/src/mcp/approval-store.ts +99 -0
- package/src/mcp/build-server.ts +579 -303
- package/src/mcp/embed-app.ts +1 -1
- package/src/mcp/oauth-client-metadata.ts +380 -0
- package/src/mcp/oauth-route.ts +57 -52
- package/src/mcp/screen-memory-stdio.ts +400 -378
- package/src/mcp/server.ts +29 -145
- package/src/mcp/stdio.ts +72 -80
- package/src/mcp-client/manager.ts +6 -10
- package/src/mcp-client/oauth-client.ts +127 -36
- package/src/mcp-client/oauth-routes.ts +16 -6
- package/src/mcp-client/routes.ts +6 -5
- package/src/server/agent-capabilities.ts +20 -0
- package/src/server/agent-chat/action-filters-a2a.ts +27 -0
- package/src/server/agent-chat-plugin.ts +18 -0
- package/src/server/transcribe-voice.ts +14 -5
- package/src/templates/chat/.agents/skills/security/SKILL.md +13 -2
- package/src/templates/chat/README.md +0 -2
- package/src/templates/default/.agents/skills/security/SKILL.md +13 -2
- package/src/templates/workspace-core/.agents/skills/authentication/SKILL.md +5 -2
- package/src/templates/workspace-core/.agents/skills/external-agents/SKILL.md +18 -0
- package/src/templates/workspace-core/.agents/skills/security/SKILL.md +13 -2
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { AgentSidebar } from "@agent-native/core/client/agent-chat";
|
|
2
1
|
import { configureTracking } from "@agent-native/core/client/analytics";
|
|
3
2
|
import { appPath } from "@agent-native/core/client/api-path";
|
|
4
3
|
import {
|
|
@@ -34,7 +33,14 @@ import {
|
|
|
34
33
|
IconSun,
|
|
35
34
|
} from "@tabler/icons-react";
|
|
36
35
|
import { useTheme } from "next-themes";
|
|
37
|
-
import {
|
|
36
|
+
import {
|
|
37
|
+
lazy,
|
|
38
|
+
Suspense,
|
|
39
|
+
useCallback,
|
|
40
|
+
useEffect,
|
|
41
|
+
useMemo,
|
|
42
|
+
useState,
|
|
43
|
+
} from "react";
|
|
38
44
|
import {
|
|
39
45
|
Links,
|
|
40
46
|
Meta,
|
|
@@ -119,6 +125,11 @@ export function shouldRevalidate({
|
|
|
119
125
|
// Pass args to match content's 3-way theme-cycle UX (no disableTransitionOnChange).
|
|
120
126
|
const THEME_INIT_SCRIPT = getThemeInitScript("system", true);
|
|
121
127
|
|
|
128
|
+
const LazyAgentSidebar = lazy(async () => {
|
|
129
|
+
const { AgentSidebar } = await import("@agent-native/core/client/agent-chat");
|
|
130
|
+
return { default: AgentSidebar };
|
|
131
|
+
});
|
|
132
|
+
|
|
122
133
|
const DEFAULT_LOADER_DATA: RootLoaderData = {
|
|
123
134
|
locale: "en-US",
|
|
124
135
|
preference: { locale: "system" },
|
|
@@ -509,19 +520,29 @@ function PublicAgentShell({ children }: { children: React.ReactNode }) {
|
|
|
509
520
|
}
|
|
510
521
|
|
|
511
522
|
return (
|
|
512
|
-
<
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
t("chat.publicSuggestionActionPlan"),
|
|
521
|
-
]}
|
|
523
|
+
<Suspense
|
|
524
|
+
fallback={
|
|
525
|
+
<div className="flex min-w-0 flex-1 h-screen overflow-hidden">
|
|
526
|
+
<div className="flex min-w-0 flex-1 flex-col overflow-auto">
|
|
527
|
+
{content}
|
|
528
|
+
</div>
|
|
529
|
+
</div>
|
|
530
|
+
}
|
|
522
531
|
>
|
|
523
|
-
|
|
524
|
-
|
|
532
|
+
<LazyAgentSidebar
|
|
533
|
+
position="right"
|
|
534
|
+
defaultOpen={false}
|
|
535
|
+
defaultSidebarWidth={420}
|
|
536
|
+
emptyStateText={t("chat.publicEmptyState")}
|
|
537
|
+
suggestions={[
|
|
538
|
+
t("chat.publicSuggestionSummary"),
|
|
539
|
+
t("chat.publicSuggestionTakeaways"),
|
|
540
|
+
t("chat.publicSuggestionActionPlan"),
|
|
541
|
+
]}
|
|
542
|
+
>
|
|
543
|
+
{content}
|
|
544
|
+
</LazyAgentSidebar>
|
|
545
|
+
</Suspense>
|
|
525
546
|
);
|
|
526
547
|
}
|
|
527
548
|
|
|
@@ -163,7 +163,9 @@ private UI after the shell loads. See the `authentication` skill and
|
|
|
163
163
|
proves *someone* is signed in. To restrict an operation to some teammates, set
|
|
164
164
|
`authorize` on the `defineAction`. It wraps `run`, so it applies at every
|
|
165
165
|
dispatch site (agent tool, HTTP, frontend, MCP, A2A, CLI) — unlike
|
|
166
|
-
`needsApproval`, which is
|
|
166
|
+
`needsApproval`, which is honored by the agent loop and MCP 2026 hosts that
|
|
167
|
+
support elicitation, but is not an authorization boundary for every dispatch
|
|
168
|
+
site.
|
|
167
169
|
|
|
168
170
|
```ts
|
|
169
171
|
import { coachAccess } from "../lib/access.js"; // defineAppRoles(...)
|
|
@@ -203,7 +205,16 @@ export default defineAction({
|
|
|
203
205
|
});
|
|
204
206
|
```
|
|
205
207
|
|
|
206
|
-
When the gate is truthy and the call is not yet approved, the loop emits
|
|
208
|
+
When the gate is truthy and the call is not yet approved, the agent loop emits
|
|
209
|
+
an `approval_required` event and **stops the turn — `run()` never executes**.
|
|
210
|
+
The human approves via the chat UI's Approve affordance, which re-issues the
|
|
211
|
+
turn with the call's stable `approvalKey`; only then does the action run. MCP
|
|
212
|
+
2026 hosts receive an `input_required` approval request bound to the exact
|
|
213
|
+
caller, action, and arguments. The signed response state is backed by a durable,
|
|
214
|
+
single-use grant, so denial, expiry, replay, missing host support, or invalid
|
|
215
|
+
state fails closed before `run()`. A predicate gates conditionally (e.g. only
|
|
216
|
+
external recipients) and **fails closed** — a throw is treated as "approval
|
|
217
|
+
required".
|
|
207
218
|
|
|
208
219
|
Rules:
|
|
209
220
|
|
|
@@ -27,10 +27,18 @@ exported instructions only, with no MCP connector registration.
|
|
|
27
27
|
|
|
28
28
|
## Put Design Beside The Chat
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
Prefer the interactive MCP App returned by `open-visual-edit` when the coding
|
|
31
|
+
host renders it. The user gets the Design canvas beside the conversation, and
|
|
32
|
+
**Apply design updates** can submit the bounded source-edit handoff back to the
|
|
33
|
+
current host conversation through the standard MCP Apps message bridge. The
|
|
34
|
+
host may ask the user to confirm the current conversation or choose a new one.
|
|
35
|
+
|
|
36
|
+
Otherwise, after `open-visual-edit` returns `openUrl`, open that URL in the
|
|
37
|
+
coding host's inline browser when one is available. This still keeps Design
|
|
38
|
+
beside the conversation, but an ordinary browser page has no trusted path into
|
|
39
|
+
the host's current composer. In that fallback surface, **Apply design updates**
|
|
40
|
+
uses Design's local agent; use **Copy prompt to your agent** to hand the same
|
|
41
|
+
structured edit batch to the coding agent.
|
|
34
42
|
|
|
35
43
|
- In Codex Desktop, use the in-app Browser tool to open `openUrl`. The built-in
|
|
36
44
|
browser is the right surface for localhost and public pages that should stay
|
|
@@ -42,14 +50,13 @@ screens as the agent, and iterate without switching apps.
|
|
|
42
50
|
sessions may not expose one. If the inline surface is unavailable or disabled,
|
|
43
51
|
return the normal **Open design** link instead of claiming it opened.
|
|
44
52
|
|
|
45
|
-
Prefer the
|
|
46
|
-
|
|
47
|
-
panes.
|
|
53
|
+
Prefer the MCP App surface for a connected Design plugin, then the host's
|
|
54
|
+
browser/preview tool as the universal fallback. Keep the canvas beside chat
|
|
55
|
+
when the host supports rearrangeable panes.
|
|
48
56
|
|
|
49
|
-
Inside Design, use **Show/Hide UI** from the `Cmd+K` menu or press
|
|
50
|
-
`
|
|
51
|
-
|
|
52
|
-
Design's empty-canvas context menu.
|
|
57
|
+
Inside Design, use **Show/Hide UI** from the `Cmd+K` menu or press Figma's
|
|
58
|
+
`Shift+\` shortcut to toggle all editing chrome so only the canvas remains.
|
|
59
|
+
The same action is available from Design's empty-canvas context menu.
|
|
53
60
|
|
|
54
61
|
## Core Model
|
|
55
62
|
|
|
@@ -57,8 +64,16 @@ Design's empty-canvas context menu.
|
|
|
57
64
|
- Each screen keeps URL metadata: `connectionId`, `routeId`, `path`,
|
|
58
65
|
`url`, `bridgeUrl`, title, and viewport size.
|
|
59
66
|
- Localhost Edit mode renders the running app through the local bridge as a live
|
|
60
|
-
iframe with the same editor bridge used by HTML designs. It is
|
|
61
|
-
static DOM snapshot.
|
|
67
|
+
iframe with the same editor bridge used by HTML designs. It is never a frozen
|
|
68
|
+
static DOM snapshot. Editing is direct DOM manipulation against that live
|
|
69
|
+
document; the parallel `/snapshot` fetch feeds the editable source model only
|
|
70
|
+
and must never be rendered in the frame.
|
|
71
|
+
- A viewer holding the connection's `previewToken` gets the proxied
|
|
72
|
+
`/live-edit` document with editor chrome. A viewer without one — a signed-out
|
|
73
|
+
session, a public link, or an inline browser with no cookies — gets the plain
|
|
74
|
+
dev-server URL: still live, but with no editor chrome, no layers, and no
|
|
75
|
+
editing. If the canvas looks right but selection and the layers panel do
|
|
76
|
+
nothing, the frame is unbridged; sign in rather than assuming Design is broken.
|
|
62
77
|
- The live editor is same-origin through the local bridge proxy. This boots
|
|
63
78
|
CSR apps and root-relative assets, but it is still a localhost editing proxy:
|
|
64
79
|
app-origin cookies, WebSockets/HMR, SSE, and non-GET app API calls may need a
|
|
@@ -336,9 +351,11 @@ Fallback, only when `open-visual-edit` is unavailable:
|
|
|
336
351
|
## Applying Visual Edits Back To Source
|
|
337
352
|
|
|
338
353
|
Canvas edits on a localhost screen do not write source as you make them. They
|
|
339
|
-
accumulate as pending edits and the editor shows an
|
|
340
|
-
button
|
|
341
|
-
prompt to the
|
|
354
|
+
accumulate as pending edits and the editor shows an **Apply design updates**
|
|
355
|
+
button on the canvas. In an MCP App, clicking it hands the bounded structured
|
|
356
|
+
prompt to the current host coding conversation. In an ordinary browser or
|
|
357
|
+
standalone Design page, it falls back to the local Design agent. The dropdown's
|
|
358
|
+
**Copy prompt to your agent** action is the universal manual fallback.
|
|
342
359
|
|
|
343
360
|
- Style, text, and drag/drop structure edits all collect into the same pending
|
|
344
361
|
batch, so the user can make several changes and apply once.
|
|
@@ -410,6 +427,9 @@ the connected app's text/code files through the bridge
|
|
|
410
427
|
- The Design editor opens in overview mode.
|
|
411
428
|
- Every requested screen renders the intended localhost URL, showing real app
|
|
412
429
|
content rather than an endless loading spinner.
|
|
430
|
+
- The screen iframe carries a `src`, not a `srcdoc`. A localhost screen with a
|
|
431
|
+
`srcdoc` is a bug, not a slow load — check it in the browser devtools before
|
|
432
|
+
reporting the canvas as working.
|
|
413
433
|
- Alt-dragging a screen copies the URL-backed frame, not an inline HTML clone.
|
|
414
434
|
- A query/path edit changes only the target screen's URL metadata and iframe.
|
|
415
435
|
- The Code tab shows a local-files root for the connection and opens its files.
|
|
@@ -3152,6 +3152,9 @@ export const editorChromeBridgeScript: string = `"use strict";
|
|
|
3152
3152
|
return true;
|
|
3153
3153
|
}
|
|
3154
3154
|
if (/^Arrow/.test(key || "")) return !e.altKey;
|
|
3155
|
+
if (!primary && !e.altKey && e.shiftKey && e.code === "Backslash") {
|
|
3156
|
+
return true;
|
|
3157
|
+
}
|
|
3155
3158
|
if (primary) {
|
|
3156
3159
|
return [
|
|
3157
3160
|
"z",
|
|
@@ -3185,9 +3188,7 @@ export const editorChromeBridgeScript: string = `"use strict";
|
|
|
3185
3188
|
// Cmd+H / Cmd+L — common OS "Hide app" / browser "focus address bar"
|
|
3186
3189
|
// shortcuts the host has no bare-primary binding for — are left
|
|
3187
3190
|
// alone (see useDesignHotkeys.ts: both require event.shiftKey).
|
|
3188
|
-
e.shiftKey && (normalized === "h" || normalized === "l") || // Cmd/Ctrl+
|
|
3189
|
-
// here so the iframe never intercepts a desktop host's bare Cmd/Ctrl+\\.
|
|
3190
|
-
e.shiftKey && normalized === "\\\\" || // Cmd/Ctrl+Alt+B detach instance / Cmd/Ctrl+Alt+K create component
|
|
3191
|
+
e.shiftKey && (normalized === "h" || normalized === "l") || // Cmd/Ctrl+Alt+B detach instance / Cmd/Ctrl+Alt+K create component
|
|
3191
3192
|
// (onDetachInstance / onCreateComponent). Gated on altKey so bare
|
|
3192
3193
|
// Cmd+B is left alone — the host has no bare-primary binding for it.
|
|
3193
3194
|
e.altKey && (normalized === "b" || normalized === "k") || // Ctrl+Alt+H / Ctrl+Alt+T — distribute horizontal / tidy up
|
|
@@ -8245,6 +8246,44 @@ export const editorChromeBridgeScript: string = `"use strict";
|
|
|
8245
8246
|
});
|
|
8246
8247
|
window.addEventListener("scroll", scheduleRefreshOverlays, true);
|
|
8247
8248
|
window.addEventListener("resize", scheduleRefreshOverlays);
|
|
8249
|
+
function isNativeInteractionNetExempt(target) {
|
|
8250
|
+
return isOverlayElement(target) || isEditorTypingTarget(target) || !!activeDragCancel;
|
|
8251
|
+
}
|
|
8252
|
+
function interceptNativeInteractionNet(e) {
|
|
8253
|
+
if (readOnly) return;
|
|
8254
|
+
var target = e.target && e.target.nodeType === 1 ? e.target : null;
|
|
8255
|
+
if (isNativeInteractionNetExempt(target)) return;
|
|
8256
|
+
stopNativeInteraction(e);
|
|
8257
|
+
}
|
|
8258
|
+
[
|
|
8259
|
+
"click",
|
|
8260
|
+
"auxclick",
|
|
8261
|
+
"dblclick",
|
|
8262
|
+
"mousedown",
|
|
8263
|
+
"mouseup",
|
|
8264
|
+
"pointerdown",
|
|
8265
|
+
"pointerup",
|
|
8266
|
+
"submit"
|
|
8267
|
+
].forEach(function(type) {
|
|
8268
|
+
document.addEventListener(type, interceptNativeInteractionNet, true);
|
|
8269
|
+
});
|
|
8270
|
+
function isFocusedActivationTarget(target) {
|
|
8271
|
+
return !!(target && target.closest && target.closest(
|
|
8272
|
+
'a[href], button, summary, input[type="submit"], input[type="button"], input[type="reset"], input[type="image"], [role="button"], [role="link"]'
|
|
8273
|
+
));
|
|
8274
|
+
}
|
|
8275
|
+
document.addEventListener(
|
|
8276
|
+
"keydown",
|
|
8277
|
+
function(e) {
|
|
8278
|
+
if (readOnly) return;
|
|
8279
|
+
if (e.key !== "Enter" && !(e.key === " " && e.code === "Space")) return;
|
|
8280
|
+
var target = e.target && e.target.nodeType === 1 ? e.target : null;
|
|
8281
|
+
if (isNativeInteractionNetExempt(target)) return;
|
|
8282
|
+
if (!isFocusedActivationTarget(target)) return;
|
|
8283
|
+
stopNativeInteraction(e);
|
|
8284
|
+
},
|
|
8285
|
+
true
|
|
8286
|
+
);
|
|
8248
8287
|
applyEditorChromeScale();
|
|
8249
8288
|
if (runtimeLayerSnapshotEnabled && typeof MutationObserver !== "undefined" && document.body) {
|
|
8250
8289
|
var runtimeLayerObserver = new MutationObserver(function(mutations) {
|
|
@@ -303,7 +303,8 @@ export default defineAction({
|
|
|
303
303
|
compactCatalog: true,
|
|
304
304
|
resource: embedApp({
|
|
305
305
|
title: "Local visual edit",
|
|
306
|
-
description:
|
|
306
|
+
description:
|
|
307
|
+
"Review local URL-backed screens and hand pending source edits back to the host coding agent.",
|
|
307
308
|
iframeTitle: "Agent-Native Design",
|
|
308
309
|
openLabel: "Open overview",
|
|
309
310
|
height: 680,
|
|
@@ -52,7 +52,7 @@ import type { CanvasLayerHitCandidate } from "./types";
|
|
|
52
52
|
// EMPTY canvas (no selection):
|
|
53
53
|
// Paste here
|
|
54
54
|
// [sep]
|
|
55
|
-
// Show/Hide UI
|
|
55
|
+
// Show/Hide UI ⇧\ · Show/Hide comments ⇧C
|
|
56
56
|
//
|
|
57
57
|
// Real Figma has no Duplicate/Delete/Select-all/Zoom items on either canvas
|
|
58
58
|
// menu (all keyboard-only there) — those are intentionally NOT rendered here
|
|
@@ -461,7 +461,7 @@ const DEFAULT_SHORTCUTS: CanvasContextMenuShortcuts = {
|
|
|
461
461
|
rotateClockwise: "",
|
|
462
462
|
flipHorizontal: "⇧H",
|
|
463
463
|
flipVertical: "⇧V",
|
|
464
|
-
toggleUi: "
|
|
464
|
+
toggleUi: "⇧\\",
|
|
465
465
|
toggleComments: "⇧C",
|
|
466
466
|
};
|
|
467
467
|
|
|
@@ -1398,10 +1398,6 @@ export function DesignCanvas({
|
|
|
1398
1398
|
bridgeUrl,
|
|
1399
1399
|
liveEditBridgeKey,
|
|
1400
1400
|
);
|
|
1401
|
-
const hasLiveEditExternalFrame =
|
|
1402
|
-
sourceType === "localhost" && Boolean(bridgeUrl && rawExternalPreviewUrl);
|
|
1403
|
-
const hasAuthenticatedLiveEditExternalFrame =
|
|
1404
|
-
hasLiveEditExternalFrame && Boolean(previewToken);
|
|
1405
1401
|
const usesLiveEditInjectedBridge =
|
|
1406
1402
|
sourceType === "localhost" &&
|
|
1407
1403
|
Boolean(bridgeUrl && previewToken && rawExternalPreviewUrl);
|
|
@@ -1440,12 +1436,15 @@ export function DesignCanvas({
|
|
|
1440
1436
|
// bridge, so crossing that boundary must use the latest persisted `content`
|
|
1441
1437
|
// or native hover/focus/pressed behavior would run against the stale HTML
|
|
1442
1438
|
// from before the inspector edits.
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1439
|
+
//
|
|
1440
|
+
// A localhost screen NEVER renders `activeExternalSnapshotHtml`. The snapshot
|
|
1441
|
+
// is the editable source model only. Rendering it produced a frame that looked
|
|
1442
|
+
// exactly like the running app but was a corpse: no live DOM to manipulate,
|
|
1443
|
+
// layers parsed from frozen HTML, and every edit applied to markup the app had
|
|
1444
|
+
// already moved past — a failure indistinguishable from success. A viewer with
|
|
1445
|
+
// no bridge entitlement gets the real dev-server URL instead (see
|
|
1446
|
+
// externalPreviewUrl below), which is live even without editor chrome.
|
|
1447
|
+
const iframeRenderContent = interactMode ? content : renderedContent;
|
|
1449
1448
|
|
|
1450
1449
|
const desktopNativeSnapshot = useDesktopDesignNativePreview({
|
|
1451
1450
|
iframeRef,
|
|
@@ -1476,13 +1475,13 @@ export function DesignCanvas({
|
|
|
1476
1475
|
editMode,
|
|
1477
1476
|
hasLiveEditorBridge: usesLiveEditEditorBridge,
|
|
1478
1477
|
});
|
|
1478
|
+
// Null only while an entitled viewer's keyed bridge is still registering, so
|
|
1479
|
+
// the frame mounts once directly at the proxied document (resolveLiveEditPreviewUrl's
|
|
1480
|
+
// flash/state-loss note). A viewer with no previewToken has no bridge to wait
|
|
1481
|
+
// for, so it loads the dev server directly rather than degrading to a snapshot.
|
|
1479
1482
|
const externalPreviewUrl =
|
|
1480
1483
|
liveEditExternalPreviewUrl ??
|
|
1481
|
-
(
|
|
1482
|
-
? null
|
|
1483
|
-
: activeExternalSnapshotHtml
|
|
1484
|
-
? null
|
|
1485
|
-
: rawExternalPreviewUrl);
|
|
1484
|
+
(usesLiveEditInjectedBridge ? null : rawExternalPreviewUrl);
|
|
1486
1485
|
const runtimeVerificationUrl = useMemo(() => {
|
|
1487
1486
|
if (!runtimeVerificationRequest || !externalPreviewUrl) return null;
|
|
1488
1487
|
return externalPreviewUrl;
|