@aigne/doc-smith 0.8.3 → 0.8.5
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 -3
- package/.aigne/doc-smith/preferences.yml +58 -12
- package/.aigne/doc-smith/upload-cache.yaml +600 -207
- package/CHANGELOG.md +22 -0
- package/README.md +77 -5
- package/agents/input-generator.mjs +12 -6
- package/agents/publish-docs.mjs +53 -4
- package/docs/_sidebar.md +1 -1
- package/docs/advanced-how-it-works.md +55 -60
- package/docs/advanced-how-it-works.zh.md +60 -65
- package/docs/advanced-quality-assurance.md +73 -38
- package/docs/advanced-quality-assurance.zh.md +73 -38
- package/docs/advanced.md +2 -14
- package/docs/advanced.zh.md +5 -17
- package/docs/changelog.md +41 -4
- package/docs/changelog.zh.md +77 -40
- package/docs/cli-reference.md +79 -13
- package/docs/cli-reference.zh.md +92 -26
- package/docs/configuration-interactive-setup.md +102 -49
- package/docs/configuration-interactive-setup.zh.md +102 -49
- package/docs/configuration-language-support.md +69 -39
- package/docs/configuration-language-support.zh.md +68 -38
- package/docs/configuration-llm-setup.md +25 -62
- package/docs/configuration-llm-setup.zh.md +25 -62
- package/docs/configuration-preferences.md +79 -67
- package/docs/configuration-preferences.zh.md +78 -67
- package/docs/configuration.md +122 -109
- package/docs/configuration.zh.md +130 -117
- package/docs/features-generate-documentation.md +44 -24
- package/docs/features-generate-documentation.zh.md +52 -32
- package/docs/features-publish-your-docs.md +41 -40
- package/docs/features-publish-your-docs.zh.md +50 -49
- package/docs/features-translate-documentation.md +73 -17
- package/docs/features-translate-documentation.zh.md +76 -20
- package/docs/features-update-and-refine.md +72 -21
- package/docs/features-update-and-refine.zh.md +80 -29
- package/docs/features.md +24 -28
- package/docs/features.zh.md +25 -29
- package/docs/getting-started.md +87 -38
- package/docs/getting-started.zh.md +88 -39
- package/docs/overview.md +17 -35
- package/docs/overview.zh.md +18 -36
- package/package.json +9 -8
- package/prompts/content-detail-generator.md +1 -0
- package/prompts/document/custom-code-block.md +101 -0
- package/prompts/document/d2-chart/rules.md +941 -1031
- package/prompts/document/detail-generator.md +7 -53
- package/tests/input-generator.test.mjs +2 -2
- package/tests/kroki-utils.test.mjs +88 -17
- package/utils/auth-utils.mjs +9 -2
- package/utils/blocklet.mjs +25 -6
- package/utils/constants.mjs +17 -1
- package/utils/deploy.mjs +404 -0
- package/utils/kroki-utils.mjs +22 -14
- package/utils/markdown-checker.mjs +1 -1
- package/utils/utils.mjs +3 -2
- package/prompts/document/d2-chart/diy-examples.md +0 -44
- package/prompts/document/d2-chart/shape-rules.md +0 -182
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.8.5](https://github.com/AIGNE-io/aigne-doc-smith/compare/v0.8.4...v0.8.5) (2025-09-10)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* support publish docs to enterprise spaces ([#82](https://github.com/AIGNE-io/aigne-doc-smith/issues/82)) ([35b577a](https://github.com/AIGNE-io/aigne-doc-smith/commit/35b577ac0f2c1b860a23185054a55bada3742e8e))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Miscellaneous Chores
|
|
12
|
+
|
|
13
|
+
* release 0.8.5 ([7a60a03](https://github.com/AIGNE-io/aigne-doc-smith/commit/7a60a03f91a20f378e94b12dd32a6a8b0a4bede5))
|
|
14
|
+
|
|
15
|
+
## [0.8.4](https://github.com/AIGNE-io/aigne-doc-smith/compare/v0.8.3...v0.8.4) (2025-09-09)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* parse markdown code blocks into custom x-code element ([#89](https://github.com/AIGNE-io/aigne-doc-smith/issues/89)) ([96ea776](https://github.com/AIGNE-io/aigne-doc-smith/commit/96ea7761299b93ea406abe04193f531fc406ccfa))
|
|
21
|
+
* **utils:** update code block regex to support enhanced attributes ([#92](https://github.com/AIGNE-io/aigne-doc-smith/issues/92)) ([bf1fbab](https://github.com/AIGNE-io/aigne-doc-smith/commit/bf1fbabf193e90a83ed6e83e4ff4c5b3b2930477))
|
|
22
|
+
* **ux:** make background transparent for d2 diagrams ([13eed81](https://github.com/AIGNE-io/aigne-doc-smith/commit/13eed81cb6be13c64ad04c41505d9d76f34d54bb))
|
|
23
|
+
* **ux:** make background transparent for d2 diagrams ([#96](https://github.com/AIGNE-io/aigne-doc-smith/issues/96)) ([13eed81](https://github.com/AIGNE-io/aigne-doc-smith/commit/13eed81cb6be13c64ad04c41505d9d76f34d54bb))
|
|
24
|
+
|
|
3
25
|
## [0.8.3](https://github.com/AIGNE-io/aigne-doc-smith/compare/v0.8.2...v0.8.3) (2025-09-05)
|
|
4
26
|
|
|
5
27
|
|
package/README.md
CHANGED
|
@@ -19,9 +19,9 @@ As shown in the diagram, DocSmith integrates seamlessly with other [AIGNE](https
|
|
|
19
19
|
|
|
20
20
|
- **Automated Structure Planning:** Intelligently analyzes your codebase to generate a comprehensive and logical document structure.
|
|
21
21
|
- **AI-Powered Content Generation:** Populates the document structure with detailed, high-quality content.
|
|
22
|
-
- **Multi-Language Support:** Seamlessly translates your documentation into 12
|
|
23
|
-
- **AIGNE Hub Integration:** Use AIGNE Hub as your LLM provider without needing your own API keys, with easy switching between different large language models.
|
|
24
|
-
- **
|
|
22
|
+
- **Multi-Language Support:** Seamlessly translates your documentation into 12 languages including English, Chinese, Japanese, Korean, Spanish, French, German, Portuguese, Russian, Italian, and Arabic.
|
|
23
|
+
- **AIGNE Hub Integration:** Use [AIGNE Hub](https://www.aigne.io/en/hub) as your LLM provider without needing your own API keys, with easy switching between different large language models.
|
|
24
|
+
- **Document Publishing:** Preview your documentation on the official platform at [docsmith.aigne.io](https://docsmith.aigne.io/app/), or publish to your own [Discuss Kit](https://www.arcblock.io/docs/web3-kit/en/discuss-kit) instance for full control.
|
|
25
25
|
- **Document Update Mechanism:** Automatically detects source code changes and updates documentation accordingly.
|
|
26
26
|
- **Individual Document Optimization:** Regenerate and optimize specific documents with targeted feedback.
|
|
27
27
|
|
|
@@ -29,9 +29,81 @@ As shown in the diagram, DocSmith integrates seamlessly with other [AIGNE](https
|
|
|
29
29
|
|
|
30
30
|
### Prerequisites
|
|
31
31
|
|
|
32
|
-
- Node.js and
|
|
32
|
+
- Node.js and npm
|
|
33
33
|
- AIGNE CLI
|
|
34
34
|
|
|
35
|
+
### Node.js Installation
|
|
36
|
+
|
|
37
|
+
#### Windows
|
|
38
|
+
1. Download Node.js installer from [nodejs.org](https://nodejs.org/)
|
|
39
|
+
2. Run the installer (.msi file)
|
|
40
|
+
3. Follow installation wizard steps
|
|
41
|
+
4. Verify installation: `node --version`
|
|
42
|
+
|
|
43
|
+
#### macOS
|
|
44
|
+
**Option 1: Using Homebrew (Recommended)**
|
|
45
|
+
```bash
|
|
46
|
+
# Install Homebrew if not already installed
|
|
47
|
+
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
|
48
|
+
|
|
49
|
+
# Install Node.js
|
|
50
|
+
brew install node
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
**Option 2: Using the Official Installer**
|
|
54
|
+
1. Download the macOS installer from [nodejs.org](https://nodejs.org/)
|
|
55
|
+
2. Double-click the .pkg file to run the installer
|
|
56
|
+
3. Follow the installation wizard
|
|
57
|
+
4. Verify installation: `node --version`
|
|
58
|
+
|
|
59
|
+
#### Linux
|
|
60
|
+
|
|
61
|
+
**Ubuntu/Debian:**
|
|
62
|
+
```bash
|
|
63
|
+
# Update package index
|
|
64
|
+
sudo apt update
|
|
65
|
+
|
|
66
|
+
# Install Node.js
|
|
67
|
+
sudo apt install nodejs npm
|
|
68
|
+
|
|
69
|
+
# Or install latest LTS version using NodeSource repository
|
|
70
|
+
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
|
|
71
|
+
sudo apt-get install -y nodejs
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
**CentOS/RHEL/Fedora:**
|
|
75
|
+
```bash
|
|
76
|
+
# For CentOS/RHEL
|
|
77
|
+
sudo yum install nodejs npm
|
|
78
|
+
|
|
79
|
+
# For Fedora
|
|
80
|
+
sudo dnf install nodejs npm
|
|
81
|
+
|
|
82
|
+
# Or using NodeSource repository
|
|
83
|
+
curl -fsSL https://rpm.nodesource.com/setup_lts.x | sudo bash -
|
|
84
|
+
sudo yum install nodejs
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
**Using Node Version Manager (nvm) - All Linux Distributions:**
|
|
88
|
+
```bash
|
|
89
|
+
# Install nvm
|
|
90
|
+
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
|
|
91
|
+
|
|
92
|
+
# Restart terminal or run:
|
|
93
|
+
source ~/.bashrc
|
|
94
|
+
|
|
95
|
+
# Install latest LTS Node.js
|
|
96
|
+
nvm install --lts
|
|
97
|
+
nvm use --lts
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
#### Verification
|
|
101
|
+
After installation on any platform, verify Node.js and npm are installed correctly:
|
|
102
|
+
```bash
|
|
103
|
+
node --version
|
|
104
|
+
npm --version
|
|
105
|
+
```
|
|
106
|
+
|
|
35
107
|
### Installation
|
|
36
108
|
|
|
37
109
|
Install the latest version of AIGNE CLI globally:
|
|
@@ -161,7 +233,7 @@ aigne doc publish
|
|
|
161
233
|
|
|
162
234
|
**Interactive Publishing:** When run `aigne doc publish` will present an interactive menu for you to choose between:
|
|
163
235
|
- **Official Platform:** [docsmith.aigne.io](https://docsmith.aigne.io/app/)
|
|
164
|
-
- **
|
|
236
|
+
- **Own Instance:** Your own deployed [Discuss Kit](https://store.blocklet.dev/blocklets/z8ia1WEiBZ7hxURf6LwH21Wpg99vophFwSJdu) instance
|
|
165
237
|
|
|
166
238
|
|
|
167
239
|
|
|
@@ -385,12 +385,18 @@ export function generateYAML(input) {
|
|
|
385
385
|
// Generate comments and structure
|
|
386
386
|
let yaml = "# Project information for documentation publishing\n";
|
|
387
387
|
|
|
388
|
-
// Serialize the project info section safely
|
|
389
|
-
const projectSection = yamlStringify(
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
388
|
+
// Serialize the project info section safely with string quoting
|
|
389
|
+
const projectSection = yamlStringify(
|
|
390
|
+
{
|
|
391
|
+
projectName: config.projectName,
|
|
392
|
+
projectDesc: config.projectDesc,
|
|
393
|
+
projectLogo: config.projectLogo,
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
quotingType: '"',
|
|
397
|
+
defaultStringType: "QUOTE_DOUBLE",
|
|
398
|
+
},
|
|
399
|
+
).trim();
|
|
394
400
|
|
|
395
401
|
yaml += `${projectSection}\n\n`;
|
|
396
402
|
|
package/agents/publish-docs.mjs
CHANGED
|
@@ -5,6 +5,7 @@ import fs from "fs-extra";
|
|
|
5
5
|
|
|
6
6
|
import { getAccessToken } from "../utils/auth-utils.mjs";
|
|
7
7
|
import { DISCUSS_KIT_STORE_URL, TMP_DIR, TMP_DOCS_DIR } from "../utils/constants.mjs";
|
|
8
|
+
import { deploy } from "../utils/deploy.mjs";
|
|
8
9
|
import { beforePublishHook, ensureTmpDir } from "../utils/kroki-utils.mjs";
|
|
9
10
|
import { getGithubRepoUrl, loadConfigFromFile, saveValueToConfig } from "../utils/utils.mjs";
|
|
10
11
|
|
|
@@ -17,6 +18,8 @@ export default async function publishDocs(
|
|
|
17
18
|
// move work dir to tmp-dir
|
|
18
19
|
await ensureTmpDir();
|
|
19
20
|
|
|
21
|
+
const hasDocSmithBaseUrl = !!process.env.DOC_SMITH_BASE_URL;
|
|
22
|
+
|
|
20
23
|
const docsDir = join(".aigne", "doc-smith", TMP_DIR, TMP_DOCS_DIR);
|
|
21
24
|
await fs.rm(docsDir, { recursive: true, force: true });
|
|
22
25
|
await fs.mkdir(docsDir, {
|
|
@@ -42,18 +45,41 @@ export default async function publishDocs(
|
|
|
42
45
|
const isDefaultAppUrl = appUrl === DEFAULT_APP_URL;
|
|
43
46
|
const hasAppUrlInConfig = config?.appUrl;
|
|
44
47
|
|
|
48
|
+
let token = "";
|
|
49
|
+
|
|
45
50
|
if (!useEnvAppUrl && isDefaultAppUrl && !hasAppUrlInConfig) {
|
|
51
|
+
const hasCachedCheckoutId = !!config?.checkoutId;
|
|
46
52
|
const choice = await options.prompts.select({
|
|
47
53
|
message: "Select platform to publish your documents:",
|
|
48
54
|
choices: [
|
|
49
55
|
{
|
|
50
|
-
name:
|
|
56
|
+
name:
|
|
57
|
+
chalk.blue("Publish to docsmith.aigne.io") +
|
|
58
|
+
" - free, but your documents will be publicly accessible, recommended for open-source projects",
|
|
51
59
|
value: "default",
|
|
52
60
|
},
|
|
53
61
|
{
|
|
54
|
-
name: "Publish to your
|
|
62
|
+
name: `${chalk.blue("Publish to your existing website")} - use your current website`,
|
|
55
63
|
value: "custom",
|
|
56
64
|
},
|
|
65
|
+
...(hasCachedCheckoutId && hasDocSmithBaseUrl
|
|
66
|
+
? [
|
|
67
|
+
{
|
|
68
|
+
name:
|
|
69
|
+
chalk.yellow("Continue your previous website setup") +
|
|
70
|
+
" - resume from where you left off",
|
|
71
|
+
value: "new-instance-continue",
|
|
72
|
+
},
|
|
73
|
+
]
|
|
74
|
+
: []),
|
|
75
|
+
...(hasDocSmithBaseUrl
|
|
76
|
+
? [
|
|
77
|
+
{
|
|
78
|
+
name: `${chalk.blue("Publish to a new website")} - we'll help you set up a new website`,
|
|
79
|
+
value: "new-instance",
|
|
80
|
+
},
|
|
81
|
+
]
|
|
82
|
+
: []),
|
|
57
83
|
],
|
|
58
84
|
});
|
|
59
85
|
|
|
@@ -63,7 +89,7 @@ export default async function publishDocs(
|
|
|
63
89
|
`Start here to run your own website:\n${chalk.cyan(DISCUSS_KIT_STORE_URL)}\n`,
|
|
64
90
|
);
|
|
65
91
|
const userInput = await options.prompts.input({
|
|
66
|
-
message: "Please enter your
|
|
92
|
+
message: "Please enter your website URL:",
|
|
67
93
|
validate: (input) => {
|
|
68
94
|
try {
|
|
69
95
|
// Check if input contains protocol, if not, prepend https://
|
|
@@ -77,10 +103,31 @@ export default async function publishDocs(
|
|
|
77
103
|
});
|
|
78
104
|
// Ensure appUrl has protocol
|
|
79
105
|
appUrl = userInput.includes("://") ? userInput : `https://${userInput}`;
|
|
106
|
+
} else if (hasDocSmithBaseUrl && ["new-instance", "new-instance-continue"].includes(choice)) {
|
|
107
|
+
// Deploy a new Discuss Kit service
|
|
108
|
+
try {
|
|
109
|
+
let id = "";
|
|
110
|
+
let paymentUrl = "";
|
|
111
|
+
if (choice === "new-instance-continue") {
|
|
112
|
+
id = config?.checkoutId;
|
|
113
|
+
paymentUrl = config?.paymentUrl;
|
|
114
|
+
console.log(`\nResuming your previous website setup...`);
|
|
115
|
+
} else {
|
|
116
|
+
console.log(`\nCreating a new doc website for your documentation...`);
|
|
117
|
+
}
|
|
118
|
+
const { appUrl: homeUrl, token: ltToken } = (await deploy(id, paymentUrl)) || {};
|
|
119
|
+
|
|
120
|
+
appUrl = homeUrl;
|
|
121
|
+
token = ltToken;
|
|
122
|
+
} catch (error) {
|
|
123
|
+
const errorMsg = error?.message || "Unknown error occurred";
|
|
124
|
+
console.error(`${chalk.red("❌ Failed to publish to website:")} ${errorMsg}`);
|
|
125
|
+
return { message: `❌ Publish failed: ${errorMsg}` };
|
|
126
|
+
}
|
|
80
127
|
}
|
|
81
128
|
}
|
|
82
129
|
|
|
83
|
-
const accessToken = await getAccessToken(appUrl);
|
|
130
|
+
const accessToken = await getAccessToken(appUrl, token);
|
|
84
131
|
|
|
85
132
|
process.env.DOC_ROOT_DIR = docsDir;
|
|
86
133
|
|
|
@@ -138,6 +185,8 @@ export default async function publishDocs(
|
|
|
138
185
|
} catch (error) {
|
|
139
186
|
message = `❌ Failed to publish docs: ${error.message}`;
|
|
140
187
|
}
|
|
188
|
+
saveValueToConfig("checkoutId", "", "Checkout ID for document deployment service");
|
|
189
|
+
|
|
141
190
|
// clean up tmp work dir
|
|
142
191
|
await fs.rm(docsDir, { recursive: true, force: true });
|
|
143
192
|
return message ? { message } : {};
|
package/docs/_sidebar.md
CHANGED
|
@@ -1,16 +1,6 @@
|
|
|
1
|
-
---
|
|
2
|
-
labels: ["Reference"]
|
|
3
|
-
---
|
|
4
|
-
|
|
5
1
|
# How It Works
|
|
6
2
|
|
|
7
|
-
AIGNE DocSmith
|
|
8
|
-
|
|
9
|
-
## Architectural Overview
|
|
10
|
-
|
|
11
|
-
DocSmith is an integral part of the AIGNE ecosystem, a comprehensive platform for AI application development. It seamlessly integrates with other AIGNE components, utilizing the platform's core AI capabilities and infrastructure.
|
|
12
|
-
|
|
13
|
-

|
|
3
|
+
AIGNE DocSmith automates documentation using a multi-agent system. Instead of a single AI model, DocSmith orchestrates a pipeline of specialized AI agents, where each agent is an expert in a specific task. This collaborative approach generates structured and detailed documentation directly from your source code.
|
|
14
4
|
|
|
15
5
|
At its core, DocSmith operates as a pipeline, processing your source code through several distinct stages, each managed by one or more dedicated AI agents.
|
|
16
6
|
|
|
@@ -21,72 +11,77 @@ The entire process, from analyzing your code to publishing the final documents,
|
|
|
21
11
|
```d2
|
|
22
12
|
direction: down
|
|
23
13
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
"Structure Planning": {
|
|
30
|
-
shape: step
|
|
31
|
-
label: "1. Structure Planning"
|
|
14
|
+
Input: {
|
|
15
|
+
label: "Source Code & Config"
|
|
16
|
+
shape: rectangle
|
|
32
17
|
}
|
|
33
18
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
19
|
+
Pipeline: {
|
|
20
|
+
label: "Documentation Generation Pipeline"
|
|
21
|
+
shape: rectangle
|
|
22
|
+
grid-columns: 1
|
|
23
|
+
grid-gap: 40
|
|
24
|
+
|
|
25
|
+
Structure-Planning: {
|
|
26
|
+
label: "1. Structure Planning\n(reflective-structure-planner)"
|
|
27
|
+
shape: rectangle
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
Content-Generation: {
|
|
31
|
+
label: "2. Content Generation\n(content-detail-generator)"
|
|
32
|
+
shape: rectangle
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
Saving: {
|
|
36
|
+
label: "3. Save Documents\n(save-docs)"
|
|
37
|
+
shape: rectangle
|
|
38
|
+
}
|
|
37
39
|
}
|
|
38
40
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
41
|
+
User-Feedback: {
|
|
42
|
+
label: "User Feedback Loop\n(via --feedback flag)"
|
|
43
|
+
shape: rectangle
|
|
42
44
|
}
|
|
43
45
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
46
|
+
Optional-Steps: {
|
|
47
|
+
label: "Optional Steps"
|
|
48
|
+
shape: rectangle
|
|
49
|
+
grid-columns: 2
|
|
50
|
+
grid-gap: 40
|
|
51
|
+
|
|
52
|
+
Translation: {
|
|
53
|
+
label: "Translate\n(aigne doc translate)"
|
|
54
|
+
shape: rectangle
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
Publishing: {
|
|
58
|
+
label: "Publish\n(aigne doc publish)"
|
|
59
|
+
shape: rectangle
|
|
60
|
+
}
|
|
47
61
|
}
|
|
48
62
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
"Publishing": {
|
|
55
|
-
shape: step
|
|
56
|
-
label: "Publishing"
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
"Feedback Loop": {
|
|
60
|
-
shape: callout
|
|
61
|
-
label: "User Feedback Loop"
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
"Source Code & Config" -> "Structure Planning"
|
|
65
|
-
"Structure Planning" -> "Content Generation"
|
|
66
|
-
"Content Generation" -> "Saving & Output"
|
|
67
|
-
"Saving & Output" -> "Optional Processes"
|
|
68
|
-
|
|
69
|
-
"Optional Processes" -> "Translation": "Translate Docs"
|
|
70
|
-
"Optional Processes" -> "Publishing": "Publish Docs"
|
|
71
|
-
|
|
72
|
-
"Structure Planning" <- "Feedback Loop": "Refine Structure"
|
|
73
|
-
"Content Generation" <- "Feedback Loop": "Regenerate Content"
|
|
63
|
+
Input -> Pipeline.Structure-Planning
|
|
64
|
+
Pipeline.Structure-Planning -> Pipeline.Content-Generation
|
|
65
|
+
Pipeline.Content-Generation -> Pipeline.Saving
|
|
66
|
+
Pipeline.Saving -> Optional-Steps
|
|
74
67
|
|
|
68
|
+
User-Feedback -> Pipeline.Structure-Planning: "Refine Structure"
|
|
69
|
+
User-Feedback -> Pipeline.Content-Generation: "Regenerate Content"
|
|
75
70
|
```
|
|
76
71
|
|
|
77
72
|
1. **Input Analysis**: The process begins with agents like `load-sources` and `load-config`, which gather your source code, configuration files (`aigne.yaml`), and any user-defined rules.
|
|
78
73
|
|
|
79
|
-
2. **Structure Planning**: The `reflective-structure-planner` agent analyzes the codebase to propose a
|
|
74
|
+
2. **Structure Planning**: The `reflective-structure-planner` agent analyzes the codebase to propose a logical document structure. It considers your specified target audience, rules, and feedback to create an optimal outline.
|
|
80
75
|
|
|
81
|
-
3. **Content Generation**: Once the structure is
|
|
76
|
+
3. **Content Generation**: Once the structure is defined, the `content-detail-generator` and `batch-docs-detail-generator` agents take over. They populate each section of the document plan with detailed content, ensuring technical accuracy and adherence to the defined style.
|
|
82
77
|
|
|
83
|
-
4. **Refinement and Updates**: If you provide feedback using `aigne doc update` or `aigne doc generate --feedback`, the `detail-regenerator` and `feedback-refiner` agents are activated. They
|
|
78
|
+
4. **Refinement and Updates**: If you provide feedback using `aigne doc update` or `aigne doc generate --feedback`, the `detail-regenerator` and `feedback-refiner` agents are activated. They update specific documents or adjust the overall structure based on your input.
|
|
84
79
|
|
|
85
80
|
5. **Translation and Publishing**: Finally, optional agents like `translate` and `publish-docs` handle multi-language translation and publishing to Discuss Kit platforms, completing the end-to-end workflow.
|
|
86
81
|
|
|
87
82
|
## Key AI Agents
|
|
88
83
|
|
|
89
|
-
DocSmith's
|
|
84
|
+
DocSmith's functionality comes from its team of specialized agents. While many agents work behind the scenes, here are some of the key players in the documentation pipeline:
|
|
90
85
|
|
|
91
86
|
| Agent Role | Primary Function | Governing File(s) |
|
|
92
87
|
|---|---|---|
|
|
@@ -95,10 +90,10 @@ DocSmith's power comes from its team of specialized agents. While many agents wo
|
|
|
95
90
|
| **Translation Agent** | Translates generated documentation into multiple target languages. | `translate.yaml`, `batch-translate.yaml` |
|
|
96
91
|
| **Refinement Agent** | Regenerates or modifies content and structure based on user feedback. | `detail-regenerator.yaml`, `feedback-refiner.yaml` |
|
|
97
92
|
| **Publishing Agent** | Manages the process of publishing documents to Discuss Kit instances. | `publish-docs.mjs`, `team-publish-docs.yaml` |
|
|
98
|
-
| **Configuration Loader** | Reads and interprets the project's configuration
|
|
93
|
+
| **Configuration Loader** | Reads and interprets the project's configuration and source files. | `load-config.mjs`, `load-sources.mjs` |
|
|
99
94
|
|
|
100
|
-
This modular, agent-based architecture makes DocSmith
|
|
95
|
+
This modular, agent-based architecture makes DocSmith flexible and robust, allowing each step of the process to be optimized independently.
|
|
101
96
|
|
|
102
97
|
---
|
|
103
98
|
|
|
104
|
-
Now that you understand the mechanics behind DocSmith, learn about the measures in place to guarantee
|
|
99
|
+
Now that you understand the mechanics behind DocSmith, learn about the measures in place to guarantee output quality in the [Quality Assurance](./advanced-quality-assurance.md) section.
|
|
@@ -1,104 +1,99 @@
|
|
|
1
|
-
---
|
|
2
|
-
labels: ["Reference"]
|
|
3
|
-
---
|
|
4
|
-
|
|
5
1
|
# 工作原理
|
|
6
2
|
|
|
7
|
-
AIGNE DocSmith
|
|
8
|
-
|
|
9
|
-
## 架构概述
|
|
3
|
+
AIGNE DocSmith 使用一个多 Agent 系统来自动化文档生成。DocSmith 不使用单个 AI 模型,而是协调一个由专业化 AI Agent 组成的流水线,其中每个 Agent 都是特定任务的专家。这种协作方法可以直接从您的源代码生成结构化且详细的文档。
|
|
10
4
|
|
|
11
|
-
DocSmith
|
|
12
|
-
|
|
13
|
-

|
|
14
|
-
|
|
15
|
-
DocSmith 的核心是一个处理流水线,它将您的源代码经过几个不同阶段的处理,每个阶段都由一个或多个专用的 AI Agent 管理。
|
|
5
|
+
其核心是,DocSmith 作为一个流水线运行,通过几个不同的阶段处理您的源代码,每个阶段都由一个或多个专用的 AI Agent 管理。
|
|
16
6
|
|
|
17
7
|
## 文档生成流水线
|
|
18
8
|
|
|
19
|
-
|
|
9
|
+
从分析代码到发布最终文档的整个过程,都遵循一个结构化的流水线。这确保了一致性,并允许在任何阶段进行有针对性的优化。
|
|
20
10
|
|
|
21
11
|
```d2
|
|
22
12
|
direction: down
|
|
23
13
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
"Structure Planning": {
|
|
30
|
-
shape: step
|
|
31
|
-
label: "1. 结构规划"
|
|
14
|
+
Input: {
|
|
15
|
+
label: "Source Code & Config"
|
|
16
|
+
shape: rectangle
|
|
32
17
|
}
|
|
33
18
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
19
|
+
Pipeline: {
|
|
20
|
+
label: "Documentation Generation Pipeline"
|
|
21
|
+
shape: rectangle
|
|
22
|
+
grid-columns: 1
|
|
23
|
+
grid-gap: 40
|
|
24
|
+
|
|
25
|
+
Structure-Planning: {
|
|
26
|
+
label: "1. Structure Planning\n(reflective-structure-planner)"
|
|
27
|
+
shape: rectangle
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
Content-Generation: {
|
|
31
|
+
label: "2. Content Generation\n(content-detail-generator)"
|
|
32
|
+
shape: rectangle
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
Saving: {
|
|
36
|
+
label: "3. Save Documents\n(save-docs)"
|
|
37
|
+
shape: rectangle
|
|
38
|
+
}
|
|
37
39
|
}
|
|
38
40
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
41
|
+
User-Feedback: {
|
|
42
|
+
label: "User Feedback Loop\n(via --feedback flag)"
|
|
43
|
+
shape: rectangle
|
|
42
44
|
}
|
|
43
45
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
46
|
+
Optional-Steps: {
|
|
47
|
+
label: "Optional Steps"
|
|
48
|
+
shape: rectangle
|
|
49
|
+
grid-columns: 2
|
|
50
|
+
grid-gap: 40
|
|
51
|
+
|
|
52
|
+
Translation: {
|
|
53
|
+
label: "Translate\n(aigne doc translate)"
|
|
54
|
+
shape: rectangle
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
Publishing: {
|
|
58
|
+
label: "Publish\n(aigne doc publish)"
|
|
59
|
+
shape: rectangle
|
|
60
|
+
}
|
|
47
61
|
}
|
|
48
62
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
"Publishing": {
|
|
55
|
-
shape: step
|
|
56
|
-
label: "发布"
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
"Feedback Loop": {
|
|
60
|
-
shape: callout
|
|
61
|
-
label: "用户反馈循环"
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
"Source Code & Config" -> "Structure Planning"
|
|
65
|
-
"Structure Planning" -> "Content Generation"
|
|
66
|
-
"Content Generation" -> "Saving & Output"
|
|
67
|
-
"Saving & Output" -> "Optional Processes"
|
|
68
|
-
|
|
69
|
-
"Optional Processes" -> "Translation": "翻译文档"
|
|
70
|
-
"Optional Processes" -> "Publishing": "发布文档"
|
|
71
|
-
|
|
72
|
-
"Structure Planning" <- "Feedback Loop": "优化结构"
|
|
73
|
-
"Content Generation" <- "Feedback Loop": "重新生成内容"
|
|
63
|
+
Input -> Pipeline.Structure-Planning
|
|
64
|
+
Pipeline.Structure-Planning -> Pipeline.Content-Generation
|
|
65
|
+
Pipeline.Content-Generation -> Pipeline.Saving
|
|
66
|
+
Pipeline.Saving -> Optional-Steps
|
|
74
67
|
|
|
68
|
+
User-Feedback -> Pipeline.Structure-Planning: "Refine Structure"
|
|
69
|
+
User-Feedback -> Pipeline.Content-Generation: "Regenerate Content"
|
|
75
70
|
```
|
|
76
71
|
|
|
77
|
-
1. **输入分析**:该过程始于 `load-sources` 和 `load-config` 等 Agent
|
|
72
|
+
1. **输入分析**:该过程始于 `load-sources` 和 `load-config` 等 Agent,它们会收集您的源代码、配置文件(`aigne.yaml`)以及任何用户定义的规则。
|
|
78
73
|
|
|
79
|
-
2. **结构规划**:`reflective-structure-planner` Agent
|
|
74
|
+
2. **结构规划**:`reflective-structure-planner` Agent 会分析代码库,以提出一个逻辑化的文档结构。它会考虑您指定的目标受众、规则和反馈,以创建一个最佳大纲。
|
|
80
75
|
|
|
81
|
-
3.
|
|
76
|
+
3. **内容生成**:一旦结构确定,`content-detail-generator` 和 `batch-docs-detail-generator` Agent 就会接管。它们会用详细内容填充文档计划的每个部分,确保技术准确性并遵循定义的风格。
|
|
82
77
|
|
|
83
|
-
4. **优化与更新**:如果您使用 `aigne doc update` 或 `aigne doc generate --feedback` 提供反馈,`detail-regenerator` 和 `feedback-refiner` Agent
|
|
78
|
+
4. **优化与更新**:如果您使用 `aigne doc update` 或 `aigne doc generate --feedback` 提供反馈,`detail-regenerator` 和 `feedback-refiner` Agent 将被激活。它们会根据您的输入更新特定文档或调整整体结构。
|
|
84
79
|
|
|
85
80
|
5. **翻译与发布**:最后,像 `translate` 和 `publish-docs` 这样的可选 Agent 会处理多语言翻译和发布到 Discuss Kit 平台的工作,从而完成端到端的工作流。
|
|
86
81
|
|
|
87
82
|
## 关键 AI Agent
|
|
88
83
|
|
|
89
|
-
DocSmith
|
|
84
|
+
DocSmith 的功能源于其专业化的 Agent 团队。虽然许多 Agent 在幕后工作,但以下是文档生成流水线中的一些关键角色:
|
|
90
85
|
|
|
91
86
|
| Agent 角色 | 主要功能 | 相关文件 |
|
|
92
87
|
|---|---|---|
|
|
93
|
-
|
|
|
94
|
-
|
|
|
88
|
+
| **Structure Planner** | 分析源代码和规则,生成整体文档大纲。 | `structure-planning.yaml`, `reflective-structure-planner.yaml` |
|
|
89
|
+
| **Content Generator** | 根据计划为每个独立的文档部分撰写详细内容。 | `content-detail-generator.yaml`, `batch-docs-detail-generator.yaml` |
|
|
95
90
|
| **Translation Agent** | 将生成的文档翻译成多种目标语言。 | `translate.yaml`, `batch-translate.yaml` |
|
|
96
91
|
| **Refinement Agent** | 根据用户反馈重新生成或修改内容和结构。 | `detail-regenerator.yaml`, `feedback-refiner.yaml` |
|
|
97
92
|
| **Publishing Agent** | 管理将文档发布到 Discuss Kit 实例的过程。 | `publish-docs.mjs`, `team-publish-docs.yaml` |
|
|
98
|
-
|
|
|
93
|
+
| **Configuration Loader** | 读取并解析项目的配置文件和源文件。 | `load-config.mjs`, `load-sources.mjs` |
|
|
99
94
|
|
|
100
|
-
这种模块化的、基于 Agent
|
|
95
|
+
这种模块化的、基于 Agent 的架构使得 DocSmith 灵活而强大,允许流程中的每一步都能被独立优化。
|
|
101
96
|
|
|
102
97
|
---
|
|
103
98
|
|
|
104
|
-
现在您已经了解了 DocSmith
|
|
99
|
+
现在您已经了解了 DocSmith 背后的工作原理,请在 [质量保证](./advanced-quality-assurance.md) 部分了解为保证输出质量而采取的措施。
|