@tempo-ai/mcp 0.0.100-staging.1 → 0.0.100

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/bin.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import { createRequire as __tempoCreateRequire } from 'node:module'; const require = __tempoCreateRequire(import.meta.url);
3
3
  import {
4
4
  run
5
- } from "./chunk-QTTJRK4J.js";
5
+ } from "./chunk-EYHFTWP5.js";
6
6
  import "./chunk-JDPG7F4Z.js";
7
7
 
8
8
  // src/bin.ts
@@ -127,7 +127,7 @@ async function run(argv) {
127
127
  process.stderr.write(USAGE);
128
128
  return 1;
129
129
  }
130
- const { runServe } = await import("./serve-OI2RGYVP.js");
130
+ const { runServe } = await import("./serve-ODDE266E.js");
131
131
  return await runServe(options);
132
132
  }
133
133
  switch (subcommand) {
@@ -153,4 +153,4 @@ async function run(argv) {
153
153
  export {
154
154
  run
155
155
  };
156
- //# sourceMappingURL=chunk-QTTJRK4J.js.map
156
+ //# sourceMappingURL=chunk-EYHFTWP5.js.map
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { createRequire as __tempoCreateRequire } from 'node:module'; const require = __tempoCreateRequire(import.meta.url);
2
2
  import {
3
3
  run
4
- } from "./chunk-QTTJRK4J.js";
4
+ } from "./chunk-EYHFTWP5.js";
5
5
  import "./chunk-JDPG7F4Z.js";
6
6
  export {
7
7
  run
@@ -15833,9 +15833,9 @@ Only as a narrow escape hatch:
15833
15833
 
15834
15834
  If a canvas-local file contains more than ~30 lines of UI code, that UI belongs in the app \u2014 unless it exists purely for canvas narration, which is prose about the design rather than product UI.
15835
15835
 
15836
- ### Explore before you build (required when adding new UI to the app)
15836
+ ### Explore before UI work (required when creating or changing app UI)
15837
15837
 
15838
- Before writing a single line of new UI, read the existing app to learn its patterns. This step is non-negotiable \u2014 skipping it is the #1 cause of canvases that "look like code from a random place":
15838
+ Before creating, modifying, restyling, or reviewing UI, read the existing app to learn its patterns. This step is non-negotiable \u2014 skipping it is the #1 cause of canvases that "look like code from a random place":
15839
15839
 
15840
15840
  1. **Routing** \u2014 read the app's router (\`src/App.tsx\`, \`app/\` directory, route config) to understand how pages are registered and how the app shell wraps them. If the new UI is a page, wire it into the real router.
15841
15841
  2. **Sibling screens** \u2014 read 2\u20133 existing screen/page components most similar to what you're building. Match their:
@@ -15844,7 +15844,7 @@ Before writing a single line of new UI, read the existing app to learn its patte
15844
15844
  - Layout primitives (AppShell? Sidebar + content? Card grid?)
15845
15845
  - State patterns (Redux slice? Context? Local state? RTK Query? Supabase?)
15846
15846
  - Styling approach (Tailwind classes? CSS modules? tokens from a theme file?)
15847
- 3. **Design system** \u2014 before reaching for a raw \`<div>\` or \`<button>\`, query the project's design system: \`asset_list\` returns every blessed component with a \`useFor\` line saying when to use it, and \`asset_get\` gives variants with real prop values. If the index is empty (no assembled design system), fall back to checking \`components/ui/\`, \`components/common/\`, or equivalent for an existing primitive. Prefer the app's components over hand-rolled ones every time.
15847
+ 3. **Asset libraries** \u2014 query the project's reusable collections before reaching for a raw \`<div>\` or \`<button>\`: \`asset_list\` returns every blessed component with \`usageInstructions\` saying when to use it, and \`asset_get\` gives variants with real prop values. These libraries include the design system and may include other approved collections. If the index is empty or has no suitable asset, fall back to checking \`components/ui/\`, \`components/common/\`, or equivalent for an existing primitive. Prefer the app's components over hand-rolled ones every time.
15848
15848
  4. **Providers** \u2014 confirm the app's entry point wires every provider the new component needs. If you add a provider to make the new UI work, add it to the app's entry, not to CanvasProviders.
15849
15849
  5. **Mock data** \u2014 if backing data isn't available yet, hardcode realistic fixtures inline in the component as a "UI-only prototype". Do not build API clients or data-fetching scaffolding for a prototype.
15850
15850
 
@@ -16323,6 +16323,17 @@ If anything looks wrong, fix before calling \`finish_working_on_canvas\`. The us
16323
16323
 
16324
16324
  ---
16325
16325
 
16326
+ ## 9.1 Pixel-perfect replication
16327
+
16328
+ For UI that already exists, measure instead of guessing:
16329
+
16330
+ 1. Capture the reference at the target viewport through the Tempo CDP endpoint. Use \`get_tempo_context\` to match Browser tabs by URL; inspect computed styles only when the screenshot is insufficient.
16331
+ 2. Reuse the real components and tokens where possible.
16332
+ 3. Capture your result, compare it with the reference, fix visible differences, and repeat until they match. The one-screenshot limit above does not apply to this loop.
16333
+ 4. For state-heavy UI, prefer a \`<RouteStoryboard>\` over rebuilding the screen.
16334
+
16335
+ ---
16336
+
16326
16337
  ## 10. Constraints
16327
16338
 
16328
16339
  - No UUIDs, no JSON canvas configs
@@ -17245,23 +17256,24 @@ function registerDocs(server, context) {
17245
17256
 
17246
17257
  // ../canvas-mcp/instructions.ts
17247
17258
  function buildCanvasInstructions(canvasesDir, options) {
17248
- const designSystemSection = options?.assetsEnabled === false ? "" : `## The design system \u2014 check it before building UI
17259
+ const assetLibrarySection = options?.assetsEnabled === false ? "" : `## Asset libraries
17249
17260
 
17250
- When the user mentions the "design system", a component library, or reusable components \u2014 or you are about to write ANY new UI \u2014 call \`asset_list\` (or \`asset_list_libraries\`) FIRST and reuse what it returns; every asset's \`usageInstructions\` says when to use it. All asset_* reads are cheap: call them freely, no guide needed. To ADD or EDIT assets, FIRST call get_guide({ topic: "tempo-assets-instructions" }) \u2014 membership is canvas-declared (\`defineAsset\` on the showcasing canvas, declaring the TOP-LEVEL component a consumer imports \u2014 \`Select\`, never \`SelectTrigger\`).
17261
+ Before creating, modifying, restyling, or reviewing ANY UI, call \`asset_list\` FIRST and reuse results per \`usageInstructions\`. Do the same for design system, component library, or UI kit requests; use \`asset_list_libraries\` for a collection overview. To ADD or EDIT asset declarations, FIRST call get_guide({ topic: "tempo-assets-instructions" }) \u2014 \`defineAsset\` declares the TOP-LEVEL component consumers import (\`Select\`, never \`SelectTrigger\`).
17251
17262
 
17252
17263
  `;
17253
- return `Tempo's "Design" tab is a code-first Figma alternative. Canvases live under the canvases root ${canvasesDir}/, holding storyboards that render PRODUCTION components and routes \u2014 never mocks of existing UI.
17264
+ return `Tempo's "Design" tab is a code-first Figma alternative. Canvases live under the canvases root ${canvasesDir}/, whose storyboards render PRODUCTION components and routes \u2014 never mocks of existing UI.
17254
17265
 
17255
17266
  Before any canvas change \u2014 including tempo.config.json edits (Docker, custom launchers, ports) \u2014 you MUST call get_guide({ topic: "tempo-canvas-instructions" }); it holds every protocol and overrides this summary.
17256
17267
 
17257
- ${designSystemSection}## Hard invariants
17268
+ ${assetLibrarySection}## Hard invariants
17258
17269
 
17259
- - No tempo.config.json \u2192 run canvas_project_init BEFORE any canvas work. \`tempo/\` is Tempo's canvas host, NOT the user's app \u2014 build new UI in the real app and import it, never inside the canvas folder.
17270
+ - No tempo.config.json \u2192 canvas_project_init BEFORE any canvas work. \`tempo/\` is Tempo's canvas host, NOT the user's app \u2014 build new UI in the real app and import it, never inside the canvas folder.
17260
17271
  - Zone canvases (design-system/**, libraries/<libname>/**) MUST defineAsset-declare their showcased components \u2014 else canvas_validate fails missing_asset_declaration.
17261
17272
  - Bookend every canvas session: start_working_on_canvas BEFORE the first mutating call (canvas_create included) \u2192 edits \u2192 canvas_screenshot on ONE edited storyboard \u2192 finish_working_on_canvas once. On screenshot failure: canvas_debug once, no retries.
17262
- - Write is blocked on *.canvas.tsx \u2014 canvas_create creates canvases, Edit modifies them.
17263
- - Route storyboards need the user's real app: set_app_dev_command once, start_app_dev_server before screenshotting one.
17264
- - Link new canvases to their sibling issue/doc via link_items (branch pushed).`;
17273
+ - Write is blocked on *.canvas.tsx \u2014 canvas_create creates, Edit modifies.
17274
+ - Route storyboards need the user's real app: set_app_dev_command once, start_app_dev_server before screenshots.
17275
+ - Replicating existing UI (live page, Browser tab, URL)? Pixel parity is the goal: capture its screenshot/HTML/styles via the CDP endpoint, loop canvas_screenshot against it \u2014 guide \xA79.1.
17276
+ - Link new canvases to sibling issue/doc via link_items (branch pushed).`;
17265
17277
  }
17266
17278
 
17267
17279
  // ../canvas-mcp/tools.ts
@@ -20899,7 +20911,7 @@ function countByKind(entries) {
20899
20911
  function registerAssetTools(server, context) {
20900
20912
  server.tool(
20901
20913
  "asset_list_libraries",
20902
- "Start here for anything design-system related: a one-call overview of the project's design system \u2014 its libraries (named groups of assets; a library exists iff some `defineAsset` declaration names it) with component/canvas member counts, plus counts of library-less assets. Call it whenever the user mentions the design system, a component library, or asks what reusable components / building blocks exist. **Read-only and cheap** (fresh static scan of source; no code execution; no guide needed to browse). Returns `{ libraries: [{ name, componentCount, canvasCount }], unassigned: { componentCount, canvasCount } }`.",
20914
+ "Discover the project's asset libraries: named collections of approved reusable components and canvases, including its design system, component library, UI kit, and future collections. Call for a broad collection overview or when the user asks what libraries, reusable components, canvases, or building blocks exist; use asset_list next to search their members. **Read-only and cheap** (fresh source scan; no code execution; no guide needed to browse). Returns `{ libraries: [{ name, componentCount, canvasCount }], unassigned: { componentCount, canvasCount } }`.",
20903
20915
  {},
20904
20916
  async () => {
20905
20917
  try {
@@ -20923,7 +20935,7 @@ function registerAssetTools(server, context) {
20923
20935
  );
20924
20936
  server.tool(
20925
20937
  "asset_library_get",
20926
- "Get one design-system library's members (components and canvases) with per-asset summaries. **Read-only and cheap** \u2014 no guide needed to browse. Returns `{ name, assets: [{ key, kind, name, filePath, usageInstructions?, canvasPath?, variantNames }] }`. Errors `library_not_found` when no asset names the library.",
20938
+ "Get one asset library's approved reusable components and canvases with per-asset summaries. Use after asset_list_libraries when exploring a design system, component library, UI kit, or another named collection. **Read-only and cheap** \u2014 no guide needed to browse. Returns `{ name, assets: [{ key, kind, name, filePath, usageInstructions?, canvasPath?, variantNames }] }`. Errors `library_not_found` when no asset names the library.",
20927
20939
  {
20928
20940
  name: z22.string().describe(
20929
20941
  "Library name, exactly as listed by asset_list_libraries."
@@ -20950,14 +20962,20 @@ function registerAssetTools(server, context) {
20950
20962
  }
20951
20963
  }
20952
20964
  );
20953
- server.tool(
20965
+ server.registerTool(
20954
20966
  "asset_list",
20955
- 'List every asset in the project\'s design system \u2014 the components and canvases declared with `defineAsset` \u2014 optionally filtered by library and/or a name substring. Call it BEFORE building or restyling UI to find an existing component to reuse instead of hand-rolling one: each asset\'s `usageInstructions` is a one-line "when to use it (and when not)". **Read-only and cheap** (fresh static scan; no code execution; no guide needed to browse). Pass `library: ""` (empty string) to select library-less assets; omit `library` to list everything. Returns `{ assets: [{ key, kind, name, filePath, usageInstructions?, canvasPath?, componentFilePath?, variantNames, libraries }], fileErrors? }`. `canvasPath` marks canvas-declared components (the linked canvas folder \u2014 the declaring file is its `index.canvas.tsx`) and `componentFilePath` is the component\'s resolved defining file; `fileErrors` (present only when non-empty) reports structural declaration errors per file, e.g. `duplicate_asset_declaration` and `component_declaration_outside_canvas` \u2014 these also FAIL `canvas_validate` for any canvas they involve.',
20956
20967
  {
20957
- library: z22.string().optional().describe(
20958
- 'Exact library name to filter by. "" (empty string) selects assets that belong to no library.'
20959
- ),
20960
- query: z22.string().optional().describe("Case-insensitive substring match on the asset name.")
20968
+ description: "Primary asset-discovery tool for UI work. Search every approved reusable component and canvas declared with `defineAsset`, across the project's design system, component library, UI kit, and other asset libraries. Call BEFORE creating, modifying, restyling, or reviewing UI to reuse an existing building block instead of hand-rolling one; each asset's `usageInstructions` says when to use it and when not to. **Read-only and cheap** (fresh source scan; no code execution; no guide needed to browse). Filter by library and/or name; pass `library: \"\"` for library-less assets. Returns `{ assets: [{ key, kind, name, filePath, usageInstructions?, canvasPath?, componentFilePath?, variantNames, libraries }], fileErrors? }`. `fileErrors` reports structural declaration problems such as `duplicate_asset_declaration` and `component_declaration_outside_canvas`, which also fail `canvas_validate`.",
20969
+ inputSchema: z22.object({
20970
+ library: z22.string().optional().describe(
20971
+ 'Exact library name to filter by. "" (empty string) selects assets that belong to no library.'
20972
+ ),
20973
+ query: z22.string().optional().describe("Case-insensitive substring match on the asset name.")
20974
+ }),
20975
+ // Claude Code defers MCP definitions behind ToolSearch by default. This
20976
+ // small discovery schema stays visible so the portable skill can call it
20977
+ // immediately; other providers safely ignore this namespaced metadata.
20978
+ _meta: { "anthropic/alwaysLoad": true }
20961
20979
  },
20962
20980
  async ({ library, query }) => {
20963
20981
  try {
@@ -20994,7 +21012,7 @@ function registerAssetTools(server, context) {
20994
21012
  );
20995
21013
  server.tool(
20996
21014
  "asset_get",
20997
- 'Full detail for one asset: config (usageInstructions, libraries), variants with static prop values, warnings, and canvas info \u2014 `canvas` page info for canvas assets, `canvasPath` + `componentFilePath` for components declared on a canvas (the declaring file is `<canvasPath>/index.canvas.tsx`). **Read-only and cheap** \u2014 no guide needed to browse. Prop values the parser could not resolve statically are `{"$unresolved": true}`. `warnings` includes canvas-pointer validation: `missing_canvas_pointer` / `stale_canvas_pointer` mean the component\'s defining file lacks (or misstates) the docstring line naming its canvas path \u2014 the warning message contains the exact line to add; info-level `canvas_pointer_unverified` means the defining file could not be resolved. Errors `asset_not_found` for an unknown key.',
21015
+ 'Inspect one approved asset selected from a design system, component library, UI kit, or another asset library. Call after asset_list before reuse. Returns usageInstructions, library membership, real variants, warnings, and linked canvas/component paths. **Read-only and cheap** \u2014 no guide needed to browse. Prop values the parser could not resolve statically are `{"$unresolved": true}`. Canvas-pointer warnings identify missing or stale links and include the exact repair. Errors `asset_not_found` for an unknown key.',
20998
21016
  {
20999
21017
  assetKey: z22.string().describe(
21000
21018
  'Asset key as returned by the list tools: "<workspace-relative-path>#<bindingName>".'
@@ -45095,7 +45113,7 @@ function isExternallyExposed(toolName, opts) {
45095
45113
  }
45096
45114
 
45097
45115
  // src/version.ts
45098
- var CLI_VERSION = "0.0.100-staging.1";
45116
+ var CLI_VERSION = "0.0.100";
45099
45117
 
45100
45118
  // src/canvas-hooks.ts
45101
45119
  var import_pngjs3 = __toESM(require_png(), 1);
@@ -45977,6 +45995,24 @@ import { createHash as createHash5 } from "crypto";
45977
45995
  import fs6 from "fs/promises";
45978
45996
  import os3 from "os";
45979
45997
  import path57 from "path";
45998
+
45999
+ // ../workspaces/git-worktree/non-interactive-git.ts
46000
+ var NON_INTERACTIVE_GIT_CONFIG = [
46001
+ "credential.interactive=false"
46002
+ ];
46003
+ function nonInteractiveGitEnv(base = process.env) {
46004
+ return {
46005
+ ...base,
46006
+ GIT_TERMINAL_PROMPT: "0",
46007
+ GCM_INTERACTIVE: "never",
46008
+ // Disable OpenSSH's graphical askpass without replacing GIT_SSH,
46009
+ // GIT_SSH_COMMAND, or a repository's core.sshCommand. Replacing those
46010
+ // would break configured transports such as PuTTY/plink.
46011
+ SSH_ASKPASS_REQUIRE: "never"
46012
+ };
46013
+ }
46014
+
46015
+ // ../workspaces/git-worktree/worktree.ts
45980
46016
  var GIT_CONFIG = ["core.optionalLocks=false"];
45981
46017
  function simpleGit2(repoPath) {
45982
46018
  return repoPath ? simpleGit({ baseDir: repoPath, config: [...GIT_CONFIG] }) : simpleGit({ config: [...GIT_CONFIG] });
@@ -46066,9 +46102,9 @@ async function computeShareStatus(repoPath) {
46066
46102
  async function checkBranchOnRemote(repoPath, branch) {
46067
46103
  const git = simpleGit({
46068
46104
  baseDir: repoPath,
46069
- config: [...GIT_CONFIG],
46105
+ config: [...GIT_CONFIG, ...NON_INTERACTIVE_GIT_CONFIG],
46070
46106
  timeout: { block: 15e3 }
46071
- }).env({ ...process.env, GIT_TERMINAL_PROMPT: "0" });
46107
+ }).env(nonInteractiveGitEnv());
46072
46108
  try {
46073
46109
  const out = await git.raw(["ls-remote", "--heads", "origin", branch]);
46074
46110
  return out.trim().length > 0;
@@ -46870,4 +46906,4 @@ export {
46870
46906
  runServe,
46871
46907
  scopeParamsFor
46872
46908
  };
46873
- //# sourceMappingURL=serve-OI2RGYVP.js.map
46909
+ //# sourceMappingURL=serve-ODDE266E.js.map