@agent-native/core 0.92.7 → 0.92.8
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/core/CHANGELOG.md +12 -0
- package/corpus/core/docs/content/a2a-protocol.mdx +12 -0
- package/corpus/core/docs/content/locales/ar-SA/a2a-protocol.mdx +12 -0
- package/corpus/core/docs/content/locales/ar-SA/pr-visual-recap.mdx +3 -3
- package/corpus/core/docs/content/locales/ar-SA/pure-agent-apps.mdx +4 -0
- package/corpus/core/docs/content/locales/de-DE/a2a-protocol.mdx +12 -0
- package/corpus/core/docs/content/locales/de-DE/pr-visual-recap.mdx +3 -3
- package/corpus/core/docs/content/locales/de-DE/pure-agent-apps.mdx +4 -0
- package/corpus/core/docs/content/locales/es-ES/a2a-protocol.mdx +12 -0
- package/corpus/core/docs/content/locales/es-ES/pr-visual-recap.mdx +3 -3
- package/corpus/core/docs/content/locales/es-ES/pure-agent-apps.mdx +4 -0
- package/corpus/core/docs/content/locales/fr-FR/a2a-protocol.mdx +12 -0
- package/corpus/core/docs/content/locales/fr-FR/pr-visual-recap.mdx +3 -3
- package/corpus/core/docs/content/locales/fr-FR/pure-agent-apps.mdx +4 -0
- package/corpus/core/docs/content/locales/hi-IN/a2a-protocol.mdx +12 -0
- package/corpus/core/docs/content/locales/hi-IN/pr-visual-recap.mdx +3 -3
- package/corpus/core/docs/content/locales/hi-IN/pure-agent-apps.mdx +4 -0
- package/corpus/core/docs/content/locales/ja-JP/a2a-protocol.mdx +12 -0
- package/corpus/core/docs/content/locales/ja-JP/pr-visual-recap.mdx +3 -3
- package/corpus/core/docs/content/locales/ja-JP/pure-agent-apps.mdx +4 -0
- package/corpus/core/docs/content/locales/ko-KR/a2a-protocol.mdx +12 -0
- package/corpus/core/docs/content/locales/ko-KR/pr-visual-recap.mdx +3 -3
- package/corpus/core/docs/content/locales/ko-KR/pure-agent-apps.mdx +4 -0
- package/corpus/core/docs/content/locales/pt-BR/a2a-protocol.mdx +12 -0
- package/corpus/core/docs/content/locales/pt-BR/pr-visual-recap.mdx +3 -3
- package/corpus/core/docs/content/locales/pt-BR/pure-agent-apps.mdx +4 -0
- package/corpus/core/docs/content/locales/zh-CN/a2a-protocol.mdx +12 -0
- package/corpus/core/docs/content/locales/zh-CN/pr-visual-recap.mdx +3 -3
- package/corpus/core/docs/content/locales/zh-CN/pure-agent-apps.mdx +4 -0
- package/corpus/core/docs/content/locales/zh-TW/a2a-protocol.mdx +12 -0
- package/corpus/core/docs/content/locales/zh-TW/pr-visual-recap.mdx +3 -3
- package/corpus/core/docs/content/locales/zh-TW/pure-agent-apps.mdx +4 -0
- package/corpus/core/docs/content/pr-visual-recap.mdx +3 -3
- package/corpus/core/docs/content/pure-agent-apps.mdx +22 -0
- package/corpus/core/package.json +1 -1
- package/corpus/core/src/agent/engine/builtin.ts +1 -1
- package/corpus/core/src/agent/model-config.ts +30 -30
- package/corpus/core/src/agent/production-agent.ts +129 -7
- package/corpus/core/src/cli/design-connect.ts +438 -83
- package/corpus/core/src/cli/recap.ts +2 -2
- package/corpus/core/src/client/AgentPanel.tsx +8 -1
- package/corpus/core/src/client/agent-chat-adapter.ts +12 -7
- package/corpus/core/src/client/composer/TiptapComposer.tsx +1 -1
- package/corpus/core/src/client/index.ts +4 -0
- package/corpus/core/src/client/org/TeamPage.tsx +41 -26
- package/corpus/core/src/client/use-action.ts +113 -1
- package/corpus/core/src/db/client.ts +12 -2
- package/corpus/core/src/db/create-get-db.ts +4 -1
- package/corpus/core/src/scripts/agent-engines/manage-agent-engine.ts +1 -1
- package/corpus/core/src/scripts/agent-engines/set-agent-engine.ts +1 -1
- package/corpus/core/src/server/transcribe-voice.ts +1 -1
- package/corpus/core/src/usage/store.ts +13 -4
- package/corpus/core/src/vite/client.ts +38 -1
- package/corpus/templates/analytics/AGENTS.md +3 -0
- package/corpus/templates/analytics/actions/get-data-program.ts +78 -0
- package/corpus/templates/analytics/actions/list-data-programs.ts +49 -0
- package/corpus/templates/analytics/app/global.css +11 -0
- package/corpus/templates/analytics/app/hooks/use-dashboard-chat-context.ts +163 -17
- package/corpus/templates/analytics/app/i18n/zh-TW.ts +2 -0
- package/corpus/templates/analytics/app/i18n-data.ts +20 -0
- package/corpus/templates/analytics/app/pages/adhoc/explorer-dashboard/ChartCard.tsx +96 -3
- package/corpus/templates/analytics/app/pages/adhoc/explorer-dashboard/index.tsx +3 -1
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/SqlChartCard.tsx +61 -4
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/index.tsx +40 -2
- package/corpus/templates/analytics/changelog/2026-07-09-analytics-no-longer-forgets-successful-data-queries-when-a-l.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-09-dashboard-charts-keep-consistent-spacing-when-they-stack-ver.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-09-dashboard-charts-tables-and-extensions-can-be-selected-and-d.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-09-long-running-analytics-requests-now-recover-automatically-wh.md +6 -0
- package/corpus/templates/analytics/server/db/index.ts +6 -0
- package/corpus/templates/clips/desktop/src/hooks/useMeetingTranscription.ts +1 -7
- package/corpus/templates/content/app/components/editor/DocumentProperties.tsx +102 -15
- package/corpus/templates/content/app/hooks/use-content-database.ts +52 -0
- package/corpus/templates/content/app/hooks/use-document-properties.ts +50 -6
- package/corpus/templates/content/app/i18n/zh-TW.ts +2 -0
- package/corpus/templates/content/app/i18n-data.ts +28 -0
- package/corpus/templates/content/changelog/2026-07-09-notion-conflict-warnings-no-longer-flash-during-normal-synce.md +6 -0
- package/corpus/templates/content/changelog/2026-07-09-property-menus-and-delete-confirmations-now-open-visibly-and.md +6 -0
- package/corpus/templates/content/server/lib/notion-sync.ts +130 -28
- package/corpus/templates/design/actions/add-breakpoint.ts +48 -68
- package/corpus/templates/design/actions/add-localhost-screens.ts +496 -61
- package/corpus/templates/design/actions/apply-component-prop-edit.ts +2 -18
- package/corpus/templates/design/actions/apply-design-token-edit.ts +51 -82
- package/corpus/templates/design/actions/apply-tweaks.ts +63 -41
- package/corpus/templates/design/actions/capture-design-state.ts +2 -2
- package/corpus/templates/design/actions/connect-localhost.ts +58 -12
- package/corpus/templates/design/actions/create-component.ts +2 -18
- package/corpus/templates/design/actions/create-design-branch.ts +38 -18
- package/corpus/templates/design/actions/create-fusion-app.ts +15 -11
- package/corpus/templates/design/actions/delete-file.ts +19 -34
- package/corpus/templates/design/actions/deploy-design-preview.ts +59 -27
- package/corpus/templates/design/actions/deploy-fusion-app.ts +22 -15
- package/corpus/templates/design/actions/export-pdf.ts +2 -1
- package/corpus/templates/design/actions/export-zip.ts +9 -3
- package/corpus/templates/design/actions/generate-design.ts +107 -70
- package/corpus/templates/design/actions/get-component-details.ts +2 -18
- package/corpus/templates/design/actions/get-design-branch-diff.ts +2 -3
- package/corpus/templates/design/actions/get-design-surface-index.ts +2 -18
- package/corpus/templates/design/actions/get-design.ts +2 -1
- package/corpus/templates/design/actions/grant-localhost-write-consent.ts +7 -1
- package/corpus/templates/design/actions/import-design-tokens.ts +114 -76
- package/corpus/templates/design/actions/index-components.ts +2 -18
- package/corpus/templates/design/actions/list-design-source-capabilities.ts +23 -28
- package/corpus/templates/design/actions/list-local-files.ts +9 -2
- package/corpus/templates/design/actions/migrate-board-objects-to-file.ts +82 -98
- package/corpus/templates/design/actions/open-component-source.ts +2 -18
- package/corpus/templates/design/actions/open-visual-edit.ts +19 -1
- package/corpus/templates/design/actions/present-design-variants.ts +70 -70
- package/corpus/templates/design/actions/preview-component-prop-edit.ts +4 -14
- package/corpus/templates/design/actions/read-local-file.ts +9 -2
- package/corpus/templates/design/actions/remove-breakpoint.ts +40 -61
- package/corpus/templates/design/actions/rename-screen.ts +425 -0
- package/corpus/templates/design/actions/request-localhost-write-consent.ts +12 -2
- package/corpus/templates/design/actions/revoke-localhost-write-consent.ts +9 -2
- package/corpus/templates/design/actions/sync-fusion-app.ts +56 -39
- package/corpus/templates/design/actions/update-design.ts +376 -61
- package/corpus/templates/design/actions/update-file.ts +455 -188
- package/corpus/templates/design/actions/write-local-file.ts +10 -2
- package/corpus/templates/design/app/components/design/DesignCanvas.tsx +685 -608
- package/corpus/templates/design/app/components/design/LayersPanel.tsx +43 -15
- package/corpus/templates/design/app/components/design/MultiScreenCanvas.tsx +576 -2015
- package/corpus/templates/design/app/components/design/bridge/editor-chrome.bridge.ts +62 -14
- package/corpus/templates/design/app/components/design/bridge/embedded-wheel.bridge.ts +263 -25
- package/corpus/templates/design/app/components/design/design-canvas/annotation-submit.ts +34 -0
- package/corpus/templates/design/app/components/design/design-canvas/coordinate-transforms.ts +40 -0
- package/corpus/templates/design/app/components/design/design-canvas/creation.ts +47 -0
- package/corpus/templates/design/app/components/design/design-canvas/element-payload.ts +27 -0
- package/corpus/templates/design/app/components/design/design-canvas/embedded-frame.ts +62 -0
- package/corpus/templates/design/app/components/design/design-canvas/external-preview.ts +137 -0
- package/corpus/templates/design/app/components/design/design-canvas/file-drop.ts +10 -0
- package/corpus/templates/design/app/components/design/design-canvas/hit-test.ts +23 -0
- package/corpus/templates/design/app/components/design/design-canvas/iframe-events.ts +23 -0
- package/corpus/templates/design/app/components/design/design-canvas/iframe-pan.ts +177 -0
- package/corpus/templates/design/app/components/design/design-canvas/motion-types.ts +7 -0
- package/corpus/templates/design/app/components/design/design-canvas/pending-text-edit.ts +62 -0
- package/corpus/templates/design/app/components/design/index.ts +2 -2
- package/corpus/templates/design/app/components/design/multi-screen/canvas-tools.ts +100 -0
- package/corpus/templates/design/app/components/design/multi-screen/coordinate-transforms.ts +81 -0
- package/corpus/templates/design/app/components/design/multi-screen/cross-screen-drop.ts +23 -13
- package/corpus/templates/design/app/components/design/multi-screen/culling.ts +238 -19
- package/corpus/templates/design/app/components/design/multi-screen/draft-primitives.ts +424 -0
- package/corpus/templates/design/app/components/design/multi-screen/frame-geometry.ts +341 -0
- package/corpus/templates/design/app/components/design/multi-screen/iframe-targeting.ts +52 -0
- package/corpus/templates/design/app/components/design/multi-screen/overview-layout.ts +62 -0
- package/corpus/templates/design/app/components/design/multi-screen/primitive-drop-target.ts +283 -0
- package/corpus/templates/design/app/components/design/multi-screen/screen-content-cache.ts +272 -0
- package/corpus/templates/design/app/components/design/multi-screen/types.ts +5 -1
- package/corpus/templates/design/app/components/design/multi-screen/wheel-gesture-state.ts +12 -0
- package/corpus/templates/design/app/components/visual-editor/DrawOverlay.tsx +325 -84
- package/corpus/templates/design/app/hooks/use-navigation-state.ts +15 -1
- package/corpus/templates/design/app/hooks/useDesignHotkeys.ts +119 -47
- package/corpus/templates/design/app/i18n/zh-TW.ts +9 -0
- package/corpus/templates/design/app/i18n-data.ts +223 -0
- package/corpus/templates/design/app/lib/design-save-outbox.ts +379 -0
- package/corpus/templates/design/app/lib/png-clipboard.ts +113 -0
- package/corpus/templates/design/app/pages/design-editor/canvas-primitives.ts +229 -0
- package/corpus/templates/design/app/pages/design-editor/code-layer-state.ts +918 -0
- package/corpus/templates/design/app/pages/design-editor/collab-sync.ts +43 -0
- package/corpus/templates/design/app/pages/design-editor/cross-screen-text-color.ts +336 -0
- package/corpus/templates/design/app/pages/design-editor/data-operations.ts +270 -0
- package/corpus/templates/design/app/pages/design-editor/dom-guards.ts +24 -0
- package/corpus/templates/design/app/pages/design-editor/dom-utils.ts +11 -0
- package/corpus/templates/design/app/pages/design-editor/editor-session.ts +20 -0
- package/corpus/templates/design/app/pages/design-editor/editor-state.ts +408 -0
- package/corpus/templates/design/app/pages/design-editor/export-capture.ts +115 -0
- package/corpus/templates/design/app/pages/design-editor/geometry-persistence.ts +93 -0
- package/corpus/templates/design/app/pages/design-editor/history.ts +169 -0
- package/corpus/templates/design/app/pages/design-editor/layout-operations.ts +185 -0
- package/corpus/templates/design/app/pages/design-editor/motion-state.ts +309 -0
- package/corpus/templates/design/app/pages/design-editor/overview-camera.ts +438 -0
- package/corpus/templates/design/app/pages/design-editor/pending-edits.ts +510 -0
- package/corpus/templates/design/app/pages/design-editor/portable-style.ts +115 -0
- package/corpus/templates/design/app/pages/design-editor/selection-state.ts +337 -0
- package/corpus/templates/design/app/pages/design-editor/style-utils.ts +5 -0
- package/corpus/templates/design/app/pages/design-editor/tool-state.ts +92 -0
- package/corpus/templates/design/app/pages/design-editor/tweak-save.ts +87 -0
- package/corpus/templates/design/app/pages/design-editor/types.ts +36 -0
- package/corpus/templates/design/app/routes/design.$id.tsx +11 -1
- package/corpus/templates/design/changelog/2026-07-09-design-edits-canvas-positions-tools-and-tab-context-now-pers.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-figma-style-shortcuts-drawing-annotations-and-cross-screen-d.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-hand-and-scale-tools-now-keep-their-active-toolbar-identity-.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-large-multi-screen-designs-now-stay-responsive-during-long-c.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-layer-drags-now-land-exactly-where-the-insertion-indicator-s.md +6 -0
- package/corpus/templates/design/server/db/index.ts +2 -52
- package/corpus/templates/design/server/db/schema.ts +16 -0
- package/corpus/templates/design/server/lib/design-data-access.ts +70 -0
- package/corpus/templates/design/server/lib/design-data-mutation.ts +249 -0
- package/corpus/templates/design/server/lib/fusion-screens.ts +89 -76
- package/corpus/templates/design/server/lib/import-design-files.ts +76 -35
- package/corpus/templates/design/server/lib/verify-write-grant.ts +7 -2
- package/corpus/templates/design/server/plugins/db.ts +19 -0
- package/corpus/templates/design/server/source-workspace.ts +12 -13
- package/corpus/templates/design/shared/resolve-tweaks.ts +15 -0
- package/corpus/templates/design/shared/screen-rename.ts +42 -0
- package/corpus/templates/design/shared/source-mode.ts +84 -4
- package/dist/agent/engine/builder-engine.d.ts +1 -1
- package/dist/agent/engine/builder-engine.d.ts.map +1 -1
- package/dist/agent/engine/builtin.js +1 -1
- package/dist/agent/engine/builtin.js.map +1 -1
- package/dist/agent/model-config.d.ts +9 -9
- package/dist/agent/model-config.d.ts.map +1 -1
- package/dist/agent/model-config.js +30 -30
- package/dist/agent/model-config.js.map +1 -1
- package/dist/agent/production-agent.d.ts +60 -1
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +106 -7
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/cli/design-connect.d.ts +30 -1
- package/dist/cli/design-connect.d.ts.map +1 -1
- package/dist/cli/design-connect.js +359 -75
- package/dist/cli/design-connect.js.map +1 -1
- package/dist/cli/recap.js +2 -2
- package/dist/cli/recap.js.map +1 -1
- package/dist/client/AgentPanel.d.ts.map +1 -1
- package/dist/client/AgentPanel.js +6 -1
- package/dist/client/AgentPanel.js.map +1 -1
- package/dist/client/agent-chat-adapter.d.ts.map +1 -1
- package/dist/client/agent-chat-adapter.js +10 -5
- package/dist/client/agent-chat-adapter.js.map +1 -1
- package/dist/client/composer/TiptapComposer.js +1 -1
- package/dist/client/composer/TiptapComposer.js.map +1 -1
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +1 -1
- package/dist/client/index.js.map +1 -1
- package/dist/client/org/TeamPage.d.ts.map +1 -1
- package/dist/client/org/TeamPage.js +6 -5
- package/dist/client/org/TeamPage.js.map +1 -1
- package/dist/client/use-action.d.ts +32 -0
- package/dist/client/use-action.d.ts.map +1 -1
- package/dist/client/use-action.js +68 -1
- package/dist/client/use-action.js.map +1 -1
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/db/client.d.ts +3 -0
- package/dist/db/client.d.ts.map +1 -1
- package/dist/db/client.js +7 -2
- package/dist/db/client.js.map +1 -1
- package/dist/db/create-get-db.d.ts.map +1 -1
- package/dist/db/create-get-db.js +2 -2
- package/dist/db/create-get-db.js.map +1 -1
- package/dist/notifications/routes.d.ts +3 -3
- package/dist/resources/handlers.d.ts +2 -2
- package/dist/scripts/agent-engines/manage-agent-engine.js +1 -1
- package/dist/scripts/agent-engines/manage-agent-engine.js.map +1 -1
- package/dist/scripts/agent-engines/set-agent-engine.js +1 -1
- package/dist/scripts/agent-engines/set-agent-engine.js.map +1 -1
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/transcribe-voice.js +1 -1
- package/dist/server/transcribe-voice.js.map +1 -1
- package/dist/usage/store.d.ts.map +1 -1
- package/dist/usage/store.js +13 -4
- package/dist/usage/store.js.map +1 -1
- package/dist/vite/client.d.ts.map +1 -1
- package/dist/vite/client.js +36 -1
- package/dist/vite/client.js.map +1 -1
- package/docs/content/a2a-protocol.mdx +12 -0
- package/docs/content/locales/ar-SA/a2a-protocol.mdx +12 -0
- package/docs/content/locales/ar-SA/pr-visual-recap.mdx +3 -3
- package/docs/content/locales/ar-SA/pure-agent-apps.mdx +4 -0
- package/docs/content/locales/de-DE/a2a-protocol.mdx +12 -0
- package/docs/content/locales/de-DE/pr-visual-recap.mdx +3 -3
- package/docs/content/locales/de-DE/pure-agent-apps.mdx +4 -0
- package/docs/content/locales/es-ES/a2a-protocol.mdx +12 -0
- package/docs/content/locales/es-ES/pr-visual-recap.mdx +3 -3
- package/docs/content/locales/es-ES/pure-agent-apps.mdx +4 -0
- package/docs/content/locales/fr-FR/a2a-protocol.mdx +12 -0
- package/docs/content/locales/fr-FR/pr-visual-recap.mdx +3 -3
- package/docs/content/locales/fr-FR/pure-agent-apps.mdx +4 -0
- package/docs/content/locales/hi-IN/a2a-protocol.mdx +12 -0
- package/docs/content/locales/hi-IN/pr-visual-recap.mdx +3 -3
- package/docs/content/locales/hi-IN/pure-agent-apps.mdx +4 -0
- package/docs/content/locales/ja-JP/a2a-protocol.mdx +12 -0
- package/docs/content/locales/ja-JP/pr-visual-recap.mdx +3 -3
- package/docs/content/locales/ja-JP/pure-agent-apps.mdx +4 -0
- package/docs/content/locales/ko-KR/a2a-protocol.mdx +12 -0
- package/docs/content/locales/ko-KR/pr-visual-recap.mdx +3 -3
- package/docs/content/locales/ko-KR/pure-agent-apps.mdx +4 -0
- package/docs/content/locales/pt-BR/a2a-protocol.mdx +12 -0
- package/docs/content/locales/pt-BR/pr-visual-recap.mdx +3 -3
- package/docs/content/locales/pt-BR/pure-agent-apps.mdx +4 -0
- package/docs/content/locales/zh-CN/a2a-protocol.mdx +12 -0
- package/docs/content/locales/zh-CN/pr-visual-recap.mdx +3 -3
- package/docs/content/locales/zh-CN/pure-agent-apps.mdx +4 -0
- package/docs/content/locales/zh-TW/a2a-protocol.mdx +12 -0
- package/docs/content/locales/zh-TW/pr-visual-recap.mdx +3 -3
- package/docs/content/locales/zh-TW/pure-agent-apps.mdx +4 -0
- package/docs/content/pr-visual-recap.mdx +3 -3
- package/docs/content/pure-agent-apps.mdx +22 -0
- package/package.json +2 -2
|
@@ -34,6 +34,9 @@ const screenRouteSchema = z.object({
|
|
|
34
34
|
url: z.string().optional(),
|
|
35
35
|
title: z.string().optional(),
|
|
36
36
|
sourceFile: z.string().optional(),
|
|
37
|
+
sourceKind: z.enum(["react-router", "html", "manual"]).optional(),
|
|
38
|
+
screenshotUrl: z.string().optional(),
|
|
39
|
+
metadata: z.record(z.string(), z.unknown()).optional(),
|
|
37
40
|
width: z.number().positive().optional(),
|
|
38
41
|
height: z.number().positive().optional(),
|
|
39
42
|
x: z.number().optional(),
|
|
@@ -107,6 +110,11 @@ function routeManifestFromScreens(args: {
|
|
|
107
110
|
if (screenInputs.length === 0) return undefined;
|
|
108
111
|
|
|
109
112
|
return screenInputs.map((input) => {
|
|
113
|
+
if (!input.path && !input.url) {
|
|
114
|
+
throw new Error(
|
|
115
|
+
`Route "${input.routeId ?? "(unknown)"}" needs path or url when no routeManifest is provided.`,
|
|
116
|
+
);
|
|
117
|
+
}
|
|
110
118
|
const url = routeUrl(args.devServerUrl, {
|
|
111
119
|
path: input.path,
|
|
112
120
|
url: input.url,
|
|
@@ -117,7 +125,9 @@ function routeManifestFromScreens(args: {
|
|
|
117
125
|
path,
|
|
118
126
|
title: input.title ?? titleFromRoutePath(path),
|
|
119
127
|
sourceFile: input.sourceFile,
|
|
120
|
-
sourceKind: "manual" as const,
|
|
128
|
+
sourceKind: input.sourceKind ?? ("manual" as const),
|
|
129
|
+
screenshotUrl: input.screenshotUrl,
|
|
130
|
+
metadata: input.metadata,
|
|
121
131
|
};
|
|
122
132
|
});
|
|
123
133
|
}
|
|
@@ -167,6 +177,12 @@ export default defineAction({
|
|
|
167
177
|
"returns it as `bridgeToken` so the caller can start the local bridge " +
|
|
168
178
|
"with `design connect --bridge-token <token>`.",
|
|
169
179
|
),
|
|
180
|
+
previewToken: z
|
|
181
|
+
.string()
|
|
182
|
+
.optional()
|
|
183
|
+
.describe(
|
|
184
|
+
"Optional paired read-only preview token from a self-registering CLI. Omit it with bridgeToken to derive the compatible token automatically.",
|
|
185
|
+
),
|
|
170
186
|
routes: jsonArray(z.array(screenRouteSchema))
|
|
171
187
|
.optional()
|
|
172
188
|
.describe(
|
|
@@ -244,6 +260,7 @@ export default defineAction({
|
|
|
244
260
|
routeManifest,
|
|
245
261
|
capabilities: args.capabilities,
|
|
246
262
|
bridgeToken: args.bridgeToken,
|
|
263
|
+
previewToken: args.previewToken,
|
|
247
264
|
status: "connected",
|
|
248
265
|
});
|
|
249
266
|
|
|
@@ -321,6 +338,7 @@ export default defineAction({
|
|
|
321
338
|
// Minted/stored by connect-localhost; the skill starts the bridge with
|
|
322
339
|
// `design connect --bridge-token <this>` so bridge and row agree.
|
|
323
340
|
bridgeToken: connection.bridgeToken,
|
|
341
|
+
previewToken: connection.previewToken,
|
|
324
342
|
};
|
|
325
343
|
},
|
|
326
344
|
link: ({ result }) => {
|
|
@@ -13,6 +13,7 @@ import { z } from "zod";
|
|
|
13
13
|
|
|
14
14
|
import "../server/db/index.js"; // ensure registerShareableResource runs
|
|
15
15
|
import { getDb, schema } from "../server/db/index.js";
|
|
16
|
+
import { mutateDesignData } from "../server/lib/design-data-mutation.js";
|
|
16
17
|
import {
|
|
17
18
|
mergeCanvasFramePlacements,
|
|
18
19
|
type CanvasFramePlacement,
|
|
@@ -119,16 +120,6 @@ function isRecord(value: unknown): value is Record<string, unknown> {
|
|
|
119
120
|
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
120
121
|
}
|
|
121
122
|
|
|
122
|
-
function parseJsonRecord(value: string | null | undefined) {
|
|
123
|
-
if (!value) return {};
|
|
124
|
-
try {
|
|
125
|
-
const parsed = JSON.parse(value);
|
|
126
|
-
return isRecord(parsed) ? parsed : {};
|
|
127
|
-
} catch {
|
|
128
|
-
return {};
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
123
|
function slugify(value: string, fallback: string) {
|
|
133
124
|
return (
|
|
134
125
|
value
|
|
@@ -472,11 +463,6 @@ export default defineAction({
|
|
|
472
463
|
|
|
473
464
|
const db = getDb();
|
|
474
465
|
const now = new Date().toISOString();
|
|
475
|
-
const [design] = await db
|
|
476
|
-
.select({ data: schema.designs.data })
|
|
477
|
-
.from(schema.designs)
|
|
478
|
-
.where(eq(schema.designs.id, designId))
|
|
479
|
-
.limit(1);
|
|
480
466
|
const existingFiles = await db
|
|
481
467
|
.select()
|
|
482
468
|
.from(schema.designFiles)
|
|
@@ -527,62 +513,76 @@ export default defineAction({
|
|
|
527
513
|
}
|
|
528
514
|
|
|
529
515
|
const placements = placeVariantScreens(screens);
|
|
530
|
-
await
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
516
|
+
await mutateDesignData({
|
|
517
|
+
designId,
|
|
518
|
+
mutate: (current, { updatedAt }) => {
|
|
519
|
+
const mergedFrames = mergeCanvasFramePlacements({
|
|
520
|
+
existing: current.canvasFrames,
|
|
521
|
+
placements,
|
|
522
|
+
resolveFileId: (placement) => placement.fileId,
|
|
523
|
+
});
|
|
524
|
+
const previousMetadata = isRecord(current.screenMetadata)
|
|
525
|
+
? { ...current.screenMetadata }
|
|
526
|
+
: {};
|
|
527
|
+
const previousVariantSets = isRecord(current.designVariantSets)
|
|
528
|
+
? { ...current.designVariantSets }
|
|
529
|
+
: {};
|
|
530
|
+
for (const screen of screens) {
|
|
531
|
+
previousMetadata[screen.id] = {
|
|
532
|
+
sourceType: "inline",
|
|
533
|
+
previewState: "preview",
|
|
534
|
+
title: screen.label,
|
|
535
|
+
width: screen.width,
|
|
536
|
+
height: screen.height,
|
|
537
|
+
variantSetId,
|
|
538
|
+
variantId: screen.variantId,
|
|
539
|
+
};
|
|
540
|
+
}
|
|
541
|
+
previousVariantSets[variantSetId] = {
|
|
542
|
+
id: variantSetId,
|
|
543
|
+
prompt: prompt ?? "Pick a direction",
|
|
544
|
+
createdAt: now,
|
|
545
|
+
screens: screens.map((screen) => ({
|
|
546
|
+
id: screen.id,
|
|
547
|
+
variantId: screen.variantId,
|
|
548
|
+
label: screen.label,
|
|
549
|
+
filename: screen.filename,
|
|
550
|
+
width: screen.width,
|
|
551
|
+
height: screen.height,
|
|
552
|
+
})),
|
|
557
553
|
};
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
554
|
+
|
|
555
|
+
return {
|
|
556
|
+
...current,
|
|
557
|
+
canvasFrames: mergedFrames.canvasFrames,
|
|
558
|
+
screenMetadata: previousMetadata,
|
|
559
|
+
designVariantSets: previousVariantSets,
|
|
560
|
+
updatedAt,
|
|
561
|
+
};
|
|
562
|
+
},
|
|
563
|
+
isApplied: (current) => {
|
|
564
|
+
const canvasFrames = isRecord(current.canvasFrames)
|
|
565
|
+
? current.canvasFrames
|
|
566
|
+
: {};
|
|
567
|
+
const metadata = isRecord(current.screenMetadata)
|
|
568
|
+
? current.screenMetadata
|
|
569
|
+
: {};
|
|
570
|
+
const variantSets = isRecord(current.designVariantSets)
|
|
571
|
+
? current.designVariantSets
|
|
572
|
+
: {};
|
|
573
|
+
const set = isRecord(variantSets[variantSetId])
|
|
574
|
+
? variantSets[variantSetId]
|
|
575
|
+
: null;
|
|
576
|
+
const persistedScreens = Array.isArray(set?.screens) ? set.screens : [];
|
|
577
|
+
return screens.every(
|
|
578
|
+
(screen) =>
|
|
579
|
+
isRecord(canvasFrames[screen.id]) &&
|
|
580
|
+
isRecord(metadata[screen.id]) &&
|
|
581
|
+
persistedScreens.some(
|
|
582
|
+
(persisted) => isRecord(persisted) && persisted.id === screen.id,
|
|
583
|
+
),
|
|
584
|
+
);
|
|
585
|
+
},
|
|
586
586
|
});
|
|
587
587
|
|
|
588
588
|
await writeAppState("navigate", {
|
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
componentNodeIdMatches,
|
|
38
38
|
extractProps,
|
|
39
39
|
} from "../shared/component-model.js";
|
|
40
|
-
import {
|
|
40
|
+
import { designSourceTypeFromData } from "../shared/source-mode.js";
|
|
41
41
|
|
|
42
42
|
// ─── Helpers ──────────────────────────────────────────────────────────────────
|
|
43
43
|
|
|
@@ -230,19 +230,9 @@ export default defineAction({
|
|
|
230
230
|
nodeId,
|
|
231
231
|
});
|
|
232
232
|
|
|
233
|
-
const sourceType =
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
try {
|
|
237
|
-
const d = JSON.parse(
|
|
238
|
-
(access.resource as { data?: string }).data ?? "{}",
|
|
239
|
-
) as Record<string, unknown>;
|
|
240
|
-
return d.sourceType ?? "inline";
|
|
241
|
-
} catch {
|
|
242
|
-
return "inline";
|
|
243
|
-
}
|
|
244
|
-
})(),
|
|
245
|
-
) ?? "inline";
|
|
233
|
+
const sourceType = designSourceTypeFromData(
|
|
234
|
+
(access.resource as { data?: unknown }).data,
|
|
235
|
+
);
|
|
246
236
|
|
|
247
237
|
return {
|
|
248
238
|
designId,
|
|
@@ -15,9 +15,12 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import { defineAction } from "@agent-native/core";
|
|
18
|
-
import {
|
|
18
|
+
import {
|
|
19
|
+
getRequestOrgId,
|
|
20
|
+
getRequestUserEmail,
|
|
21
|
+
} from "@agent-native/core/server/request-context";
|
|
19
22
|
import { assertAccess } from "@agent-native/core/sharing";
|
|
20
|
-
import { and, eq } from "drizzle-orm";
|
|
23
|
+
import { and, eq, isNull } from "drizzle-orm";
|
|
21
24
|
import { z } from "zod";
|
|
22
25
|
|
|
23
26
|
import { getDb, schema } from "../server/db/index.js";
|
|
@@ -80,6 +83,7 @@ export default defineAction({
|
|
|
80
83
|
|
|
81
84
|
const ownerEmail = getRequestUserEmail();
|
|
82
85
|
if (!ownerEmail) throw new Error("no authenticated user");
|
|
86
|
+
const orgId = getRequestOrgId() ?? null;
|
|
83
87
|
|
|
84
88
|
const db = getDb();
|
|
85
89
|
const [connection] = await db
|
|
@@ -92,6 +96,9 @@ export default defineAction({
|
|
|
92
96
|
and(
|
|
93
97
|
eq(schema.designLocalhostConnections.id, connectionId),
|
|
94
98
|
eq(schema.designLocalhostConnections.ownerEmail, ownerEmail),
|
|
99
|
+
orgId
|
|
100
|
+
? eq(schema.designLocalhostConnections.orgId, orgId)
|
|
101
|
+
: isNull(schema.designLocalhostConnections.orgId),
|
|
95
102
|
),
|
|
96
103
|
)
|
|
97
104
|
.limit(1);
|
|
@@ -1,48 +1,24 @@
|
|
|
1
1
|
import { defineAction } from "@agent-native/core";
|
|
2
2
|
import { assertAccess } from "@agent-native/core/sharing";
|
|
3
|
-
import { eq } from "drizzle-orm";
|
|
4
3
|
import { z } from "zod";
|
|
5
4
|
|
|
6
|
-
import { getDb, schema } from "../server/db/index.js";
|
|
7
5
|
import "../server/db/index.js"; // ensure registerShareableResource runs
|
|
6
|
+
import {
|
|
7
|
+
mutateDesignData,
|
|
8
|
+
type DesignDataRecord,
|
|
9
|
+
} from "../server/lib/design-data-mutation.js";
|
|
8
10
|
import type { BreakpointSet } from "../shared/design-state.js";
|
|
9
11
|
|
|
10
|
-
function readBreakpointSet(designData:
|
|
11
|
-
if (
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
} catch {
|
|
18
|
-
// ignore
|
|
12
|
+
function readBreakpointSet(designData: DesignDataRecord): BreakpointSet | null {
|
|
13
|
+
if (
|
|
14
|
+
designData.breakpointSet &&
|
|
15
|
+
typeof designData.breakpointSet === "object"
|
|
16
|
+
) {
|
|
17
|
+
return designData.breakpointSet as BreakpointSet;
|
|
19
18
|
}
|
|
20
19
|
return null;
|
|
21
20
|
}
|
|
22
21
|
|
|
23
|
-
function writeBreakpointSet(
|
|
24
|
-
designData: string | null,
|
|
25
|
-
set: BreakpointSet,
|
|
26
|
-
now: string,
|
|
27
|
-
): string {
|
|
28
|
-
let prev: Record<string, unknown> = {};
|
|
29
|
-
if (designData) {
|
|
30
|
-
try {
|
|
31
|
-
const parsed = JSON.parse(designData);
|
|
32
|
-
if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
|
|
33
|
-
prev = parsed;
|
|
34
|
-
}
|
|
35
|
-
} catch {
|
|
36
|
-
// ignore
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
return JSON.stringify({
|
|
40
|
-
...prev,
|
|
41
|
-
breakpointSet: set,
|
|
42
|
-
breakpointSetUpdatedAt: now,
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
|
|
46
22
|
export default defineAction({
|
|
47
23
|
description:
|
|
48
24
|
"Remove a breakpoint frame from the design's breakpoint set by its id. " +
|
|
@@ -57,47 +33,50 @@ export default defineAction({
|
|
|
57
33
|
run: async ({ designId, breakpointId }) => {
|
|
58
34
|
await assertAccess("design", designId, "editor");
|
|
59
35
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
36
|
+
let sawSet = false;
|
|
37
|
+
let removedBreakpoint: BreakpointSet["breakpoints"][number] | undefined;
|
|
38
|
+
const persisted = await mutateDesignData({
|
|
39
|
+
designId,
|
|
40
|
+
mutate: (current, { updatedAt }) => {
|
|
41
|
+
const set = readBreakpointSet(current);
|
|
42
|
+
if (!set) return current;
|
|
43
|
+
sawSet = true;
|
|
44
|
+
const removed = set.breakpoints.find((bp) => bp.id === breakpointId);
|
|
45
|
+
if (!removed) return current;
|
|
46
|
+
removedBreakpoint = removed;
|
|
47
|
+
return {
|
|
48
|
+
...current,
|
|
49
|
+
breakpointSet: {
|
|
50
|
+
...set,
|
|
51
|
+
breakpoints: set.breakpoints.filter((bp) => bp.id !== breakpointId),
|
|
52
|
+
},
|
|
53
|
+
breakpointSetUpdatedAt: updatedAt,
|
|
54
|
+
};
|
|
55
|
+
},
|
|
56
|
+
isApplied: (current) =>
|
|
57
|
+
!readBreakpointSet(current)?.breakpoints.some(
|
|
58
|
+
(breakpoint) => breakpoint.id === breakpointId,
|
|
59
|
+
),
|
|
60
|
+
});
|
|
61
|
+
const updatedSet = readBreakpointSet(persisted.data);
|
|
66
62
|
|
|
67
|
-
if (!
|
|
68
|
-
|
|
69
|
-
const set = readBreakpointSet(design.data);
|
|
70
|
-
if (!set) {
|
|
63
|
+
if (!sawSet && !updatedSet) {
|
|
71
64
|
return {
|
|
72
65
|
removed: false,
|
|
73
66
|
reason: "No breakpoint set found for this design.",
|
|
74
67
|
};
|
|
75
68
|
}
|
|
76
|
-
|
|
77
|
-
const removed = set.breakpoints.find((bp) => bp.id === breakpointId);
|
|
78
|
-
if (!removed) {
|
|
69
|
+
if (!removedBreakpoint) {
|
|
79
70
|
return {
|
|
80
71
|
removed: false,
|
|
81
72
|
reason: `Breakpoint '${breakpointId}' not found in the set.`,
|
|
82
73
|
};
|
|
83
74
|
}
|
|
84
75
|
|
|
85
|
-
const updatedSet: BreakpointSet = {
|
|
86
|
-
...set,
|
|
87
|
-
breakpoints: set.breakpoints.filter((bp) => bp.id !== breakpointId),
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
const now = new Date().toISOString();
|
|
91
|
-
const updatedData = writeBreakpointSet(design.data, updatedSet, now);
|
|
92
|
-
await db
|
|
93
|
-
.update(schema.designs)
|
|
94
|
-
.set({ data: updatedData, updatedAt: now })
|
|
95
|
-
.where(eq(schema.designs.id, designId));
|
|
96
|
-
|
|
97
76
|
return {
|
|
98
77
|
removed: true,
|
|
99
|
-
removedBreakpoint
|
|
100
|
-
breakpointSet: updatedSet
|
|
78
|
+
removedBreakpoint,
|
|
79
|
+
breakpointSet: updatedSet!,
|
|
101
80
|
};
|
|
102
81
|
},
|
|
103
82
|
});
|