@dxtmisha/scripts 1.1.10 → 1.3.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/CHANGELOG.md CHANGED
@@ -2,6 +2,40 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [1.2.1] - 2026-09-19
6
+
7
+ ### Fixed
8
+ - **Empty Type Declaration File Saving (`DesignTypesMake`)**:
9
+ - Fixed an issue in `DesignTypesMake.make()` where declaration files with empty content (such as files without exportable declarations or with bodies removed during preprocessing) were treated as failures, triggering false `[Warning] Failed to generate AI types for: ...` warnings. Checking `content !== undefined` instead of `if (content)` ensures empty declaration files are saved and cached properly.
10
+
11
+ ### Changed
12
+ - **Documentation & Workflow Overhaul (`README.md`)**:
13
+ - Restructured `README.md` to document the full AI pipeline and design system toolchain.
14
+ - Added a numbered CLI workflow guide covering `dxt-types`, `dxt-types-save`, `dxt-prompt`, `dxt-component`, `dxt-constructor`, `dxt-library`, `dxt-screenshot`, and `dxt-build-packages`.
15
+ - Updated programmatic usage examples demonstrating `DesignTypes`, `LibraryAiPrompt`, `ComponentCreator`, and `LibraryExport`.
16
+ - Detailed foundational principles: Zero Hallucination by Design, Search Before Full Scan, Non-Destructive Agent Rules, Developer Experience First, and TypeScript-first.
17
+ - Clarified architectural differentiation of `@dxtmisha/scripts` as an integrated bridge between design system architecture and AI coding agents.
18
+
19
+ ## [1.2.0] - 2026-09-18
20
+
21
+ ### Added
22
+ - **`LibraryAiPromptAgents` Class**:
23
+ - Implemented `LibraryAiPromptAgents` to synchronize and inject `ai-prompt.md` instructions into `AGENTS.md`.
24
+ - Added boundary markers (`<!-- START:ai-prompt md5:... -->` ... `<!-- END:ai-prompt -->`) with non-fixed length MD5 checksums to detect prompt changes, update the block in place, and preserve surrounding user-defined rules.
25
+ - Added automatic file initialization if `AGENTS.md` does not exist and appending logic for files without markers.
26
+ - Exported `LibraryAiPromptAgents` from `src/library.ts`.
27
+ - **AI Agents Prompt Templates**:
28
+ - Added bilingual template files `src/media/templates/prompts/aiPromptAgents.en.md` and `src/media/templates/prompts/aiPromptAgents.ru.md` specifying preparation rules and strict action protocols for AI agents.
29
+ - **Configuration Constant**:
30
+ - Added `UI_FILE_AI_AGENTS = 'AGENTS.md'` in `src/config.ts`.
31
+ - **Unit Tests**:
32
+ - Added comprehensive test suite `LibraryAiPromptAgents.test.ts` for MD5 verification, marker detection, and update mechanics.
33
+
34
+ ### Changed
35
+ - **`LibraryAiPrompt` Workflow**:
36
+ - Integrated `this.makeAgents()` into `LibraryAiPrompt.make()` to automatically synchronize `AGENTS.md` during prompt generation (`dxt-prompt`).
37
+ - Extracted `new LibraryAiMcp().make()` into a dedicated protected method `makeMcp()`.
38
+
5
39
  ## [1.1.10] - 2026-09-14
6
40
 
7
41
  ### Changed
package/README.md CHANGED
@@ -4,27 +4,31 @@
4
4
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
5
  [![Node.js Version](https://img.shields.io/badge/node-%3E%3D20.0.0-brightgreen)](https://nodejs.org/)
6
6
 
7
- `@dxtmisha/scripts` is a powerful suite of development scripts and CLI tools designed specifically for automating workflows in modern UI libraries.
7
+ `@dxtmisha/scripts` is a powerful suite of development scripts, CLI tools, and an AI context engineering engine designed specifically for modern UI libraries and TypeScript monorepos. It bridges the gap between design systems and Large Language Models (LLMs) — transforming complex codebases into token-efficient, context-rich type summaries (`ai-types.md`) and consolidated system prompts (`ai-prompt.md`, `AGENTS.md`), while automating component scaffolding, token compilation, and library exports.
8
8
 
9
9
  ## Why this library?
10
10
 
11
- Maintaining a UI library inevitably involves a lot of repetitive boilerplate: creating component files, writing basic props interfaces, setting up Storybook configuration, keeping index barrel files updated, and maintaining documentation. Typically each project solves these by copying and pasting folders or writing ad-hoc shell scripts that break over time.
11
+ Maintaining a UI library and pairing with AI coding assistants (Claude, Gemini, ChatGPT, Antigravity, Cursor) introduces two major challenges. On one hand, developers face repetitive boilerplate: scaffolding components, writing props interfaces, managing barrel exports, compiling tokens, and taking screenshots. On the other hand, feeding raw codebases or standard `.d.ts` declaration files into LLMs quickly exhausts context windows with internal implementation noise, leading to hallucinations, invented props, and broken design token conventions.
12
12
 
13
- `scripts` brings all these solutions together in one place — thoughtful, tested, and ready to use. It automates the mundane work, providing a cohesive toolset to scaffold components, generate documentation (including AI-assisted text), and automatically manage library exports, ensuring your UI project remains structured and easy to scale.
13
+ `scripts` brings all these solutions together into a unified, tested toolkit. It provides an automated AI pipeline that cleans TypeScript declarations via AST transforms and generates search-optimized type definitions (`dxt-types`), assembles consolidated system prompts with safe `AGENTS.md` synchronization (`dxt-prompt`), and automates the entire UI lifecycle from component creation (`dxt-component`) to monorepo package building (`dxt-build-packages`).
14
14
 
15
15
  ## What does it do?
16
16
 
17
- For **component scaffolding** — automatic generation of full Vue component templates. A single command sets up `.vue` files, `props.ts`, `styleToken.scss`, and barrel exports, complete with TypeScript definitions.
17
+ For **AI prompt consolidation (`dxt-prompt`)** — `LibraryAiPrompt` scans workspace packages and dependencies to build a unified `ai-prompt.md` system prompt. It consolidates global development rules, Vue style guides (`--vue`), package overviews, links to specialized `ai-resources/*.md` guides, type definitions, and visual screenshot references. It safely synchronizes rules into `AGENTS.md` using MD5-tracked boundary comments without overwriting developer instructions, and generates MCP (Model Context Protocol) configurations (`--mcp`).
18
18
 
19
- For **design system orchestration** — a robust suite of classes to parse TypeScript props, manage constructor configurations, and synchronize design tokens.
19
+ For **AI-optimized type generation (`dxt-types`)** — `DesignTypes` compiles TypeScript declarations, strips private/internal symbols via AST transformation (`DesignTypesMakeTsTransformer`), caches unchanged files via MD5 diffing, and uses AI to generate a minimal, token-efficient `ai-types.md`. It injects searchable `@keywords` tags and concise bilingual (EN/RU) JSDoc comments so AI agents can look up signatures instantly before scanning files. It also generates package summaries (`ai-description.md`), MCP server definitions (`ai-mcp.json`), and handles gitignore rules.
20
20
 
21
- For **documentation & Storybook** — tools to generate `.stories.ts` and `.mdx` files automatically. It can even utilize Google's AI (Gemini) or Anthropic's Claude to generate component descriptions and technical docs.
21
+ For **fast cached type rebuilding (`dxt-types-save`)** — an instant offline command that re-assembles `ai-types.md` and MCP resources directly from cached `ai-types-list/` chunks without calling external LLM APIs, ideal for CI/CD pipelines and fast local builds.
22
22
 
23
- For **Figma integration** — a complete Figma API client capable of fetching styles, analyzing design nodes, and translating them into usable code structures.
23
+ For **component scaffolding (`dxt-component`)** — automatic generation of full Vue component templates. A single command sets up `.vue` files, `props.ts`, `styleToken.scss`, and barrel exports, complete with TypeScript definitions.
24
24
 
25
- For **visual testing** — browser automation using Puppeteer to capture and process component screenshots across different states and themes.
25
+ For **design system orchestration (`dxt-constructor`)** — a robust suite of classes to parse TypeScript props, manage constructor configurations, and synchronize design tokens.
26
26
 
27
- For **library management** — automated maintenance of `index.ts` files (barrel exports) across packages, ensuring all components and utilities are correctly exposed.
27
+ For **visual screenshot capture (`dxt-screenshot`)** — browser automation using Puppeteer to capture high-resolution WebP component screenshots across themes and states, extracting rendered DOM HTML and computed styles for multimodal AI visual inspection.
28
+
29
+ For **library management (`dxt-library`)** — automated maintenance of `index.ts` files (barrel exports) across packages, ensuring all components and utilities are correctly exposed.
30
+
31
+ For **monorepo build orchestration (`dxt-build-packages`)** — topologically ordered compilation and publishing (`dxt-build-publish-packages`) of workspace packages.
28
32
 
29
33
  ## Installation
30
34
 
@@ -39,47 +43,65 @@ npm install -D @dxtmisha/scripts
39
43
  ### CLI Commands
40
44
 
41
45
  ```bash
42
- # Generate component scaffolds in empty directories
43
- npx dxt-component
46
+ # 1. Compile declarations and generate AI-optimized type definitions (ai-types.md)
47
+ npx dxt-types
44
48
 
45
- # Generate wiki documentation for a specific component
46
- npx dxt-component-wiki MyButton
49
+ # 2. Fast rebuild of ai-types.md from cache without calling AI APIs
50
+ npx dxt-types-save
47
51
 
48
- # Build component constructors
52
+ # 3. Generate consolidated ai-prompt.md, update AGENTS.md, and create MCP resources
53
+ npx dxt-prompt --mcp --vue
54
+
55
+ # 4. Scaffold component templates in empty directories
56
+ npx dxt-component
57
+
58
+ # 5. Build component constructors and token bindings
49
59
  npx dxt-constructor
50
60
 
51
- # Rebuild library exports
61
+ # 6. Rebuild library index exports
52
62
  npx dxt-library
53
63
 
54
- # Full UI project build
55
- npx dxt-ui
64
+ # 7. Capture component screenshots for multimodal AI context
65
+ npx dxt-screenshot
66
+
67
+ # 8. Build all monorepo packages in dependency order
68
+ npx dxt-build-packages
56
69
  ```
57
70
 
58
71
  ### Programmatic Usage
59
72
 
60
73
  ```typescript
61
- import { ComponentCreator, AiGoogle, LibraryExport } from '@dxtmisha/scripts'
62
-
63
- // Generate component scaffolds
74
+ import {
75
+ DesignTypes,
76
+ LibraryAiPrompt,
77
+ ComponentCreator,
78
+ LibraryExport
79
+ } from '@dxtmisha/scripts'
80
+
81
+ // 1. Generate AI-optimized types (ai-types.md, ai-description.md, ai-mcp.json)
82
+ const types = new DesignTypes()
83
+ await types.make()
84
+
85
+ // 2. Consolidate repository AI prompt (ai-prompt.md) and sync AGENTS.md
86
+ const prompt = new LibraryAiPrompt([], true, true)
87
+ prompt.make()
88
+
89
+ // 3. Scaffold component templates
64
90
  const creator = new ComponentCreator()
65
91
  creator.make()
66
92
 
67
- // AI-powered generation
68
- const ai = new AiGoogle()
69
- ai.setModel('gemini-1.5-flash')
70
- const result = await ai.generate('Create props interface for Button component')
71
-
72
- // Library export management
93
+ // 4. Manage barrel exports
73
94
  const library = new LibraryExport()
74
95
  library.make()
75
96
  ```
76
97
 
77
98
  ## Principles
78
99
 
79
- - **Developer Experience First** — commands are simple, outputs are predictable. You shouldn't have to write boilerplate.
80
- - **TypeScript-first** — strict typing and autocomplete out of the box. Ships source directly, making it easy to integrate into modern tooling environments.
81
- - **AI-Enhanced** — embraces LLMs to speed up tedious documentation and scaffolding tasks.
82
- - **Clean API** — predictable behavior and clear naming for programmatically managing UI systems.
100
+ - **Zero Hallucination by Design** — bounded, verified AI context. Generating compact `ai-types.md` and consolidated `ai-prompt.md` files prevents LLMs from guessing signatures or misinterpreting tokens.
101
+ - **Search Before Full Scan** — `@keywords` indexing and structured headers allow AI agents to quickly retrieve needed types via text search without burning context tokens on massive files.
102
+ - **Non-Destructive Agent Rules** — updates to `AGENTS.md` are performed strictly within MD5-tracked marker blocks, preserving developer-specific instructions.
103
+ - **Developer Experience First** — commands are simple, outputs are predictable. You shouldn't have to write boilerplate or manually maintain exports and documentation prompts.
104
+ - **TypeScript-first** — strict typing and AST-level transformations out of the box, integrating seamlessly into modern monorepo tooling.
83
105
 
84
106
  ## Documentation
85
107
 
@@ -89,7 +111,7 @@ Full API reference, examples, and guides:
89
111
 
90
112
  ## Difference from other tools
91
113
 
92
- - **`@dxtmisha/scripts`** — specifically tailored for the internal architecture of DXT UI, integrating deeply with our property management and Storybook setup. Not a generic scaffolding tool like Yeoman or Plop.
114
+ - **`@dxtmisha/scripts`** — an integrated design system engine combining UI scaffolding, token compilation, and specialized AI context generation (`ai-types.md`, `ai-prompt.md`, `AGENTS.md`, MCP). Not just a generic generator like Yeoman or Plop, but an end-to-end bridge between design system architecture and AI coding agents.
93
115
 
94
116
  ## License
95
117
 
package/dist/config.d.ts CHANGED
@@ -7,6 +7,9 @@ export declare const UI_DIR_AI = "ai";
7
7
  /** Screenshot folder name for AI / Название папки со снимками экрана для AI */
8
8
  export declare const UI_DIR_AI_PROMPT_SCREENSHOT = "ai-screenshot";
9
9
 
10
+ /** AI prompts directory name / Название директории промптов AI */
11
+ export declare const UI_DIR_AI_PROMPTS = "ai-prompts";
12
+
10
13
  /** AI types directory name in root / Название директории типов AI в корне */
11
14
  export declare const UI_DIR_AI_TYPES = "ai-packages-types";
12
15
 
@@ -82,6 +85,9 @@ export declare const UI_DIRS_WIKI: string[];
82
85
  /** SCSS file extension/ Расширение файлов SCSS */
83
86
  export declare const UI_EXTENSION_STYLE = "scss";
84
87
 
88
+ /** AI agents instruction file name / Название файла инструкций для агентов AI */
89
+ export declare const UI_FILE_AI_AGENTS = "AGENTS.md";
90
+
85
91
  /** AI description file name / Название файла с описанием AI */
86
92
  export declare const UI_FILE_AI_DESCRIPTION = "ai-description.md";
87
93
 
package/dist/config.js CHANGED
@@ -1,20 +1,20 @@
1
1
  //#region src/config.ts
2
- var e = "design.config.json", t = "@dxtmisha", n = "constructor", r = `${t}/${n}`, i = "node_modules", a = "d", o = "custom", s = /\/\/ *export:none/, c = "src", l = "ai", u = "ai-screenshot", d = "ai-packages-types", f = "ai-types-list", p = "ai-types-temp", m = "resources", h = "components", g = "constructors", _ = "structure", v = "wiki", y = "temporary", b = "dist", x = "dist-temporary", S = "prompt", C = "packages", w = [
2
+ var e = "design.config.json", t = "@dxtmisha", n = "constructor", r = `${t}/${n}`, i = "node_modules", a = "d", o = "custom", s = /\/\/ *export:none/, c = "src", l = "ai", u = "ai-screenshot", d = "ai-packages-types", f = "ai-types-list", p = "ai-types-temp", m = "resources", h = "components", g = "constructors", _ = "structure", v = "wiki", y = "temporary", b = "dist", x = "dist-temporary", S = "prompt", C = "ai-prompts", w = "packages", T = [
3
3
  "src",
4
4
  v,
5
5
  "ai"
6
- ], T = ["src", "media"], E = [...T, "icons"], D = ["src", h], O = ["src", g], k = ["src", "styles"], A = ["src", "library"], j = ["src", v], M = ["src", "library.ts"], N = [
6
+ ], E = ["src", "media"], D = [...E, "icons"], O = ["src", h], k = ["src", g], A = ["src", "styles"], j = ["src", "library"], M = ["src", v], N = ["src", "library.ts"], P = [
7
7
  "classes",
8
8
  "components",
9
9
  "composables",
10
10
  "functions",
11
11
  "global",
12
12
  "types"
13
- ], P = ".gitignore", ee = "package.json", F = "properties.json", I = "ai-description.md", L = "ai-doc.md", R = "ai-instruction.md", z = "ai-prompt.md", B = "ai-types.md", V = "ai-developer.md", H = "screenshot.json", U = "screenshot-code.html", W = "screenshot-styles.css", G = "flags", K = "media", q = "design", J = "plugin", Y = "style", X = "wiki", Z = "vite.config.ts", Q = "vite-workers.config.ts", $ = "index.ts", te = "ai-types.md", ne = "ai-description.md", re = "ai-mcp-resources.json", ie = "ai-mcp-all-resources.json", ae = "ai-mcp-all-resources.ts", oe = "style.scss", se = "ui-properties.scss", ce = "scss", le = "classes", ue = [
13
+ ], ee = ".gitignore", F = "package.json", I = "properties.json", L = "AGENTS.md", R = "ai-description.md", z = "ai-doc.md", B = "ai-instruction.md", V = "ai-prompt.md", H = "ai-types.md", U = "ai-developer.md", W = "screenshot.json", G = "screenshot-code.html", K = "screenshot-styles.css", q = "flags", J = "media", Y = "design", X = "plugin", Z = "style", Q = "wiki", $ = "vite.config.ts", te = "vite-workers.config.ts", ne = "index.ts", re = "ai-types.md", ie = "ai-description.md", ae = "ai-mcp-resources.json", oe = "ai-mcp-all-resources.json", se = "ai-mcp-all-resources.ts", ce = "style.scss", le = "ui-properties.scss", ue = "scss", de = "classes", fe = [
14
14
  "disabled",
15
15
  "focus",
16
16
  "readonly",
17
17
  "read-only"
18
18
  ];
19
19
  //#endregion
20
- export { e as UI_CONFIG_FILE, w as UI_DIRS_AI_WIKI, D as UI_DIRS_COMPONENTS, O as UI_DIRS_CONSTRUCTOR, M as UI_DIRS_FILE_EXPORT, E as UI_DIRS_ICONS, A as UI_DIRS_LIBRARY, N as UI_DIRS_LIST_EXPORT, k as UI_DIRS_STYLES, T as UI_DIRS_TOKENS, j as UI_DIRS_WIKI, l as UI_DIR_AI, u as UI_DIR_AI_PROMPT_SCREENSHOT, d as UI_DIR_AI_TYPES, f as UI_DIR_AI_TYPES_LIST, p as UI_DIR_AI_TYPES_TEMPORARY, h as UI_DIR_COMPONENTS, g as UI_DIR_CONSTRUCTOR, b as UI_DIR_DIST, x as UI_DIR_DIST_TEMPORARY, c as UI_DIR_IN, C as UI_DIR_PACKAGES, S as UI_DIR_PROMPT, m as UI_DIR_RESOURCES, _ as UI_DIR_STRUCTURE, y as UI_DIR_TEMPORARY, v as UI_DIR_WIKI, ce as UI_EXTENSION_STYLE, ne as UI_FILE_AI_DESCRIPTION, re as UI_FILE_AI_MCP, ie as UI_FILE_AI_MCP_ALL, ae as UI_FILE_AI_MCP_ALL_TS, I as UI_FILE_AI_PROMPT_DESCRIPTION, V as UI_FILE_AI_PROMPT_DEVELOPER, L as UI_FILE_AI_PROMPT_INFO, R as UI_FILE_AI_PROMPT_INSTRUCTION, z as UI_FILE_AI_PROMPT_PROMPT, U as UI_FILE_AI_PROMPT_SCREENSHOT_CODE, H as UI_FILE_AI_PROMPT_SCREENSHOT_JSON, W as UI_FILE_AI_PROMPT_SCREENSHOT_STYLES, B as UI_FILE_AI_PROMPT_TYPES, te as UI_FILE_AI_TYPES, P as UI_FILE_GITIGNORE, $ as UI_FILE_INDEX, q as UI_FILE_NAME_DESIGN, G as UI_FILE_NAME_FLAGS, K as UI_FILE_NAME_MEDIA, J as UI_FILE_NAME_PLUGIN, Y as UI_FILE_NAME_STYLE, Z as UI_FILE_NAME_VITE, Q as UI_FILE_NAME_VITE_WORKERS, X as UI_FILE_NAME_WIKI, ee as UI_FILE_PACKAGE, F as UI_FILE_PROPERTY, se as UI_FILE_STYLE_PROPERTIES, oe as UI_FILE_STYLE_SCSS, s as UI_FLAG_NOT_EXPORT, a as UI_KEY_CONSTRUCTOR, o as UI_KEY_CUSTOM, i as UI_MODULES, r as UI_PROJECT_CONSTRUCTOR_FULL_NAME, n as UI_PROJECT_CONSTRUCTOR_NAME, t as UI_PROJECT_NAME, ue as UI_PROPERTY_FOR_PROPS, le as UI_STRUCTURE_CLASSES };
20
+ export { e as UI_CONFIG_FILE, T as UI_DIRS_AI_WIKI, O as UI_DIRS_COMPONENTS, k as UI_DIRS_CONSTRUCTOR, N as UI_DIRS_FILE_EXPORT, D as UI_DIRS_ICONS, j as UI_DIRS_LIBRARY, P as UI_DIRS_LIST_EXPORT, A as UI_DIRS_STYLES, E as UI_DIRS_TOKENS, M as UI_DIRS_WIKI, l as UI_DIR_AI, C as UI_DIR_AI_PROMPTS, u as UI_DIR_AI_PROMPT_SCREENSHOT, d as UI_DIR_AI_TYPES, f as UI_DIR_AI_TYPES_LIST, p as UI_DIR_AI_TYPES_TEMPORARY, h as UI_DIR_COMPONENTS, g as UI_DIR_CONSTRUCTOR, b as UI_DIR_DIST, x as UI_DIR_DIST_TEMPORARY, c as UI_DIR_IN, w as UI_DIR_PACKAGES, S as UI_DIR_PROMPT, m as UI_DIR_RESOURCES, _ as UI_DIR_STRUCTURE, y as UI_DIR_TEMPORARY, v as UI_DIR_WIKI, ue as UI_EXTENSION_STYLE, L as UI_FILE_AI_AGENTS, ie as UI_FILE_AI_DESCRIPTION, ae as UI_FILE_AI_MCP, oe as UI_FILE_AI_MCP_ALL, se as UI_FILE_AI_MCP_ALL_TS, R as UI_FILE_AI_PROMPT_DESCRIPTION, U as UI_FILE_AI_PROMPT_DEVELOPER, z as UI_FILE_AI_PROMPT_INFO, B as UI_FILE_AI_PROMPT_INSTRUCTION, V as UI_FILE_AI_PROMPT_PROMPT, G as UI_FILE_AI_PROMPT_SCREENSHOT_CODE, W as UI_FILE_AI_PROMPT_SCREENSHOT_JSON, K as UI_FILE_AI_PROMPT_SCREENSHOT_STYLES, H as UI_FILE_AI_PROMPT_TYPES, re as UI_FILE_AI_TYPES, ee as UI_FILE_GITIGNORE, ne as UI_FILE_INDEX, Y as UI_FILE_NAME_DESIGN, q as UI_FILE_NAME_FLAGS, J as UI_FILE_NAME_MEDIA, X as UI_FILE_NAME_PLUGIN, Z as UI_FILE_NAME_STYLE, $ as UI_FILE_NAME_VITE, te as UI_FILE_NAME_VITE_WORKERS, Q as UI_FILE_NAME_WIKI, F as UI_FILE_PACKAGE, I as UI_FILE_PROPERTY, le as UI_FILE_STYLE_PROPERTIES, ce as UI_FILE_STYLE_SCSS, s as UI_FLAG_NOT_EXPORT, a as UI_KEY_CONSTRUCTOR, o as UI_KEY_CUSTOM, i as UI_MODULES, r as UI_PROJECT_CONSTRUCTOR_FULL_NAME, n as UI_PROJECT_CONSTRUCTOR_NAME, t as UI_PROJECT_NAME, fe as UI_PROPERTY_FOR_PROPS, de as UI_STRUCTURE_CLASSES };
@@ -1,6 +1,6 @@
1
1
  import { n as e, t } from "./PropertiesConfig-BBsuNndv.js";
2
2
  import { UI_DIRS_COMPONENTS as n, UI_DIRS_CONSTRUCTOR as r, UI_DIRS_ICONS as i, UI_DIRS_LIBRARY as a, UI_DIRS_STYLES as o, UI_DIRS_TOKENS as s, UI_DIRS_WIKI as c, UI_DIR_COMPONENTS as l, UI_DIR_CONSTRUCTOR as u, UI_DIR_DIST as d, UI_DIR_STRUCTURE as f, UI_EXTENSION_STYLE as p, UI_FILE_NAME_DESIGN as ee, UI_FILE_NAME_MEDIA as te, UI_FILE_NAME_PLUGIN as ne, UI_FILE_NAME_STYLE as re, UI_FILE_NAME_WIKI as ie, UI_FILE_PACKAGE as ae, UI_FILE_PROPERTY as m, UI_FILE_STYLE_PROPERTIES as oe, UI_FILE_STYLE_SCSS as se, UI_KEY_CUSTOM as ce, UI_PROJECT_CONSTRUCTOR_FULL_NAME as le, UI_PROJECT_CONSTRUCTOR_NAME as h, UI_PROPERTY_FOR_PROPS as ue, UI_STRUCTURE_CLASSES as de } from "./config.js";
3
- import { a as g, i as fe, n as _, r as v, t as y } from "./propertyTypes-CstobYcc.js";
3
+ import { a as g, i as fe, n as _, r as v, t as y } from "./propertyTypes-CeW8CD8G.js";
4
4
  import { ServerStorage as pe, copyObject as me, forEach as b, getColumn as x, isArray as S, isFilled as C, isNull as he, isObject as w, isObjectNotArray as T, isSelected as E, isString as ge, replaceComponentName as _e, replaceRecursive as D, splice as ve, strFill as ye, toArray as O, toCamelCase as k, toCamelCaseFirst as A, toKebabCase as j, uniqueArray as be } from "@dxtmisha/functional-basic";
5
5
  import M from "typescript";
6
6
  import * as xe from "sass";
package/dist/library.d.ts CHANGED
@@ -3482,6 +3482,20 @@ export declare class LibraryAiPrompt {
3482
3482
  * Основной метод для генерации файла промпта ИИ.
3483
3483
  */
3484
3484
  make(): void;
3485
+ /**
3486
+ * Injects and synchronizes the ai-prompt guidelines in AGENTS.md.
3487
+ *
3488
+ * Внедряет и синхронизирует инструкции ai-prompt в AGENTS.md.
3489
+ * @protected
3490
+ */
3491
+ protected makeAgents(): void;
3492
+ /**
3493
+ * Generates MCP configuration and resources.
3494
+ *
3495
+ * Генерирует конфигурацию и ресурсы MCP.
3496
+ * @protected
3497
+ */
3498
+ protected makeMcp(): void;
3485
3499
  /**
3486
3500
  * Checks whether the library should be excluded from the ai-prompt.md file based on configuration.
3487
3501
  *
@@ -3525,6 +3539,14 @@ export declare class LibraryAiPrompt {
3525
3539
  * @protected
3526
3540
  */
3527
3541
  protected getInstruction(): string | undefined;
3542
+ /**
3543
+ * Retrieves the prompts section from ai-prompts directory.
3544
+ *
3545
+ * Получает секцию промптов из директории ai-prompts.
3546
+ * @returns formatted prompts section or undefined / отформатированная секция промптов или undefined
3547
+ * @protected
3548
+ */
3549
+ protected getPrompts(): string | undefined;
3528
3550
  /**
3529
3551
  * Retrieves the Vue component implementation prompt.
3530
3552
  *
@@ -3595,6 +3617,104 @@ export declare class LibraryAiPrompt {
3595
3617
  protected writeMcp(mcpData: Record<string, any>[]): this;
3596
3618
  }
3597
3619
 
3620
+ /**
3621
+ * Class for injecting and synchronizing the ai-prompt guidelines into AGENTS.md.
3622
+ * Tracks changes using MD5 hashes and boundary markers to preserve existing content in AGENTS.md.
3623
+ *
3624
+ * Класс для внедрения и синхронизации инструкций ai-prompt в AGENTS.md.
3625
+ * Отслеживает изменения с помощью хэшей MD5 и граничных меток для сохранения существующего контента в AGENTS.md.
3626
+ */
3627
+ export declare class LibraryAiPromptAgents {
3628
+ protected readonly targetFile: string;
3629
+ /** Regular expression to find marked ai-prompt section with MD5 / Регулярное выражение для поиска размеченной секции ai-prompt с MD5 */
3630
+ protected readonly exMarker: RegExp;
3631
+ /**
3632
+ * Constructor for LibraryAiPromptAgents.
3633
+ *
3634
+ * Конструктор для LibraryAiPromptAgents.
3635
+ * @param targetFile Target agents file path / Путь к целевому файлу agents
3636
+ */
3637
+ constructor(targetFile?: string);
3638
+ /**
3639
+ * Generates or updates the ai-prompt section in AGENTS.md if changed.
3640
+ *
3641
+ * Генерирует или обновляет секцию ai-prompt в AGENTS.md при наличии изменений.
3642
+ */
3643
+ make(): void;
3644
+ /**
3645
+ * Checks if boundary markers exist in the given content.
3646
+ *
3647
+ * Проверяет, присутствуют ли граничные метки в переданном контенте.
3648
+ * @param content File content to check / Содержимое файла для проверки
3649
+ * @returns true if markers found / true, если метки найдены
3650
+ * @protected
3651
+ */
3652
+ protected isMarker(content: string): boolean;
3653
+ /**
3654
+ * Returns the prompt template content.
3655
+ *
3656
+ * Возвращает содержимое шаблона промпта.
3657
+ * @returns Raw prompt content string / Исходная строка содержимого промпта
3658
+ * @protected
3659
+ */
3660
+ protected getContent(): string;
3661
+ /**
3662
+ * Generates initial content for a new AGENTS.md file.
3663
+ *
3664
+ * Генерирует начальное содержимое для нового файла AGENTS.md.
3665
+ * @param section Formatted ai-prompt section / Отформатированная секция ai-prompt
3666
+ * @returns Initial file content / Начальное содержимое файла
3667
+ * @protected
3668
+ */
3669
+ protected getInitial(section: string): string;
3670
+ /**
3671
+ * Calculates MD5 hash of the prompt template content.
3672
+ *
3673
+ * Вычисляет MD5 хэш содержимого шаблона промпта.
3674
+ * @returns Calculated MD5 hex string / Вычисленная hex-строка MD5
3675
+ * @protected
3676
+ */
3677
+ protected getMd5(): string;
3678
+ /**
3679
+ * Wraps the prompt content in HTML comment boundary markers with MD5 hash.
3680
+ *
3681
+ * Оборачивает контент промпта в граничные маркеры комментариев HTML с MD5 хэшем.
3682
+ * @param md5 MD5 hash checksum (defaults to this.getMd5()) / Контрольная сумма хэша MD5 (по умолчанию this.getMd5())
3683
+ * @returns Formatted section with start and end markers / Отформатированная секция с начальной и конечной метками
3684
+ * @protected
3685
+ */
3686
+ protected getSection(md5?: string): string;
3687
+ /**
3688
+ * Updates the marked ai-prompt section if boundary markers exist.
3689
+ *
3690
+ * Обновляет размеченную секцию ai-prompt, если граничные метки существуют.
3691
+ * @param existingContent Current file content / Текущее содержимое файла
3692
+ * @param section Formatted section to insert / Отформатированная секция для вставки
3693
+ * @returns true if updated, false if up to date or markers not found / true, если обновлено, false, если актуально или метки не найдены
3694
+ * @protected
3695
+ */
3696
+ protected updateMarker(existingContent: string, section: string): boolean;
3697
+ /**
3698
+ * Appends the ai-prompt section to the end of the file.
3699
+ *
3700
+ * Добавляет секцию ai-prompt в конец файла.
3701
+ * @param existingContent Current file content / Текущее содержимое файла
3702
+ * @param section Formatted section to append / Отформатированная секция для добавления
3703
+ * @returns true if file was updated / true, если файл был обновлен
3704
+ * @protected
3705
+ */
3706
+ protected append(existingContent: string, section: string): boolean;
3707
+ /**
3708
+ * Writes content to the target file.
3709
+ *
3710
+ * Записывает контент в целевой файл.
3711
+ * @param content Content to write / Контент для записи
3712
+ * @returns this instance / этот экземпляр
3713
+ * @protected
3714
+ */
3715
+ protected write(content: string): this;
3716
+ }
3717
+
3598
3718
  /**
3599
3719
  * Class representing an item in the AI prompt generation process.
3600
3720
  * Handles reading and aggregating various project-related files (descriptions, info, types, screenshots)
@@ -3781,6 +3901,79 @@ export declare class LibraryAiPromptItem {
3781
3901
  protected readFile(dirFile: string): string;
3782
3902
  }
3783
3903
 
3904
+ /**
3905
+ * AI prompt metadata extracted from markdown YAML frontmatter.
3906
+ *
3907
+ * Метаданные промпта ИИ, извлеченные из YAML frontmatter в markdown.
3908
+ */
3909
+ export declare type LibraryAiPromptItemMetadata = {
3910
+ /** Name or identifier of the prompt / Имя или идентификатор промпта */
3911
+ name: string;
3912
+ /** Description of the prompt rules and usage / Описание правил и использования промпта */
3913
+ description: string;
3914
+ };
3915
+
3916
+ /**
3917
+ * Class for analyzing prompt files in ai-prompts directory and generating a prompt section.
3918
+ * Scans markdown files, extracts YAML frontmatter metadata (name and description),
3919
+ * and formats them into a consolidated mandatory rules section.
3920
+ *
3921
+ * Класс для анализа файлов промптов в директории ai-prompts и генерации секции промптов.
3922
+ * Сканирует markdown-файлы, извлекает метаданные YAML frontmatter (имя и описание)
3923
+ * и форматирует их в консолидированную секцию обязательных правил.
3924
+ */
3925
+ export declare class LibraryAiPromptPrompts {
3926
+ protected readonly dir: string;
3927
+ /** Regular expression to find YAML frontmatter block. / Регулярное выражение для поиска блока YAML frontmatter. */
3928
+ protected readonly exFrontmatter: RegExp;
3929
+ /** Regular expression to extract prompt name. / Регулярное выражение для извлечения имени промпта. */
3930
+ protected readonly exName: RegExp;
3931
+ /** Regular expression to extract prompt description. / Регулярное выражение для извлечения описания промпта. */
3932
+ protected readonly exDescription: RegExp;
3933
+ /**
3934
+ * Constructor for LibraryAiPromptPrompts.
3935
+ *
3936
+ * Конструктор для LibraryAiPromptPrompts.
3937
+ * @param dir Directory containing AI prompt files / Директория, содержащая файлы промптов ИИ
3938
+ */
3939
+ constructor(dir?: string);
3940
+ /**
3941
+ * Analyzes prompt files in the directory and returns formatted markdown section.
3942
+ *
3943
+ * Анализирует файлы промптов в директории и возвращает отформатированную секцию markdown.
3944
+ * @returns formatted prompts section or undefined / отформатированная секция промптов или undefined
3945
+ */
3946
+ make(): string | undefined;
3947
+ /**
3948
+ * Retrieves a list of formatted rule lines for all prompt files with valid frontmatter.
3949
+ *
3950
+ * Получает список отформатированных строк правил для всех файлов промптов с корректным frontmatter.
3951
+ * @returns array of formatted prompt rule lines / массив отформатированных строк правил промптов
3952
+ * @protected
3953
+ */
3954
+ protected getList(): string[];
3955
+ /**
3956
+ * Extracts frontmatter metadata (name and description) from file content.
3957
+ *
3958
+ * Извлекает метаданные frontmatter (имя и описание) из содержимого файла.
3959
+ * @param content file content / содержимое файла
3960
+ * @returns metadata object or undefined / объект метаданных или undefined
3961
+ * @protected
3962
+ */
3963
+ protected getMetadata(content: string): LibraryAiPromptItemMetadata | undefined;
3964
+ /**
3965
+ * Formats a single prompt rule line.
3966
+ *
3967
+ * Форматирует отдельную строку правила промпта.
3968
+ * @param name prompt name or identifier / имя или идентификатор промпта
3969
+ * @param path relative file path from project root / относительный путь к файлу от корня проекта
3970
+ * @param description prompt description / описание промпта
3971
+ * @returns formatted prompt rule line / отформатированная строка правила промпта
3972
+ * @protected
3973
+ */
3974
+ protected getPromptLine(name: string, path: string, description: string): string;
3975
+ }
3976
+
3784
3977
  /**
3785
3978
  * Class representing screenshot handling in the AI prompt generation process.
3786
3979
  * Manages reading screenshot image references, copying HTML/CSS showcase artifacts, and enriching screenshot lists with AI descriptions.