@aigne/doc-smith 0.9.8-alpha.3 → 0.9.8-alpha.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/CLAUDE.md +43 -0
- package/README.md +94 -250
- package/aigne.yaml +5 -146
- package/doc-smith/SKILL.md +117 -0
- package/doc-smith/references/changeset_schema.md +118 -0
- package/doc-smith/references/document_structure_schema.md +139 -0
- package/doc-smith/references/document_update_guide.md +193 -0
- package/doc-smith/references/structure_confirmation_guide.md +133 -0
- package/doc-smith/references/structure_planning_guide.md +146 -0
- package/doc-smith/references/user_intent_guide.md +172 -0
- package/doc-smith.yaml +114 -0
- package/main-system-prompt.md +56 -0
- package/package.json +3 -69
- package/scripts/README.md +90 -0
- package/scripts/install.sh +86 -0
- package/scripts/uninstall.sh +52 -0
- package/CHANGELOG.md +0 -994
- package/LICENSE +0 -93
- package/agentic-agents/common/base-info.md +0 -53
- package/agentic-agents/common/completer.md +0 -54
- package/agentic-agents/common/planner.md +0 -168
- package/agentic-agents/common/worker.md +0 -93
- package/agentic-agents/create/index.yaml +0 -129
- package/agentic-agents/create/objective.md +0 -44
- package/agentic-agents/create/set-custom-prompt.mjs +0 -27
- package/agentic-agents/detail/index.yaml +0 -95
- package/agentic-agents/detail/objective.md +0 -9
- package/agentic-agents/detail/set-custom-prompt.mjs +0 -88
- package/agentic-agents/predict-resources/index.yaml +0 -44
- package/agentic-agents/predict-resources/instructions.md +0 -61
- package/agentic-agents/structure/design-rules.md +0 -39
- package/agentic-agents/structure/index.yaml +0 -86
- package/agentic-agents/structure/objective.md +0 -14
- package/agentic-agents/structure/review-criteria.md +0 -55
- package/agentic-agents/structure/set-custom-prompt.mjs +0 -78
- package/agentic-agents/utils/init-workspace-cache.mjs +0 -171
- package/agentic-agents/utils/load-base-sources.mjs +0 -20
- package/agentic-agents/workspace-cache-sharing-design.md +0 -671
- package/agents/chat/chat-system.md +0 -38
- package/agents/chat/index.mjs +0 -59
- package/agents/chat/skills/generate-document.yaml +0 -15
- package/agents/chat/skills/list-documents.mjs +0 -15
- package/agents/chat/skills/update-document.yaml +0 -24
- package/agents/clear/choose-contents.mjs +0 -192
- package/agents/clear/clear-auth-tokens.mjs +0 -88
- package/agents/clear/clear-deployment-config.mjs +0 -49
- package/agents/clear/clear-document-config.mjs +0 -36
- package/agents/clear/clear-document-structure.mjs +0 -102
- package/agents/clear/clear-generated-docs.mjs +0 -142
- package/agents/clear/clear-media-description.mjs +0 -129
- package/agents/clear/index.yaml +0 -26
- package/agents/create/analyze-diagram-type-llm.yaml +0 -160
- package/agents/create/analyze-diagram-type.mjs +0 -297
- package/agents/create/check-document-structure.yaml +0 -30
- package/agents/create/check-need-generate-structure.mjs +0 -105
- package/agents/create/document-structure-tools/add-document.mjs +0 -85
- package/agents/create/document-structure-tools/delete-document.mjs +0 -116
- package/agents/create/document-structure-tools/move-document.mjs +0 -109
- package/agents/create/document-structure-tools/update-document.mjs +0 -84
- package/agents/create/generate-diagram-image.yaml +0 -60
- package/agents/create/generate-structure.yaml +0 -117
- package/agents/create/index.yaml +0 -49
- package/agents/create/refine-document-structure.yaml +0 -12
- package/agents/create/replace-d2-with-image.mjs +0 -625
- package/agents/create/update-document-structure.yaml +0 -54
- package/agents/create/user-add-document/add-documents-to-structure.mjs +0 -90
- package/agents/create/user-add-document/find-documents-to-add-links.yaml +0 -47
- package/agents/create/user-add-document/index.yaml +0 -46
- package/agents/create/user-add-document/prepare-documents-to-translate.mjs +0 -22
- package/agents/create/user-add-document/print-add-document-summary.mjs +0 -63
- package/agents/create/user-add-document/review-documents-with-new-links.mjs +0 -110
- package/agents/create/user-remove-document/find-documents-with-invalid-links.mjs +0 -78
- package/agents/create/user-remove-document/index.yaml +0 -40
- package/agents/create/user-remove-document/prepare-documents-to-translate.mjs +0 -22
- package/agents/create/user-remove-document/print-remove-document-summary.mjs +0 -53
- package/agents/create/user-remove-document/remove-documents-from-structure.mjs +0 -99
- package/agents/create/user-remove-document/review-documents-with-invalid-links.mjs +0 -115
- package/agents/create/user-review-document-structure.mjs +0 -140
- package/agents/create/utils/init-current-content.mjs +0 -34
- package/agents/create/utils/merge-document-structures.mjs +0 -30
- package/agents/evaluate/code-snippet.mjs +0 -97
- package/agents/evaluate/document-structure.yaml +0 -67
- package/agents/evaluate/document.yaml +0 -82
- package/agents/evaluate/generate-report.mjs +0 -85
- package/agents/evaluate/index.yaml +0 -46
- package/agents/history/index.yaml +0 -6
- package/agents/history/view.mjs +0 -78
- package/agents/init/check.mjs +0 -16
- package/agents/init/index.mjs +0 -275
- package/agents/init/validate.mjs +0 -16
- package/agents/localize/choose-language.mjs +0 -107
- package/agents/localize/index.yaml +0 -58
- package/agents/localize/record-translation-history.mjs +0 -23
- package/agents/localize/translate-document.yaml +0 -24
- package/agents/localize/translate-multilingual.yaml +0 -51
- package/agents/media/batch-generate-media-description.yaml +0 -46
- package/agents/media/generate-media-description.yaml +0 -50
- package/agents/media/load-media-description.mjs +0 -256
- package/agents/prefs/index.mjs +0 -203
- package/agents/publish/index.yaml +0 -26
- package/agents/publish/publish-docs.mjs +0 -356
- package/agents/publish/translate-meta.mjs +0 -103
- package/agents/schema/document-structure-item.yaml +0 -26
- package/agents/schema/document-structure-refine-item.yaml +0 -23
- package/agents/schema/document-structure.yaml +0 -29
- package/agents/update/batch-generate-document.yaml +0 -27
- package/agents/update/batch-update-document.yaml +0 -7
- package/agents/update/check-diagram-flag.mjs +0 -116
- package/agents/update/check-document.mjs +0 -162
- package/agents/update/check-generate-diagram.mjs +0 -106
- package/agents/update/check-sync-image-flag.mjs +0 -55
- package/agents/update/check-update-is-single.mjs +0 -53
- package/agents/update/document-tools/update-document-content.mjs +0 -303
- package/agents/update/generate-diagram.yaml +0 -63
- package/agents/update/generate-document.yaml +0 -70
- package/agents/update/handle-document-update.yaml +0 -103
- package/agents/update/index.yaml +0 -79
- package/agents/update/pre-check-generate-diagram.yaml +0 -44
- package/agents/update/save-and-translate-document.mjs +0 -76
- package/agents/update/sync-images-and-exit.mjs +0 -148
- package/agents/update/update-document-detail.yaml +0 -71
- package/agents/update/update-single/update-single-document-detail.mjs +0 -280
- package/agents/update/update-single-document.yaml +0 -7
- package/agents/update/user-review-document.mjs +0 -272
- package/agents/utils/action-success.mjs +0 -16
- package/agents/utils/analyze-document-feedback-intent.yaml +0 -32
- package/agents/utils/analyze-feedback-intent.mjs +0 -136
- package/agents/utils/analyze-structure-feedback-intent.yaml +0 -29
- package/agents/utils/check-detail-result.mjs +0 -38
- package/agents/utils/check-feedback-refiner.mjs +0 -81
- package/agents/utils/choose-docs.mjs +0 -293
- package/agents/utils/document-icon-generate.yaml +0 -52
- package/agents/utils/document-title-streamline.yaml +0 -48
- package/agents/utils/ensure-document-icons.mjs +0 -129
- package/agents/utils/exit.mjs +0 -6
- package/agents/utils/feedback-refiner.yaml +0 -50
- package/agents/utils/find-item-by-path.mjs +0 -114
- package/agents/utils/find-user-preferences-by-path.mjs +0 -37
- package/agents/utils/format-document-structure.mjs +0 -35
- package/agents/utils/generate-document-or-skip.mjs +0 -41
- package/agents/utils/handle-diagram-operations.mjs +0 -263
- package/agents/utils/load-all-document-content.mjs +0 -30
- package/agents/utils/load-document-all-content.mjs +0 -84
- package/agents/utils/load-sources.mjs +0 -405
- package/agents/utils/map-reasoning-effort-level.mjs +0 -15
- package/agents/utils/post-generate.mjs +0 -144
- package/agents/utils/read-current-document-content.mjs +0 -46
- package/agents/utils/save-doc-translation.mjs +0 -61
- package/agents/utils/save-doc.mjs +0 -88
- package/agents/utils/save-output.mjs +0 -26
- package/agents/utils/save-sidebar.mjs +0 -51
- package/agents/utils/skip-if-content-exists.mjs +0 -27
- package/agents/utils/streamline-document-titles-if-needed.mjs +0 -88
- package/agents/utils/transform-detail-data-sources.mjs +0 -45
- package/agents/utils/update-branding.mjs +0 -84
- package/assets/report-template/report.html +0 -198
- package/docs-mcp/analyze-content-relevance.yaml +0 -50
- package/docs-mcp/analyze-docs-relevance.yaml +0 -59
- package/docs-mcp/docs-search.yaml +0 -42
- package/docs-mcp/get-docs-detail.mjs +0 -41
- package/docs-mcp/get-docs-structure.mjs +0 -16
- package/docs-mcp/read-doc-content.mjs +0 -119
- package/prompts/common/document/content-rules-core.md +0 -20
- package/prompts/common/document/markdown-syntax-rules.md +0 -65
- package/prompts/common/document/media-file-list-usage-rules.md +0 -18
- package/prompts/common/document/openapi-usage-rules.md +0 -189
- package/prompts/common/document/role-and-personality.md +0 -16
- package/prompts/common/document/user-preferences.md +0 -9
- package/prompts/common/document-structure/conflict-resolution-guidance.md +0 -16
- package/prompts/common/document-structure/document-icon-generate.md +0 -116
- package/prompts/common/document-structure/document-structure-rules.md +0 -43
- package/prompts/common/document-structure/document-title-streamline.md +0 -86
- package/prompts/common/document-structure/glossary.md +0 -7
- package/prompts/common/document-structure/intj-traits.md +0 -5
- package/prompts/common/document-structure/openapi-usage-rules.md +0 -28
- package/prompts/common/document-structure/output-constraints.md +0 -18
- package/prompts/common/document-structure/user-locale-rules.md +0 -10
- package/prompts/common/document-structure/user-preferences.md +0 -9
- package/prompts/detail/custom/admonition-usage-rules.md +0 -94
- package/prompts/detail/custom/code-block-usage-rules.md +0 -163
- package/prompts/detail/custom/custom-components/x-card-usage-rules.md +0 -63
- package/prompts/detail/custom/custom-components/x-cards-usage-rules.md +0 -83
- package/prompts/detail/custom/custom-components/x-field-desc-usage-rules.md +0 -120
- package/prompts/detail/custom/custom-components/x-field-group-usage-rules.md +0 -80
- package/prompts/detail/custom/custom-components/x-field-usage-rules.md +0 -189
- package/prompts/detail/custom/custom-components-usage-rules.md +0 -18
- package/prompts/detail/diagram/generate-image-system.md +0 -135
- package/prompts/detail/diagram/generate-image-user.md +0 -32
- package/prompts/detail/diagram/guide.md +0 -29
- package/prompts/detail/diagram/official-examples.md +0 -712
- package/prompts/detail/diagram/pre-check.md +0 -23
- package/prompts/detail/diagram/role-and-personality.md +0 -2
- package/prompts/detail/diagram/rules.md +0 -46
- package/prompts/detail/diagram/system-prompt.md +0 -1139
- package/prompts/detail/diagram/user-prompt.md +0 -43
- package/prompts/detail/generate/detail-example.md +0 -457
- package/prompts/detail/generate/document-rules.md +0 -45
- package/prompts/detail/generate/system-prompt.md +0 -61
- package/prompts/detail/generate/user-prompt.md +0 -99
- package/prompts/detail/jsx/rules.md +0 -6
- package/prompts/detail/update/system-prompt.md +0 -121
- package/prompts/detail/update/user-prompt.md +0 -41
- package/prompts/evaluate/document-structure.md +0 -93
- package/prompts/evaluate/document.md +0 -149
- package/prompts/media/media-description/system-prompt.md +0 -43
- package/prompts/media/media-description/user-prompt.md +0 -17
- package/prompts/structure/check-document-structure.md +0 -93
- package/prompts/structure/document-rules.md +0 -21
- package/prompts/structure/find-documents-to-add-links.md +0 -52
- package/prompts/structure/generate/system-prompt.md +0 -13
- package/prompts/structure/generate/user-prompt.md +0 -137
- package/prompts/structure/review/structure-review-system.md +0 -81
- package/prompts/structure/structure-example.md +0 -89
- package/prompts/structure/structure-getting-started.md +0 -10
- package/prompts/structure/update/system-prompt.md +0 -93
- package/prompts/structure/update/user-prompt.md +0 -43
- package/prompts/translate/admonition.md +0 -20
- package/prompts/translate/code-block.md +0 -33
- package/prompts/translate/glossary.md +0 -6
- package/prompts/translate/translate-document.md +0 -305
- package/prompts/utils/analyze-document-feedback-intent.md +0 -54
- package/prompts/utils/analyze-structure-feedback-intent.md +0 -43
- package/prompts/utils/feedback-refiner.md +0 -105
- package/types/document-schema.mjs +0 -55
- package/types/document-structure-schema.mjs +0 -261
- package/utils/auth-utils.mjs +0 -275
- package/utils/blocklet.mjs +0 -104
- package/utils/check-document-has-diagram.mjs +0 -95
- package/utils/conflict-detector.mjs +0 -149
- package/utils/constants/index.mjs +0 -620
- package/utils/constants/linter.mjs +0 -102
- package/utils/d2-utils.mjs +0 -198
- package/utils/debug.mjs +0 -3
- package/utils/delete-diagram-images.mjs +0 -99
- package/utils/deploy.mjs +0 -86
- package/utils/docs-finder-utils.mjs +0 -623
- package/utils/evaluate/report-utils.mjs +0 -132
- package/utils/extract-api.mjs +0 -32
- package/utils/file-utils.mjs +0 -960
- package/utils/history-utils.mjs +0 -203
- package/utils/icon-map.mjs +0 -26
- package/utils/image-compress.mjs +0 -75
- package/utils/kroki-utils.mjs +0 -173
- package/utils/linter/index.mjs +0 -50
- package/utils/load-config.mjs +0 -107
- package/utils/markdown/index.mjs +0 -26
- package/utils/markdown-checker.mjs +0 -694
- package/utils/mermaid-validator.mjs +0 -140
- package/utils/mermaid-worker-pool.mjs +0 -250
- package/utils/mermaid-worker.mjs +0 -233
- package/utils/openapi/index.mjs +0 -28
- package/utils/preferences-utils.mjs +0 -175
- package/utils/request.mjs +0 -10
- package/utils/store/index.mjs +0 -45
- package/utils/sync-diagram-to-translations.mjs +0 -262
- package/utils/upload-files.mjs +0 -231
- package/utils/utils.mjs +0 -1354
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getMoveDocumentInputJsonSchema,
|
|
3
|
-
getMoveDocumentOutputJsonSchema,
|
|
4
|
-
validateMoveDocumentInput,
|
|
5
|
-
} from "../../../types/document-structure-schema.mjs";
|
|
6
|
-
|
|
7
|
-
export default async function moveDocument(input, options) {
|
|
8
|
-
// Validate input using Zod schema
|
|
9
|
-
const validation = validateMoveDocumentInput(input);
|
|
10
|
-
if (!validation.success) {
|
|
11
|
-
const errorMessage = `Cannot move document: ${validation.error}`;
|
|
12
|
-
console.log(`⚠️ ${errorMessage}`);
|
|
13
|
-
return {
|
|
14
|
-
documentStructure: input.documentStructure,
|
|
15
|
-
error: { message: errorMessage },
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const { path, newParentId } = validation.data;
|
|
20
|
-
let documentStructure = options?.context?.userContext?.currentStructure;
|
|
21
|
-
|
|
22
|
-
if (!documentStructure) {
|
|
23
|
-
documentStructure = input.documentStructure;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// Find the document to move
|
|
27
|
-
const documentIndex = documentStructure.findIndex((item) => item.path === path);
|
|
28
|
-
if (documentIndex === -1) {
|
|
29
|
-
const errorMessage = `Cannot move document: Document '${path}' does not exist. Please select an existing document to move.`;
|
|
30
|
-
console.log(`⚠️ ${errorMessage}`);
|
|
31
|
-
return {
|
|
32
|
-
documentStructure,
|
|
33
|
-
error: { message: errorMessage },
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
const documentToMove = documentStructure[documentIndex];
|
|
38
|
-
|
|
39
|
-
// Validate new parent exists if newParentId is provided
|
|
40
|
-
if (
|
|
41
|
-
newParentId !== null &&
|
|
42
|
-
newParentId !== undefined &&
|
|
43
|
-
newParentId !== "null" &&
|
|
44
|
-
newParentId !== ""
|
|
45
|
-
) {
|
|
46
|
-
const newParentExists = documentStructure.some((item) => item.path === newParentId);
|
|
47
|
-
if (!newParentExists) {
|
|
48
|
-
const errorMessage = `Cannot move document: Target parent document '${newParentId}' does not exist. Please select an existing parent document.`;
|
|
49
|
-
console.log(`⚠️ ${errorMessage}`);
|
|
50
|
-
return {
|
|
51
|
-
documentStructure,
|
|
52
|
-
error: { message: errorMessage },
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
// Check for circular dependency: the new parent cannot be a descendant of the document being moved
|
|
57
|
-
const isDescendant = (parentPath, childPath) => {
|
|
58
|
-
const children = documentStructure.filter((item) => item.parentId === parentPath);
|
|
59
|
-
for (const child of children) {
|
|
60
|
-
if (child.path === childPath || isDescendant(child.path, childPath)) {
|
|
61
|
-
return true;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
return false;
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
if (isDescendant(path, newParentId)) {
|
|
68
|
-
const errorMessage = `Cannot move document: Moving '${path}' under '${newParentId}' would create an invalid hierarchy. Please select a parent that is not nested under the document being moved.`;
|
|
69
|
-
console.log(`⚠️ ${errorMessage}`);
|
|
70
|
-
return {
|
|
71
|
-
documentStructure,
|
|
72
|
-
error: { message: errorMessage },
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
// Create updated document object with new parent
|
|
78
|
-
const updatedDocument = {
|
|
79
|
-
...documentToMove,
|
|
80
|
-
parentId: newParentId || null,
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
// Update the document's position in the structure
|
|
84
|
-
const updatedStructure = [...documentStructure];
|
|
85
|
-
updatedStructure[documentIndex] = updatedDocument;
|
|
86
|
-
|
|
87
|
-
const newParentText = newParentId ? `'${newParentId}'` : "root level";
|
|
88
|
-
const successMessage = `moveDocument executed successfully.
|
|
89
|
-
Successfully moved document '${documentToMove.title}' to ${newParentText}.
|
|
90
|
-
Check if the latest version of documentStructure meets user feedback, if so, just return 'success'.`;
|
|
91
|
-
|
|
92
|
-
// update shared document structure
|
|
93
|
-
if (options?.context?.userContext) {
|
|
94
|
-
options.context.userContext.currentStructure = updatedStructure;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
return {
|
|
98
|
-
documentStructure: updatedStructure,
|
|
99
|
-
message: successMessage,
|
|
100
|
-
originalDocument: documentToMove,
|
|
101
|
-
updatedDocument: updatedDocument,
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
moveDocument.taskTitle = "Move document";
|
|
106
|
-
moveDocument.description =
|
|
107
|
-
"Relocate a document to a different parent in the documentation structure";
|
|
108
|
-
moveDocument.inputSchema = getMoveDocumentInputJsonSchema();
|
|
109
|
-
moveDocument.outputSchema = getMoveDocumentOutputJsonSchema();
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getUpdateDocumentInputJsonSchema,
|
|
3
|
-
getUpdateDocumentOutputJsonSchema,
|
|
4
|
-
validateUpdateDocumentInput,
|
|
5
|
-
} from "../../../types/document-structure-schema.mjs";
|
|
6
|
-
import streamlineDocumentTitlesIfNeeded from "../../utils/streamline-document-titles-if-needed.mjs";
|
|
7
|
-
|
|
8
|
-
export default async function updateDocument(input, options) {
|
|
9
|
-
// Validate input using Zod schema
|
|
10
|
-
const validation = validateUpdateDocumentInput(input);
|
|
11
|
-
if (!validation.success) {
|
|
12
|
-
const errorMessage = `Cannot update document: ${validation.error}`;
|
|
13
|
-
console.log(`⚠️ ${errorMessage}`);
|
|
14
|
-
return {
|
|
15
|
-
documentStructure: input.documentStructure,
|
|
16
|
-
error: { message: errorMessage },
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
const { path, title, description, sourceIds } = validation.data;
|
|
21
|
-
let documentStructure = options?.context?.userContext?.currentStructure;
|
|
22
|
-
|
|
23
|
-
if (!documentStructure) {
|
|
24
|
-
documentStructure = input.documentStructure;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// Find the document to update
|
|
28
|
-
const documentIndex = documentStructure.findIndex((item) => item.path === path);
|
|
29
|
-
if (documentIndex === -1) {
|
|
30
|
-
const errorMessage = `Cannot update document: Document '${path}' does not exist. Choose an existing document to update.`;
|
|
31
|
-
console.log(`⚠️ ${errorMessage}`);
|
|
32
|
-
return {
|
|
33
|
-
documentStructure,
|
|
34
|
-
error: { message: errorMessage },
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
const originalDocument = documentStructure[documentIndex];
|
|
39
|
-
|
|
40
|
-
// Create updated document object
|
|
41
|
-
const updatedDocument = {
|
|
42
|
-
...originalDocument,
|
|
43
|
-
...(title !== undefined && { title }),
|
|
44
|
-
...(description !== undefined && { description }),
|
|
45
|
-
...(sourceIds !== undefined && { sourceIds: [...sourceIds] }), // Create a copy of the array
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
if (!options.context.userContext.streamlinedDocumentTitles) {
|
|
49
|
-
// Streamline document titles if needed (will streamline the updated document if title > 18 characters)
|
|
50
|
-
await streamlineDocumentTitlesIfNeeded({ documentStructure: [updatedDocument] }, options);
|
|
51
|
-
options.context.userContext.streamlinedDocumentTitles = true;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
// Update the document in the structure
|
|
55
|
-
const updatedStructure = [...documentStructure];
|
|
56
|
-
updatedStructure[documentIndex] = updatedDocument;
|
|
57
|
-
|
|
58
|
-
const updates = [];
|
|
59
|
-
if (title !== undefined) updates.push(`title to '${title}'`);
|
|
60
|
-
if (description !== undefined) updates.push("description");
|
|
61
|
-
if (sourceIds !== undefined) updates.push("sourceIds");
|
|
62
|
-
const updatesText = updates.length > 0 ? updates.join(", ") : "properties";
|
|
63
|
-
|
|
64
|
-
const successMessage = `updateDocument executed successfully.
|
|
65
|
-
Successfully updated ${updatesText} for document '${path}'.
|
|
66
|
-
Check if the latest version of documentStructure meets user feedback, if so, just return 'success'.`;
|
|
67
|
-
|
|
68
|
-
// update shared document structure
|
|
69
|
-
if (options?.context?.userContext) {
|
|
70
|
-
options.context.userContext.currentStructure = updatedStructure;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
return {
|
|
74
|
-
documentStructure: updatedStructure,
|
|
75
|
-
message: successMessage,
|
|
76
|
-
originalDocument: originalDocument,
|
|
77
|
-
updatedDocument: updatedDocument,
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
updateDocument.taskTitle = "Update document";
|
|
82
|
-
updateDocument.description = "Modify properties of a document in the documentation structure";
|
|
83
|
-
updateDocument.inputSchema = getUpdateDocumentInputJsonSchema();
|
|
84
|
-
updateDocument.outputSchema = getUpdateDocumentOutputJsonSchema();
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
type: image
|
|
2
|
-
name: generateDiagramImage
|
|
3
|
-
image_model:
|
|
4
|
-
model: google/gemini-3-pro-image-preview
|
|
5
|
-
# The cues that come with thought patterns are actually not obvious
|
|
6
|
-
# thinkingConfig:
|
|
7
|
-
# includeThoughts: true
|
|
8
|
-
# responseModalities:
|
|
9
|
-
# - 'TEXT'
|
|
10
|
-
# - 'IMAGE'
|
|
11
|
-
imageConfig:
|
|
12
|
-
imageSize:
|
|
13
|
-
$get: size
|
|
14
|
-
aspectRatio:
|
|
15
|
-
$get: ratio
|
|
16
|
-
|
|
17
|
-
instructions:
|
|
18
|
-
- role: system
|
|
19
|
-
url: ../../prompts/detail/diagram/generate-image-system.md
|
|
20
|
-
- role: user
|
|
21
|
-
url: ../../prompts/detail/diagram/generate-image-user.md
|
|
22
|
-
|
|
23
|
-
input_schema:
|
|
24
|
-
type: object
|
|
25
|
-
properties:
|
|
26
|
-
documentContent:
|
|
27
|
-
type: string
|
|
28
|
-
description: The full original document content
|
|
29
|
-
documentSummary:
|
|
30
|
-
type: string
|
|
31
|
-
description: A comprehensive summary of the document content for diagram generation (preferred over documentContent if available)
|
|
32
|
-
diagramType:
|
|
33
|
-
type: string
|
|
34
|
-
description: The type of diagram to generate (architecture, flowchart, guide, intro, sequence, network)
|
|
35
|
-
diagramStyle:
|
|
36
|
-
type: string
|
|
37
|
-
description: The visual style for the diagram (modern, standard, hand-drawn, anthropomorphic, flat, minimalist, 3d)
|
|
38
|
-
locale:
|
|
39
|
-
type: string
|
|
40
|
-
description: Language for diagram labels
|
|
41
|
-
default: en
|
|
42
|
-
size:
|
|
43
|
-
type: string
|
|
44
|
-
description: Size of the generated image (e.g., "1K", "2K")
|
|
45
|
-
default: "1K"
|
|
46
|
-
ratio:
|
|
47
|
-
type: string
|
|
48
|
-
description: Aspect ratio of the generated image (must match content flow direction)
|
|
49
|
-
enum: ["1:1", "5:4", "4:3", "3:2", "16:9", "21:9"]
|
|
50
|
-
aspectRatio:
|
|
51
|
-
type: string
|
|
52
|
-
description: Aspect ratio of the generated image (alias for ratio, used in prompt templates)
|
|
53
|
-
enum: ["1:1", "5:4", "4:3", "3:2", "16:9", "21:9"]
|
|
54
|
-
required:
|
|
55
|
-
- documentContent
|
|
56
|
-
- diagramType
|
|
57
|
-
- diagramStyle
|
|
58
|
-
- ratio
|
|
59
|
-
include_input_in_output: true
|
|
60
|
-
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
type: team
|
|
2
|
-
name: generateStructure
|
|
3
|
-
description: Generate the structure and organization of your documentation
|
|
4
|
-
skills:
|
|
5
|
-
- type: team
|
|
6
|
-
name: generateStructureWorker
|
|
7
|
-
iterate_on: dataSources
|
|
8
|
-
skills:
|
|
9
|
-
- type: ai
|
|
10
|
-
instructions:
|
|
11
|
-
- role: system
|
|
12
|
-
url: ../../prompts/structure/generate/system-prompt.md
|
|
13
|
-
- role: user
|
|
14
|
-
url: ../../prompts/structure/generate/user-prompt.md
|
|
15
|
-
task_render_mode: collapse
|
|
16
|
-
task_title: Generate the structure of the documentation
|
|
17
|
-
tool_calls_concurrency: 5
|
|
18
|
-
input_schema:
|
|
19
|
-
type: object
|
|
20
|
-
properties:
|
|
21
|
-
rules:
|
|
22
|
-
type: string
|
|
23
|
-
description: Your specific requirements for documentation structure
|
|
24
|
-
locale:
|
|
25
|
-
type: string
|
|
26
|
-
description: Primary language for documentation (e.g., zh, en, ja)
|
|
27
|
-
dataSourceChunk:
|
|
28
|
-
type: string
|
|
29
|
-
description: Project content and context to help generate documentation structure
|
|
30
|
-
targetAudience:
|
|
31
|
-
type: string
|
|
32
|
-
description: Target audience for the documentation
|
|
33
|
-
nodeName:
|
|
34
|
-
type: string
|
|
35
|
-
description: Specific section or page name to focus on
|
|
36
|
-
glossary:
|
|
37
|
-
type: string
|
|
38
|
-
description: Glossary for consistent terminology
|
|
39
|
-
feedback:
|
|
40
|
-
type: string
|
|
41
|
-
description: Tell us how to improve the documentation structure
|
|
42
|
-
userPreferences:
|
|
43
|
-
type: string
|
|
44
|
-
description: Your saved preferences for structure and documentation style
|
|
45
|
-
docsType:
|
|
46
|
-
type: string
|
|
47
|
-
description: "Documentation type (options: general, getting-started, reference, faq)"
|
|
48
|
-
default: general
|
|
49
|
-
required:
|
|
50
|
-
- rules
|
|
51
|
-
- dataSourceChunk
|
|
52
|
-
output_schema:
|
|
53
|
-
type: object
|
|
54
|
-
properties:
|
|
55
|
-
projectName:
|
|
56
|
-
type: string
|
|
57
|
-
description: Project name identified from your content sources. Max 40 characters (any language, each character = 1). Leading/trailing spaces removed. Generate complete name within limit.
|
|
58
|
-
projectDesc:
|
|
59
|
-
type: string
|
|
60
|
-
description: Brief project description from content analysis. Max 160 characters (any language, each character = 1). Leading/trailing spaces removed. Generate complete description within limit.
|
|
61
|
-
structures:
|
|
62
|
-
type: array
|
|
63
|
-
description: List of document structure items to add or update
|
|
64
|
-
items: ../schema/document-structure-item.yaml
|
|
65
|
-
|
|
66
|
-
- ./utils/merge-document-structures.mjs
|
|
67
|
-
|
|
68
|
-
- type: function
|
|
69
|
-
name: aggregateDocumentStructure
|
|
70
|
-
process: |
|
|
71
|
-
return {
|
|
72
|
-
documentStructure: options.context.userContext.originalDocumentStructure.map((i, index) => ({
|
|
73
|
-
...i,
|
|
74
|
-
id: i.title.toLowerCase().replace(/\s+/g, '-'),
|
|
75
|
-
index
|
|
76
|
-
})),
|
|
77
|
-
projectName: options.context.userContext.projectName,
|
|
78
|
-
projectDesc: options.context.userContext.projectDesc,
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
- type: ai
|
|
82
|
-
name: refineStructure
|
|
83
|
-
instructions:
|
|
84
|
-
- role: system
|
|
85
|
-
url: ../../prompts/structure/review/structure-review-system.md
|
|
86
|
-
output_schema:
|
|
87
|
-
type: object
|
|
88
|
-
properties:
|
|
89
|
-
structures:
|
|
90
|
-
type: array
|
|
91
|
-
description: Document structure items that need to be updated or changed
|
|
92
|
-
items: ../schema/document-structure-refine-item.yaml
|
|
93
|
-
required:
|
|
94
|
-
- structures
|
|
95
|
-
|
|
96
|
-
- type: function
|
|
97
|
-
name: finalizeDocumentStructure
|
|
98
|
-
process: |
|
|
99
|
-
return {
|
|
100
|
-
projectName: input.projectName,
|
|
101
|
-
projectDesc: input.projectDesc,
|
|
102
|
-
documentStructure: input.structures.map(refinedItem => {
|
|
103
|
-
// Find original item to get sourceIds and other fields
|
|
104
|
-
const originalItem = input.documentStructure.find(orig => orig.id === refinedItem.id)
|
|
105
|
-
|
|
106
|
-
const newItem = {
|
|
107
|
-
title: refinedItem.title,
|
|
108
|
-
description: refinedItem.description,
|
|
109
|
-
path: refinedItem.path,
|
|
110
|
-
parentId: refinedItem.parentPath || null, // Convert parentPath to parentId
|
|
111
|
-
sourceIds: originalItem?.sourceIds || [],
|
|
112
|
-
...(refinedItem.icon && { icon: refinedItem.icon }), // Preserve icon if updated during refinement
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
return newItem
|
|
116
|
-
})
|
|
117
|
-
}
|
package/agents/create/index.yaml
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
type: team
|
|
2
|
-
name: create
|
|
3
|
-
alias:
|
|
4
|
-
- generate
|
|
5
|
-
- gen
|
|
6
|
-
description: Create complete documentation for your project
|
|
7
|
-
skills:
|
|
8
|
-
- url: ../init/index.mjs
|
|
9
|
-
default_input:
|
|
10
|
-
skipIfExists: true
|
|
11
|
-
# - ../../agentic-agents/structure/index.yaml
|
|
12
|
-
- ../utils/load-sources.mjs
|
|
13
|
-
- ./check-need-generate-structure.mjs
|
|
14
|
-
- url: ../utils/save-output.mjs
|
|
15
|
-
default_input:
|
|
16
|
-
saveKey: documentStructure
|
|
17
|
-
savePath:
|
|
18
|
-
$get: outputDir
|
|
19
|
-
fileName: structure-plan.json
|
|
20
|
-
- ./user-review-document-structure.mjs
|
|
21
|
-
- url: ../utils/save-output.mjs
|
|
22
|
-
default_input:
|
|
23
|
-
saveKey: documentStructure
|
|
24
|
-
savePath:
|
|
25
|
-
$get: outputDir
|
|
26
|
-
fileName: structure-plan.json
|
|
27
|
-
- ../utils/save-sidebar.mjs
|
|
28
|
-
- ../utils/ensure-document-icons.mjs
|
|
29
|
-
- ../utils/format-document-structure.mjs
|
|
30
|
-
- ../media/load-media-description.mjs
|
|
31
|
-
- ../update/batch-generate-document.yaml
|
|
32
|
-
- url: ../utils/check-feedback-refiner.mjs
|
|
33
|
-
default_input:
|
|
34
|
-
stage: document_structure
|
|
35
|
-
- ../utils/post-generate.mjs
|
|
36
|
-
|
|
37
|
-
input_schema:
|
|
38
|
-
type: object
|
|
39
|
-
properties:
|
|
40
|
-
feedback:
|
|
41
|
-
type: string
|
|
42
|
-
description: User feedback describing what documentation tasks to perform (natural language)
|
|
43
|
-
# glossary:
|
|
44
|
-
# type: string
|
|
45
|
-
# description: Glossary file for consistent terminology (use @filename.md)
|
|
46
|
-
# forceRegenerate:
|
|
47
|
-
# type: boolean
|
|
48
|
-
# description: Rebuild all documentation from scratch
|
|
49
|
-
mode: sequential
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
type: team
|
|
2
|
-
name: refineDocumentStructure
|
|
3
|
-
description: A team of agents that generate the structure of the documentation.
|
|
4
|
-
skills:
|
|
5
|
-
- generate-structure.yaml
|
|
6
|
-
task_title: Generate the structure of the documentation
|
|
7
|
-
task_render_mode: collapse
|
|
8
|
-
reflection:
|
|
9
|
-
reviewer: check-document-structure.yaml
|
|
10
|
-
is_approved: isValid
|
|
11
|
-
max_iterations: 3
|
|
12
|
-
return_last_on_max_iterations: true
|