@agiflowai/style-system 0.0.6 → 0.0.7

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/cli.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- const require_stdio = require('./stdio-D3tBpCoD.cjs');
2
+ const require_stdio = require('./stdio-DxdE_ClP.cjs');
3
3
  let __agiflowai_aicode_utils = require("@agiflowai/aicode-utils");
4
4
  __agiflowai_aicode_utils = require_stdio.__toESM(__agiflowai_aicode_utils);
5
5
  let commander = require("commander");
package/dist/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { a as ListAppComponentsTool, i as ListThemesTool, m as GetCSSClassesTool, n as createServer, o as GetComponentVisualTool, r as ListSharedComponentsTool, t as StdioTransportHandler, u as getBundlerServiceFromConfig } from "./stdio-DvPtx0WS.js";
2
+ import { a as ListAppComponentsTool, i as ListThemesTool, m as GetCSSClassesTool, n as createServer, o as GetComponentVisualTool, r as ListSharedComponentsTool, t as StdioTransportHandler, u as getBundlerServiceFromConfig } from "./stdio-Ct-YYe6g.js";
3
3
  import { print } from "@agiflowai/aicode-utils";
4
4
  import { Command } from "commander";
5
5
 
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- const require_stdio = require('./stdio-D3tBpCoD.cjs');
1
+ const require_stdio = require('./stdio-DxdE_ClP.cjs');
2
2
 
3
3
  exports.BaseBundlerService = require_stdio.BaseBundlerService;
4
4
  exports.BaseCSSClassesService = require_stdio.BaseCSSClassesService;
package/dist/index.d.cts CHANGED
@@ -612,7 +612,6 @@ interface RenderResult {
612
612
  * ```
613
613
  */
614
614
  declare class ComponentRendererService {
615
- private monorepoRoot;
616
615
  private tmpDir;
617
616
  private themeService;
618
617
  private appPath;
@@ -886,11 +885,6 @@ declare abstract class BaseCSSClassesService {
886
885
  * ```
887
886
  */
888
887
  declare class TailwindCSSClassesService extends BaseCSSClassesService {
889
- /**
890
- * Creates a new TailwindCSSClassesService instance
891
- * @param config - Style system configuration from toolkit.yaml
892
- */
893
- constructor(config: StyleSystemConfig);
894
888
  /**
895
889
  * Get the CSS framework identifier
896
890
  * @returns Framework identifier string 'tailwind'
package/dist/index.d.ts CHANGED
@@ -612,7 +612,6 @@ interface RenderResult {
612
612
  * ```
613
613
  */
614
614
  declare class ComponentRendererService {
615
- private monorepoRoot;
616
615
  private tmpDir;
617
616
  private themeService;
618
617
  private appPath;
@@ -886,11 +885,6 @@ declare abstract class BaseCSSClassesService {
886
885
  * ```
887
886
  */
888
887
  declare class TailwindCSSClassesService extends BaseCSSClassesService {
889
- /**
890
- * Creates a new TailwindCSSClassesService instance
891
- * @param config - Style system configuration from toolkit.yaml
892
- */
893
- constructor(config: StyleSystemConfig);
894
888
  /**
895
889
  * Get the CSS framework identifier
896
890
  * @returns Framework identifier string 'tailwind'
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
- import { _ as TailwindCSSClassesService, a as ListAppComponentsTool, c as ThemeService, d as ViteReactBundlerService, f as BaseBundlerService, g as DEFAULT_STYLE_SYSTEM_CONFIG, h as CSSClassesServiceFactory, i as ListThemesTool, l as createDefaultBundlerService, m as GetCSSClassesTool, n as createServer, o as GetComponentVisualTool, p as StoriesIndexService, r as ListSharedComponentsTool, s as ComponentRendererService, t as StdioTransportHandler, u as getBundlerServiceFromConfig, v as BaseCSSClassesService } from "./stdio-DvPtx0WS.js";
1
+ import { _ as TailwindCSSClassesService, a as ListAppComponentsTool, c as ThemeService, d as ViteReactBundlerService, f as BaseBundlerService, g as DEFAULT_STYLE_SYSTEM_CONFIG, h as CSSClassesServiceFactory, i as ListThemesTool, l as createDefaultBundlerService, m as GetCSSClassesTool, n as createServer, o as GetComponentVisualTool, p as StoriesIndexService, r as ListSharedComponentsTool, s as ComponentRendererService, t as StdioTransportHandler, u as getBundlerServiceFromConfig, v as BaseCSSClassesService } from "./stdio-Ct-YYe6g.js";
2
2
 
3
3
  export { BaseBundlerService, BaseCSSClassesService, CSSClassesServiceFactory, ComponentRendererService, DEFAULT_STYLE_SYSTEM_CONFIG, GetCSSClassesTool, GetComponentVisualTool, ListAppComponentsTool, ListSharedComponentsTool, ListThemesTool, StdioTransportHandler, StoriesIndexService, TailwindCSSClassesService, ThemeService, ViteReactBundlerService, createDefaultBundlerService, createServer, getBundlerServiceFromConfig };
@@ -76,7 +76,7 @@ async function getAppDesignSystemConfig(appPath) {
76
76
  }
77
77
  if (typeof projectJson !== "object" || projectJson === null) throw new Error(`${projectJsonPath} must contain a JSON object`);
78
78
  const project = projectJson;
79
- const projectName = typeof project.name === "string" ? project.name : path.basename(resolvedAppPath);
79
+ const projectName = project.name ? project.name : path.basename(resolvedAppPath);
80
80
  if (project["style-system"]) {
81
81
  const validatedConfig = validateDesignSystemConfig(project["style-system"], projectName);
82
82
  log.info(`[Config] Loaded and validated style-system config for ${projectName}`);
@@ -229,13 +229,6 @@ var BaseCSSClassesService = class {
229
229
  * ```
230
230
  */
231
231
  var TailwindCSSClassesService = class extends BaseCSSClassesService {
232
- /**
233
- * Creates a new TailwindCSSClassesService instance
234
- * @param config - Style system configuration from toolkit.yaml
235
- */
236
- constructor(config) {
237
- super(config);
238
- }
239
232
  /**
240
233
  * Get the CSS framework identifier
241
234
  * @returns Framework identifier string 'tailwind'
@@ -1403,7 +1396,7 @@ var ViteReactBundlerService = class ViteReactBundlerService extends BaseBundlerS
1403
1396
  const config = this.storyConfigs.get(storyId);
1404
1397
  if (config) try {
1405
1398
  const htmlTemplate = this.generateHtmlTemplate(`@virtual:story-entry?id=${storyId}`, config.darkMode);
1406
- const transformedHtml = await this.server.transformIndexHtml(url$1, htmlTemplate);
1399
+ const transformedHtml = await this.server?.transformIndexHtml(url$1, htmlTemplate);
1407
1400
  res.statusCode = 200;
1408
1401
  res.setHeader("Content-Type", "text/html");
1409
1402
  res.end(transformedHtml);
@@ -2366,7 +2359,6 @@ var ThemeServiceFactory = class {
2366
2359
  * ```
2367
2360
  */
2368
2361
  var ComponentRendererService = class ComponentRendererService {
2369
- monorepoRoot;
2370
2362
  tmpDir;
2371
2363
  themeService;
2372
2364
  appPath;
@@ -2379,7 +2371,6 @@ var ComponentRendererService = class ComponentRendererService {
2379
2371
  */
2380
2372
  constructor(designSystemConfig, appPath, options = {}) {
2381
2373
  if (!appPath) throw new Error("appPath is required for ComponentRendererService");
2382
- this.monorepoRoot = TemplatesManagerService.getWorkspaceRootSync();
2383
2374
  this.appPath = appPath;
2384
2375
  this.tmpDir = path.join(os.tmpdir(), "style-system");
2385
2376
  this.themeService = new ThemeService(designSystemConfig);
@@ -2617,7 +2608,7 @@ var GetUiComponentService = class {
2617
2608
  if (input.darkMode !== void 0 && typeof input.darkMode !== "boolean") throw new Error("darkMode must be a boolean");
2618
2609
  if (input.selector !== void 0) {
2619
2610
  if (typeof input.selector !== "string") throw new Error("selector must be a string");
2620
- if (!/^[a-zA-Z0-9_\-#.\[\]=":' ]+$/.test(input.selector)) throw new Error("selector contains invalid characters");
2611
+ if (!/^[a-zA-Z0-9_\-#.[\]=":' ]+$/.test(input.selector)) throw new Error("selector contains invalid characters");
2621
2612
  if (/javascript:|expression\(|url\(/i.test(input.selector)) throw new Error("selector contains potentially malicious content");
2622
2613
  }
2623
2614
  const { componentName, appPath, storyName = this.config.defaultStoryName, darkMode = this.config.defaultDarkMode } = input;
@@ -115,7 +115,7 @@ async function getAppDesignSystemConfig(appPath) {
115
115
  }
116
116
  if (typeof projectJson !== "object" || projectJson === null) throw new Error(`${projectJsonPath} must contain a JSON object`);
117
117
  const project = projectJson;
118
- const projectName = typeof project.name === "string" ? project.name : node_path.default.basename(resolvedAppPath);
118
+ const projectName = project.name ? project.name : node_path.default.basename(resolvedAppPath);
119
119
  if (project["style-system"]) {
120
120
  const validatedConfig = validateDesignSystemConfig(project["style-system"], projectName);
121
121
  __agiflowai_aicode_utils.log.info(`[Config] Loaded and validated style-system config for ${projectName}`);
@@ -268,13 +268,6 @@ var BaseCSSClassesService = class {
268
268
  * ```
269
269
  */
270
270
  var TailwindCSSClassesService = class extends BaseCSSClassesService {
271
- /**
272
- * Creates a new TailwindCSSClassesService instance
273
- * @param config - Style system configuration from toolkit.yaml
274
- */
275
- constructor(config) {
276
- super(config);
277
- }
278
271
  /**
279
272
  * Get the CSS framework identifier
280
273
  * @returns Framework identifier string 'tailwind'
@@ -1442,7 +1435,7 @@ var ViteReactBundlerService = class ViteReactBundlerService extends BaseBundlerS
1442
1435
  const config = this.storyConfigs.get(storyId);
1443
1436
  if (config) try {
1444
1437
  const htmlTemplate = this.generateHtmlTemplate(`@virtual:story-entry?id=${storyId}`, config.darkMode);
1445
- const transformedHtml = await this.server.transformIndexHtml(url$1, htmlTemplate);
1438
+ const transformedHtml = await this.server?.transformIndexHtml(url$1, htmlTemplate);
1446
1439
  res.statusCode = 200;
1447
1440
  res.setHeader("Content-Type", "text/html");
1448
1441
  res.end(transformedHtml);
@@ -2405,7 +2398,6 @@ var ThemeServiceFactory = class {
2405
2398
  * ```
2406
2399
  */
2407
2400
  var ComponentRendererService = class ComponentRendererService {
2408
- monorepoRoot;
2409
2401
  tmpDir;
2410
2402
  themeService;
2411
2403
  appPath;
@@ -2418,7 +2410,6 @@ var ComponentRendererService = class ComponentRendererService {
2418
2410
  */
2419
2411
  constructor(designSystemConfig, appPath, options = {}) {
2420
2412
  if (!appPath) throw new Error("appPath is required for ComponentRendererService");
2421
- this.monorepoRoot = __agiflowai_aicode_utils.TemplatesManagerService.getWorkspaceRootSync();
2422
2413
  this.appPath = appPath;
2423
2414
  this.tmpDir = node_path.default.join(node_os.default.tmpdir(), "style-system");
2424
2415
  this.themeService = new ThemeService(designSystemConfig);
@@ -2656,7 +2647,7 @@ var GetUiComponentService = class {
2656
2647
  if (input.darkMode !== void 0 && typeof input.darkMode !== "boolean") throw new Error("darkMode must be a boolean");
2657
2648
  if (input.selector !== void 0) {
2658
2649
  if (typeof input.selector !== "string") throw new Error("selector must be a string");
2659
- if (!/^[a-zA-Z0-9_\-#.\[\]=":' ]+$/.test(input.selector)) throw new Error("selector contains invalid characters");
2650
+ if (!/^[a-zA-Z0-9_\-#.[\]=":' ]+$/.test(input.selector)) throw new Error("selector contains invalid characters");
2660
2651
  if (/javascript:|expression\(|url\(/i.test(input.selector)) throw new Error("selector contains potentially malicious content");
2661
2652
  }
2662
2653
  const { componentName, appPath, storyName = this.config.defaultStoryName, darkMode = this.config.defaultDarkMode } = input;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@agiflowai/style-system",
3
3
  "description": "MCP server for exploring themes, Tailwind CSS classes, and UI components from Storybook with standalone component rendering capabilities",
4
- "version": "0.0.6",
4
+ "version": "0.0.7",
5
5
  "license": "AGPL-3.0",
6
6
  "keywords": [
7
7
  "mcp",
@@ -22,7 +22,7 @@
22
22
  "README.md"
23
23
  ],
24
24
  "dependencies": {
25
- "@modelcontextprotocol/sdk": "1.25.2",
25
+ "@modelcontextprotocol/sdk": "1.26.0",
26
26
  "@storybook/csf-tools": "^8.6.14",
27
27
  "@tailwindcss/vite": "^4.1.16",
28
28
  "chalk": "5.6.2",
@@ -38,7 +38,7 @@
38
38
  "tailwindcss": "^4.1.11",
39
39
  "vite": "^7.1.12",
40
40
  "vite-plugin-singlefile": "^2.3.0",
41
- "@agiflowai/aicode-utils": "1.0.13"
41
+ "@agiflowai/aicode-utils": "1.0.14"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@babel/parser": "^7.28.5",