@calibrate-ds/cli 0.1.88 → 0.1.89

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.
@@ -280,15 +280,18 @@ criteria, and recommended build order.
280
280
 
281
281
  TOKEN AUTHORITY — what to trust, what to verify:
282
282
  - PTB's --ptb-* cssVar names are authoritative for token identity. Always emit them.
283
- - If tokenConflicts is present in the response, PTB's resolved token hex diverges from
284
- the raw Figma fill. These are low-confidenceverify with Figma (get_variable_defs or
285
- get_screenshot) and use: var(--ptb-token, <figma-verified-hex>) as the CSS fallback.
286
- - PTB cannot verify exact visual appearance. Use Figma for colors/spacing when in doubt.
283
+ - If tokenConflicts is present, PTB's resolved token hex diverges from the raw scanned
284
+ fill. Each conflict includes rawValue the hex the design actually renders, captured
285
+ by PTB's own scan. Trust rawValue as the visual ground truth and emit:
286
+ var(--ptb-token, <rawValue>) as the CSS fallback.
287
+ - For exact visual appearance, read the scan thumbnail at thumbnailPath (and per-variant
288
+ thumbnails) — it is PTB's captured ground truth for colors, spacing, and arrangement.
287
289
 
288
- DIVISION OF LABOR WITH FIGMA MCP (composite workflow most accurate):
289
- PTB → token names, dependency graph, variant axes, state/content contracts (read contextFile)
290
- Figma exact hex values, spacing, visual arrangement (get_variable_defs, get_screenshot)
291
- Map: Figma hex get_token(hex) → --ptb-* cssVar name emit both together
290
+ EVERYTHING YOU NEED IS IN PTB (no external tools required):
291
+ token names, dependency graph, variant axes, state/content contracts read contextFile
292
+ exact rendered hex tokenConflicts[].rawValue (from the scan)
293
+ visual arrangement/spacingthe scan thumbnail at thumbnailPath
294
+ hex → token name → get_token(hex)
292
295
 
293
296
  TYPICAL WORKFLOW:
294
297
  1. Call start_work("<name>") — read blockedBy and tokenConflicts first
@@ -421,8 +424,8 @@ TYPICAL WORKFLOW:
421
424
  instructions: promptPackage.instructions,
422
425
  structureSummary: promptPackage.structureSummary,
423
426
  // Token conflicts: slots where PTB's resolved token hex differs from
424
- // the raw Figma fill. Always low-confidence verify against Figma
425
- // (get_screenshot / get_variable_defs) before trusting the token name.
427
+ // the raw scanned fill. Each carries rawValue (what the design renders,
428
+ // from PTB's scan) trust that and emit var(--ptb-token, <rawValue>).
426
429
  ...(context.tokenConflicts?.length
427
430
  ? { tokenConflicts: context.tokenConflicts }
428
431
  : {}),
@@ -571,13 +574,13 @@ Returns the design context (variants, tokens, slots, contracts, render tree) for
571
574
  component PLUS a dependency check: which child components this one uses and whether they are
572
575
  already implemented in ptb.lock.
573
576
 
574
- TOKEN AUTHORITY — what to trust, what to verify:
577
+ TOKEN AUTHORITY — what to trust:
575
578
  - PTB's --ptb-* cssVar names are authoritative. Always use them in emitted CSS.
576
- - If tokenConflicts is present, PTB's resolved token hex diverges from the raw Figma fill
577
- for those slots. Cross-check with Figma (get_variable_defs / get_screenshot) and emit the
578
- correct hex as a literal fallback: var(--ptb-token, <figma-hex>).
579
- - PTB does NOT know exact pixel positions, image assets, or precise spacing when tokens are
580
- unresolved ("unknown"). Use Figma for those facts.
579
+ - If tokenConflicts is present, PTB's resolved token hex diverges from the raw scanned fill
580
+ for those slots. Each conflict carries rawValue the hex the design actually renders,
581
+ from PTB's scan. Emit it as the literal fallback: var(--ptb-token, <rawValue>).
582
+ - For exact visual appearance colors, spacing, image assets, arrangement read the scan
583
+ thumbnail at thumbnailPath (and per-variant thumbnails). That is PTB's captured ground truth.
581
584
 
582
585
  WORKFLOW — follow this exactly:
583
586
  1. Check unbuiltDependencies. If any exist, call implement_component for each one in buildOrder first.
@@ -51,16 +51,17 @@ WHAT PTB IS AUTHORITATIVE FOR (trust these without Figma):
51
51
  - Variant axes, state contract, interaction contract, slot contract
52
52
  - Lifecycle: designHash, stampedHash, workStatus (from ptb.lock)
53
53
 
54
- WHAT PTB CANNOT VERIFY (cross-check with Figma when available):
55
- - Exact visual appearance — PTB has no rendered reference
54
+ VISUAL GROUND TRUTH (all from PTB's own scan no external tools needed):
55
+ - Exact visual appearance — read the scan thumbnail at thumbnailPath (and per-variant
56
+ thumbnails). That is the captured reference for colors, spacing, positions, and assets.
56
57
  - tokenConflicts (if present): slots where PTB's resolved token hex diverges from the raw
57
- Figma fill. Always low-confidence. Use Figma get_variable_defs or get_screenshot to
58
- determine which value is correct, then use PTB's cssVar name with Figma's hex as fallback.
58
+ scanned fill. Each carries rawValue the hex the design actually renders. Emit PTB's
59
+ cssVar name with rawValue as the literal fallback: var(--ptb-token, <rawValue>).
59
60
 
60
- DIVISION OF LABOR WITH FIGMA MCP (composite workflow):
61
- PTB → token names, dependency graph, variant axes, state/content contracts
62
- Figma exact hex values, spacing px, badge positions, image assets (get_variable_defs, get_screenshot)
63
- Never deep-read the full render tree just to recover colors — that is Figma's job.`, {
61
+ EVERYTHING YOU NEED IS IN PTB:
62
+ token names, dependency graph, variant axes, state/content contracts → this response
63
+ exact rendered hex tokenConflicts[].rawValue visual arrangement thumbnailPath
64
+ hex token name get_token(hex)`, {
64
65
  name: z.string().describe("Component display name, e.g. 'Button' or 'Notification Item'"),
65
66
  detail: z.enum(["summary", "full"]).optional().default("summary").describe("'summary' (default): compact planning brief — variant axes, token bindings, dependencies, layout, state axis names, contextFile path. " +
66
67
  "'full': complete context with render tree and compressed variant patches."),
@@ -3,6 +3,12 @@ import * as path from "node:path";
3
3
  import { z } from "zod";
4
4
  import { resolveToken } from "@calibrate-ds/core";
5
5
  const UPGRADE_CHECKLIST = {
6
+ "0.1.89": [
7
+ "INDEPENDENCE release — PTB no longer recommends or depends on any external tool. Previously several MCP tool descriptions told the agent to 'cross-check with Figma MCP' (get_variable_defs / get_screenshot) for exact hex and visual truth.",
8
+ "That guidance was redundant: PTB already has that data from its own scan. tokenConflicts now direct the agent to rawValue — the hex the design actually renders, captured by the scan — with var(--ptb-token, <rawValue>) as the fallback; and the scan thumbnail at thumbnailPath is the visual ground truth for colors/spacing/arrangement.",
9
+ "Net effect: fewer round-trips, no dependency on a third-party MCP, and the agent gets a concrete value instead of being sent to another tool. No code behavior changed — only agent-facing guidance in start_work / get_component / get_token descriptions and two type comments.",
10
+ "Restart your IDE's MCP server to pick up the updated tool descriptions. No re-scan. 593 tests.",
11
+ ],
6
12
  "0.1.88": [
7
13
  "0.1.87 audit fixes (docs/PTB_0187_REPORT.md). Closes the last functional beta blocker plus the emitter-parity residuals. Six-plus releases, zero regressions.",
8
14
  "FIX (NEW-8, open since .79 — was FAILING HARD): start_work's MCP response inlined promptText (100 KB+, 94.7% of the payload), so start_work on a large component-set EXCEEDED the tool-call token limit and the call failed outright. promptText is no longer inlined in the response. The contextFile on disk is UNCHANGED — it still contains promptText and every detail; read the full brief from there (the tool description says so). This unblocks the primary agent entry point.",
@@ -141,8 +141,9 @@ Accepts:
141
141
 
142
142
  Returns: collection, tokenName, cssVar (--ptb-* variable), resolvedValue, aliasChain (when present).
143
143
 
144
- PTB owns the token identity map — use hex lookup when Figma's get_variable_defs returns a
145
- raw color and you need the canonical --ptb-* name instead of guessing the convention.`, { query: z.string().describe("Token name, path, Figma variable name (surface/surface-info-light), or hex color (#E5F3FF)") }, async ({ query }) => {
144
+ PTB owns the token identity map — use hex lookup when you have a raw color (e.g. a
145
+ tokenConflicts rawValue from the scan) and need the canonical --ptb-* name instead of
146
+ guessing the convention.`, { query: z.string().describe("Token name, path, Figma variable name (surface/surface-info-light), or hex color (#E5F3FF)") }, async ({ query }) => {
146
147
  let ctx;
147
148
  try {
148
149
  ctx = await getContext();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@calibrate-ds/cli",
3
- "version": "0.1.88",
3
+ "version": "0.1.89",
4
4
  "license": "FSL-1.1-MIT",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -44,10 +44,10 @@
44
44
  "commander": "^14.0.3",
45
45
  "openai": "^6.34.0",
46
46
  "zod": "^4.3.6",
47
- "@calibrate-ds/core": "^0.1.88",
48
- "@calibrate-ds/figma-client": "^0.1.88",
49
- "@calibrate-ds/generator-react": "^0.1.88",
50
- "@calibrate-ds/shared-types": "^0.1.88"
47
+ "@calibrate-ds/core": "^0.1.89",
48
+ "@calibrate-ds/figma-client": "^0.1.89",
49
+ "@calibrate-ds/generator-react": "^0.1.89",
50
+ "@calibrate-ds/shared-types": "^0.1.89"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@types/node": "^22.13.5",