@dexhq/canvas 0.14.0 → 0.16.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/CHANGELOG.md +70 -0
- package/README.md +5 -3
- package/app/canvas/activity-parts.tsx +50 -6
- package/app/canvas/activity.tsx +10 -18
- package/app/canvas/agent-changes.ts +18 -8
- package/app/canvas/anchoring.ts +15 -7
- package/app/canvas/canvas-context.tsx +6 -2
- package/app/canvas/canvas-input.ts +186 -14
- package/app/canvas/canvas-keys.ts +9 -0
- package/app/canvas/canvas-model.ts +7 -44
- package/app/canvas/canvas-panels.ts +1 -17
- package/app/canvas/canvas-scene.ts +250 -27
- package/app/canvas/canvas-ui.ts +13 -3
- package/app/canvas/canvas.css +147 -29
- package/app/canvas/change-notice.tsx +10 -1
- package/app/canvas/comment-layer.tsx +2 -1
- package/app/canvas/comments.tsx +270 -111
- package/app/canvas/element-link.ts +135 -0
- package/app/canvas/element-picker.ts +223 -27
- package/app/canvas/engine/canvas-gestures.ts +72 -17
- package/app/canvas/engine/canvas-store.ts +17 -1
- package/app/canvas/engine/engine.css +6 -3
- package/app/canvas/export-dialog.tsx +265 -0
- package/app/canvas/find-bar.tsx +817 -0
- package/app/canvas/find-model.ts +135 -0
- package/app/canvas/flow-canvas.tsx +83 -16
- package/app/canvas/follow-pin.ts +26 -6
- package/app/canvas/frame-context-menu.tsx +61 -7
- package/app/canvas/frame-node.tsx +19 -20
- package/app/canvas/imported-reviews.tsx +12 -22
- package/app/canvas/layout.ts +68 -22
- package/app/canvas/linked-element.tsx +196 -0
- package/app/canvas/live-page.ts +156 -19
- package/app/canvas/mentions.tsx +209 -0
- package/app/canvas/page-find.ts +220 -0
- package/app/canvas/page-style.ts +23 -0
- package/app/canvas/picked-box.tsx +21 -0
- package/app/canvas/removed-views-panel.tsx +4 -4
- package/app/canvas/request-node.tsx +151 -0
- package/app/canvas/review-panel.tsx +8 -3
- package/app/canvas/section-node.tsx +6 -133
- package/app/canvas/spec-margin.tsx +4 -1
- package/app/canvas/spec-threads.ts +24 -23
- package/app/canvas/teammates-layer.tsx +205 -0
- package/app/canvas/text-layer.tsx +103 -17
- package/app/canvas/thread-focus.tsx +14 -12
- package/app/canvas/tool-cursors.ts +7 -6
- package/app/canvas/tool-icons.tsx +24 -56
- package/app/canvas/typing.ts +12 -0
- package/app/canvas/use-activity.ts +0 -8
- package/app/canvas/use-agent-changes.tsx +40 -42
- package/app/canvas/use-canvas-clipboard.tsx +11 -14
- package/app/canvas/use-canvas-editor.ts +4 -2
- package/app/canvas/xray.ts +3 -12
- package/app/export/player-model.ts +159 -0
- package/app/export/player.tsx +198 -0
- package/app/export.html +31 -0
- package/app/export.tsx +9 -0
- package/app/frame/announce-refreshes.ts +21 -0
- package/app/frame/start-frame.tsx +50 -0
- package/app/frame/view-loads.ts +161 -0
- package/app/frame/views.ts +13 -49
- package/app/frame.tsx +2 -33
- package/app/i18n/locales/en/messages.po +233 -14
- package/app/i18n/locales/en/messages.ts +1 -1
- package/app/i18n/locales/pseudo/messages.po +232 -13
- package/app/i18n/locales/pseudo/messages.ts +1 -1
- package/app/icons/dex-glyphs.tsx +219 -0
- package/app/icons/glyphs.tsx +80 -80
- package/app/kit/use-flow.ts +2 -1
- package/app/live/canvas-teammates.ts +90 -0
- package/app/live/studio-api.ts +30 -20
- package/app/main.tsx +3 -0
- package/app/pages/canvas.tsx +45 -14
- package/app/pages/commands-settings.tsx +17 -3
- package/app/pages/render.tsx +39 -11
- package/app/shell/bell.tsx +15 -5
- package/app/shell/feedback-form.tsx +10 -21
- package/app/shell/feedback-link.tsx +2 -1
- package/app/shell/presence.tsx +123 -26
- package/app/shell/scaled-frame.tsx +21 -9
- package/app/shell/thread-list.tsx +25 -8
- package/app/shell/working-on.tsx +35 -3
- package/app/types.ts +21 -205
- package/app/ui/file-drop.ts +128 -0
- package/app/ui/prompt-editor.tsx +39 -11
- package/app/ui/reference.tsx +21 -8
- package/app/ui/shadcn/input-group.tsx +2 -2
- package/bin/sudio.mjs +1 -1
- package/dist/cli/banner.d.mts +4 -2
- package/dist/cli/banner.mjs +34 -11
- package/dist/cli/commands/app.mjs +19 -11
- package/dist/cli/commands/create.d.mts +5 -5
- package/dist/cli/commands/create.mjs +4 -4
- package/dist/cli/commands/export.d.mts +40 -0
- package/dist/cli/commands/export.mjs +66 -0
- package/dist/cli/commands/hook.mjs +2 -1
- package/dist/cli/commands/init.d.mts +2 -2
- package/dist/cli/commands/upgrade.mjs +1 -1
- package/dist/cli/help.d.mts +1 -1
- package/dist/cli/help.mjs +13 -7
- package/dist/cli/main.d.mts +42 -5
- package/dist/cli/main.mjs +1 -0
- package/dist/config/load.mjs +14 -2
- package/dist/config/project-files.d.mts +11 -0
- package/dist/config/project-files.mjs +23 -2
- package/dist/config/renamed.d.mts +7 -2
- package/dist/config/renamed.mjs +13 -3
- package/dist/content/capture.d.mts +2 -2
- package/dist/content/capture.mjs +2 -2
- package/dist/content/commands.d.mts +11 -9
- package/dist/content/commands.mjs +22 -16
- package/dist/content/comments-log.mjs +2 -1
- package/dist/content/content.d.mts +13 -143
- package/dist/content/content.mjs +55 -76
- package/dist/content/element-words.d.mts +42 -0
- package/dist/content/element-words.mjs +112 -0
- package/dist/content/flow-specs.mjs +1 -1
- package/dist/content/hosted-person.d.mts +31 -0
- package/dist/content/hosted-person.mjs +68 -0
- package/dist/content/merge-rules.d.mts +5 -0
- package/dist/content/merge-rules.mjs +17 -1
- package/dist/content/prototype-summary.d.mts +3 -39
- package/dist/content/prototype-summary.mjs +2 -3
- package/dist/content/prototypes.mjs +1 -1
- package/dist/content/screenshot.mjs +9 -0
- package/dist/content/text-edit.d.mts +24 -14
- package/dist/content/text-edit.mjs +92 -81
- package/dist/content/text-replace.d.mts +30 -0
- package/dist/content/text-replace.mjs +285 -0
- package/dist/content/thread-module.d.mts +2 -4
- package/dist/content/thread-module.mjs +4 -5
- package/dist/content/threads.mjs +1 -1
- package/dist/paste/paste.mjs +1 -1
- package/dist/paths.d.mts +0 -2
- package/dist/paths.mjs +1 -3
- package/dist/server/agent-env.d.mts +5 -1
- package/dist/server/agent-env.mjs +7 -2
- package/dist/server/agent-session.d.mts +14 -1
- package/dist/server/agent-session.mjs +84 -19
- package/dist/server/agents.d.mts +10 -0
- package/dist/server/agents.mjs +21 -6
- package/dist/server/build-pictures.mjs +1 -1
- package/dist/server/canvas-presence.d.mts +22 -0
- package/dist/server/canvas-presence.mjs +160 -0
- package/dist/server/channel.d.mts +13 -24
- package/dist/server/channel.mjs +55 -37
- package/dist/server/claimed-presence.d.mts +3 -2
- package/dist/server/claimed-presence.mjs +15 -7
- package/dist/server/close-check.mjs +2 -2
- package/dist/server/command-settings.mjs +1 -1
- package/dist/server/comments/actions.d.mts +145 -0
- package/dist/server/comments/actions.mjs +146 -0
- package/dist/server/comments/routes.d.mts +25 -0
- package/dist/server/comments/routes.mjs +67 -0
- package/dist/server/comments/tools.d.mts +6 -0
- package/dist/server/comments/tools.mjs +154 -0
- package/dist/server/dev-server.mjs +59 -23
- package/dist/server/export/build.d.mts +15 -0
- package/dist/server/export/build.mjs +220 -0
- package/dist/server/export/page.d.mts +25 -0
- package/dist/server/export/page.mjs +40 -0
- package/dist/server/export/plugin.d.mts +31 -0
- package/dist/server/export/plugin.mjs +69 -0
- package/dist/server/export/run.d.mts +9 -0
- package/dist/server/export/run.mjs +61 -0
- package/dist/server/export/save.d.mts +7 -0
- package/dist/server/export/save.mjs +29 -0
- package/dist/server/file-lock.d.mts +2 -2
- package/dist/server/file-lock.mjs +130 -36
- package/dist/server/hosted.d.mts +8 -0
- package/dist/server/hosted.mjs +78 -0
- package/dist/server/live-mirror.mjs +66 -10
- package/dist/server/live.mjs +28 -1
- package/dist/server/mcp.d.mts +0 -2
- package/dist/server/mcp.mjs +9 -8
- package/dist/server/me.d.mts +3 -1
- package/dist/server/me.mjs +8 -2
- package/dist/server/notices.d.mts +1 -1
- package/dist/server/notices.mjs +1 -1
- package/dist/server/open-page.d.mts +22 -0
- package/dist/server/open-page.mjs +20 -2
- package/dist/server/outcome.d.mts +22 -0
- package/dist/server/outcome.mjs +8 -0
- package/dist/server/own-copies.mjs +1 -1
- package/dist/server/people.d.mts +8 -3
- package/dist/server/people.mjs +6 -2
- package/dist/server/pictures.d.mts +1 -1
- package/dist/server/pictures.mjs +2 -2
- package/dist/server/port.d.mts +12 -0
- package/dist/server/port.mjs +66 -14
- package/dist/server/prebundle.d.mts +32 -0
- package/dist/server/prebundle.mjs +115 -0
- package/dist/server/presence.d.mts +4 -1
- package/dist/server/presence.mjs +2 -2
- package/dist/server/problems.d.mts +8 -0
- package/dist/server/problems.mjs +13 -0
- package/dist/server/requests.d.mts +5 -1
- package/dist/server/requests.mjs +76 -78
- package/dist/server/source-stamp.d.mts +4 -3
- package/dist/server/source-stamp.mjs +60 -31
- package/dist/server/state.d.mts +19 -10
- package/dist/server/state.mjs +27 -18
- package/dist/server/studio-for.d.mts +5 -0
- package/dist/server/studio-for.mjs +17 -3
- package/dist/server/sync-install.d.mts +8 -12
- package/dist/server/sync-install.mjs +12 -30
- package/dist/server/thread-source.d.mts +8 -0
- package/dist/server/thread-source.mjs +25 -6
- package/dist/server/tools/describe.d.mts +1 -1
- package/dist/server/tools/describe.mjs +1 -1
- package/dist/server/tools/export.d.mts +5 -0
- package/dist/server/tools/export.mjs +35 -0
- package/dist/server/tools/feedback.d.mts +1 -1
- package/dist/server/tools/place-frame.mjs +16 -16
- package/dist/server/tools/reading.mjs +13 -4
- package/dist/server/tools/show.d.mts +1 -1
- package/dist/server/tools/snapshot.d.mts +1 -1
- package/dist/server/tools/thread-list.mjs +2 -2
- package/dist/server/tools/watch.mjs +5 -3
- package/dist/server/vite.d.mts +9 -4
- package/dist/server/vite.mjs +65 -63
- package/dist/server/web-app.mjs +4 -7
- package/dist/server/welcome.mjs +2 -1
- package/dist/server/work-groups.mjs +1 -1
- package/dist/setup/apply.d.mts +4 -0
- package/dist/setup/apply.mjs +5 -4
- package/dist/setup/create.d.mts +4 -2
- package/dist/setup/create.mjs +72 -22
- package/dist/setup/design-system-checks.mjs +3 -17
- package/dist/setup/desktop-app-script.mjs +4 -3
- package/dist/setup/desktop-app-start.d.mts +8 -2
- package/dist/setup/desktop-app-start.mjs +64 -29
- package/dist/setup/desktop-app.d.mts +8 -0
- package/dist/setup/desktop-app.mjs +19 -3
- package/dist/setup/detect/workspace.d.mts +10 -10
- package/dist/setup/detect/workspace.mjs +10 -12
- package/dist/setup/detect.d.mts +0 -2
- package/dist/setup/detect.mjs +1 -3
- package/dist/setup/doctor.d.mts +4 -1
- package/dist/setup/doctor.mjs +8 -6
- package/dist/setup/migrate/dex-folder.d.mts +61 -0
- package/dist/setup/migrate/dex-folder.mjs +544 -0
- package/dist/setup/migrate/files-folder.mjs +1 -1
- package/dist/setup/migrate/guides.mjs +1 -1
- package/dist/setup/migrate/migrations.mjs +4 -0
- package/dist/setup/migrate/row-titles.mjs +1 -1
- package/dist/setup/migrate/setup-files.d.mts +5 -0
- package/dist/setup/migrate/setup-files.mjs +115 -0
- package/dist/setup/migrate/studio-state.d.mts +2 -2
- package/dist/setup/migrate/studio-state.mjs +4 -4
- package/dist/setup/placement.d.mts +1 -1
- package/dist/setup/placement.mjs +5 -4
- package/dist/setup/plan.d.mts +5 -5
- package/dist/setup/plan.mjs +8 -12
- package/dist/setup/project.d.mts +6 -1
- package/dist/setup/project.mjs +10 -10
- package/dist/setup/prompts.d.mts +2 -1
- package/dist/setup/prompts.mjs +4 -3
- package/dist/setup/questions.mjs +3 -2
- package/dist/setup/starters.d.mts +3 -1
- package/dist/setup/starters.mjs +9 -3
- package/dist/setup/write.d.mts +15 -3
- package/dist/setup/write.mjs +23 -3
- package/dist/shared/annotations-core.mjs +1 -1
- package/dist/shared/canvas-core.d.mts +22 -7
- package/dist/shared/canvas-core.mjs +39 -11
- package/dist/shared/canvas-file.d.mts +201 -0
- package/dist/shared/canvas-file.mjs +1 -0
- package/dist/shared/comments/routes.d.mts +55 -0
- package/dist/shared/comments/routes.mjs +39 -0
- package/dist/shared/export-core.d.mts +62 -0
- package/dist/shared/export-core.mjs +101 -0
- package/dist/shared/feedback.d.mts +8 -0
- package/dist/shared/feedback.mjs +10 -2
- package/dist/shared/live-core.d.mts +2 -0
- package/dist/shared/live-core.mjs +6 -1
- package/dist/shared/live-presence.d.mts +57 -2
- package/dist/shared/live-presence.mjs +90 -4
- package/dist/shared/page-messages.d.mts +14 -1
- package/dist/shared/page-messages.mjs +30 -3
- package/dist/shared/page-review.d.mts +2 -11
- package/dist/shared/page-review.mjs +4 -13
- package/dist/shared/people-core.d.mts +28 -0
- package/dist/shared/people-core.mjs +27 -1
- package/dist/shared/presence-core.d.mts +13 -0
- package/dist/shared/presence-core.mjs +11 -2
- package/dist/shared/references-core.d.mts +4 -0
- package/dist/shared/references-core.mjs +12 -4
- package/dist/shared/review-file.d.mts +5 -0
- package/dist/shared/review-file.mjs +23 -13
- package/dist/shared/server-page.mjs +1 -1
- package/dist/shared/signup.d.mts +2 -5
- package/dist/shared/signup.mjs +2 -35
- package/dist/shared/studio-events.d.mts +0 -6
- package/dist/shared/studio-events.mjs +1 -5
- package/dist/shared/studio-files.d.mts +21 -0
- package/dist/shared/studio-files.mjs +16 -2
- package/dist/shared/studio-routes.d.mts +29 -63
- package/dist/shared/studio-routes.mjs +1 -69
- package/dist/shared/threads-core.d.mts +29 -6
- package/dist/shared/threads-core.mjs +68 -13
- package/extension/dist/feedback.js +104 -284
- package/extension/dist/manifest.json +1 -1
- package/extension/dist/picker.js +104 -284
- package/package.json +2 -2
- package/src/cli/banner.ts +45 -11
- package/src/cli/commands/app.ts +23 -8
- package/src/cli/commands/create.ts +4 -4
- package/src/cli/commands/export.ts +78 -0
- package/src/cli/commands/hook.ts +4 -1
- package/src/cli/commands/upgrade.ts +1 -1
- package/src/cli/help.ts +13 -7
- package/src/cli/main.ts +1 -0
- package/src/config/load.ts +26 -2
- package/src/config/project-files.ts +36 -6
- package/src/config/renamed.ts +19 -4
- package/src/content/capture.ts +6 -12
- package/src/content/commands.ts +30 -18
- package/src/content/comments-log.ts +4 -1
- package/src/content/content.ts +71 -257
- package/src/content/element-words.ts +175 -0
- package/src/content/flow-specs.ts +2 -1
- package/src/content/hosted-person.ts +107 -0
- package/src/content/merge-rules.ts +29 -0
- package/src/content/prototype-summary.ts +4 -44
- package/src/content/review-pages.ts +2 -1
- package/src/content/screenshot.ts +14 -0
- package/src/content/text-edit.ts +172 -105
- package/src/content/text-replace.ts +420 -0
- package/src/content/thread-module.ts +2 -4
- package/src/content/trash.ts +1 -1
- package/src/paths.ts +0 -8
- package/src/server/agent-env.ts +12 -2
- package/src/server/agent-session.ts +124 -34
- package/src/server/agents.ts +48 -17
- package/src/server/canvas-presence.ts +237 -0
- package/src/server/channel.ts +95 -53
- package/src/server/claimed-presence.ts +26 -10
- package/src/server/command-settings.ts +1 -1
- package/src/server/comments/actions.ts +333 -0
- package/src/server/comments/routes.ts +131 -0
- package/src/server/comments/tools.ts +317 -0
- package/src/server/dev-server.ts +94 -33
- package/src/server/export/build.ts +310 -0
- package/src/server/export/page.ts +85 -0
- package/src/server/export/plugin.ts +138 -0
- package/src/server/export/run.ts +79 -0
- package/src/server/export/save.ts +38 -0
- package/src/server/file-lock.ts +205 -54
- package/src/server/hosted.ts +113 -0
- package/src/server/live-mirror.ts +93 -8
- package/src/server/live.ts +46 -1
- package/src/server/machine-update.ts +3 -3
- package/src/server/mcp.ts +15 -14
- package/src/server/me.ts +12 -6
- package/src/server/notices.ts +2 -2
- package/src/server/open-page.ts +54 -4
- package/src/server/outcome.ts +26 -0
- package/src/server/people.ts +13 -3
- package/src/server/pictures.ts +2 -2
- package/src/server/port.ts +94 -20
- package/src/server/prebundle.ts +230 -0
- package/src/server/presence.ts +12 -4
- package/src/server/problems.ts +11 -0
- package/src/server/requests.ts +115 -110
- package/src/server/roster.ts +1 -1
- package/src/server/saved.ts +1 -1
- package/src/server/source-stamp.ts +118 -37
- package/src/server/state.ts +53 -31
- package/src/server/studio-for.ts +26 -2
- package/src/server/sync-install.ts +35 -26
- package/src/server/thread-place.ts +2 -4
- package/src/server/thread-source.ts +35 -3
- package/src/server/tools/export.ts +56 -0
- package/src/server/tools/place-frame.ts +23 -15
- package/src/server/tools/reading.ts +16 -3
- package/src/server/tools/thread-list.ts +1 -1
- package/src/server/tools/watch.ts +7 -7
- package/src/server/updates.ts +2 -2
- package/src/server/vite.ts +106 -110
- package/src/server/web-app.ts +11 -9
- package/src/server/welcome.ts +3 -1
- package/src/setup/apply.ts +8 -5
- package/src/setup/create.ts +101 -27
- package/src/setup/design-system-checks.ts +8 -21
- package/src/setup/desktop-app-script.ts +4 -3
- package/src/setup/desktop-app-start.ts +94 -26
- package/src/setup/desktop-app.ts +23 -2
- package/src/setup/detect/workspace.ts +20 -21
- package/src/setup/detect.ts +0 -4
- package/src/setup/doctor.ts +13 -6
- package/src/setup/migrate/dex-folder.ts +842 -0
- package/src/setup/migrate/files-folder.ts +1 -1
- package/src/setup/migrate/guides.ts +3 -1
- package/src/setup/migrate/migrations.ts +8 -2
- package/src/setup/migrate/setup-files.ts +198 -0
- package/src/setup/migrate/studio-state.ts +12 -10
- package/src/setup/own-app.ts +1 -1
- package/src/setup/placement.ts +7 -6
- package/src/setup/plan.ts +13 -18
- package/src/setup/project.ts +11 -10
- package/src/setup/prompts.ts +5 -4
- package/src/setup/questions.ts +6 -3
- package/src/setup/starters.ts +11 -4
- package/src/setup/write.ts +34 -3
- package/src/shared/canvas-core.ts +48 -9
- package/src/shared/canvas-file.ts +205 -0
- package/src/shared/comments/routes.ts +81 -0
- package/src/shared/export-core.ts +198 -0
- package/src/shared/feedback.ts +14 -4
- package/src/shared/live-core.ts +8 -0
- package/src/shared/live-presence.ts +171 -2
- package/src/shared/page-messages.ts +38 -2
- package/src/shared/page-review.ts +11 -16
- package/src/shared/people-core.ts +44 -0
- package/src/shared/presence-core.ts +18 -2
- package/src/shared/references-core.ts +22 -3
- package/src/shared/review-file.ts +28 -12
- package/src/shared/server-page.ts +2 -1
- package/src/shared/signup.ts +4 -28
- package/src/shared/studio-events.ts +0 -13
- package/src/shared/studio-files.ts +29 -1
- package/src/shared/studio-routes.ts +32 -65
- package/src/shared/threads-core.ts +134 -12
- package/templates/methods/explore.md +1 -1
- package/templates/methods/handoff.md +1 -1
- package/templates/methods/review.md +2 -1
- package/templates/rules/canvas-frames.md +6 -3
- package/templates/rules/commands.md +1 -0
- package/templates/rules/prototypes.md +1 -1
- package/templates/rules/studio.md +17 -11
- package/templates/skills/comprehend/SKILL.md +56 -0
- package/templates/skills/distill/SKILL.md +172 -0
- package/templates/skills/export-prototype/SKILL.md +35 -0
- package/templates/skills/riff/SKILL.md +21 -0
- package/templates/skills/riff-deep/SKILL.md +40 -0
- package/templates/skills/riff-max/SKILL.md +46 -0
- package/templates/skills/riff-state/SKILL.md +45 -0
- package/templates/skills/riff-up/SKILL.md +38 -0
- package/templates/skills/riff-wide/SKILL.md +40 -0
- package/templates/starters/standalone/README.md +1 -1
- package/templates/starters/turborepo/README.md +2 -2
- package/templates/starters/turborepo/apps/web/src/app.tsx +2 -2
- package/templates/starters/vite/README.md +1 -1
- package/dist/server/tools/close-reply.d.mts +0 -6
- package/dist/server/tools/close-reply.mjs +0 -138
- package/dist/server/tools/comment.d.mts +0 -6
- package/dist/server/tools/comment.mjs +0 -49
- package/src/server/tools/close-reply.ts +0 -271
- package/src/server/tools/comment.ts +0 -96
|
@@ -11,7 +11,10 @@
|
|
|
11
11
|
// people/<slug>/avatar.png a person's own picture, or avatar.jpg
|
|
12
12
|
// (avatar-file.ts)
|
|
13
13
|
// files/ every file (prototypes-core.ts)
|
|
14
|
-
//
|
|
14
|
+
// skills/ the team's own skills, the / menu's commands
|
|
15
|
+
// (content/commands.ts)
|
|
16
|
+
// .local/ what only this machine has, never committed
|
|
17
|
+
// (server/state.ts)
|
|
15
18
|
//
|
|
16
19
|
// live-core.ts keeps its own list of the files a live workspace shares; see
|
|
17
20
|
// there for why.
|
|
@@ -22,6 +25,29 @@ import {
|
|
|
22
25
|
splitPrototypePath,
|
|
23
26
|
} from "./prototypes-core.ts";
|
|
24
27
|
|
|
28
|
+
export const DISCIPLINES = ["product", "brand", "engineering"] as const;
|
|
29
|
+
export type Discipline = (typeof DISCIPLINES)[number];
|
|
30
|
+
|
|
31
|
+
/** A person who makes prototypes, from contributors.json. */
|
|
32
|
+
export interface Contributor {
|
|
33
|
+
discipline: Discipline;
|
|
34
|
+
/** Git user names that identify this person, so the agent knows who it is working for. */
|
|
35
|
+
git: string[];
|
|
36
|
+
/** Their GitHub username, for their avatar. */
|
|
37
|
+
github?: string;
|
|
38
|
+
name: string;
|
|
39
|
+
slug: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* The Dex folder's name: `dex/` in a project, `apps/web/dex/` in an app of
|
|
44
|
+
* a workspace. An app of its own (`apps/dex`) is its Dex folder.
|
|
45
|
+
*/
|
|
46
|
+
export const DEX_FOLDER = "dex";
|
|
47
|
+
|
|
48
|
+
/** Its name before, `studio/`: `dex upgrade` moves it to DEX_FOLDER. */
|
|
49
|
+
export const OLD_DEX_FOLDER = "studio";
|
|
50
|
+
|
|
25
51
|
/** Where each of the studio's own files is, relative to its content root. */
|
|
26
52
|
export const STUDIO_FILES = {
|
|
27
53
|
/** Who works in the studio, and the git users that are them. */
|
|
@@ -34,6 +60,8 @@ export const STUDIO_FILES = {
|
|
|
34
60
|
context: "context",
|
|
35
61
|
/** Each person's folder: people/<slug>/guidelines.md. */
|
|
36
62
|
people: "people",
|
|
63
|
+
/** The team's own skills: skills/<name>/SKILL.md. */
|
|
64
|
+
skills: "skills",
|
|
37
65
|
} as const;
|
|
38
66
|
|
|
39
67
|
/** A person's own guidelines, for their agents, on top of the workspace's. */
|
|
@@ -6,8 +6,11 @@
|
|
|
6
6
|
// side fails to type-check on the other.
|
|
7
7
|
//
|
|
8
8
|
// Bodies are not declared here, but for git's (StudioBodies): each handler
|
|
9
|
-
// checks the fields it relies on.
|
|
10
|
-
//
|
|
9
|
+
// checks the fields it relies on. A feature with a contract of its own
|
|
10
|
+
// declares its requests there, bodies and all, and its types are taken in
|
|
11
|
+
// here: the comments' (comments/routes.ts). The methods each request takes,
|
|
12
|
+
// as a list that runs, are the server's (testing/route-methods.ts).
|
|
13
|
+
// Types only, with no I/O, so the browser can use it too.
|
|
11
14
|
|
|
12
15
|
import type { Authored } from "./annotations-core.ts";
|
|
13
16
|
import type { AvatarFile } from "./avatar-file.ts";
|
|
@@ -17,6 +20,7 @@ import type {
|
|
|
17
20
|
CommandSwitch,
|
|
18
21
|
CommandsAnswer,
|
|
19
22
|
} from "./commands-core.ts";
|
|
23
|
+
import type { CommentAnswers, CommentBodies } from "./comments/routes.ts";
|
|
20
24
|
import type { Devices } from "./devices.ts";
|
|
21
25
|
import type {
|
|
22
26
|
GitAsk,
|
|
@@ -348,7 +352,7 @@ export type GitStepName = GitStepBody["step"];
|
|
|
348
352
|
* The bodies the contract declares, by request and method; the rest are
|
|
349
353
|
* unknown, checked by their handlers.
|
|
350
354
|
*/
|
|
351
|
-
export interface StudioBodies {
|
|
355
|
+
export interface StudioBodies extends CommentBodies {
|
|
352
356
|
"agent-launch": { POST: { agent: LaunchAgentId } };
|
|
353
357
|
/** An agent's Dex server on an older Dex, by its process. */
|
|
354
358
|
"agent-stop": { POST: { pid: number } };
|
|
@@ -393,7 +397,8 @@ export type StudioBodyOf<
|
|
|
393
397
|
* Each request, by name, and its answer to each method it takes. The query
|
|
394
398
|
* a request needs is in its comment.
|
|
395
399
|
*/
|
|
396
|
-
export interface StudioAnswers<Own extends OwnTypes = OwnTypes>
|
|
400
|
+
export interface StudioAnswers<Own extends OwnTypes = OwnTypes>
|
|
401
|
+
extends CommentAnswers {
|
|
397
402
|
/**
|
|
398
403
|
* Open an agent, or a plain terminal, where agents start: in a terminal
|
|
399
404
|
* window on this Mac (`opened`), else the command to run. Only from this
|
|
@@ -460,6 +465,11 @@ export interface StudioAnswers<Own extends OwnTypes = OwnTypes> {
|
|
|
460
465
|
* JSON: read with an EventSource.
|
|
461
466
|
*/
|
|
462
467
|
events: { GET: unknown };
|
|
468
|
+
/**
|
|
469
|
+
* ?prototype=<name>: its frames as an exported prototype (export-core.ts),
|
|
470
|
+
* a zip (not JSON) named for the file. POST takes an ExportChoice.
|
|
471
|
+
*/
|
|
472
|
+
export: { POST: Blob };
|
|
463
473
|
/**
|
|
464
474
|
* The browser extension, as a zip (not JSON) of the folder Chrome loads
|
|
465
475
|
* unpacked, its files at the root, named EXTENSION_FILE.
|
|
@@ -507,6 +517,11 @@ export interface StudioAnswers<Own extends OwnTypes = OwnTypes> {
|
|
|
507
517
|
* they make something.
|
|
508
518
|
*/
|
|
509
519
|
newcomer: Own["contributor"] | null;
|
|
520
|
+
/**
|
|
521
|
+
* In Dex in the browser, hosted for the workspace: viewers look and
|
|
522
|
+
* comment, and never change the files.
|
|
523
|
+
*/
|
|
524
|
+
viewer?: true;
|
|
510
525
|
};
|
|
511
526
|
};
|
|
512
527
|
/**
|
|
@@ -522,7 +537,7 @@ export interface StudioAnswers<Own extends OwnTypes = OwnTypes> {
|
|
|
522
537
|
saved: { frame: string; name: string }[];
|
|
523
538
|
};
|
|
524
539
|
};
|
|
525
|
-
/** The workspace's contributors, the latest to commit first. */
|
|
540
|
+
/** The workspace's contributors, the latest to commit first; ?commits=0 skips git's log. */
|
|
526
541
|
people: { GET: { people: Person[] } };
|
|
527
542
|
/** A JPEG, or nothing (204) when the frame's stamp has not changed. */
|
|
528
543
|
picture: { POST: Blob };
|
|
@@ -536,6 +551,18 @@ export interface StudioAnswers<Own extends OwnTypes = OwnTypes> {
|
|
|
536
551
|
GET: RemovedViewList;
|
|
537
552
|
POST: { dismissed: string[]; views: string[] };
|
|
538
553
|
};
|
|
554
|
+
/** A find and replace's changes, or what its undo put back. */
|
|
555
|
+
replace: {
|
|
556
|
+
POST:
|
|
557
|
+
| {
|
|
558
|
+
files: string[];
|
|
559
|
+
left?: number;
|
|
560
|
+
replaced: number;
|
|
561
|
+
skipped: number;
|
|
562
|
+
undo?: string;
|
|
563
|
+
}
|
|
564
|
+
| { kept: string[]; restored: string[] };
|
|
565
|
+
};
|
|
539
566
|
/**
|
|
540
567
|
* GET: how a restart goes, from this Dex or, while none answers, its
|
|
541
568
|
* supervisor; POST: the run Dex restarts from.
|
|
@@ -555,8 +582,6 @@ export interface StudioAnswers<Own extends OwnTypes = OwnTypes> {
|
|
|
555
582
|
"spec-suggestion": { POST: ThreadWithPrototype };
|
|
556
583
|
/** The file each changed. */
|
|
557
584
|
text: { POST: { file: string } };
|
|
558
|
-
/** ?slug= for one prototype's, or none for every one's. */
|
|
559
|
-
threads: { GET: ThreadWithPrototype[]; POST: ThreadWithPrototype };
|
|
560
585
|
trash: { DELETE: Done };
|
|
561
586
|
update: {
|
|
562
587
|
/**
|
|
@@ -610,64 +635,6 @@ export type StudioRouteName = keyof StudioAnswers;
|
|
|
610
635
|
export type StudioMethodOf<Name extends StudioRouteName> =
|
|
611
636
|
keyof StudioAnswers[Name] & StudioMethod;
|
|
612
637
|
|
|
613
|
-
/**
|
|
614
|
-
* The requests and the methods each takes, for what has to know them as it
|
|
615
|
-
* runs: the server's test that it serves each one as declared.
|
|
616
|
-
*/
|
|
617
|
-
export const STUDIO_ROUTES = {
|
|
618
|
-
canvas: ["GET", "PUT"],
|
|
619
|
-
annotations: ["GET", "PUT", "DELETE"],
|
|
620
|
-
events: ["GET"],
|
|
621
|
-
"removed-views": ["GET", "POST"],
|
|
622
|
-
reviews: ["POST"],
|
|
623
|
-
trash: ["DELETE"],
|
|
624
|
-
threads: ["GET", "POST"],
|
|
625
|
-
"spec-suggestion": ["POST"],
|
|
626
|
-
instructions: ["GET", "PUT"],
|
|
627
|
-
focus: ["PUT"],
|
|
628
|
-
me: ["GET"],
|
|
629
|
-
people: ["GET"],
|
|
630
|
-
prototypes: ["POST"],
|
|
631
|
-
paste: ["POST"],
|
|
632
|
-
frame: ["POST"],
|
|
633
|
-
show: ["POST"],
|
|
634
|
-
text: ["POST"],
|
|
635
|
-
props: ["POST"],
|
|
636
|
-
insert: ["POST"],
|
|
637
|
-
screenshot: ["POST"],
|
|
638
|
-
snapshot: ["POST"],
|
|
639
|
-
picture: ["POST"],
|
|
640
|
-
agents: ["GET"],
|
|
641
|
-
edited: ["GET"],
|
|
642
|
-
extension: ["GET"],
|
|
643
|
-
"agent-setup": ["GET", "POST"],
|
|
644
|
-
"agent-launch": ["POST"],
|
|
645
|
-
"agent-stop": ["POST"],
|
|
646
|
-
preferences: ["GET", "PUT"],
|
|
647
|
-
watch: ["GET", "POST"],
|
|
648
|
-
welcome: ["GET", "POST"],
|
|
649
|
-
update: ["GET", "POST"],
|
|
650
|
-
"machine-update": ["GET", "POST"],
|
|
651
|
-
"other-dexes": ["GET", "POST"],
|
|
652
|
-
restart: ["GET", "POST"],
|
|
653
|
-
"desktop-app": ["GET", "POST"],
|
|
654
|
-
devices: ["GET", "PUT"],
|
|
655
|
-
git: ["GET", "POST"],
|
|
656
|
-
"git-branches": ["GET"],
|
|
657
|
-
"git-sync": ["POST"],
|
|
658
|
-
"git-pull-base": ["POST"],
|
|
659
|
-
"git-saved": ["GET", "POST"],
|
|
660
|
-
"git-checks": ["POST"],
|
|
661
|
-
"git-settings": ["GET", "PUT"],
|
|
662
|
-
"build-settings": ["GET", "PUT"],
|
|
663
|
-
commands: ["GET", "POST", "PUT", "DELETE"],
|
|
664
|
-
"workspace-settings": ["GET", "PUT"],
|
|
665
|
-
"workspace-icon": ["GET", "PUT", "DELETE"],
|
|
666
|
-
avatar: ["PUT", "DELETE"],
|
|
667
|
-
} as const satisfies {
|
|
668
|
-
[Name in StudioRouteName]: readonly StudioMethodOf<Name>[];
|
|
669
|
-
};
|
|
670
|
-
|
|
671
638
|
/** The web app manifest `dex dev` serves. */
|
|
672
639
|
export const MANIFEST_FILE = "manifest.webmanifest";
|
|
673
640
|
|
|
@@ -20,7 +20,13 @@
|
|
|
20
20
|
// A thread can carry a wireframe (see sketch-core.ts): boxes drawn over a
|
|
21
21
|
// frame, or in an empty cell for a new view, for an agent to build.
|
|
22
22
|
|
|
23
|
-
import {
|
|
23
|
+
import {
|
|
24
|
+
isSpecPath,
|
|
25
|
+
type PageSize,
|
|
26
|
+
requestCell,
|
|
27
|
+
VIEWPORTS,
|
|
28
|
+
type Viewport,
|
|
29
|
+
} from "./canvas-core.ts";
|
|
24
30
|
import { isOneOf, isRecord, isText } from "./checks.ts";
|
|
25
31
|
import { prototypeFiles } from "./prototypes-core.ts";
|
|
26
32
|
import type { Sketch } from "./sketch-core.ts";
|
|
@@ -114,8 +120,8 @@ export type ThreadTarget =
|
|
|
114
120
|
selector?: string;
|
|
115
121
|
/**
|
|
116
122
|
* The start of the element's text, or its label or placeholder when it
|
|
117
|
-
* has none, to help find it in code
|
|
118
|
-
*
|
|
123
|
+
* has none, to help find it in code, and on the page when it moves.
|
|
124
|
+
* Its pin stays in its place when the words change.
|
|
119
125
|
*/
|
|
120
126
|
text?: string;
|
|
121
127
|
/**
|
|
@@ -154,10 +160,20 @@ export type ThreadTarget =
|
|
|
154
160
|
viewport?: Viewport;
|
|
155
161
|
}
|
|
156
162
|
| {
|
|
163
|
+
/**
|
|
164
|
+
* With no row: the row its new row goes right above, as the + on the
|
|
165
|
+
* line between two rows asks. None puts the new row below the others.
|
|
166
|
+
*/
|
|
167
|
+
above?: string;
|
|
157
168
|
kind: "view";
|
|
158
169
|
/** The row to add it to; leave out for a new row (a new iteration). */
|
|
159
170
|
row?: string;
|
|
160
171
|
section: string;
|
|
172
|
+
/**
|
|
173
|
+
* The size its frame takes, set by resizing the request on the canvas.
|
|
174
|
+
* Left out, it takes the size of the frame before it.
|
|
175
|
+
*/
|
|
176
|
+
size?: PageSize;
|
|
161
177
|
step: number;
|
|
162
178
|
}
|
|
163
179
|
| (SpecQuote & {
|
|
@@ -215,6 +231,9 @@ export interface ThreadReaction {
|
|
|
215
231
|
*/
|
|
216
232
|
export type ChangePlace = Extract<ThreadTarget, { kind: "element" | "frame" }>;
|
|
217
233
|
|
|
234
|
+
/** A request for a new view's target: the cell it waits in, and its size. */
|
|
235
|
+
export type ViewTarget = Extract<ThreadTarget, { kind: "view" }>;
|
|
236
|
+
|
|
218
237
|
/** What changed, or why not, when the thread was resolved or dismissed. */
|
|
219
238
|
export interface ThreadResolution {
|
|
220
239
|
agent?: boolean;
|
|
@@ -309,6 +328,11 @@ export interface ThreadChange {
|
|
|
309
328
|
/** The agent session making the change, kept on its reaction. */
|
|
310
329
|
session?: string;
|
|
311
330
|
status?: ThreadStatus;
|
|
331
|
+
/**
|
|
332
|
+
* A request for a new view, moved or resized on the canvas by a person:
|
|
333
|
+
* the cell it now waits in, and the size its frame takes.
|
|
334
|
+
*/
|
|
335
|
+
target?: ThreadTarget;
|
|
312
336
|
via?: string;
|
|
313
337
|
/** Resolving: where the change landed, kept with the note. */
|
|
314
338
|
where?: ChangePlace;
|
|
@@ -316,7 +340,8 @@ export interface ThreadChange {
|
|
|
316
340
|
|
|
317
341
|
/**
|
|
318
342
|
* A person's change to a thread, before the studio adds who they are: a
|
|
319
|
-
* reply, a reaction, who it is for, or
|
|
343
|
+
* reply, a reaction, who it is for, its status, or where a request for a
|
|
344
|
+
* new view waits.
|
|
320
345
|
*/
|
|
321
346
|
export type PersonChange = Pick<
|
|
322
347
|
ThreadChange,
|
|
@@ -329,6 +354,7 @@ export type PersonChange = Pick<
|
|
|
329
354
|
| "react"
|
|
330
355
|
| "remove"
|
|
331
356
|
| "status"
|
|
357
|
+
| "target"
|
|
332
358
|
>;
|
|
333
359
|
|
|
334
360
|
/**
|
|
@@ -420,7 +446,17 @@ const MAX_REACTION = 8;
|
|
|
420
446
|
* for; a longer one is kept, and shortened where it is shown.
|
|
421
447
|
*/
|
|
422
448
|
const MAX_NOTE = 2000;
|
|
423
|
-
|
|
449
|
+
/** The names "@" calls an agent by: no frame goes by one in a comment. */
|
|
450
|
+
export const AGENT_NAMES: readonly string[] = [
|
|
451
|
+
"agent",
|
|
452
|
+
"claude",
|
|
453
|
+
"codex",
|
|
454
|
+
"cursor",
|
|
455
|
+
];
|
|
456
|
+
const MENTION_RE = new RegExp(
|
|
457
|
+
`(?:^|\\s)@(?:${AGENT_NAMES.join("|")})(?![\\w-])`,
|
|
458
|
+
"i"
|
|
459
|
+
);
|
|
424
460
|
/** Why an agent cannot acknowledge a thread another session has claimed. */
|
|
425
461
|
export const CLAIMED_PROBLEM = "Another agent is on this thread.";
|
|
426
462
|
/** Why an agent cannot let go of a thread it does not hold. */
|
|
@@ -710,6 +746,12 @@ export function changeConflicts(
|
|
|
710
746
|
if (change.hidden !== undefined && !thread.review) {
|
|
711
747
|
return [HIDDEN_PROBLEM];
|
|
712
748
|
}
|
|
749
|
+
if (
|
|
750
|
+
change.target !== undefined &&
|
|
751
|
+
(change.agent || thread.target.kind !== "view" || isClosed(thread))
|
|
752
|
+
) {
|
|
753
|
+
return [MOVE_PROBLEM];
|
|
754
|
+
}
|
|
713
755
|
if (!change.agent) {
|
|
714
756
|
return ownMessageProblems(thread, change);
|
|
715
757
|
}
|
|
@@ -770,6 +812,10 @@ export const isOwnMessage = (
|
|
|
770
812
|
const HIDDEN_PROBLEM =
|
|
771
813
|
"Only a review's comments can be hidden from the published site.";
|
|
772
814
|
|
|
815
|
+
/** Only a person moves a request for a new view, and only until it is built. */
|
|
816
|
+
const MOVE_PROBLEM =
|
|
817
|
+
"Only a person moves or resizes a request for a new view, and only while it is still to be built.";
|
|
818
|
+
|
|
773
819
|
const ownMessageProblems = (thread: Thread, change: ThreadChange): string[] => {
|
|
774
820
|
if (!(isText(change.edit) || change.remove)) {
|
|
775
821
|
return [];
|
|
@@ -805,17 +851,52 @@ const changeMessage = (
|
|
|
805
851
|
}
|
|
806
852
|
};
|
|
807
853
|
|
|
854
|
+
/** Whether a value is a size in pixels: a positive width and height. */
|
|
855
|
+
const isSize = (value: unknown): value is PageSize =>
|
|
856
|
+
isRecord(value) &&
|
|
857
|
+
[value.width, value.height].every(
|
|
858
|
+
(side) => typeof side === "number" && Number.isFinite(side) && side > 0
|
|
859
|
+
);
|
|
860
|
+
|
|
861
|
+
/** What a request for a new view, moved or resized, must say. */
|
|
862
|
+
const movedRequestProblems = (target: unknown): string[] => {
|
|
863
|
+
if (!(isRecord(target) && target.kind === "view")) {
|
|
864
|
+
return ["Only a request for a new view moves: give its cell, as a view's."];
|
|
865
|
+
}
|
|
866
|
+
const { above, row, section, size, step } = target;
|
|
867
|
+
return [
|
|
868
|
+
...(isText(section) ? [] : ["A request for a view names its section."]),
|
|
869
|
+
...(row === undefined || isText(row)
|
|
870
|
+
? []
|
|
871
|
+
: ["A request's row is a row's id; leave it out for a new row."]),
|
|
872
|
+
...(above === undefined || isText(above)
|
|
873
|
+
? []
|
|
874
|
+
: ["A new row's `above` is the id of the row it goes above."]),
|
|
875
|
+
...(Number.isInteger(step) && Number(step) >= 1
|
|
876
|
+
? []
|
|
877
|
+
: ["A request for a view needs the step it fills."]),
|
|
878
|
+
...(size === undefined || isSize(size)
|
|
879
|
+
? []
|
|
880
|
+
: ["A request's size is a width and a height in pixels."]),
|
|
881
|
+
];
|
|
882
|
+
};
|
|
883
|
+
|
|
808
884
|
/** Problems with a change to a thread, empty when it is fine. */
|
|
809
885
|
export function changeProblems({
|
|
810
886
|
status,
|
|
811
887
|
for: audience,
|
|
812
888
|
hidden,
|
|
889
|
+
target,
|
|
813
890
|
}: {
|
|
814
891
|
for?: unknown;
|
|
815
892
|
hidden?: unknown;
|
|
816
893
|
status?: unknown;
|
|
894
|
+
target?: unknown;
|
|
817
895
|
}): string[] {
|
|
818
896
|
const problems: string[] = [];
|
|
897
|
+
if (target !== undefined) {
|
|
898
|
+
problems.push(...movedRequestProblems(target));
|
|
899
|
+
}
|
|
819
900
|
if (hidden !== undefined && typeof hidden !== "boolean") {
|
|
820
901
|
problems.push("Hidden is true or false.");
|
|
821
902
|
}
|
|
@@ -846,6 +927,7 @@ export function changeThread<T extends Thread>(
|
|
|
846
927
|
at,
|
|
847
928
|
};
|
|
848
929
|
changeMessage(thread, change, at);
|
|
930
|
+
moveRequest(thread, change.target);
|
|
849
931
|
addReaction(thread, change, who);
|
|
850
932
|
keepResolution(thread, change, who);
|
|
851
933
|
addMessage(thread, change, at);
|
|
@@ -856,6 +938,25 @@ export function changeThread<T extends Thread>(
|
|
|
856
938
|
return thread;
|
|
857
939
|
}
|
|
858
940
|
|
|
941
|
+
/**
|
|
942
|
+
* A request for a new view, moved or resized: the cell it waits in (for a
|
|
943
|
+
* new row, the row it goes above) and the size its frame takes, nothing else.
|
|
944
|
+
*/
|
|
945
|
+
const moveRequest = (thread: Thread, target: ThreadTarget | undefined) => {
|
|
946
|
+
if (target?.kind !== "view" || thread.target.kind !== "view") {
|
|
947
|
+
return;
|
|
948
|
+
}
|
|
949
|
+
const { size } = target;
|
|
950
|
+
thread.target = given({
|
|
951
|
+
kind: "view",
|
|
952
|
+
...requestCell(target),
|
|
953
|
+
size: size && {
|
|
954
|
+
width: Math.round(size.width),
|
|
955
|
+
height: Math.round(size.height),
|
|
956
|
+
},
|
|
957
|
+
});
|
|
958
|
+
};
|
|
959
|
+
|
|
859
960
|
/** Leave an imported review's thread off the published site, or show it. */
|
|
860
961
|
const setHidden = (thread: Thread, hidden: boolean | undefined) => {
|
|
861
962
|
if (hidden === undefined || !thread.review) {
|
|
@@ -1240,6 +1341,28 @@ const frameFile = (
|
|
|
1240
1341
|
const ownCanvas = (files: ReturnType<typeof prototypeFiles>) =>
|
|
1241
1342
|
files && `${files.people}/<you>/canvas.json`;
|
|
1242
1343
|
|
|
1344
|
+
/** Where a request's new row goes, as an agent reads it. */
|
|
1345
|
+
const newRowWhere = (above?: string) =>
|
|
1346
|
+
above
|
|
1347
|
+
? `a new row, right above row "${above}"`
|
|
1348
|
+
: "a new row at the end of the section";
|
|
1349
|
+
|
|
1350
|
+
/**
|
|
1351
|
+
* A request for a new view, as an agent reads it: the cell to put its frame
|
|
1352
|
+
* in, and the size to put it at when the person gave it one.
|
|
1353
|
+
*/
|
|
1354
|
+
const requestWhere = (
|
|
1355
|
+
{ above, row, section, size, step }: ViewTarget,
|
|
1356
|
+
files: ReturnType<typeof prototypeFiles>
|
|
1357
|
+
): Record<string, unknown> => ({
|
|
1358
|
+
what: `A request for a new view. Build it, then add a frame for it in this cell${size ? ", at this size" : ""}: with \`place_frame\` (pass this thread's id) where you have it, otherwise in canvas.json.`,
|
|
1359
|
+
canvas: ownCanvas(files),
|
|
1360
|
+
section,
|
|
1361
|
+
row: row ?? newRowWhere(above),
|
|
1362
|
+
step,
|
|
1363
|
+
...(size ? { size } : {}),
|
|
1364
|
+
});
|
|
1365
|
+
|
|
1243
1366
|
/** Where a thread is, as an agent reads it: what it is on, and its file. */
|
|
1244
1367
|
const whereOf = (
|
|
1245
1368
|
target: ThreadTarget,
|
|
@@ -1301,13 +1424,7 @@ const whereOf = (
|
|
|
1301
1424
|
point: target.point,
|
|
1302
1425
|
};
|
|
1303
1426
|
case "view":
|
|
1304
|
-
return
|
|
1305
|
-
what: "A request for a new view. Build it, then add a frame for it in this cell: with `place_frame` (pass this thread's id) where you have it, otherwise in canvas.json.",
|
|
1306
|
-
canvas: ownCanvas(files),
|
|
1307
|
-
section: target.section,
|
|
1308
|
-
row: target.row ?? "a new row at the end of the section",
|
|
1309
|
-
step: target.step,
|
|
1310
|
-
};
|
|
1427
|
+
return requestWhere(target, files);
|
|
1311
1428
|
default:
|
|
1312
1429
|
return {
|
|
1313
1430
|
what: "A comment on the file as a whole.",
|
|
@@ -1391,6 +1508,11 @@ const publicTarget = (target: ThreadTarget): ThreadTarget => {
|
|
|
1391
1508
|
section: target.section,
|
|
1392
1509
|
step: target.step,
|
|
1393
1510
|
row: target.row,
|
|
1511
|
+
above: target.above,
|
|
1512
|
+
size: target.size && {
|
|
1513
|
+
width: target.size.width,
|
|
1514
|
+
height: target.size.height,
|
|
1515
|
+
},
|
|
1394
1516
|
});
|
|
1395
1517
|
case "spec":
|
|
1396
1518
|
return given({
|
|
@@ -20,7 +20,7 @@ that agent: precise, short, pointing at files.
|
|
|
20
20
|
```md
|
|
21
21
|
# Handoff: <file title>
|
|
22
22
|
|
|
23
|
-
**Build from:** `<
|
|
23
|
+
**Build from:** `<Dex folder>/files/<slug>/people/<person>/views/<view>.tsx`
|
|
24
24
|
**Production target:** <screen, route or starter it changes>
|
|
25
25
|
|
|
26
26
|
## What changes
|
|
@@ -23,7 +23,8 @@ design changes; you never apply one they have not approved.
|
|
|
23
23
|
near that spot.
|
|
24
24
|
- **Requests for new views.** People click a dashed cell on the canvas and
|
|
25
25
|
describe a screen. The thread's target has `kind: "view"` and the cell
|
|
26
|
-
(section, row, step) where it belongs
|
|
26
|
+
(section, row, step) where it belongs; with no row, a new row, right above
|
|
27
|
+
the row `above` names when it has one.
|
|
27
28
|
- **Wireframes.** People draw boxes for a new view, or over a frame to change
|
|
28
29
|
it. The thread has a `wireframe` describing each box; build it from the
|
|
29
30
|
design system (see `rules/canvas-frames.md`).
|
|
@@ -74,9 +74,12 @@ make by drawing on the canvas. `rules/canvas.md` has the grid they sit in.
|
|
|
74
74
|
|
|
75
75
|
People can click a dashed cell and ask for a new view there. That arrives as a
|
|
76
76
|
thread whose target has `kind: "view"`, with its section id (`section`), row (or none,
|
|
77
|
-
for a new row at the end) and step
|
|
78
|
-
|
|
79
|
-
|
|
77
|
+
for a new row: right above the row `above` names, else at the end) and step, and a
|
|
78
|
+
`size` when the person resized it. While it is open, the cell shows the request, and
|
|
79
|
+
people can drag it to another cell or resize it: read the thread again before you
|
|
80
|
+
place the frame. Build the view, add a frame for it to `canvas.json` in exactly that
|
|
81
|
+
cell, at that size when it has one (`place_frame` with the thread's id does both),
|
|
82
|
+
then resolve the thread (see `methods/review.md`).
|
|
80
83
|
|
|
81
84
|
## Wireframes
|
|
82
85
|
|
|
@@ -26,5 +26,6 @@ stops the command and names the nearest one: fix it and run it again.
|
|
|
26
26
|
| `npx dex scope --person <slug>` | Lists changed files outside that contributor's folder and files' shared parts. |
|
|
27
27
|
| `npx dex presence --slug <file> --view <view> --agent "<name>" [--clear]` | Shows the team which view you are editing. Claude Code does this automatically. |
|
|
28
28
|
| `npx dex snapshot --slug <file>` | Snapshots every canvas frame in light and dark, as the `snapshot` tool does; lists errors and overflow. Needs Dex running. `--view <view>` takes only that view's frames: what a sub-agent checks. |
|
|
29
|
+
| `npx dex export --slug <file> [--sections <ids> \| --frames <keys>] [--kind clickable\|pages\|content\|source] [--flows]` | When someone asks to send, share or zip frames as a prototype: a zip in their Downloads that opens by double-click, offline, as the `export` tool makes. Prepare the views first as the `export-prototype` skill says; never write the HTML or a bundler config yourself. |
|
|
29
30
|
| `npx dex dev` | Serves Dex at http://localhost:3008, or the next free port when another checkout's Dex holds it. |
|
|
30
31
|
| `npx dex stop` | Stops this checkout's Dex, and no other. Never stop Dex with `pkill`, `killall` or a `kill` of a pid you found by name: a pattern such as `pkill -f "dex dev"` stops every checkout's Dex on the machine. |
|
|
@@ -164,7 +164,7 @@ person is waiting on the canvas while you check.
|
|
|
164
164
|
and overflow. Fix what you find in place, then look again, until a look
|
|
165
165
|
finds nothing. Then run `npx dex check` and `npx tsc --noEmit` in the
|
|
166
166
|
Dex folder. Without MCP, `npx dex snapshot --slug <slug> --view <view>`
|
|
167
|
-
takes the same snapshots, writes them to `.
|
|
167
|
+
takes the same snapshots, writes them to `.local/snapshots/<slug>/` and
|
|
168
168
|
lists their problems.
|
|
169
169
|
- **Before you say a file is ready for review or handoff.** The full
|
|
170
170
|
pass over every frame, whatever changed: `npx dex snapshot --slug
|
|
@@ -4,7 +4,8 @@ when: A change to Dex itself: its pages, canvas, scripts, rules or methods
|
|
|
4
4
|
|
|
5
5
|
# Working on Dex itself
|
|
6
6
|
|
|
7
|
-
Dex's configuration and shared content
|
|
7
|
+
Dex's configuration and shared content, in the Dex folder (`dex/`, or the
|
|
8
|
+
app of its own in a workspace). If it is not clear whether a
|
|
8
9
|
request is an idea for the product or a change to Dex itself, ask. These
|
|
9
10
|
affect everyone, so they need the normal engineering workflow: a branch,
|
|
10
11
|
a pull request and review.
|
|
@@ -13,13 +14,14 @@ a pull request and review.
|
|
|
13
14
|
|
|
14
15
|
| Path | What it is |
|
|
15
16
|
| -------------------- | -------------------------------------------------------------------------- |
|
|
16
|
-
| `dex.config.ts` | All settings, in one file:
|
|
17
|
+
| `dex.config.ts` | All settings, in one file: where the Dex folder is (`content`), port, build output, Vite plugins, `designSystem` (the components, imports, styles, guide and contributing doc views build with, and the provider that wraps every view) and `ui` (title, subtitle, your own interface components, and `primitives`: your components for Dex's buttons and menus). |
|
|
17
18
|
| `design-system/` | Studios set up before the design system moved into `dex.config.ts`: the adapter (`index.ts`) and styles (`styles.css`). `npx dex upgrade` moves them. |
|
|
18
19
|
| `rules/`, `methods/` | Only when the team has its own: a file here replaces the installed one of the same name. The installed ones come with `@dexhq/canvas`, in its `templates/` folder, where agents read them (the MCP server's `brief` names each); Dex shows them in Settings, under Reference. |
|
|
19
20
|
| `DESIGN.md` | The workspace guidelines for every file, edited under Guidelines, in Dex's sidebar. |
|
|
20
21
|
| `context/` | Team context the critique method reads. |
|
|
21
22
|
| `people/<you>/guidelines.md` | Each person's own guidelines, edited under Your guidelines, in Dex's sidebar. `brief` names them only to that person's agents. Never change someone else's. |
|
|
22
23
|
| `contributors.json` | Who works here, matched to git users. Dex makes it when it first starts. |
|
|
24
|
+
| `skills/` | The team's own skills, the commands its `/` menu offers: `skills/<name>/SKILL.md`. Settings, under Commands, saves them here. |
|
|
23
25
|
| `tsconfig.json` | Extends the project's, so views import as the app does. Never add `paths` here: they replace the project's. |
|
|
24
26
|
| `studio.cloud.json` | The cloud workspace this Dex is linked to (Team plan). No secrets; commit it. |
|
|
25
27
|
|
|
@@ -35,7 +37,7 @@ package, or ask its maintainers.
|
|
|
35
37
|
`DESIGN.md`, `context/*.md` and your `people/<you>/guidelines.md`
|
|
36
38
|
(guidelines), `contributors.json`, new
|
|
37
39
|
files made the same way as `npx dex new`, and a person's own views
|
|
38
|
-
that no canvas shows, moved to `.
|
|
40
|
+
that no canvas shows, moved to `.local/trash/` from the file's archive. All
|
|
39
41
|
other content goes through you.
|
|
40
42
|
- Comments are answered through `npx dex mcp`, which setup registers in
|
|
41
43
|
`.mcp.json` (at the workspace root in a monorepo, where agents start, with
|
|
@@ -46,20 +48,24 @@ package, or ask its maintainers.
|
|
|
46
48
|
hook in `.claude/settings.json` adds what changed in Dex (the
|
|
47
49
|
workspace guidelines, your guidelines, the open file, new feedback) to the next prompt, as the
|
|
48
50
|
Dex's tools do to their results.
|
|
49
|
-
- Presence lives in `.
|
|
51
|
+
- Presence lives in `.local/presence.json`. Claude Code writes it through
|
|
50
52
|
the `dex hook` entries in `.claude/settings.json`; other agents use
|
|
51
53
|
`npx dex presence`. Entries expire after two minutes.
|
|
52
|
-
- `.
|
|
53
|
-
snapshots, the Watch switch, the
|
|
54
|
-
|
|
55
|
-
it; deleting it is safe.
|
|
54
|
+
- `.local/` is Dex's own machine-local state (gitignored, by the project's
|
|
55
|
+
`.gitignore` and its own): presence, snapshots, the Watch switch, the
|
|
56
|
+
open file, connected agents and the trash. Its `README.md` says what each
|
|
57
|
+
file is. Never edit or commit it; deleting it is safe.
|
|
56
58
|
- To update Dex, update `@dexhq/canvas` with the package manager. Rules
|
|
57
59
|
and methods update with it. A Dex set up by an older version
|
|
58
|
-
(
|
|
60
|
+
(its Dex folder is `studio/`, or it has `.studio/`, `.dex/skills/`,
|
|
61
|
+
`design-system/index.ts`, `studio.lock.json`, `.presence.json` or
|
|
59
62
|
`.snapshots/`, or a generated `AGENTS.md`) runs
|
|
60
63
|
`npx dex upgrade` once, after `npx dex upgrade --dry-run` shows the
|
|
61
|
-
person what moves:
|
|
62
|
-
|
|
64
|
+
person what moves: `studio/` to `dex/` (with what names it: the config,
|
|
65
|
+
`.gitignore`, agents' configs), `.studio/` to `.local/`, `.dex/skills/`
|
|
66
|
+
to `skills/` in the Dex folder, the design system into `dex.config.ts`
|
|
67
|
+
and its prose into `DESIGN.md`, presence and snapshots into `.local/`,
|
|
68
|
+
and copied rules,
|
|
63
69
|
the generated `AGENTS.md`, its `CLAUDE.md` line and the old Claude skill
|
|
64
70
|
nobody edited away. Exit code 2 means the
|
|
65
71
|
config must be edited by hand: show the person the printed snippet.
|