@dxtmisha/scripts 0.10.8 → 0.10.9
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 +8 -0
- package/package.json +1 -1
- package/src/classes/Design/DesignTypes.ts +41 -31
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [0.10.9] - 2026-08-03
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
- **DesignTypes**: Updated AI prompt instructions in `DesignTypes.toAiEdit` and `DesignTypes.toAiDescription`:
|
|
9
|
+
- Enforced strict prompt boundaries forbidding AI agents from analyzing unprovided external files, links, paths, or environment data.
|
|
10
|
+
- Enhanced JSDoc generation rules to generate English JSDocs for non-obvious entities directly from JS implementation code.
|
|
11
|
+
- Expanded project description structure in `toAiDescription` to detail all exposed capabilities and triggers for `ai-types.md` analysis, and added optional `code` parameter support.
|
|
12
|
+
|
|
5
13
|
## [0.10.8] - 2026-07-28
|
|
6
14
|
|
|
7
15
|
### Added / Updated
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxtmisha/scripts",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.10.
|
|
4
|
+
"version": "0.10.9",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Development scripts and CLI tools for DXT UI projects - automated component generation, library building and project management tools",
|
|
7
7
|
"keywords": [
|
|
@@ -53,7 +53,7 @@ export class DesignTypes {
|
|
|
53
53
|
const aiContent = await this.toAiEdit(fullContent, fullJsContent)
|
|
54
54
|
this.save(aiContent)
|
|
55
55
|
|
|
56
|
-
const aiDescription = await this.toAiDescription(fullContent)
|
|
56
|
+
const aiDescription = await this.toAiDescription(fullContent, fullJsContent)
|
|
57
57
|
this.saveDescription(aiDescription)
|
|
58
58
|
|
|
59
59
|
console.log('DesignTypes: AI types saved.')
|
|
@@ -270,25 +270,31 @@ export class DesignTypes {
|
|
|
270
270
|
protected async toAiEdit(content: string, code: string): Promise<string> {
|
|
271
271
|
const generate = await this.toAi(
|
|
272
272
|
content,
|
|
273
|
-
'
|
|
274
|
-
+ '
|
|
275
|
-
+ '
|
|
276
|
-
+ '
|
|
277
|
-
+ '
|
|
278
|
-
+ '
|
|
279
|
-
+ '
|
|
280
|
-
+ '
|
|
281
|
-
+ '
|
|
282
|
-
+ '
|
|
283
|
-
+ '
|
|
284
|
-
+ '
|
|
285
|
-
+ '
|
|
286
|
-
+ '
|
|
287
|
-
+ 'Remove
|
|
288
|
-
+ '
|
|
289
|
-
+ '
|
|
290
|
-
+ '
|
|
291
|
-
+ '
|
|
273
|
+
'Goal: Optimize and generate clean, highly informative TypeScript type definitions based ONLY on the provided code and types.\n\n'
|
|
274
|
+
+ 'CRITICAL CONTEXT & SCOPE RESTRICTIONS:\n'
|
|
275
|
+
+ '- IMPORTANT: The AI coding agent that will write code for developers using this library will NEVER see or have access to the underlying JS implementation code or external files. It will rely EXCLUSIVELY on the output document generated by you in this session. You MUST ensure that your output provides complete, flawless context, clear JSDoc explanations, and precise type contracts so that the reading AI agent can write accurate code without making assumptions.\n'
|
|
276
|
+
+ '- Analyze ONLY the code, type definitions, and text explicitly provided in this prompt. Do NOT attempt to read, search, infer, or assume any external files, imports, project structure, or unprovided environment data.\n'
|
|
277
|
+
+ '- Do NOT include any references, links, file paths, or pointers to external files or local directories in the final output, as AI agents will have no environment file access.\n'
|
|
278
|
+
+ '- Do NOT return the provided JS code in your response.\n\n'
|
|
279
|
+
+ 'JSDOC & COMMENT RULES:\n'
|
|
280
|
+
+ '- STUDY THE PROVIDED JS CODE: You are explicitly provided with the JS implementation code (`File JS Code`). You MUST study the JS code for every function/method/property to understand its exact logic, behavior, and purpose.\n'
|
|
281
|
+
+ '- GENERATE MISSING JSDOCS FROM JS CODE: If an entity lacks a JSDoc comment in the input declarations, but its provided JS code implementation reveals its behavior or purpose, you MUST generate and add a clear, fluff-free English JSDoc description directly above its declaration.\n'
|
|
282
|
+
+ '- DEFINITION OF OBVIOUS (NO JSDOC): An entity is "obvious" ONLY IF its name uses clear, standard English naming conventions (e.g., `isString`, `capitalize`, `copyObject`) AND its functionality is 100% self-evident from its signature alone. Obvious entities MUST NOT have a JSDoc.\n'
|
|
283
|
+
+ '- MANDATORY JSDOC FOR NON-OBVIOUS ENTITIES: Any entity with an obscure, non-standard, custom, abbreviated, or ambiguous name (e.g., `abutaSudatoho`, `transformation`), or complex logic, MUST have a clear English JSDoc description generated by inspecting its JS implementation code.\n'
|
|
284
|
+
+ '- Write JSDoc comments WITHOUT fluff or filler text, focusing strictly on operational logic and behavior.\n'
|
|
285
|
+
+ '- Place all JSDoc comments STRICTLY directly above the target declaration.\n'
|
|
286
|
+
+ '- Translate all non-English comments and JSDocs to English.\n'
|
|
287
|
+
+ '- Remove regular inline comments (`//` or `/* ... */`).\n'
|
|
288
|
+
+ '- STRICTLY PRESERVE all JSDoc tags like `@example`, `@remarks`, `@note`, and warnings—keep them intact, translating only to English if needed.\n\n'
|
|
289
|
+
+ 'CLEANING & OPTIMIZATION:\n'
|
|
290
|
+
+ '- Remove all `import` statements and local internal re-exports (e.g., `export * from "./..."`). Strictly KEEP exports from external packages.\n'
|
|
291
|
+
+ '- Delete all non-public content (private/protected class members, unexported elements). Keep all public API surfaces.\n'
|
|
292
|
+
+ '- Do NOT delete any `type` definitions; they are strictly required.\n'
|
|
293
|
+
+ '- Remove large Enums or structures that add length without critical context.\n'
|
|
294
|
+
+ '- Exercise extreme caution when removing abstract classes: if there is even a 5% chance it helps understand the API or generate code, keep it.\n'
|
|
295
|
+
+ '- Format output tightly with no blank lines.\n\n'
|
|
296
|
+
+ 'OUTPUT REQUIREMENTS:\n'
|
|
297
|
+
+ 'Return ONLY the resulting optimized TypeScript type definitions code. No markdown formatting, no code blocks (```), no explanations, and no additional AI text. NOTHING but pure code.',
|
|
292
298
|
code
|
|
293
299
|
)
|
|
294
300
|
|
|
@@ -300,20 +306,24 @@ export class DesignTypes {
|
|
|
300
306
|
*
|
|
301
307
|
* Генерирует описание проекта и рекомендации по использованию с помощью ИИ.
|
|
302
308
|
* @param content cleaned type definitions / очищенные определения типов
|
|
309
|
+
* @param code JS code for analysis / JS код для анализа
|
|
303
310
|
*/
|
|
304
|
-
protected async toAiDescription(content: string): Promise<string> {
|
|
311
|
+
protected async toAiDescription(content: string, code?: string): Promise<string> {
|
|
305
312
|
const generate = await this.toAi(
|
|
306
313
|
content,
|
|
307
|
-
'
|
|
308
|
-
+ '
|
|
309
|
-
+ '
|
|
310
|
-
+ '
|
|
311
|
-
+ '
|
|
312
|
-
+ '
|
|
313
|
-
+ '
|
|
314
|
-
+ '
|
|
315
|
-
+ '
|
|
316
|
-
+ '
|
|
314
|
+
'Goal: Generate a comprehensive, highly technical, and fluff-free project overview designed for an AI coding assistant to evaluate this library\'s exact contents and capabilities.\n\n'
|
|
315
|
+
+ 'CRITICAL RESTRICTIONS:\n'
|
|
316
|
+
+ '- Analyze ONLY the code, type definitions, and text explicitly provided in this prompt. Do NOT attempt to read, search, infer, or assume any external files, dependencies, or unprovided data.\n'
|
|
317
|
+
+ '- Do NOT include any file paths, relative links, or external URLs, as reading AI agents will not have environment file access.\n\n'
|
|
318
|
+
+ 'STRUCTURE & CONTENT REQUIREMENTS:\n'
|
|
319
|
+
+ 'Provide an objective, dense, and complete technical summary including:\n'
|
|
320
|
+
+ '1. Core Purpose: What is the primary technical function, responsibility, and role of this library?\n'
|
|
321
|
+
+ '2. Key Expositions & Capabilities: Detail ALL main classes, composables/hooks, utilities, components, services, or data structures exposed by this library. Specify the exact functionality and specific tasks each exposed entity or module performs so reading AI agents clearly understand the full capability set.\n'
|
|
322
|
+
+ '3. Triggers for Studying ai-types.md: Under what specific coding requirements, keywords, tasks, or architectural needs is this library indispensable, making it mandatory for the AI to study "ai-types.md"?\n'
|
|
323
|
+
+ '4. Integration Context: How does this library connect with other technologies, frameworks, or packages in the system stack?\n\n'
|
|
324
|
+
+ 'OUTPUT REQUIREMENTS:\n'
|
|
325
|
+
+ 'Return ONLY the resulting description text. No markdown formatting, no code blocks, no labels (like "Description:"), and no conversational explanations. NOTHING but pure, dense content.',
|
|
326
|
+
code
|
|
317
327
|
)
|
|
318
328
|
|
|
319
329
|
return generate ?? ''
|