@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
|
@@ -158,7 +158,7 @@ describe("move-document", () => {
|
|
|
158
158
|
expect(result.documentStructure).toEqual(baseDocumentStructure);
|
|
159
159
|
expect(result.originalDocument).toBeUndefined();
|
|
160
160
|
expect(result.updatedDocument).toBeUndefined();
|
|
161
|
-
expect(consoleSpy).toHaveBeenCalledWith("
|
|
161
|
+
expect(consoleSpy).toHaveBeenCalledWith("⚠️ Cannot move document: path: Required");
|
|
162
162
|
});
|
|
163
163
|
|
|
164
164
|
test("should return error when path is empty string", async () => {
|
|
@@ -169,7 +169,7 @@ describe("move-document", () => {
|
|
|
169
169
|
});
|
|
170
170
|
|
|
171
171
|
expect(result.documentStructure).toEqual(baseDocumentStructure);
|
|
172
|
-
expect(consoleSpy).toHaveBeenCalledWith("
|
|
172
|
+
expect(consoleSpy).toHaveBeenCalledWith("⚠️ Cannot move document: path: Path is required");
|
|
173
173
|
});
|
|
174
174
|
|
|
175
175
|
test("should return error when document does not exist", async () => {
|
|
@@ -181,7 +181,7 @@ describe("move-document", () => {
|
|
|
181
181
|
|
|
182
182
|
expect(result.documentStructure).toEqual(baseDocumentStructure);
|
|
183
183
|
expect(consoleSpy).toHaveBeenCalledWith(
|
|
184
|
-
"
|
|
184
|
+
"⚠️ Cannot move document: Document '/nonexistent-document' does not exist. Please select an existing document to move.",
|
|
185
185
|
);
|
|
186
186
|
});
|
|
187
187
|
|
|
@@ -194,7 +194,7 @@ describe("move-document", () => {
|
|
|
194
194
|
|
|
195
195
|
expect(result.documentStructure).toEqual(baseDocumentStructure);
|
|
196
196
|
expect(consoleSpy).toHaveBeenCalledWith(
|
|
197
|
-
"
|
|
197
|
+
"⚠️ Cannot move document: Target parent document '/nonexistent-parent' does not exist. Please select an existing parent document.",
|
|
198
198
|
);
|
|
199
199
|
});
|
|
200
200
|
|
|
@@ -208,7 +208,7 @@ describe("move-document", () => {
|
|
|
208
208
|
|
|
209
209
|
expect(result.documentStructure).toEqual(baseDocumentStructure);
|
|
210
210
|
expect(consoleSpy).toHaveBeenCalledWith(
|
|
211
|
-
"
|
|
211
|
+
"⚠️ Cannot move document: Moving '/api' under '/api/auth' would create an invalid hierarchy. Please select a parent that is not nested under the document being moved.",
|
|
212
212
|
);
|
|
213
213
|
});
|
|
214
214
|
|
|
@@ -221,7 +221,7 @@ describe("move-document", () => {
|
|
|
221
221
|
|
|
222
222
|
expect(result.documentStructure).toEqual(baseDocumentStructure);
|
|
223
223
|
expect(consoleSpy).toHaveBeenCalledWith(
|
|
224
|
-
"
|
|
224
|
+
"⚠️ Cannot move document: Moving '/api' under '/api/auth/oauth' would create an invalid hierarchy. Please select a parent that is not nested under the document being moved.",
|
|
225
225
|
);
|
|
226
226
|
});
|
|
227
227
|
|
|
@@ -278,7 +278,7 @@ describe("move-document", () => {
|
|
|
278
278
|
|
|
279
279
|
expect(result.documentStructure).toEqual(complexStructure);
|
|
280
280
|
expect(consoleSpy).toHaveBeenCalledWith(
|
|
281
|
-
"
|
|
281
|
+
"⚠️ Cannot move document: Moving '/api' under '/api/auth/oauth/scopes' would create an invalid hierarchy. Please select a parent that is not nested under the document being moved.",
|
|
282
282
|
);
|
|
283
283
|
});
|
|
284
284
|
|
|
@@ -326,7 +326,7 @@ describe("move-document", () => {
|
|
|
326
326
|
expect(updatedDoc.parentId).not.toBe(originalDoc.parentId);
|
|
327
327
|
});
|
|
328
328
|
|
|
329
|
-
test("should handle empty
|
|
329
|
+
test("should handle empty documentation structure", async () => {
|
|
330
330
|
const result = await moveDocument({
|
|
331
331
|
documentStructure: [],
|
|
332
332
|
path: "/any-path",
|
|
@@ -335,11 +335,11 @@ describe("move-document", () => {
|
|
|
335
335
|
|
|
336
336
|
expect(result.documentStructure).toEqual([]);
|
|
337
337
|
expect(consoleSpy).toHaveBeenCalledWith(
|
|
338
|
-
"
|
|
338
|
+
"⚠️ Cannot move document: Document '/any-path' does not exist. Please select an existing document to move.",
|
|
339
339
|
);
|
|
340
340
|
});
|
|
341
341
|
|
|
342
|
-
test("should handle single
|
|
342
|
+
test("should handle single documentation structure", async () => {
|
|
343
343
|
const singleDocStructure = [
|
|
344
344
|
{
|
|
345
345
|
title: "Only Document",
|
|
@@ -358,12 +358,12 @@ describe("move-document", () => {
|
|
|
358
358
|
|
|
359
359
|
expect(result.documentStructure).toEqual(singleDocStructure);
|
|
360
360
|
expect(consoleSpy).toHaveBeenCalledWith(
|
|
361
|
-
"
|
|
361
|
+
"⚠️ Cannot move document: Target parent document '/nonexistent' does not exist. Please select an existing parent document.",
|
|
362
362
|
);
|
|
363
363
|
});
|
|
364
364
|
|
|
365
365
|
// DATA INTEGRITY TESTS
|
|
366
|
-
test("should not modify original
|
|
366
|
+
test("should not modify original documentation structure", async () => {
|
|
367
367
|
const originalStructure = [...baseDocumentStructure];
|
|
368
368
|
|
|
369
369
|
await moveDocument({
|
|
@@ -319,7 +319,7 @@ describe("update-document", () => {
|
|
|
319
319
|
expect(consoleSpy).not.toHaveBeenCalled();
|
|
320
320
|
});
|
|
321
321
|
|
|
322
|
-
test("should handle empty
|
|
322
|
+
test("should handle empty documentation structure", async () => {
|
|
323
323
|
const result = await updateDocument({
|
|
324
324
|
documentStructure: [],
|
|
325
325
|
path: "/any-path",
|
|
@@ -332,7 +332,7 @@ describe("update-document", () => {
|
|
|
332
332
|
);
|
|
333
333
|
});
|
|
334
334
|
|
|
335
|
-
test("should handle single
|
|
335
|
+
test("should handle single documentation structure", async () => {
|
|
336
336
|
const singleDocStructure = [
|
|
337
337
|
{
|
|
338
338
|
title: "Only Document",
|
|
@@ -377,7 +377,7 @@ describe("update-document", () => {
|
|
|
377
377
|
});
|
|
378
378
|
|
|
379
379
|
// DATA INTEGRITY TESTS
|
|
380
|
-
test("should not modify original
|
|
380
|
+
test("should not modify original documentation structure", async () => {
|
|
381
381
|
const originalStructure = [...baseDocumentStructure];
|
|
382
382
|
|
|
383
383
|
await updateDocument({
|
|
@@ -49,6 +49,9 @@ describe("user-review-document-structure", () => {
|
|
|
49
49
|
invoke: mock(async () => ({
|
|
50
50
|
documentStructure: documentStructure,
|
|
51
51
|
})),
|
|
52
|
+
userContext: {
|
|
53
|
+
currentStructure: [],
|
|
54
|
+
},
|
|
52
55
|
},
|
|
53
56
|
};
|
|
54
57
|
|
|
@@ -71,13 +74,13 @@ describe("user-review-document-structure", () => {
|
|
|
71
74
|
consoleSpy?.mockRestore();
|
|
72
75
|
});
|
|
73
76
|
|
|
74
|
-
test("should return original structure when no
|
|
77
|
+
test("should return original structure when no documentation structure provided", async () => {
|
|
75
78
|
const result = await userReviewDocumentStructure({}, mockOptions);
|
|
76
79
|
|
|
77
80
|
expect(result).toBeDefined();
|
|
78
81
|
expect(result.documentStructure).toBeUndefined();
|
|
79
82
|
expect(mockOptions.prompts.select).not.toHaveBeenCalled();
|
|
80
|
-
expect(consoleSpy).toHaveBeenCalledWith("No
|
|
83
|
+
expect(consoleSpy).toHaveBeenCalledWith("No documentation structure was generated to review.");
|
|
81
84
|
});
|
|
82
85
|
|
|
83
86
|
test("should return original structure when empty array provided", async () => {
|
|
@@ -86,7 +89,7 @@ describe("user-review-document-structure", () => {
|
|
|
86
89
|
expect(result).toBeDefined();
|
|
87
90
|
expect(result.documentStructure).toEqual([]);
|
|
88
91
|
expect(mockOptions.prompts.select).not.toHaveBeenCalled();
|
|
89
|
-
expect(consoleSpy).toHaveBeenCalledWith("No
|
|
92
|
+
expect(consoleSpy).toHaveBeenCalledWith("No documentation structure was generated to review.");
|
|
90
93
|
});
|
|
91
94
|
|
|
92
95
|
test("should return original structure when user chooses not to review", async () => {
|
|
@@ -110,7 +113,9 @@ describe("user-review-document-structure", () => {
|
|
|
110
113
|
expect(result.documentStructure).toEqual(documentStructure);
|
|
111
114
|
expect(mockOptions.prompts.select).toHaveBeenCalled();
|
|
112
115
|
expect(mockOptions.prompts.input).toHaveBeenCalled();
|
|
113
|
-
expect(consoleSpy).toHaveBeenCalledWith(
|
|
116
|
+
expect(consoleSpy).toHaveBeenCalledWith(
|
|
117
|
+
expect.stringContaining("Current Documentation Structure"),
|
|
118
|
+
);
|
|
114
119
|
});
|
|
115
120
|
|
|
116
121
|
test("should process user feedback and call refineDocumentStructure agent", async () => {
|
|
@@ -130,9 +135,13 @@ describe("user-review-document-structure", () => {
|
|
|
130
135
|
.mockImplementationOnce(async () => feedback)
|
|
131
136
|
.mockImplementationOnce(async () => ""); // Exit loop on second call
|
|
132
137
|
|
|
133
|
-
mockOptions.context.invoke.mockImplementation(async () =>
|
|
134
|
-
|
|
135
|
-
|
|
138
|
+
mockOptions.context.invoke.mockImplementation(async () => {
|
|
139
|
+
// Simulate the agent updating the shared context
|
|
140
|
+
mockOptions.context.userContext.currentStructure = refinedStructure;
|
|
141
|
+
return {
|
|
142
|
+
documentStructure: refinedStructure,
|
|
143
|
+
};
|
|
144
|
+
});
|
|
136
145
|
|
|
137
146
|
const result = await userReviewDocumentStructure({ documentStructure }, mockOptions);
|
|
138
147
|
|
|
@@ -188,7 +197,7 @@ describe("user-review-document-structure", () => {
|
|
|
188
197
|
|
|
189
198
|
expect(result.documentStructure).toEqual(documentStructure);
|
|
190
199
|
expect(consoleSpy).toHaveBeenCalledWith(
|
|
191
|
-
"Unable to process your feedback - the
|
|
200
|
+
"Unable to process your feedback - the documentation structure update feature is unavailable.",
|
|
192
201
|
);
|
|
193
202
|
});
|
|
194
203
|
|
|
@@ -240,11 +249,25 @@ describe("user-review-document-structure", () => {
|
|
|
240
249
|
.mockImplementationOnce(async () => secondFeedback)
|
|
241
250
|
.mockImplementationOnce(async () => ""); // Exit loop
|
|
242
251
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
252
|
+
let invokeCount = 0;
|
|
253
|
+
mockOptions.context.invoke.mockImplementation(async () => {
|
|
254
|
+
invokeCount++;
|
|
255
|
+
if (invokeCount === 1) {
|
|
256
|
+
// refineDocumentStructure 1st call
|
|
257
|
+
mockOptions.context.userContext.currentStructure = firstRefinedStructure;
|
|
258
|
+
return { documentStructure: firstRefinedStructure };
|
|
259
|
+
} else if (invokeCount === 2) {
|
|
260
|
+
// checkFeedbackRefiner 1st call
|
|
261
|
+
return {};
|
|
262
|
+
} else if (invokeCount === 3) {
|
|
263
|
+
// refineDocumentStructure 2nd call
|
|
264
|
+
mockOptions.context.userContext.currentStructure = finalRefinedStructure;
|
|
265
|
+
return { documentStructure: finalRefinedStructure };
|
|
266
|
+
} else {
|
|
267
|
+
// checkFeedbackRefiner 2nd call
|
|
268
|
+
return {};
|
|
269
|
+
}
|
|
270
|
+
});
|
|
248
271
|
|
|
249
272
|
const result = await userReviewDocumentStructure({ documentStructure }, mockOptions);
|
|
250
273
|
|
|
@@ -177,7 +177,7 @@ describe("check-document", () => {
|
|
|
177
177
|
expect(mockOptions.context.invoke).not.toHaveBeenCalled();
|
|
178
178
|
});
|
|
179
179
|
|
|
180
|
-
test("should handle missing original node in
|
|
180
|
+
test("should handle missing original node in documentation structure", async () => {
|
|
181
181
|
accessSpy.mockResolvedValue();
|
|
182
182
|
checkDetailResultSpy.mockResolvedValue({ isApproved: true });
|
|
183
183
|
|