@aigne/doc-smith 0.8.11-beta.5 → 0.8.11-beta.6
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/.aigne/doc-smith/config.yaml +1 -1
- package/.release-please-manifest.json +1 -1
- package/CHANGELOG.md +9 -2
- package/README.md +1 -1
- package/agents/clear/choose-contents.mjs +2 -2
- package/agents/clear/clear-document-structure.mjs +8 -8
- package/agents/clear/index.yaml +1 -1
- package/agents/evaluate/document-structure.yaml +1 -1
- package/agents/generate/check-document-structure.yaml +3 -3
- package/agents/generate/check-need-generate-structure.mjs +8 -8
- package/agents/generate/document-structure-tools/add-document.mjs +3 -3
- package/agents/generate/document-structure-tools/delete-document.mjs +2 -2
- package/agents/generate/document-structure-tools/move-document.mjs +3 -2
- package/agents/generate/document-structure-tools/update-document.mjs +2 -2
- package/agents/generate/generate-structure.yaml +1 -1
- package/agents/generate/update-document-structure.yaml +3 -3
- package/agents/generate/user-review-document-structure.mjs +10 -10
- package/agents/update/batch-generate-document.yaml +1 -1
- package/agents/update/check-document.mjs +2 -2
- package/agents/utils/check-feedback-refiner.mjs +1 -1
- package/agents/utils/choose-docs.mjs +1 -1
- package/agents/utils/load-document-all-content.mjs +3 -3
- package/agents/utils/load-sources.mjs +1 -1
- package/agents/utils/save-docs.mjs +7 -28
- package/aigne.yaml +2 -2
- package/docs/_sidebar.md +1 -1
- package/docs/advanced-how-it-works.md +3 -3
- package/docs/advanced-quality-assurance.md +1 -1
- package/docs/cli-reference.ja.md +151 -80
- package/docs/cli-reference.md +126 -55
- package/docs/cli-reference.zh-TW.md +133 -62
- package/docs/cli-reference.zh.md +143 -72
- package/docs/configuration-interactive-setup.md +1 -1
- package/docs/configuration-language-support.md +1 -1
- package/docs/configuration-preferences.md +1 -1
- package/docs/configuration.ja.md +104 -48
- package/docs/configuration.md +58 -2
- package/docs/configuration.zh-TW.md +99 -42
- package/docs/configuration.zh.md +78 -21
- package/docs/features-generate-documentation.ja.md +63 -44
- package/docs/features-generate-documentation.md +54 -35
- package/docs/features-generate-documentation.zh-TW.md +67 -48
- package/docs/features-generate-documentation.zh.md +61 -41
- package/docs/features-publish-your-docs.ja.md +69 -46
- package/docs/features-publish-your-docs.md +65 -42
- package/docs/features-publish-your-docs.zh-TW.md +73 -50
- package/docs/features-publish-your-docs.zh.md +67 -44
- package/docs/features-translate-documentation.ja.md +35 -33
- package/docs/features-translate-documentation.md +24 -22
- package/docs/features-translate-documentation.zh-TW.md +32 -30
- package/docs/features-translate-documentation.zh.md +29 -27
- package/docs/features-update-and-refine.ja.md +120 -66
- package/docs/features-update-and-refine.md +110 -56
- package/docs/features-update-and-refine.zh-TW.md +116 -62
- package/docs/features-update-and-refine.zh.md +118 -64
- package/docs/getting-started.ja.md +22 -22
- package/docs/getting-started.md +1 -1
- package/docs/getting-started.zh-TW.md +16 -16
- package/docs/getting-started.zh.md +28 -28
- package/docs/overview.md +3 -3
- package/docs-mcp/analyze-docs-relevance.yaml +6 -6
- package/docs-mcp/docs-search.yaml +1 -1
- package/package.json +2 -2
- package/prompts/common/document-structure/conflict-resolution-guidance.md +3 -3
- package/prompts/common/document-structure/document-structure-rules.md +2 -2
- package/prompts/detail/document-rules.md +1 -1
- package/prompts/detail/generate-document.md +1 -1
- package/prompts/evaluate/document-structure.md +6 -6
- package/prompts/structure/check-document-structure.md +10 -10
- package/prompts/structure/document-rules.md +2 -2
- package/prompts/structure/generate-structure-system.md +3 -3
- package/prompts/structure/structure-example.md +1 -1
- package/prompts/structure/structure-getting-started.md +1 -1
- package/prompts/structure/update-document-structure.md +9 -9
- package/prompts/utils/feedback-refiner.md +1 -1
- package/tests/agents/clear/choose-contents.test.mjs +1 -1
- package/tests/agents/clear/clear-document-structure.test.mjs +36 -30
- package/tests/agents/evaluate/generate-report.test.mjs +1 -1
- package/tests/agents/generate/check-need-generate-structure.test.mjs +1 -1
- package/tests/agents/generate/document-structure-tools/add-document.test.mjs +2 -2
- package/tests/agents/generate/document-structure-tools/delete-document.test.mjs +4 -4
- package/tests/agents/generate/document-structure-tools/move-document.test.mjs +3 -3
- package/tests/agents/generate/document-structure-tools/update-document.test.mjs +3 -3
- package/tests/agents/generate/user-review-document-structure.test.mjs +7 -5
- package/tests/agents/update/check-document.test.mjs +1 -1
- package/tests/agents/utils/format-document-structure.test.mjs +5 -5
- package/tests/agents/utils/load-sources.test.mjs +4 -4
- package/tests/agents/utils/save-docs.test.mjs +1 -1
- package/tests/utils/conflict-detector.test.mjs +1 -1
- package/tests/utils/docs-finder-utils.test.mjs +8 -8
- package/types/document-structure-schema.mjs +9 -9
- package/utils/conflict-detector.mjs +1 -1
- package/utils/constants/index.mjs +4 -4
- package/utils/docs-finder-utils.mjs +11 -11
- package/utils/markdown-checker.mjs +1 -1
|
@@ -350,7 +350,7 @@ export const SUPPORTED_FILE_EXTENSIONS = [".txt", ".md", ".json", ".yaml", ".yml
|
|
|
350
350
|
export const CONFLICT_RULES = {
|
|
351
351
|
// Internal conflicts within the same question (multi-select conflicts)
|
|
352
352
|
internalConflicts: {
|
|
353
|
-
// Note: Most conflicts can be resolved through intelligent
|
|
353
|
+
// Note: Most conflicts can be resolved through intelligent documentation structure
|
|
354
354
|
// Only keeping conflicts that represent fundamental incompatibilities
|
|
355
355
|
},
|
|
356
356
|
|
|
@@ -424,7 +424,7 @@ export const CONFLICT_RULES = {
|
|
|
424
424
|
|
|
425
425
|
// Conflict resolution rules - defines how to handle conflicts when users select conflicting options
|
|
426
426
|
export const CONFLICT_RESOLUTION_RULES = {
|
|
427
|
-
// Document purpose conflicts that can be resolved through
|
|
427
|
+
// Document purpose conflicts that can be resolved through documentation structure
|
|
428
428
|
documentPurpose: [
|
|
429
429
|
{
|
|
430
430
|
conflictItems: ["getStarted", "findAnswers"],
|
|
@@ -451,7 +451,7 @@ export const CONFLICT_RESOLUTION_RULES = {
|
|
|
451
451
|
},
|
|
452
452
|
],
|
|
453
453
|
|
|
454
|
-
// Target audience conflicts that can be resolved through
|
|
454
|
+
// Target audience conflicts that can be resolved through documentation structure
|
|
455
455
|
targetAudienceTypes: [
|
|
456
456
|
{
|
|
457
457
|
conflictItems: ["endUsers", "developers"],
|
|
@@ -475,7 +475,7 @@ export const CONFLICT_RESOLUTION_RULES = {
|
|
|
475
475
|
// Resolution strategy descriptions
|
|
476
476
|
export const RESOLUTION_STRATEGIES = {
|
|
477
477
|
layered_structure: (items) =>
|
|
478
|
-
`Detected "${items.join('" and "')}" purpose conflict. Resolution strategy: Create layered
|
|
478
|
+
`Detected "${items.join('" and "')}" purpose conflict. Resolution strategy: Create layered documentation structure
|
|
479
479
|
- Quick start section: Uses "get started" style - optimizes for speed, key steps, working examples, skips complex edge cases
|
|
480
480
|
- API reference section: Uses "find answers" style - comprehensive coverage, searchability, rich examples, skips narrative flow
|
|
481
481
|
- Ensure sections complement rather than conflict with each other`,
|
|
@@ -24,8 +24,8 @@ function generateFileName(flatName, locale) {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
|
-
* Find a single item by path in
|
|
28
|
-
* @param {Array} documentExecutionStructure - Array of
|
|
27
|
+
* Find a single item by path in documentation structure result and read its content
|
|
28
|
+
* @param {Array} documentExecutionStructure - Array of documentation structure items
|
|
29
29
|
* @param {string} docPath - Document path to find (supports .md filenames)
|
|
30
30
|
* @param {string} boardId - Board ID for fallback matching
|
|
31
31
|
* @param {string} docsDir - Docs directory path for reading content
|
|
@@ -116,7 +116,7 @@ export async function readFileContent(docsDir, fileName) {
|
|
|
116
116
|
* Get main language markdown files from docs directory
|
|
117
117
|
* @param {string} docsDir - Docs directory path
|
|
118
118
|
* @param {string} locale - Main language locale (e.g., 'en', 'zh', 'fr')
|
|
119
|
-
* @param {Array} documentExecutionStructure - Array of
|
|
119
|
+
* @param {Array} documentExecutionStructure - Array of documentation structure items to determine file order
|
|
120
120
|
* @returns {Promise<string[]>} Array of main language .md files ordered by documentExecutionStructure
|
|
121
121
|
*/
|
|
122
122
|
export async function getMainLanguageFiles(docsDir, locale, documentExecutionStructure = null) {
|
|
@@ -153,7 +153,7 @@ export async function getMainLanguageFiles(docsDir, locale, documentExecutionStr
|
|
|
153
153
|
|
|
154
154
|
// If documentExecutionStructure is provided, sort files according to the order in documentExecutionStructure
|
|
155
155
|
if (documentExecutionStructure && Array.isArray(documentExecutionStructure)) {
|
|
156
|
-
// Create a map from flat file name to
|
|
156
|
+
// Create a map from flat file name to documentation structure order
|
|
157
157
|
const orderMap = new Map();
|
|
158
158
|
documentExecutionStructure.forEach((item, index) => {
|
|
159
159
|
const itemFlattenedPath = item.path.replace(/^\//, "").replace(/\//g, "-");
|
|
@@ -166,16 +166,16 @@ export async function getMainLanguageFiles(docsDir, locale, documentExecutionStr
|
|
|
166
166
|
const orderA = orderMap.get(a);
|
|
167
167
|
const orderB = orderMap.get(b);
|
|
168
168
|
|
|
169
|
-
// If both files are in the
|
|
169
|
+
// If both files are in the documentation structure, sort by order
|
|
170
170
|
if (orderA !== undefined && orderB !== undefined) {
|
|
171
171
|
return orderA - orderB;
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
-
// If only one file is in the
|
|
174
|
+
// If only one file is in the documentation structure, it comes first
|
|
175
175
|
if (orderA !== undefined) return -1;
|
|
176
176
|
if (orderB !== undefined) return 1;
|
|
177
177
|
|
|
178
|
-
// If neither file is in the
|
|
178
|
+
// If neither file is in the documentation structure, maintain alphabetical order
|
|
179
179
|
return a.localeCompare(b);
|
|
180
180
|
});
|
|
181
181
|
}
|
|
@@ -200,8 +200,8 @@ export function fileNameToFlatPath(fileName) {
|
|
|
200
200
|
}
|
|
201
201
|
|
|
202
202
|
/**
|
|
203
|
-
* Find
|
|
204
|
-
* @param {Array} documentExecutionStructure - Array of
|
|
203
|
+
* Find documentation structure item by flattened file name
|
|
204
|
+
* @param {Array} documentExecutionStructure - Array of documentation structure items
|
|
205
205
|
* @param {string} flatName - Flattened file name
|
|
206
206
|
* @returns {Object|null} Found item or null
|
|
207
207
|
*/
|
|
@@ -215,7 +215,7 @@ export function findItemByFlatName(documentExecutionStructure, flatName) {
|
|
|
215
215
|
/**
|
|
216
216
|
* Process selected files and convert to found items with content
|
|
217
217
|
* @param {string[]} selectedFiles - Array of selected file names
|
|
218
|
-
* @param {Array} documentExecutionStructure - Array of
|
|
218
|
+
* @param {Array} documentExecutionStructure - Array of documentation structure items
|
|
219
219
|
* @param {string} docsDir - Docs directory path
|
|
220
220
|
* @returns {Promise<Object[]>} Array of found items with content
|
|
221
221
|
*/
|
|
@@ -244,7 +244,7 @@ export async function processSelectedFiles(selectedFiles, documentExecutionStruc
|
|
|
244
244
|
|
|
245
245
|
foundItems.push(result);
|
|
246
246
|
} else {
|
|
247
|
-
console.warn(`⚠️ No
|
|
247
|
+
console.warn(`⚠️ No documentation structure item found for file: ${selectedFile}`);
|
|
248
248
|
}
|
|
249
249
|
}
|
|
250
250
|
|
|
@@ -87,7 +87,7 @@ function checkDeadLinks(markdown, source, allowedLinks, errorMessages) {
|
|
|
87
87
|
// Check if this link is in the allowed links set
|
|
88
88
|
if (!allowedLinks.has(path)) {
|
|
89
89
|
errorMessages.push(
|
|
90
|
-
`Found a dead link in ${source}: [${match[1]}](${trimLink}), ensure the link exists in the
|
|
90
|
+
`Found a dead link in ${source}: [${match[1]}](${trimLink}), ensure the link exists in the documentation structure path`,
|
|
91
91
|
);
|
|
92
92
|
}
|
|
93
93
|
}
|