@dxtmisha/scripts 1.1.10 → 1.2.1
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 +34 -0
- package/README.md +53 -31
- package/dist/config.d.ts +3 -0
- package/dist/config.js +2 -2
- package/dist/library-ui.js +1 -1
- package/dist/library.d.ts +112 -0
- package/dist/library.js +221 -161
- package/dist/{propertyTypes-CstobYcc.js → propertyTypes-CeW8CD8G.js} +1 -1
- package/package.json +1 -1
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
|
[](https://opensource.org/licenses/MIT)
|
|
5
5
|
[](https://nodejs.org/)
|
|
6
6
|
|
|
7
|
-
`@dxtmisha/scripts` is a powerful suite of development scripts
|
|
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
|
|
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
|
|
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 **
|
|
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 **
|
|
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 **
|
|
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 **
|
|
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 **
|
|
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 **
|
|
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
|
-
#
|
|
43
|
-
npx dxt-
|
|
46
|
+
# 1. Compile declarations and generate AI-optimized type definitions (ai-types.md)
|
|
47
|
+
npx dxt-types
|
|
44
48
|
|
|
45
|
-
#
|
|
46
|
-
npx dxt-
|
|
49
|
+
# 2. Fast rebuild of ai-types.md from cache without calling AI APIs
|
|
50
|
+
npx dxt-types-save
|
|
47
51
|
|
|
48
|
-
#
|
|
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
|
-
#
|
|
55
|
-
npx dxt-
|
|
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 {
|
|
62
|
-
|
|
63
|
-
|
|
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
|
-
//
|
|
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
|
-
- **
|
|
80
|
-
- **
|
|
81
|
-
- **
|
|
82
|
-
- **
|
|
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`** —
|
|
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
|
@@ -82,6 +82,9 @@ export declare const UI_DIRS_WIKI: string[];
|
|
|
82
82
|
/** SCSS file extension/ Расширение файлов SCSS */
|
|
83
83
|
export declare const UI_EXTENSION_STYLE = "scss";
|
|
84
84
|
|
|
85
|
+
/** AI agents instruction file name / Название файла инструкций для агентов AI */
|
|
86
|
+
export declare const UI_FILE_AI_AGENTS = "AGENTS.md";
|
|
87
|
+
|
|
85
88
|
/** AI description file name / Название файла с описанием AI */
|
|
86
89
|
export declare const UI_FILE_AI_DESCRIPTION = "ai-description.md";
|
|
87
90
|
|
package/dist/config.js
CHANGED
|
@@ -10,11 +10,11 @@ var e = "design.config.json", t = "@dxtmisha", n = "constructor", r = `${t}/${n}
|
|
|
10
10
|
"functions",
|
|
11
11
|
"global",
|
|
12
12
|
"types"
|
|
13
|
-
], P = ".gitignore", ee = "package.json", F = "properties.json", I = "ai-description.md",
|
|
13
|
+
], P = ".gitignore", ee = "package.json", F = "properties.json", I = "AGENTS.md", L = "ai-description.md", R = "ai-doc.md", z = "ai-instruction.md", B = "ai-prompt.md", V = "ai-types.md", H = "ai-developer.md", U = "screenshot.json", W = "screenshot-code.html", G = "screenshot-styles.css", K = "flags", q = "media", J = "design", Y = "plugin", X = "style", Z = "wiki", Q = "vite.config.ts", $ = "vite-workers.config.ts", te = "index.ts", ne = "ai-types.md", re = "ai-description.md", ie = "ai-mcp-resources.json", ae = "ai-mcp-all-resources.json", oe = "ai-mcp-all-resources.ts", se = "style.scss", ce = "ui-properties.scss", le = "scss", ue = "classes", de = [
|
|
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,
|
|
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, le as UI_EXTENSION_STYLE, I as UI_FILE_AI_AGENTS, re as UI_FILE_AI_DESCRIPTION, ie as UI_FILE_AI_MCP, ae as UI_FILE_AI_MCP_ALL, oe as UI_FILE_AI_MCP_ALL_TS, L as UI_FILE_AI_PROMPT_DESCRIPTION, H as UI_FILE_AI_PROMPT_DEVELOPER, R as UI_FILE_AI_PROMPT_INFO, z as UI_FILE_AI_PROMPT_INSTRUCTION, B as UI_FILE_AI_PROMPT_PROMPT, W as UI_FILE_AI_PROMPT_SCREENSHOT_CODE, U as UI_FILE_AI_PROMPT_SCREENSHOT_JSON, G as UI_FILE_AI_PROMPT_SCREENSHOT_STYLES, V as UI_FILE_AI_PROMPT_TYPES, ne as UI_FILE_AI_TYPES, P as UI_FILE_GITIGNORE, te as UI_FILE_INDEX, J as UI_FILE_NAME_DESIGN, K as UI_FILE_NAME_FLAGS, q as UI_FILE_NAME_MEDIA, Y as UI_FILE_NAME_PLUGIN, X as UI_FILE_NAME_STYLE, Q as UI_FILE_NAME_VITE, $ as UI_FILE_NAME_VITE_WORKERS, Z as UI_FILE_NAME_WIKI, ee as UI_FILE_PACKAGE, F as UI_FILE_PROPERTY, ce as UI_FILE_STYLE_PROPERTIES, se 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, de as UI_PROPERTY_FOR_PROPS, ue as UI_STRUCTURE_CLASSES };
|
package/dist/library-ui.js
CHANGED
|
@@ -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-
|
|
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
|
*
|
|
@@ -3595,6 +3609,104 @@ export declare class LibraryAiPrompt {
|
|
|
3595
3609
|
protected writeMcp(mcpData: Record<string, any>[]): this;
|
|
3596
3610
|
}
|
|
3597
3611
|
|
|
3612
|
+
/**
|
|
3613
|
+
* Class for injecting and synchronizing the ai-prompt guidelines into AGENTS.md.
|
|
3614
|
+
* Tracks changes using MD5 hashes and boundary markers to preserve existing content in AGENTS.md.
|
|
3615
|
+
*
|
|
3616
|
+
* Класс для внедрения и синхронизации инструкций ai-prompt в AGENTS.md.
|
|
3617
|
+
* Отслеживает изменения с помощью хэшей MD5 и граничных меток для сохранения существующего контента в AGENTS.md.
|
|
3618
|
+
*/
|
|
3619
|
+
export declare class LibraryAiPromptAgents {
|
|
3620
|
+
protected readonly targetFile: string;
|
|
3621
|
+
/** Regular expression to find marked ai-prompt section with MD5 / Регулярное выражение для поиска размеченной секции ai-prompt с MD5 */
|
|
3622
|
+
protected readonly exMarker: RegExp;
|
|
3623
|
+
/**
|
|
3624
|
+
* Constructor for LibraryAiPromptAgents.
|
|
3625
|
+
*
|
|
3626
|
+
* Конструктор для LibraryAiPromptAgents.
|
|
3627
|
+
* @param targetFile Target agents file path / Путь к целевому файлу agents
|
|
3628
|
+
*/
|
|
3629
|
+
constructor(targetFile?: string);
|
|
3630
|
+
/**
|
|
3631
|
+
* Generates or updates the ai-prompt section in AGENTS.md if changed.
|
|
3632
|
+
*
|
|
3633
|
+
* Генерирует или обновляет секцию ai-prompt в AGENTS.md при наличии изменений.
|
|
3634
|
+
*/
|
|
3635
|
+
make(): void;
|
|
3636
|
+
/**
|
|
3637
|
+
* Checks if boundary markers exist in the given content.
|
|
3638
|
+
*
|
|
3639
|
+
* Проверяет, присутствуют ли граничные метки в переданном контенте.
|
|
3640
|
+
* @param content File content to check / Содержимое файла для проверки
|
|
3641
|
+
* @returns true if markers found / true, если метки найдены
|
|
3642
|
+
* @protected
|
|
3643
|
+
*/
|
|
3644
|
+
protected isMarker(content: string): boolean;
|
|
3645
|
+
/**
|
|
3646
|
+
* Returns the prompt template content.
|
|
3647
|
+
*
|
|
3648
|
+
* Возвращает содержимое шаблона промпта.
|
|
3649
|
+
* @returns Raw prompt content string / Исходная строка содержимого промпта
|
|
3650
|
+
* @protected
|
|
3651
|
+
*/
|
|
3652
|
+
protected getContent(): string;
|
|
3653
|
+
/**
|
|
3654
|
+
* Generates initial content for a new AGENTS.md file.
|
|
3655
|
+
*
|
|
3656
|
+
* Генерирует начальное содержимое для нового файла AGENTS.md.
|
|
3657
|
+
* @param section Formatted ai-prompt section / Отформатированная секция ai-prompt
|
|
3658
|
+
* @returns Initial file content / Начальное содержимое файла
|
|
3659
|
+
* @protected
|
|
3660
|
+
*/
|
|
3661
|
+
protected getInitial(section: string): string;
|
|
3662
|
+
/**
|
|
3663
|
+
* Calculates MD5 hash of the prompt template content.
|
|
3664
|
+
*
|
|
3665
|
+
* Вычисляет MD5 хэш содержимого шаблона промпта.
|
|
3666
|
+
* @returns Calculated MD5 hex string / Вычисленная hex-строка MD5
|
|
3667
|
+
* @protected
|
|
3668
|
+
*/
|
|
3669
|
+
protected getMd5(): string;
|
|
3670
|
+
/**
|
|
3671
|
+
* Wraps the prompt content in HTML comment boundary markers with MD5 hash.
|
|
3672
|
+
*
|
|
3673
|
+
* Оборачивает контент промпта в граничные маркеры комментариев HTML с MD5 хэшем.
|
|
3674
|
+
* @param md5 MD5 hash checksum (defaults to this.getMd5()) / Контрольная сумма хэша MD5 (по умолчанию this.getMd5())
|
|
3675
|
+
* @returns Formatted section with start and end markers / Отформатированная секция с начальной и конечной метками
|
|
3676
|
+
* @protected
|
|
3677
|
+
*/
|
|
3678
|
+
protected getSection(md5?: string): string;
|
|
3679
|
+
/**
|
|
3680
|
+
* Updates the marked ai-prompt section if boundary markers exist.
|
|
3681
|
+
*
|
|
3682
|
+
* Обновляет размеченную секцию ai-prompt, если граничные метки существуют.
|
|
3683
|
+
* @param existingContent Current file content / Текущее содержимое файла
|
|
3684
|
+
* @param section Formatted section to insert / Отформатированная секция для вставки
|
|
3685
|
+
* @returns true if updated, false if up to date or markers not found / true, если обновлено, false, если актуально или метки не найдены
|
|
3686
|
+
* @protected
|
|
3687
|
+
*/
|
|
3688
|
+
protected updateMarker(existingContent: string, section: string): boolean;
|
|
3689
|
+
/**
|
|
3690
|
+
* Appends the ai-prompt section to the end of the file.
|
|
3691
|
+
*
|
|
3692
|
+
* Добавляет секцию ai-prompt в конец файла.
|
|
3693
|
+
* @param existingContent Current file content / Текущее содержимое файла
|
|
3694
|
+
* @param section Formatted section to append / Отформатированная секция для добавления
|
|
3695
|
+
* @returns true if file was updated / true, если файл был обновлен
|
|
3696
|
+
* @protected
|
|
3697
|
+
*/
|
|
3698
|
+
protected append(existingContent: string, section: string): boolean;
|
|
3699
|
+
/**
|
|
3700
|
+
* Writes content to the target file.
|
|
3701
|
+
*
|
|
3702
|
+
* Записывает контент в целевой файл.
|
|
3703
|
+
* @param content Content to write / Контент для записи
|
|
3704
|
+
* @returns this instance / этот экземпляр
|
|
3705
|
+
* @protected
|
|
3706
|
+
*/
|
|
3707
|
+
protected write(content: string): this;
|
|
3708
|
+
}
|
|
3709
|
+
|
|
3598
3710
|
/**
|
|
3599
3711
|
* Class representing an item in the AI prompt generation process.
|
|
3600
3712
|
* Handles reading and aggregating various project-related files (descriptions, info, types, screenshots)
|