@aigne/doc-smith 0.8.15-beta.11 → 0.8.15-beta.12
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 +7 -0
- package/agents/generate/update-document-structure.yaml +51 -45
- package/agents/update/update-document-detail.yaml +64 -58
- package/agents/utils/analyze-feedback-intent.yaml +31 -0
- package/aigne.yaml +1 -0
- package/package.json +1 -1
- package/prompts/detail/update/user-prompt.md +2 -0
- package/prompts/structure/update/system-prompt.md +0 -13
- package/prompts/structure/update/user-prompt.md +2 -1
- package/prompts/utils/analyze-feedback-intent.md +55 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.8.15-beta.12](https://github.com/AIGNE-io/aigne-doc-smith/compare/v0.8.15-beta.11...v0.8.15-beta.12) (2025-11-05)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* tune token consumption for update ops with intent analysis ([#264](https://github.com/AIGNE-io/aigne-doc-smith/issues/264)) ([8c53d28](https://github.com/AIGNE-io/aigne-doc-smith/commit/8c53d288346ae622e8841866db1b6fbed9d5023d))
|
|
9
|
+
|
|
3
10
|
## [0.8.15-beta.11](https://github.com/AIGNE-io/aigne-doc-smith/compare/v0.8.15-beta.10...v0.8.15-beta.11) (2025-11-04)
|
|
4
11
|
|
|
5
12
|
|
|
@@ -1,48 +1,54 @@
|
|
|
1
|
-
type:
|
|
1
|
+
type: team
|
|
2
2
|
name: updateDocumentStructure
|
|
3
3
|
description: Update documentation structure based on user feedback and intentions using structure modification tools
|
|
4
|
-
instructions:
|
|
5
|
-
- role: system
|
|
6
|
-
url: ../../prompts/structure/update/system-prompt.md
|
|
7
|
-
- role: user
|
|
8
|
-
url: ../../prompts/structure/update/user-prompt.md
|
|
9
|
-
input_schema:
|
|
10
|
-
type: object
|
|
11
|
-
properties:
|
|
12
|
-
documentStructure: ../schema/document-structure.yaml
|
|
13
|
-
rules:
|
|
14
|
-
type: string
|
|
15
|
-
description: User configuration rules
|
|
16
|
-
locale:
|
|
17
|
-
type: string
|
|
18
|
-
description: User language, e.g. zh, en
|
|
19
|
-
dataSourceChunk:
|
|
20
|
-
type: string
|
|
21
|
-
description: Context for documentation structure
|
|
22
|
-
glossary:
|
|
23
|
-
type: string
|
|
24
|
-
description: Glossary of terms
|
|
25
|
-
feedback:
|
|
26
|
-
type: string
|
|
27
|
-
description: User feedback for structure modifications
|
|
28
|
-
userPreferences:
|
|
29
|
-
type: string
|
|
30
|
-
description: Your saved preferences for structure and documentation style
|
|
31
|
-
required:
|
|
32
|
-
- documentStructure
|
|
33
|
-
- feedback
|
|
34
|
-
output_key: message
|
|
35
|
-
afs:
|
|
36
|
-
modules:
|
|
37
|
-
- module: system-fs
|
|
38
|
-
options:
|
|
39
|
-
mount: /sources
|
|
40
|
-
path: .
|
|
41
|
-
description: |
|
|
42
|
-
Codebase of the project to be documented used as context for document generation,
|
|
43
|
-
should search and read as needed while generating document content
|
|
44
4
|
skills:
|
|
45
|
-
-
|
|
46
|
-
-
|
|
47
|
-
|
|
48
|
-
|
|
5
|
+
- url: ../utils/analyze-feedback-intent.yaml
|
|
6
|
+
- type: ai
|
|
7
|
+
instructions:
|
|
8
|
+
- role: system
|
|
9
|
+
url: ../../prompts/structure/update/system-prompt.md
|
|
10
|
+
- role: user
|
|
11
|
+
url: ../../prompts/structure/update/user-prompt.md
|
|
12
|
+
input_schema:
|
|
13
|
+
type: object
|
|
14
|
+
properties:
|
|
15
|
+
documentStructure: ../schema/document-structure.yaml
|
|
16
|
+
rules:
|
|
17
|
+
type: string
|
|
18
|
+
description: User configuration rules
|
|
19
|
+
locale:
|
|
20
|
+
type: string
|
|
21
|
+
description: User language, e.g. zh, en
|
|
22
|
+
dataSourceChunk:
|
|
23
|
+
type: string
|
|
24
|
+
description: Context for documentation structure
|
|
25
|
+
glossary:
|
|
26
|
+
type: string
|
|
27
|
+
description: Glossary of terms
|
|
28
|
+
feedback:
|
|
29
|
+
type: string
|
|
30
|
+
description: User feedback for structure modifications
|
|
31
|
+
userPreferences:
|
|
32
|
+
type: string
|
|
33
|
+
description: Your saved preferences for structure and documentation style
|
|
34
|
+
needDataSources:
|
|
35
|
+
type: boolean
|
|
36
|
+
description: Whether data sources are needed for content modifications
|
|
37
|
+
required:
|
|
38
|
+
- documentStructure
|
|
39
|
+
- feedback
|
|
40
|
+
output_key: message
|
|
41
|
+
afs:
|
|
42
|
+
modules:
|
|
43
|
+
- module: system-fs
|
|
44
|
+
options:
|
|
45
|
+
mount: /sources
|
|
46
|
+
path: .
|
|
47
|
+
description: |
|
|
48
|
+
Codebase of the project to be documented used as context for document generation,
|
|
49
|
+
should search and read as needed while generating document content
|
|
50
|
+
skills:
|
|
51
|
+
- ./document-structure-tools/add-document.mjs
|
|
52
|
+
- ./document-structure-tools/delete-document.mjs
|
|
53
|
+
- ./document-structure-tools/update-document.mjs
|
|
54
|
+
- ./document-structure-tools/move-document.mjs
|
|
@@ -1,61 +1,67 @@
|
|
|
1
|
-
type:
|
|
1
|
+
type: team
|
|
2
2
|
name: updateDocumentDetail
|
|
3
3
|
description: Update and optimize document content based on user feedback using diff patches
|
|
4
|
-
instructions:
|
|
5
|
-
- role: system
|
|
6
|
-
url: ../../prompts/detail/update/system-prompt.md
|
|
7
|
-
- role: user
|
|
8
|
-
url: ../../prompts/detail/update/user-prompt.md
|
|
9
|
-
auto_reorder_system_messages: true
|
|
10
|
-
auto_merge_system_messages: true
|
|
11
|
-
input_schema:
|
|
12
|
-
type: object
|
|
13
|
-
properties:
|
|
14
|
-
originalContent:
|
|
15
|
-
type: string
|
|
16
|
-
description: Original markdown content to be updated
|
|
17
|
-
feedback:
|
|
18
|
-
type: string
|
|
19
|
-
description: User feedback for content improvements
|
|
20
|
-
rules:
|
|
21
|
-
type: string
|
|
22
|
-
description: User configuration rules
|
|
23
|
-
locale:
|
|
24
|
-
type: string
|
|
25
|
-
description: User language, e.g. zh, en
|
|
26
|
-
detailDataSource:
|
|
27
|
-
type: string
|
|
28
|
-
description: Context for document content
|
|
29
|
-
glossary:
|
|
30
|
-
type: string
|
|
31
|
-
description: Glossary of terms
|
|
32
|
-
userPreferences:
|
|
33
|
-
type: string
|
|
34
|
-
description: User's saved preferences for content and documentation style
|
|
35
|
-
targetAudience:
|
|
36
|
-
type: string
|
|
37
|
-
description: Target audience for the documentation
|
|
38
|
-
title:
|
|
39
|
-
type: string
|
|
40
|
-
description: Document title
|
|
41
|
-
description:
|
|
42
|
-
type: string
|
|
43
|
-
description: Document description
|
|
44
|
-
required:
|
|
45
|
-
- originalContent
|
|
46
|
-
- feedback
|
|
47
|
-
output_key: message
|
|
48
|
-
afs:
|
|
49
|
-
modules:
|
|
50
|
-
- module: system-fs
|
|
51
|
-
options:
|
|
52
|
-
mount: /sources
|
|
53
|
-
path: .
|
|
54
|
-
description: |
|
|
55
|
-
Codebase of the project to be documented used as context for document generation,
|
|
56
|
-
should search and read as needed while generating document content
|
|
57
|
-
keep_text_in_tool_uses: false
|
|
58
|
-
skills:
|
|
59
|
-
- ./document-tools/update-document-content.mjs
|
|
60
|
-
# - ./generate-diagram.yaml
|
|
61
4
|
task_render_mode: collapse
|
|
5
|
+
skills:
|
|
6
|
+
- url: ../utils/analyze-feedback-intent.yaml
|
|
7
|
+
- type: ai
|
|
8
|
+
instructions:
|
|
9
|
+
- role: system
|
|
10
|
+
url: ../../prompts/detail/update/system-prompt.md
|
|
11
|
+
- role: user
|
|
12
|
+
url: ../../prompts/detail/update/user-prompt.md
|
|
13
|
+
auto_reorder_system_messages: true
|
|
14
|
+
auto_merge_system_messages: true
|
|
15
|
+
input_schema:
|
|
16
|
+
type: object
|
|
17
|
+
properties:
|
|
18
|
+
originalContent:
|
|
19
|
+
type: string
|
|
20
|
+
description: Original markdown content to be updated
|
|
21
|
+
feedback:
|
|
22
|
+
type: string
|
|
23
|
+
description: User feedback for content improvements
|
|
24
|
+
rules:
|
|
25
|
+
type: string
|
|
26
|
+
description: User configuration rules
|
|
27
|
+
locale:
|
|
28
|
+
type: string
|
|
29
|
+
description: User language, e.g. zh, en
|
|
30
|
+
detailDataSource:
|
|
31
|
+
type: string
|
|
32
|
+
description: Context for document content
|
|
33
|
+
glossary:
|
|
34
|
+
type: string
|
|
35
|
+
description: Glossary of terms
|
|
36
|
+
userPreferences:
|
|
37
|
+
type: string
|
|
38
|
+
description: User's saved preferences for content and documentation style
|
|
39
|
+
targetAudience:
|
|
40
|
+
type: string
|
|
41
|
+
description: Target audience for the documentation
|
|
42
|
+
title:
|
|
43
|
+
type: string
|
|
44
|
+
description: Document title
|
|
45
|
+
description:
|
|
46
|
+
type: string
|
|
47
|
+
description: Document description
|
|
48
|
+
needDataSources:
|
|
49
|
+
type: boolean
|
|
50
|
+
description: Whether data sources are needed for content modifications
|
|
51
|
+
required:
|
|
52
|
+
- originalContent
|
|
53
|
+
- feedback
|
|
54
|
+
output_key: message
|
|
55
|
+
afs:
|
|
56
|
+
modules:
|
|
57
|
+
- module: system-fs
|
|
58
|
+
options:
|
|
59
|
+
mount: /sources
|
|
60
|
+
path: .
|
|
61
|
+
description: |
|
|
62
|
+
Codebase of the project to be documented used as context for document generation,
|
|
63
|
+
should search and read as needed while generating document content
|
|
64
|
+
keep_text_in_tool_uses: false
|
|
65
|
+
skills:
|
|
66
|
+
- ./document-tools/update-document-content.mjs
|
|
67
|
+
# - ./generate-diagram.yaml
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
name: analyzeFeedbackIntent
|
|
2
|
+
description: Analyze user feedback to determine if data sources are needed for content modifications
|
|
3
|
+
model:
|
|
4
|
+
reasoning_effort: 200
|
|
5
|
+
task_render_mode: hide
|
|
6
|
+
instructions:
|
|
7
|
+
url: ../../prompts/utils/analyze-feedback-intent.md
|
|
8
|
+
input_schema:
|
|
9
|
+
type: object
|
|
10
|
+
properties:
|
|
11
|
+
feedback:
|
|
12
|
+
type: string
|
|
13
|
+
description: User feedback for content modifications
|
|
14
|
+
required:
|
|
15
|
+
- feedback
|
|
16
|
+
output_schema:
|
|
17
|
+
type: object
|
|
18
|
+
properties:
|
|
19
|
+
needDataSources:
|
|
20
|
+
type: boolean
|
|
21
|
+
description: Whether data sources are needed - true for add/edit operations that need context, false for delete/move/reorder operations
|
|
22
|
+
intentType:
|
|
23
|
+
type: string
|
|
24
|
+
description: The primary type of user intention
|
|
25
|
+
reason:
|
|
26
|
+
type: string
|
|
27
|
+
description: Explanation of why data sources are or aren't needed
|
|
28
|
+
required:
|
|
29
|
+
- needDataSources
|
|
30
|
+
- intentType
|
|
31
|
+
- reason
|
package/aigne.yaml
CHANGED
package/package.json
CHANGED
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
{{originalContent}}
|
|
16
16
|
</original_page_content>
|
|
17
17
|
|
|
18
|
+
{% if needDataSources %}
|
|
18
19
|
<detail_data_source>
|
|
19
20
|
|
|
20
21
|
{{ detailDataSource }}
|
|
@@ -28,6 +29,7 @@
|
|
|
28
29
|
{% endif %}
|
|
29
30
|
|
|
30
31
|
</detail_data_source>
|
|
32
|
+
{% endif %}
|
|
31
33
|
|
|
32
34
|
<user_feedback>
|
|
33
35
|
{{feedback}}
|
|
@@ -90,17 +90,4 @@ Analyze the user feedback to determine the intended operation:
|
|
|
90
90
|
</operation_output_constraints>
|
|
91
91
|
</operation_execution_rules>
|
|
92
92
|
|
|
93
|
-
<file_tool_usage>
|
|
94
|
-
1. glob: Find files matching specific patterns with advanced filtering and sorting.
|
|
95
|
-
|
|
96
|
-
2. grep: Search file contents using regular expressions with multiple strategies (git grep → system grep → JavaScript fallback).
|
|
97
|
-
|
|
98
|
-
3. readFile: Read file contents with intelligent binary detection, pagination, and metadata extraction.
|
|
99
|
-
|
|
100
|
-
When to use Tools:
|
|
101
|
-
- During document structure update, if the given context is missing or lacks referenced content, use glob/grep/readFile to obtain more context
|
|
102
|
-
- When sourceIds or file content from `<file_list>` is needed but not provided in `<data_sources>`, use readFile to read the file content
|
|
103
|
-
</file_tool_usage>
|
|
104
|
-
|
|
105
|
-
|
|
106
93
|
{% include "../../common/document-structure/output-constraints.md" %}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
<role>
|
|
2
|
+
You are a feedback intent analyzer. Your task is to determine whether data sources are needed to fulfill the user's feedback about content modifications.
|
|
3
|
+
</role>
|
|
4
|
+
|
|
5
|
+
<input>
|
|
6
|
+
- feedback: {{feedback}}
|
|
7
|
+
</input>
|
|
8
|
+
|
|
9
|
+
<analysis_rules>
|
|
10
|
+
**Determining Data Source Necessity:**
|
|
11
|
+
|
|
12
|
+
You need to analyze the user's feedback and categorize it into different intent types. Based on the intent type, determine if data sources are required.
|
|
13
|
+
|
|
14
|
+
This analyzer is generic and can be used for any content modification scenarios (documentation structure, document content, translations, etc.).
|
|
15
|
+
|
|
16
|
+
**Intent Types:**
|
|
17
|
+
|
|
18
|
+
1. **add** - Adding new items, sections, or content
|
|
19
|
+
- Requires data sources: **YES**
|
|
20
|
+
- Reason: Need sufficient context from codebase or related materials to generate accurate new content
|
|
21
|
+
|
|
22
|
+
2. **edit** - Modifying existing content, descriptions, titles, or properties
|
|
23
|
+
- Requires data sources: **YES**
|
|
24
|
+
- Reason: Need context to ensure modifications are accurate and contextually appropriate
|
|
25
|
+
|
|
26
|
+
3. **delete** - Removing items, sections, or content
|
|
27
|
+
- Requires data sources: **NO**
|
|
28
|
+
- Reason: Deletion only needs to identify what to remove, no new content generation needed
|
|
29
|
+
|
|
30
|
+
4. **move** - Moving items to different positions or parent sections
|
|
31
|
+
- Requires data sources: **NO**
|
|
32
|
+
- Reason: Only changing item location in the structure, no content changes needed
|
|
33
|
+
|
|
34
|
+
5. **reorder** - Changing the order of items at the same level
|
|
35
|
+
- Requires data sources: **NO**
|
|
36
|
+
- Reason: Only rearranging sequence, no content generation needed
|
|
37
|
+
|
|
38
|
+
6. **mixed** - Combination of multiple intent types
|
|
39
|
+
- Requires data sources: **Depends on whether add/edit operations are included**
|
|
40
|
+
- Reason: If the feedback includes any add or edit operations, data sources are needed
|
|
41
|
+
|
|
42
|
+
**Decision Logic:**
|
|
43
|
+
- If the feedback contains ANY add or edit operations → `needDataSources = true`
|
|
44
|
+
- If the feedback ONLY contains delete, move, or reorder operations → `needDataSources = false`
|
|
45
|
+
- When in doubt, default to `needDataSources = true` to ensure sufficient context
|
|
46
|
+
</analysis_rules>
|
|
47
|
+
|
|
48
|
+
<output_rules>
|
|
49
|
+
Return a JSON object with:
|
|
50
|
+
- `needDataSources`: boolean indicating if data sources are required
|
|
51
|
+
- `intentType`: the primary intent type (add, edit, delete, move, reorder, or mixed)
|
|
52
|
+
- `reason`: clear explanation of why data sources are or aren't needed
|
|
53
|
+
|
|
54
|
+
Analyze the feedback carefully and be conservative - when uncertain, prefer `needDataSources: true` to ensure sufficient context is available.
|
|
55
|
+
</output_rules>
|