@aigne/doc-smith 0.8.11 → 0.8.12-beta.1
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/.github/workflows/publish-docs.yml +1 -0
- package/.release-please-manifest.json +1 -1
- package/CHANGELOG.md +19 -0
- package/agents/generate/check-diagram.mjs +40 -0
- package/agents/generate/draw-diagram.yaml +23 -0
- package/agents/generate/generate-structure.yaml +5 -1
- package/agents/generate/merge-d2-diagram.yaml +3 -3
- package/agents/generate/update-document-structure.yaml +5 -2
- package/agents/generate/user-review-document-structure.mjs +7 -0
- package/agents/generate/wrap-diagram-code.mjs +35 -0
- package/agents/history/index.yaml +6 -0
- package/agents/history/view.mjs +75 -0
- package/agents/translate/index.yaml +3 -2
- package/agents/translate/record-translation-history.mjs +19 -0
- package/agents/translate/translate-multilingual.yaml +2 -1
- package/agents/update/batch-update-document.yaml +1 -1
- package/agents/update/check-document.mjs +1 -1
- package/agents/update/fs-tools/read-file.mjs +3 -1
- package/agents/update/generate-document.yaml +31 -25
- package/agents/update/{generate-and-translate-document.yaml → handle-document-update.yaml} +2 -11
- package/agents/update/index.yaml +1 -0
- package/agents/update/save-and-translate-document.mjs +101 -0
- package/agents/update/update-document-detail.yaml +5 -1
- package/agents/update/update-single-document.yaml +1 -10
- package/agents/update/user-review-document.mjs +4 -1
- package/aigne.yaml +8 -1
- package/package.json +1 -1
- package/prompts/detail/d2-diagram/guide.md +19 -0
- package/prompts/detail/d2-diagram/role-and-personality.md +2 -0
- package/prompts/detail/d2-diagram/rules.md +24 -0
- package/prompts/detail/d2-diagram/{rules-system.md → system-prompt.md} +3 -9
- package/prompts/detail/{document-rules.md → generate/document-rules.md} +1 -1
- package/prompts/detail/generate/system-prompt.md +72 -0
- package/prompts/detail/generate/user-prompt.md +54 -0
- package/prompts/detail/{update-document.md → update/system-prompt.md} +43 -67
- package/prompts/detail/update/user-prompt.md +33 -0
- package/prompts/structure/{generate-structure-system.md → generate/system-prompt.md} +7 -40
- package/prompts/structure/{generate-structure-user.md → generate/user-prompt.md} +17 -13
- package/prompts/structure/{update-document-structure.md → update/system-prompt.md} +16 -27
- package/prompts/structure/update/user-prompt.md +19 -0
- package/tests/agents/generate/user-review-document-structure.test.mjs +2 -0
- package/tests/agents/update/check-document.test.mjs +1 -1
- package/tests/agents/update/fs-tools/read-file.test.mjs +8 -12
- package/tests/agents/utils/check-detail-result.test.mjs +13 -0
- package/tests/utils/d2-utils.test.mjs +14 -0
- package/tests/utils/docs-finder-utils.test.mjs +13 -0
- package/tests/utils/history-utils.test.mjs +178 -0
- package/utils/d2-utils.mjs +9 -0
- package/utils/docs-finder-utils.mjs +10 -1
- package/utils/history-utils.mjs +191 -0
- package/utils/markdown-checker.mjs +20 -0
- package/agents/generate/check-d2-diagram-valid.mjs +0 -26
- package/agents/generate/generate-d2-diagram.yaml +0 -23
- package/prompts/detail/generate-document.md +0 -125
- /package/prompts/detail/d2-diagram/{rules-user.md → user-prompt.md} +0 -0
- /package/prompts/detail/{detail-example.md → generate/detail-example.md} +0 -0
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
<role_and_goal>
|
|
2
|
-
{% include "../common/document/role-and-personality.md" %}
|
|
3
|
-
|
|
4
|
-
Your task is to generate detailed content for the current {{nodeName}} based on user-provided information: current {{nodeName}} details (including title, description, path), DataSources, documentStructure (overall structural planning), and other relevant information.
|
|
5
|
-
</role_and_goal>
|
|
6
|
-
|
|
7
|
-
<user_locale>
|
|
8
|
-
{{ locale }}
|
|
9
|
-
</user_locale>
|
|
10
|
-
|
|
11
|
-
<user_rules>
|
|
12
|
-
{{ rules }}
|
|
13
|
-
|
|
14
|
-
** Output content in {{ locale }} language **
|
|
15
|
-
</user_rules>
|
|
16
|
-
|
|
17
|
-
{% set operation_type = "generating" %}
|
|
18
|
-
{% include "../common/document/user-preferences.md" %}
|
|
19
|
-
|
|
20
|
-
{% if detailFeedback %}
|
|
21
|
-
<content_review_feedback>
|
|
22
|
-
{{ detailFeedback }}
|
|
23
|
-
</content_review_feedback>
|
|
24
|
-
{% endif %}
|
|
25
|
-
|
|
26
|
-
<content_generation_rules>
|
|
27
|
-
|
|
28
|
-
{% include "../common/document/content-rules-core.md" %}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
Documentation content generation rules:
|
|
32
|
-
{% include "./document-rules.md" %}
|
|
33
|
-
|
|
34
|
-
Custom component generation rules:
|
|
35
|
-
{% include "custom/custom-components.md" %}
|
|
36
|
-
|
|
37
|
-
Custom code block generation rules:
|
|
38
|
-
{% include "custom/custom-code-block.md" %}
|
|
39
|
-
|
|
40
|
-
</content_generation_rules>
|
|
41
|
-
|
|
42
|
-
{% if glossary %}
|
|
43
|
-
<terms>
|
|
44
|
-
Glossary of specialized terms. Please ensure correct spelling when using these terms.
|
|
45
|
-
|
|
46
|
-
{{glossary}}
|
|
47
|
-
</terms>
|
|
48
|
-
{% endif %}
|
|
49
|
-
|
|
50
|
-
<document_structure>
|
|
51
|
-
{{ documentStructureYaml }}
|
|
52
|
-
</document_structure>
|
|
53
|
-
|
|
54
|
-
<current_document>
|
|
55
|
-
Current {{nodeName}} information:
|
|
56
|
-
title: {{title}}
|
|
57
|
-
description: {{description}}
|
|
58
|
-
path: {{path}}
|
|
59
|
-
parentId: {{parentId}}
|
|
60
|
-
</current_document>
|
|
61
|
-
|
|
62
|
-
{% if content %}
|
|
63
|
-
Content from previous generation:
|
|
64
|
-
<last_content>
|
|
65
|
-
{{content}}
|
|
66
|
-
</last_content>
|
|
67
|
-
{% endif %}
|
|
68
|
-
|
|
69
|
-
{% if feedback %}
|
|
70
|
-
User feedback on previous generation:
|
|
71
|
-
<feedback>
|
|
72
|
-
{{feedback}}
|
|
73
|
-
</feedback>
|
|
74
|
-
{% endif %}
|
|
75
|
-
|
|
76
|
-
{% if detailFeedback %}
|
|
77
|
-
<content_review_feedback>
|
|
78
|
-
{{ detailFeedback }}
|
|
79
|
-
</content_review_feedback>
|
|
80
|
-
{% endif %}
|
|
81
|
-
|
|
82
|
-
<datasources>
|
|
83
|
-
{{ detailDataSources }}
|
|
84
|
-
|
|
85
|
-
{{ additionalInformation }}
|
|
86
|
-
|
|
87
|
-
<media_list>
|
|
88
|
-
{{ assetsContent }}
|
|
89
|
-
</media_list>
|
|
90
|
-
|
|
91
|
-
{% include "../common/document/media-handling-rules.md" %}
|
|
92
|
-
|
|
93
|
-
</datasources>
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
{% include "./detail-example.md" %}
|
|
97
|
-
|
|
98
|
-
<output_constraints>
|
|
99
|
-
|
|
100
|
-
1. Output detailed text content for {{nodeName}}.
|
|
101
|
-
2. Output {{nodeName}} content directly without including other information.
|
|
102
|
-
3. Reference the style from examples only, **output content in {{locale}} language**
|
|
103
|
-
|
|
104
|
-
</output_constraints>
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
<tool-usage>
|
|
108
|
-
1. generateD2DiagramContent: Generate D2 diagram for the given document content
|
|
109
|
-
- Use diagrams to clarify complex concepts and diversify the presentation of the page.
|
|
110
|
-
- The document overview page must include an architecture diagram that illustrates the entire documentation structure.
|
|
111
|
-
- For the first page of each section, include a structural diagram of the current module when it adds clarity.
|
|
112
|
-
- For individual article pages, consider detailed flowcharts when the content or overall architecture warrants them.
|
|
113
|
-
- The number of diagrams is flexible, but aim for 0-3 diagrams as a practical range.
|
|
114
|
-
|
|
115
|
-
2. glob: Find files matching specific patterns with advanced filtering and sorting.
|
|
116
|
-
|
|
117
|
-
3. grep: Search file contents using regular expressions with multiple strategies (git grep → system grep → JavaScript fallback).
|
|
118
|
-
|
|
119
|
-
4. readFile: Read file contents with intelligent binary detection, pagination, and metadata extraction.
|
|
120
|
-
|
|
121
|
-
When to use Tools:
|
|
122
|
-
- For each document, evaluate whether D2 diagrams are needed. If so, always use generateD2DiagramContent to add diagrams to the document
|
|
123
|
-
- During document generation, if the given context is missing or lacks referenced content, use glob/grep/readFile to obtain more context
|
|
124
|
-
- Code examples in generated documents must use APIs and packages defined in the input data sources. Do not generate non-existent code out of thin air. Use glob/grep/readFile to query related code or references
|
|
125
|
-
</tool-usage>
|
|
File without changes
|
|
File without changes
|