@aigne/doc-smith 0.8.11-beta.5 → 0.8.11-beta.7
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 +3 -1
- package/.aigne/doc-smith/output/structure-plan.json +2 -2
- package/.aigne/doc-smith/preferences.yml +28 -20
- package/.aigne/doc-smith/upload-cache.yaml +702 -0
- package/.release-please-manifest.json +1 -1
- package/CHANGELOG.md +22 -2
- package/README.md +2 -2
- 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 +38 -13
- package/agents/generate/document-structure-tools/delete-document.mjs +37 -14
- package/agents/generate/document-structure-tools/move-document.mjs +46 -19
- package/agents/generate/document-structure-tools/update-document.mjs +39 -12
- package/agents/generate/generate-structure.yaml +1 -1
- package/agents/generate/update-document-structure.yaml +3 -9
- package/agents/generate/user-review-document-structure.mjs +15 -14
- package/agents/translate/translate-document.yaml +1 -9
- package/agents/update/batch-generate-document.yaml +1 -1
- package/agents/update/check-document.mjs +2 -2
- package/agents/update/check-update-is-single.mjs +2 -1
- package/agents/update/document-tools/update-document-content.mjs +24 -14
- package/agents/update/fs-tools/glob.mjs +184 -0
- package/agents/update/fs-tools/grep.mjs +317 -0
- package/agents/update/fs-tools/read-file.mjs +307 -0
- package/agents/update/generate-document.yaml +4 -7
- package/agents/update/update-document-detail.yaml +6 -10
- package/agents/update/user-review-document.mjs +13 -13
- 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/assets/screenshots/doc-complete-setup.png +0 -0
- package/assets/screenshots/doc-generate-docs.png +0 -0
- package/assets/screenshots/doc-generate.png +0 -0
- package/assets/screenshots/doc-generated-successfully.png +0 -0
- package/assets/screenshots/doc-publish.png +0 -0
- package/assets/screenshots/doc-regenerate.png +0 -0
- package/assets/screenshots/doc-translate-langs.png +0 -0
- package/assets/screenshots/doc-translate.png +0 -0
- package/assets/screenshots/doc-update.png +0 -0
- package/docs/_sidebar.md +1 -1
- package/docs/advanced-how-it-works.ja.md +31 -31
- package/docs/advanced-how-it-works.md +10 -10
- package/docs/advanced-how-it-works.zh-TW.md +24 -24
- package/docs/advanced-how-it-works.zh.md +20 -20
- package/docs/advanced-quality-assurance.ja.md +57 -61
- package/docs/advanced-quality-assurance.md +57 -61
- package/docs/advanced-quality-assurance.zh-TW.md +57 -61
- package/docs/advanced-quality-assurance.zh.md +57 -61
- package/docs/advanced.ja.md +8 -4
- package/docs/advanced.md +7 -3
- package/docs/advanced.zh-TW.md +9 -5
- package/docs/advanced.zh.md +9 -5
- package/docs/changelog.ja.md +206 -29
- package/docs/changelog.md +177 -0
- package/docs/changelog.zh-TW.md +229 -52
- package/docs/changelog.zh.md +204 -27
- package/docs/cli-reference.ja.md +181 -80
- package/docs/cli-reference.md +168 -67
- package/docs/cli-reference.zh-TW.md +177 -76
- package/docs/cli-reference.zh.md +172 -71
- package/docs/configuration-interactive-setup.ja.md +45 -42
- package/docs/configuration-interactive-setup.md +9 -6
- package/docs/configuration-interactive-setup.zh-TW.md +26 -23
- package/docs/configuration-interactive-setup.zh.md +25 -22
- package/docs/configuration-language-support.ja.md +33 -63
- package/docs/configuration-language-support.md +32 -62
- package/docs/configuration-language-support.zh-TW.md +35 -65
- package/docs/configuration-language-support.zh.md +32 -62
- package/docs/configuration-llm-setup.ja.md +25 -23
- package/docs/configuration-llm-setup.md +20 -18
- package/docs/configuration-llm-setup.zh-TW.md +21 -19
- package/docs/configuration-llm-setup.zh.md +20 -18
- package/docs/configuration-preferences.ja.md +67 -52
- package/docs/configuration-preferences.md +55 -40
- package/docs/configuration-preferences.zh-TW.md +69 -54
- package/docs/configuration-preferences.zh.md +68 -53
- package/docs/configuration.ja.md +98 -58
- package/docs/configuration.md +42 -2
- package/docs/configuration.zh-TW.md +86 -46
- package/docs/configuration.zh.md +76 -36
- package/docs/features-generate-documentation.ja.md +49 -55
- package/docs/features-generate-documentation.md +49 -55
- package/docs/features-generate-documentation.zh-TW.md +54 -60
- package/docs/features-generate-documentation.zh.md +48 -54
- package/docs/features-publish-your-docs.ja.md +68 -45
- package/docs/features-publish-your-docs.md +65 -42
- package/docs/features-publish-your-docs.zh-TW.md +74 -51
- package/docs/features-publish-your-docs.zh.md +67 -44
- package/docs/features-translate-documentation.ja.md +46 -35
- package/docs/features-translate-documentation.md +39 -28
- package/docs/features-translate-documentation.zh-TW.md +45 -34
- package/docs/features-translate-documentation.zh.md +39 -28
- package/docs/features-update-and-refine.ja.md +75 -71
- package/docs/features-update-and-refine.md +67 -63
- package/docs/features-update-and-refine.zh-TW.md +72 -67
- package/docs/features-update-and-refine.zh.md +71 -67
- package/docs/features.ja.md +29 -19
- package/docs/features.md +25 -15
- package/docs/features.zh-TW.md +28 -18
- package/docs/features.zh.md +31 -21
- package/docs/getting-started.ja.md +43 -46
- package/docs/getting-started.md +36 -39
- package/docs/getting-started.zh-TW.md +41 -44
- package/docs/getting-started.zh.md +39 -42
- package/docs/overview.ja.md +63 -11
- package/docs/overview.md +62 -10
- package/docs/overview.zh-TW.md +67 -15
- package/docs/overview.zh.md +62 -10
- package/docs-mcp/analyze-docs-relevance.yaml +6 -6
- package/docs-mcp/docs-search.yaml +1 -1
- package/media.md +9 -9
- 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/custom/custom-components.md +304 -188
- package/prompts/detail/document-rules.md +5 -5
- package/prompts/detail/generate-document.md +21 -8
- package/prompts/detail/update-document.md +8 -12
- 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 +18 -14
- package/prompts/utils/feedback-refiner.md +3 -3
- 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 +12 -12
- package/tests/agents/generate/document-structure-tools/update-document.test.mjs +3 -3
- package/tests/agents/generate/user-review-document-structure.test.mjs +36 -13
- package/tests/agents/update/check-document.test.mjs +1 -1
- package/tests/agents/update/document-tools/update-document-content.test.mjs +115 -112
- package/tests/agents/update/fs-tools/glob.test.mjs +438 -0
- package/tests/agents/update/fs-tools/grep.test.mjs +279 -0
- package/tests/agents/update/fs-tools/read-file.test.mjs +553 -0
- package/tests/agents/update/user-review-document.test.mjs +48 -27
- 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-schema.mjs +5 -6
- package/types/document-structure-schema.mjs +25 -13
- 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
|
@@ -134,7 +134,8 @@ export default async function userReviewDocument(
|
|
|
134
134
|
// Print current document headings structure
|
|
135
135
|
printDocumentHeadings(content, title || "Untitled Document");
|
|
136
136
|
|
|
137
|
-
|
|
137
|
+
// Initialize shared context with current content
|
|
138
|
+
options.context.userContext.currentContent = content;
|
|
138
139
|
|
|
139
140
|
const MAX_ITERATIONS = 100;
|
|
140
141
|
let iterationCount = 0;
|
|
@@ -163,7 +164,10 @@ export default async function userReviewDocument(
|
|
|
163
164
|
if (action === "finish") {
|
|
164
165
|
break;
|
|
165
166
|
} else if (action === "view") {
|
|
166
|
-
await showDocumentDetail(
|
|
167
|
+
await showDocumentDetail(
|
|
168
|
+
options.context.userContext.currentContent,
|
|
169
|
+
title || "Untitled Document",
|
|
170
|
+
);
|
|
167
171
|
}
|
|
168
172
|
|
|
169
173
|
// Ask for feedback
|
|
@@ -200,20 +204,13 @@ export default async function userReviewDocument(
|
|
|
200
204
|
|
|
201
205
|
try {
|
|
202
206
|
// Call updateDocument agent with feedback
|
|
203
|
-
|
|
207
|
+
await options.context.invoke(updateAgent, {
|
|
204
208
|
...rest,
|
|
205
|
-
originalContent: currentContent,
|
|
209
|
+
originalContent: options.context.userContext.currentContent,
|
|
206
210
|
feedback: feedback.trim(),
|
|
207
211
|
userPreferences,
|
|
208
212
|
});
|
|
209
213
|
|
|
210
|
-
if (result.updatedContent) {
|
|
211
|
-
currentContent = result.updatedContent;
|
|
212
|
-
console.log(`\n✅ ${result.operationSummary || "Document updated successfully"}\n`);
|
|
213
|
-
} else {
|
|
214
|
-
console.log("\n❌ We couldn't update the document. Please try rephrasing your feedback.\n");
|
|
215
|
-
}
|
|
216
|
-
|
|
217
214
|
// Check if feedback should be saved as user preference
|
|
218
215
|
const feedbackRefinerAgent = options.context.agents["checkFeedbackRefiner"];
|
|
219
216
|
if (feedbackRefinerAgent) {
|
|
@@ -229,7 +226,10 @@ export default async function userReviewDocument(
|
|
|
229
226
|
}
|
|
230
227
|
|
|
231
228
|
// Print updated document headings structure
|
|
232
|
-
printDocumentHeadings(
|
|
229
|
+
printDocumentHeadings(
|
|
230
|
+
options.context.userContext.currentContent,
|
|
231
|
+
title || "Untitled Document",
|
|
232
|
+
);
|
|
233
233
|
} catch (error) {
|
|
234
234
|
console.error("Error processing your feedback:");
|
|
235
235
|
console.error(`Type: ${error.name}`);
|
|
@@ -242,7 +242,7 @@ export default async function userReviewDocument(
|
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
244
|
|
|
245
|
-
return { content: currentContent };
|
|
245
|
+
return { content: options.context.userContext.currentContent };
|
|
246
246
|
}
|
|
247
247
|
|
|
248
248
|
userReviewDocument.taskTitle = "User review and modify document content";
|
|
@@ -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
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/docs/_sidebar.md
CHANGED
|
@@ -1,63 +1,63 @@
|
|
|
1
1
|
# 仕組み
|
|
2
2
|
|
|
3
|
-
AIGNE DocSmith
|
|
3
|
+
AIGNE DocSmithは、マルチagentシステムで動作します。単一のモノリシックなプロセスではなく、専門のAI agentのパイプラインを編成し、各agentが特定のタスクを担当します。このアプローチにより、ソースコードを完全なドキュメントに変換するための構造化されたモジュラーなプロセスが可能になります。
|
|
4
4
|
|
|
5
|
-
このツールは、AI
|
|
5
|
+
このツールは、AIアプリケーションを開発・展開するためのプラットフォームを提供する、より大きなAIGNEエコシステムの不可欠な部分です。
|
|
6
6
|
|
|
7
7
|

|
|
8
8
|
|
|
9
|
-
##
|
|
9
|
+
## ドキュメント生成パイプライン
|
|
10
10
|
|
|
11
|
-
DocSmith
|
|
11
|
+
DocSmithの中核は、ソースコードをいくつかの異なるステージを通して処理するパイプラインです。各ステージは1つ以上の専用agentによって管理されます。通常、`aigne doc generate`コマンドによって開始される主要なワークフローは、次のように視覚化できます。
|
|
12
12
|
|
|
13
13
|
```d2
|
|
14
14
|
direction: down
|
|
15
15
|
|
|
16
16
|
Input: {
|
|
17
|
-
label: "
|
|
17
|
+
label: "ソースコードと設定"
|
|
18
18
|
shape: rectangle
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
Pipeline: {
|
|
22
|
-
label: "
|
|
22
|
+
label: "コア生成パイプライン"
|
|
23
23
|
shape: rectangle
|
|
24
24
|
grid-columns: 1
|
|
25
25
|
grid-gap: 40
|
|
26
26
|
|
|
27
27
|
Structure-Planning: {
|
|
28
|
-
label: "1.
|
|
28
|
+
label: "1. 構造計画"
|
|
29
29
|
shape: rectangle
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
Content-Generation: {
|
|
33
|
-
label: "2.
|
|
33
|
+
label: "2. コンテンツ生成"
|
|
34
34
|
shape: rectangle
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
Saving: {
|
|
38
|
-
label: "3.
|
|
38
|
+
label: "3. ドキュメント保存"
|
|
39
39
|
shape: rectangle
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
User-Feedback: {
|
|
44
|
-
label: "
|
|
44
|
+
label: "ユーザーフィードバックループ\n(--feedbackフラグ経由)"
|
|
45
45
|
shape: rectangle
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
Optional-Steps: {
|
|
49
|
-
label: "
|
|
49
|
+
label: "オプションの生成後ステップ"
|
|
50
50
|
shape: rectangle
|
|
51
51
|
grid-columns: 2
|
|
52
52
|
grid-gap: 40
|
|
53
53
|
|
|
54
54
|
Translation: {
|
|
55
|
-
label: "
|
|
55
|
+
label: "翻訳\n(aigne doc translate)"
|
|
56
56
|
shape: rectangle
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
Publishing: {
|
|
60
|
-
label: "
|
|
60
|
+
label: "公開\n(aigne doc publish)"
|
|
61
61
|
shape: rectangle
|
|
62
62
|
}
|
|
63
63
|
}
|
|
@@ -67,35 +67,35 @@ Pipeline.Structure-Planning -> Pipeline.Content-Generation
|
|
|
67
67
|
Pipeline.Content-Generation -> Pipeline.Saving
|
|
68
68
|
Pipeline.Saving -> Optional-Steps
|
|
69
69
|
|
|
70
|
-
User-Feedback -> Pipeline.Structure-Planning: "
|
|
71
|
-
User-Feedback -> Pipeline.Content-Generation: "
|
|
70
|
+
User-Feedback -> Pipeline.Structure-Planning: "構造の改良"
|
|
71
|
+
User-Feedback -> Pipeline.Content-Generation: "コンテンツの再生成"
|
|
72
72
|
```
|
|
73
73
|
|
|
74
|
-
1. **入力分析**:
|
|
74
|
+
1. **入力分析**: このプロセスは、agentがソースコードとプロジェクト設定(`aigne.yaml`)を読み込むことから始まります。
|
|
75
75
|
|
|
76
|
-
2. **構造計画**:
|
|
76
|
+
2. **構造計画**: あるagentがコードベースを分析し、論理的なドキュメント構造を提案します。プロジェクトの構成と指定されたルールに基づいてアウトラインを作成します。
|
|
77
77
|
|
|
78
|
-
3. **コンテンツ生成**:
|
|
78
|
+
3. **コンテンツ生成**: 構造が決定されると、コンテンツ生成agentがドキュメントプランの各セクションに詳細なテキスト、コード例、説明を埋め込んでいきます。
|
|
79
79
|
|
|
80
|
-
4. **改良と更新**: `aigne doc update
|
|
80
|
+
4. **改良と更新**: `aigne doc update`または`aigne doc generate --feedback`を介して入力が提供されると、特定のagentがアクティブになり、個々のドキュメントを更新したり、全体の構造を調整したりします。
|
|
81
81
|
|
|
82
|
-
5. **翻訳と公開**: 主要なコンテンツが生成された後、オプションの
|
|
82
|
+
5. **翻訳と公開**: 主要なコンテンツが生成された後、オプションのagentが多言語翻訳や最終的なドキュメントをウェブプラットフォームに公開するなどのタスクを処理します。
|
|
83
83
|
|
|
84
84
|
## 主要なAI Agent
|
|
85
85
|
|
|
86
|
-
DocSmithの機能は、プロジェクトの設定で定義された
|
|
86
|
+
DocSmithの機能は、プロジェクトの設定で定義されたagentのコレクションによって提供されます。各agentには特定の役割があります。以下の表は、主要なagentとその機能の一部をリストアップしたものです。
|
|
87
87
|
|
|
88
|
-
| 機能的役割
|
|
89
|
-
|
|
|
90
|
-
| **構造計画**
|
|
91
|
-
| **構造の改良**
|
|
92
|
-
| **コンテンツ生成**
|
|
93
|
-
| **翻訳**
|
|
94
|
-
| **公開**
|
|
95
|
-
| **データI/O**
|
|
88
|
+
| 機能的役割 | 主要なAgentファイル | 説明 |
|
|
89
|
+
| :--- | :--- | :--- |
|
|
90
|
+
| **構造計画** | `generate/generate-structure.yaml` | ソースコードを分析し、最初のドキュメントアウトラインを提案します。 |
|
|
91
|
+
| **構造の改良** | `generate/refine-document-structure.yaml` | ユーザーのフィードバックに基づいてドキュメントの構造を修正します。 |
|
|
92
|
+
| **コンテンツ生成** | `update/batch-generate-document.yaml`, `update/generate-document.yaml` | ドキュメント構造の各セクションに詳細なコンテンツを埋め込みます。 |
|
|
93
|
+
| **翻訳** | `translate/translate-document.yaml`, `translate/translate-multilingual.yaml` | 生成されたドキュメントを複数のターゲット言語に翻訳します。 |
|
|
94
|
+
| **公開** | `publish/publish-docs.mjs` | ドキュメントをDiscuss Kitインスタンスに公開するプロセスを管理します。 |
|
|
95
|
+
| **データI/O** | `utils/load-sources.mjs`, `utils/save-docs.mjs` | ソースファイルの読み込みと、最終的なマークダウンドキュメントのディスクへの書き込みを担当します。 |
|
|
96
96
|
|
|
97
|
-
この
|
|
97
|
+
このagentベースのアーキテクチャにより、ドキュメント化プロセスの各ステップを専門のツールで処理できるため、構造化され、保守可能なワークフローが保証されます。
|
|
98
98
|
|
|
99
99
|
---
|
|
100
100
|
|
|
101
|
-
DocSmith
|
|
101
|
+
DocSmithが出力の正確性と形式を保証するために講じている対策を理解するには、[品質保証](./advanced-quality-assurance.md)のセクションに進んでください。
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# How It Works
|
|
2
2
|
|
|
3
|
-
AIGNE DocSmith operates on a multi-agent system
|
|
3
|
+
AIGNE DocSmith operates on a multi-agent system. Instead of a single monolithic process, it orchestrates a pipeline of specialized AI agents, where each agent is responsible for a specific task. This approach allows for a structured and modular process that transforms source code into complete documentation.
|
|
4
4
|
|
|
5
5
|
The tool is an integral part of the larger AIGNE ecosystem, which provides a platform for developing and deploying AI applications.
|
|
6
6
|
|
|
@@ -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
|
|
|
@@ -85,14 +85,14 @@ User-Feedback -> Pipeline.Content-Generation: "Regenerate Content"
|
|
|
85
85
|
|
|
86
86
|
DocSmith's functionality is provided by a collection of agents defined in the project's configuration. Each agent has a specific role. The table below lists some of the key agents and their functions.
|
|
87
87
|
|
|
88
|
-
| Functional Role
|
|
89
|
-
|
|
|
90
|
-
| **Structure Planning**
|
|
91
|
-
| **Structure Refinement** | `generate/refine-document-structure.yaml`
|
|
92
|
-
| **Content Generation**
|
|
93
|
-
| **Translation**
|
|
94
|
-
| **Publishing**
|
|
95
|
-
| **Data I/O**
|
|
88
|
+
| Functional Role | Key Agent Files | Description |
|
|
89
|
+
| :--- | :--- | :--- |
|
|
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 documentation structure based on user feedback. |
|
|
92
|
+
| **Content Generation** | `update/batch-generate-document.yaml`, `update/generate-document.yaml` | Populates the documentation structure with detailed content for each section. |
|
|
93
|
+
| **Translation** | `translate/translate-document.yaml`, `translate/translate-multilingual.yaml` | Translates generated documentation into multiple target languages. |
|
|
94
|
+
| **Publishing** | `publish/publish-docs.mjs` | Manages the process of publishing documents to Discuss Kit instances. |
|
|
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. |
|
|
96
96
|
|
|
97
97
|
This agent-based architecture allows each step of the documentation process to be handled by a specialized tool, ensuring a structured and maintainable workflow.
|
|
98
98
|
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
# 運作方式
|
|
2
2
|
|
|
3
|
-
AIGNE DocSmith
|
|
3
|
+
AIGNE DocSmith 運作於一個多 Agent 系統之上。它並非單一的巨型流程,而是協調一個由專業化 AI Agent 組成的流程,其中每個 Agent 負責一項特定任務。這種方法實現了一個結構化和模組化的流程,能將原始程式碼轉換為完整的文件。
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
此工具是更廣泛的 AIGNE 生態系統中不可或缺的一部分,該生態系統為開發和部署 AI 應用程式提供了一個平台。
|
|
6
6
|
|
|
7
7
|

|
|
8
8
|
|
|
9
|
-
##
|
|
9
|
+
## 文件產生流程
|
|
10
10
|
|
|
11
|
-
DocSmith
|
|
11
|
+
DocSmith 的核心是一個將您的原始程式碼經過數個不同階段處理的流程。每個階段都由一個或多個專門的 Agent 管理。主要的工作流程,通常由 `aigne doc generate` 指令啟動,可視覺化如下:
|
|
12
12
|
|
|
13
13
|
```d2
|
|
14
14
|
direction: down
|
|
15
15
|
|
|
16
16
|
Input: {
|
|
17
|
-
label: "
|
|
17
|
+
label: "原始程式碼與設定"
|
|
18
18
|
shape: rectangle
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
Pipeline: {
|
|
22
|
-
label: "
|
|
22
|
+
label: "核心產生流程"
|
|
23
23
|
shape: rectangle
|
|
24
24
|
grid-columns: 1
|
|
25
25
|
grid-gap: 40
|
|
@@ -30,7 +30,7 @@ Pipeline: {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
Content-Generation: {
|
|
33
|
-
label: "2.
|
|
33
|
+
label: "2. 內容產生"
|
|
34
34
|
shape: rectangle
|
|
35
35
|
}
|
|
36
36
|
|
|
@@ -46,7 +46,7 @@ User-Feedback: {
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
Optional-Steps: {
|
|
49
|
-
label: "
|
|
49
|
+
label: "選用的後產生步驟"
|
|
50
50
|
shape: rectangle
|
|
51
51
|
grid-columns: 2
|
|
52
52
|
grid-gap: 40
|
|
@@ -68,33 +68,33 @@ Pipeline.Content-Generation -> Pipeline.Saving
|
|
|
68
68
|
Pipeline.Saving -> Optional-Steps
|
|
69
69
|
|
|
70
70
|
User-Feedback -> Pipeline.Structure-Planning: "優化結構"
|
|
71
|
-
User-Feedback -> Pipeline.Content-Generation: "
|
|
71
|
+
User-Feedback -> Pipeline.Content-Generation: "重新產生內容"
|
|
72
72
|
```
|
|
73
73
|
|
|
74
|
-
1. **輸入分析**:當 Agent
|
|
74
|
+
1. **輸入分析**:當 Agent 載入您的原始程式碼和專案設定(`aigne.yaml`)時,流程便開始了。
|
|
75
75
|
|
|
76
|
-
2. **結構規劃**:一個 Agent
|
|
76
|
+
2. **結構規劃**:一個 Agent 會分析程式庫以提出一個合乎邏輯的文件結構。它會根據專案的組成和任何指定的規則來建立大綱。
|
|
77
77
|
|
|
78
|
-
3.
|
|
78
|
+
3. **內容產生**:結構就緒後,內容產生 Agent 會在文件計畫的每個部分填入詳細的文字、程式碼範例和說明。
|
|
79
79
|
|
|
80
|
-
4. **優化與更新**:當您透過 `aigne doc update` 或 `aigne doc generate --feedback`
|
|
80
|
+
4. **優化與更新**:當您透過 `aigne doc update` 或 `aigne doc generate --feedback` 提供輸入時,特定的 Agent 會被啟動以更新個別文件或調整整體結構。
|
|
81
81
|
|
|
82
|
-
5.
|
|
82
|
+
5. **翻譯與發布**:主要內容產生後,選用的 Agent 會處理多語言翻譯和將最終文件發布到網路平台等任務。
|
|
83
83
|
|
|
84
84
|
## 關鍵 AI Agent
|
|
85
85
|
|
|
86
|
-
DocSmith
|
|
86
|
+
DocSmith 的功能由專案設定中定義的一系列 Agent 提供。每個 Agent 都有特定的角色。下表列出了一些關鍵 Agent 及其功能。
|
|
87
87
|
|
|
88
|
-
| 功能角色
|
|
89
|
-
|
|
|
90
|
-
| **結構規劃**
|
|
91
|
-
| **結構優化**
|
|
92
|
-
|
|
|
93
|
-
| **翻譯**
|
|
94
|
-
| **發布**
|
|
95
|
-
| **資料 I/O**
|
|
88
|
+
| 功能角色 | 關鍵 Agent 檔案 | 說明 |
|
|
89
|
+
| :--- | :--- | :--- |
|
|
90
|
+
| **結構規劃** | `generate/generate-structure.yaml` | 分析原始程式碼以提出初始的文件大綱。 |
|
|
91
|
+
| **結構優化** | `generate/refine-document-structure.yaml` | 根據使用者回饋修改文件結構。 |
|
|
92
|
+
| **內容產生** | `update/batch-generate-document.yaml`, `update/generate-document.yaml` | 為文件結構的每個部分填入詳細內容。 |
|
|
93
|
+
| **翻譯** | `translate/translate-document.yaml`, `translate/translate-multilingual.yaml` | 將產生的文件翻譯成多個目標語言。 |
|
|
94
|
+
| **發布** | `publish/publish-docs.mjs` | 管理將文件發布到 Discuss Kit 實例的流程。 |
|
|
95
|
+
| **資料 I/O** | `utils/load-sources.mjs`, `utils/save-docs.mjs` | 負責讀取來源檔案並將最終的 markdown 文件寫入磁碟。 |
|
|
96
96
|
|
|
97
|
-
這種基於 Agent
|
|
97
|
+
這種基於 Agent 的架構讓文件流程的每一步都由專門的工具處理,確保了工作流程的結構化和可維護性。
|
|
98
98
|
|
|
99
99
|
---
|
|
100
100
|
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
# 工作原理
|
|
2
2
|
|
|
3
|
-
AIGNE DocSmith
|
|
3
|
+
AIGNE DocSmith 在一个多 Agent 系统上运行。它不是一个单一的整体流程,而是协调一个由专门的 AI Agent 组成的管道,其中每个 Agent 负责一项特定任务。这种方法允许通过一个结构化和模块化的流程将源代码转换为完整的文档。
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
该工具是更广泛的 AIGNE 生态系统的一个组成部分,该生态系统为开发和部署 AI 应用程序提供了一个平台。
|
|
6
6
|
|
|
7
7
|

|
|
8
8
|
|
|
9
|
-
##
|
|
9
|
+
## 文档生成管道
|
|
10
10
|
|
|
11
|
-
DocSmith
|
|
11
|
+
DocSmith 的核心是一个通过几个不同阶段处理您的源代码的管道。每个阶段都由一个或多个专用 Agent 管理。主要工作流程通常由 `aigne doc generate` 命令启动,可以可视化如下:
|
|
12
12
|
|
|
13
13
|
```d2
|
|
14
14
|
direction: down
|
|
15
15
|
|
|
16
16
|
Input: {
|
|
17
|
-
label: "
|
|
17
|
+
label: "源代码和配置"
|
|
18
18
|
shape: rectangle
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
Pipeline: {
|
|
22
|
-
label: "
|
|
22
|
+
label: "核心生成管道"
|
|
23
23
|
shape: rectangle
|
|
24
24
|
grid-columns: 1
|
|
25
25
|
grid-gap: 40
|
|
@@ -73,29 +73,29 @@ User-Feedback -> Pipeline.Content-Generation: "重新生成内容"
|
|
|
73
73
|
|
|
74
74
|
1. **输入分析**:当 Agent 加载您的源代码和项目配置(`aigne.yaml`)时,该过程开始。
|
|
75
75
|
|
|
76
|
-
2. **结构规划**:一个 Agent
|
|
76
|
+
2. **结构规划**:一个 Agent 分析代码库以提出一个逻辑化的文档结构。它会根据项目的构成和任何指定的规则创建一个大纲。
|
|
77
77
|
|
|
78
78
|
3. **内容生成**:结构确定后,内容生成 Agent 会为文档计划的每个部分填充详细的文本、代码示例和解释。
|
|
79
79
|
|
|
80
|
-
4.
|
|
80
|
+
4. **优化和更新**:当您通过 `aigne doc update` 或 `aigne doc generate --feedback` 提供输入时,特定的 Agent 会被激活以更新单个文档或调整整体结构。
|
|
81
81
|
|
|
82
|
-
5.
|
|
82
|
+
5. **翻译和发布**:在主要内容生成后,可选的 Agent 会处理多语言翻译和将最终文档发布到 Web 平台等任务。
|
|
83
83
|
|
|
84
84
|
## 关键 AI Agent
|
|
85
85
|
|
|
86
|
-
DocSmith 的功能由项目配置中定义的一系列 Agent 提供。每个 Agent
|
|
86
|
+
DocSmith 的功能由项目配置中定义的一系列 Agent 提供。每个 Agent 都有特定的角色。下表列出了一些关键 Agent 及其功能。
|
|
87
87
|
|
|
88
|
-
| 功能角色
|
|
89
|
-
|
|
|
90
|
-
| **结构规划**
|
|
91
|
-
| **结构优化** | `generate/refine-document-structure.yaml`
|
|
92
|
-
| **内容生成**
|
|
93
|
-
| **翻译**
|
|
94
|
-
| **发布**
|
|
95
|
-
| **数据 I/O**
|
|
88
|
+
| 功能角色 | 关键 Agent 文件 | 描述 |
|
|
89
|
+
| :--- | :--- | :--- |
|
|
90
|
+
| **结构规划** | `generate/generate-structure.yaml` | 分析源代码以提出初始文档大纲。 |
|
|
91
|
+
| **结构优化** | `generate/refine-document-structure.yaml` | 根据用户反馈修改文档结构。 |
|
|
92
|
+
| **内容生成** | `update/batch-generate-document.yaml`, `update/generate-document.yaml` | 为文档结构的每个部分填充详细内容。 |
|
|
93
|
+
| **翻译** | `translate/translate-document.yaml`, `translate/translate-multilingual.yaml` | 将生成的文档翻译成多种目标语言。 |
|
|
94
|
+
| **发布** | `publish/publish-docs.mjs` | 管理将文档发布到 Discuss Kit 实例的过程。 |
|
|
95
|
+
| **数据 I/O** | `utils/load-sources.mjs`, `utils/save-docs.mjs` | 负责读取源文件并将最终的 Markdown 文档写入磁盘。 |
|
|
96
96
|
|
|
97
|
-
这种基于 Agent
|
|
97
|
+
这种基于 Agent 的架构允许文档流程的每一步都由专门的工具处理,从而确保一个结构化且可维护的工作流程。
|
|
98
98
|
|
|
99
99
|
---
|
|
100
100
|
|
|
101
|
-
要了解 DocSmith
|
|
101
|
+
要了解 DocSmith 为确保输出的准确性和格式而采取的措施,请继续阅读[质量保证](./advanced-quality-assurance.md)部分。
|