@framingui/mcp-server 0.6.27 → 0.6.28
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 +3 -1
- package/dist/auth/state.d.ts +11 -0
- package/dist/auth/state.d.ts.map +1 -1
- package/dist/auth/state.js +31 -25
- package/dist/auth/state.js.map +1 -1
- package/dist/auth/verify.d.ts +9 -0
- package/dist/auth/verify.d.ts.map +1 -1
- package/dist/auth/verify.js.map +1 -1
- package/dist/billing/quota-policy.d.ts +13 -0
- package/dist/billing/quota-policy.d.ts.map +1 -0
- package/dist/billing/quota-policy.js +32 -0
- package/dist/billing/quota-policy.js.map +1 -0
- package/dist/billing/tool-metering.d.ts +10 -0
- package/dist/billing/tool-metering.d.ts.map +1 -0
- package/dist/billing/tool-metering.js +126 -0
- package/dist/billing/tool-metering.js.map +1 -0
- package/dist/billing/usage-ledger.d.ts +61 -0
- package/dist/billing/usage-ledger.d.ts.map +1 -0
- package/dist/billing/usage-ledger.js +102 -0
- package/dist/billing/usage-ledger.js.map +1 -0
- package/dist/billing/usage-sync.d.ts +3 -0
- package/dist/billing/usage-sync.d.ts.map +1 -0
- package/dist/billing/usage-sync.js +40 -0
- package/dist/billing/usage-sync.js.map +1 -0
- package/dist/cli/agent-md-templates.d.ts.map +1 -1
- package/dist/cli/agent-md-templates.js +4 -2
- package/dist/cli/agent-md-templates.js.map +1 -1
- package/dist/cli/commands.d.ts +2 -0
- package/dist/cli/commands.d.ts.map +1 -0
- package/dist/cli/commands.js +20 -0
- package/dist/cli/commands.js.map +1 -0
- package/dist/cli/guide-template.d.ts.map +1 -1
- package/dist/cli/guide-template.js +3 -1
- package/dist/cli/guide-template.js.map +1 -1
- package/dist/cli/help.d.ts +5 -0
- package/dist/cli/help.d.ts.map +1 -0
- package/dist/cli/help.js +59 -0
- package/dist/cli/help.js.map +1 -0
- package/dist/cli/package-manager.d.ts +5 -0
- package/dist/cli/package-manager.d.ts.map +1 -0
- package/dist/cli/package-manager.js +34 -0
- package/dist/cli/package-manager.js.map +1 -0
- package/dist/cli/update.d.ts +8 -0
- package/dist/cli/update.d.ts.map +1 -0
- package/dist/cli/update.js +53 -0
- package/dist/cli/update.js.map +1 -0
- package/dist/commands/slash-command-adapters.d.ts +9 -0
- package/dist/commands/slash-command-adapters.d.ts.map +1 -0
- package/dist/commands/slash-command-adapters.js +116 -0
- package/dist/commands/slash-command-adapters.js.map +1 -0
- package/dist/data/component-props.d.ts +30 -0
- package/dist/data/component-props.d.ts.map +1 -0
- package/dist/data/component-props.js +537 -0
- package/dist/data/component-props.js.map +1 -0
- package/dist/data/component-registry.d.ts +30 -0
- package/dist/data/component-registry.d.ts.map +1 -0
- package/dist/data/component-registry.js +320 -0
- package/dist/data/component-registry.js.map +1 -0
- package/dist/data/examples/screen-examples.d.ts +38 -0
- package/dist/data/examples/screen-examples.d.ts.map +1 -0
- package/dist/data/examples/screen-examples.js +500 -0
- package/dist/data/examples/screen-examples.js.map +1 -0
- package/dist/index.js +130 -177
- package/dist/index.js.map +1 -1
- package/dist/prompts/doctor-workflow.js +1 -1
- package/dist/prompts/getting-started.d.ts.map +1 -1
- package/dist/prompts/getting-started.js +10 -9
- package/dist/prompts/getting-started.js.map +1 -1
- package/dist/prompts/screen-workflow.js +1 -1
- package/dist/schemas/mcp-schemas.d.ts +854 -739
- package/dist/schemas/mcp-schemas.d.ts.map +1 -1
- package/dist/schemas/mcp-schemas.js +32 -1
- package/dist/schemas/mcp-schemas.js.map +1 -1
- package/dist/tools/detect-project-context.d.ts +3 -1
- package/dist/tools/detect-project-context.d.ts.map +1 -1
- package/dist/tools/detect-project-context.js.map +1 -1
- package/dist/tools/get-screen-generation-context.d.ts +3 -1
- package/dist/tools/get-screen-generation-context.d.ts.map +1 -1
- package/dist/tools/get-screen-generation-context.js +2 -2
- package/dist/tools/get-screen-generation-context.js.map +1 -1
- package/dist/tools/list-screen-templates.d.ts +3 -1
- package/dist/tools/list-screen-templates.d.ts.map +1 -1
- package/dist/tools/list-screen-templates.js +3 -3
- package/dist/tools/list-screen-templates.js.map +1 -1
- package/dist/tools/preview-theme.d.ts +3 -1
- package/dist/tools/preview-theme.d.ts.map +1 -1
- package/dist/tools/preview-theme.js +28 -19
- package/dist/tools/preview-theme.js.map +1 -1
- package/dist/tools/validate-environment.d.ts +3 -1
- package/dist/tools/validate-environment.d.ts.map +1 -1
- package/dist/tools/validate-environment.js.map +1 -1
- package/dist/tools/whoami.d.ts.map +1 -1
- package/dist/tools/whoami.js +27 -17
- package/dist/tools/whoami.js.map +1 -1
- package/dist/utils/style-contract-reader.d.ts +10 -0
- package/dist/utils/style-contract-reader.d.ts.map +1 -0
- package/dist/utils/style-contract-reader.js +67 -0
- package/dist/utils/style-contract-reader.js.map +1 -0
- package/package.json +17 -16
- package/LICENSE +0 -21
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { getRawApiKey } from '../auth/state.js';
|
|
2
|
+
import { resolveFraminguiApiUrl } from '../utils/api-url.js';
|
|
3
|
+
import { info, error as logError } from '../utils/logger.js';
|
|
4
|
+
export async function syncUsageEvent(entry) {
|
|
5
|
+
if (!entry.userId) {
|
|
6
|
+
return;
|
|
7
|
+
}
|
|
8
|
+
const apiKey = getRawApiKey();
|
|
9
|
+
if (!apiKey) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
const { apiUrl } = resolveFraminguiApiUrl(process.env.FRAMINGUI_API_URL);
|
|
13
|
+
const endpoint = `${apiUrl}/api/mcp/usage-events`;
|
|
14
|
+
try {
|
|
15
|
+
const response = await fetch(endpoint, {
|
|
16
|
+
method: 'POST',
|
|
17
|
+
headers: {
|
|
18
|
+
Authorization: `Bearer ${apiKey}`,
|
|
19
|
+
'Content-Type': 'application/json',
|
|
20
|
+
},
|
|
21
|
+
body: JSON.stringify({
|
|
22
|
+
toolName: entry.toolName,
|
|
23
|
+
toolClass: entry.toolClass,
|
|
24
|
+
units: entry.units,
|
|
25
|
+
outcome: entry.outcome,
|
|
26
|
+
createdAt: entry.timestamp,
|
|
27
|
+
}),
|
|
28
|
+
});
|
|
29
|
+
if (!response.ok) {
|
|
30
|
+
logError(`[usage-sync] Failed to sync usage event for ${entry.toolName}: ${response.status} ${response.statusText}`);
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
info(`[usage-sync] Synced usage event for ${entry.toolName}`);
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
37
|
+
logError(`[usage-sync] Network error while syncing usage event: ${message}`);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=usage-sync.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage-sync.js","sourceRoot":"","sources":["../../src/billing/usage-sync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,IAAI,EAAE,KAAK,IAAI,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAG7D,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,KAAuB;IAC1D,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;QAClB,OAAO;IACT,CAAC;IAED,MAAM,MAAM,GAAG,YAAY,EAAE,CAAC;IAC9B,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO;IACT,CAAC;IAED,MAAM,EAAE,MAAM,EAAE,GAAG,sBAAsB,CAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IACzE,MAAM,QAAQ,GAAG,GAAG,MAAM,uBAAuB,CAAC;IAElD,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,QAAQ,EAAE;YACrC,MAAM,EAAE,MAAM;YACd,OAAO,EAAE;gBACP,aAAa,EAAE,UAAU,MAAM,EAAE;gBACjC,cAAc,EAAE,kBAAkB;aACnC;YACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;gBACnB,QAAQ,EAAE,KAAK,CAAC,QAAQ;gBACxB,SAAS,EAAE,KAAK,CAAC,SAAS;gBAC1B,KAAK,EAAE,KAAK,CAAC,KAAK;gBAClB,OAAO,EAAE,KAAK,CAAC,OAAO;gBACtB,SAAS,EAAE,KAAK,CAAC,SAAS;aAC3B,CAAC;SACH,CAAC,CAAC;QAEH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACjB,QAAQ,CACN,+CAA+C,KAAK,CAAC,QAAQ,KAAK,QAAQ,CAAC,MAAM,IAAI,QAAQ,CAAC,UAAU,EAAE,CAC3G,CAAC;YACF,OAAO;QACT,CAAC;QAED,IAAI,CAAC,uCAAuC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;IAChE,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACvE,QAAQ,CAAC,yDAAyD,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-md-templates.d.ts","sourceRoot":"","sources":["../../src/cli/agent-md-templates.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE1C,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"agent-md-templates.d.ts","sourceRoot":"","sources":["../../src/cli/agent-md-templates.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE1C,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,CAkGpE;AAED,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,CA0EpE"}
|
|
@@ -5,12 +5,14 @@ export function generateClaudeMdSection(framework) {
|
|
|
5
5
|
|
|
6
6
|
### Authentication
|
|
7
7
|
|
|
8
|
-
Before using
|
|
8
|
+
Before using account-scoped themes or checking quota visibility:
|
|
9
9
|
|
|
10
10
|
\`\`\`bash
|
|
11
11
|
framingui-mcp login
|
|
12
12
|
\`\`\`
|
|
13
13
|
|
|
14
|
+
Use \`whoami\` when you need the current entitlement list or shadow quota snapshot.
|
|
15
|
+
|
|
14
16
|
### Production Screen Flow
|
|
15
17
|
|
|
16
18
|
1. If the project path is known, call \`detect-project-context\` to establish the session default platform/runtime.
|
|
@@ -103,7 +105,7 @@ FramingUI is available in this project through MCP.
|
|
|
103
105
|
|
|
104
106
|
### Required Sequence
|
|
105
107
|
|
|
106
|
-
1. Confirm authentication if
|
|
108
|
+
1. Confirm authentication if entitled themes or quota visibility are needed.
|
|
107
109
|
2. If the project path is known, call \`detect-project-context\` first.
|
|
108
110
|
3. Decide the style contract before generation.
|
|
109
111
|
4. Use \`preview-theme\` when theme defaults or recipes matter.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-md-templates.js","sourceRoot":"","sources":["../../src/cli/agent-md-templates.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,uBAAuB,CAAC,SAAoB;IAC1D,MAAM,UAAU,GAAG,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,aAAa,CAAC;IAE3E,OAAO
|
|
1
|
+
{"version":3,"file":"agent-md-templates.js","sourceRoot":"","sources":["../../src/cli/agent-md-templates.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,uBAAuB,CAAC,SAAoB;IAC1D,MAAM,UAAU,GAAG,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,aAAa,CAAC;IAE3E,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA2EJ,UAAU;;;;;;;;;;;;;;;;;;;CAmBd,CAAC;AACF,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,SAAoB;IAC1D,MAAM,UAAU,GAAG,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,aAAa,CAAC;IAE3E,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAmDJ,UAAU;;;;;;;;;;;;;;;;;;;CAmBd,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/cli/commands.ts"],"names":[],"mappings":"AAcA,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CAYpD"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { renderSlashCommandAdapter, } from '../commands/slash-command-adapters.js';
|
|
2
|
+
function readOption(args, flag) {
|
|
3
|
+
const index = args.indexOf(flag);
|
|
4
|
+
if (index === -1) {
|
|
5
|
+
return undefined;
|
|
6
|
+
}
|
|
7
|
+
return args[index + 1];
|
|
8
|
+
}
|
|
9
|
+
export function commandsCommand(args) {
|
|
10
|
+
const formatArg = readOption(args, '--format') ?? 'text';
|
|
11
|
+
const clientArg = (readOption(args, '--client') ?? 'generic');
|
|
12
|
+
const commandArg = readOption(args, '--command');
|
|
13
|
+
const output = renderSlashCommandAdapter({
|
|
14
|
+
format: formatArg === 'json' || formatArg === 'markdown' ? formatArg : 'text',
|
|
15
|
+
client: clientArg,
|
|
16
|
+
command: commandArg,
|
|
17
|
+
});
|
|
18
|
+
console.log(output);
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=commands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../../src/cli/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,GAE1B,MAAM,uCAAuC,CAAC;AAE/C,SAAS,UAAU,CAAC,IAAc,EAAE,IAAY;IAC9C,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACjC,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC;QACjB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;AACzB,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,IAAc;IAC5C,MAAM,SAAS,GAAG,UAAU,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,MAAM,CAAC;IACzD,MAAM,SAAS,GAAG,CAAC,UAAU,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,SAAS,CAA8B,CAAC;IAC3F,MAAM,UAAU,GAAG,UAAU,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IAEjD,MAAM,MAAM,GAAG,yBAAyB,CAAC;QACvC,MAAM,EAAE,SAAS,KAAK,MAAM,IAAI,SAAS,KAAK,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM;QAC7E,MAAM,EAAE,SAAS;QACjB,OAAO,EAAE,UAAU;KACpB,CAAC,CAAC;IAEH,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guide-template.d.ts","sourceRoot":"","sources":["../../src/cli/guide-template.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE1C,wBAAgB,aAAa,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"guide-template.d.ts","sourceRoot":"","sources":["../../src/cli/guide-template.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE1C,wBAAgB,aAAa,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,CA8G1D"}
|
|
@@ -6,7 +6,7 @@ FramingUI is installed in this project as an MCP-assisted design system for prod
|
|
|
6
6
|
|
|
7
7
|
## Authentication
|
|
8
8
|
|
|
9
|
-
Authenticate before using
|
|
9
|
+
Authenticate before using account-scoped themes and quota visibility:
|
|
10
10
|
|
|
11
11
|
\`\`\`bash
|
|
12
12
|
framingui-mcp login
|
|
@@ -18,6 +18,8 @@ Check the current state with:
|
|
|
18
18
|
framingui-mcp status
|
|
19
19
|
\`\`\`
|
|
20
20
|
|
|
21
|
+
Use \`whoami\` when you need the current entitlement list or shadow quota snapshot.
|
|
22
|
+
|
|
21
23
|
## Recommended Workflow
|
|
22
24
|
|
|
23
25
|
1. If the project path is known, call \`detect-project-context\` first to store the default platform/runtime for this session.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guide-template.js","sourceRoot":"","sources":["../../src/cli/guide-template.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,aAAa,CAAC,SAAoB;IAChD,MAAM,OAAO,GAAG,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,aAAa,CAAC;IAExE,OAAO
|
|
1
|
+
{"version":3,"file":"guide-template.js","sourceRoot":"","sources":["../../src/cli/guide-template.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,aAAa,CAAC,SAAoB;IAChD,MAAM,OAAO,GAAG,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,aAAa,CAAC;IAExE,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA+EJ,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BX,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../../src/cli/help.ts"],"names":[],"mappings":"AAAA,wBAAgB,eAAe,IAAI,MAAM,CA6BxC;AAED,wBAAgB,SAAS,IAAI,IAAI,CAqBhC;AAED,wBAAgB,UAAU,IAAI,IAAI,CAEjC;AAED,wBAAgB,qBAAqB,IAAI,OAAO,CAE/C"}
|
package/dist/cli/help.js
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
export function getCliGuideText() {
|
|
2
|
+
return `FramingUI MCP Server
|
|
3
|
+
|
|
4
|
+
FramingUI is a design-system workflow for generating production-ready UI with MCP-aware tools, prompts, and command metadata.
|
|
5
|
+
|
|
6
|
+
Quick start:
|
|
7
|
+
1. Set up a project: framingui-mcp init
|
|
8
|
+
2. Authenticate: framingui-mcp login
|
|
9
|
+
3. Check status: framingui-mcp status
|
|
10
|
+
4. Inspect commands: framingui-mcp commands --format text
|
|
11
|
+
5. Start MCP server: framingui-mcp server
|
|
12
|
+
|
|
13
|
+
What you get:
|
|
14
|
+
- screen generation workflows
|
|
15
|
+
- responsive optimization guidance
|
|
16
|
+
- accessibility and theme-swap workflows
|
|
17
|
+
- environment diagnosis and install checks
|
|
18
|
+
|
|
19
|
+
Useful commands:
|
|
20
|
+
framingui-mcp help
|
|
21
|
+
framingui-mcp guide
|
|
22
|
+
framingui-mcp commands --command /responsive
|
|
23
|
+
framingui-mcp update --check
|
|
24
|
+
|
|
25
|
+
In MCP clients, use the built-in prompts:
|
|
26
|
+
- getting-started
|
|
27
|
+
- slash-commands
|
|
28
|
+
- command-help
|
|
29
|
+
`;
|
|
30
|
+
}
|
|
31
|
+
export function printHelp() {
|
|
32
|
+
console.log(`Usage: framingui-mcp <command>
|
|
33
|
+
|
|
34
|
+
Commands:
|
|
35
|
+
help Show CLI usage and FramingUI overview
|
|
36
|
+
guide Show first-run onboarding guide
|
|
37
|
+
commands Export slash command metadata for clients or humans
|
|
38
|
+
init Configure a project for FramingUI
|
|
39
|
+
login Authenticate via browser OAuth
|
|
40
|
+
logout Remove saved credentials
|
|
41
|
+
status Show current authentication status
|
|
42
|
+
update Update installed FramingUI packages in a project
|
|
43
|
+
server Start the MCP stdio server explicitly
|
|
44
|
+
-v, --version Print the CLI version
|
|
45
|
+
|
|
46
|
+
Examples:
|
|
47
|
+
framingui-mcp init
|
|
48
|
+
framingui-mcp commands --format markdown
|
|
49
|
+
framingui-mcp commands --command /responsive --format text
|
|
50
|
+
framingui-mcp update --check
|
|
51
|
+
framingui-mcp server`);
|
|
52
|
+
}
|
|
53
|
+
export function printGuide() {
|
|
54
|
+
console.log(getCliGuideText());
|
|
55
|
+
}
|
|
56
|
+
export function isInteractiveTerminal() {
|
|
57
|
+
return Boolean(process.stdin.isTTY && process.stdout.isTTY);
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=help.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"help.js","sourceRoot":"","sources":["../../src/cli/help.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,eAAe;IAC7B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BR,CAAC;AACF,CAAC;AAED,MAAM,UAAU,SAAS;IACvB,OAAO,CAAC,GAAG,CAAC;;;;;;;;;;;;;;;;;;;uBAmBS,CAAC,CAAC;AACzB,CAAC;AAED,MAAM,UAAU,UAAU;IACxB,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,CAAC,CAAC;AACjC,CAAC;AAED,MAAM,UAAU,qBAAqB;IACnC,OAAO,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,IAAI,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC9D,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type PackageManager = 'pnpm' | 'yarn' | 'bun' | 'npm';
|
|
2
|
+
export declare function detectPackageManager(cwd: string): PackageManager;
|
|
3
|
+
export declare function buildAddCommand(pm: PackageManager, packages: string[]): string;
|
|
4
|
+
export declare function buildUpdateCommand(pm: PackageManager, packages: string[]): string;
|
|
5
|
+
//# sourceMappingURL=package-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-manager.d.ts","sourceRoot":"","sources":["../../src/cli/package-manager.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,GAAG,KAAK,CAAC;AAM7D,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CAWhE;AAED,wBAAgB,eAAe,CAAC,EAAE,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,CAE9E;AAED,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,CAYjF"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
function fileExists(filePath) {
|
|
4
|
+
return fs.existsSync(filePath);
|
|
5
|
+
}
|
|
6
|
+
export function detectPackageManager(cwd) {
|
|
7
|
+
if (fileExists(path.join(cwd, 'pnpm-lock.yaml'))) {
|
|
8
|
+
return 'pnpm';
|
|
9
|
+
}
|
|
10
|
+
if (fileExists(path.join(cwd, 'yarn.lock'))) {
|
|
11
|
+
return 'yarn';
|
|
12
|
+
}
|
|
13
|
+
if (fileExists(path.join(cwd, 'bun.lock')) || fileExists(path.join(cwd, 'bun.lockb'))) {
|
|
14
|
+
return 'bun';
|
|
15
|
+
}
|
|
16
|
+
return 'npm';
|
|
17
|
+
}
|
|
18
|
+
export function buildAddCommand(pm, packages) {
|
|
19
|
+
return `${pm} add ${packages.join(' ')}`;
|
|
20
|
+
}
|
|
21
|
+
export function buildUpdateCommand(pm, packages) {
|
|
22
|
+
switch (pm) {
|
|
23
|
+
case 'pnpm':
|
|
24
|
+
return `pnpm up ${packages.join(' ')}`;
|
|
25
|
+
case 'yarn':
|
|
26
|
+
return `yarn up ${packages.join(' ')}`;
|
|
27
|
+
case 'bun':
|
|
28
|
+
return `bun update ${packages.join(' ')}`;
|
|
29
|
+
case 'npm':
|
|
30
|
+
default:
|
|
31
|
+
return `npm install ${packages.map(pkg => `${pkg}@latest`).join(' ')}`;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=package-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-manager.js","sourceRoot":"","sources":["../../src/cli/package-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAI7B,SAAS,UAAU,CAAC,QAAgB;IAClC,OAAO,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;AACjC,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,GAAW;IAC9C,IAAI,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,gBAAgB,CAAC,CAAC,EAAE,CAAC;QACjD,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,IAAI,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC,EAAE,CAAC;QAC5C,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,IAAI,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC,EAAE,CAAC;QACtF,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,EAAkB,EAAE,QAAkB;IACpE,OAAO,GAAG,EAAE,QAAQ,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;AAC3C,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,EAAkB,EAAE,QAAkB;IACvE,QAAQ,EAAE,EAAE,CAAC;QACX,KAAK,MAAM;YACT,OAAO,WAAW,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QACzC,KAAK,MAAM;YACT,OAAO,WAAW,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QACzC,KAAK,KAAK;YACR,OAAO,cAAc,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QAC5C,KAAK,KAAK,CAAC;QACX;YACE,OAAO,eAAe,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,SAAS,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;IAC3E,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare function getInstalledFraminguiPackages(cwd: string): string[];
|
|
2
|
+
export declare function getUpdatePlan(cwd: string): {
|
|
3
|
+
packageManager: string;
|
|
4
|
+
packages: string[];
|
|
5
|
+
command: string | null;
|
|
6
|
+
};
|
|
7
|
+
export declare function updateCommand(args: string[]): void;
|
|
8
|
+
//# sourceMappingURL=update.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/cli/update.ts"],"names":[],"mappings":"AA2BA,wBAAgB,6BAA6B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CASnE;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG;IAC1C,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB,CASA;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CAsBlD"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { execSync } from 'node:child_process';
|
|
4
|
+
import { buildUpdateCommand, detectPackageManager } from './package-manager.js';
|
|
5
|
+
const UPDATE_CANDIDATES = [
|
|
6
|
+
'@framingui/ui',
|
|
7
|
+
'@framingui/core',
|
|
8
|
+
'@framingui/tokens',
|
|
9
|
+
'@framingui/mcp-server',
|
|
10
|
+
'tailwindcss-animate',
|
|
11
|
+
];
|
|
12
|
+
function findPackageJsonPath(cwd) {
|
|
13
|
+
const direct = path.join(cwd, 'package.json');
|
|
14
|
+
if (fs.existsSync(direct)) {
|
|
15
|
+
return direct;
|
|
16
|
+
}
|
|
17
|
+
throw new Error(`No package.json found in ${cwd}. Run this inside a project directory.`);
|
|
18
|
+
}
|
|
19
|
+
export function getInstalledFraminguiPackages(cwd) {
|
|
20
|
+
const packageJsonPath = findPackageJsonPath(cwd);
|
|
21
|
+
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));
|
|
22
|
+
const installed = new Set([
|
|
23
|
+
...Object.keys(packageJson.dependencies ?? {}),
|
|
24
|
+
...Object.keys(packageJson.devDependencies ?? {}),
|
|
25
|
+
]);
|
|
26
|
+
return UPDATE_CANDIDATES.filter(pkg => installed.has(pkg));
|
|
27
|
+
}
|
|
28
|
+
export function getUpdatePlan(cwd) {
|
|
29
|
+
const packageManager = detectPackageManager(cwd);
|
|
30
|
+
const packages = getInstalledFraminguiPackages(cwd);
|
|
31
|
+
return {
|
|
32
|
+
packageManager,
|
|
33
|
+
packages,
|
|
34
|
+
command: packages.length > 0 ? buildUpdateCommand(packageManager, packages) : null,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export function updateCommand(args) {
|
|
38
|
+
const cwdIndex = args.indexOf('--cwd');
|
|
39
|
+
const cwd = cwdIndex === -1 ? process.cwd() : path.resolve(args[cwdIndex + 1] ?? process.cwd());
|
|
40
|
+
const checkOnly = args.includes('--check');
|
|
41
|
+
const plan = getUpdatePlan(cwd);
|
|
42
|
+
if (!plan.command) {
|
|
43
|
+
throw new Error(`No installed FramingUI packages found in ${cwd}. Run \`framingui-mcp init\` or install @framingui/ui first.`);
|
|
44
|
+
}
|
|
45
|
+
console.log(`Detected package manager: ${plan.packageManager}`);
|
|
46
|
+
console.log(`Packages: ${plan.packages.join(', ')}`);
|
|
47
|
+
console.log(`Command: ${plan.command}`);
|
|
48
|
+
if (checkOnly) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
execSync(plan.command, { cwd, stdio: 'inherit' });
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=update.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../src/cli/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAEhF,MAAM,iBAAiB,GAAG;IACxB,eAAe;IACf,iBAAiB;IACjB,mBAAmB;IACnB,uBAAuB;IACvB,qBAAqB;CACtB,CAAC;AAOF,SAAS,mBAAmB,CAAC,GAAW;IACtC,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;IAC9C,IAAI,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;QAC1B,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,4BAA4B,GAAG,wCAAwC,CAAC,CAAC;AAC3F,CAAC;AAED,MAAM,UAAU,6BAA6B,CAAC,GAAW;IACvD,MAAM,eAAe,GAAG,mBAAmB,CAAC,GAAG,CAAC,CAAC;IACjD,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAA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,4CAA4C,GAAG,8DAA8D,CAC9G,CAAC;IACJ,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,6BAA6B,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC;IAChE,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACrD,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;IAExC,IAAI,SAAS,EAAE,CAAC;QACd,OAAO;IACT,CAAC;IAED,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;AACpD,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type SlashCommandAdapterFormat = 'json' | 'markdown' | 'text';
|
|
2
|
+
export type SlashCommandAdapterClient = 'generic' | 'codex' | 'claude-code' | 'cursor';
|
|
3
|
+
export interface SlashCommandAdapterOptions {
|
|
4
|
+
format: SlashCommandAdapterFormat;
|
|
5
|
+
client?: SlashCommandAdapterClient;
|
|
6
|
+
command?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function renderSlashCommandAdapter(options: SlashCommandAdapterOptions): string;
|
|
9
|
+
//# sourceMappingURL=slash-command-adapters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slash-command-adapters.d.ts","sourceRoot":"","sources":["../../src/commands/slash-command-adapters.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,yBAAyB,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,CAAC;AACrE,MAAM,MAAM,yBAAyB,GAAG,SAAS,GAAG,OAAO,GAAG,aAAa,GAAG,QAAQ,CAAC;AAEvF,MAAM,WAAW,0BAA0B;IACzC,MAAM,EAAE,yBAAyB,CAAC;IAClC,MAAM,CAAC,EAAE,yBAAyB,CAAC;IACnC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AA2HD,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,0BAA0B,GAAG,MAAM,CAyBrF"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { getSlashCommand, listSlashCommands, } from './slash-command-registry.js';
|
|
2
|
+
function getCommands(command) {
|
|
3
|
+
if (!command) {
|
|
4
|
+
return listSlashCommands();
|
|
5
|
+
}
|
|
6
|
+
const resolved = getSlashCommand(command);
|
|
7
|
+
return resolved ? [resolved] : [];
|
|
8
|
+
}
|
|
9
|
+
function getClientAdapterMeta(client) {
|
|
10
|
+
switch (client) {
|
|
11
|
+
case 'codex':
|
|
12
|
+
return {
|
|
13
|
+
title: 'FramingUI adapter for Codex',
|
|
14
|
+
integrationTarget: 'AGENTS.md or a Codex-specific command manifest',
|
|
15
|
+
notes: [
|
|
16
|
+
'Render each command in slash completion and show `summary` plus `usage` on tab.',
|
|
17
|
+
'When a command is selected, use `promptRecipe` as the fallback workflow guide.',
|
|
18
|
+
'For focused help, request `command-help` with the command name.',
|
|
19
|
+
],
|
|
20
|
+
};
|
|
21
|
+
case 'claude-code':
|
|
22
|
+
return {
|
|
23
|
+
title: 'FramingUI adapter for Claude Code',
|
|
24
|
+
integrationTarget: 'CLAUDE.md, command palette glue, or MCP prompt helpers',
|
|
25
|
+
notes: [
|
|
26
|
+
'Surface slash commands from the canonical registry instead of hardcoding them.',
|
|
27
|
+
'Use `slash-commands` as the catalog fallback when native slash UI is unavailable.',
|
|
28
|
+
'Preserve MCP workflow order from the `workflow` field.',
|
|
29
|
+
],
|
|
30
|
+
};
|
|
31
|
+
case 'cursor':
|
|
32
|
+
return {
|
|
33
|
+
title: 'FramingUI adapter for Cursor',
|
|
34
|
+
integrationTarget: '.cursor rules, custom command palette wiring, or MCP helper layer',
|
|
35
|
+
notes: [
|
|
36
|
+
'Render short summaries in the command palette and full `usage` on selection.',
|
|
37
|
+
'Use the registry `examples` to seed autocomplete or example prompts.',
|
|
38
|
+
'Map `promptRecipe` into a fallback prompt path when command UX is limited.',
|
|
39
|
+
],
|
|
40
|
+
};
|
|
41
|
+
case 'generic':
|
|
42
|
+
default:
|
|
43
|
+
return {
|
|
44
|
+
title: 'FramingUI generic command adapter',
|
|
45
|
+
integrationTarget: 'Any slash-command capable MCP client',
|
|
46
|
+
notes: [
|
|
47
|
+
'Render `summary` in command lists and `usage` in inline help.',
|
|
48
|
+
'Use `examples` for discoverability.',
|
|
49
|
+
'Use `promptRecipe` and `command-help` as fallback guidance.',
|
|
50
|
+
],
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
function renderMarkdown(commands, client) {
|
|
55
|
+
const meta = getClientAdapterMeta(client);
|
|
56
|
+
if (commands.length === 0) {
|
|
57
|
+
return `# ${meta.title}\n\nNo matching commands.`;
|
|
58
|
+
}
|
|
59
|
+
return [
|
|
60
|
+
`# ${meta.title}`,
|
|
61
|
+
'',
|
|
62
|
+
`Integration target: ${meta.integrationTarget}`,
|
|
63
|
+
'',
|
|
64
|
+
'## Adapter notes',
|
|
65
|
+
'',
|
|
66
|
+
...meta.notes.map(note => `- ${note}`),
|
|
67
|
+
...commands.flatMap(command => [
|
|
68
|
+
'',
|
|
69
|
+
`## ${command.name}`,
|
|
70
|
+
'',
|
|
71
|
+
command.summary,
|
|
72
|
+
'',
|
|
73
|
+
`- Usage: \`${command.usage}\``,
|
|
74
|
+
`- Prompt fallback: \`${command.promptRecipe}\``,
|
|
75
|
+
`- Workflow: ${command.workflow.map(step => `\`${step}\``).join(' -> ')}`,
|
|
76
|
+
`- Required preflight: ${command.preflight
|
|
77
|
+
? `\`${command.preflight.steps.join(' -> ')}\` (${command.preflight.when})`
|
|
78
|
+
: 'none'}`,
|
|
79
|
+
`- Examples: ${command.examples.map(example => `\`${example}\``).join(', ')}`,
|
|
80
|
+
]),
|
|
81
|
+
].join('\n');
|
|
82
|
+
}
|
|
83
|
+
function renderText(commands, client) {
|
|
84
|
+
const meta = getClientAdapterMeta(client);
|
|
85
|
+
if (commands.length === 0) {
|
|
86
|
+
return `${meta.title}\n\nNo matching commands.`;
|
|
87
|
+
}
|
|
88
|
+
return [
|
|
89
|
+
meta.title,
|
|
90
|
+
`Integration target: ${meta.integrationTarget}`,
|
|
91
|
+
'',
|
|
92
|
+
'Notes:',
|
|
93
|
+
...meta.notes.map(note => ` - ${note}`),
|
|
94
|
+
'',
|
|
95
|
+
...commands.map(command => `${command.name}\n ${command.summary}\n Usage: ${command.usage}\n Prompt: ${command.promptRecipe}\n Preflight: ${command.preflight ? `${command.preflight.steps.join(' -> ')}` : 'none'}`),
|
|
96
|
+
].join('\n');
|
|
97
|
+
}
|
|
98
|
+
export function renderSlashCommandAdapter(options) {
|
|
99
|
+
const client = options.client ?? 'generic';
|
|
100
|
+
const commands = getCommands(options.command);
|
|
101
|
+
if (options.format === 'json') {
|
|
102
|
+
const meta = getClientAdapterMeta(client);
|
|
103
|
+
return JSON.stringify({
|
|
104
|
+
client,
|
|
105
|
+
title: meta.title,
|
|
106
|
+
integrationTarget: meta.integrationTarget,
|
|
107
|
+
notes: meta.notes,
|
|
108
|
+
commands,
|
|
109
|
+
}, null, 2);
|
|
110
|
+
}
|
|
111
|
+
if (options.format === 'markdown') {
|
|
112
|
+
return renderMarkdown(commands, client);
|
|
113
|
+
}
|
|
114
|
+
return renderText(commands, client);
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=slash-command-adapters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slash-command-adapters.js","sourceRoot":"","sources":["../../src/commands/slash-command-adapters.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EACf,iBAAiB,GAClB,MAAM,6BAA6B,CAAC;AAiBrC,SAAS,WAAW,CAAC,OAAgB;IACnC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,iBAAiB,EAAE,CAAC;IAC7B,CAAC;IAED,MAAM,QAAQ,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;IAC1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
4
|
+
*
|
|
5
|
+
* 사용처:
|
|
6
|
+
* - preview-component.ts: 컴포넌트 상세 정보 제공
|
|
7
|
+
* - get-screen-generation-context.ts: 인라인 props 컨텍스트 제공
|
|
8
|
+
* - validate-screen-definition.ts: props 유효성 검증
|
|
9
|
+
*/
|
|
10
|
+
import type { PropDefinition, Variant, UsageExample } from '../schemas/mcp-schemas.js';
|
|
11
|
+
export interface ComponentPropsData {
|
|
12
|
+
props: PropDefinition[];
|
|
13
|
+
variants?: Variant[];
|
|
14
|
+
subComponents?: string[];
|
|
15
|
+
dependencies: {
|
|
16
|
+
internal: string[];
|
|
17
|
+
external: string[];
|
|
18
|
+
};
|
|
19
|
+
examples?: UsageExample[];
|
|
20
|
+
accessibility?: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* 컴포넌트 ID로 props 데이터 조회
|
|
24
|
+
*/
|
|
25
|
+
export declare function getComponentPropsData(componentId: string): ComponentPropsData | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* 모든 컴포넌트 props 데이터가 있는 컴포넌트 ID 목록 반환
|
|
28
|
+
*/
|
|
29
|
+
export declare function getComponentIdsWithProps(): string[];
|
|
30
|
+
//# sourceMappingURL=component-props.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-props.d.ts","sourceRoot":"","sources":["../../src/data/component-props.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEvF,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,YAAY,EAAE;QAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;QAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IACzD,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAuhBD;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,MAAM,GAAG,kBAAkB,GAAG,SAAS,CAEzF;AAED;;GAEG;AACH,wBAAgB,wBAAwB,IAAI,MAAM,EAAE,CAEnD"}
|