@flashdsm/genome 0.1.0 → 0.2.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.
- package/README.md +175 -19
- package/dist/{chunk-6OCQZNS7.js → chunk-PHEWKKKF.js} +14 -357
- package/dist/index.d.ts +70 -6
- package/dist/index.js +4008 -357
- package/dist/smoke.js +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,46 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
3
|
+
import { WorkspaceScanResult } from '@flash-ds/core';
|
|
4
|
+
|
|
5
|
+
declare function scanWorkspace(workspaceRoot: string): Promise<WorkspaceScanResult>;
|
|
6
|
+
|
|
7
|
+
type ApiClient = {
|
|
8
|
+
health(): Promise<{
|
|
9
|
+
status: string;
|
|
10
|
+
}>;
|
|
11
|
+
listDesignSystems(): Promise<unknown[]>;
|
|
12
|
+
createFromCodeScan(body: {
|
|
13
|
+
name?: string;
|
|
14
|
+
scan?: unknown;
|
|
15
|
+
}): Promise<{
|
|
16
|
+
id: number;
|
|
17
|
+
name: string;
|
|
18
|
+
editor_url: string;
|
|
19
|
+
fidelity: unknown;
|
|
20
|
+
schema_version: string;
|
|
21
|
+
revision: number;
|
|
22
|
+
/** Tokens per category after the server parsed the scan's files. */
|
|
23
|
+
found?: Record<string, number>;
|
|
24
|
+
}>;
|
|
25
|
+
getDesignSystem(id: number): Promise<{
|
|
26
|
+
document?: unknown;
|
|
27
|
+
}>;
|
|
28
|
+
proposeCodeScan(id: number, body: {
|
|
29
|
+
scan: unknown;
|
|
30
|
+
}): Promise<{
|
|
31
|
+
change_set_id: number | null;
|
|
32
|
+
no_changes: boolean;
|
|
33
|
+
changes: number;
|
|
34
|
+
summary: string;
|
|
35
|
+
skipped: string[];
|
|
36
|
+
detected_css_prefix: string | null;
|
|
37
|
+
css_prefix: string | null;
|
|
38
|
+
}>;
|
|
39
|
+
};
|
|
40
|
+
declare function createApiClient(opts: {
|
|
41
|
+
baseUrl: string;
|
|
42
|
+
accessToken: string | null;
|
|
43
|
+
}): ApiClient;
|
|
3
44
|
|
|
4
45
|
/**
|
|
5
46
|
* flash-genome - Flash Genome, the local MCP for a customer design system (stdio).
|
|
@@ -9,13 +50,36 @@ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
|
9
50
|
*
|
|
10
51
|
* Tools: get_tokens, list_components, get_component, get_brand_dna,
|
|
11
52
|
* suggest_token, apply_token_patch, generate_component_prompt,
|
|
12
|
-
* check_violations, scan_workspace,
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
53
|
+
* check_violations, scan_workspace, capture_project_shell, scan_usage,
|
|
54
|
+
* pull_from_web,
|
|
55
|
+
* detect_drift, push_to_web, list_modules, get_module, get_relations,
|
|
56
|
+
* get_impact, sync_context, api_health, list_design_systems. The pre-rename
|
|
57
|
+
* names (get_design_tokens, suggest_token_usage, list_violations) answer
|
|
58
|
+
* too, for one release.
|
|
16
59
|
*/
|
|
17
60
|
|
|
18
|
-
declare const TOOL_NAMES: readonly ["get_tokens", "list_components", "get_component", "get_brand_dna", "suggest_token", "apply_token_patch", "generate_component_prompt", "check_violations", "scan_workspace", "pull_from_web", "detect_drift", "push_to_web", "list_modules", "get_module", "get_relations", "get_impact", "sync_context", "api_health", "list_design_systems"];
|
|
61
|
+
declare const TOOL_NAMES: readonly ["get_tokens", "list_components", "get_component", "get_brand_dna", "suggest_token", "apply_token_patch", "generate_component_prompt", "check_violations", "scan_workspace", "capture_project_shell", "scan_usage", "pull_from_web", "detect_drift", "push_to_web", "list_modules", "get_module", "get_relations", "get_impact", "sync_context", "api_health", "list_design_systems"];
|
|
62
|
+
declare function parseCliArgs(argv: string[]): {
|
|
63
|
+
command?: string;
|
|
64
|
+
tokensPath?: string;
|
|
65
|
+
componentsPath?: string;
|
|
66
|
+
configPath?: string;
|
|
67
|
+
apiUrl?: string;
|
|
68
|
+
accessToken?: string;
|
|
69
|
+
token?: string;
|
|
70
|
+
/** Workspace root for pull / push / drift / init. */
|
|
71
|
+
cwd?: string;
|
|
72
|
+
/** init: the setup code from Flash's "From your code" prompt. */
|
|
73
|
+
code?: string;
|
|
74
|
+
/** init / connect: the new system's name (default: package.json's, then the folder's). */
|
|
75
|
+
name?: string;
|
|
76
|
+
/** connect: print the link instead of opening the browser. */
|
|
77
|
+
noOpen: boolean;
|
|
78
|
+
/** pull / push: write, rather than print the plan. */
|
|
79
|
+
confirm: boolean;
|
|
80
|
+
/** pull / push / drift: one JSON object on stdout. */
|
|
81
|
+
json: boolean;
|
|
82
|
+
};
|
|
19
83
|
declare function createServer(opts: {
|
|
20
84
|
tokenFile: string;
|
|
21
85
|
componentsFile: string;
|
|
@@ -37,4 +101,4 @@ declare function createServer(opts: {
|
|
|
37
101
|
*/
|
|
38
102
|
declare function isEntryPoint(argv1: string | undefined, moduleUrl: string): boolean;
|
|
39
103
|
|
|
40
|
-
export { TOOL_NAMES, createServer, isEntryPoint };
|
|
104
|
+
export { TOOL_NAMES, createApiClient, createServer, isEntryPoint, parseCliArgs, scanWorkspace };
|