@calibrate-ds/cli 0.1.25 → 0.1.27
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/apply.d.ts.map +1 -1
- package/dist/commands/apply.js +4 -2
- package/dist/commands/apply.js.map +1 -1
- package/dist/commands/diff.d.ts.map +1 -1
- package/dist/commands/diff.js +26 -26
- package/dist/commands/diff.js.map +1 -1
- package/dist/commands/document.d.ts.map +1 -1
- package/dist/commands/document.js +2 -1
- package/dist/commands/document.js.map +1 -1
- package/dist/commands/generate-components.d.ts.map +1 -1
- package/dist/commands/generate-components.js +11 -5
- package/dist/commands/generate-components.js.map +1 -1
- package/dist/commands/implement.d.ts.map +1 -1
- package/dist/commands/implement.js +2 -1
- package/dist/commands/implement.js.map +1 -1
- package/dist/commands/prompt.js +2 -1
- package/dist/commands/prompt.js.map +1 -1
- package/dist/commands/scan.d.ts.map +1 -1
- package/dist/commands/scan.js +3 -13
- package/dist/commands/scan.js.map +1 -1
- package/dist/mcp/tools/action-tools.d.ts.map +1 -1
- package/dist/mcp/tools/action-tools.js +189 -217
- package/dist/mcp/tools/action-tools.js.map +1 -1
- package/dist/mcp/tools/component-tools.d.ts.map +1 -1
- package/dist/mcp/tools/component-tools.js +84 -29
- package/dist/mcp/tools/component-tools.js.map +1 -1
- package/dist/mcp/tools/governance-tools.d.ts.map +1 -1
- package/dist/mcp/tools/governance-tools.js +70 -184
- package/dist/mcp/tools/governance-tools.js.map +1 -1
- package/dist/mcp/tools/info-tools.d.ts.map +1 -1
- package/dist/mcp/tools/info-tools.js +44 -172
- package/dist/mcp/tools/info-tools.js.map +1 -1
- package/dist/mcp/tools/token-tools.d.ts.map +1 -1
- package/dist/mcp/tools/token-tools.js +71 -59
- package/dist/mcp/tools/token-tools.js.map +1 -1
- package/dist/mcp/tools/verify-tool.d.ts.map +1 -1
- package/dist/mcp/tools/verify-tool.js +0 -37
- package/dist/mcp/tools/verify-tool.js.map +1 -1
- package/dist/utils/managed-components.d.ts +14 -0
- package/dist/utils/managed-components.d.ts.map +1 -0
- package/dist/utils/managed-components.js +23 -0
- package/dist/utils/managed-components.js.map +1 -0
- package/package.json +5 -5
|
@@ -1,138 +1,25 @@
|
|
|
1
1
|
import * as fs from "node:fs/promises";
|
|
2
2
|
import * as path from "node:path";
|
|
3
|
-
|
|
4
|
-
"0.1.25": {
|
|
5
|
-
summary: "R5 fully closed — CLI ptb verify now passes workspaceRoot to runVerify, enabling Playwright resolution from the host project's node_modules. All 7 R-tickets are behaviorally verified.",
|
|
6
|
-
highlights: [
|
|
7
|
-
"fix: commands/verify.ts now passes workspaceRoot (from resolveDSPaths) to runVerify — Playwright is resolved via createRequire from the host project, not the CLI's own node_modules (R5 CLI path)",
|
|
8
|
-
],
|
|
9
|
-
},
|
|
10
|
-
"0.1.24": {
|
|
11
|
-
summary: "R3 fully closed — resolveRelativeImportTarget now emits the index barrel (casing-safe) instead of the lowercase slug filename. All 7 R-tickets are now green.",
|
|
12
|
-
highlights: [
|
|
13
|
-
"fix: resolveRelativeImportTarget returns '…/index' instead of '…/<slug>' — composite dep imports now resolve to the folder barrel, eliminating TS2307/TS1149 casing errors (R3 final)",
|
|
14
|
-
],
|
|
15
|
-
},
|
|
16
|
-
"0.1.23": {
|
|
17
|
-
summary: "Version bump to resolve install issues with 0.1.22. No functional changes.",
|
|
18
|
-
highlights: [
|
|
19
|
-
"chore: bump all packages to 0.1.23 to resolve npm publish/install conflict with 0.1.22",
|
|
20
|
-
],
|
|
21
|
-
},
|
|
22
|
-
"0.1.22": {
|
|
23
|
-
summary: "token_impact now reads context/components/ (was context/) and normalises slash-style token names to dashes — R1b closes after three attempts. generateCompositeFile falls back to dependencyInstances when composite.children is empty — R3 closes after three attempts. All 7 R-tickets are now green.",
|
|
24
|
-
highlights: [
|
|
25
|
-
"fix: token_impact (MCP + CLI) reads .ptb/context/components/<slug>.json — 'context/' subdir was missing; ctxData was null for every component (R1b)",
|
|
26
|
-
"fix: token_impact query normalises '/' → '-' so Figma-style 'surface/surface-info-light' matches the dash-form cssVar (R1b)",
|
|
27
|
-
"fix: generateCompositeFile falls back to component.dependencyInstances when composite.children is [] — the normalizeComposites stub hardcodes children:[] so ChatHeader now emits import { BtnWeb } + import { Profile } (R3)",
|
|
28
|
-
],
|
|
29
|
-
},
|
|
30
|
-
"0.1.21": {
|
|
31
|
-
summary: "token_impact walks per-node resolvedBindings across all context files — finds tokens in nested nodes (R1b″). Dep-import supplemental pass runs unconditionally — ChatHeader now imports BtnWeb + Profile even when no layoutTree is present (R3″).",
|
|
32
|
-
highlights: [
|
|
33
|
-
"fix: token_impact and ptb query token-impact now walk .ptb/context/<slug>.json per-node resolvedBindings instead of shallow comp.tokenBindings — finds nested token usages like surface-info-light in a chip node (R1b″)",
|
|
34
|
-
"fix: dependencyInstances supplemental pass moved outside if(layoutTree) — import stubs are always emitted, fixing ChatHeader with no layoutTree still getting BtnWeb + Profile imports (R3″)",
|
|
35
|
-
],
|
|
36
|
-
},
|
|
37
|
-
"0.1.20": {
|
|
38
|
-
summary: "cssValue fallback to cssVar when alias chain points outside model.tokens (R1c). CLI token-impact command reads real binding fields (R1b′). CLI generate-components passes full snapshot to writeComponents — single-component regen no longer drops sibling barrel exports (R2′). generator-react package now correctly versioned alongside all other packages.",
|
|
39
|
-
highlights: [
|
|
40
|
-
"fix: resolveTokenBinding/resolveTokenBindingFromIndex fall back to cssVar when formatCSSValue returns empty — per-node resolvedBindings.cssValue no longer blank for cross-library alias chains (R1c)",
|
|
41
|
-
"fix: CLI ptb query token-impact reads b.boundToken.name / b.resolvedToken.name / b.boundToken.cssVariable — matches components that actually use a token (R1b′)",
|
|
42
|
-
"fix: CLI generate-components passes full snapshot to writeComponents — single-component regen no longer drops sibling barrel exports (R2′)",
|
|
43
|
-
"fix: generator-react package.json bumped alongside all other packages — resolves silent R2/R3 failures in consumer repos that published 0.1.19 without the updated generator",
|
|
44
|
-
],
|
|
45
|
-
},
|
|
46
|
-
"0.1.19": {
|
|
47
|
-
summary: "Token alias resolution in get_token and list_themes (R1a). token_impact now reads real binding fields (R1b). Single-component regen preserves full category barrel (R2). Dep import stubs emitted for all instances in layout tree (R3). stateAxis now correctly selects the interactive axis over dimensional axes (R4). childNodes removed from ComponentContext — payload drops ~66% (R6). Playwright resolved from host project node_modules in run_verify (R5).",
|
|
48
|
-
highlights: [
|
|
49
|
-
"fix: get_token and list_themes now call resolveTokenValue() — resolvedValue is a hex string, not '[object Object]' (R1a)",
|
|
50
|
-
"fix: token_impact reads b.boundToken.name / b.resolvedToken.name / b.boundToken.cssVariable — finds components that actually use a token (R1b)",
|
|
51
|
-
"fix: generate_components passes full snapshot to writeComponents — single-component regen no longer drops sibling barrel exports (R2)",
|
|
52
|
-
"fix: dep import stubs emitted unconditionally for all dependencyInstances — ChatHeader now imports BtnWeb and Profile (R3)",
|
|
53
|
-
"fix: resolveStateContract prefers pseudo-state axis (hover/pressed/rest) over dimensional axis (size) — stateAxis and stateDefaults now reflect interactive states (R4)",
|
|
54
|
-
"fix: childNodes removed from ComponentContext output — get_component(PropertyCard) context drops from 424K to ~140K; renderTree is the canonical source (R6)",
|
|
55
|
-
"fix: screenshotWithPlaywright resolves Playwright via createRequire from workspaceRoot — uses host project's playwright, not PTB's own node_modules (R5)",
|
|
56
|
-
],
|
|
57
|
-
},
|
|
58
|
-
"0.1.18": {
|
|
59
|
-
summary: "Token pipeline fixed end-to-end: MCP run_scan now enriches tokens, icons, bitmaps, and thumbnails identical to CLI scan. get_token_by_value, list_themes, and get_token return correct --ptb-* CSS var names. Content-stable designHash eliminates false-drift storms. Barrel regen is now additive (never drops hand-crafted exports, never sweeps _compare dirs into public API). Thumbnail pipeline SVG mislabeling fixed. get_component now surfaces thumbnailPath. Codegen emits import stubs for all known dep instances. what_uses returns code-level workStatus. variantAxes options backfilled from variantDiffs. stateDefaults keyed by primary-axis value. W7: form-control and unnamed-axis semantic guards in implementationHints. W8: spacing token names resolved from token collections (eliminates 161 'unknown' entries); render tree instance nodes carry ptbCodeName.",
|
|
60
|
-
highlights: [
|
|
61
|
-
"fix: MCP run_scan now calls resolveTokenSource, enrichIconsWithSvg, enrichBitmapAssets, enrichComponentThumbnails — identical enrichment pipeline to CLI scan; fixes tokens:[] in MCP-saved snapshots",
|
|
62
|
-
"fix: normalize-token-collections now stores aliasTargetId on VARIABLE_ALIAS tokens — consistent with plugin path; enables alias chain traversal from REST-path snapshots",
|
|
63
|
-
"fix: get_token_by_value, list_themes, get_token: cssVar constructed from getPTBTokenVariableName(collection, name) — no longer reads non-existent t.cssVar/t.resolvedValue/t.resolutionPath fields",
|
|
64
|
-
"fix: get_token_by_value alias chain now follows aliasTargetId references across all token collections",
|
|
65
|
-
"fix: designHash uses stable key-sorted JSON serialization — eliminates false-drift storm (17/17 components showing drift after re-scan)",
|
|
66
|
-
"fix: barrel regen skips _-prefixed dirs (e.g. _compare_*) at both root and category level — no more private dirs leaking into public API",
|
|
67
|
-
"fix: thumbnail enrichment always uses PNG export path — SVG content no longer mislabeled as .png",
|
|
68
|
-
"feat: get_component response includes thumbnailPath from ComponentDefinition",
|
|
69
|
-
"feat: codegen emits import stubs for all dependencyInstances not found in layout tree walk — agents no longer wire imports by hand",
|
|
70
|
-
"feat: what_uses returns workStatus + codeStatus (in-sync/stale/unbuilt) for each dependent — blast-radius analysis includes code layer",
|
|
71
|
-
"fix: variantAxes options backfilled from variantDiffs.variantSelection when Figma API omits variantOptions — axes always have full value lists",
|
|
72
|
-
"fix: stateContract.stateDefaults keyed by primary-axis value ('Default', 'Hover') not by concatenated all-axis string ('sm-Default')",
|
|
73
|
-
"feat: implementationHints.isFormControl + formControlNote emitted for form-control components — agents emit correct native inputs",
|
|
74
|
-
"feat: implementationHints.unnamedAxesWarning + unnamedAxes emitted when Figma auto-named axes (Property 1) would leak into public prop API",
|
|
75
|
-
"fix: layout spacing token names ('unknown') resolved directly from model.tokens by token ID — fixes 161 'unknown' spacing entries",
|
|
76
|
-
"feat: render tree instance nodes carry ptbCodeName — agents see component names, not raw Figma IDs",
|
|
77
|
-
],
|
|
78
|
-
},
|
|
79
|
-
"0.1.16": {
|
|
80
|
-
summary: "Spacing token fixes, correct CSS output, auto-stories in generate-components, render tree pruning, thumbnail-first verify, and structured diff output.",
|
|
81
|
-
highlights: [
|
|
82
|
-
"fix: spacing tokens (gap, padding) now emit correct px values in generated CSS — was silently dropping units when token value was stored as a string internally",
|
|
83
|
-
"fix: resolvedToken.name no longer shows 'unknown' for layout spacing bindings — names are backfilled from resolvedBindings after context build",
|
|
84
|
-
"fix: CSS border shorthand now emits valid `1px solid <color>` — was producing `border: #color` which is invalid CSS",
|
|
85
|
-
"feat: ptb generate-components now auto-generates .stories.tsx when generation.stories: true — previously only the scaffold/implement paths created stories files",
|
|
86
|
-
"feat: instance subtrees pruned from render tree — removes ~1MB of redundant JSON from component context payloads; no code-gen impact",
|
|
87
|
-
"feat: ptb verify uses scan-time thumbnail as design reference by default (no Figma token required at verify time); add --fresh-figma to force a live Figma API screenshot",
|
|
88
|
-
"fix: ptb diff / run_diff MCP: cross-collection token alias targets now show as CollectionName/token-name instead of raw VariableID:XX:YY strings",
|
|
89
|
-
"feat: run_diff MCP output enriched — multiline blocks flattened to discrete lines, changeCategories per component, affectedComponents per token collection, top-level summary string for one-liner AI answers",
|
|
90
|
-
],
|
|
91
|
-
},
|
|
92
|
-
"0.1.9": {
|
|
93
|
-
summary: "Write-action MCP tools, preferred values for instance-swap slots, and upgrade notices.",
|
|
94
|
-
highlights: [
|
|
95
|
-
"New MCP tool: run_scan — scan Figma and update snapshot without leaving the IDE",
|
|
96
|
-
"New MCP tool: generate_components — scaffold typed React shells from snapshot",
|
|
97
|
-
"New MCP tool: generate_tokens — regenerate CSS token files",
|
|
98
|
-
"New MCP tool: export_context — export .ptb/context/ files and update ptb.lock",
|
|
99
|
-
"New MCP tool: stamp_component — mark component as implemented",
|
|
100
|
-
"New MCP tool: assign_component — assign component to a developer",
|
|
101
|
-
"New MCP tool: get_component_slots — returns only instance-swap slots with preferredValues (valid icon names)",
|
|
102
|
-
"Scanner now captures Figma preferredValues for INSTANCE_SWAP properties (resolved to component names)",
|
|
103
|
-
"Post-upgrade notice: prints what's new when ptb version changes",
|
|
104
|
-
],
|
|
105
|
-
},
|
|
106
|
-
"0.1.8": {
|
|
107
|
-
summary: "Full MCP server (11 tools), Symbol Bridge, and --cwd fix.",
|
|
108
|
-
highlights: [
|
|
109
|
-
"MCP server: ptb mcp starts an MCP stdio server for AI IDEs",
|
|
110
|
-
"11 MCP tools: get_component, list_components, get_component_slots, find_component_by_figma_node, is_stale, what_uses, coverage_summary, token_impact, list_themes, get_token, get_verify_report",
|
|
111
|
-
"Symbol Bridge (ptb-bridge.json): maps Figma node IDs to exported component symbols",
|
|
112
|
-
"--cwd flag and PTB_WORKSPACE env var for MCP server CWD resolution",
|
|
113
|
-
"MCP roots auto-detect: uses MCP client workspace roots when available",
|
|
114
|
-
],
|
|
115
|
-
},
|
|
116
|
-
"0.1.7": {
|
|
117
|
-
summary: "Verify command and Storybook integration.",
|
|
118
|
-
highlights: [
|
|
119
|
-
"ptb verify component <name>: pixel-diffs Figma vs Storybook render",
|
|
120
|
-
"AI visual feedback via Claude Vision",
|
|
121
|
-
"Auto-detect Storybook on localhost:6006",
|
|
122
|
-
],
|
|
123
|
-
},
|
|
124
|
-
"0.1.6": {
|
|
125
|
-
summary: "AI layer, document command, and CI integration.",
|
|
126
|
-
highlights: [
|
|
127
|
-
"ptb implement component <name>: AI-writes component from design context",
|
|
128
|
-
"ptb document component <name>: generates MDX docs and Storybook stories",
|
|
129
|
-
"ptb document system: generates CLAUDE.md and components.md",
|
|
130
|
-
"ptb ci setup: generates GitHub Actions workflow for freshness checks",
|
|
131
|
-
"ptb ai setup/use/remove: multi-provider AI config (Claude, OpenAI)",
|
|
132
|
-
],
|
|
133
|
-
},
|
|
134
|
-
};
|
|
3
|
+
import { z } from "zod";
|
|
135
4
|
const UPGRADE_CHECKLIST = {
|
|
5
|
+
"0.1.27": [
|
|
6
|
+
"BEHAVIOR CHANGE: implement_component promptText now includes a '## Visual Source of Truth' section pointing to the scan thumbnail. The agent is instructed to read the thumbnail before writing CSS and to run run_verify before submit_work.",
|
|
7
|
+
"BEHAVIOR CHANGE: implement_component WORKFLOW now has step 2d — run run_verify (pixel-diff against cached thumbnail) before submit_work when Storybook is running. Target score ≥ 0.90.",
|
|
8
|
+
"BEHAVIOR CHANGE: implement_component response JSON now includes thumbnailPath on the component object (when present from last scan).",
|
|
9
|
+
"IMPROVEMENT: Scan thumbnails are now captured at scale 1.0 (was 0.5). Re-run ptb scan to refresh thumbnails at the higher resolution. Existing thumbnails remain at old size until the next scan.",
|
|
10
|
+
"No breaking changes to ptb.config.json, ptb.lock, or MCP tool names.",
|
|
11
|
+
"No re-export or re-generate required.",
|
|
12
|
+
],
|
|
13
|
+
"0.1.26": [
|
|
14
|
+
"BREAKING (MCP tool names): run_scan, generate_components, generate_tokens, export_context, run_prune removed — use run({ stage: 'scan'|'generate'|'tokens'|'context'|'prune' }) instead",
|
|
15
|
+
"BREAKING (MCP tool names): get_token_by_value removed — use get_token({ query }) for all token lookups including hex reverse-lookup",
|
|
16
|
+
"BREAKING (MCP tool names): get_setup_checklist and get_upgrade_checklist removed — use get_checklist({ kind: 'setup' | 'upgrade' })",
|
|
17
|
+
"BREAKING (MCP tool names): is_stale removed — use get_status({ quick: true }) for fast design-drift checks (ptb.lock only, no source file reads)",
|
|
18
|
+
"BREAKING (MCP tool names): stamp_component removed — use submit_work({ name, transitionTo:'stamped', folder?, artifacts? }) instead. Bulk stamp via CLI: ptb stamp component .",
|
|
19
|
+
"BEHAVIOR CHANGE: get_component now defaults to summary mode — if your agent workflow relies on the full inline context, add detail:'full' to those calls or switch to implement_component which returns the full brief",
|
|
20
|
+
"No changes to ptb.config.json, ptb.lock, generated component files, or context files on disk",
|
|
21
|
+
"No re-scan or re-export required",
|
|
22
|
+
],
|
|
136
23
|
"0.1.19": [
|
|
137
24
|
"Re-run `ptb export context` (or export_context MCP tool) — refreshes context files without childNodes; context payloads drop ~66%",
|
|
138
25
|
"Re-run `ptb scan` to repopulate token alias chains if stateContract shows wrong axis after upgrade",
|
|
@@ -177,40 +64,29 @@ const UPGRADE_CHECKLIST = {
|
|
|
177
64
|
export const infoTools = {
|
|
178
65
|
name: "info",
|
|
179
66
|
register(server, getContext) {
|
|
180
|
-
server.tool("
|
|
181
|
-
const entries = Object.entries(CHANGELOG).map(([v, c]) => ({
|
|
182
|
-
version: v,
|
|
183
|
-
summary: c.summary,
|
|
184
|
-
highlights: c.highlights,
|
|
185
|
-
}));
|
|
186
|
-
return { content: [{ type: "text", text: JSON.stringify(entries, null, 2) }] };
|
|
187
|
-
});
|
|
188
|
-
server.tool("get_upgrade_checklist", "Get the upgrade checklist for a specific PTB version — what to do after updating.", async () => {
|
|
189
|
-
const entries = Object.entries(UPGRADE_CHECKLIST).map(([v, steps]) => ({
|
|
190
|
-
version: v,
|
|
191
|
-
steps,
|
|
192
|
-
}));
|
|
193
|
-
return { content: [{ type: "text", text: JSON.stringify(entries, null, 2) }] };
|
|
194
|
-
});
|
|
195
|
-
server.tool("get_setup_checklist", `Check the current PTB setup state and return a prioritized step-by-step guide.
|
|
67
|
+
server.tool("get_checklist", `Get a checklist for PTB setup or upgrade.
|
|
196
68
|
|
|
197
|
-
|
|
198
|
-
the exact tool
|
|
199
|
-
|
|
200
|
-
- Pause and ask the user only for steps that require manual action (like setting a file key or token)
|
|
201
|
-
- Once a manual step is confirmed done, continue with the next canAutoRun steps
|
|
69
|
+
kind: 'setup' — checks current workspace state and returns a prioritized step-by-step
|
|
70
|
+
guide with status (done/pending/blocked) and the exact MCP tool to call for each step.
|
|
71
|
+
Work through steps in order: call canAutoRun steps immediately, pause only for manual steps.
|
|
202
72
|
|
|
203
|
-
|
|
73
|
+
kind: 'upgrade' — returns per-version upgrade checklists (what to do after updating PTB).`, { kind: z.enum(["setup", "upgrade"]).describe("'setup': guided first-time setup checklist with live state detection. 'upgrade': post-update steps per PTB version.") }, async ({ kind }) => {
|
|
74
|
+
if (kind === "upgrade") {
|
|
75
|
+
const entries = Object.entries(UPGRADE_CHECKLIST).map(([v, steps]) => ({
|
|
76
|
+
version: v,
|
|
77
|
+
steps,
|
|
78
|
+
}));
|
|
79
|
+
return { content: [{ type: "text", text: JSON.stringify(entries, null, 2) }] };
|
|
80
|
+
}
|
|
81
|
+
// kind === "setup": check live workspace state and return prioritized steps
|
|
204
82
|
let workspaceRoot = process.cwd();
|
|
205
83
|
let config = null;
|
|
206
|
-
// Try to get workspaceRoot from context if snapshot already exists
|
|
207
84
|
try {
|
|
208
85
|
const ctx = await getContext();
|
|
209
86
|
workspaceRoot = ctx.workspaceRoot;
|
|
210
87
|
config = ctx.config;
|
|
211
88
|
}
|
|
212
89
|
catch {
|
|
213
|
-
// No snapshot yet — load config independently
|
|
214
90
|
try {
|
|
215
91
|
const raw = await fs.readFile(path.join(workspaceRoot, "ptb.config.json"), "utf-8");
|
|
216
92
|
config = JSON.parse(raw);
|
|
@@ -218,7 +94,6 @@ Call this after ptb init to drive the full guided setup without the user needing
|
|
|
218
94
|
catch { /* no config yet */ }
|
|
219
95
|
}
|
|
220
96
|
const steps = [];
|
|
221
|
-
// Step 1 — file key configured
|
|
222
97
|
const fileKey = config?.designTool?.fileKey;
|
|
223
98
|
const fileKeySet = !!fileKey && fileKey !== "YOUR_FIGMA_FILE_KEY";
|
|
224
99
|
steps.push({
|
|
@@ -230,7 +105,6 @@ Call this after ptb init to drive the full guided setup without the user needing
|
|
|
230
105
|
? null
|
|
231
106
|
: 'Open ptb.config.json and replace "YOUR_FIGMA_FILE_KEY" with your actual file key.\nFind it in the Figma URL: figma.com/design/<FILE_KEY>/...',
|
|
232
107
|
});
|
|
233
|
-
// Step 2 — access token set in MCP server environment
|
|
234
108
|
const tokenEnv = config?.designTool?.accessTokenEnv ?? "FIGMA_ACCESS_TOKEN";
|
|
235
109
|
const tokenSet = !!process.env[tokenEnv];
|
|
236
110
|
steps.push({
|
|
@@ -242,7 +116,6 @@ Call this after ptb init to drive the full guided setup without the user needing
|
|
|
242
116
|
? null
|
|
243
117
|
: `The MCP server needs the token in its own environment (not just your terminal).\n\nMac (dock-launched IDEs): run in terminal:\n launchctl setenv ${tokenEnv} your_token\nThen FULLY QUIT and relaunch your IDE — not just reload the window.\nIf you already ran launchctl setenv but still see this error, the MCP server started before the token was set. A full IDE quit-and-relaunch is required.\n\nAlternatively, launch your IDE from the terminal so it inherits your shell env:\n export ${tokenEnv}=your_token && cursor . (or code .)\n\nGet your token: Figma → Account Settings → Security → Generate New Token`,
|
|
244
118
|
});
|
|
245
|
-
// Step 3 — snapshot exists
|
|
246
119
|
const snapshotPath = path.join(workspaceRoot, ".ptb", "latest.json");
|
|
247
120
|
const hasSnapshot = await fs.access(snapshotPath).then(() => true).catch(() => false);
|
|
248
121
|
const canScan = fileKeySet && tokenSet;
|
|
@@ -252,16 +125,14 @@ Call this after ptb init to drive the full guided setup without the user needing
|
|
|
252
125
|
status: hasSnapshot ? "done" : canScan ? "pending" : "blocked",
|
|
253
126
|
blockedReason: !fileKeySet ? "Complete step 1 first" : !tokenSet ? "Complete step 2 first" : undefined,
|
|
254
127
|
canAutoRun: canScan,
|
|
255
|
-
mcpTool: "
|
|
256
|
-
|
|
128
|
+
mcpTool: "run",
|
|
129
|
+
mcpArgs: { stage: "scan" },
|
|
130
|
+
action: hasSnapshot ? null : "Call run({ stage: 'scan' })",
|
|
257
131
|
});
|
|
258
|
-
// Step 4 — context exported
|
|
259
|
-
// Files are written to .ptb/context/components/ (not the flat .ptb/context/ dir).
|
|
260
132
|
const contextDir = path.join(workspaceRoot, ".ptb", "context", "components");
|
|
261
133
|
let contextCount = 0;
|
|
262
134
|
try {
|
|
263
135
|
const files = await fs.readdir(contextDir);
|
|
264
|
-
// Exclude index.json which is always present after export
|
|
265
136
|
contextCount = files.filter((f) => f.endsWith(".json") && f !== "index.json").length;
|
|
266
137
|
}
|
|
267
138
|
catch { /* not yet */ }
|
|
@@ -272,10 +143,10 @@ Call this after ptb init to drive the full guided setup without the user needing
|
|
|
272
143
|
blockedReason: !hasSnapshot ? "Complete step 3 first" : undefined,
|
|
273
144
|
details: contextCount > 0 ? `${contextCount} context files in .ptb/context/components/` : null,
|
|
274
145
|
canAutoRun: hasSnapshot,
|
|
275
|
-
mcpTool: "
|
|
276
|
-
|
|
146
|
+
mcpTool: "run",
|
|
147
|
+
mcpArgs: { stage: "context" },
|
|
148
|
+
action: contextCount > 0 ? null : "Call run({ stage: 'context' })",
|
|
277
149
|
});
|
|
278
|
-
// Step 5 — tokens generated
|
|
279
150
|
const tokensDir = config?.output?.tokensDir
|
|
280
151
|
? path.join(workspaceRoot, config.output.tokensDir)
|
|
281
152
|
: path.join(workspaceRoot, "packages/ui/src/tokens");
|
|
@@ -292,10 +163,10 @@ Call this after ptb init to drive the full guided setup without the user needing
|
|
|
292
163
|
blockedReason: !hasSnapshot ? "Complete step 3 first" : undefined,
|
|
293
164
|
details: tokenFileCount > 0 ? `${tokenFileCount} token files generated` : null,
|
|
294
165
|
canAutoRun: hasSnapshot,
|
|
295
|
-
mcpTool: "
|
|
296
|
-
|
|
166
|
+
mcpTool: "run",
|
|
167
|
+
mcpArgs: { stage: "tokens" },
|
|
168
|
+
action: tokenFileCount > 0 ? null : "Call run({ stage: 'tokens' })",
|
|
297
169
|
});
|
|
298
|
-
// Step 6 — components generated
|
|
299
170
|
const manifestPath = path.join(workspaceRoot, ".ptb", "manifest.json");
|
|
300
171
|
let generatedCount = 0;
|
|
301
172
|
try {
|
|
@@ -310,8 +181,9 @@ Call this after ptb init to drive the full guided setup without the user needing
|
|
|
310
181
|
blockedReason: !hasSnapshot ? "Complete step 3 first" : undefined,
|
|
311
182
|
details: generatedCount > 0 ? `${generatedCount} component shells scaffolded` : null,
|
|
312
183
|
canAutoRun: hasSnapshot,
|
|
313
|
-
mcpTool: "
|
|
314
|
-
|
|
184
|
+
mcpTool: "run",
|
|
185
|
+
mcpArgs: { stage: "generate" },
|
|
186
|
+
action: generatedCount > 0 ? null : "Call run({ stage: 'generate' })",
|
|
315
187
|
});
|
|
316
188
|
const done = steps.filter((s) => s.status === "done").length;
|
|
317
189
|
const pending = steps.filter((s) => s.status === "pending");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"info-tools.js","sourceRoot":"","sources":["../../../src/mcp/tools/info-tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"info-tools.js","sourceRoot":"","sources":["../../../src/mcp/tools/info-tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,iBAAiB,GAA6B;IAChD,QAAQ,EAAE;QACN,+OAA+O;QAC/O,yLAAyL;QACzL,sIAAsI;QACtI,mMAAmM;QACnM,sEAAsE;QACtE,uCAAuC;KAC1C;IACD,QAAQ,EAAE;QACN,yLAAyL;QACzL,qIAAqI;QACrI,qIAAqI;QACrI,kJAAkJ;QAClJ,gLAAgL;QAChL,wNAAwN;QACxN,8FAA8F;QAC9F,kCAAkC;KACrC;IACD,QAAQ,EAAE;QACN,mIAAmI;QACnI,oGAAoG;QACpG,oHAAoH;QACpH,yIAAyI;QACzI,8EAA8E;KACjF;IACD,QAAQ,EAAE;QACN,oJAAoJ;QACpJ,4LAA4L;QAC5L,kIAAkI;QAClI,6IAA6I;QAC7I,2DAA2D;KAC9D;IACD,QAAQ,EAAE;QACN,0IAA0I;QAC1I,4HAA4H;QAC5H,6EAA6E;QAC7E,oDAAoD;KACvD;IACD,OAAO,EAAE;QACL,0GAA0G;QAC1G,oGAAoG;QACpG,4FAA4F;QAC5F,oDAAoD;KACvD;IACD,OAAO,EAAE;QACL,yGAAyG;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AE,CAAC,CAAC,CAAC,IAAI;gCACjJ,cAAc,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,IAAI,EAAG,UAAkB,CAAC,IAAI,EAAE,IAAI,EAAG,UAAkB,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI;6BACzG;4BACD,KAAK;yBACR,EAAE,IAAI,EAAE,CAAC,CAAC;qBACd,CAAC;aACL,CAAC;QACN,CAAC,CACJ,CAAC;IACN,CAAC;CACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token-tools.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/token-tools.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAc,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"token-tools.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/token-tools.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAc,MAAM,gBAAgB,CAAC;AA0E/D,eAAO,MAAM,UAAU,EAAE,YA8HxB,CAAC"}
|
|
@@ -11,6 +11,22 @@ function normaliseHex(raw) {
|
|
|
11
11
|
}
|
|
12
12
|
return null;
|
|
13
13
|
}
|
|
14
|
+
// Figma REST API stores colors as { r, g, b, a } in 0–1 range.
|
|
15
|
+
// String() on that object gives "[object Object]", so we convert explicitly.
|
|
16
|
+
function rgbaToHex(v) {
|
|
17
|
+
if (typeof v !== "object" || v === null)
|
|
18
|
+
return null;
|
|
19
|
+
const c = v;
|
|
20
|
+
if (typeof c.r !== "number")
|
|
21
|
+
return null;
|
|
22
|
+
const r = Math.round(c.r * 255).toString(16).padStart(2, "0");
|
|
23
|
+
const g = Math.round((c.g ?? 0) * 255).toString(16).padStart(2, "0");
|
|
24
|
+
const b = Math.round((c.b ?? 0) * 255).toString(16).padStart(2, "0");
|
|
25
|
+
return `#${r}${g}${b}`.toUpperCase();
|
|
26
|
+
}
|
|
27
|
+
function normaliseName(raw) {
|
|
28
|
+
return raw.toLowerCase().replace(/[\s/.]+/g, "-").replace(/^-+|-+$/g, "");
|
|
29
|
+
}
|
|
14
30
|
function buildTokenById(collections) {
|
|
15
31
|
const map = new Map();
|
|
16
32
|
for (const col of collections) {
|
|
@@ -21,6 +37,16 @@ function buildTokenById(collections) {
|
|
|
21
37
|
}
|
|
22
38
|
return map;
|
|
23
39
|
}
|
|
40
|
+
// Returns the alias target ID from a token, regardless of whether the snapshot
|
|
41
|
+
// stores it in aliasTargetId (normalized path) or in value as "VariableID:xx:yy"
|
|
42
|
+
// (raw REST API path before 0.1.18 normalization).
|
|
43
|
+
function getAliasTargetId(token) {
|
|
44
|
+
if (token.aliasTargetId)
|
|
45
|
+
return token.aliasTargetId;
|
|
46
|
+
if (typeof token.value === "string" && /^VariableID:/i.test(token.value))
|
|
47
|
+
return token.value;
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
24
50
|
function resolveTokenValue(token, tokenById) {
|
|
25
51
|
const visited = new Set();
|
|
26
52
|
let cur = token;
|
|
@@ -28,11 +54,18 @@ function resolveTokenValue(token, tokenById) {
|
|
|
28
54
|
if (visited.has(cur.id))
|
|
29
55
|
break;
|
|
30
56
|
visited.add(cur.id);
|
|
57
|
+
// Try RGBA object first (Figma REST API color format)
|
|
58
|
+
const fromRgba = rgbaToHex(cur.value);
|
|
59
|
+
if (fromRgba)
|
|
60
|
+
return fromRgba;
|
|
61
|
+
// Try hex string
|
|
31
62
|
const hex = normaliseHex(String(cur.value ?? ""));
|
|
32
63
|
if (hex)
|
|
33
64
|
return hex;
|
|
34
|
-
|
|
35
|
-
|
|
65
|
+
// Follow alias — aliasTargetId (normalized) or VariableID value (raw)
|
|
66
|
+
const aliasId = getAliasTargetId(cur);
|
|
67
|
+
if (aliasId) {
|
|
68
|
+
const next = tokenById.get(aliasId);
|
|
36
69
|
if (next) {
|
|
37
70
|
cur = next.token;
|
|
38
71
|
continue;
|
|
@@ -69,49 +102,17 @@ export const tokenTools = {
|
|
|
69
102
|
}));
|
|
70
103
|
return { content: [{ type: "text", text: JSON.stringify(summary, null, 2) }] };
|
|
71
104
|
});
|
|
72
|
-
server.tool("get_token",
|
|
73
|
-
let ctx;
|
|
74
|
-
try {
|
|
75
|
-
ctx = await getContext();
|
|
76
|
-
}
|
|
77
|
-
catch (e) {
|
|
78
|
-
return { content: [{ type: "text", text: e.message }] };
|
|
79
|
-
}
|
|
80
|
-
const query = tokenPath.toLowerCase();
|
|
81
|
-
const matches = [];
|
|
82
|
-
const tokenById = buildTokenById((ctx.snapshot.tokens ?? []));
|
|
83
|
-
for (const col of (ctx.snapshot.tokens ?? [])) {
|
|
84
|
-
for (const token of col.tokens ?? []) {
|
|
85
|
-
const tokenName = token.name ?? "";
|
|
86
|
-
const cssVar = getPTBTokenVariableName(col.name, tokenName);
|
|
87
|
-
if (tokenName.toLowerCase().includes(query) || cssVar.toLowerCase().includes(query)) {
|
|
88
|
-
matches.push({
|
|
89
|
-
collection: col.name,
|
|
90
|
-
name: tokenName,
|
|
91
|
-
cssVar,
|
|
92
|
-
resolvedValue: resolveTokenValue(token, tokenById),
|
|
93
|
-
valueType: token.type ?? null,
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
if (matches.length === 0) {
|
|
99
|
-
return { content: [{ type: "text", text: `No tokens found matching '${tokenPath}'.` }] };
|
|
100
|
-
}
|
|
101
|
-
return { content: [{ type: "text", text: JSON.stringify(matches, null, 2) }] };
|
|
102
|
-
});
|
|
103
|
-
server.tool("get_token_by_value", `Reverse-lookup: given a color hex value OR a Figma variable name, return the matching --ptb-* token(s) with their full 4-tier resolution chain.
|
|
104
|
-
|
|
105
|
-
PTB owns the token identity map — this tool makes that map queryable from the composite (Figma + PTB) workflow. When Figma's get_variable_defs returns a variable like "surface/surface-info-light = #E5F3FF", use this tool to find the canonical --ptb-* name instead of guessing the convention manually.
|
|
105
|
+
server.tool("get_token", `Look up a design token by name, path, or color hex value.
|
|
106
106
|
|
|
107
107
|
Accepts:
|
|
108
|
-
-
|
|
109
|
-
- Figma variable name:
|
|
110
|
-
-
|
|
108
|
+
- Name or partial path: 'brand.900', 'spacing.4', 'border-radius' (substring match)
|
|
109
|
+
- Figma variable name: 'surface/surface-info-light', 'Brand/900' (slash-separated)
|
|
110
|
+
- Hex color: '#E5F3FF' or 'e5f3ff' (# optional) — reverse-lookup by resolved value
|
|
111
|
+
|
|
112
|
+
Returns: collection, tokenName, cssVar (--ptb-* variable), resolvedValue, aliasChain (when present).
|
|
111
113
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
}, async ({ value }) => {
|
|
114
|
+
PTB owns the token identity map — use hex lookup when Figma's get_variable_defs returns a
|
|
115
|
+
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 }) => {
|
|
115
116
|
let ctx;
|
|
116
117
|
try {
|
|
117
118
|
ctx = await getContext();
|
|
@@ -119,21 +120,22 @@ Returns: collection, tokenName, cssVar (--ptb-* variable), resolvedValue, aliasC
|
|
|
119
120
|
catch (e) {
|
|
120
121
|
return { content: [{ type: "text", text: e.message }] };
|
|
121
122
|
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
const hexQuery = normaliseHex(value);
|
|
126
|
-
const nameQuery = normaliseName(value);
|
|
123
|
+
const hexQuery = normaliseHex(query);
|
|
124
|
+
const nameQueryLower = query.toLowerCase();
|
|
125
|
+
const nameQueryNorm = normaliseName(query);
|
|
127
126
|
const tokenById = buildTokenById((ctx.snapshot.tokens ?? []));
|
|
128
127
|
function buildAliasChain(token) {
|
|
129
128
|
const chain = [];
|
|
130
129
|
const visited = new Set();
|
|
131
130
|
let cur = token;
|
|
132
|
-
while (cur
|
|
131
|
+
while (cur) {
|
|
132
|
+
const aliasId = getAliasTargetId(cur);
|
|
133
|
+
if (!aliasId)
|
|
134
|
+
break;
|
|
133
135
|
if (visited.has(cur.id))
|
|
134
136
|
break;
|
|
135
137
|
visited.add(cur.id);
|
|
136
|
-
const next = tokenById.get(
|
|
138
|
+
const next = tokenById.get(aliasId);
|
|
137
139
|
if (!next)
|
|
138
140
|
break;
|
|
139
141
|
chain.push(getPTBTokenVariableName(next.collectionName, next.token.name));
|
|
@@ -149,13 +151,23 @@ Returns: collection, tokenName, cssVar (--ptb-* variable), resolvedValue, aliasC
|
|
|
149
151
|
const tokenName = t.name ?? "";
|
|
150
152
|
const cssVar = getPTBTokenVariableName(col.name, tokenName);
|
|
151
153
|
const resolvedValue = resolveTokenValue(t, tokenById);
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
154
|
+
let matched = false;
|
|
155
|
+
if (hexQuery !== null) {
|
|
156
|
+
// Hex lookup: match by resolved color value
|
|
157
|
+
matched = normaliseHex(resolvedValue) === hexQuery;
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
// Name lookup: match by tokenName or cssVar using both
|
|
161
|
+
// normalization styles (dot-path lowercase and slash-to-dash)
|
|
162
|
+
const normToken = normaliseName(tokenName);
|
|
163
|
+
const normCssVar = normaliseName(cssVar);
|
|
164
|
+
matched =
|
|
165
|
+
tokenName.toLowerCase().includes(nameQueryLower) ||
|
|
166
|
+
cssVar.toLowerCase().includes(nameQueryLower) ||
|
|
167
|
+
normToken.includes(nameQueryNorm) ||
|
|
168
|
+
normCssVar.includes(nameQueryNorm);
|
|
169
|
+
}
|
|
170
|
+
if (matched) {
|
|
159
171
|
const key = `${col.name}::${tokenName}`;
|
|
160
172
|
if (seen.has(key))
|
|
161
173
|
continue;
|
|
@@ -173,9 +185,9 @@ Returns: collection, tokenName, cssVar (--ptb-* variable), resolvedValue, aliasC
|
|
|
173
185
|
}
|
|
174
186
|
}
|
|
175
187
|
if (matches.length === 0) {
|
|
176
|
-
const hint = hexQuery
|
|
177
|
-
? `No token found with resolved value ${hexQuery}. The token may
|
|
178
|
-
: `No
|
|
188
|
+
const hint = hexQuery !== null
|
|
189
|
+
? `No token found with resolved value ${hexQuery}. The token may use an alias chain — try a name fragment instead.`
|
|
190
|
+
: `No tokens found matching '${query}'. Try a shorter fragment or a hex value.`;
|
|
179
191
|
return { content: [{ type: "text", text: hint }] };
|
|
180
192
|
}
|
|
181
193
|
return { content: [{ type: "text", text: JSON.stringify(matches, null, 2) }] };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token-tools.js","sourceRoot":"","sources":["../../../src/mcp/tools/token-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAE7D,SAAS,YAAY,CAAC,GAAW;IAC7B,MAAM,QAAQ,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAC9C,IAAI,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;QACpC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACrC,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,WAAW,EAAE,CAAC;IACrD,CAAC;IACD,IAAI,oBAAoB,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;QACtC,OAAO,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC;IACpD,CAAC;IACD,OAAO,IAAI,CAAC;AAChB,CAAC;AAED,SAAS,
|
|
1
|
+
{"version":3,"file":"token-tools.js","sourceRoot":"","sources":["../../../src/mcp/tools/token-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EA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-1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify-tool.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/verify-tool.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAc,MAAM,gBAAgB,CAAC;AAgB/D,eAAO,MAAM,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"verify-tool.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/verify-tool.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAc,MAAM,gBAAgB,CAAC;AAgB/D,eAAO,MAAM,UAAU,EAAE,YAqHxB,CAAC"}
|