synthesisui 0.16.513 → 0.16.514
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/commands/hook.js +22 -0
- package/dist/generated-tells.js +122 -0
- package/dist/install-marks.js +6 -1
- package/package.json +1 -1
package/dist/commands/hook.js
CHANGED
|
@@ -17,6 +17,8 @@ import { readMode } from "../mode.js";
|
|
|
17
17
|
import { namesRemoved, previousText, rulesTouchedBy, } from "../rule-touched.js";
|
|
18
18
|
import { loadSystem } from "./doctor.js";
|
|
19
19
|
import { takeGrowthNote } from "../what-grew.js";
|
|
20
|
+
import { readProjectConfig } from "../config.js";
|
|
21
|
+
import { generatedTells, tellsText } from "../generated-tells.js";
|
|
20
22
|
const pass = () => ({ continue: true });
|
|
21
23
|
const speak = (context) => ({
|
|
22
24
|
continue: true,
|
|
@@ -765,6 +767,26 @@ async function endOfTurn(root, input) {
|
|
|
765
767
|
? await checkChanged(root, changed, mode, "turn")
|
|
766
768
|
: { said: [] };
|
|
767
769
|
/** O que o sync destacado do turno anterior mandou para o rascunho - dito uma vez (re-rodada, 28/09). */
|
|
770
|
+
/**
|
|
771
|
+
* OS SINAIS DE PÁGINA FEITA POR IA (jornada "as camadas de design com fonte", E04, 24/10): só os que as fontes
|
|
772
|
+
* concordam, cada um com a fonte e o que fazer no lugar - ver `generated-tells.ts`. Um sistema que veio do código dela
|
|
773
|
+
* (o `intent` do config) não ouve: o hábito do código dela vence a regra de fora.
|
|
774
|
+
*/
|
|
775
|
+
const imported = Boolean((await readProjectConfig(root).catch(() => null))?.intent);
|
|
776
|
+
if (!imported && changed.length > 0) {
|
|
777
|
+
const found = [];
|
|
778
|
+
for (const { rel } of changed.filter((c) => SCREEN.test(c.rel)).slice(0, REFUSAL_CEILING)) {
|
|
779
|
+
const src = await readFile(join(root, rel), "utf8").catch(() => null);
|
|
780
|
+
if (src == null)
|
|
781
|
+
continue;
|
|
782
|
+
const tells = generatedTells(src);
|
|
783
|
+
if (tells.length > 0)
|
|
784
|
+
found.push({ rel, tells });
|
|
785
|
+
}
|
|
786
|
+
const text = tellsText(found);
|
|
787
|
+
if (text)
|
|
788
|
+
said.push(text);
|
|
789
|
+
}
|
|
768
790
|
const grown = await takeGrowthNote(root).catch(() => null);
|
|
769
791
|
if (grown)
|
|
770
792
|
said.push(grown);
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OS SINAIS DE PÁGINA FEITA POR IA - jornada "as camadas de design com fonte", E04 (24/10). Desenho aprovado em 16/10
|
|
3
|
+
* (o aviso do fim do turno, v4 de https://claude.ai/artifact/KLxJLPXaZokMjgQKBkcGtf).
|
|
4
|
+
*
|
|
5
|
+
* São só os sinais em que as fontes CONCORDAM, cada um com a fonte e o commit lidos - os mesmos do registro do site
|
|
6
|
+
* (`apps/web/src/lib/design-layers/registry.ts`) - e o que fazer no lugar. A checagem lê o código que o turno escreveu,
|
|
7
|
+
* não a tela: o que ela não consegue ler com segurança no código, ela não acusa.
|
|
8
|
+
*
|
|
9
|
+
* QUEM NÃO OUVE: um sistema que veio do código da pessoa (o `intent` do config, adopt/migrate). O desenho é dele: "sistema
|
|
10
|
+
* IMPORTADO: nada muda; ligar é dele" - o hábito do código dela vence a regra de fora.
|
|
11
|
+
*/
|
|
12
|
+
const SOURCE = {
|
|
13
|
+
label: "taste-skill f624f37: on 16% of the strongest sites, 57% of the weakest",
|
|
14
|
+
gradientText: "impeccable 6af45ac and taste-skill f624f37: gradient text on 2% of the strongest sites, 13% of the weakest",
|
|
15
|
+
bounce: "impeccable 6af45ac and taste-skill f624f37 (motion.md: bounce and elastic easing are banned)",
|
|
16
|
+
sameFade: "taste-skill f624f37 (motion.md: the most cited motion tell) and design-motion-principles 4a9ca87",
|
|
17
|
+
};
|
|
18
|
+
const lineOf = (src, index) => src.slice(0, index).split("\n").length;
|
|
19
|
+
const excerpt = (s) => {
|
|
20
|
+
const one = s.replace(/\s+/g, " ").trim();
|
|
21
|
+
return one.length > 90 ? `${one.slice(0, 87)}...` : one;
|
|
22
|
+
};
|
|
23
|
+
/** O rótulo: um elemento curto em maiúsculas com espaçamento de letra, logo antes de um título. */
|
|
24
|
+
const LABEL = /<([a-z][\w.]*)\b[^>]*\bclassName=(?:"([^"]*)"|\{`([^`]*)`\})[^>]*>([^<{}]{1,200})<\/\1>\s*(?:\{\/\*[\s\S]*?\*\/\}\s*)?<(?:h[1-3]|Heading|DsHeading)\b/g;
|
|
25
|
+
/** O gradiente no texto: o fundo recortado no texto e um gradiente no mesmo lugar. */
|
|
26
|
+
const GRADIENT_TEXT_CLASS = /className=(?:"([^"]*)"|\{`([^`]*)`\})/g;
|
|
27
|
+
const GRADIENT_TEXT_STYLE = /background-clip:\s*text|backgroundClip:\s*["']text["']|WebkitBackgroundClip:\s*["']text["']/g;
|
|
28
|
+
/** O easing que quica: o do gsap pelo nome, e a curva que passa do fim. */
|
|
29
|
+
const BOUNCE_NAME = /\bease\s*:\s*["'](bounce|elastic|back)(?:\.\w+)?(?:\([^)]*\))?["']/g;
|
|
30
|
+
const OVERSHOOT = /cubic-bezier\(\s*([-\d.]+)\s*,\s*([-\d.]+)\s*,\s*([-\d.]+)\s*,\s*([-\d.]+)\s*\)/g;
|
|
31
|
+
/** A mesma entrada: cada seção marcada para entrar do mesmo jeito. */
|
|
32
|
+
const REVEAL = /\bdata-reveal\b|\bwhileInView=/g;
|
|
33
|
+
const SAME_FADE_AT = 4;
|
|
34
|
+
export function generatedTells(src) {
|
|
35
|
+
const tells = [];
|
|
36
|
+
for (const m of src.matchAll(LABEL)) {
|
|
37
|
+
const cls = m[2] ?? m[3] ?? "";
|
|
38
|
+
if (!/\buppercase\b/.test(cls) || !/\btracking-|letter-spacing/.test(cls))
|
|
39
|
+
continue;
|
|
40
|
+
/* O texto vem quebrado em linhas com recuo no JSX real ("Ceramics studio & school", Kiln & Clay de 12/10): o
|
|
41
|
+
limite de rótulo é para o texto, não para o recuo. */
|
|
42
|
+
if (m[4].replace(/\s+/g, " ").trim().length > 48)
|
|
43
|
+
continue;
|
|
44
|
+
tells.push({
|
|
45
|
+
line: lineOf(src, m.index ?? 0),
|
|
46
|
+
what: "a small uppercase label above a heading",
|
|
47
|
+
excerpt: excerpt(`${m[4]}`),
|
|
48
|
+
instead: "put it in the heading or the first sentence, or drop it",
|
|
49
|
+
source: SOURCE.label,
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
for (const m of src.matchAll(GRADIENT_TEXT_CLASS)) {
|
|
53
|
+
const cls = m[1] ?? m[2] ?? "";
|
|
54
|
+
if (!/\bbg-clip-text\b/.test(cls) ||
|
|
55
|
+
!/\bbg-(gradient|linear|radial)-|\bfrom-/.test(cls))
|
|
56
|
+
continue;
|
|
57
|
+
tells.push({
|
|
58
|
+
line: lineOf(src, m.index ?? 0),
|
|
59
|
+
what: "gradient on text",
|
|
60
|
+
excerpt: excerpt(cls),
|
|
61
|
+
instead: "set the text in one colour from the system; let size and weight carry the emphasis",
|
|
62
|
+
source: SOURCE.gradientText,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
for (const m of src.matchAll(GRADIENT_TEXT_STYLE)) {
|
|
66
|
+
const around = src.slice(Math.max(0, (m.index ?? 0) - 240), (m.index ?? 0) + 240);
|
|
67
|
+
if (!/gradient\(/.test(around))
|
|
68
|
+
continue;
|
|
69
|
+
tells.push({
|
|
70
|
+
line: lineOf(src, m.index ?? 0),
|
|
71
|
+
what: "gradient on text",
|
|
72
|
+
excerpt: excerpt(m[0]),
|
|
73
|
+
instead: "set the text in one colour from the system; let size and weight carry the emphasis",
|
|
74
|
+
source: SOURCE.gradientText,
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
for (const m of src.matchAll(BOUNCE_NAME)) {
|
|
78
|
+
tells.push({
|
|
79
|
+
line: lineOf(src, m.index ?? 0),
|
|
80
|
+
what: `a ${m[1]} easing`,
|
|
81
|
+
excerpt: excerpt(m[0]),
|
|
82
|
+
instead: "use the system's motion easing - things settle, they do not bounce",
|
|
83
|
+
source: SOURCE.bounce,
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
for (const m of src.matchAll(OVERSHOOT)) {
|
|
87
|
+
const y1 = Number(m[2]);
|
|
88
|
+
const y2 = Number(m[4]);
|
|
89
|
+
if (!(y1 > 1 || y1 < 0 || y2 > 1 || y2 < 0))
|
|
90
|
+
continue;
|
|
91
|
+
tells.push({
|
|
92
|
+
line: lineOf(src, m.index ?? 0),
|
|
93
|
+
what: "an easing that overshoots (it bounces past the end)",
|
|
94
|
+
excerpt: excerpt(m[0]),
|
|
95
|
+
instead: "use the system's motion easing - things settle, they do not bounce",
|
|
96
|
+
source: SOURCE.bounce,
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
const reveals = [...src.matchAll(REVEAL)];
|
|
100
|
+
if (reveals.length >= SAME_FADE_AT)
|
|
101
|
+
tells.push({
|
|
102
|
+
line: lineOf(src, reveals[0].index ?? 0),
|
|
103
|
+
what: `every section enters the same way (${reveals.length} marked to reveal)`,
|
|
104
|
+
excerpt: excerpt(reveals[0][0]),
|
|
105
|
+
instead: "give the entrance to the two or three sections that carry the story; the rest sit at rest",
|
|
106
|
+
source: SOURCE.sameFade,
|
|
107
|
+
});
|
|
108
|
+
return tells.sort((a, b) => a.line - b.line);
|
|
109
|
+
}
|
|
110
|
+
/** O bloco que o fim do turno entrega ao agente: por arquivo, o sinal, a linha, o que fazer no lugar e a fonte. */
|
|
111
|
+
export function tellsText(found) {
|
|
112
|
+
const total = found.reduce((n, f) => n + f.tells.length, 0);
|
|
113
|
+
if (total === 0)
|
|
114
|
+
return null;
|
|
115
|
+
const lines = [
|
|
116
|
+
`SynthesisUI · ${total} thing${total === 1 ? "" : "s"} on this page look${total === 1 ? "s" : ""} generated`,
|
|
117
|
+
];
|
|
118
|
+
for (const { rel, tells } of found)
|
|
119
|
+
for (const t of tells)
|
|
120
|
+
lines.push("", ` ${rel}:${t.line} ${t.what}`, ` ${t.excerpt}`, ` -> ${t.instead}`, ` rule from ${t.source}`);
|
|
121
|
+
return lines.join("\n");
|
|
122
|
+
}
|
package/dist/install-marks.js
CHANGED
|
@@ -598,7 +598,12 @@ export const COUNTED_DIFFERENTLY = "this run counts a value as named only when Y
|
|
|
598
598
|
* E (E02, no mesmo PR) guarda o tamanho de título sem papel para a próxima leitura perguntar, e cobra o papel que a pessoa
|
|
599
599
|
* escolheu no "não" (`decided` no rules.json): um hook pinado antes diz "papel novo" uma vez e nunca cobra.
|
|
600
600
|
*/
|
|
601
|
-
|
|
601
|
+
/**
|
|
602
|
+
* 0.16.506 -> 0.16.514 em 24/10 (jornada "as camadas de design com fonte", E04), e o passo 1 dá **SIM**: o fim do turno
|
|
603
|
+
* passa a acusar os sinais de página feita por IA em que as fontes concordam (o rótulo acima do título, o gradiente no
|
|
604
|
+
* texto, o easing que quica, a mesma entrada em toda seção - `generated-tells.ts`). Um hook pinado antes não os cobra.
|
|
605
|
+
*/
|
|
606
|
+
export const CHECKER_SINCE = "0.16.514";
|
|
602
607
|
/**
|
|
603
608
|
* A ÚLTIMA VERSÃO EM QUE OS LEITORES PASSARAM A PRODUZIR UM CENSO DIFERENTE.
|
|
604
609
|
*
|
package/package.json
CHANGED