synthesisui 0.16.255 → 0.16.256

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/claude-md.js CHANGED
@@ -24,6 +24,7 @@ async function readInstalled(projectRoot) {
24
24
  name: lock.name,
25
25
  version: lock.version,
26
26
  adopted: lock.adopted === true,
27
+ ...(lock.reference ? { reference: lock.reference } : {}),
27
28
  });
28
29
  }
29
30
  catch {
@@ -310,6 +311,25 @@ async function renderRegion(projectRoot, installed) {
310
311
  // writes a line. An INSTALLED system speaks `--ds-*` and is scoped with
311
312
  // `data-ds`; an ADOPTED one is the project's own vocabulary, already wired,
312
313
  // with no `data-ds` anywhere to scope to.
314
+ /**
315
+ * QUANDO ESTE REPO CARREGA MAIS DE UM SISTEMA, o agente precisa saber qual
316
+ * manda - e é a única coisa que ele não consegue deduzir lendo os dois.
317
+ *
318
+ * O `loadSystem` sempre leu todos os sistemas instalados lado a lado, porque
319
+ * cada token é prefixado `--ds-` e é isso que o app rodando vê. O que faltava
320
+ * era a relação: um deles é a referência para onde os outros convergem, ou eles
321
+ * são independentes. Sem esta frase, um agente diante de dois vocabulários
322
+ * escolhe por proximidade no arquivo, que é o mesmo que escolher no par ou
323
+ * ímpar.
324
+ *
325
+ * "Independentes" NÃO é dito: a ausência é o caso comum, e uma linha em todo
326
+ * repo de um sistema só para negar uma relação que ninguém cogitou é ruído no
327
+ * arquivo mais lido do projeto.
328
+ */
329
+ const ref = installed.find((d) => d.reference)?.reference;
330
+ if (installed.length > 1 && ref) {
331
+ sections.push(`\n**${ref.name}** (\`${ref.slug}\`) is the reference system of this group. When two of the systems above name the same thing differently, its answer is the one to follow - the others are moving towards it.`);
332
+ }
313
333
  const onlyAdopted = installed.every((d) => d.adopted);
314
334
  const selfCheck = (await hasHook(projectRoot))
315
335
  ? SELF_CHECK_HOOKED
@@ -192,6 +192,18 @@ export async function add(slug, opts) {
192
192
  ...(scope ? { scope } : {}),
193
193
  ...(systems.length > 0 ? { scopes: systems } : {}),
194
194
  ...(usage.length > 0 ? { usage } : {}),
195
+ /**
196
+ * A RELAÇÃO ENTRE OS SISTEMAS DESTE REPO, vinda da plataforma.
197
+ *
198
+ * Preservada quando o registry não a manda: um servidor mais antigo não sabe
199
+ * do campo, e apagar a relação por causa disso faria a resposta oscilar entre
200
+ * dois `add` seguidos.
201
+ */
202
+ ...(payload.groupReference
203
+ ? { reference: payload.groupReference }
204
+ : prev?.reference
205
+ ? { reference: prev.reference }
206
+ : {}),
195
207
  };
196
208
  const landed = (() => {
197
209
  if (!prev?.fetchedAt)
@@ -97,12 +97,34 @@ opts = {}) {
97
97
  /** Sem sistema instalado não há alinho a cobrar - não é desalinho, é um repo sem DS. */
98
98
  if (locks.length === 0)
99
99
  return out;
100
- if (locks.length > 1)
101
- out.push({
102
- says: `${locks.length} design systems are installed here (${locks
103
- .map((l) => l.slug)
104
- .join(", ")}) - commands act on the first, so one of them is not being governed`,
105
- });
100
+ /**
101
+ * DOIS SISTEMAS DEIXA DE SER SUSPEITA QUANDO A RELAÇÃO ESTÁ DECLARADA.
102
+ *
103
+ * Este aviso nasceu para o caso real de um clone de outro projeto na mesma
104
+ * pasta, e ele continua certo ali. Mas um monorepo com uma biblioteca
105
+ * compartilhada e o vocabulário de um app tem DOIS sistemas de propósito, e
106
+ * dizer que "um deles não está sendo governado" é chamar de acidente uma
107
+ * decisão que alguém tomou na tela do grupo.
108
+ *
109
+ * Com a referência declarada, a frase muda de queixa para informação: os
110
+ * comandos seguem agindo sobre o primeiro, e agora dá para dizer QUAL deveria
111
+ * ser. Sem referência, o aviso é o de sempre.
112
+ */
113
+ const declared = locks.find((l) => l.reference)?.reference;
114
+ if (locks.length > 1) {
115
+ const names = locks.map((l) => l.slug).join(", ");
116
+ if (declared && locks.some((l) => l.slug === declared.slug)) {
117
+ if (locks[0].slug !== declared.slug)
118
+ out.push({
119
+ says: `${locks.length} design systems here (${names}), and this group's reference is \`${declared.slug}\` - but commands act on \`${locks[0].slug}\`, which is first alphabetically.`,
120
+ });
121
+ }
122
+ else {
123
+ out.push({
124
+ says: `${locks.length} design systems are installed here (${names}) - commands act on the first, so one of them is not being governed. If that is on purpose, name the reference on the group's screen.`,
125
+ });
126
+ }
127
+ }
106
128
  const lock = locks[0];
107
129
  const creds = await credentials(home);
108
130
  if (!creds)
@@ -100,7 +100,7 @@
100
100
  *
101
101
  * Quem instalou antes desta versão tem o stub que estanca: o `upgrade`/`connect` é o que alcança.
102
102
  */
103
- export const MATERIALISER_SINCE = "0.16.255";
103
+ export const MATERIALISER_SINCE = "0.16.256";
104
104
  /**
105
105
  * A ÚLTIMA VERSÃO EM QUE O QUE O HOOK RODA MUDOU.
106
106
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "synthesisui",
3
- "version": "0.16.255",
3
+ "version": "0.16.256",
4
4
  "description": "Bring SynthesisUI design systems into any project - tokens, typed components, whole pages and an agent-ready CLAUDE.md manifest.",
5
5
  "type": "module",
6
6
  "bin": {