@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
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
-
|
|
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
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
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/spacing → the 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
|
|
425
|
-
//
|
|
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
|
|
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
|
|
577
|
-
for those slots.
|
|
578
|
-
|
|
579
|
-
-
|
|
580
|
-
|
|
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
|
-
|
|
55
|
-
- Exact visual appearance —
|
|
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
|
-
|
|
58
|
-
|
|
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
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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
|
|
145
|
-
|
|
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.
|
|
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.
|
|
48
|
-
"@calibrate-ds/figma-client": "^0.1.
|
|
49
|
-
"@calibrate-ds/generator-react": "^0.1.
|
|
50
|
-
"@calibrate-ds/shared-types": "^0.1.
|
|
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",
|