@fragments-sdk/context 0.6.1 → 0.7.0

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.
@@ -50,6 +50,11 @@ var MCP_TOOL_DEFINITIONS = [
50
50
  type: "string",
51
51
  enum: ["compact", "standard", "full"],
52
52
  description: 'Response detail level: "compact" (names only), "standard" (default), "full" (everything including code)'
53
+ },
54
+ depth: {
55
+ type: "string",
56
+ enum: ["quick", "full"],
57
+ description: 'Search depth for useCase mode. "quick" (default): component suggestions only. "full": also returns matching blocks with code, relevant CSS tokens, and import statements \u2014 everything needed to implement in one call.'
53
58
  }
54
59
  }
55
60
  },
@@ -135,26 +140,6 @@ var MCP_TOOL_DEFINITIONS = [
135
140
  }
136
141
  }
137
142
  },
138
- {
139
- key: "implement",
140
- description: "One-shot implementation helper. Describe what you want to build and get everything needed in a single call: best-matching component(s) with full props and code examples, relevant composition blocks, and applicable CSS tokens. Saves multiple round-trips.",
141
- params: {
142
- useCase: {
143
- type: "string",
144
- description: 'What you want to implement (e.g., "login form", "data table with sorting", "streaming chat messages")'
145
- },
146
- limit: {
147
- type: "number",
148
- description: "Maximum number of components to return (default: 5)"
149
- },
150
- verbosity: {
151
- type: "string",
152
- enum: ["compact", "standard", "full"],
153
- description: 'Response detail level: "compact" (names only), "standard" (default), "full" (all props + examples + full block code)'
154
- }
155
- },
156
- required: ["useCase"]
157
- },
158
143
  {
159
144
  key: "render",
160
145
  description: "Render a component and return a screenshot. Optionally compare against a Figma design ('figmaUrl'). Requires a running Fragments dev server (viewer URL). Use this to verify your implementation looks correct.",
@@ -243,7 +228,7 @@ var MCP_TOOL_DEFINITIONS = [
243
228
  description: "Max traversal depth for impact mode (default: 3)"
244
229
  }
245
230
  },
246
- required: ["mode"]
231
+ required: []
247
232
  },
248
233
  {
249
234
  key: "perf",
@@ -323,6 +308,73 @@ var MCP_TOOL_DEFINITIONS = [
323
308
  }
324
309
  },
325
310
  required: ["spec"]
311
+ },
312
+ {
313
+ key: "validate_and_fix",
314
+ description: "Validate a UI spec against governance policies and deterministically repair deprecated component usage when a safe canonical replacement exists. Returns the verdict, any applied replacements, and the fixed spec when successful.",
315
+ params: {
316
+ spec: {
317
+ type: "object",
318
+ description: "The UI spec to validate and repair. Format: { nodes: [{ id, type, props, children }], root?, metadata? }"
319
+ },
320
+ policy: {
321
+ type: "object",
322
+ description: "Optional policy overrides to merge with the base policy. Same shape as govern.config.ts rules."
323
+ },
324
+ applyFixes: {
325
+ type: "boolean",
326
+ description: "If true (default), applies deterministic repairs before re-validating the spec."
327
+ },
328
+ format: {
329
+ type: "string",
330
+ description: 'Output format: "json" (default) or "summary" (compact text)',
331
+ enum: ["json", "summary"]
332
+ }
333
+ },
334
+ required: ["spec"]
335
+ },
336
+ {
337
+ key: "findings_list",
338
+ description: "List governance findings for a project from Fragments Cloud. Returns violations detected by CI checks or repo scans. Requires a Cloud API key (FRAGMENTS_API_KEY). Filter by status, severity, category, ruleId, or file path.",
339
+ params: {
340
+ status: {
341
+ type: "string",
342
+ enum: ["open", "resolved", "ignored"],
343
+ description: 'Filter by finding status (default: "open")'
344
+ },
345
+ severity: {
346
+ type: "string",
347
+ enum: ["error", "warning", "info"],
348
+ description: "Filter by severity level"
349
+ },
350
+ category: {
351
+ type: "string",
352
+ description: 'Filter by violation category (e.g., "tokens/hardcoded-color")'
353
+ },
354
+ ruleId: {
355
+ type: "string",
356
+ description: "Filter by governance rule ID"
357
+ },
358
+ filePath: {
359
+ type: "string",
360
+ description: "Filter findings whose file path starts with this prefix"
361
+ },
362
+ limit: {
363
+ type: "number",
364
+ description: "Maximum number of findings to return (default: 50, max: 200)"
365
+ }
366
+ }
367
+ },
368
+ {
369
+ key: "findings_for_file",
370
+ description: "Get all open governance findings for a specific file from Fragments Cloud. Returns findings sorted by line number. Requires a Cloud API key (FRAGMENTS_API_KEY).",
371
+ params: {
372
+ filePath: {
373
+ type: "string",
374
+ description: "Exact file path to retrieve findings for"
375
+ }
376
+ },
377
+ required: ["filePath"]
326
378
  }
327
379
  ];
328
380
  var CLI_TOOL_EXTENSIONS = [
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  MCP_TOOL_DEFINITIONS,
4
4
  buildMcpTools,
5
5
  buildToolNames
6
- } from "./chunk-3IBKSLZY.js";
6
+ } from "./chunk-PIWQB6CK.js";
7
7
  import {
8
8
  CLI_COMMANDS,
9
9
  CLI_COMMAND_CATEGORIES
@@ -3,7 +3,7 @@ import {
3
3
  MCP_TOOL_DEFINITIONS,
4
4
  buildMcpTools,
5
5
  buildToolNames
6
- } from "../chunk-3IBKSLZY.js";
6
+ } from "../chunk-PIWQB6CK.js";
7
7
  export {
8
8
  CLI_TOOL_EXTENSIONS,
9
9
  MCP_TOOL_DEFINITIONS,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fragments-sdk/context",
3
- "version": "0.6.1",
3
+ "version": "0.7.0",
4
4
  "license": "FSL-1.1-MIT",
5
5
  "description": "Code intelligence and RAG primitives for design system and codebase indexing",
6
6
  "author": "Conan McNicholl",