@aigne/doc-smith 0.9.10 → 0.9.11-beta
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/CHANGELOG.md +12 -0
- package/README.md +189 -219
- package/README.zh.md +270 -0
- package/agents/bash-executor/index.mjs +347 -0
- package/agents/clear/ai/intent.md +142 -0
- package/agents/clear/choose-contents.mjs +13 -65
- package/agents/clear/clear-auth-tokens.mjs +17 -21
- package/agents/clear/clear-deployment-config.mjs +33 -24
- package/agents/clear/index.yaml +1 -9
- package/agents/content-checker/ai/intent.md +209 -0
- package/agents/content-checker/clean-invalid-docs.mjs +254 -0
- package/agents/content-checker/index.mjs +191 -0
- package/agents/content-checker/validate-content.mjs +983 -0
- package/agents/generate-images/generate-image.yaml +75 -0
- package/agents/generate-images/generate-summary.mjs +213 -0
- package/agents/generate-images/index.yaml +39 -0
- package/agents/generate-images/prepare-generation.mjs +286 -0
- package/agents/generate-images/prepare-image-generation.mjs +130 -0
- package/{prompts/detail/diagram/generate-image-system.md → agents/generate-images/prompts/system.md} +22 -56
- package/agents/generate-images/prompts/user.md +85 -0
- package/agents/generate-images/save-image-result.mjs +247 -0
- package/agents/generate-images/scan-image-slots.mjs +247 -0
- package/agents/localize/index.yaml +19 -42
- package/{prompts/translate → agents/localize/prompts}/translate-document.md +0 -139
- package/agents/localize/translate-documents/generate-summary.mjs +163 -0
- package/agents/localize/translate-documents/load-glossary.mjs +52 -0
- package/agents/localize/translate-documents/prepare-translation.mjs +249 -0
- package/agents/localize/translate-documents/save-translation.mjs +171 -0
- package/agents/localize/translate-documents/translate-document-to-language.mjs +209 -0
- package/agents/localize/translate-documents/translate-document.yaml +23 -0
- package/agents/localize/translate-documents/translate-to-languages.yaml +10 -0
- package/agents/localize/translate-images/check-image-translation.mjs +225 -0
- package/agents/localize/translate-images/detect-text/detect-and-update-shared.mjs +148 -0
- package/agents/localize/translate-images/detect-text/detect-image-text.yaml +44 -0
- package/agents/localize/translate-images/detect-text/detect-images-text.yaml +21 -0
- package/agents/localize/translate-images/detect-text/prompts/detect-image-text-system.md +43 -0
- package/agents/localize/translate-images/detect-text/prompts/detect-image-text-user.md +14 -0
- package/agents/localize/translate-images/detect-text/save-text-detection.mjs +105 -0
- package/agents/localize/translate-images/prepare-image-input.mjs +124 -0
- package/agents/localize/translate-images/save-image-translation.mjs +172 -0
- package/agents/localize/translate-images/scan-doc-images.mjs +165 -0
- package/agents/localize/translate-images/translate-doc-images.yaml +24 -0
- package/agents/localize/{translate-diagram.yaml → translate-images/translate-image.yaml} +25 -14
- package/agents/publish/ai/intent.md +182 -0
- package/agents/publish/check.mjs +107 -0
- package/agents/publish/index.yaml +9 -14
- package/agents/publish/publish-docs.mjs +81 -61
- package/agents/publish/translate-meta.mjs +79 -58
- package/agents/save-document/index.mjs +260 -0
- package/agents/structure-checker/index.mjs +307 -0
- package/agents/structure-checker/validate-structure.mjs +477 -0
- package/agents/update-image/analyze-feedback.yaml +37 -0
- package/agents/update-image/index.yaml +78 -0
- package/agents/update-image/load-existing-image.mjs +211 -0
- package/agents/update-image/prompts/analyze-feedback-system.md +43 -0
- package/agents/update-image/prompts/analyze-feedback-user.md +15 -0
- package/aigne.yaml +26 -139
- package/package.json +16 -48
- package/scripts/README.md +90 -0
- package/scripts/install.sh +86 -0
- package/scripts/uninstall.sh +52 -0
- package/skills/doc-smith/SKILL.md +285 -0
- package/skills/doc-smith/ai/intent/sources-improve.md +290 -0
- package/skills/doc-smith/references/changeset-guide.md +171 -0
- package/skills/doc-smith/references/document-content-guide.md +214 -0
- package/skills/doc-smith/references/document-structure-schema.md +138 -0
- package/skills/doc-smith/references/patch-guide.md +96 -0
- package/skills/doc-smith/references/structure-confirmation-guide.md +133 -0
- package/skills/doc-smith/references/structure-planning-guide.md +149 -0
- package/skills/doc-smith/references/update-workflow.md +108 -0
- package/skills/doc-smith/references/user-intent-guide.md +175 -0
- package/skills/doc-smith/references/workspace-initialization.md +376 -0
- package/skills/doc-smith-docs-detail/SKILL.md +356 -0
- package/skills/doc-smith-docs-detail/ai/intent.md +271 -0
- package/skills-entry/doc-smith/ai/intent.md +260 -0
- package/skills-entry/doc-smith/index.mjs +66 -0
- package/skills-entry/doc-smith/prompt.md +57 -0
- package/skills-entry/doc-smith/utils.mjs +27 -0
- package/skills-entry/doc-smith-docs-detail/batch.yaml +56 -0
- package/skills-entry/doc-smith-docs-detail/index.mjs +95 -0
- package/skills-entry/doc-smith-docs-detail/prompt.md +64 -0
- package/utils/afs-factory.mjs +183 -0
- package/utils/agent-constants.mjs +97 -0
- package/utils/{auth-utils.mjs → auth.mjs} +6 -9
- package/{agents/utils/update-branding.mjs → utils/branding.mjs} +3 -4
- package/utils/config.mjs +261 -0
- package/utils/constants.mjs +32 -0
- package/utils/deploy.mjs +3 -3
- package/utils/docs-converter.mjs +454 -0
- package/utils/docs.mjs +212 -0
- package/utils/document-paths.mjs +172 -0
- package/utils/files.mjs +74 -0
- package/utils/git.mjs +65 -0
- package/utils/{blocklet.mjs → http.mjs} +18 -0
- package/utils/image-slots.mjs +57 -0
- package/utils/image-utils.mjs +114 -0
- package/utils/project.mjs +95 -0
- package/utils/sources-path-resolver.mjs +76 -0
- package/utils/{upload-files.mjs → upload.mjs} +3 -3
- package/utils/workspace.mjs +371 -0
- 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/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/create/aggregate-document-structure.mjs +0 -21
- package/agents/create/analyze-diagram-type-llm.yaml +0 -159
- package/agents/create/analyze-diagram-type.mjs +0 -455
- package/agents/create/check-document-structure.yaml +0 -30
- package/agents/create/check-need-generate-structure.mjs +0 -138
- 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 -91
- package/agents/create/generate-structure.yaml +0 -106
- package/agents/create/index.yaml +0 -45
- package/agents/create/refine-document-structure.yaml +0 -12
- package/agents/create/replace-d2-with-image.mjs +0 -610
- 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 -139
- package/agents/create/utils/init-current-content.mjs +0 -34
- package/agents/create/utils/merge-document-structures.mjs +0 -36
- 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 -643
- package/agents/init/validate.mjs +0 -16
- package/agents/localize/choose-language.mjs +0 -107
- package/agents/localize/record-translation-history.mjs +0 -23
- package/agents/localize/save-doc-translation-or-skip.mjs +0 -18
- package/agents/localize/set-review-content.mjs +0 -58
- package/agents/localize/translate-document-wrapper.mjs +0 -34
- package/agents/localize/translate-document.yaml +0 -24
- package/agents/localize/translate-multilingual.yaml +0 -57
- package/agents/localize/translate-or-skip-diagram.mjs +0 -52
- 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 -454
- package/agents/prefs/index.mjs +0 -203
- 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-update-is-single.mjs +0 -53
- package/agents/update/document-tools/update-document-content.mjs +0 -303
- package/agents/update/generate-diagram.yaml +0 -80
- package/agents/update/generate-document.yaml +0 -70
- package/agents/update/handle-document-update.yaml +0 -103
- package/agents/update/index.yaml +0 -69
- package/agents/update/pre-check-generate-diagram.yaml +0 -44
- package/agents/update/save-and-translate-document.mjs +0 -80
- package/agents/update/update-document-detail.yaml +0 -71
- package/agents/update/update-single/update-single-document-detail.mjs +0 -322
- 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 -253
- package/agents/utils/analyze-structure-feedback-intent.yaml +0 -29
- package/agents/utils/check-detail-result.mjs +0 -51
- package/agents/utils/check-feedback-refiner.mjs +0 -81
- package/agents/utils/choose-docs.mjs +0 -251
- 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 -96
- 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 -133
- package/agents/utils/read-current-document-content.mjs +0 -46
- package/agents/utils/save-doc-translation.mjs +0 -30
- package/agents/utils/save-doc.mjs +0 -54
- package/agents/utils/save-output.mjs +0 -26
- package/agents/utils/save-sidebar.mjs +0 -38
- 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/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-user.md +0 -81
- 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/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/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 -205
- package/utils/debug.mjs +0 -3
- package/utils/delete-diagram-images.mjs +0 -99
- package/utils/diagram-version-utils.mjs +0 -14
- package/utils/docs-finder-utils.mjs +0 -548
- 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 -154
- package/utils/kroki-utils.mjs +0 -173
- package/utils/linter/index.mjs +0 -50
- package/utils/load-config.mjs +0 -78
- 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/sync-diagram-to-translations.mjs +0 -272
- package/utils/translate-diagram-images.mjs +0 -807
- package/utils/utils.mjs +0 -1354
- /package/{prompts/translate → agents/localize/prompts}/glossary.md +0 -0
|
@@ -1,303 +0,0 @@
|
|
|
1
|
-
import { applyPatch } from "diff";
|
|
2
|
-
import {
|
|
3
|
-
getUpdateDocumentContentInputJsonSchema,
|
|
4
|
-
getUpdateDocumentContentOutputJsonSchema,
|
|
5
|
-
validateUpdateDocumentContentInput,
|
|
6
|
-
} from "../../../types/document-schema.mjs";
|
|
7
|
-
import { userContextAt } from "../../../utils/utils.mjs";
|
|
8
|
-
|
|
9
|
-
export default async function updateDocumentContent(input, options) {
|
|
10
|
-
// Validate input using Zod schema
|
|
11
|
-
const validation = validateUpdateDocumentContentInput(input);
|
|
12
|
-
if (!validation.success) {
|
|
13
|
-
return {
|
|
14
|
-
success: false,
|
|
15
|
-
error: { message: validation.error },
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const { diffPatch, path } = validation.data;
|
|
20
|
-
|
|
21
|
-
// Get originalContent from shared context using path, fallback to input
|
|
22
|
-
const contentContext = userContextAt(options, `currentContents.${path}`);
|
|
23
|
-
let originalContent = contentContext.get();
|
|
24
|
-
|
|
25
|
-
if (!originalContent) {
|
|
26
|
-
originalContent = input.originalContent;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
try {
|
|
30
|
-
// Parse and validate diff patch
|
|
31
|
-
const parsedDiff = parseDiffPatch(diffPatch);
|
|
32
|
-
if (!parsedDiff.success) {
|
|
33
|
-
return {
|
|
34
|
-
success: false,
|
|
35
|
-
error: { message: parsedDiff.error },
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// Check and fix line number issues
|
|
40
|
-
const fixedDiff = fixLineNumberIssues(originalContent, parsedDiff.hunks);
|
|
41
|
-
if (!fixedDiff.success) {
|
|
42
|
-
return {
|
|
43
|
-
success: false,
|
|
44
|
-
error: { message: fixedDiff.error },
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
// Reconstruct the fixed diff patch
|
|
49
|
-
const fixedPatch = reconstructDiffPatch(fixedDiff.hunks);
|
|
50
|
-
|
|
51
|
-
// Apply the diff patch using the diff library
|
|
52
|
-
const result = applyPatch(originalContent, fixedPatch);
|
|
53
|
-
|
|
54
|
-
if (result === false) {
|
|
55
|
-
return {
|
|
56
|
-
success: false,
|
|
57
|
-
error: { message: "Failed to apply patch" },
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
// Update shared context with new content using path
|
|
62
|
-
contentContext.set(result);
|
|
63
|
-
|
|
64
|
-
return {
|
|
65
|
-
success: true,
|
|
66
|
-
updatedContent: `<page_content>
|
|
67
|
-
${result}
|
|
68
|
-
</page_content>`,
|
|
69
|
-
message:
|
|
70
|
-
"Document content updated successfully.\nCheck if updatedContent meets user feedback, if so, just return 'success'.",
|
|
71
|
-
};
|
|
72
|
-
} catch (error) {
|
|
73
|
-
return {
|
|
74
|
-
success: false,
|
|
75
|
-
error: { message: error.message },
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
function parseDiffPatch(diffPatch) {
|
|
81
|
-
try {
|
|
82
|
-
const hunks = [];
|
|
83
|
-
const lines = diffPatch.split("\n");
|
|
84
|
-
let currentHunk = null;
|
|
85
|
-
|
|
86
|
-
for (let i = 0; i < lines.length; i++) {
|
|
87
|
-
const line = lines[i];
|
|
88
|
-
|
|
89
|
-
// Parse hunk header: @@ -oldStart,oldCount +newStart,newCount @@
|
|
90
|
-
const hunkMatch = line.match(/^@@\s+-(\d+)(?:,(\d+))?\s+\+(\d+)(?:,(\d+))?\s+@@/);
|
|
91
|
-
if (hunkMatch) {
|
|
92
|
-
if (currentHunk) {
|
|
93
|
-
hunks.push(currentHunk);
|
|
94
|
-
}
|
|
95
|
-
currentHunk = {
|
|
96
|
-
oldStart: parseInt(hunkMatch[1], 10),
|
|
97
|
-
oldCount: parseInt(hunkMatch[2], 10) || 1,
|
|
98
|
-
newStart: parseInt(hunkMatch[3], 10),
|
|
99
|
-
newCount: parseInt(hunkMatch[4], 10) || 1,
|
|
100
|
-
changes: [],
|
|
101
|
-
};
|
|
102
|
-
continue;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
// Parse changes
|
|
106
|
-
if (currentHunk && line.length > 0) {
|
|
107
|
-
const changeType = line[0];
|
|
108
|
-
const content = line.slice(1);
|
|
109
|
-
|
|
110
|
-
if (changeType === "-") {
|
|
111
|
-
currentHunk.changes.push({ type: "remove", content });
|
|
112
|
-
} else if (changeType === "+") {
|
|
113
|
-
currentHunk.changes.push({ type: "add", content });
|
|
114
|
-
} else if (changeType === " ") {
|
|
115
|
-
currentHunk.changes.push({ type: "context", content });
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
if (currentHunk) {
|
|
121
|
-
hunks.push(currentHunk);
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
if (hunks.length === 0) {
|
|
125
|
-
return { success: false, error: "No valid hunks found in diff" };
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
return { success: true, hunks };
|
|
129
|
-
} catch (error) {
|
|
130
|
-
return { success: false, error: `Failed to parse diff: ${error.message}` };
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
function fixLineNumberIssues(originalContent, hunks) {
|
|
135
|
-
try {
|
|
136
|
-
const originalLines = originalContent.split("\n");
|
|
137
|
-
const fixedHunks = [];
|
|
138
|
-
|
|
139
|
-
for (const hunk of hunks) {
|
|
140
|
-
// Extract context and removed lines to find best match
|
|
141
|
-
const contextAndRemoved = hunk.changes
|
|
142
|
-
.filter((change) => change.type === "context" || change.type === "remove")
|
|
143
|
-
.map((change) => change.content);
|
|
144
|
-
|
|
145
|
-
if (contextAndRemoved.length === 0) {
|
|
146
|
-
// No context to match against, keep original
|
|
147
|
-
fixedHunks.push(hunk);
|
|
148
|
-
continue;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
// Find best matching position in original content
|
|
152
|
-
const bestMatch = findBestMatch(originalLines, contextAndRemoved, hunk.oldStart - 1);
|
|
153
|
-
|
|
154
|
-
if (bestMatch.found) {
|
|
155
|
-
const fixedHunk = {
|
|
156
|
-
...hunk,
|
|
157
|
-
oldStart: bestMatch.position + 1,
|
|
158
|
-
newStart: bestMatch.position + 1,
|
|
159
|
-
// Fix line counts based on actual changes
|
|
160
|
-
oldCount: calculateOldCount(hunk.changes),
|
|
161
|
-
newCount: calculateNewCount(hunk.changes),
|
|
162
|
-
};
|
|
163
|
-
fixedHunks.push(fixedHunk);
|
|
164
|
-
} else {
|
|
165
|
-
// Try fuzzy matching
|
|
166
|
-
const fuzzyMatch = findFuzzyMatch(originalLines, contextAndRemoved);
|
|
167
|
-
if (fuzzyMatch.found) {
|
|
168
|
-
const fixedHunk = {
|
|
169
|
-
...hunk,
|
|
170
|
-
oldStart: fuzzyMatch.position + 1,
|
|
171
|
-
newStart: fuzzyMatch.position + 1,
|
|
172
|
-
// Fix line counts based on actual changes
|
|
173
|
-
oldCount: calculateOldCount(hunk.changes),
|
|
174
|
-
newCount: calculateNewCount(hunk.changes),
|
|
175
|
-
};
|
|
176
|
-
fixedHunks.push(fixedHunk);
|
|
177
|
-
} else {
|
|
178
|
-
return {
|
|
179
|
-
success: false,
|
|
180
|
-
error: `Cannot find matching context for hunk at line ${hunk.oldStart}`,
|
|
181
|
-
};
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
return { success: true, hunks: fixedHunks };
|
|
187
|
-
} catch (error) {
|
|
188
|
-
return { success: false, error: `Failed to fix line numbers: ${error.message}` };
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
function findBestMatch(originalLines, targetLines, startPosition) {
|
|
193
|
-
// Try exact match at expected position first
|
|
194
|
-
if (startPosition >= 0 && startPosition + targetLines.length <= originalLines.length) {
|
|
195
|
-
let matches = 0;
|
|
196
|
-
for (let i = 0; i < targetLines.length; i++) {
|
|
197
|
-
if (originalLines[startPosition + i] === targetLines[i]) {
|
|
198
|
-
matches++;
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
if (matches === targetLines.length) {
|
|
203
|
-
return { found: true, position: startPosition };
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
// Try nearby positions (within 10 lines)
|
|
208
|
-
const NEARBY_SEARCH_RANGE = 10; // Maximum number of lines to search before/after expected position
|
|
209
|
-
for (let offset = 1; offset <= NEARBY_SEARCH_RANGE; offset++) {
|
|
210
|
-
// Try before
|
|
211
|
-
const beforePos = startPosition - offset;
|
|
212
|
-
if (beforePos >= 0 && beforePos + targetLines.length <= originalLines.length) {
|
|
213
|
-
let matches = 0;
|
|
214
|
-
for (let i = 0; i < targetLines.length; i++) {
|
|
215
|
-
if (originalLines[beforePos + i] === targetLines[i]) {
|
|
216
|
-
matches++;
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
if (matches === targetLines.length) {
|
|
220
|
-
return { found: true, position: beforePos };
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
// Try after
|
|
225
|
-
const afterPos = startPosition + offset;
|
|
226
|
-
if (afterPos >= 0 && afterPos + targetLines.length <= originalLines.length) {
|
|
227
|
-
let matches = 0;
|
|
228
|
-
for (let i = 0; i < targetLines.length; i++) {
|
|
229
|
-
if (originalLines[afterPos + i] === targetLines[i]) {
|
|
230
|
-
matches++;
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
if (matches === targetLines.length) {
|
|
234
|
-
return { found: true, position: afterPos };
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
return { found: false };
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
function findFuzzyMatch(originalLines, targetLines) {
|
|
243
|
-
// Find the best partial match
|
|
244
|
-
let bestMatch = { found: false, position: 0, score: 0 };
|
|
245
|
-
|
|
246
|
-
for (let pos = 0; pos <= originalLines.length - targetLines.length; pos++) {
|
|
247
|
-
let matches = 0;
|
|
248
|
-
for (let i = 0; i < targetLines.length; i++) {
|
|
249
|
-
if (originalLines[pos + i] === targetLines[i]) {
|
|
250
|
-
matches++;
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
const score = matches / targetLines.length;
|
|
255
|
-
const FUZZY_MATCH_THRESHOLD = 0.7; // 70% similarity threshold for fuzzy matching
|
|
256
|
-
if (score > bestMatch.score && score >= FUZZY_MATCH_THRESHOLD) {
|
|
257
|
-
bestMatch = { found: true, position: pos, score };
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
return bestMatch;
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
function calculateOldCount(changes) {
|
|
265
|
-
const contextCount = changes.filter((c) => c.type === "context").length;
|
|
266
|
-
const removeCount = changes.filter((c) => c.type === "remove").length;
|
|
267
|
-
return contextCount + removeCount;
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
function calculateNewCount(changes) {
|
|
271
|
-
const contextCount = changes.filter((c) => c.type === "context").length;
|
|
272
|
-
const addCount = changes.filter((c) => c.type === "add").length;
|
|
273
|
-
return contextCount + addCount;
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
function reconstructDiffPatch(hunks) {
|
|
277
|
-
let patchContent = "";
|
|
278
|
-
|
|
279
|
-
for (const hunk of hunks) {
|
|
280
|
-
// Add hunk header
|
|
281
|
-
const oldRange = hunk.oldCount === 1 ? hunk.oldStart : `${hunk.oldStart},${hunk.oldCount}`;
|
|
282
|
-
const newRange = hunk.newCount === 1 ? hunk.newStart : `${hunk.newStart},${hunk.newCount}`;
|
|
283
|
-
patchContent += `@@ -${oldRange} +${newRange} @@\n`;
|
|
284
|
-
|
|
285
|
-
// Add changes
|
|
286
|
-
for (const change of hunk.changes) {
|
|
287
|
-
if (change.type === "context") {
|
|
288
|
-
patchContent += ` ${change.content}\n`;
|
|
289
|
-
} else if (change.type === "remove") {
|
|
290
|
-
patchContent += `-${change.content}\n`;
|
|
291
|
-
} else if (change.type === "add") {
|
|
292
|
-
patchContent += `+${change.content}\n`;
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
return patchContent;
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
updateDocumentContent.inputSchema = getUpdateDocumentContentInputJsonSchema();
|
|
301
|
-
updateDocumentContent.outputSchema = getUpdateDocumentContentOutputJsonSchema();
|
|
302
|
-
|
|
303
|
-
updateDocumentContent.description = "Apply diff patch to update markdown document content";
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
type: team
|
|
2
|
-
task_render_mode: collapse
|
|
3
|
-
name: generateDiagram
|
|
4
|
-
skills:
|
|
5
|
-
# Step 1: Analyze document content to determine diagram type and style
|
|
6
|
-
- ../create/analyze-diagram-type.mjs
|
|
7
|
-
# Step 2: Transform output for image generation agent (map aspectRatio to ratio, add size, pass existingImage and feedback)
|
|
8
|
-
- type: transform
|
|
9
|
-
jsonata: |
|
|
10
|
-
$merge([
|
|
11
|
-
$,
|
|
12
|
-
{
|
|
13
|
-
"ratio": aspectRatio,
|
|
14
|
-
"size": "1K",
|
|
15
|
-
"existingImage": existingImage,
|
|
16
|
-
"useImageToImage": useImageToImage,
|
|
17
|
-
"feedback": feedback
|
|
18
|
-
}
|
|
19
|
-
])
|
|
20
|
-
# Step 3: Generate diagram image directly with unified agent
|
|
21
|
-
- ../create/generate-diagram-image.yaml
|
|
22
|
-
# Step 4: Replace placeholder with generated image
|
|
23
|
-
- ../create/replace-d2-with-image.mjs
|
|
24
|
-
input_schema:
|
|
25
|
-
type: object
|
|
26
|
-
properties:
|
|
27
|
-
documentContent:
|
|
28
|
-
type: string
|
|
29
|
-
description: The **raw text content** of the current document. (**Note:** This is the original document and **does not include** any diagram source code.)
|
|
30
|
-
locale:
|
|
31
|
-
type: string
|
|
32
|
-
description: Language for diagram labels and text
|
|
33
|
-
default: en
|
|
34
|
-
diagramming:
|
|
35
|
-
type: object
|
|
36
|
-
description: Diagramming configuration
|
|
37
|
-
properties:
|
|
38
|
-
style:
|
|
39
|
-
type: string
|
|
40
|
-
description: Default diagram style to use when no style is specified in feedback
|
|
41
|
-
feedback:
|
|
42
|
-
type: string
|
|
43
|
-
description: User feedback that may contain style or type preferences, or diagram index (e.g., 'use anthropomorphic style', 'update the second diagram')
|
|
44
|
-
default: ""
|
|
45
|
-
path:
|
|
46
|
-
type: string
|
|
47
|
-
description: Document path (e.g., "guides/getting-started.md") used for generating image filename
|
|
48
|
-
docsDir:
|
|
49
|
-
type: string
|
|
50
|
-
description: Documentation directory where assets will be saved (relative to project root)
|
|
51
|
-
intentAnalysis:
|
|
52
|
-
type: object
|
|
53
|
-
description: Analysis results from analyzeFeedbackIntent containing intentType, diagramInfo, generationMode, and changes
|
|
54
|
-
properties:
|
|
55
|
-
intentType:
|
|
56
|
-
type: string
|
|
57
|
-
enum: ["addDiagram", "updateDiagram", "deleteDiagram", "updateDocument"]
|
|
58
|
-
diagramInfo:
|
|
59
|
-
type: object
|
|
60
|
-
nullable: true
|
|
61
|
-
properties:
|
|
62
|
-
path: { type: "string" }
|
|
63
|
-
index: { type: "number" }
|
|
64
|
-
markdown: { type: "string" }
|
|
65
|
-
generationMode:
|
|
66
|
-
type: string
|
|
67
|
-
enum: ["image-to-image", "text-only", "add-new", "remove-image"]
|
|
68
|
-
changes:
|
|
69
|
-
type: array
|
|
70
|
-
items: { type: "string" }
|
|
71
|
-
required:
|
|
72
|
-
- documentContent
|
|
73
|
-
output_schema:
|
|
74
|
-
type: object
|
|
75
|
-
properties:
|
|
76
|
-
content:
|
|
77
|
-
type: string
|
|
78
|
-
description: The document content with D2 code blocks replaced by generated diagram image.
|
|
79
|
-
required:
|
|
80
|
-
- content
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
name: generateDocument
|
|
2
|
-
description: Comprehensive content generator for documentation that creates detailed, high-quality document content from various data sources with intelligent analysis.
|
|
3
|
-
instructions:
|
|
4
|
-
- role: system
|
|
5
|
-
url: ../../prompts/detail/generate/system-prompt.md
|
|
6
|
-
- role: user
|
|
7
|
-
url: ../../prompts/detail/generate/user-prompt.md
|
|
8
|
-
auto_reorder_system_messages: true
|
|
9
|
-
auto_merge_system_messages: true
|
|
10
|
-
input_schema:
|
|
11
|
-
type: object
|
|
12
|
-
properties:
|
|
13
|
-
rules:
|
|
14
|
-
type: string
|
|
15
|
-
description: User's content generation rules and requirements
|
|
16
|
-
locale:
|
|
17
|
-
type: string
|
|
18
|
-
description: User language, such as zh, en
|
|
19
|
-
detailDataSource:
|
|
20
|
-
type: string
|
|
21
|
-
description: Source data and context for document content generation
|
|
22
|
-
targetAudience:
|
|
23
|
-
type: string
|
|
24
|
-
description: Target audience for document content
|
|
25
|
-
nodeName:
|
|
26
|
-
type: string
|
|
27
|
-
description: Document node name for content generation
|
|
28
|
-
originalDocumentStructure: ../schema/document-structure.yaml
|
|
29
|
-
title:
|
|
30
|
-
type: string
|
|
31
|
-
description:
|
|
32
|
-
type: string
|
|
33
|
-
path:
|
|
34
|
-
type: string
|
|
35
|
-
originalContent:
|
|
36
|
-
type: string
|
|
37
|
-
description: The original content of the document before update
|
|
38
|
-
parentId:
|
|
39
|
-
type:
|
|
40
|
-
- string
|
|
41
|
-
- "null"
|
|
42
|
-
glossary:
|
|
43
|
-
type: string
|
|
44
|
-
description: Glossary
|
|
45
|
-
additionalInformation:
|
|
46
|
-
type: string
|
|
47
|
-
description: Additional supplementary information
|
|
48
|
-
intentType:
|
|
49
|
-
type:
|
|
50
|
-
- string
|
|
51
|
-
- "null"
|
|
52
|
-
description: User intent type analyzed from feedback (addDiagram, updateDiagram, deleteDiagram, updateDocument). Can be null if not specified.
|
|
53
|
-
enum: ["addDiagram", "updateDiagram", "deleteDiagram", "updateDocument", null]
|
|
54
|
-
required:
|
|
55
|
-
- rules
|
|
56
|
-
- detailDataSource
|
|
57
|
-
- originalDocumentStructure
|
|
58
|
-
output_key: content
|
|
59
|
-
afs:
|
|
60
|
-
modules:
|
|
61
|
-
- module: system-fs
|
|
62
|
-
options:
|
|
63
|
-
name: sources
|
|
64
|
-
localPath: .
|
|
65
|
-
description: |
|
|
66
|
-
Codebase of the project to be documented used as context for document generation,
|
|
67
|
-
should search and read as needed while generating document content
|
|
68
|
-
keep_text_in_tool_uses: false
|
|
69
|
-
# skills:
|
|
70
|
-
# - ./generate-diagram.yaml
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
type: team
|
|
2
|
-
name: handleDocumentUpdate
|
|
3
|
-
description: Update a document in a batch
|
|
4
|
-
skills:
|
|
5
|
-
- ../utils/transform-detail-data-sources.mjs
|
|
6
|
-
# Check if document generation should be skipped (if content already exists)
|
|
7
|
-
# If intentType is diagram-related and content exists, mark skipGenerateDocument so generation can be short-circuited
|
|
8
|
-
- url: ../utils/skip-if-content-exists.mjs
|
|
9
|
-
# Generate document content (skipped when skipGenerateDocument is true and content exists)
|
|
10
|
-
- type: team
|
|
11
|
-
task_render_mode: collapse
|
|
12
|
-
name: generateDocumentContent
|
|
13
|
-
skills:
|
|
14
|
-
- url: ../utils/find-user-preferences-by-path.mjs
|
|
15
|
-
default_input:
|
|
16
|
-
scope: document
|
|
17
|
-
- ../utils/generate-document-or-skip.mjs
|
|
18
|
-
reflection:
|
|
19
|
-
reviewer: ../utils/check-detail-result.mjs
|
|
20
|
-
is_approved: isApproved
|
|
21
|
-
max_iterations: 5
|
|
22
|
-
return_last_on_max_iterations: true
|
|
23
|
-
task_title: Generate document for '{{ title }}'
|
|
24
|
-
# Ensure content, documentContent, and originalContent are set
|
|
25
|
-
- type: transform
|
|
26
|
-
jsonata: |
|
|
27
|
-
$merge([
|
|
28
|
-
$,
|
|
29
|
-
{
|
|
30
|
-
"documentContent": content,
|
|
31
|
-
"originalContent": content
|
|
32
|
-
}
|
|
33
|
-
])
|
|
34
|
-
- ./check-generate-diagram.mjs
|
|
35
|
-
# - ../generate/merge-diagram.yaml
|
|
36
|
-
- ../utils/save-doc.mjs
|
|
37
|
-
input_schema:
|
|
38
|
-
type: object
|
|
39
|
-
properties:
|
|
40
|
-
nodeName:
|
|
41
|
-
type: string
|
|
42
|
-
description: Node name
|
|
43
|
-
default: Section
|
|
44
|
-
locale:
|
|
45
|
-
type: string
|
|
46
|
-
description: Language
|
|
47
|
-
targetAudience:
|
|
48
|
-
type: string
|
|
49
|
-
description: Target audience
|
|
50
|
-
glossary:
|
|
51
|
-
type: string
|
|
52
|
-
description: Glossary
|
|
53
|
-
doc-path:
|
|
54
|
-
type: string
|
|
55
|
-
description: Current path
|
|
56
|
-
feedback:
|
|
57
|
-
type: string
|
|
58
|
-
description: Feedback
|
|
59
|
-
sources:
|
|
60
|
-
type: array
|
|
61
|
-
items:
|
|
62
|
-
type: string
|
|
63
|
-
description: Source code path
|
|
64
|
-
sourcesPath:
|
|
65
|
-
type: array
|
|
66
|
-
items:
|
|
67
|
-
type: string
|
|
68
|
-
description: Source code path
|
|
69
|
-
default:
|
|
70
|
-
- ./
|
|
71
|
-
includePatterns:
|
|
72
|
-
type: array
|
|
73
|
-
items:
|
|
74
|
-
type: string
|
|
75
|
-
description: Included file name patterns
|
|
76
|
-
excludePatterns:
|
|
77
|
-
type: array
|
|
78
|
-
items:
|
|
79
|
-
type: string
|
|
80
|
-
description: Excluded file name patterns
|
|
81
|
-
outputDir:
|
|
82
|
-
type: string
|
|
83
|
-
description: Output directory
|
|
84
|
-
default: ./aigne-docs/output
|
|
85
|
-
docsDir:
|
|
86
|
-
type: string
|
|
87
|
-
description: Documentation directory
|
|
88
|
-
default: ./aigne-docs/docs
|
|
89
|
-
additionalInformation:
|
|
90
|
-
type: string
|
|
91
|
-
description: Additional information
|
|
92
|
-
output_schema:
|
|
93
|
-
type: object
|
|
94
|
-
properties:
|
|
95
|
-
title:
|
|
96
|
-
type: string
|
|
97
|
-
description:
|
|
98
|
-
type: string
|
|
99
|
-
path:
|
|
100
|
-
type: string
|
|
101
|
-
content:
|
|
102
|
-
type: string
|
|
103
|
-
mode: sequential
|
package/agents/update/index.yaml
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
type: team
|
|
2
|
-
name: update
|
|
3
|
-
alias:
|
|
4
|
-
- up
|
|
5
|
-
description: Update specific documents and their translations. Use --diagram to filter and select documents with diagrams, or --diagram-all to auto-update all diagrams.
|
|
6
|
-
skills:
|
|
7
|
-
- url: ../init/index.mjs
|
|
8
|
-
default_input:
|
|
9
|
-
skipIfExists: true
|
|
10
|
-
checkOnly: true
|
|
11
|
-
- url: ../init/check.mjs
|
|
12
|
-
- ../utils/load-sources.mjs
|
|
13
|
-
- type: transform
|
|
14
|
-
task_render_mode: hide
|
|
15
|
-
jsonata: |
|
|
16
|
-
$merge([
|
|
17
|
-
$,
|
|
18
|
-
{
|
|
19
|
-
'documentStructure': originalDocumentStructure
|
|
20
|
-
}
|
|
21
|
-
])
|
|
22
|
-
# Check if --diagram or --diagram-all flag is set
|
|
23
|
-
- url: ../update/check-diagram-flag.mjs
|
|
24
|
-
- url: ../utils/choose-docs.mjs
|
|
25
|
-
default_input:
|
|
26
|
-
requiredFeedback: false
|
|
27
|
-
- ../utils/format-document-structure.mjs
|
|
28
|
-
- ../utils/ensure-document-icons.mjs
|
|
29
|
-
- ../media/load-media-description.mjs
|
|
30
|
-
- ../update/check-update-is-single.mjs
|
|
31
|
-
- ../update/save-and-translate-document.mjs
|
|
32
|
-
- url: ../utils/action-success.mjs
|
|
33
|
-
default_input:
|
|
34
|
-
action: "✅ Documents updated successfully!\n💡 Looks good? Run `aigne doc publish` to go live."
|
|
35
|
-
input_schema:
|
|
36
|
-
type: object
|
|
37
|
-
properties:
|
|
38
|
-
glossary:
|
|
39
|
-
type: string
|
|
40
|
-
description: Glossary file for consistent terminology (use @filename.md)
|
|
41
|
-
docs:
|
|
42
|
-
type: array
|
|
43
|
-
items:
|
|
44
|
-
type: string
|
|
45
|
-
description: Documents to update
|
|
46
|
-
feedback:
|
|
47
|
-
type: string
|
|
48
|
-
description: Tell us what to change in this content
|
|
49
|
-
reset:
|
|
50
|
-
type: boolean
|
|
51
|
-
description: Start fresh - ignore previous versions
|
|
52
|
-
diagram:
|
|
53
|
-
type: ["boolean", "string"]
|
|
54
|
-
description: "Flag to update diagrams: true for user selection (can also use --diagram CLI arg)"
|
|
55
|
-
"diagram-all":
|
|
56
|
-
type: ["boolean", "string"]
|
|
57
|
-
description: "Flag to auto-select all documents with diagrams (can also use --diagram-all CLI arg)"
|
|
58
|
-
output_schema:
|
|
59
|
-
type: object
|
|
60
|
-
properties:
|
|
61
|
-
title:
|
|
62
|
-
type: string
|
|
63
|
-
description:
|
|
64
|
-
type: string
|
|
65
|
-
path:
|
|
66
|
-
type: string
|
|
67
|
-
content:
|
|
68
|
-
type: string
|
|
69
|
-
mode: sequential
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
name: preCheckGenerateDiagram
|
|
2
|
-
description: Pre-check for generating diagram
|
|
3
|
-
model:
|
|
4
|
-
reasoning_effort: 1
|
|
5
|
-
instructions:
|
|
6
|
-
url: ../../prompts/detail/diagram/pre-check.md
|
|
7
|
-
input_schema:
|
|
8
|
-
type: object
|
|
9
|
-
properties:
|
|
10
|
-
documentContent:
|
|
11
|
-
type: string
|
|
12
|
-
description: Source content of the document
|
|
13
|
-
feedback:
|
|
14
|
-
type: string
|
|
15
|
-
description: User generation feedback
|
|
16
|
-
detailFeedback:
|
|
17
|
-
type: string
|
|
18
|
-
description: Current document detail feedback
|
|
19
|
-
previousGenerationContent:
|
|
20
|
-
type: string
|
|
21
|
-
description: Previous document content
|
|
22
|
-
required:
|
|
23
|
-
- documentContent
|
|
24
|
-
output_schema:
|
|
25
|
-
type: object
|
|
26
|
-
properties:
|
|
27
|
-
content:
|
|
28
|
-
type: string
|
|
29
|
-
description: Document content
|
|
30
|
-
details:
|
|
31
|
-
type: array
|
|
32
|
-
description: Detailed needDiagram score
|
|
33
|
-
items:
|
|
34
|
-
type: object
|
|
35
|
-
properties:
|
|
36
|
-
type:
|
|
37
|
-
type: string
|
|
38
|
-
score:
|
|
39
|
-
type: number
|
|
40
|
-
reason:
|
|
41
|
-
type: string
|
|
42
|
-
required:
|
|
43
|
-
- content
|
|
44
|
-
|