@pro-vi/designer 0.3.5 → 0.3.6
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/dist/cli.js +27 -8
- package/dist/setup.js +2 -2
- package/dist/ui-anchors.js +10 -4
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -542,18 +542,37 @@ async function checkOnDesignSurface() {
|
|
|
542
542
|
const port = process.env.DESIGNER_CDP || '9222';
|
|
543
543
|
try {
|
|
544
544
|
const res = await fetch(`http://127.0.0.1:${port}/json/list`);
|
|
545
|
-
if (!res.ok)
|
|
546
|
-
return {
|
|
545
|
+
if (!res.ok) {
|
|
546
|
+
return {
|
|
547
|
+
name: 'claude.ai/design tab',
|
|
548
|
+
status: 'fail',
|
|
549
|
+
detail: `CDP HTTP ${res.status} — debug Chrome may have died. Run \`designer setup\` to relaunch it.`
|
|
550
|
+
};
|
|
551
|
+
}
|
|
547
552
|
const tabs = await res.json();
|
|
548
553
|
const onDesign = tabs.find((t) => t.url && /claude\.ai\/design/.test(t.url));
|
|
549
|
-
if (!onDesign)
|
|
550
|
-
return {
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
+
if (!onDesign) {
|
|
555
|
+
return {
|
|
556
|
+
name: 'claude.ai/design tab',
|
|
557
|
+
status: 'warn',
|
|
558
|
+
detail: 'no tab on claude.ai/design in the debug Chrome window. Open https://claude.ai/design THERE (not in your normal Chrome — they are separate profiles with separate cookies).'
|
|
559
|
+
};
|
|
560
|
+
}
|
|
561
|
+
if (/login|sign in/i.test(onDesign.title || '')) {
|
|
562
|
+
return {
|
|
563
|
+
name: 'signed in to claude.ai/design',
|
|
564
|
+
status: 'fail',
|
|
565
|
+
detail: 'on a login page. Sign in INSIDE the debug Chrome window (not your normal Chrome — that profile is signed in but its cookies are not shared).'
|
|
566
|
+
};
|
|
567
|
+
}
|
|
568
|
+
return { name: 'signed in to claude.ai/design', status: 'ok', detail: onDesign.url };
|
|
554
569
|
}
|
|
555
570
|
catch {
|
|
556
|
-
return {
|
|
571
|
+
return {
|
|
572
|
+
name: 'claude.ai/design tab',
|
|
573
|
+
status: 'fail',
|
|
574
|
+
detail: 'debug Chrome unreachable. Run `designer setup` to launch it.'
|
|
575
|
+
};
|
|
557
576
|
}
|
|
558
577
|
}
|
|
559
578
|
function checkSelectors() {
|
package/dist/setup.js
CHANGED
|
@@ -169,11 +169,11 @@ async function step4SignIn(port) {
|
|
|
169
169
|
log('login', 'ok', `Signed in. Tab on ${tab.url.replace(/\?.*$/, '')}`);
|
|
170
170
|
return true;
|
|
171
171
|
}
|
|
172
|
-
log('login', 'wait', 'Sign in to Claude in the
|
|
172
|
+
log('login', 'wait', 'Sign in to Claude in the DEBUG Chrome window I just opened (it is a separate window with no extensions/bookmarks — NOT your normal Chrome; the two have separate cookie jars). Then navigate to claude.ai/design. I am polling.');
|
|
173
173
|
const ok = await pollUntil('login', async () => (await getDesignTab(port)) !== null, {
|
|
174
174
|
intervalMs: 2000,
|
|
175
175
|
timeoutMs: 10 * 60_000,
|
|
176
|
-
reminder: 'Still waiting for a tab on claude.ai/design (not
|
|
176
|
+
reminder: 'Still waiting for a tab on claude.ai/design in the debug window (signing into your normal Chrome will not help — different profile).',
|
|
177
177
|
hint60s: "If Chrome shows a Google 'new device' or 2FA prompt, complete that first — setup is waiting on you."
|
|
178
178
|
});
|
|
179
179
|
if (!ok) {
|
package/dist/ui-anchors.js
CHANGED
|
@@ -77,7 +77,11 @@ export const UI_ANCHORS = [
|
|
|
77
77
|
category: 'session',
|
|
78
78
|
description: 'html-viewer-iframe (design preview)',
|
|
79
79
|
requires: 'session',
|
|
80
|
-
check: async (b) =>
|
|
80
|
+
check: async (b, url) => {
|
|
81
|
+
if (!/[?&]file=/.test(url))
|
|
82
|
+
return { ok: true, detail: '(no file open — iframe not expected)' };
|
|
83
|
+
return { ok: await hasSelector(b, '[data-testid="html-viewer-iframe"]') };
|
|
84
|
+
}
|
|
81
85
|
},
|
|
82
86
|
{
|
|
83
87
|
id: 'session.chatMessages',
|
|
@@ -91,10 +95,12 @@ export const UI_ANCHORS = [
|
|
|
91
95
|
category: 'pattern',
|
|
92
96
|
description: 'iframe src is claudeusercontent.com with signed ?t= token',
|
|
93
97
|
requires: 'session',
|
|
94
|
-
check: async (b) => {
|
|
98
|
+
check: async (b, url) => {
|
|
99
|
+
if (!/[?&]file=/.test(url))
|
|
100
|
+
return { ok: true, detail: '(no file open — iframe not expected)' };
|
|
95
101
|
const src = await b.evalValue(`(() => { const el = document.querySelector('[data-testid="html-viewer-iframe"]'); return (el && el.src) || ''; })()`).catch(() => '');
|
|
96
102
|
if (!src)
|
|
97
|
-
return { ok: false, detail: '
|
|
103
|
+
return { ok: false, detail: 'file param present but iframe missing src' };
|
|
98
104
|
const ok = /claudeusercontent\.com/.test(src) && /[?&]t=/.test(src);
|
|
99
105
|
return { ok, detail: ok ? undefined : `src=${src.slice(0, 120)}...` };
|
|
100
106
|
}
|
|
@@ -182,7 +188,7 @@ export const UI_ANCHORS = [
|
|
|
182
188
|
}
|
|
183
189
|
const match = url.match(/[?&]file=([^&]+)/);
|
|
184
190
|
if (match && match[1]) {
|
|
185
|
-
const activeFile = decodeURIComponent(match[1]);
|
|
191
|
+
const activeFile = decodeURIComponent(match[1].replace(/\+/g, ' '));
|
|
186
192
|
if (!files.includes(activeFile)) {
|
|
187
193
|
return {
|
|
188
194
|
ok: false,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pro-vi/designer",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "MCP + CLI for autonomous iteration of claude.ai/design — drives the design surface via agent-browser, downloads handoff bundles, and exposes a tasting harness for full-viewport variant comparison.",
|
|
6
6
|
"license": "MIT",
|