@stackable-labs/mcp-app-extension 1.4.0 → 1.6.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/dist/index.js +82 -27
- package/dist/server.js +82 -27
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
3
3
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
4
|
-
import { IDENTITY_EVENT, ACTIVITY_EVENT, SURFACE_TARGET, TEMPLATE_FLAVORS, PERMISSIONS, CAPABILITY_PERMISSION_MAP, EVENT_HOOK_PERMISSION_MAP, ALLOWED_ICONS, UI_TAGS, UI_TAG_ATTRIBUTES, tagToComponentName } from '@stackable-labs/sdk-extension-contracts';
|
|
4
|
+
import { IDENTITY_EVENT, ACTIVITY_EVENT, SURFACE_TARGET, TEMPLATE_FLAVORS, PERMISSIONS, CAPABILITY_PERMISSION_MAP, EVENT_HOOK_PERMISSION_MAP, ALLOWED_ICONS, UI_TAGS, UI_TAG_CATEGORIES, UI_TAG_ATTRIBUTES, tagToComponentName } from '@stackable-labs/sdk-extension-contracts';
|
|
5
5
|
import fs4, { readFile, mkdir, writeFile, constants } from 'fs/promises';
|
|
6
6
|
import path, { join } from 'path';
|
|
7
7
|
import os, { homedir } from 'os';
|
|
@@ -382,6 +382,22 @@ var frontmatter = (meta) => {
|
|
|
382
382
|
var generateCoreReference = () => CORE_CONTENT;
|
|
383
383
|
|
|
384
384
|
// ../../sdk/extension/ai-docs/src/generators/components.ts
|
|
385
|
+
var CATEGORY_ORDER = [
|
|
386
|
+
"layout",
|
|
387
|
+
"text",
|
|
388
|
+
"input",
|
|
389
|
+
"navigation",
|
|
390
|
+
"feedback",
|
|
391
|
+
"composite"
|
|
392
|
+
];
|
|
393
|
+
var CATEGORY_LABELS = {
|
|
394
|
+
layout: "Layout",
|
|
395
|
+
text: "Text",
|
|
396
|
+
input: "Input",
|
|
397
|
+
navigation: "Navigation",
|
|
398
|
+
feedback: "Feedback",
|
|
399
|
+
composite: "Composite"
|
|
400
|
+
};
|
|
385
401
|
var generateComponents = () => {
|
|
386
402
|
const fm = frontmatter({
|
|
387
403
|
root: false,
|
|
@@ -389,13 +405,31 @@ var generateComponents = () => {
|
|
|
389
405
|
description: "Available UI components with allowed attributes per tag",
|
|
390
406
|
globs: ["packages/extension/src/**/*.tsx"]
|
|
391
407
|
});
|
|
392
|
-
const
|
|
408
|
+
const tagsByCategory = /* @__PURE__ */ new Map();
|
|
393
409
|
for (const tag of UI_TAGS) {
|
|
394
|
-
const
|
|
395
|
-
const
|
|
396
|
-
|
|
397
|
-
|
|
410
|
+
const category = UI_TAG_CATEGORIES[tag];
|
|
411
|
+
const bucket = tagsByCategory.get(category) ?? [];
|
|
412
|
+
bucket.push(tag);
|
|
413
|
+
tagsByCategory.set(category, bucket);
|
|
414
|
+
}
|
|
415
|
+
for (const tags of tagsByCategory.values()) {
|
|
416
|
+
tags.sort();
|
|
417
|
+
}
|
|
418
|
+
const componentLines = [];
|
|
419
|
+
for (const category of CATEGORY_ORDER) {
|
|
420
|
+
const tags = tagsByCategory.get(category);
|
|
421
|
+
if (!tags || tags.length === 0) {
|
|
422
|
+
continue;
|
|
423
|
+
}
|
|
424
|
+
componentLines.push(`## ${CATEGORY_LABELS[category]}`);
|
|
398
425
|
componentLines.push("");
|
|
426
|
+
for (const tag of tags) {
|
|
427
|
+
const attrs = UI_TAG_ATTRIBUTES[tag];
|
|
428
|
+
const name = tagToComponentName(tag);
|
|
429
|
+
componentLines.push(`### \`<ui.${name}>\` (\`${tag}\`)`);
|
|
430
|
+
componentLines.push(`Allowed attributes: ${attrs.map((a2) => `\`${a2}\``).join(", ")}`);
|
|
431
|
+
componentLines.push("");
|
|
432
|
+
}
|
|
399
433
|
}
|
|
400
434
|
const iconList = ALLOWED_ICONS.map((icon) => `\`${icon}\``).join(", ");
|
|
401
435
|
return `${fm}
|
|
@@ -1748,31 +1782,32 @@ export const Header = () => {
|
|
|
1748
1782
|
`;
|
|
1749
1783
|
};
|
|
1750
1784
|
var DLX = "pnpm --config.dlx-cache-max-age=0 dlx";
|
|
1785
|
+
var CLI_PKG = "@stackable-labs/cli-app-extension@latest";
|
|
1751
1786
|
var CLI = {
|
|
1752
1787
|
/** Scaffold a new extension project */
|
|
1753
|
-
create: (name = "<extension-name>") => `${DLX}
|
|
1788
|
+
create: (name = "<extension-name>") => `${DLX} ${CLI_PKG} create ${name}`,
|
|
1754
1789
|
/** Start dev servers with hot reload */
|
|
1755
|
-
dev: `${DLX}
|
|
1790
|
+
dev: `${DLX} ${CLI_PKG} dev`,
|
|
1756
1791
|
/** Deploy the extension (future) */
|
|
1757
|
-
deploy: `${DLX}
|
|
1792
|
+
deploy: `${DLX} ${CLI_PKG} deploy`,
|
|
1758
1793
|
/** Validate the extension for common errors (coming soon) */
|
|
1759
|
-
validate: `${DLX}
|
|
1794
|
+
validate: `${DLX} ${CLI_PKG} validate`,
|
|
1760
1795
|
/** Scaffold from an existing extension */
|
|
1761
|
-
scaffold: `${DLX}
|
|
1796
|
+
scaffold: `${DLX} ${CLI_PKG} scaffold`,
|
|
1762
1797
|
/** Update an existing extension */
|
|
1763
|
-
update: `${DLX}
|
|
1798
|
+
update: `${DLX} ${CLI_PKG} update`,
|
|
1764
1799
|
/** Manage CLI authentication (browser-based OAuth) */
|
|
1765
1800
|
auth: {
|
|
1766
|
-
login: `${DLX}
|
|
1767
|
-
logout: `${DLX}
|
|
1768
|
-
status: `${DLX}
|
|
1801
|
+
login: `${DLX} ${CLI_PKG} auth login`,
|
|
1802
|
+
logout: `${DLX} ${CLI_PKG} auth logout`,
|
|
1803
|
+
status: `${DLX} ${CLI_PKG} auth status`
|
|
1769
1804
|
},
|
|
1770
1805
|
/** AI editor configuration tools (Skills + MCP) */
|
|
1771
1806
|
ai: {
|
|
1772
1807
|
/** Download AI editor config files (Stackable Skills) into your project */
|
|
1773
|
-
scaffold: `${DLX}
|
|
1808
|
+
scaffold: `${DLX} ${CLI_PKG} ai scaffold`,
|
|
1774
1809
|
/** Add Stackable MCP server config to your project */
|
|
1775
|
-
mcp: `${DLX}
|
|
1810
|
+
mcp: `${DLX} ${CLI_PKG} ai mcp`
|
|
1776
1811
|
}
|
|
1777
1812
|
};
|
|
1778
1813
|
var TEMPLATE_FLAVOR_META = {
|
|
@@ -2885,16 +2920,36 @@ var parseSafelist = (css) => {
|
|
|
2885
2920
|
return classes;
|
|
2886
2921
|
};
|
|
2887
2922
|
var classifyFamily = (cls) => {
|
|
2888
|
-
if (cls.startsWith("dark:hover:text-"))
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
if (cls.startsWith("dark:bg-"))
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
if (cls.startsWith("
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
if (cls.startsWith("
|
|
2923
|
+
if (cls.startsWith("dark:hover:text-")) {
|
|
2924
|
+
return "Dark \u2014 hover text";
|
|
2925
|
+
}
|
|
2926
|
+
if (cls.startsWith("dark:hover:bg-")) {
|
|
2927
|
+
return "Dark \u2014 hover background";
|
|
2928
|
+
}
|
|
2929
|
+
if (cls.startsWith("dark:text-")) {
|
|
2930
|
+
return "Dark \u2014 text color";
|
|
2931
|
+
}
|
|
2932
|
+
if (cls.startsWith("dark:bg-")) {
|
|
2933
|
+
return "Dark \u2014 background color";
|
|
2934
|
+
}
|
|
2935
|
+
if (cls.startsWith("dark:border-")) {
|
|
2936
|
+
return "Dark \u2014 border color";
|
|
2937
|
+
}
|
|
2938
|
+
if (cls.startsWith("hover:opacity-")) {
|
|
2939
|
+
return "Hover \u2014 opacity";
|
|
2940
|
+
}
|
|
2941
|
+
if (cls.startsWith("hover:text-")) {
|
|
2942
|
+
return "Hover \u2014 text color";
|
|
2943
|
+
}
|
|
2944
|
+
if (cls.startsWith("hover:bg-")) {
|
|
2945
|
+
return "Hover \u2014 background color";
|
|
2946
|
+
}
|
|
2947
|
+
if (cls.startsWith("focus:")) {
|
|
2948
|
+
return "Focus";
|
|
2949
|
+
}
|
|
2950
|
+
if (cls.startsWith("disabled:")) {
|
|
2951
|
+
return "Disabled";
|
|
2952
|
+
}
|
|
2898
2953
|
if (/^(m|mx|my|mt|mb|ml|mr)-/.test(cls)) {
|
|
2899
2954
|
return "Margin";
|
|
2900
2955
|
}
|
package/dist/server.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
-
import { IDENTITY_EVENT, ACTIVITY_EVENT, SURFACE_TARGET, TEMPLATE_FLAVORS, PERMISSIONS, CAPABILITY_PERMISSION_MAP, EVENT_HOOK_PERMISSION_MAP, ALLOWED_ICONS, UI_TAGS, UI_TAG_ATTRIBUTES, tagToComponentName } from '@stackable-labs/sdk-extension-contracts';
|
|
2
|
+
import { IDENTITY_EVENT, ACTIVITY_EVENT, SURFACE_TARGET, TEMPLATE_FLAVORS, PERMISSIONS, CAPABILITY_PERMISSION_MAP, EVENT_HOOK_PERMISSION_MAP, ALLOWED_ICONS, UI_TAGS, UI_TAG_CATEGORIES, UI_TAG_ATTRIBUTES, tagToComponentName } from '@stackable-labs/sdk-extension-contracts';
|
|
3
3
|
import { readFile } from 'fs/promises';
|
|
4
4
|
import { join } from 'path';
|
|
5
5
|
import { homedir } from 'os';
|
|
@@ -375,6 +375,22 @@ var frontmatter = (meta) => {
|
|
|
375
375
|
var generateCoreReference = () => CORE_CONTENT;
|
|
376
376
|
|
|
377
377
|
// ../../sdk/extension/ai-docs/src/generators/components.ts
|
|
378
|
+
var CATEGORY_ORDER = [
|
|
379
|
+
"layout",
|
|
380
|
+
"text",
|
|
381
|
+
"input",
|
|
382
|
+
"navigation",
|
|
383
|
+
"feedback",
|
|
384
|
+
"composite"
|
|
385
|
+
];
|
|
386
|
+
var CATEGORY_LABELS = {
|
|
387
|
+
layout: "Layout",
|
|
388
|
+
text: "Text",
|
|
389
|
+
input: "Input",
|
|
390
|
+
navigation: "Navigation",
|
|
391
|
+
feedback: "Feedback",
|
|
392
|
+
composite: "Composite"
|
|
393
|
+
};
|
|
378
394
|
var generateComponents = () => {
|
|
379
395
|
const fm = frontmatter({
|
|
380
396
|
root: false,
|
|
@@ -382,13 +398,31 @@ var generateComponents = () => {
|
|
|
382
398
|
description: "Available UI components with allowed attributes per tag",
|
|
383
399
|
globs: ["packages/extension/src/**/*.tsx"]
|
|
384
400
|
});
|
|
385
|
-
const
|
|
401
|
+
const tagsByCategory = /* @__PURE__ */ new Map();
|
|
386
402
|
for (const tag of UI_TAGS) {
|
|
387
|
-
const
|
|
388
|
-
const
|
|
389
|
-
|
|
390
|
-
|
|
403
|
+
const category = UI_TAG_CATEGORIES[tag];
|
|
404
|
+
const bucket = tagsByCategory.get(category) ?? [];
|
|
405
|
+
bucket.push(tag);
|
|
406
|
+
tagsByCategory.set(category, bucket);
|
|
407
|
+
}
|
|
408
|
+
for (const tags of tagsByCategory.values()) {
|
|
409
|
+
tags.sort();
|
|
410
|
+
}
|
|
411
|
+
const componentLines = [];
|
|
412
|
+
for (const category of CATEGORY_ORDER) {
|
|
413
|
+
const tags = tagsByCategory.get(category);
|
|
414
|
+
if (!tags || tags.length === 0) {
|
|
415
|
+
continue;
|
|
416
|
+
}
|
|
417
|
+
componentLines.push(`## ${CATEGORY_LABELS[category]}`);
|
|
391
418
|
componentLines.push("");
|
|
419
|
+
for (const tag of tags) {
|
|
420
|
+
const attrs = UI_TAG_ATTRIBUTES[tag];
|
|
421
|
+
const name = tagToComponentName(tag);
|
|
422
|
+
componentLines.push(`### \`<ui.${name}>\` (\`${tag}\`)`);
|
|
423
|
+
componentLines.push(`Allowed attributes: ${attrs.map((a2) => `\`${a2}\``).join(", ")}`);
|
|
424
|
+
componentLines.push("");
|
|
425
|
+
}
|
|
392
426
|
}
|
|
393
427
|
const iconList = ALLOWED_ICONS.map((icon) => `\`${icon}\``).join(", ");
|
|
394
428
|
return `${fm}
|
|
@@ -1741,31 +1775,32 @@ export const Header = () => {
|
|
|
1741
1775
|
`;
|
|
1742
1776
|
};
|
|
1743
1777
|
var DLX = "pnpm --config.dlx-cache-max-age=0 dlx";
|
|
1778
|
+
var CLI_PKG = "@stackable-labs/cli-app-extension@latest";
|
|
1744
1779
|
var CLI = {
|
|
1745
1780
|
/** Scaffold a new extension project */
|
|
1746
|
-
create: (name = "<extension-name>") => `${DLX}
|
|
1781
|
+
create: (name = "<extension-name>") => `${DLX} ${CLI_PKG} create ${name}`,
|
|
1747
1782
|
/** Start dev servers with hot reload */
|
|
1748
|
-
dev: `${DLX}
|
|
1783
|
+
dev: `${DLX} ${CLI_PKG} dev`,
|
|
1749
1784
|
/** Deploy the extension (future) */
|
|
1750
|
-
deploy: `${DLX}
|
|
1785
|
+
deploy: `${DLX} ${CLI_PKG} deploy`,
|
|
1751
1786
|
/** Validate the extension for common errors (coming soon) */
|
|
1752
|
-
validate: `${DLX}
|
|
1787
|
+
validate: `${DLX} ${CLI_PKG} validate`,
|
|
1753
1788
|
/** Scaffold from an existing extension */
|
|
1754
|
-
scaffold: `${DLX}
|
|
1789
|
+
scaffold: `${DLX} ${CLI_PKG} scaffold`,
|
|
1755
1790
|
/** Update an existing extension */
|
|
1756
|
-
update: `${DLX}
|
|
1791
|
+
update: `${DLX} ${CLI_PKG} update`,
|
|
1757
1792
|
/** Manage CLI authentication (browser-based OAuth) */
|
|
1758
1793
|
auth: {
|
|
1759
|
-
login: `${DLX}
|
|
1760
|
-
logout: `${DLX}
|
|
1761
|
-
status: `${DLX}
|
|
1794
|
+
login: `${DLX} ${CLI_PKG} auth login`,
|
|
1795
|
+
logout: `${DLX} ${CLI_PKG} auth logout`,
|
|
1796
|
+
status: `${DLX} ${CLI_PKG} auth status`
|
|
1762
1797
|
},
|
|
1763
1798
|
/** AI editor configuration tools (Skills + MCP) */
|
|
1764
1799
|
ai: {
|
|
1765
1800
|
/** Download AI editor config files (Stackable Skills) into your project */
|
|
1766
|
-
scaffold: `${DLX}
|
|
1801
|
+
scaffold: `${DLX} ${CLI_PKG} ai scaffold`,
|
|
1767
1802
|
/** Add Stackable MCP server config to your project */
|
|
1768
|
-
mcp: `${DLX}
|
|
1803
|
+
mcp: `${DLX} ${CLI_PKG} ai mcp`
|
|
1769
1804
|
}
|
|
1770
1805
|
};
|
|
1771
1806
|
var TEMPLATE_FLAVOR_META = {
|
|
@@ -2878,16 +2913,36 @@ var parseSafelist = (css) => {
|
|
|
2878
2913
|
return classes;
|
|
2879
2914
|
};
|
|
2880
2915
|
var classifyFamily = (cls) => {
|
|
2881
|
-
if (cls.startsWith("dark:hover:text-"))
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
if (cls.startsWith("dark:bg-"))
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
if (cls.startsWith("
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
if (cls.startsWith("
|
|
2916
|
+
if (cls.startsWith("dark:hover:text-")) {
|
|
2917
|
+
return "Dark \u2014 hover text";
|
|
2918
|
+
}
|
|
2919
|
+
if (cls.startsWith("dark:hover:bg-")) {
|
|
2920
|
+
return "Dark \u2014 hover background";
|
|
2921
|
+
}
|
|
2922
|
+
if (cls.startsWith("dark:text-")) {
|
|
2923
|
+
return "Dark \u2014 text color";
|
|
2924
|
+
}
|
|
2925
|
+
if (cls.startsWith("dark:bg-")) {
|
|
2926
|
+
return "Dark \u2014 background color";
|
|
2927
|
+
}
|
|
2928
|
+
if (cls.startsWith("dark:border-")) {
|
|
2929
|
+
return "Dark \u2014 border color";
|
|
2930
|
+
}
|
|
2931
|
+
if (cls.startsWith("hover:opacity-")) {
|
|
2932
|
+
return "Hover \u2014 opacity";
|
|
2933
|
+
}
|
|
2934
|
+
if (cls.startsWith("hover:text-")) {
|
|
2935
|
+
return "Hover \u2014 text color";
|
|
2936
|
+
}
|
|
2937
|
+
if (cls.startsWith("hover:bg-")) {
|
|
2938
|
+
return "Hover \u2014 background color";
|
|
2939
|
+
}
|
|
2940
|
+
if (cls.startsWith("focus:")) {
|
|
2941
|
+
return "Focus";
|
|
2942
|
+
}
|
|
2943
|
+
if (cls.startsWith("disabled:")) {
|
|
2944
|
+
return "Disabled";
|
|
2945
|
+
}
|
|
2891
2946
|
if (/^(m|mx|my|mt|mb|ml|mr)-/.test(cls)) {
|
|
2892
2947
|
return "Margin";
|
|
2893
2948
|
}
|