foundry-design 0.2.0-beta.1
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/LICENSE +21 -0
- package/README.md +98 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +449 -0
- package/dist/index.js.map +1 -0
- package/dist/indexer.d.ts +4 -0
- package/dist/indexer.d.ts.map +1 -0
- package/dist/indexer.js +200 -0
- package/dist/indexer.js.map +1 -0
- package/dist/installer.d.ts +72 -0
- package/dist/installer.d.ts.map +1 -0
- package/dist/installer.js +458 -0
- package/dist/installer.js.map +1 -0
- package/dist/project.d.ts +4 -0
- package/dist/project.d.ts.map +1 -0
- package/dist/project.js +37 -0
- package/dist/project.js.map +1 -0
- package/package.json +46 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Sean Lynch
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# Foundry Design Control
|
|
2
|
+
|
|
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
|
+
|
|
5
|
+
## Beta installation
|
|
6
|
+
|
|
7
|
+
Foundry `0.2.0-beta.1` is the first shareable beta. From the project you want to inspect, run:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx foundry-design@beta setup
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Setup detects the platform, framework, package manager, development command, and installed coding agents. It previews every file it will manage, adds development-only instrumentation for supported web frameworks, configures the selected MCP clients, and records a reversible install manifest.
|
|
14
|
+
|
|
15
|
+
Then start a session with:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npx foundry-design@beta start
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Foundry reuses an available project server or starts the detected development command, launches the loopback runtime, and opens an authenticated visual preview. Remove only Foundry-managed integration with:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npx foundry-design@beta uninstall
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
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.
|
|
28
|
+
|
|
29
|
+
Codex, Cursor, and Claude Code users can alternatively install the bundled plugin from this repository. The plugin contains the Foundry skill and MCP server definition, so project setup uses `--agent none` and does not create duplicate MCP configuration.
|
|
30
|
+
|
|
31
|
+
The beta supports Node.js 20 or newer. Read [Privacy](PRIVACY.md), [Security](SECURITY.md), and the [beta changelog](CHANGELOG.md) before using it with sensitive work.
|
|
32
|
+
|
|
33
|
+
## Agent plugin
|
|
34
|
+
|
|
35
|
+
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:
|
|
36
|
+
|
|
37
|
+
```text
|
|
38
|
+
Start Foundry for this project.
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Foundry remains local-first. Installing the plugin does not create an account, enable telemetry, or send project data to a Foundry service.
|
|
42
|
+
|
|
43
|
+
## Current capabilities
|
|
44
|
+
|
|
45
|
+
- Measured browser selection with overlap cycling, parent/child traversal, hover previews, and an isolated Shadow DOM inspector
|
|
46
|
+
- A searchable, collapsible, virtualized live layer hierarchy with mapped-source context, Shadow DOM traversal, drag reordering, and selection persistence across HMR
|
|
47
|
+
- Multi-selection, measured spacing annotations, sibling-aware resize snapping, keyboard nudging, alignment, distribution, and preview undo/redo
|
|
48
|
+
- A revisioned local design graph for CSS tokens, components, Storybook variants, breakpoints, themes, states, and motion presets
|
|
49
|
+
- Semantic source-mapping choices that block ambiguous changes until the user selects the intended implementation
|
|
50
|
+
- Fixed, hug, fill, and min/max sizing; flex and grid flow; linked spacing; aspect ratio; overflow; and positional controls
|
|
51
|
+
- Project-native spacing, radius, typography, and color choices with token-only filtering, exact token suggestions, component variants, type presets, gradients, opacity, and live contrast guidance
|
|
52
|
+
- Layout, typography, color, content, asset, accessibility, responsive, and motion controls
|
|
53
|
+
- Before/after toggles, continuous comparison scrubbing, side-by-side source comparison, isolation, per-element reset, keyboard shortcuts, and a searchable command palette
|
|
54
|
+
- 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
|
|
55
|
+
- An in-app state workbench with real viewport frames, theme switching, forced interaction states, motion controls, and contextual verification
|
|
56
|
+
- Persistent, coalescing change ledger with JSON and consolidated prompt export
|
|
57
|
+
- Compact in-preview review with editable approved batches and unresolved-target blocking
|
|
58
|
+
- Persistent Apply with agent runs across Codex, Cursor, and Claude Code through MCP
|
|
59
|
+
- Live source, rebuild, validation, retry, and rendered-verification progress
|
|
60
|
+
- Local MCP bridge for agent access
|
|
61
|
+
- Debug adapters for web, SwiftUI, and React Native on iOS Simulator
|
|
62
|
+
- Verification records that compare requested and rendered values
|
|
63
|
+
|
|
64
|
+
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.
|
|
65
|
+
|
|
66
|
+
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`.
|
|
67
|
+
|
|
68
|
+
## Local development
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
pnpm install
|
|
72
|
+
pnpm check
|
|
73
|
+
pnpm release:check
|
|
74
|
+
pnpm release:pack
|
|
75
|
+
pnpm release:test-install
|
|
76
|
+
pnpm build
|
|
77
|
+
pnpm foundry setup --project /path/to/project --agent codex --local-mcp
|
|
78
|
+
pnpm foundry index --project /path/to/project --output /tmp/foundry-design-graph.json
|
|
79
|
+
pnpm foundry start --project /path/to/project
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
The runtime binds to `127.0.0.1:4387`. Inspector preview changes remain temporary. Setup edits only the development integration and coding-agent configuration it shows before confirmation.
|
|
83
|
+
|
|
84
|
+
## Repository layout
|
|
85
|
+
|
|
86
|
+
- `packages/protocol`: versioned schemas and ledger rules
|
|
87
|
+
- `packages/runtime`: localhost session service and persistence
|
|
88
|
+
- `packages/cli`: project detection, initialization, launch, export, and doctor commands
|
|
89
|
+
- `packages/web-adapter`: injected browser inspector
|
|
90
|
+
- `packages/react-native-adapter`: React Native debug bridge
|
|
91
|
+
- `packages/mcp-server`: agent tools backed by the runtime
|
|
92
|
+
- `packages/swiftui-adapter`: Swift package for inspectable SwiftUI views
|
|
93
|
+
- `apps/inspector`: session dashboard and review surface
|
|
94
|
+
- `examples/web-fixture`: end-to-end browser fixture
|
|
95
|
+
|
|
96
|
+
## Safety model
|
|
97
|
+
|
|
98
|
+
Foundry stores sessions locally under the operating system application-support directory, binds only to loopback, and requires a per-session token. Preview overrides are temporary. The coding agent must propose a normal source diff and run project validation before a change can be marked applied.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,449 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { spawn } from 'node:child_process';
|
|
3
|
+
import { createHash } from 'node:crypto';
|
|
4
|
+
import { appendFile, mkdir, readFile, writeFile } from 'node:fs/promises';
|
|
5
|
+
import { basename, dirname, join, resolve } from 'node:path';
|
|
6
|
+
import { createInterface } from 'node:readline/promises';
|
|
7
|
+
import { fileURLToPath } from 'node:url';
|
|
8
|
+
import { renderChangePrompt } from 'foundry-design-protocol';
|
|
9
|
+
import { FoundryRuntime, SessionStore } from 'foundry-design-runtime';
|
|
10
|
+
import { createSetupPlan, setupProject, uninstallProject, } from './installer.js';
|
|
11
|
+
import { addSessionParams, detectPlatform } from './project.js';
|
|
12
|
+
import { indexProjectDesign } from './indexer.js';
|
|
13
|
+
const args = process.argv.slice(2);
|
|
14
|
+
const command = args[0] ?? 'help';
|
|
15
|
+
const runtimeRepository = resolve(fileURLToPath(new URL('../../../', import.meta.url)));
|
|
16
|
+
function flag(name) {
|
|
17
|
+
const index = args.indexOf(name);
|
|
18
|
+
return index >= 0 ? args[index + 1] : undefined;
|
|
19
|
+
}
|
|
20
|
+
function has(name) {
|
|
21
|
+
return args.includes(name);
|
|
22
|
+
}
|
|
23
|
+
function projectRoot() {
|
|
24
|
+
return resolve(process.env.INIT_CWD ?? process.cwd(), flag('--project') ?? '.');
|
|
25
|
+
}
|
|
26
|
+
function printHelp() {
|
|
27
|
+
console.log(`Foundry Design Control
|
|
28
|
+
|
|
29
|
+
Usage:
|
|
30
|
+
foundry-design setup [--project PATH] [--agent codex,cursor,claude] [--url URL] [--yes]
|
|
31
|
+
foundry-design init <web|swiftui|react-native> [--project PATH]
|
|
32
|
+
foundry-design start [--project PATH] [--url URL] [--platform PLATFORM] [--no-open] [--no-dev]
|
|
33
|
+
foundry-design doctor [--project PATH]
|
|
34
|
+
foundry-design index [--project PATH] [--output FILE]
|
|
35
|
+
foundry-design uninstall [--project PATH] [--yes]
|
|
36
|
+
foundry-design export <SESSION_ID> [--format json|prompt|full] [--output FILE]
|
|
37
|
+
foundry-design install-agent <cursor|claude|codex> [--project PATH]
|
|
38
|
+
|
|
39
|
+
Foundry is local-only and never edits product source from inspector controls.`);
|
|
40
|
+
}
|
|
41
|
+
async function gitOutput(root, gitArgs) {
|
|
42
|
+
return new Promise((resolveRevision) => {
|
|
43
|
+
const child = spawn('git', gitArgs, {
|
|
44
|
+
cwd: root,
|
|
45
|
+
stdio: ['ignore', 'pipe', 'ignore'],
|
|
46
|
+
});
|
|
47
|
+
let output = '';
|
|
48
|
+
child.stdout.on('data', (chunk) => {
|
|
49
|
+
output += String(chunk);
|
|
50
|
+
});
|
|
51
|
+
child.on('close', (code) => resolveRevision(code === 0 ? output.trim() : undefined));
|
|
52
|
+
child.on('error', () => resolveRevision(undefined));
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
async function revision(root) {
|
|
56
|
+
const head = await gitOutput(root, ['rev-parse', 'HEAD']);
|
|
57
|
+
if (!head)
|
|
58
|
+
return undefined;
|
|
59
|
+
const diff = (await gitOutput(root, ['diff', '--no-ext-diff', '--binary', 'HEAD'])) ?? '';
|
|
60
|
+
const untracked = (await gitOutput(root, ['ls-files', '--others', '--exclude-standard']))
|
|
61
|
+
?.split('\n')
|
|
62
|
+
.filter(Boolean)
|
|
63
|
+
.sort() ?? [];
|
|
64
|
+
if (!diff && !untracked.length)
|
|
65
|
+
return head;
|
|
66
|
+
const hash = createHash('sha256').update(diff);
|
|
67
|
+
for (const file of untracked) {
|
|
68
|
+
hash.update(file);
|
|
69
|
+
hash.update(await readFile(join(root, file)).catch(() => Buffer.from('unreadable')));
|
|
70
|
+
}
|
|
71
|
+
return `${head}-dirty-${hash.digest('hex').slice(0, 12)}`;
|
|
72
|
+
}
|
|
73
|
+
async function openUrl(url) {
|
|
74
|
+
const executable = process.platform === 'darwin' ? 'open' : process.platform === 'win32' ? 'cmd' : 'xdg-open';
|
|
75
|
+
const childArgs = process.platform === 'win32' ? ['/c', 'start', '', url] : [url];
|
|
76
|
+
const child = spawn(executable, childArgs, { detached: true, stdio: 'ignore' });
|
|
77
|
+
child.unref();
|
|
78
|
+
}
|
|
79
|
+
async function urlAvailable(url) {
|
|
80
|
+
return fetch(url)
|
|
81
|
+
.then(() => true)
|
|
82
|
+
.catch(() => false);
|
|
83
|
+
}
|
|
84
|
+
async function confirm(message) {
|
|
85
|
+
if (has('--yes') || !process.stdin.isTTY)
|
|
86
|
+
return true;
|
|
87
|
+
const prompt = createInterface({ input: process.stdin, output: process.stdout });
|
|
88
|
+
try {
|
|
89
|
+
const answer = (await prompt.question(`${message} (Y/n) `)).trim().toLowerCase();
|
|
90
|
+
return answer === '' || answer === 'y' || answer === 'yes';
|
|
91
|
+
}
|
|
92
|
+
finally {
|
|
93
|
+
prompt.close();
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
function requestedAgents() {
|
|
97
|
+
const value = flag('--agent');
|
|
98
|
+
if (!value)
|
|
99
|
+
return undefined;
|
|
100
|
+
if (value === 'none')
|
|
101
|
+
return [];
|
|
102
|
+
const agents = value.split(',').filter(Boolean);
|
|
103
|
+
const invalid = agents.filter((agent) => !['codex', 'cursor', 'claude'].includes(agent));
|
|
104
|
+
if (invalid.length)
|
|
105
|
+
throw new Error(`Unsupported agent: ${invalid.join(', ')}`);
|
|
106
|
+
return [...new Set(agents)];
|
|
107
|
+
}
|
|
108
|
+
async function setup() {
|
|
109
|
+
const root = projectRoot();
|
|
110
|
+
const options = {
|
|
111
|
+
agents: requestedAgents(),
|
|
112
|
+
targetUrl: flag('--url'),
|
|
113
|
+
packageRoot: has('--local-mcp') ? runtimeRepository : undefined,
|
|
114
|
+
};
|
|
115
|
+
const plan = await createSetupPlan(root, options);
|
|
116
|
+
console.log(`Foundry setup\n\nProject: ${root}\nPlatform: ${plan.platform}`);
|
|
117
|
+
if (plan.framework)
|
|
118
|
+
console.log(`Framework: ${plan.framework}`);
|
|
119
|
+
console.log(`Agent integration: ${plan.agents.length ? plan.agents.join(', ') : 'plugin-provided'}`);
|
|
120
|
+
console.log('\nFiles Foundry will manage:');
|
|
121
|
+
for (const path of plan.files)
|
|
122
|
+
console.log(` ${path}`);
|
|
123
|
+
if (!plan.integrationFile && plan.platform === 'web') {
|
|
124
|
+
console.log('\nNo supported web entry was found. Foundry will create its adapter but leave integration pending.');
|
|
125
|
+
}
|
|
126
|
+
if (!(await confirm('\nContinue with this setup?'))) {
|
|
127
|
+
console.log('Setup cancelled.');
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
const result = await setupProject(root, options);
|
|
131
|
+
console.log(`\n✓ Foundry configured ${result.changed.length} files.`);
|
|
132
|
+
if (result.targetUrl)
|
|
133
|
+
console.log(`✓ Preview URL: ${result.targetUrl}`);
|
|
134
|
+
if (result.devCommand)
|
|
135
|
+
console.log(`✓ Development command: ${result.devCommand.command} ${result.devCommand.args.join(' ')}`);
|
|
136
|
+
console.log('\nNext: foundry-design start');
|
|
137
|
+
}
|
|
138
|
+
async function initProject() {
|
|
139
|
+
const platform = (args[1] ?? 'web');
|
|
140
|
+
if (!['web', 'swiftui', 'react-native'].includes(platform))
|
|
141
|
+
throw new Error(`Unsupported platform: ${platform}`);
|
|
142
|
+
const root = projectRoot();
|
|
143
|
+
const configRoot = join(root, '.foundry');
|
|
144
|
+
await mkdir(configRoot, { recursive: true });
|
|
145
|
+
await writeFile(join(configRoot, 'foundry.config.json'), `${JSON.stringify({
|
|
146
|
+
version: 2,
|
|
147
|
+
platform,
|
|
148
|
+
runtimeUrl: 'http://127.0.0.1:4387',
|
|
149
|
+
instrumented: true,
|
|
150
|
+
design: {
|
|
151
|
+
componentRoots: ['src', 'app', 'components'],
|
|
152
|
+
exclude: ['node_modules', 'dist', 'build', '.next', 'coverage'],
|
|
153
|
+
viewports: [
|
|
154
|
+
{ id: 'mobile', label: 'Mobile', width: 390, height: 844 },
|
|
155
|
+
{ id: 'tablet', label: 'Tablet', width: 768, height: 1024 },
|
|
156
|
+
{ id: 'desktop', label: 'Desktop', width: 1440, height: 900 },
|
|
157
|
+
],
|
|
158
|
+
},
|
|
159
|
+
}, null, 2)}\n`);
|
|
160
|
+
if (platform === 'web') {
|
|
161
|
+
await writeFile(join(configRoot, 'web-adapter.ts'), `/** Load only in a development browser entry. */\nexport async function installFoundryDesignControl(): Promise<void> {\n if (typeof window === 'undefined' || process.env.NODE_ENV === 'production') return;\n const query = new URLSearchParams(window.location.search);\n if (!query.has('__foundry_session')) return;\n const module = await import(/* @vite-ignore */ 'http://127.0.0.1:4387/adapter.js');\n module.installFoundryInspector();\n}\n`);
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
await writeFile(join(configRoot, `${platform}-setup.md`), platform === 'swiftui'
|
|
165
|
+
? '# SwiftUI setup\n\nAdd the local `packages/swiftui-adapter` package in DEBUG builds. Apply `.foundryInspectable(id:label:controls:)` to meaningful view boundaries.\n'
|
|
166
|
+
: '# React Native setup\n\nImport `createFoundryNativeAdapter` from the local React Native adapter in development builds and register meaningful view measurements.\n');
|
|
167
|
+
}
|
|
168
|
+
const gitignore = join(root, '.gitignore');
|
|
169
|
+
let ignores = '';
|
|
170
|
+
try {
|
|
171
|
+
ignores = await readFile(gitignore, 'utf8');
|
|
172
|
+
}
|
|
173
|
+
catch {
|
|
174
|
+
/* Create it below. */
|
|
175
|
+
}
|
|
176
|
+
if (!ignores.includes('.foundry/sessions/'))
|
|
177
|
+
await appendFile(gitignore, `${ignores.endsWith('\n') || !ignores ? '' : '\n'}.foundry/sessions/\n`);
|
|
178
|
+
console.log(`Initialized ${platform} instrumentation at ${configRoot}`);
|
|
179
|
+
if (platform === 'web')
|
|
180
|
+
console.log('Import and call .foundry/web-adapter.ts once from your development-only client entry.');
|
|
181
|
+
}
|
|
182
|
+
async function start() {
|
|
183
|
+
const root = projectRoot();
|
|
184
|
+
let config;
|
|
185
|
+
try {
|
|
186
|
+
config = JSON.parse(await readFile(join(root, '.foundry', 'foundry.config.json'), 'utf8'));
|
|
187
|
+
}
|
|
188
|
+
catch {
|
|
189
|
+
/* The explicit flags remain available for unconfigured projects. */
|
|
190
|
+
}
|
|
191
|
+
const platform = flag('--platform') ??
|
|
192
|
+
config?.platform ??
|
|
193
|
+
(await detectPlatform(root));
|
|
194
|
+
const targetUrl = flag('--url') ?? config?.targetUrl;
|
|
195
|
+
if (platform === 'web' && config && !config.instrumented) {
|
|
196
|
+
throw new Error('Foundry setup is incomplete. Connect .foundry/web-adapter.ts to a development-only client entry, then set instrumented to true.');
|
|
197
|
+
}
|
|
198
|
+
let developmentServer;
|
|
199
|
+
if (platform === 'web' &&
|
|
200
|
+
targetUrl &&
|
|
201
|
+
config?.devCommand &&
|
|
202
|
+
!has('--no-dev') &&
|
|
203
|
+
!(await urlAvailable(targetUrl))) {
|
|
204
|
+
console.log(`Starting development server: ${config.devCommand.command} ${config.devCommand.args.join(' ')}`);
|
|
205
|
+
developmentServer = spawn(config.devCommand.command, config.devCommand.args, {
|
|
206
|
+
cwd: root,
|
|
207
|
+
stdio: 'inherit',
|
|
208
|
+
});
|
|
209
|
+
const deadline = Date.now() + 45_000;
|
|
210
|
+
while (Date.now() < deadline) {
|
|
211
|
+
if (await urlAvailable(targetUrl))
|
|
212
|
+
break;
|
|
213
|
+
if (developmentServer.exitCode != null)
|
|
214
|
+
throw new Error(`Development server exited with code ${developmentServer.exitCode}`);
|
|
215
|
+
await new Promise((resolveWait) => setTimeout(resolveWait, 250));
|
|
216
|
+
}
|
|
217
|
+
if (!(await urlAvailable(targetUrl))) {
|
|
218
|
+
developmentServer.kill('SIGTERM');
|
|
219
|
+
throw new Error(`Development server did not become ready at ${targetUrl}`);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
const projectRevision = await revision(root);
|
|
223
|
+
const context = {
|
|
224
|
+
projectRoot: root,
|
|
225
|
+
revision: projectRevision,
|
|
226
|
+
platform,
|
|
227
|
+
targetUrl,
|
|
228
|
+
targetName: basename(root),
|
|
229
|
+
theme: 'system',
|
|
230
|
+
breakpoint: 'current',
|
|
231
|
+
state: 'current',
|
|
232
|
+
};
|
|
233
|
+
const store = new SessionStore();
|
|
234
|
+
const session = await store.create(context);
|
|
235
|
+
if (platform === 'web') {
|
|
236
|
+
const graph = await indexProjectDesign(root, config, projectRevision);
|
|
237
|
+
await store.setDesignGraph(session.changeSet.sessionId, graph);
|
|
238
|
+
console.log(`Indexed ${graph.tokens.length} tokens, ${graph.components.length} components, and ${graph.breakpoints.length} viewports.`);
|
|
239
|
+
}
|
|
240
|
+
const runtime = new FoundryRuntime({ store });
|
|
241
|
+
try {
|
|
242
|
+
await runtime.start();
|
|
243
|
+
}
|
|
244
|
+
catch (error) {
|
|
245
|
+
if (error.code !== 'EADDRINUSE')
|
|
246
|
+
throw error;
|
|
247
|
+
developmentServer?.kill('SIGTERM');
|
|
248
|
+
console.error('Port 4387 is already in use. Stop the existing Foundry runtime before starting another session.');
|
|
249
|
+
process.exitCode = 1;
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
const reviewUrl = `http://127.0.0.1:4387/?session=${encodeURIComponent(session.changeSet.sessionId)}&token=${encodeURIComponent(session.token)}`;
|
|
253
|
+
const productUrl = targetUrl && platform === 'web'
|
|
254
|
+
? addSessionParams(targetUrl, session.changeSet.sessionId, session.token)
|
|
255
|
+
: reviewUrl;
|
|
256
|
+
console.log(`Foundry session ${session.changeSet.sessionId}`);
|
|
257
|
+
console.log(`Platform: ${platform}`);
|
|
258
|
+
console.log(`Inspector: ${reviewUrl}`);
|
|
259
|
+
if (targetUrl && platform === 'web')
|
|
260
|
+
console.log(`Instrumented preview: ${productUrl}`);
|
|
261
|
+
if (platform === 'web') {
|
|
262
|
+
console.log('\nFirst edit:');
|
|
263
|
+
console.log(' 1. Option-click an element. Shift-click to add more.');
|
|
264
|
+
console.log(' 2. Drag a blue handle or use the inspector for exact values.');
|
|
265
|
+
console.log(' 3. Review the semantic mapping, then Apply with agent.');
|
|
266
|
+
}
|
|
267
|
+
if (!has('--no-open'))
|
|
268
|
+
await openUrl(productUrl);
|
|
269
|
+
const shutdown = async () => {
|
|
270
|
+
await runtime.stop();
|
|
271
|
+
developmentServer?.kill('SIGTERM');
|
|
272
|
+
process.exit(0);
|
|
273
|
+
};
|
|
274
|
+
process.on('SIGINT', () => void shutdown());
|
|
275
|
+
process.on('SIGTERM', () => void shutdown());
|
|
276
|
+
await new Promise(() => { });
|
|
277
|
+
}
|
|
278
|
+
async function indexDesign() {
|
|
279
|
+
const root = projectRoot();
|
|
280
|
+
const config = await readFile(join(root, '.foundry', 'foundry.config.json'), 'utf8')
|
|
281
|
+
.then((content) => JSON.parse(content))
|
|
282
|
+
.catch(() => undefined);
|
|
283
|
+
const graph = await indexProjectDesign(root, config, await revision(root));
|
|
284
|
+
const content = `${JSON.stringify(graph, null, 2)}\n`;
|
|
285
|
+
const output = flag('--output');
|
|
286
|
+
if (output) {
|
|
287
|
+
await writeFile(resolve(output), content);
|
|
288
|
+
console.log(`Wrote Foundry design graph to ${resolve(output)}`);
|
|
289
|
+
}
|
|
290
|
+
else
|
|
291
|
+
console.log(content);
|
|
292
|
+
}
|
|
293
|
+
async function uninstall() {
|
|
294
|
+
const root = projectRoot();
|
|
295
|
+
if (!(await confirm(`Remove Foundry-managed project integration from ${root}?`))) {
|
|
296
|
+
console.log('Uninstall cancelled.');
|
|
297
|
+
return;
|
|
298
|
+
}
|
|
299
|
+
const result = await uninstallProject(root);
|
|
300
|
+
console.log(`Removed Foundry integration from ${root}.`);
|
|
301
|
+
if (result.preserved.length) {
|
|
302
|
+
console.log('Preserved files with user changes:');
|
|
303
|
+
for (const path of result.preserved)
|
|
304
|
+
console.log(` ${path}`);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
async function doctor() {
|
|
308
|
+
const root = projectRoot();
|
|
309
|
+
const platform = await detectPlatform(root);
|
|
310
|
+
const configPath = join(root, '.foundry', 'foundry.config.json');
|
|
311
|
+
let config;
|
|
312
|
+
try {
|
|
313
|
+
config = JSON.parse(await readFile(configPath, 'utf8'));
|
|
314
|
+
}
|
|
315
|
+
catch {
|
|
316
|
+
/* Report setup as missing below. */
|
|
317
|
+
}
|
|
318
|
+
const agentFiles = [
|
|
319
|
+
join(root, '.codex', 'config.toml'),
|
|
320
|
+
join(root, '.cursor', 'mcp.json'),
|
|
321
|
+
join(root, '.mcp.json'),
|
|
322
|
+
];
|
|
323
|
+
const configuredAgents = [];
|
|
324
|
+
for (const path of agentFiles) {
|
|
325
|
+
if ((await readFile(path, 'utf8').catch(() => '')).includes('foundry-design-control'))
|
|
326
|
+
configuredAgents.push(path);
|
|
327
|
+
}
|
|
328
|
+
const pluginProvided = await readFile(join(root, '.foundry', 'install-manifest.json'), 'utf8')
|
|
329
|
+
.then((content) => {
|
|
330
|
+
const manifest = JSON.parse(content);
|
|
331
|
+
return Array.isArray(manifest.agents) && manifest.agents.length === 0;
|
|
332
|
+
})
|
|
333
|
+
.catch(() => false);
|
|
334
|
+
const checks = [
|
|
335
|
+
['Project', root, true],
|
|
336
|
+
['Detected platform', platform, true],
|
|
337
|
+
['Foundry config', configPath, Boolean(config)],
|
|
338
|
+
[
|
|
339
|
+
'Instrumentation',
|
|
340
|
+
config?.instrumented ? `${config.framework ?? config.platform}` : 'integration pending',
|
|
341
|
+
Boolean(config?.instrumented),
|
|
342
|
+
],
|
|
343
|
+
[
|
|
344
|
+
'Agent connection',
|
|
345
|
+
configuredAgents.length
|
|
346
|
+
? configuredAgents.join(', ')
|
|
347
|
+
: pluginProvided
|
|
348
|
+
? 'plugin-provided'
|
|
349
|
+
: 'not configured',
|
|
350
|
+
configuredAgents.length > 0 || pluginProvided,
|
|
351
|
+
],
|
|
352
|
+
[
|
|
353
|
+
'Project preview',
|
|
354
|
+
config?.targetUrl ?? 'not configured',
|
|
355
|
+
config?.targetUrl ? await urlAvailable(config.targetUrl) : platform !== 'web',
|
|
356
|
+
],
|
|
357
|
+
[
|
|
358
|
+
'Runtime health',
|
|
359
|
+
'http://127.0.0.1:4387/v1/health',
|
|
360
|
+
await fetch('http://127.0.0.1:4387/v1/health')
|
|
361
|
+
.then((response) => response.ok)
|
|
362
|
+
.catch(() => false),
|
|
363
|
+
],
|
|
364
|
+
];
|
|
365
|
+
for (const [label, value, passed] of checks)
|
|
366
|
+
console.log(`${passed ? '✓' : '○'} ${label}: ${value}`);
|
|
367
|
+
if (!config)
|
|
368
|
+
console.log('Run: foundry-design setup');
|
|
369
|
+
}
|
|
370
|
+
async function exportSession() {
|
|
371
|
+
const id = args[1];
|
|
372
|
+
if (!id)
|
|
373
|
+
throw new Error('export requires a session id');
|
|
374
|
+
const format = flag('--format') ?? 'json';
|
|
375
|
+
const session = await new SessionStore().read(id);
|
|
376
|
+
const content = format === 'prompt'
|
|
377
|
+
? renderChangePrompt(session.changeSet)
|
|
378
|
+
: JSON.stringify(format === 'full'
|
|
379
|
+
? {
|
|
380
|
+
changeSet: session.changeSet,
|
|
381
|
+
verifications: session.verifications,
|
|
382
|
+
applyRuns: session.applyRuns,
|
|
383
|
+
designGraph: session.designGraph,
|
|
384
|
+
}
|
|
385
|
+
: session.changeSet, null, 2);
|
|
386
|
+
const output = flag('--output');
|
|
387
|
+
if (output) {
|
|
388
|
+
await writeFile(resolve(output), `${content}\n`);
|
|
389
|
+
console.log(`Exported ${format} to ${resolve(output)}`);
|
|
390
|
+
}
|
|
391
|
+
else
|
|
392
|
+
console.log(content);
|
|
393
|
+
}
|
|
394
|
+
async function installAgent() {
|
|
395
|
+
const agent = args[1];
|
|
396
|
+
if (!agent || !['cursor', 'claude', 'codex'].includes(agent))
|
|
397
|
+
throw new Error('install-agent requires cursor, claude, or codex');
|
|
398
|
+
const root = projectRoot();
|
|
399
|
+
const server = {
|
|
400
|
+
command: 'pnpm',
|
|
401
|
+
args: ['--dir', runtimeRepository, '--filter', 'foundry-design-mcp-server', 'start'],
|
|
402
|
+
env: { FOUNDRY_DESIGN_RUNTIME_URL: 'http://127.0.0.1:4387' },
|
|
403
|
+
};
|
|
404
|
+
if (agent === 'codex') {
|
|
405
|
+
const directory = join(root, '.codex');
|
|
406
|
+
await mkdir(directory, { recursive: true });
|
|
407
|
+
const file = join(directory, 'foundry-mcp.toml');
|
|
408
|
+
await writeFile(file, `# Merge this project-scoped server into your Codex MCP configuration.\n[mcp_servers.foundry-design-control]\ncommand = "pnpm"\nargs = ["--dir", "${runtimeRepository}", "--filter", "foundry-design-mcp-server", "start"]\n[mcp_servers.foundry-design-control.env]\nFOUNDRY_DESIGN_RUNTIME_URL = "http://127.0.0.1:4387"\n`);
|
|
409
|
+
console.log(`Wrote Codex MCP snippet: ${file}`);
|
|
410
|
+
return;
|
|
411
|
+
}
|
|
412
|
+
const file = agent === 'cursor' ? join(root, '.cursor', 'mcp.json') : join(root, '.mcp.json');
|
|
413
|
+
await mkdir(dirname(file), { recursive: true });
|
|
414
|
+
let current = {};
|
|
415
|
+
try {
|
|
416
|
+
current = JSON.parse(await readFile(file, 'utf8'));
|
|
417
|
+
}
|
|
418
|
+
catch {
|
|
419
|
+
/* Create a new project config. */
|
|
420
|
+
}
|
|
421
|
+
current.mcpServers = { ...current.mcpServers, 'foundry-design-control': server };
|
|
422
|
+
await writeFile(file, `${JSON.stringify(current, null, 2)}\n`);
|
|
423
|
+
console.log(`Installed Foundry MCP configuration for ${agent}: ${file}`);
|
|
424
|
+
}
|
|
425
|
+
try {
|
|
426
|
+
if (command === 'setup')
|
|
427
|
+
await setup();
|
|
428
|
+
else if (command === 'init')
|
|
429
|
+
await initProject();
|
|
430
|
+
else if (command === 'start')
|
|
431
|
+
await start();
|
|
432
|
+
else if (command === 'doctor')
|
|
433
|
+
await doctor();
|
|
434
|
+
else if (command === 'index')
|
|
435
|
+
await indexDesign();
|
|
436
|
+
else if (command === 'uninstall')
|
|
437
|
+
await uninstall();
|
|
438
|
+
else if (command === 'export')
|
|
439
|
+
await exportSession();
|
|
440
|
+
else if (command === 'install-agent')
|
|
441
|
+
await installAgent();
|
|
442
|
+
else
|
|
443
|
+
printHelp();
|
|
444
|
+
}
|
|
445
|
+
catch (error) {
|
|
446
|
+
console.error(error instanceof Error ? error.message : error);
|
|
447
|
+
process.exitCode = 1;
|
|
448
|
+
}
|
|
449
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAsC,MAAM,yBAAyB,CAAC;AACjG,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,EACL,eAAe,EACf,YAAY,EACZ,gBAAgB,GAGjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AA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AAG,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;IAC/D,OAAO,CAAC,GAAG,CAAC,2CAA2C,KAAK,KAAK,IAAI,EAAE,CAAC,CAAC;AAC3E,CAAC;AAED,IAAI,CAAC;IACH,IAAI,OAAO,KAAK,OAAO;QAAE,MAAM,KAAK,EAAE,CAAC;SAClC,IAAI,OAAO,KAAK,MAAM;QAAE,MAAM,WAAW,EAAE,CAAC;SAC5C,IAAI,OAAO,KAAK,OAAO;QAAE,MAAM,KAAK,EAAE,CAAC;SACvC,IAAI,OAAO,KAAK,QAAQ;QAAE,MAAM,MAAM,EAAE,CAAC;SACzC,IAAI,OAAO,KAAK,OAAO;QAAE,MAAM,WAAW,EAAE,CAAC;SAC7C,IAAI,OAAO,KAAK,WAAW;QAAE,MAAM,SAAS,EAAE,CAAC;SAC/C,IAAI,OAAO,KAAK,QAAQ;QAAE,MAAM,aAAa,EAAE,CAAC;SAChD,IAAI,OAAO,KAAK,eAAe;QAAE,MAAM,YAAY,EAAE,CAAC;;QACtD,SAAS,EAAE,CAAC;AACnB,CAAC;AAAC,OAAO,KAAK,EAAE,CAAC;IACf,OAAO,CAAC,KAAK,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IAC9D,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;AACvB,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type ProjectDesignGraph } from 'foundry-design-protocol';
|
|
2
|
+
import type { FoundryProjectConfig } from './installer.js';
|
|
3
|
+
export declare function indexProjectDesign(root: string, config: FoundryProjectConfig | undefined, revision?: string): Promise<ProjectDesignGraph>;
|
|
4
|
+
//# sourceMappingURL=indexer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"indexer.d.ts","sourceRoot":"","sources":["../src/indexer.ts"],"names":[],"mappings":"AAGA,OAAO,EAML,KAAK,kBAAkB,EACxB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AA+D3D,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,oBAAoB,GAAG,SAAS,EACxC,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,kBAAkB,CAAC,CAyI7B"}
|