@fragments-sdk/context 0.6.0 → 0.6.1
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/{chunk-62K7BSAT.js → chunk-3IBKSLZY.js} +4 -4
- package/dist/{chunk-XVZH4IVV.js → chunk-RQ46R2HQ.js} +2 -0
- package/dist/cli-commands/index.js +1 -1
- package/dist/index.js +2 -2
- package/dist/mcp-tools/index.d.ts +6 -5
- package/dist/mcp-tools/index.js +1 -1
- package/dist/types/index.d.ts +4 -0
- package/package.json +1 -1
|
@@ -247,7 +247,7 @@ var MCP_TOOL_DEFINITIONS = [
|
|
|
247
247
|
},
|
|
248
248
|
{
|
|
249
249
|
key: "perf",
|
|
250
|
-
description: "Query component performance data (bundle sizes, complexity tiers, budget status). Returns measured bundle sizes
|
|
250
|
+
description: "Query component performance data (bundle sizes, complexity tiers, budget status). Returns measured bundle sizes when the active source provides performance data. Run `fragments perf` first to generate measurements for local fragments.json sources.",
|
|
251
251
|
params: {
|
|
252
252
|
component: {
|
|
253
253
|
type: "string",
|
|
@@ -343,14 +343,14 @@ var CLI_TOOL_EXTENSIONS = [
|
|
|
343
343
|
},
|
|
344
344
|
{
|
|
345
345
|
key: "fix",
|
|
346
|
-
description: "Generate patches to fix token compliance issues in a component. Returns unified diff patches that replace hardcoded CSS values with design token references. Use this after
|
|
346
|
+
description: "Generate patches to fix token compliance issues in a component. Returns unified diff patches that replace hardcoded CSS values with design token references. Use this after the render tool identifies issues to automatically fix them.",
|
|
347
347
|
params: {}
|
|
348
348
|
}
|
|
349
349
|
];
|
|
350
350
|
function buildToolNames(prefix) {
|
|
351
351
|
const map = {};
|
|
352
352
|
for (const def of MCP_TOOL_DEFINITIONS) {
|
|
353
|
-
map[def.key] = `${prefix}_${def.key}
|
|
353
|
+
map[def.key] = prefix ? `${prefix}_${def.key}` : def.key;
|
|
354
354
|
}
|
|
355
355
|
return map;
|
|
356
356
|
}
|
|
@@ -382,7 +382,7 @@ function buildMcpTools(prefix, extensions) {
|
|
|
382
382
|
properties[name] = prop;
|
|
383
383
|
}
|
|
384
384
|
return {
|
|
385
|
-
name: `${prefix}_${def.key}
|
|
385
|
+
name: prefix ? `${prefix}_${def.key}` : def.key,
|
|
386
386
|
description: ext?.description ?? def.description,
|
|
387
387
|
inputSchema: {
|
|
388
388
|
type: "object",
|
|
@@ -84,6 +84,8 @@ var CLI_COMMANDS = [
|
|
|
84
84
|
{ flags: "--registry", description: "Also generate .fragments/registry.json and context.md" },
|
|
85
85
|
{ flags: "--registry-only", description: "Only generate .fragments/ directory (skip fragments.json)" },
|
|
86
86
|
{ flags: "--from-source", description: "Build from source code (zero-config, no fragment files needed)" },
|
|
87
|
+
{ flags: "--if-needed", description: "Skip rebuilding when fragments.json is already fresh" },
|
|
88
|
+
{ flags: "--check", description: "Check whether fragments.json is fresh and exit non-zero if it is stale" },
|
|
87
89
|
{ flags: "--skip-usage", description: "Skip usage analysis when building from source" },
|
|
88
90
|
{ flags: "--skip-storybook", description: "Skip Storybook parsing when building from source" },
|
|
89
91
|
{ flags: "-v, --verbose", description: "Verbose output" }
|
package/dist/index.js
CHANGED
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
MCP_TOOL_DEFINITIONS,
|
|
4
4
|
buildMcpTools,
|
|
5
5
|
buildToolNames
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-3IBKSLZY.js";
|
|
7
7
|
import {
|
|
8
8
|
CLI_COMMANDS,
|
|
9
9
|
CLI_COMMAND_CATEGORIES
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-RQ46R2HQ.js";
|
|
11
11
|
import {
|
|
12
12
|
chunkByAST,
|
|
13
13
|
chunkByLines,
|
|
@@ -15,7 +15,7 @@ interface McpToolParam {
|
|
|
15
15
|
properties?: Record<string, McpToolParam>;
|
|
16
16
|
}
|
|
17
17
|
interface McpToolDefinition {
|
|
18
|
-
/** Short key used
|
|
18
|
+
/** Short key used as the canonical tool name, e.g. "discover" */
|
|
19
19
|
key: string;
|
|
20
20
|
description: string;
|
|
21
21
|
params: Record<string, McpToolParam>;
|
|
@@ -41,13 +41,14 @@ interface McpSdkTool {
|
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
43
|
/**
|
|
44
|
-
* Build a TOOL_NAMES map: `{ discover: "
|
|
44
|
+
* Build a TOOL_NAMES map: `{ discover: "discover", ... }` by default.
|
|
45
|
+
* Pass a prefix only for embedding scenarios that intentionally namespace tools.
|
|
45
46
|
*/
|
|
46
|
-
declare function buildToolNames(prefix
|
|
47
|
+
declare function buildToolNames(prefix?: string): Record<string, string>;
|
|
47
48
|
/**
|
|
48
49
|
* Build MCP SDK `Tool[]` from shared definitions, optionally merging CLI
|
|
49
|
-
* extensions.
|
|
50
|
+
* extensions. Tool names are bare by default.
|
|
50
51
|
*/
|
|
51
|
-
declare function buildMcpTools(prefix
|
|
52
|
+
declare function buildMcpTools(prefix?: string, extensions?: CliToolExtension[]): McpSdkTool[];
|
|
52
53
|
|
|
53
54
|
export { CLI_TOOL_EXTENSIONS, type CliToolExtension, MCP_TOOL_DEFINITIONS, type McpToolDefinition, type McpToolParam, buildMcpTools, buildToolNames };
|
package/dist/mcp-tools/index.js
CHANGED
package/dist/types/index.d.ts
CHANGED
|
@@ -219,6 +219,10 @@ interface PerformanceSummary {
|
|
|
219
219
|
interface CompiledFragmentsFile {
|
|
220
220
|
version: string;
|
|
221
221
|
generatedAt: string;
|
|
222
|
+
/** CLI version that produced this file, used for freshness checks */
|
|
223
|
+
generatorVersion?: string;
|
|
224
|
+
/** Relative source/config inputs used to build this file, used for freshness checks */
|
|
225
|
+
buildInputs?: string[];
|
|
222
226
|
packageName?: string;
|
|
223
227
|
fragments: Record<string, CompiledFragment>;
|
|
224
228
|
blocks?: Record<string, CompiledBlock>;
|