@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
|
@@ -66,7 +66,7 @@ translateLanguages:
|
|
|
66
66
|
docsDir: ./docs # Directory to save generated documentation
|
|
67
67
|
sourcesPath: # Source code paths to analyze
|
|
68
68
|
- ./
|
|
69
|
-
lastGitHead:
|
|
69
|
+
lastGitHead: 6fc5d715e778663896ae179975ec72d9e5ff97ed
|
|
70
70
|
# ⚠️ Warning: boardId is auto-generated by system, please do not edit manually
|
|
71
71
|
boardId: "docsmith"
|
|
72
72
|
appUrl: https://docsmith.aigne.io
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.8.11-beta.6](https://github.com/AIGNE-io/aigne-doc-smith/compare/v0.8.11-beta.5...v0.8.11-beta.6) (2025-10-02)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Miscellaneous Chores
|
|
7
|
+
|
|
8
|
+
* release 0.8.11-beta.6 ([ecc8f5c](https://github.com/AIGNE-io/aigne-doc-smith/commit/ecc8f5c4ff9cc813e5cf7e35cbfdb915826cd183))
|
|
9
|
+
|
|
3
10
|
## [0.8.11-beta.5](https://github.com/AIGNE-io/aigne-doc-smith/compare/v0.8.11-beta.4...v0.8.11-beta.5) (2025-10-01)
|
|
4
11
|
|
|
5
12
|
|
|
@@ -79,7 +86,7 @@
|
|
|
79
86
|
### Bug Fixes
|
|
80
87
|
|
|
81
88
|
* polish code test ([#122](https://github.com/AIGNE-io/aigne-doc-smith/issues/122)) ([0629705](https://github.com/AIGNE-io/aigne-doc-smith/commit/0629705ebd271282411d507421c1ba5dd01473b9))
|
|
82
|
-
* update
|
|
89
|
+
* update documentation structure review prompts and display ([#119](https://github.com/AIGNE-io/aigne-doc-smith/issues/119)) ([e2d99db](https://github.com/AIGNE-io/aigne-doc-smith/commit/e2d99db83ff3a6266b32dd450a79b6e000aff09e))
|
|
83
90
|
* update usage rules for field elements ([#120](https://github.com/AIGNE-io/aigne-doc-smith/issues/120)) ([434f161](https://github.com/AIGNE-io/aigne-doc-smith/commit/434f161ab7dd989d57ca670f36d0828c09abe38a))
|
|
84
91
|
|
|
85
92
|
## [0.8.10-beta.1](https://github.com/AIGNE-io/aigne-doc-smith/compare/v0.8.10-beta...v0.8.10-beta.1) (2025-09-18)
|
|
@@ -87,7 +94,7 @@
|
|
|
87
94
|
|
|
88
95
|
### Features
|
|
89
96
|
|
|
90
|
-
* support
|
|
97
|
+
* support documentation structure review workflow ([#117](https://github.com/AIGNE-io/aigne-doc-smith/issues/117)) ([ec7ae80](https://github.com/AIGNE-io/aigne-doc-smith/commit/ec7ae80b26a1b66928bddef7ac401f633a0f5a2b))
|
|
91
98
|
|
|
92
99
|
|
|
93
100
|
### Bug Fixes
|
package/README.md
CHANGED
|
@@ -45,7 +45,7 @@ As shown in the diagram, DocSmith integrates seamlessly with other [AIGNE](https
|
|
|
45
45
|
|
|
46
46
|
- **AIGNE Hub Integration**: Use [AIGNE Hub](https://www.aigne.io/en/hub) without API keys, switch between Google Gemini, OpenAI GPT, Claude, and more
|
|
47
47
|
- **Multiple LLM Support**: Bring your own API keys for OpenAI, Anthropic, Google, and other providers
|
|
48
|
-
- **
|
|
48
|
+
- **One-Click Publishing**: Make your docs live and generate shareable links for your team - publish to [docsmith.aigne.io](https://docsmith.aigne.io/app/) or your own [Discuss Kit](https://www.web3kit.rocks/discuss-kit) instance
|
|
49
49
|
|
|
50
50
|
### 🔄 Smart Updates
|
|
51
51
|
|
|
@@ -5,8 +5,8 @@ const TARGET_METADATA = {
|
|
|
5
5
|
agent: "clearGeneratedDocs",
|
|
6
6
|
},
|
|
7
7
|
documentStructure: {
|
|
8
|
-
label: "
|
|
9
|
-
description: "Delete the
|
|
8
|
+
label: "documentation structure",
|
|
9
|
+
description: "Delete the documentation structure and all generated documents.",
|
|
10
10
|
agent: "clearDocumentStructure",
|
|
11
11
|
},
|
|
12
12
|
documentConfig: {
|
|
@@ -20,8 +20,8 @@ export default async function clearDocumentStructure(input = {}, _options = {})
|
|
|
20
20
|
|
|
21
21
|
const structureDisplayPath = toDisplayPath(structurePlanPath);
|
|
22
22
|
const structureMessage = structureExists
|
|
23
|
-
? `Cleared
|
|
24
|
-
: `
|
|
23
|
+
? `Cleared documentation structure (${structureDisplayPath})`
|
|
24
|
+
: `Documentation structure already empty (${structureDisplayPath})`;
|
|
25
25
|
|
|
26
26
|
results.push({
|
|
27
27
|
type: "structure",
|
|
@@ -33,7 +33,7 @@ export default async function clearDocumentStructure(input = {}, _options = {})
|
|
|
33
33
|
results.push({
|
|
34
34
|
type: "structure",
|
|
35
35
|
error: true,
|
|
36
|
-
message: `Failed to clear
|
|
36
|
+
message: `Failed to clear documentation structure: ${error.message}`,
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
39
|
|
|
@@ -69,11 +69,11 @@ export default async function clearDocumentStructure(input = {}, _options = {})
|
|
|
69
69
|
|
|
70
70
|
let header;
|
|
71
71
|
if (errorItems > 0) {
|
|
72
|
-
header = "
|
|
72
|
+
header = "Documentation Structure cleanup finished with some issues.";
|
|
73
73
|
} else if (clearedItems > 0) {
|
|
74
|
-
header = "
|
|
74
|
+
header = "Documentation Structure cleared successfully!";
|
|
75
75
|
} else {
|
|
76
|
-
header = "
|
|
76
|
+
header = "Documentation Structure already empty.";
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
const detailLines = results.map((item) => `- ${item.message}`).join("\n");
|
|
@@ -101,6 +101,6 @@ clearDocumentStructure.input_schema = {
|
|
|
101
101
|
},
|
|
102
102
|
};
|
|
103
103
|
|
|
104
|
-
clearDocumentStructure.taskTitle = "Clear
|
|
104
|
+
clearDocumentStructure.taskTitle = "Clear documentation structure and all generated documents";
|
|
105
105
|
clearDocumentStructure.description =
|
|
106
|
-
"Clear the
|
|
106
|
+
"Clear the documentation structure (structure-plan.json) and optionally the documents directory";
|
package/agents/clear/index.yaml
CHANGED
|
@@ -2,7 +2,7 @@ type: team
|
|
|
2
2
|
name: clear
|
|
3
3
|
alias:
|
|
4
4
|
- clear
|
|
5
|
-
description: Clear various types of data including
|
|
5
|
+
description: Clear various types of data including documentation structure, generated documents, configuration, and authorization tokens
|
|
6
6
|
skills:
|
|
7
7
|
- url: ../init/index.mjs
|
|
8
8
|
default_input:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
name: checkDocumentStructure
|
|
2
|
-
description: Check the
|
|
2
|
+
description: Check the Documentation Structure to ensure it meets expectations, especially in scenarios with previous generation results and user feedback.
|
|
3
3
|
instructions:
|
|
4
4
|
url: ../../prompts/structure/check-document-structure.md
|
|
5
5
|
input_schema:
|
|
@@ -7,10 +7,10 @@ input_schema:
|
|
|
7
7
|
properties:
|
|
8
8
|
documentStructure:
|
|
9
9
|
$ref: ../schema/document-structure.yaml
|
|
10
|
-
description: Newly generated
|
|
10
|
+
description: Newly generated documentation structure.
|
|
11
11
|
originalDocumentStructure:
|
|
12
12
|
$ref: ../schema/document-structure.yaml
|
|
13
|
-
description: Previous generation's
|
|
13
|
+
description: Previous generation's documentation structure for comparison. If it doesn't exist, the check passes by default.
|
|
14
14
|
feedback:
|
|
15
15
|
type: string
|
|
16
16
|
description: User feedback provided for the previous generation's results.
|
|
@@ -18,10 +18,10 @@ export default async function checkNeedGenerateStructure(
|
|
|
18
18
|
if (!originalDocumentStructure) {
|
|
19
19
|
const choice = await options.prompts.select({
|
|
20
20
|
message:
|
|
21
|
-
"Your project configuration is complete. Would you like to generate the
|
|
21
|
+
"Your project configuration is complete. Would you like to generate the documentation structure now?",
|
|
22
22
|
choices: [
|
|
23
23
|
{
|
|
24
|
-
name: "Generate now - Start generating the
|
|
24
|
+
name: "Generate now - Start generating the documentation structure",
|
|
25
25
|
value: "generate",
|
|
26
26
|
},
|
|
27
27
|
{
|
|
@@ -49,7 +49,7 @@ export default async function checkNeedGenerateStructure(
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
// Check if we need to regenerate
|
|
52
|
+
// Check if we need to regenerate documentation structure
|
|
53
53
|
let shouldRegenerate = false;
|
|
54
54
|
let finalFeedback = feedback;
|
|
55
55
|
|
|
@@ -82,7 +82,7 @@ export default async function checkNeedGenerateStructure(
|
|
|
82
82
|
finalFeedback = `
|
|
83
83
|
${finalFeedback || ""}
|
|
84
84
|
|
|
85
|
-
Update
|
|
85
|
+
Update documentation structure based on the latest DataSources:
|
|
86
86
|
1. For new content, add new sections as needed or supplement existing section displays
|
|
87
87
|
2. Be cautious when deleting sections, unless all associated sourceIds have been removed
|
|
88
88
|
3. Do not modify the path of existing sections
|
|
@@ -97,11 +97,11 @@ export default async function checkNeedGenerateStructure(
|
|
|
97
97
|
finalFeedback = `
|
|
98
98
|
${finalFeedback || ""}
|
|
99
99
|
|
|
100
|
-
User requested forced regeneration of
|
|
100
|
+
User requested forced regeneration of documentation structure. Please regenerate based on the latest Data Sources and user requirements, **allowing any modifications**.
|
|
101
101
|
`;
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
// If no regeneration needed, return original
|
|
104
|
+
// If no regeneration needed, return original documentation structure
|
|
105
105
|
if (originalDocumentStructure && !finalFeedback && !shouldRegenerate) {
|
|
106
106
|
return {
|
|
107
107
|
documentStructure: originalDocumentStructure,
|
|
@@ -110,7 +110,7 @@ export default async function checkNeedGenerateStructure(
|
|
|
110
110
|
|
|
111
111
|
const planningAgent = options.context.agents["refineDocumentStructure"];
|
|
112
112
|
|
|
113
|
-
// Get user preferences for
|
|
113
|
+
// Get user preferences for documentation structure and global scope
|
|
114
114
|
const structureRules = getActiveRulesForScope("structure", []);
|
|
115
115
|
const globalRules = getActiveRulesForScope("global", []);
|
|
116
116
|
|
|
@@ -185,4 +185,4 @@ export default async function checkNeedGenerateStructure(
|
|
|
185
185
|
};
|
|
186
186
|
}
|
|
187
187
|
|
|
188
|
-
checkNeedGenerateStructure.taskTitle = "Check if
|
|
188
|
+
checkNeedGenerateStructure.taskTitle = "Check if documentation structure needs generate or update";
|
|
@@ -41,7 +41,7 @@ export default async function addDocument(input) {
|
|
|
41
41
|
sourceIds: [...sourceIds], // Create a copy of the array
|
|
42
42
|
};
|
|
43
43
|
|
|
44
|
-
// Add the
|
|
44
|
+
// Add the document to the structure
|
|
45
45
|
const updatedStructure = [...documentStructure, newDocument];
|
|
46
46
|
|
|
47
47
|
return {
|
|
@@ -50,7 +50,7 @@ export default async function addDocument(input) {
|
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
addDocument.taskTitle = "Add
|
|
54
|
-
addDocument.description = "Add a
|
|
53
|
+
addDocument.taskTitle = "Add document";
|
|
54
|
+
addDocument.description = "Add a document to the documentation structure";
|
|
55
55
|
addDocument.inputSchema = getAddDocumentInputJsonSchema();
|
|
56
56
|
addDocument.outputSchema = getAddDocumentOutputJsonSchema();
|
|
@@ -34,7 +34,7 @@ export default async function deleteDocument(input) {
|
|
|
34
34
|
return { documentStructure };
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
// Remove the document from the
|
|
37
|
+
// Remove the document from the structure
|
|
38
38
|
const updatedStructure = documentStructure.filter((_, index) => index !== documentIndex);
|
|
39
39
|
|
|
40
40
|
return {
|
|
@@ -44,6 +44,6 @@ export default async function deleteDocument(input) {
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
deleteDocument.taskTitle = "Delete document";
|
|
47
|
-
deleteDocument.description = "
|
|
47
|
+
deleteDocument.description = "Remove a document from the documentation structure";
|
|
48
48
|
deleteDocument.inputSchema = getDeleteDocumentInputJsonSchema();
|
|
49
49
|
deleteDocument.outputSchema = getDeleteDocumentOutputJsonSchema();
|
|
@@ -65,7 +65,7 @@ export default async function moveDocument(input) {
|
|
|
65
65
|
parentId: newParentId || null,
|
|
66
66
|
};
|
|
67
67
|
|
|
68
|
-
// Update the document structure
|
|
68
|
+
// Update the document's position in the structure
|
|
69
69
|
const updatedStructure = [...documentStructure];
|
|
70
70
|
updatedStructure[documentIndex] = updatedDocument;
|
|
71
71
|
|
|
@@ -77,6 +77,7 @@ export default async function moveDocument(input) {
|
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
moveDocument.taskTitle = "Move document";
|
|
80
|
-
moveDocument.description =
|
|
80
|
+
moveDocument.description =
|
|
81
|
+
"Relocate a document to a different parent in the documentation structure";
|
|
81
82
|
moveDocument.inputSchema = getMoveDocumentInputJsonSchema();
|
|
82
83
|
moveDocument.outputSchema = getMoveDocumentOutputJsonSchema();
|
|
@@ -33,7 +33,7 @@ export default async function updateDocument(input) {
|
|
|
33
33
|
...(sourceIds !== undefined && { sourceIds: [...sourceIds] }), // Create a copy of the array
|
|
34
34
|
};
|
|
35
35
|
|
|
36
|
-
// Update the document structure
|
|
36
|
+
// Update the document in the structure
|
|
37
37
|
const updatedStructure = [...documentStructure];
|
|
38
38
|
updatedStructure[documentIndex] = updatedDocument;
|
|
39
39
|
|
|
@@ -45,6 +45,6 @@ export default async function updateDocument(input) {
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
updateDocument.taskTitle = "Update document";
|
|
48
|
-
updateDocument.description = "
|
|
48
|
+
updateDocument.description = "Modify properties of a document in the documentation structure";
|
|
49
49
|
updateDocument.inputSchema = getUpdateDocumentInputJsonSchema();
|
|
50
50
|
updateDocument.outputSchema = getUpdateDocumentOutputJsonSchema();
|
|
@@ -13,7 +13,7 @@ input_schema:
|
|
|
13
13
|
description: Primary language for documentation (e.g., zh, en, ja)
|
|
14
14
|
datasources:
|
|
15
15
|
type: string
|
|
16
|
-
description: Project content and context to help generate
|
|
16
|
+
description: Project content and context to help generate documentation structure
|
|
17
17
|
targetAudience:
|
|
18
18
|
type: string
|
|
19
19
|
description: Target audience for the documentation
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
type: ai
|
|
2
2
|
name: updateDocumentStructure
|
|
3
|
-
description: Update
|
|
3
|
+
description: Update documentation structure based on user feedback and intentions using structure modification tools
|
|
4
4
|
instructions:
|
|
5
5
|
url: ../../prompts/structure/update-document-structure.md
|
|
6
6
|
input_schema:
|
|
@@ -15,7 +15,7 @@ input_schema:
|
|
|
15
15
|
description: User language, e.g. zh, en
|
|
16
16
|
datasources:
|
|
17
17
|
type: string
|
|
18
|
-
description: Context for
|
|
18
|
+
description: Context for documentation structure
|
|
19
19
|
glossary:
|
|
20
20
|
type: string
|
|
21
21
|
description: Glossary of terms
|
|
@@ -34,7 +34,7 @@ output_schema:
|
|
|
34
34
|
documentStructure: ../schema/document-structure.yaml
|
|
35
35
|
operationSummary:
|
|
36
36
|
type: string
|
|
37
|
-
description: Summary of the operations performed on the
|
|
37
|
+
description: Summary of the operations performed on the documentation structure
|
|
38
38
|
skills:
|
|
39
39
|
- ./document-structure-tools/add-document.mjs
|
|
40
40
|
- ./document-structure-tools/delete-document.mjs
|
|
@@ -48,13 +48,13 @@ function formatDocumentStructure(structure) {
|
|
|
48
48
|
|
|
49
49
|
function printDocumentStructure(structure) {
|
|
50
50
|
console.log(`\n ${"-".repeat(50)}`);
|
|
51
|
-
console.log(" Current
|
|
51
|
+
console.log(" Current Documentation Structure");
|
|
52
52
|
console.log(` ${"-".repeat(50)}`);
|
|
53
53
|
|
|
54
54
|
const { rootNodes, printNode } = formatDocumentStructure(structure);
|
|
55
55
|
|
|
56
56
|
if (rootNodes.length === 0) {
|
|
57
|
-
console.log(" No
|
|
57
|
+
console.log(" No documentation structure found.");
|
|
58
58
|
} else {
|
|
59
59
|
rootNodes.forEach((node) => {
|
|
60
60
|
printNode(node);
|
|
@@ -64,19 +64,19 @@ function printDocumentStructure(structure) {
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
export default async function userReviewDocumentStructure({ documentStructure, ...rest }, options) {
|
|
67
|
-
// Check if
|
|
67
|
+
// Check if documentation structure exists
|
|
68
68
|
if (!documentStructure || !Array.isArray(documentStructure) || documentStructure.length === 0) {
|
|
69
|
-
console.log("No
|
|
69
|
+
console.log("No documentation structure was generated to review.");
|
|
70
70
|
return { documentStructure };
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
// Print current
|
|
73
|
+
// Print current documentation structure in a user-friendly format
|
|
74
74
|
printDocumentStructure(documentStructure);
|
|
75
75
|
|
|
76
|
-
// Ask user if they want to review the
|
|
76
|
+
// Ask user if they want to review the documentation structure
|
|
77
77
|
const needReview = await options.prompts.select({
|
|
78
78
|
message:
|
|
79
|
-
"Would you like to optimize the
|
|
79
|
+
"Would you like to optimize the documentation structure?\n You can edit titles, reorganize sections.",
|
|
80
80
|
choices: [
|
|
81
81
|
{
|
|
82
82
|
name: "Looks good - proceed with current structure",
|
|
@@ -117,7 +117,7 @@ export default async function userReviewDocumentStructure({ documentStructure, .
|
|
|
117
117
|
const refineAgent = options.context.agents["updateDocumentStructure"];
|
|
118
118
|
if (!refineAgent) {
|
|
119
119
|
console.log(
|
|
120
|
-
"Unable to process your feedback - the
|
|
120
|
+
"Unable to process your feedback - the documentation structure update feature is unavailable.",
|
|
121
121
|
);
|
|
122
122
|
console.log("Please try again later or contact support if this continues.");
|
|
123
123
|
break;
|
|
@@ -157,7 +157,7 @@ export default async function userReviewDocumentStructure({ documentStructure, .
|
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
-
// Print current
|
|
160
|
+
// Print current documentation structure in a user-friendly format
|
|
161
161
|
printDocumentStructure(currentStructure);
|
|
162
162
|
} catch (error) {
|
|
163
163
|
console.error("Error processing your feedback:");
|
|
@@ -172,4 +172,4 @@ export default async function userReviewDocumentStructure({ documentStructure, .
|
|
|
172
172
|
return { documentStructure: currentStructure };
|
|
173
173
|
}
|
|
174
174
|
|
|
175
|
-
userReviewDocumentStructure.taskTitle = "User review and modify
|
|
175
|
+
userReviewDocumentStructure.taskTitle = "User review and modify documentation structure";
|
|
@@ -8,7 +8,7 @@ input_schema:
|
|
|
8
8
|
properties:
|
|
9
9
|
datasources:
|
|
10
10
|
type: string
|
|
11
|
-
description: Context for
|
|
11
|
+
description: Context for documentation structure generation, used to assist generate documentation structure
|
|
12
12
|
documentExecutionStructure: ../schema/document-execution-structure.yaml
|
|
13
13
|
modifiedFiles:
|
|
14
14
|
type: array
|
|
@@ -36,10 +36,10 @@ export default async function checkDocument(
|
|
|
36
36
|
detailGenerated = false;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
// Check if sourceIds have changed by comparing with original
|
|
39
|
+
// Check if sourceIds have changed by comparing with original documentation structure
|
|
40
40
|
let sourceIdsChanged = false;
|
|
41
41
|
if (originalDocumentStructure && sourceIds) {
|
|
42
|
-
// Find the original node in the
|
|
42
|
+
// Find the original node in the documentation structure
|
|
43
43
|
const originalNode = originalDocumentStructure.find((node) => node.path === path);
|
|
44
44
|
|
|
45
45
|
if (originalNode?.sourceIds) {
|
|
@@ -41,7 +41,7 @@ export default async function chooseDocs(
|
|
|
41
41
|
|
|
42
42
|
// Convert files to choices with titles
|
|
43
43
|
const choices = mainLanguageFiles.map((file) => {
|
|
44
|
-
// Convert filename to flat path to find corresponding
|
|
44
|
+
// Convert filename to flat path to find corresponding documentation structure item
|
|
45
45
|
const flatName = file.replace(/\.md$/, "").replace(/\.\w+(-\w+)?$/, "");
|
|
46
46
|
const docItem = documentExecutionStructure.find((item) => {
|
|
47
47
|
const itemFlattenedPath = item.path.replace(/^\//, "").replace(/\//g, "-");
|
|
@@ -4,19 +4,19 @@ import { findItemByPath, readFileContent } from "../../utils/docs-finder-utils.m
|
|
|
4
4
|
/**
|
|
5
5
|
* Loads a document's content along with all its translations from the docs directory.
|
|
6
6
|
*
|
|
7
|
-
* This function finds a document by its path in the
|
|
7
|
+
* This function finds a document by its path in the documentation structure, then searches
|
|
8
8
|
* for all translation files in the docs directory that match the document's naming pattern.
|
|
9
9
|
* Translation files are identified by the pattern: {flatName}.{language-code}.md
|
|
10
10
|
*
|
|
11
11
|
* @param {Object} params - The parameters object
|
|
12
12
|
* @param {string} params.path - The document path to find in the structure
|
|
13
13
|
* @param {string} params.docsDir - The directory containing document files and translations
|
|
14
|
-
* @param {Object} params.documentStructure - The
|
|
14
|
+
* @param {Object} params.documentStructure - The documentation structure object to search in
|
|
15
15
|
* @returns {Promise<Object>} An object containing the document data with translations
|
|
16
16
|
* @throws {Error} Throws an error if the document path is not found in the structure
|
|
17
17
|
*/
|
|
18
18
|
export default async function loadDocumentAllContent({ path, docsDir, documentStructure }) {
|
|
19
|
-
// Find the document item by path in the
|
|
19
|
+
// Find the document item by path in the documentation structure
|
|
20
20
|
const result = await findItemByPath(documentStructure, path, null, docsDir);
|
|
21
21
|
|
|
22
22
|
if (!result) {
|
|
@@ -175,7 +175,7 @@ export default async function loadSources({
|
|
|
175
175
|
}),
|
|
176
176
|
);
|
|
177
177
|
|
|
178
|
-
// Get the last
|
|
178
|
+
// Get the last documentation structure
|
|
179
179
|
let originalDocumentStructure;
|
|
180
180
|
if (outputDir) {
|
|
181
181
|
const documentStructurePath = path.join(outputDir, "structure-plan.json");
|
|
@@ -35,39 +35,18 @@ export default async function saveDocs({
|
|
|
35
35
|
console.error("Failed to save _sidebar.md:", err.message);
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
// Clean up invalid .md files that are no longer in the
|
|
38
|
+
// Clean up invalid .md files that are no longer in the documentation structure
|
|
39
39
|
try {
|
|
40
40
|
await cleanupInvalidFiles(documentStructure, docsDir, translateLanguages, locale);
|
|
41
41
|
} catch (err) {
|
|
42
42
|
console.error("Failed to cleanup invalid .md files:", err.message);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
const message =
|
|
46
|
-
|
|
47
|
-
Generated **${documentStructure.length}** documents and saved to: \`${docsDir}\`
|
|
45
|
+
const message = `
|
|
46
|
+
✅ Documentation generated successfully! (\`${documentStructure.length}\` documents → \`${docsDir}\`)
|
|
48
47
|
${projectInfoMessage || ""}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
**Publish Your Documentation**
|
|
52
|
-
|
|
53
|
-
Generate a shareable preview link for your team:
|
|
54
|
-
|
|
55
|
-
\`aigne doc publish\`
|
|
56
|
-
|
|
57
|
-
## 🔧 Optional Actions
|
|
58
|
-
|
|
59
|
-
**Update Specific Documents**
|
|
60
|
-
|
|
61
|
-
Regenerate content for individual documents:
|
|
62
|
-
|
|
63
|
-
\`aigne doc update\`
|
|
64
|
-
|
|
65
|
-
**Refine Document Structure**
|
|
66
|
-
|
|
67
|
-
Review and improve your documentation organization:
|
|
68
|
-
|
|
69
|
-
\`aigne doc generate\`
|
|
70
|
-
|
|
48
|
+
🚀 Next: Make your documentation live and generate a shareable link, run: \`aigne doc publish\`
|
|
49
|
+
💡 Optional: Update specific document (\`aigne doc update\`) or refine documentation structure (\`aigne doc generate\`)
|
|
71
50
|
`;
|
|
72
51
|
|
|
73
52
|
// Shutdown mermaid worker pool to ensure clean exit
|
|
@@ -94,7 +73,7 @@ function generateFileName(flatName, language) {
|
|
|
94
73
|
}
|
|
95
74
|
|
|
96
75
|
/**
|
|
97
|
-
* Clean up .md files that are no longer in the
|
|
76
|
+
* Clean up .md files that are no longer in the documentation structure
|
|
98
77
|
* @param {Array<{path: string, title: string}>} documentStructure
|
|
99
78
|
* @param {string} docsDir
|
|
100
79
|
* @param {Array<string>} translateLanguages
|
|
@@ -109,7 +88,7 @@ async function cleanupInvalidFiles(documentStructure, docsDir, translateLanguage
|
|
|
109
88
|
const files = await readdir(docsDir);
|
|
110
89
|
const mdFiles = files.filter((file) => file.endsWith(".md"));
|
|
111
90
|
|
|
112
|
-
// Generate expected file names from
|
|
91
|
+
// Generate expected file names from documentation structure
|
|
113
92
|
const expectedFiles = new Set();
|
|
114
93
|
|
|
115
94
|
// Add main document files
|
package/aigne.yaml
CHANGED
|
@@ -9,7 +9,7 @@ agents:
|
|
|
9
9
|
# Initialization
|
|
10
10
|
- ./agents/init/index.mjs
|
|
11
11
|
|
|
12
|
-
#
|
|
12
|
+
# Documentation Structure Generation
|
|
13
13
|
- ./agents/generate/generate-structure.yaml
|
|
14
14
|
- ./agents/generate/update-document-structure.yaml
|
|
15
15
|
- ./agents/generate/check-need-generate-structure.mjs
|
|
@@ -18,7 +18,7 @@ agents:
|
|
|
18
18
|
- ./agents/generate/user-review-document-structure.mjs
|
|
19
19
|
- ./agents/generate/index.yaml
|
|
20
20
|
|
|
21
|
-
#
|
|
21
|
+
# Documentation Structure Tools
|
|
22
22
|
- ./agents/generate/document-structure-tools/add-document.mjs
|
|
23
23
|
- ./agents/generate/document-structure-tools/delete-document.mjs
|
|
24
24
|
- ./agents/generate/document-structure-tools/update-document.mjs
|
package/docs/_sidebar.md
CHANGED
|
@@ -73,7 +73,7 @@ User-Feedback -> Pipeline.Content-Generation: "Regenerate Content"
|
|
|
73
73
|
|
|
74
74
|
1. **Input Analysis**: The process begins when agents load your source code and project configuration (`aigne.yaml`).
|
|
75
75
|
|
|
76
|
-
2. **Structure Planning**: An agent analyzes the codebase to propose a logical
|
|
76
|
+
2. **Structure Planning**: An agent analyzes the codebase to propose a logical documentation structure. It creates an outline based on the project's composition and any specified rules.
|
|
77
77
|
|
|
78
78
|
3. **Content Generation**: With the structure in place, content generation agents populate each section of the document plan with detailed text, code examples, and explanations.
|
|
79
79
|
|
|
@@ -88,8 +88,8 @@ DocSmith's functionality is provided by a collection of agents defined in the pr
|
|
|
88
88
|
| Functional Role | Key Agent Files | Description |
|
|
89
89
|
| ------------------------ | ---------------------------------------------------- | ------------------------------------------------------------------------------------ |
|
|
90
90
|
| **Structure Planning** | `generate/generate-structure.yaml` | Analyzes source code to propose the initial document outline. |
|
|
91
|
-
| **Structure Refinement** | `generate/refine-document-structure.yaml` | Modifies the
|
|
92
|
-
| **Content Generation** | `update/batch-generate-document.yaml`, `generate-document.yaml` | Populates the
|
|
91
|
+
| **Structure Refinement** | `generate/refine-document-structure.yaml` | Modifies the documentation structure based on user feedback. |
|
|
92
|
+
| **Content Generation** | `update/batch-generate-document.yaml`, `generate-document.yaml` | Populates the documentation structure with detailed content for each section. |
|
|
93
93
|
| **Translation** | `translate/translate-document.yaml`, `translate-multilingual.yaml` | Translates generated documentation into multiple target languages. |
|
|
94
94
|
| **Publishing** | `publish/publish-docs.mjs` | Manages the process of publishing documents to Discuss Kit instances. |
|
|
95
95
|
| **Data I/O** | `utils/load-sources.mjs`, `utils/save-docs.mjs` | Responsible for reading source files and writing the final markdown documents to disk. |
|
|
@@ -68,7 +68,7 @@ DocSmith performs several checks to ensure the structural integrity of the conte
|
|
|
68
68
|
|
|
69
69
|
#### Link and Media Integrity
|
|
70
70
|
|
|
71
|
-
- **Link Integrity**: All relative links within the documentation are validated against the
|
|
71
|
+
- **Link Integrity**: All relative links within the documentation are validated against the documentation structure to prevent dead links. This ensures that all internal navigation works as expected. The checker ignores external links (starting with `http://` or `https://`) and `mailto:` links.
|
|
72
72
|
|
|
73
73
|
- **Image Validation**: To avoid broken images, the checker verifies that any local image file referenced in the documentation exists on the file system. It resolves both relative and absolute paths to confirm the file is present. External image URLs and data URLs are not checked.
|
|
74
74
|
|