foundry-design-protocol 0.2.0-beta.2 → 0.2.0-beta.20
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/README.md +163 -16
- package/dist/index.d.ts +1992 -81
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +357 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,43 +2,153 @@
|
|
|
2
2
|
|
|
3
3
|
Foundry is a local-first precision design workbench for Codex, Cursor, and Claude Code. It lets design engineers manipulate rendered interface elements, resolve each gesture to the right project-native source intent, review one structured change batch, and verify the rebuilt result across recorded states.
|
|
4
4
|
|
|
5
|
+
Responsive Design Lab links one live selection across native mobile, tablet, desktop, current, and custom viewport contexts. It exposes real breakpoint transitions, overflow, clipping, awkward wrapping, and temporary browser zoom, text-scale, and long-content stress tests without changing saved product state.
|
|
6
|
+
|
|
7
|
+
Design Branches keeps parallel visual directions isolated inside one local session. Teams can switch and compare rendered alternatives, combine selected decisions, preserve rejection rationale, and explicitly promote one direction into Review and apply without changing source early.
|
|
8
|
+
|
|
5
9
|
## Beta installation
|
|
6
10
|
|
|
7
|
-
Foundry is distributed through npm, so testers do not need
|
|
11
|
+
Foundry is distributed through npm, so testers do not need GitHub access.
|
|
12
|
+
|
|
13
|
+
> **Current public beta:** `0.2.0-beta.20`. Both npm `latest` and `beta` resolve to this release.
|
|
14
|
+
|
|
15
|
+
Full documentation is available at [withfoundry.ai](https://withfoundry.ai).
|
|
16
|
+
|
|
17
|
+
### Recommended: install once, use in every project
|
|
18
|
+
|
|
19
|
+
Install Foundry's shared connection for Codex, Cursor, and Claude once:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npx foundry-design install
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Restart the selected coding agents once. Then open any project and run:
|
|
26
|
+
|
|
27
|
+
Open a terminal in the project, or ask Codex, Cursor, or Claude Code to run:
|
|
8
28
|
|
|
9
29
|
```bash
|
|
10
|
-
npx foundry-design
|
|
30
|
+
npx foundry-design
|
|
11
31
|
```
|
|
12
32
|
|
|
13
|
-
|
|
33
|
+
That command finds the nearest real project, detects its framework, installs or safely updates only the development adapter and lightweight project connection, validates it, starts the project when needed, and opens the visual session. The agent bridge and skill remain installed once at machine level. Foundry refuses to treat a home folder as a project and prints the exact CLI and MCP bridge versions before changing configuration.
|
|
14
34
|
|
|
15
|
-
|
|
35
|
+
After the restart, reopen the same project folder and ask:
|
|
16
36
|
|
|
17
37
|
```text
|
|
18
|
-
Start Foundry for this project.
|
|
38
|
+
Start Foundry for this project and keep listening for Apply with agent requests.
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
That is the normal workflow. Foundry resumes the most recent session for the current source revision and keeps all review and apply state local.
|
|
42
|
+
|
|
43
|
+
### Manual installation
|
|
44
|
+
|
|
45
|
+
Install the shared connection for selected agents:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
npx foundry-design install --agent codex,cursor,claude
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Connect any project with only its development adapter and local project metadata:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
npx foundry-design connect
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Then restart the coding agent, reopen the same project folder, and ask:
|
|
58
|
+
|
|
59
|
+
```text
|
|
60
|
+
Start Foundry for this project and keep listening for Apply with agent requests.
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
You do not need to run a second terminal command when the agent starts Foundry for you. Apply requests remain queued safely when the agent is offline. After an active agent claims a batch, the MCP bridge keeps that handoff alive through source edits, rebuilding, and verification. A claim abandoned before source work begins returns to the queue. If the agent disappears during source work, Foundry preserves the same run in **Needs attention** and waits for you to choose **Resume with agent**. It never guesses whether a half-finished edit is safe to repeat.
|
|
64
|
+
|
|
65
|
+
Check the complete connection at any time with:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
npx foundry-design status
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Foundry reports project integration, the exact MCP package version, runtime health, and the live agent listener separately. Run `npx foundry-design doctor --repair` if configuration or generated integration needs repair.
|
|
72
|
+
|
|
73
|
+
If an older project has stale or conflicting project-scoped agent configuration, run:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
npx foundry-design reset
|
|
19
77
|
```
|
|
20
78
|
|
|
21
|
-
|
|
79
|
+
Reset migrates Foundry-owned project MCP files and skills to the shared connection, preserves customized files, and reports anything it could not replace safely.
|
|
80
|
+
|
|
81
|
+
Update an existing installation with:
|
|
22
82
|
|
|
23
83
|
```bash
|
|
24
|
-
npx foundry-design
|
|
84
|
+
npx foundry-design update
|
|
25
85
|
```
|
|
26
86
|
|
|
27
|
-
|
|
87
|
+
The updater refreshes checksum-matched project files and the shared machine connection. It removes only Foundry-owned legacy project agent files, preserves customized files, validates the project, and rolls back if Foundry introduces a TypeScript or lint failure. Restart the coding agent only when its shared bridge version changes.
|
|
88
|
+
|
|
89
|
+
Remove a project from Foundry's recent-project list without removing its adapter:
|
|
28
90
|
|
|
29
91
|
```bash
|
|
30
|
-
npx foundry-design
|
|
92
|
+
npx foundry-design disconnect
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Remove only Foundry-managed integration with:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
npx foundry-design uninstall
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Remove the shared machine connection separately:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
npx foundry-design uninstall --global
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Project-scoped MCP configuration remains available only as an explicit compatibility mode:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
npx foundry-design setup --project-agent --agent codex
|
|
31
111
|
```
|
|
32
112
|
|
|
33
113
|
Supported automatic web integration currently includes Next.js App Router, Vite, and plain HTML. Generic web, SwiftUI, and React Native projects receive explicit setup guidance when a safe automatic edit is not available.
|
|
34
114
|
|
|
35
|
-
The
|
|
115
|
+
The npm setup above is the public beta installation path and includes the same portable skill and MCP connection used by the agent plugin bundle.
|
|
116
|
+
|
|
117
|
+
### Agent-native installation
|
|
118
|
+
|
|
119
|
+
The npm installer remains the universal route. Foundry also ships one versioned plugin bundle for Codex, Cursor, and Claude Code, so each host can load the same skill, MCP bridge, and session guidance through its native plugin system.
|
|
120
|
+
|
|
121
|
+
For Claude Code, add the public marketplace and install Foundry once:
|
|
122
|
+
|
|
123
|
+
```text
|
|
124
|
+
/plugin marketplace add seanx24x/foundry-design-control
|
|
125
|
+
/plugin install foundry-design-control@foundry-design-control
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Run `/reload-plugins`, open a project, then run `npx foundry-design` once to connect its development adapter.
|
|
129
|
+
|
|
130
|
+
For Cursor, use the one-click MCP connection below while the complete plugin awaits marketplace review. The repository contains a validated Cursor plugin with the Foundry skill, command, hook, and MCP bridge for local testing and submission.
|
|
131
|
+
|
|
132
|
+
For Codex, the repository contains the Agent Plugin and Codex presentation metadata used for public marketplace submission. Until that listing is available, `npx foundry-design install-agent codex` installs the identical shared skill and bridge without requiring the repository.
|
|
133
|
+
|
|
134
|
+
See [Distribution](DISTRIBUTION.md) for the exact supported route, validation command, and update boundary for every host.
|
|
36
135
|
|
|
37
|
-
|
|
136
|
+
### Claude Desktop extension
|
|
137
|
+
|
|
138
|
+
The repository also produces a validated `.mcpb` extension for Claude Desktop. It bundles the local Foundry MCP bridge and can be installed through **Settings → Extensions → Advanced → Install Extension**. This provides a host-native alternative when a Claude Desktop surface does not merge the normal user-level Claude Code MCP configuration. Project instrumentation is still installed with `npx foundry-design`.
|
|
139
|
+
|
|
140
|
+
If an npm mirror or existing `npx` cache reports an old tag, bypass it with a temporary cache and the exact current release:
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
FOUNDRY_NPX_CACHE="$(mktemp -d)"
|
|
144
|
+
npx --yes --prefer-online --registry=https://registry.npmjs.org --cache "$FOUNDRY_NPX_CACHE" --package=foundry-design@0.2.0-beta.20 foundry-design
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
The beta supports Node.js 20 or newer. Read the [local-first safety model](https://withfoundry.ai/#safety) before using it with sensitive work.
|
|
38
148
|
|
|
39
149
|
## Agent plugin
|
|
40
150
|
|
|
41
|
-
The portable plugin lives at `plugins/foundry-design-control`. The repository also includes marketplace manifests for Codex, Cursor, and Claude-compatible plugin import. Once installed, ask your agent:
|
|
151
|
+
The portable plugin lives at `plugins/foundry-design-control`. The repository also includes marketplace manifests for Codex, Cursor, and Claude-compatible plugin import. Until public marketplace review is complete, `npx foundry-design install` installs the same reusable skill and MCP connection from npm without requiring source-repository access. Once installed, ask your agent:
|
|
42
152
|
|
|
43
153
|
```text
|
|
44
154
|
Start Foundry for this project.
|
|
@@ -46,31 +156,66 @@ Start Foundry for this project.
|
|
|
46
156
|
|
|
47
157
|
Foundry remains local-first. Installing the plugin does not create an account, enable telemetry, or send project data to a Foundry service.
|
|
48
158
|
|
|
159
|
+
### Cursor one-click connection
|
|
160
|
+
|
|
161
|
+
[Add the Foundry MCP bridge to Cursor](cursor://anysphere.cursor-deeplink/mcp/install?name=foundry-design-control&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIi0tcHJlZmVyLW9ubGluZSIsImZvdW5kcnktZGVzaWduLW1jcC1zZXJ2ZXJAMC4yLjAtYmV0YS4xNiJdLCJlbnYiOnsiRk9VTkRSWV9ERVNJR05fUlVOVElNRV9VUkwiOiJodHRwOi8vMTI3LjAuMC4xOjQzODcifX0%3D), then run `npx foundry-design` inside the project. The repository's Cursor plugin additionally bundles the Foundry skill and session-start hook for marketplace distribution.
|
|
162
|
+
|
|
49
163
|
## Current capabilities
|
|
50
164
|
|
|
51
|
-
-
|
|
165
|
+
- A dedicated local design workspace with a live product canvas, equal Layers and Inspector docks, and a direct-overlay fallback when a product blocks framing
|
|
166
|
+
- Measured browser selection with overlap cycling, parent/child traversal, hover previews, and isolated Shadow DOM canvas instrumentation
|
|
52
167
|
- A searchable, collapsible, virtualized live layer hierarchy with mapped-source context, Shadow DOM traversal, drag reordering, and selection persistence across HMR
|
|
53
168
|
- Multi-selection, measured spacing annotations, sibling-aware resize snapping, keyboard nudging, alignment, distribution, and preview undo/redo
|
|
54
169
|
- A revisioned local design graph for CSS tokens, components, Storybook variants, breakpoints, themes, states, and motion presets
|
|
170
|
+
- A Design System workspace that resolves semantic alias chains, surfaces broken and circular references, traces native tokens from definition to indexed usages, groups recurring literals into existing-token-first promotion plans, and sends exact source refactors through Review without changing source automatically
|
|
55
171
|
- Semantic source-mapping choices that block ambiguous changes until the user selects the intended implementation
|
|
56
172
|
- Fixed, hug, fill, and min/max sizing; flex and grid flow; linked spacing; aspect ratio; overflow; and positional controls
|
|
57
|
-
- Project-native spacing, radius, typography, and color choices with token-only filtering, exact token
|
|
173
|
+
- Project-native spacing, radius, typography, and color choices with token-only filtering, exact and nearest-token ranking, component variants, type presets, gradients, opacity, and live contrast guidance
|
|
58
174
|
- Layout, typography, color, content, asset, accessibility, responsive, and motion controls
|
|
59
175
|
- Before/after toggles, continuous comparison scrubbing, side-by-side source comparison, isolation, per-element reset, keyboard shortcuts, and a searchable command palette
|
|
60
176
|
- Design Health scans for contrast, overflow and clipping, touch targets, accessible names, reduced-motion coverage, and project spacing consistency, with evidence, intentional-issue ignores, and safe corrections routed into review
|
|
61
177
|
- An in-app state workbench with real viewport frames, theme switching, forced interaction states, motion controls, and contextual verification
|
|
178
|
+
- A dedicated Motion Studio for live CSS and Web Animation discovery, preview-only transport, timeline scrubbing, keyframe editing, complete timing controls, performance classification, and reduced-motion review
|
|
179
|
+
- Isolated Design Branches with fixed-viewport comparison, selective composition, rejection notes, explicit promotion into the source-ready review ledger, and portable chosen or rejected decision records with source-aware compatibility, import, export, restore, removal, and explicit Design Memory linkage
|
|
62
180
|
- Persistent, coalescing change ledger with JSON and consolidated prompt export
|
|
63
|
-
-
|
|
181
|
+
- Center-workspace review with editable approved batches, grouped targets, and unresolved-target blocking
|
|
64
182
|
- Persistent Apply with agent runs across Codex, Cursor, and Claude Code through MCP
|
|
183
|
+
- Automatically renewed agent handoffs that remain claimed during source inspection and safely return abandoned work to the queue
|
|
184
|
+
- Explicit same-run recovery when an agent disappears during source editing, rebuilding, or verification
|
|
65
185
|
- Live source, rebuild, validation, retry, and rendered-verification progress
|
|
186
|
+
- Rendered verification that resumes after refresh and does not depend on Review remaining open
|
|
66
187
|
- Local MCP bridge for agent access
|
|
67
188
|
- Debug adapters for web, SwiftUI, and React Native on iOS Simulator
|
|
68
189
|
- Verification records that compare requested and rendered values
|
|
190
|
+
- A full-screen Delivery workspace with Handoff, Documentation, and History views
|
|
191
|
+
- Versioned Delivery Records created at the reviewed Apply boundary and promoted to verified only after every rendered check passes
|
|
192
|
+
- Source-backed component, system, and screen documentation with explicit current, stale, and conflicted freshness states
|
|
193
|
+
- Immutable verified design history and milestone grouping that excludes failed, cancelled, and interrupted Apply runs
|
|
194
|
+
- Conflict-safe repository export with Markdown, JSON, a pull-request brief, local evidence manifests, and no overwrite of human-edited generated documentation
|
|
69
195
|
|
|
70
196
|
The review surface explains the blast radius of every proposed change, including component instance count, token versus literal use, responsive and theme scope, and unresolved mapping risk. It never applies a source change merely because a preview override looks correct.
|
|
71
197
|
|
|
72
198
|
Foundry protocol `1.2.0` reads existing `1.0.0` and `1.1.0` sessions with migration defaults. All graph, operation, run, and verification data remains local and is available through `foundry-design export --format full`.
|
|
73
199
|
|
|
200
|
+
### Delivery export
|
|
201
|
+
|
|
202
|
+
Every reviewed Apply batch creates a local Delivery Record. Its deterministic evidence remains read-only while its intent, risks, questions, and engineering summary can be refined. The record moves through `draft`, `ready`, `implementing`, `verified`, and `superseded`; only verified records enter Design History.
|
|
203
|
+
|
|
204
|
+
From the Delivery workspace, **Export** copies the explicit repository command for the selected record:
|
|
205
|
+
|
|
206
|
+
```bash
|
|
207
|
+
npx foundry-design delivery export <DELIVERY_ID> --format repo --output /path/to/project
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
Repository export writes only below `docs/foundry/`: a managed manifest, handoff Markdown and JSON, a pull-request brief, component and feature documentation, internal history, milestones, and a local evidence manifest. Foundry never replaces the project root `CHANGELOG.md`. If a previously generated file was edited outside Foundry, export stops before writing anything and reports the conflict.
|
|
211
|
+
|
|
212
|
+
Portable single-record exports are also available:
|
|
213
|
+
|
|
214
|
+
```bash
|
|
215
|
+
npx foundry-design delivery export <DELIVERY_ID> --format markdown --output handoff.md
|
|
216
|
+
npx foundry-design delivery export <DELIVERY_ID> --format json --output handoff.json
|
|
217
|
+
```
|
|
218
|
+
|
|
74
219
|
## Local development
|
|
75
220
|
|
|
76
221
|
```bash
|
|
@@ -79,6 +224,8 @@ pnpm check
|
|
|
79
224
|
pnpm release:check
|
|
80
225
|
pnpm release:pack
|
|
81
226
|
pnpm release:test-install
|
|
227
|
+
pnpm test:e2e
|
|
228
|
+
pnpm mcpb:build
|
|
82
229
|
pnpm build
|
|
83
230
|
pnpm foundry setup --project /path/to/project --agent codex --local-mcp
|
|
84
231
|
pnpm foundry index --project /path/to/project --output /tmp/foundry-design-graph.json
|
|
@@ -96,7 +243,7 @@ The runtime binds to `127.0.0.1:4387`. Inspector preview changes remain temporar
|
|
|
96
243
|
- `packages/react-native-adapter`: React Native debug bridge
|
|
97
244
|
- `packages/mcp-server`: agent tools backed by the runtime
|
|
98
245
|
- `packages/swiftui-adapter`: Swift package for inspectable SwiftUI views
|
|
99
|
-
- `apps/inspector`:
|
|
246
|
+
- `apps/inspector`: authenticated local design workspace, canvas shell, and review surface
|
|
100
247
|
- `examples/web-fixture`: end-to-end browser fixture
|
|
101
248
|
|
|
102
249
|
## Safety model
|