@agent-native/core 0.163.4 → 0.164.3
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/app/components/agents/FeatureFlagsFleetPanel.tsx +78 -19
- package/corpus/templates/analytics/app/hooks/use-dashboard-chat-context.ts +29 -0
- package/corpus/templates/analytics/app/lib/use-auto-focus-select.ts +4 -4
- package/corpus/templates/analytics/app/pages/adhoc/explorer-dashboard/index.tsx +3 -0
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/index.tsx +6 -0
- package/corpus/templates/analytics/app/pages/sessions/SessionsPage.tsx +1 -2
- package/corpus/templates/analytics/app/routes/_index.tsx +3 -2
- package/corpus/templates/analytics/app/routes/adhoc.$id.tsx +7 -2
- package/corpus/templates/analytics/app/routes/dashboard.tsx +3 -2
- package/corpus/templates/analytics/app/routes/overview.tsx +3 -2
- package/corpus/templates/analytics/app/routes/traffic.tsx +3 -2
- package/corpus/templates/analytics/changelog/2026-08-18-verify-cross-app-feature-flag-changes.md +6 -0
- package/corpus/templates/analytics/netlify.toml +2 -0
- package/corpus/templates/analytics/server/lib/workspace-feature-flags.ts +196 -48
- package/corpus/templates/analytics/server/plugins/feature-flags.ts +5 -0
- package/corpus/templates/analytics/shared/feature-flags.ts +10 -0
- package/corpus/templates/assets/app/routes/brand-kits.$id.tsx +5 -1
- package/corpus/templates/assets/app/routes/brand-kits._index.tsx +4 -1
- package/corpus/templates/assets/app/routes/libraries.tsx +4 -1
- package/corpus/templates/assets/app/routes/picker.tsx +4 -1
- package/corpus/templates/assets/netlify.toml +2 -0
- package/corpus/templates/brain/netlify.toml +2 -0
- package/corpus/templates/calendar/app/components/calendar/DayView.tsx +2 -1
- package/corpus/templates/calendar/changelog/2026-08-19-calendar-page-loads-stay-fast-after-idle-periods.md +6 -0
- package/corpus/templates/calendar/netlify.toml +2 -0
- package/corpus/templates/chat/netlify.toml +2 -0
- package/corpus/templates/clips/app/components/player/player-controls.tsx +3 -3
- package/corpus/templates/clips/app/components/player/reaction-emojis.ts +12 -0
- package/corpus/templates/clips/app/components/player/reactions-tray.tsx +90 -9
- package/corpus/templates/clips/app/components/player/scrubber.tsx +43 -10
- package/corpus/templates/clips/app/components/player/video-player.tsx +105 -15
- package/corpus/templates/clips/app/routes/_app.settings._index.tsx +1 -2
- package/corpus/templates/clips/app/routes/_app.wispr.tsx +2 -1
- package/corpus/templates/clips/app/routes/_index.tsx +7 -3
- package/corpus/templates/clips/app/routes/r.$recordingId.tsx +13 -8
- package/corpus/templates/clips/app/routes/share.$shareId.tsx +15 -8
- package/corpus/templates/clips/netlify.toml +2 -0
- package/corpus/templates/clips/server/routes/[...page].head.ts +5 -0
- package/corpus/templates/content/netlify.toml +2 -0
- package/corpus/templates/design/.agents/skills/design-editor-architecture/SKILL.md +103 -0
- package/corpus/templates/design/.agents/skills/design-generation/SKILL.md +2 -1
- package/corpus/templates/design/AGENTS.md +3 -1
- package/corpus/templates/design/app/components/design/bridge/editor-chrome.bridge.ts +3 -2
- package/corpus/templates/design/app/components/design/editor/AgentNativeMenuMark.tsx +25 -0
- package/corpus/templates/design/app/components/design/editor/DesignBottomToolbar.tsx +411 -0
- package/corpus/templates/design/app/components/design/editor/DesignCollaborators.tsx +153 -0
- package/corpus/templates/design/app/components/design/editor/DesignWorkspaceRail.tsx +231 -0
- package/corpus/templates/design/app/components/design/editor/MakeRealDialog.tsx +223 -0
- package/corpus/templates/design/app/components/design/editor/PendingScreenDeletionDialog.tsx +58 -0
- package/corpus/templates/design/app/components/design/editor/PendingVisualStyleWarningDialog.tsx +56 -0
- package/corpus/templates/design/app/components/design/editor/ReadOnlyEditorPanel.tsx +23 -0
- package/corpus/templates/design/app/components/design/editor/SaveTemplateDialog.tsx +161 -0
- package/corpus/templates/design/app/components/design/editor/toolbar-controls.tsx +185 -0
- package/corpus/templates/design/app/pages/DesignEditor.tsx +20913 -0
- package/corpus/templates/design/app/pages/design-editor/command-types.ts +120 -0
- package/corpus/templates/design/app/pages/design-editor/commands/README.md +193 -0
- package/corpus/templates/design/app/pages/design-editor/commands/add-auto-layout.ts +416 -0
- package/corpus/templates/design/app/pages/design-editor/commands/add-screen.ts +112 -0
- package/corpus/templates/design/app/pages/design-editor/commands/align-selection.ts +183 -0
- package/corpus/templates/design/app/pages/design-editor/commands/apply-design-editor-command.ts +243 -0
- package/corpus/templates/design/app/pages/design-editor/commands/apply-file-content-update.ts +236 -0
- package/corpus/templates/design/app/pages/design-editor/commands/apply-local-content-update.ts +304 -0
- package/corpus/templates/design/app/pages/design-editor/commands/apply-pending-visual-styles-with-agent.ts +376 -0
- package/corpus/templates/design/app/pages/design-editor/commands/apply-to-source.ts +132 -0
- package/corpus/templates/design/app/pages/design-editor/commands/can-move-layer.ts +117 -0
- package/corpus/templates/design/app/pages/design-editor/commands/change-selected-z-index.ts +212 -0
- package/corpus/templates/design/app/pages/design-editor/commands/commit-relative-style-delta-to-selected-layers.ts +176 -0
- package/corpus/templates/design/app/pages/design-editor/commands/commit-styles-to-selected-layers.ts +175 -0
- package/corpus/templates/design/app/pages/design-editor/commands/commit-visual-styles.ts +710 -0
- package/corpus/templates/design/app/pages/design-editor/commands/confirm-make-real.ts +99 -0
- package/corpus/templates/design/app/pages/design-editor/commands/copy-as-figma-svg.ts +95 -0
- package/corpus/templates/design/app/pages/design-editor/commands/copy-selection.ts +156 -0
- package/corpus/templates/design/app/pages/design-editor/commands/create-primitive.ts +291 -0
- package/corpus/templates/design/app/pages/design-editor/commands/create-screen-frame.ts +131 -0
- package/corpus/templates/design/app/pages/design-editor/commands/cross-screen-element-drop.ts +577 -0
- package/corpus/templates/design/app/pages/design-editor/commands/delete-files.ts +364 -0
- package/corpus/templates/design/app/pages/design-editor/commands/delete-selection.ts +521 -0
- package/corpus/templates/design/app/pages/design-editor/commands/detach-instance-menu-action.ts +88 -0
- package/corpus/templates/design/app/pages/design-editor/commands/distribute-selection.ts +114 -0
- package/corpus/templates/design/app/pages/design-editor/commands/download-all-screens-pdf.ts +116 -0
- package/corpus/templates/design/app/pages/design-editor/commands/download-pdf.ts +103 -0
- package/corpus/templates/design/app/pages/design-editor/commands/download-svg.ts +159 -0
- package/corpus/templates/design/app/pages/design-editor/commands/duplicate-screen.ts +201 -0
- package/corpus/templates/design/app/pages/design-editor/commands/duplicate-selection.ts +279 -0
- package/corpus/templates/design/app/pages/design-editor/commands/editor-paste.ts +81 -0
- package/corpus/templates/design/app/pages/design-editor/commands/enter-hotkey.ts +155 -0
- package/corpus/templates/design/app/pages/design-editor/commands/enter-single-screen.ts +168 -0
- package/corpus/templates/design/app/pages/design-editor/commands/escape-hotkey.ts +212 -0
- package/corpus/templates/design/app/pages/design-editor/commands/frame-selection.ts +119 -0
- package/corpus/templates/design/app/pages/design-editor/commands/geometry-commit.ts +169 -0
- package/corpus/templates/design/app/pages/design-editor/commands/get-selected-layer-snapshots.ts +177 -0
- package/corpus/templates/design/app/pages/design-editor/commands/group-selection.ts +127 -0
- package/corpus/templates/design/app/pages/design-editor/commands/iframe-context-menu.ts +121 -0
- package/corpus/templates/design/app/pages/design-editor/commands/import-figma-clipboard-into-design.ts +119 -0
- package/corpus/templates/design/app/pages/design-editor/commands/layer-marquee-selection-change.ts +163 -0
- package/corpus/templates/design/app/pages/design-editor/commands/layer-move-to-screen.ts +331 -0
- package/corpus/templates/design/app/pages/design-editor/commands/layer-move.ts +517 -0
- package/corpus/templates/design/app/pages/design-editor/commands/layer-rename.ts +247 -0
- package/corpus/templates/design/app/pages/design-editor/commands/layer-selection-change.ts +161 -0
- package/corpus/templates/design/app/pages/design-editor/commands/mode-change.ts +122 -0
- package/corpus/templates/design/app/pages/design-editor/commands/nudge-selection.ts +213 -0
- package/corpus/templates/design/app/pages/design-editor/commands/overview-primitive-reparent.ts +318 -0
- package/corpus/templates/design/app/pages/design-editor/commands/paste-copied-screens.ts +114 -0
- package/corpus/templates/design/app/pages/design-editor/commands/paste-over-selection.ts +70 -0
- package/corpus/templates/design/app/pages/design-editor/commands/paste-selection.ts +436 -0
- package/corpus/templates/design/app/pages/design-editor/commands/paste-to-replace.ts +135 -0
- package/corpus/templates/design/app/pages/design-editor/commands/pasted-image-files.ts +209 -0
- package/corpus/templates/design/app/pages/design-editor/commands/persist-frame-geometry-save.ts +113 -0
- package/corpus/templates/design/app/pages/design-editor/commands/persist-tweak-save.ts +160 -0
- package/corpus/templates/design/app/pages/design-editor/commands/primitive-created.ts +168 -0
- package/corpus/templates/design/app/pages/design-editor/commands/record-pending-live-layer-state-edit.ts +149 -0
- package/corpus/templates/design/app/pages/design-editor/commands/record-pending-live-structure-edit.ts +200 -0
- package/corpus/templates/design/app/pages/design-editor/commands/record-pending-live-text-edit.ts +152 -0
- package/corpus/templates/design/app/pages/design-editor/commands/record-pending-visual-style-edit.ts +247 -0
- package/corpus/templates/design/app/pages/design-editor/commands/redo.ts +1086 -0
- package/corpus/templates/design/app/pages/design-editor/commands/render-png-blob.ts +200 -0
- package/corpus/templates/design/app/pages/design-editor/commands/save-file-content.ts +207 -0
- package/corpus/templates/design/app/pages/design-editor/commands/screen-element-select.ts +262 -0
- package/corpus/templates/design/app/pages/design-editor/commands/screen-text-content-change.ts +216 -0
- package/corpus/templates/design/app/pages/design-editor/commands/screen-visual-duplicate-change.ts +108 -0
- package/corpus/templates/design/app/pages/design-editor/commands/screen-visual-structure-change.ts +280 -0
- package/corpus/templates/design/app/pages/design-editor/commands/screen-visual-style-change.ts +151 -0
- package/corpus/templates/design/app/pages/design-editor/commands/send-overview-annotations.ts +88 -0
- package/corpus/templates/design/app/pages/design-editor/commands/send-runtime-layer-move-semantic-handoff.ts +122 -0
- package/corpus/templates/design/app/pages/design-editor/commands/send-runtime-layer-semantic-handoff.ts +143 -0
- package/corpus/templates/design/app/pages/design-editor/commands/send-runtime-layer-state-semantic-handoff.ts +115 -0
- package/corpus/templates/design/app/pages/design-editor/commands/start-retry-generation.ts +152 -0
- package/corpus/templates/design/app/pages/design-editor/commands/start-sidebar-resize.ts +99 -0
- package/corpus/templates/design/app/pages/design-editor/commands/style-change.ts +152 -0
- package/corpus/templates/design/app/pages/design-editor/commands/styles-change.ts +155 -0
- package/corpus/templates/design/app/pages/design-editor/commands/suggest-auto-layout.ts +125 -0
- package/corpus/templates/design/app/pages/design-editor/commands/text-content-change.ts +201 -0
- package/corpus/templates/design/app/pages/design-editor/commands/tidy-up.ts +123 -0
- package/corpus/templates/design/app/pages/design-editor/commands/toggle-layer-hidden.ts +167 -0
- package/corpus/templates/design/app/pages/design-editor/commands/toggle-layer-locked.ts +175 -0
- package/corpus/templates/design/app/pages/design-editor/commands/toggle-motion-keyframe.ts +99 -0
- package/corpus/templates/design/app/pages/design-editor/commands/tweak-prompt-submit.ts +84 -0
- package/corpus/templates/design/app/pages/design-editor/commands/undo.ts +906 -0
- package/corpus/templates/design/app/pages/design-editor/commands/ungroup-selection.ts +170 -0
- package/corpus/templates/design/app/pages/design-editor/commands/visual-duplicate-change.ts +119 -0
- package/corpus/templates/design/app/pages/design-editor/commands/visual-structure-change.ts +274 -0
- package/corpus/templates/design/app/pages/design-editor/commands/write-frame-geometry-snapshot.ts +99 -0
- package/corpus/templates/design/app/pages/design-editor/derive/design-breakpoints.ts +56 -0
- package/corpus/templates/design/app/pages/design-editor/derive/overview-screens.ts +146 -0
- package/corpus/templates/design/app/pages/design-editor/domains/use-tweaks.ts +326 -0
- package/corpus/templates/design/app/pages/design-editor/editor-constants.ts +54 -0
- package/corpus/templates/design/app/pages/design-editor/editor-helpers.ts +183 -0
- package/corpus/templates/design/app/pages/design-editor/effects/adopt-db-file-content.ts +270 -0
- package/corpus/templates/design/app/pages/design-editor/effects/mirror-selection-to-agent-chat.ts +134 -0
- package/corpus/templates/design/app/pages/design-editor/effects/motion-autosave.ts +335 -0
- package/corpus/templates/design/app/pages/design-editor/effects/observe-collab-text.ts +183 -0
- package/corpus/templates/design/app/pages/design-editor/effects/publish-agent-selection-context.ts +252 -0
- package/corpus/templates/design/app/pages/design-editor/effects/resume-pending-generation.ts +178 -0
- package/corpus/templates/design/app/pages/design-editor/effects/seed-collab-content.ts +157 -0
- package/corpus/templates/design/app/pages/design-editor/preview-html.ts +19 -0
- package/corpus/templates/design/app/routes/examples.tsx +2 -1
- package/corpus/templates/design/netlify.toml +2 -0
- package/corpus/templates/design/shared/board-file.ts +2 -1
- package/corpus/templates/dispatch/netlify.toml +2 -0
- package/corpus/templates/forms/app/routes/_index.tsx +3 -2
- package/corpus/templates/forms/netlify.toml +2 -0
- package/corpus/templates/mail/app/routes/_index.tsx +3 -2
- package/corpus/templates/mail/netlify.toml +2 -0
- package/corpus/templates/plan/netlify.toml +2 -0
- package/corpus/templates/slides/netlify.toml +2 -0
- package/corpus/templates/tasks/app/routes/_index.tsx +2 -1
- package/dist/agent/engine/builder-engine.d.ts +6 -4
- package/dist/agent/engine/builder-engine.js +91 -26
- package/dist/agent/engine/registry.js +16 -0
- package/dist/cli/code-agent-agent-tools.d.ts +2 -0
- package/dist/cli/code-agent-agent-tools.js +188 -0
- package/dist/cli/code-agent-collaboration.d.ts +34 -0
- package/dist/cli/code-agent-collaboration.js +104 -0
- package/dist/cli/code-agent-executor.js +6 -0
- package/dist/cli/code-agent-schedules.d.ts +54 -0
- package/dist/cli/code-agent-schedules.js +198 -0
- package/dist/client/AgentPanel.js +1 -1
- package/dist/client/ConnectBuilderCard.js +5 -2
- package/dist/client/EnvironmentBadge.js +6 -5
- package/dist/client/chat/run-recovery.js +3 -2
- package/dist/client/chat/tool-call-display.js +2 -3
- package/dist/client/components/CodeRequiredDialog.js +4 -2
- package/dist/client/i18n.js +5 -4
- package/dist/client/settings/SettingsPanel.js +1 -1
- package/dist/client/settings/VoiceTranscriptionSection.js +1 -1
- package/dist/client/settings/useBuilderStatus.d.ts +6 -1
- package/dist/client/settings/useBuilderStatus.js +22 -33
- package/dist/client/transcription/BuilderTranscriptionCta.js +1 -1
- package/dist/code-agents/index.d.ts +2 -0
- package/dist/code-agents/index.js +2 -0
- package/dist/collab/awareness.d.ts +2 -2
- package/dist/collab/routes.d.ts +1 -1
- package/dist/deploy/build.js +10 -4
- package/dist/localization/shared.d.ts +2 -0
- package/dist/localization/shared.js +5 -0
- package/dist/mcp-client/oauth-client.d.ts +1 -0
- package/dist/mcp-client/oauth-client.js +50 -1
- package/dist/notifications/routes.d.ts +3 -3
- package/dist/observability/routes.d.ts +1 -1
- package/dist/provider-api/actions/provider-api.d.ts +2 -2
- package/dist/server/auth-marketing-locales.d.ts +7 -0
- package/dist/server/auth-marketing-locales.js +1322 -0
- package/dist/server/auth-marketing.d.ts +1 -0
- package/dist/server/auth-marketing.js +35 -6
- package/dist/server/auth.js +4 -17
- package/dist/server/builder-browser.d.ts +22 -0
- package/dist/server/builder-browser.js +77 -1
- package/dist/server/builder-oauth.d.ts +50 -0
- package/dist/server/builder-oauth.js +263 -0
- package/dist/server/core-routes-plugin.d.ts +11 -0
- package/dist/server/core-routes-plugin.js +291 -415
- package/dist/server/credential-provider.d.ts +1 -1
- package/dist/server/credential-provider.js +1 -1
- package/dist/server/csrf.js +2 -2
- package/dist/server/onboarding-html.js +52 -120
- package/dist/server/ssr-handler.js +13 -4
- package/dist/settings/store.d.ts +9 -0
- package/dist/settings/store.js +19 -0
- package/dist/shared/cache-control.d.ts +22 -0
- package/dist/shared/cache-control.js +25 -0
- package/dist/shared/index.d.ts +1 -0
- package/dist/shared/index.js +1 -0
- package/dist/templates/chat/netlify.toml +2 -0
- package/docs/content/deployment.mdx +2 -0
- package/docs/content/multi-app-workspace.mdx +1 -1
- package/package.json +2 -2
- package/src/templates/chat/netlify.toml +2 -0
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import type { PromptComposerSubmitOptions } from "@agent-native/core/client/composer";
|
|
2
|
+
import type { CodeLayerNode, CodeLayerTreeNode } from "@shared/code-layer";
|
|
3
|
+
|
|
4
|
+
import type { PortableStyleSnapshot } from "@/components/design/types";
|
|
5
|
+
import type { UploadedFile } from "@/components/editor/PromptDialog";
|
|
6
|
+
import type { DesignClipboardManagedStyleSnapshot } from "@/lib/design-clipboard-managed-styles";
|
|
7
|
+
|
|
8
|
+
import type { PendingLiveStructureEdit } from "./pending-edits";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Local alias for DesignCanvas's inline `embeddedFrame` prop type (not
|
|
12
|
+
* exported from DesignCanvas.tsx) so the per-screen cache can be typed.
|
|
13
|
+
*/
|
|
14
|
+
export type DesignCanvasEmbeddedFrame = {
|
|
15
|
+
viewportWidth: number;
|
|
16
|
+
viewportHeight: number;
|
|
17
|
+
displayWidth: number;
|
|
18
|
+
displayHeight: number;
|
|
19
|
+
fluid?: boolean;
|
|
20
|
+
contentOffsetX?: number;
|
|
21
|
+
contentOffsetY?: number;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export interface LiveScreenSnapshot {
|
|
25
|
+
url: string;
|
|
26
|
+
html: string;
|
|
27
|
+
status?: number;
|
|
28
|
+
contentType?: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface RuntimeLayerSnapshot {
|
|
32
|
+
html: string;
|
|
33
|
+
nodeCount: number;
|
|
34
|
+
documentId?: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export type PendingStructureVerificationStatus =
|
|
38
|
+
| "idle"
|
|
39
|
+
| "checking-source"
|
|
40
|
+
| "awaiting-source"
|
|
41
|
+
| "awaiting-runtime"
|
|
42
|
+
| "conflict";
|
|
43
|
+
|
|
44
|
+
export interface PendingStructureVerificationSource {
|
|
45
|
+
connectionId: string;
|
|
46
|
+
path: string;
|
|
47
|
+
baselineVersionHash: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface PendingStructureVerificationSession {
|
|
51
|
+
requestId: number;
|
|
52
|
+
cancelled: boolean;
|
|
53
|
+
edits: PendingLiveStructureEdit[];
|
|
54
|
+
sources: PendingStructureVerificationSource[];
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export type PostAuthDesignIntent = "save" | "share";
|
|
58
|
+
|
|
59
|
+
export type ShareExportFormat = "html" | "png" | "svg" | "zip";
|
|
60
|
+
|
|
61
|
+
export interface CodingHandoffResult {
|
|
62
|
+
clipboardText?: string;
|
|
63
|
+
prompt?: string;
|
|
64
|
+
rawUrl?: string;
|
|
65
|
+
zipUrl?: string;
|
|
66
|
+
fileCount?: number;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export interface CanvasLayerClipboardEntry {
|
|
70
|
+
html: string;
|
|
71
|
+
rootNodeId?: string;
|
|
72
|
+
sourceFileId: string;
|
|
73
|
+
portableStyleSnapshot?: PortableStyleSnapshot;
|
|
74
|
+
managedStyleSnapshot?: DesignClipboardManagedStyleSnapshot;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface SelectedCanvasLayerSnapshot extends CanvasLayerClipboardEntry {
|
|
78
|
+
node: CodeLayerNode;
|
|
79
|
+
sourceIndex: number;
|
|
80
|
+
tree: CodeLayerTreeNode[];
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export type PatchProofStatus =
|
|
84
|
+
| "runtime"
|
|
85
|
+
| "queued"
|
|
86
|
+
| "applied"
|
|
87
|
+
| "failed"
|
|
88
|
+
| "rolledBack";
|
|
89
|
+
|
|
90
|
+
export interface PatchProofState {
|
|
91
|
+
id: string;
|
|
92
|
+
fileId: string;
|
|
93
|
+
filename: string;
|
|
94
|
+
selector: string;
|
|
95
|
+
sourceId?: string;
|
|
96
|
+
property: string;
|
|
97
|
+
previousValue?: string;
|
|
98
|
+
nextValue: string;
|
|
99
|
+
previousContent?: string;
|
|
100
|
+
capability: string;
|
|
101
|
+
confidence?: number;
|
|
102
|
+
status: PatchProofStatus;
|
|
103
|
+
error?: string;
|
|
104
|
+
createdAt: number;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export type ResponsiveEditScope = "cascade-smaller" | "only";
|
|
108
|
+
|
|
109
|
+
export interface RetryablePrompt {
|
|
110
|
+
prompt: string;
|
|
111
|
+
files: UploadedFile[];
|
|
112
|
+
model?: PromptComposerSubmitOptions["model"];
|
|
113
|
+
engine?: PromptComposerSubmitOptions["engine"];
|
|
114
|
+
effort?: PromptComposerSubmitOptions["effort"];
|
|
115
|
+
designSystemId?: string | null;
|
|
116
|
+
attempt?: number;
|
|
117
|
+
source?: string;
|
|
118
|
+
templateId?: string;
|
|
119
|
+
templateBaselineFiles?: Array<{ id: string; contentHash: string }>;
|
|
120
|
+
}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
# Editor commands
|
|
2
|
+
|
|
3
|
+
Editor _behavior_ lives here, not in `DesignEditor.tsx`. Each module exports one
|
|
4
|
+
`run<Name>(args, ...)` function; `DesignEditor.tsx` holds only the `useCallback`
|
|
5
|
+
that gathers `args` and calls it.
|
|
6
|
+
|
|
7
|
+
**To change what an editor action does, edit the module — not the call site.**
|
|
8
|
+
|
|
9
|
+
Sibling directories: `../effects/` (subscriptions and autosave loops),
|
|
10
|
+
`../derive/` (pure derivations), `../domains/` (whole-domain hooks that own
|
|
11
|
+
state + refs + effects + handlers together), and the flat `../*.ts` helpers
|
|
12
|
+
(`../history.ts`, `../selection-state.ts`, `../pending-edits.ts`,
|
|
13
|
+
`../editor-state.ts`, …).
|
|
14
|
+
|
|
15
|
+
Many specs assert against these files directly rather than against
|
|
16
|
+
`DesignEditor.tsx`, via a `commandSource("<file>.ts")` helper. Moving code out of
|
|
17
|
+
a module breaks those — re-point the spec in the same commit.
|
|
18
|
+
|
|
19
|
+
## History
|
|
20
|
+
|
|
21
|
+
| Module | Does |
|
|
22
|
+
| --------- | ---------------------------------------------------------------------------------------------------------- |
|
|
23
|
+
| `undo.ts` | Undo one step, routing across pending live edits, clipboard pastes, structure replays, and content history |
|
|
24
|
+
| `redo.ts` | Redo the last undone step, mirroring undo routing |
|
|
25
|
+
|
|
26
|
+
## Clipboard
|
|
27
|
+
|
|
28
|
+
| Module | Does |
|
|
29
|
+
| --------------------------------------- | ------------------------------------------------------------------------ |
|
|
30
|
+
| `copy-selection.ts` | Copy selected layers to the design clipboard and the system clipboard |
|
|
31
|
+
| `paste-selection.ts` | Paste clipboard layers into the target screen with cascade placement |
|
|
32
|
+
| `paste-over-selection.ts` | Paste clipboard layers alongside the current selection |
|
|
33
|
+
| `paste-copied-screens.ts` | Paste whole copied screens as new files |
|
|
34
|
+
| `paste-to-replace.ts` | Replace the selected layer with the clipboard payload |
|
|
35
|
+
| `editor-paste.ts` | Top-level paste router: image files vs Figma payload vs design clipboard |
|
|
36
|
+
| `pasted-image-files.ts` | Upload pasted or dropped image files and insert them as layers |
|
|
37
|
+
| `import-figma-clipboard-into-design.ts` | Convert a Figma clipboard payload into design layers |
|
|
38
|
+
| `get-selected-layer-snapshots.ts` | Snapshot selected layers (HTML + geometry) for copy/duplicate |
|
|
39
|
+
| `duplicate-selection.ts` | Duplicate selected layers with offset cascade |
|
|
40
|
+
|
|
41
|
+
## Structure
|
|
42
|
+
|
|
43
|
+
| Module | Does |
|
|
44
|
+
| ----------------------------------- | ------------------------------------------------------------------------------------------- |
|
|
45
|
+
| `delete-selection.ts` | Delete selected layers; writes a scoped `display:none` instead while a breakpoint is active |
|
|
46
|
+
| `delete-files.ts` | Delete screens/files and clean up selection and overview state |
|
|
47
|
+
| `group-selection.ts` | Wrap the selection in a group container |
|
|
48
|
+
| `ungroup-selection.ts` | Unwrap a group, hoisting its children |
|
|
49
|
+
| `frame-selection.ts` | Wrap the selection in a frame |
|
|
50
|
+
| `cross-screen-element-drop.ts` | Move an element from one screen to another by canvas drag |
|
|
51
|
+
| `overview-primitive-reparent.ts` | Reparent a primitive dropped on the overview board |
|
|
52
|
+
| `visual-structure-change.ts` | Apply a canvas structural change to the focused screen |
|
|
53
|
+
| `screen-visual-structure-change.ts` | Same, addressed by explicit `screenId` (overview/board) |
|
|
54
|
+
| `visual-duplicate-change.ts` | Canvas-initiated duplicate on the focused screen |
|
|
55
|
+
| `screen-visual-duplicate-change.ts` | Same, addressed by explicit `screenId` |
|
|
56
|
+
|
|
57
|
+
## Styles
|
|
58
|
+
|
|
59
|
+
| Module | Does |
|
|
60
|
+
| --------------------------------------------------- | ----------------------------------------------------------------------------------- |
|
|
61
|
+
| `commit-visual-styles.ts` | The central style write — resolves base vs breakpoint-scoped content, then persists |
|
|
62
|
+
| `commit-styles-to-selected-layers.ts` | Apply a style map to every selected layer |
|
|
63
|
+
| `commit-relative-style-delta-to-selected-layers.ts` | Apply a relative (delta) style change across the selection |
|
|
64
|
+
| `style-change.ts` | Inspector single-property change (`property`, `value`) |
|
|
65
|
+
| `styles-change.ts` | Inspector multi-property change (`styles` map) |
|
|
66
|
+
| `screen-visual-style-change.ts` | Canvas style change addressed by explicit `screenId` |
|
|
67
|
+
| `record-pending-visual-style-edit.ts` | Record an uncommitted style gesture, stamped with breakpoint scope |
|
|
68
|
+
| `change-selected-z-index.ts` | Raise or lower the selection's z-order |
|
|
69
|
+
|
|
70
|
+
## Text
|
|
71
|
+
|
|
72
|
+
| Module | Does |
|
|
73
|
+
| ---------------------------------- | ----------------------------------------- |
|
|
74
|
+
| `text-content-change.ts` | Commit text content on the focused screen |
|
|
75
|
+
| `screen-text-content-change.ts` | Same, addressed by explicit `screenId` |
|
|
76
|
+
| `record-pending-live-text-edit.ts` | Record an uncommitted live text edit |
|
|
77
|
+
|
|
78
|
+
## Pending live edits
|
|
79
|
+
|
|
80
|
+
| Module | Does |
|
|
81
|
+
| ------------------------------------------- | --------------------------------------------------------------------- |
|
|
82
|
+
| `record-pending-live-structure-edit.ts` | Record an uncommitted live structure change from the runtime canvas |
|
|
83
|
+
| `record-pending-live-layer-state-edit.ts` | Record an uncommitted live lock/hide layer-state change |
|
|
84
|
+
| `apply-pending-visual-styles-with-agent.ts` | Hand the pending visual-style batch to the agent to write into source |
|
|
85
|
+
| `apply-to-source.ts` | Write pending edits back to a localhost/fusion source file |
|
|
86
|
+
|
|
87
|
+
## Layers panel
|
|
88
|
+
|
|
89
|
+
| Module | Does |
|
|
90
|
+
| ----------------------------------- | -------------------------------------------------------------------- |
|
|
91
|
+
| `layer-move.ts` | Reorder or reparent a layer within a screen |
|
|
92
|
+
| `layer-move-to-screen.ts` | Move a layer into a different screen |
|
|
93
|
+
| `can-move-layer.ts` | Predicate guarding a layer move (lock, ownership, source capability) |
|
|
94
|
+
| `layer-rename.ts` | Rename a layer |
|
|
95
|
+
| `layer-selection-change.ts` | Apply a layers-panel selection change |
|
|
96
|
+
| `layer-marquee-selection-change.ts` | Apply a layers-panel marquee selection |
|
|
97
|
+
| `toggle-layer-locked.ts` | Toggle a layer's locked state |
|
|
98
|
+
| `toggle-layer-hidden.ts` | Toggle a layer's hidden state |
|
|
99
|
+
|
|
100
|
+
## Selection and input
|
|
101
|
+
|
|
102
|
+
| Module | Does |
|
|
103
|
+
| -------------------------- | ----------------------------------------------------------------------------- |
|
|
104
|
+
| `screen-element-select.ts` | Select an element on a screen from the canvas |
|
|
105
|
+
| `iframe-context-menu.ts` | Build the canvas context menu for a right-click inside the iframe |
|
|
106
|
+
| `enter-hotkey.ts` | Enter key: start text edit, enter a group, or enter vector edit |
|
|
107
|
+
| `escape-hotkey.ts` | Escape key: exit text edit, vector edit, tool, or selection in priority order |
|
|
108
|
+
|
|
109
|
+
## Layout and geometry
|
|
110
|
+
|
|
111
|
+
| Module | Does |
|
|
112
|
+
| ---------------------------------- | ----------------------------------------------------------- |
|
|
113
|
+
| `align-selection.ts` | Align selected layers on an axis |
|
|
114
|
+
| `distribute-selection.ts` | Distribute selected layers evenly |
|
|
115
|
+
| `nudge-selection.ts` | Arrow-key nudge, coalescing auto-repeat into one undo entry |
|
|
116
|
+
| `tidy-up.ts` | Tidy overview screen positions into a grid |
|
|
117
|
+
| `suggest-auto-layout.ts` | Compute an auto-layout suggestion for the selection |
|
|
118
|
+
| `add-auto-layout.ts` | Apply auto-layout (flex) to the selection |
|
|
119
|
+
| `geometry-commit.ts` | Commit a canvas frame move/resize |
|
|
120
|
+
| `write-frame-geometry-snapshot.ts` | Write a frame-geometry snapshot into design data |
|
|
121
|
+
| `persist-frame-geometry-save.ts` | Flush the debounced frame-geometry save to the server |
|
|
122
|
+
|
|
123
|
+
## Screens and view
|
|
124
|
+
|
|
125
|
+
| Module | Does |
|
|
126
|
+
| ------------------------ | --------------------------------------------------------- |
|
|
127
|
+
| `add-screen.ts` | Create a new screen |
|
|
128
|
+
| `create-screen-frame.ts` | Create a screen by drawing a frame on the overview canvas |
|
|
129
|
+
| `duplicate-screen.ts` | Duplicate an existing screen |
|
|
130
|
+
| `enter-single-screen.ts` | Zoom from overview into a single screen |
|
|
131
|
+
| `mode-change.ts` | Switch edit/annotate/interact, routing view mode with it |
|
|
132
|
+
|
|
133
|
+
## Primitives
|
|
134
|
+
|
|
135
|
+
| Module | Does |
|
|
136
|
+
| ---------------------- | ----------------------------------------------------------------- |
|
|
137
|
+
| `create-primitive.ts` | Insert a drawn primitive (rect, ellipse, line, arrow, text, pen) |
|
|
138
|
+
| `primitive-created.ts` | Post-insert follow-up: select, enter text edit, prune empty nodes |
|
|
139
|
+
|
|
140
|
+
## Persistence
|
|
141
|
+
|
|
142
|
+
| Module | Does |
|
|
143
|
+
| -------------------------------- | ----------------------------------------------- |
|
|
144
|
+
| `save-file-content.ts` | Perform one file-content save request |
|
|
145
|
+
| `apply-file-content-update.ts` | Apply a server-confirmed file content update |
|
|
146
|
+
| `apply-local-content-update.ts` | Apply a local content update and record history |
|
|
147
|
+
| `apply-design-editor-command.ts` | Execute a URL/agent-driven editor command |
|
|
148
|
+
| `persist-tweak-save.ts` | Persist the debounced tweak-selection save |
|
|
149
|
+
|
|
150
|
+
## Export
|
|
151
|
+
|
|
152
|
+
| Module | Does |
|
|
153
|
+
| ----------------------------- | ----------------------------------------- |
|
|
154
|
+
| `render-png-blob.ts` | Rasterize a capture target to a PNG blob |
|
|
155
|
+
| `download-pdf.ts` | Export the active screen as PDF |
|
|
156
|
+
| `download-all-screens-pdf.ts` | Export every screen as a multi-page PDF |
|
|
157
|
+
| `download-svg.ts` | Export the active screen as SVG |
|
|
158
|
+
| `copy-as-figma-svg.ts` | Copy the selection as Figma-pasteable SVG |
|
|
159
|
+
|
|
160
|
+
## Agent handoff
|
|
161
|
+
|
|
162
|
+
| Module | Does |
|
|
163
|
+
| ---------------------------------------------- | ---------------------------------------------------------------- |
|
|
164
|
+
| `send-runtime-layer-semantic-handoff.ts` | Send a runtime layer edit to the agent as a semantic instruction |
|
|
165
|
+
| `send-runtime-layer-move-semantic-handoff.ts` | Same, for a layer move |
|
|
166
|
+
| `send-runtime-layer-state-semantic-handoff.ts` | Same, for a lock/hide state change |
|
|
167
|
+
| `send-overview-annotations.ts` | Submit the overview annotation batch to the agent |
|
|
168
|
+
|
|
169
|
+
## Generation
|
|
170
|
+
|
|
171
|
+
| Module | Does |
|
|
172
|
+
| --------------------------- | ------------------------------------------ |
|
|
173
|
+
| `start-retry-generation.ts` | Retry a failed or stale generation run |
|
|
174
|
+
| `tweak-prompt-submit.ts` | Submit the tweak prompt to the agent |
|
|
175
|
+
| `confirm-make-real.ts` | Confirm the "make this a real app" handoff |
|
|
176
|
+
|
|
177
|
+
## Components
|
|
178
|
+
|
|
179
|
+
| Module | Does |
|
|
180
|
+
| -------------------------------- | --------------------------------------------------- |
|
|
181
|
+
| `detach-instance-menu-action.ts` | Detach a component instance from its main component |
|
|
182
|
+
|
|
183
|
+
## Motion
|
|
184
|
+
|
|
185
|
+
| Module | Does |
|
|
186
|
+
| --------------------------- | ---------------------------------------------------------- |
|
|
187
|
+
| `toggle-motion-keyframe.ts` | Toggle a keyframe at the playhead for the selected element |
|
|
188
|
+
|
|
189
|
+
## Chrome
|
|
190
|
+
|
|
191
|
+
| Module | Does |
|
|
192
|
+
| ------------------------- | ----------------------------------- |
|
|
193
|
+
| `start-sidebar-resize.ts` | Begin a sidebar drag-resize gesture |
|