@aayambansal/squint 0.2.0 → 0.2.2
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 +34 -7
- package/dist/cdp-SFWNP7OA.js +11 -0
- package/dist/{chrome-K4BKFOYS.js → chrome-RD7XQ767.js} +2 -2
- package/dist/{chunk-ZJOU46X4.js → chunk-2IW2MMCY.js} +59 -2
- package/dist/{chunk-4MMIJXYD.js → chunk-73ULM6HF.js} +19 -5
- package/dist/{chunk-7XUORM3K.js → chunk-LCS47EAG.js} +3 -5
- package/dist/{chunk-VJGE7HSP.js → chunk-OC6RU6XH.js} +50 -0
- package/dist/{chunk-FPTBBHOH.js → chunk-OTG4ZB4R.js} +1 -1
- package/dist/{chunk-5IR2AZVK.js → chunk-P3H4N2EN.js} +58 -3
- package/dist/{chunk-Z46MXU64.js → chunk-P3V5CWH5.js} +1 -1
- package/dist/{chunk-W6MYXQIU.js → chunk-VNLM53RJ.js} +60 -10
- package/dist/chunk-XZKQZKEE.js +80 -0
- package/dist/{chunk-WTA6YYBY.js → chunk-YHRAOBI2.js} +17 -0
- package/dist/cli.js +360 -93
- package/dist/{families-RVP5BWQD.js → families-2G5SLLY7.js} +1 -2
- package/dist/{init-7AYGAKOS.js → init-LSYB32NS.js} +1 -1
- package/dist/{preview-LTWJK3LF.js → preview-JJJLDF7H.js} +6 -4
- package/dist/run-XHLCTF6V.js +8 -0
- package/dist/shots-LRYYMTPK.js +12 -0
- package/dist/skills-UGHU22BS.js +15 -0
- package/dist/{snapshot-KKUY5RR6.js → snapshot-H6VYFHLN.js} +3 -1
- package/dist/{source-MEXHWVP4.js → source-ZZU245VN.js} +1 -1
- package/dist/{variants-4NCQXTP7.js → variants-7A7723L7.js} +4 -5
- package/package.json +1 -1
- package/dist/cdp-RTWPFIX5.js +0 -9
- package/dist/chunk-NT2HR4RD.js +0 -63
- package/dist/shots-VJBLDMF3.js +0 -66
- package/dist/{chunk-MCYQXOE7.js → chunk-2LRIKWBU.js} +18 -18
|
@@ -4,18 +4,20 @@ import {
|
|
|
4
4
|
buildReviewPrompt,
|
|
5
5
|
buildRuntimeFixPrompt,
|
|
6
6
|
captureViewports,
|
|
7
|
+
comparePulse,
|
|
7
8
|
previewDir,
|
|
8
9
|
probeRuntime,
|
|
9
10
|
runtimeSummary
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-73ULM6HF.js";
|
|
12
|
+
import "./chunk-OC6RU6XH.js";
|
|
13
|
+
import "./chunk-P3V5CWH5.js";
|
|
14
|
+
import "./chunk-2LRIKWBU.js";
|
|
14
15
|
export {
|
|
15
16
|
VIEWPORTS,
|
|
16
17
|
buildReviewPrompt,
|
|
17
18
|
buildRuntimeFixPrompt,
|
|
18
19
|
captureViewports,
|
|
20
|
+
comparePulse,
|
|
19
21
|
previewDir,
|
|
20
22
|
probeRuntime,
|
|
21
23
|
runtimeSummary
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
screenshotVariants
|
|
4
|
+
} from "./chunk-2IW2MMCY.js";
|
|
5
|
+
import "./chunk-LCS47EAG.js";
|
|
6
|
+
import "./chunk-P3H4N2EN.js";
|
|
7
|
+
import "./chunk-OTG4ZB4R.js";
|
|
8
|
+
import "./chunk-P3V5CWH5.js";
|
|
9
|
+
import "./chunk-2LRIKWBU.js";
|
|
10
|
+
export {
|
|
11
|
+
screenshotVariants
|
|
12
|
+
};
|
|
@@ -9,11 +9,10 @@ import {
|
|
|
9
9
|
runVariants,
|
|
10
10
|
variantPrompt,
|
|
11
11
|
variantsRoot
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-MCYQXOE7.js";
|
|
12
|
+
} from "./chunk-LCS47EAG.js";
|
|
13
|
+
import "./chunk-P3H4N2EN.js";
|
|
14
|
+
import "./chunk-OTG4ZB4R.js";
|
|
15
|
+
import "./chunk-2LRIKWBU.js";
|
|
17
16
|
export {
|
|
18
17
|
MAX_VARIANTS,
|
|
19
18
|
applyVariant,
|
package/package.json
CHANGED
package/dist/cdp-RTWPFIX5.js
DELETED
package/dist/chunk-NT2HR4RD.js
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
// src/prompt/brief.ts
|
|
4
|
-
import fs from "fs";
|
|
5
|
-
import path from "path";
|
|
6
|
-
var DEFAULT_BRIEF = `You are acting as a senior product designer and frontend engineer. Treat every change as production work, not a demo.
|
|
7
|
-
|
|
8
|
-
Direction before code:
|
|
9
|
-
- Commit to one specific visual direction derived from what this product is for, and state it in one sentence before implementing. If the direction could be guessed from the product category alone, sharpen it until it couldn't.
|
|
10
|
-
- Choose a color strategy deliberately: restrained (neutrals + one accent), committed (one dominant color owning 30\u201360% of the surface), or a small palette of 3\u20135 named roles. Never purple/violet gradients unless asked. Body text contrast stays at least 4.5:1 \u2014 no light gray body copy "for elegance".
|
|
11
|
-
- Typography: at most two families, paired on contrast (display serif + geometric sans, or sans + mono). Never Inter/Roboto/Open Sans/system defaults for display type. Pair weight extremes (300 against 700\u2013900); display sizes jump 3x over body, not 1.5x.
|
|
12
|
-
|
|
13
|
-
Tokens are the system:
|
|
14
|
-
- Define or extend design tokens (CSS variables / theme config) first, then compose the UI from them. Never scatter literal colors or one-off spacing values through components.
|
|
15
|
-
- One spacing rhythm on a 4/8px grid; one type scale with a ratio of at least 1.25 between steps.
|
|
16
|
-
|
|
17
|
-
Banned tells \u2014 these read instantly as machine-generated:
|
|
18
|
-
- Purple gradient on white; glassmorphism cards; cream/beige page background as a reflex "warmth" move
|
|
19
|
-
- Emoji as icons; identical icon-topped card grids; stat banner rows; numbered 01/02/03 section markers
|
|
20
|
-
- Tiny all-caps tracked eyebrow labels over every section; gradient text; colored left-border strips on cards
|
|
21
|
-
- Centered hero + badge + three feature cards; unmodified component-library defaults
|
|
22
|
-
If someone could look at the result and say "AI made that" without doubt, it has failed.
|
|
23
|
-
|
|
24
|
-
Craft details:
|
|
25
|
-
- Every interactive element gets hover, focus-visible, and active treatment; keyboard focus stays visible.
|
|
26
|
-
- Anything that loads data gets loading, empty, and error states.
|
|
27
|
-
- Motion: 150\u2013250ms ease-out; one orchestrated entrance with staggered reveals beats scattered micro-interactions; honor prefers-reduced-motion; never leave content invisible until a scroll observer fires.
|
|
28
|
-
- Body line length 65\u201375ch; text-wrap: balance on headings.
|
|
29
|
-
|
|
30
|
-
Engineering:
|
|
31
|
-
- Follow the repo's existing conventions and extend its patterns; new components in new files, small and focused; semantic HTML.
|
|
32
|
-
- Responsive from 360px up with no horizontal overflow \u2014 check intermediate widths, not just phone and desktop.
|
|
33
|
-
- Let errors surface instead of swallowing them in try/catch; log clearly so failures can be traced.
|
|
34
|
-
- Not done until the app builds cleanly, typechecks, and renders without console errors.`;
|
|
35
|
-
var FIRST_TURN_ADDENDUM = `This is the opening move on this task: establish the design foundation before building. State the visual direction, set up the tokens/theme first, then build components from them. The first render should feel like a designed product, not a scaffold \u2014 impressive on sight.`;
|
|
36
|
-
function loadBrief(cwd) {
|
|
37
|
-
const custom = path.join(cwd, ".squint", "brief.md");
|
|
38
|
-
try {
|
|
39
|
-
const text = fs.readFileSync(custom, "utf8").trim();
|
|
40
|
-
if (text.length > 0) return text;
|
|
41
|
-
} catch {
|
|
42
|
-
}
|
|
43
|
-
return DEFAULT_BRIEF;
|
|
44
|
-
}
|
|
45
|
-
function composePrompt(ask, opts) {
|
|
46
|
-
if (opts.noBrief) return ask;
|
|
47
|
-
const brief = loadBrief(opts.cwd);
|
|
48
|
-
const firstTurn = opts.firstTurn ?? true;
|
|
49
|
-
const addendum = firstTurn ? `
|
|
50
|
-
|
|
51
|
-
${FIRST_TURN_ADDENDUM}` : "";
|
|
52
|
-
return `${brief}${addendum}
|
|
53
|
-
|
|
54
|
-
## Task
|
|
55
|
-
|
|
56
|
-
${ask}`;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export {
|
|
60
|
-
DEFAULT_BRIEF,
|
|
61
|
-
FIRST_TURN_ADDENDUM,
|
|
62
|
-
composePrompt
|
|
63
|
-
};
|
package/dist/shots-VJBLDMF3.js
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
variantsRoot
|
|
4
|
-
} from "./chunk-7XUORM3K.js";
|
|
5
|
-
import "./chunk-5IR2AZVK.js";
|
|
6
|
-
import {
|
|
7
|
-
DevServer,
|
|
8
|
-
detectDevCommand
|
|
9
|
-
} from "./chunk-ZJOU46X4.js";
|
|
10
|
-
import "./chunk-FPTBBHOH.js";
|
|
11
|
-
import "./chunk-NT2HR4RD.js";
|
|
12
|
-
import {
|
|
13
|
-
findChrome,
|
|
14
|
-
screenshot
|
|
15
|
-
} from "./chunk-Z46MXU64.js";
|
|
16
|
-
import "./chunk-MCYQXOE7.js";
|
|
17
|
-
|
|
18
|
-
// src/variants/shots.ts
|
|
19
|
-
import path from "path";
|
|
20
|
-
var URL_TIMEOUT_MS = 45e3;
|
|
21
|
-
function waitForUrl(server) {
|
|
22
|
-
return new Promise((resolve) => {
|
|
23
|
-
const startedAt = Date.now();
|
|
24
|
-
const poll = setInterval(() => {
|
|
25
|
-
if (server.url) {
|
|
26
|
-
clearInterval(poll);
|
|
27
|
-
resolve(server.url);
|
|
28
|
-
} else if (Date.now() - startedAt > URL_TIMEOUT_MS || server.state === "crashed") {
|
|
29
|
-
clearInterval(poll);
|
|
30
|
-
resolve(null);
|
|
31
|
-
}
|
|
32
|
-
}, 200);
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
async function screenshotVariants(cwd, variants) {
|
|
36
|
-
const chrome = findChrome();
|
|
37
|
-
if (!chrome) {
|
|
38
|
-
return variants.map((v) => ({ familyId: v.family.id, error: "no Chrome found" }));
|
|
39
|
-
}
|
|
40
|
-
const shots = [];
|
|
41
|
-
for (const variant of variants) {
|
|
42
|
-
const command = detectDevCommand(variant.dir);
|
|
43
|
-
if (!command) {
|
|
44
|
-
shots.push({ familyId: variant.family.id, error: "no dev script" });
|
|
45
|
-
continue;
|
|
46
|
-
}
|
|
47
|
-
const server = new DevServer(variant.dir);
|
|
48
|
-
server.start(command);
|
|
49
|
-
const url = await waitForUrl(server);
|
|
50
|
-
if (!url) {
|
|
51
|
-
server.stop();
|
|
52
|
-
shots.push({ familyId: variant.family.id, error: "dev server did not announce a URL" });
|
|
53
|
-
continue;
|
|
54
|
-
}
|
|
55
|
-
const outPath = path.join(variantsRoot(cwd), `${variant.family.id}.png`);
|
|
56
|
-
const result = await screenshot(chrome, url, outPath, { width: 1440, height: 900 });
|
|
57
|
-
server.stop();
|
|
58
|
-
shots.push(
|
|
59
|
-
result.ok ? { familyId: variant.family.id, path: outPath } : { familyId: variant.family.id, error: result.error }
|
|
60
|
-
);
|
|
61
|
-
}
|
|
62
|
-
return shots;
|
|
63
|
-
}
|
|
64
|
-
export {
|
|
65
|
-
screenshotVariants
|
|
66
|
-
};
|
|
@@ -1,23 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
// src/engines/registry.ts
|
|
4
|
-
import fs from "fs";
|
|
5
|
-
import path from "path";
|
|
6
|
-
|
|
7
|
-
// src/engines/aider.ts
|
|
8
|
-
var aider = {
|
|
9
|
-
id: "aider",
|
|
10
|
-
name: "Aider",
|
|
11
|
-
binary: "aider",
|
|
12
|
-
install: "python -m pip install aider-install && aider-install",
|
|
13
|
-
supportsResume: false,
|
|
14
|
-
buildArgs(opts) {
|
|
15
|
-
const args = ["--message", opts.prompt, "--yes-always", "--no-auto-commits"];
|
|
16
|
-
if (opts.model) args.push("--model", opts.model);
|
|
17
|
-
return args;
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
|
|
21
3
|
// src/util/stream.ts
|
|
22
4
|
function lineSplitter(onLine) {
|
|
23
5
|
let buffer = "";
|
|
@@ -42,6 +24,24 @@ function truncate(text, max) {
|
|
|
42
24
|
return text.slice(0, max - 1) + "\u2026";
|
|
43
25
|
}
|
|
44
26
|
|
|
27
|
+
// src/engines/registry.ts
|
|
28
|
+
import fs from "fs";
|
|
29
|
+
import path from "path";
|
|
30
|
+
|
|
31
|
+
// src/engines/aider.ts
|
|
32
|
+
var aider = {
|
|
33
|
+
id: "aider",
|
|
34
|
+
name: "Aider",
|
|
35
|
+
binary: "aider",
|
|
36
|
+
install: "python -m pip install aider-install && aider-install",
|
|
37
|
+
supportsResume: false,
|
|
38
|
+
buildArgs(opts) {
|
|
39
|
+
const args = ["--message", opts.prompt, "--yes-always", "--no-auto-commits"];
|
|
40
|
+
if (opts.model) args.push("--model", opts.model);
|
|
41
|
+
return args;
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
|
|
45
45
|
// src/engines/claudeProtocol.ts
|
|
46
46
|
function createClaudeStreamParser(readyLabel) {
|
|
47
47
|
let sawTextDelta = false;
|