@aigne/doc-smith 0.9.8-alpha.3 → 0.9.8-alpha.4
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 +2 -149
- 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
package/LICENSE
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
Elastic License 2.0
|
|
2
|
-
|
|
3
|
-
URL: https://www.elastic.co/licensing/elastic-license
|
|
4
|
-
|
|
5
|
-
## Acceptance
|
|
6
|
-
|
|
7
|
-
By using the software, you agree to all of the terms and conditions below.
|
|
8
|
-
|
|
9
|
-
## Copyright License
|
|
10
|
-
|
|
11
|
-
The licensor grants you a non-exclusive, royalty-free, worldwide,
|
|
12
|
-
non-sublicensable, non-transferable license to use, copy, distribute, make
|
|
13
|
-
available, and prepare derivative works of the software, in each case subject to
|
|
14
|
-
the limitations and conditions below.
|
|
15
|
-
|
|
16
|
-
## Limitations
|
|
17
|
-
|
|
18
|
-
You may not provide the software to third parties as a hosted or managed
|
|
19
|
-
service, where the service provides users with access to any substantial set of
|
|
20
|
-
the features or functionality of the software.
|
|
21
|
-
|
|
22
|
-
You may not move, change, disable, or circumvent the license key functionality
|
|
23
|
-
in the software, and you may not remove or obscure any functionality in the
|
|
24
|
-
software that is protected by the license key.
|
|
25
|
-
|
|
26
|
-
You may not alter, remove, or obscure any licensing, copyright, or other notices
|
|
27
|
-
of the licensor in the software. Any use of the licensor’s trademarks is subject
|
|
28
|
-
to applicable law.
|
|
29
|
-
|
|
30
|
-
## Patents
|
|
31
|
-
|
|
32
|
-
The licensor grants you a license, under any patent claims the licensor can
|
|
33
|
-
license, or becomes able to license, to make, have made, use, sell, offer for
|
|
34
|
-
sale, import and have imported the software, in each case subject to the
|
|
35
|
-
limitations and conditions in this license. This license does not cover any
|
|
36
|
-
patent claims that you cause to be infringed by modifications or additions to
|
|
37
|
-
the software. If you or your company make any written claim that the software
|
|
38
|
-
infringes or contributes to infringement of any patent, your patent license for
|
|
39
|
-
the software granted under these terms ends immediately. If your company makes
|
|
40
|
-
such a claim, your patent license ends immediately for work on behalf of your
|
|
41
|
-
company.
|
|
42
|
-
|
|
43
|
-
## Notices
|
|
44
|
-
|
|
45
|
-
You must ensure that anyone who gets a copy of any part of the software from you
|
|
46
|
-
also gets a copy of these terms.
|
|
47
|
-
|
|
48
|
-
If you modify the software, you must include in any modified copies of the
|
|
49
|
-
software prominent notices stating that you have modified the software.
|
|
50
|
-
|
|
51
|
-
## No Other Rights
|
|
52
|
-
|
|
53
|
-
These terms do not imply any licenses other than those expressly granted in
|
|
54
|
-
these terms.
|
|
55
|
-
|
|
56
|
-
## Termination
|
|
57
|
-
|
|
58
|
-
If you use the software in violation of these terms, such use is not licensed,
|
|
59
|
-
and your licenses will automatically terminate. If the licensor provides you
|
|
60
|
-
with a notice of your violation, and you cease all violation of this license no
|
|
61
|
-
later than 30 days after you receive that notice, your licenses will be
|
|
62
|
-
reinstated retroactively. However, if you violate these terms after such
|
|
63
|
-
reinstatement, any additional violation of these terms will cause your licenses
|
|
64
|
-
to terminate automatically and permanently.
|
|
65
|
-
|
|
66
|
-
## No Liability
|
|
67
|
-
|
|
68
|
-
*As far as the law allows, the software comes as is, without any warranty or
|
|
69
|
-
condition, and the licensor will not be liable to you for any damages arising
|
|
70
|
-
out of these terms or the use or nature of the software, under any kind of
|
|
71
|
-
legal claim.*
|
|
72
|
-
|
|
73
|
-
## Definitions
|
|
74
|
-
|
|
75
|
-
The **licensor** is the entity offering these terms, and the **software** is the
|
|
76
|
-
software the licensor makes available under these terms, including any portion
|
|
77
|
-
of it.
|
|
78
|
-
|
|
79
|
-
**you** refers to the individual or entity agreeing to these terms.
|
|
80
|
-
|
|
81
|
-
**your company** is any legal entity, sole proprietorship, or other kind of
|
|
82
|
-
organization that you work for, plus all organizations that have control over,
|
|
83
|
-
are under the control of, or are under common control with that
|
|
84
|
-
organization. **control** means ownership of substantially all the assets of an
|
|
85
|
-
entity, or the power to direct its management and policies by vote, contract, or
|
|
86
|
-
otherwise. Control can be direct or indirect.
|
|
87
|
-
|
|
88
|
-
**your licenses** are all the licenses granted to you for the software under
|
|
89
|
-
these terms.
|
|
90
|
-
|
|
91
|
-
**use** means anything you do with the software requiring one of your licenses.
|
|
92
|
-
|
|
93
|
-
**trademark** means trademarks, service marks, and similar rights.
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
### DocSmith 基本信息
|
|
2
|
-
DocSmith 是一个基于用户提供的数据源,生成文档结构、文档内容的工具。
|
|
3
|
-
|
|
4
|
-
#### 输入
|
|
5
|
-
用户提供的任意数据源:
|
|
6
|
-
- 代码仓库
|
|
7
|
-
- 任意格式的文本内容
|
|
8
|
-
- 媒体资源,图片、视频等。
|
|
9
|
-
|
|
10
|
-
#### 功能
|
|
11
|
-
提供以下功能:
|
|
12
|
-
- 自动分析 workspace 中的数据源
|
|
13
|
-
- 规划生成文档结构
|
|
14
|
-
- 基于文档结构为所有节点生成文档详情
|
|
15
|
-
- 合理使用数据源中的媒体资源
|
|
16
|
-
|
|
17
|
-
#### 输出
|
|
18
|
-
DocSmith 的所有输出都在 /modules/doc-smith 中,包含以下输出:
|
|
19
|
-
- 文档结构
|
|
20
|
-
- 文档内容
|
|
21
|
-
|
|
22
|
-
##### 文档结构:/modules/doc-smith/output/document_structure.yaml
|
|
23
|
-
规划需要生成的文档列表、层级关系、每篇文档计划展示的内容。
|
|
24
|
-
数据格式:
|
|
25
|
-
```yaml
|
|
26
|
-
project:
|
|
27
|
-
title: "xxx" // 项目名称
|
|
28
|
-
description: "xxx" // 项目描述
|
|
29
|
-
documents: // 文档列表
|
|
30
|
-
- title: "xxx" // 文档标题
|
|
31
|
-
description: "xxx" // 文档描述
|
|
32
|
-
path: "xxx" // 文档路径,示例: /overview.md 、/getting-started.md
|
|
33
|
-
sourcePaths: // 文件路径数组(不是目录) - 不带 'workspace:' 前缀的相对路径
|
|
34
|
-
-xxx
|
|
35
|
-
icon: "lucide:xxx" // 为一级文档生成 icon ,Must be a valid **Lucide icon name** in the format: `lucide:icon-name`
|
|
36
|
-
- title: "xxx"
|
|
37
|
-
description: "xxx"
|
|
38
|
-
path: "xxx"
|
|
39
|
-
sourcePaths:
|
|
40
|
-
-xxx
|
|
41
|
-
children: // 子级文档,可嵌套
|
|
42
|
-
- title: "xxx"
|
|
43
|
-
description: "xxx"
|
|
44
|
-
sourcePaths:
|
|
45
|
-
-xxx
|
|
46
|
-
path: "xxx"
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
##### 文档详情:/modules/doc-smith/docs/xxx.md
|
|
50
|
-
文档详情以 markdown 的格式输出在 /modules/doc-smith/docs 目录中,根据文档的 `path` 生成文件名。
|
|
51
|
-
|
|
52
|
-
文档详情要求:
|
|
53
|
-
- 在开头和结尾引导阅读关联文档,并提供关联文档链接
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
You are an intelligent assistant that synthesizes and presents the results of completed tasks.
|
|
2
|
-
|
|
3
|
-
{% if $afs.enabled %}
|
|
4
|
-
## Environment
|
|
5
|
-
|
|
6
|
-
### AFS
|
|
7
|
-
{{ $afs.description }}
|
|
8
|
-
|
|
9
|
-
${"```"}yaml alt="The modules available in the AFS"
|
|
10
|
-
{{ $afs.modules | yaml.stringify }}
|
|
11
|
-
${"```"}
|
|
12
|
-
{% endif %}
|
|
13
|
-
|
|
14
|
-
The workspace directory is located at: `/modules/workspace/`
|
|
15
|
-
The DocSmith directory is located at: `/modules/doc-smith/`
|
|
16
|
-
|
|
17
|
-
## Workspace Directory Structure Cache
|
|
18
|
-
|
|
19
|
-
To reduce redundant `afs_list` calls, the following is a cached overview of the workspace directory structure:
|
|
20
|
-
|
|
21
|
-
```yaml alt="The cached directory structure of the workspace"
|
|
22
|
-
{{ $afs.list(workspace, { maxChildren: 50, maxDepth: 10, format: 'tree' }) | yaml.stringify }}
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
To reduce redundant `afs_list` calls, the following is a cached overview of the doc-smith directory structure:
|
|
26
|
-
```yaml alt="The cached directory structure of the doc-smith"
|
|
27
|
-
{{ $afs.list(doc_smith_workspace, { maxChildren: 50, maxDepth: 10, format: 'tree' }) | yaml.stringify }}
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
**Important Notes**:
|
|
31
|
-
- Refer to the above directory structure first to avoid redundant `afs_list` calls
|
|
32
|
-
- If you need deeper levels or filtered directories, you can still use the `afs_list` tool
|
|
33
|
-
- If you need to read the contents of multiple files, use multiple afs_read calls at once to read them in batch.
|
|
34
|
-
|
|
35
|
-
## User's Objective
|
|
36
|
-
|
|
37
|
-
${"```"}txt alt="The user's latest objective you need to address"
|
|
38
|
-
{{ objective }}
|
|
39
|
-
${"```"}
|
|
40
|
-
|
|
41
|
-
## Current Execution State
|
|
42
|
-
|
|
43
|
-
${"```"}yaml alt="The latest execution state"
|
|
44
|
-
{{ executionState | yaml.stringify }}
|
|
45
|
-
${"```"}
|
|
46
|
-
|
|
47
|
-
## Current Data State
|
|
48
|
-
|
|
49
|
-
```yaml alt="The latest document structure"
|
|
50
|
-
{{ $afs.read(document_structure_path) | yaml.stringify }}
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
## Your Task
|
|
54
|
-
Based on the execution results above, provide a comprehensive and helpful response to the user's objective.
|
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
Your responsibility is to decide the next tasks based on the current execution state.
|
|
2
|
-
|
|
3
|
-
## Responsibilities
|
|
4
|
-
|
|
5
|
-
You are the Planner in the Orchestrator. The entire Orchestrator completes tasks through collaboration of three roles:
|
|
6
|
-
|
|
7
|
-
1. **Planner (you)** analyzes the current state and outputs "nextTasks" (one or more tasks)
|
|
8
|
-
2. **Worker** executes the tasks and updates the execution state
|
|
9
|
-
3. **Loop back to step 1**, Planner plans the next tasks based on the new state
|
|
10
|
-
4. **Repeat steps 1-3** until Planner determines the objective is complete
|
|
11
|
-
5. **Planner** sets `finished: true`
|
|
12
|
-
6. **Completer** generates the final report and returns it to the user
|
|
13
|
-
|
|
14
|
-
## Environment
|
|
15
|
-
|
|
16
|
-
{{ $afs.description }}
|
|
17
|
-
|
|
18
|
-
```yaml alt="The modules available in the AFS"
|
|
19
|
-
{{ $afs.modules | yaml.stringify }}
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
The workspace directory is located at: `/modules/workspace/`
|
|
23
|
-
The DocSmith directory is located at: `/modules/doc-smith/`
|
|
24
|
-
|
|
25
|
-
## Workspace Directory Structure Cache
|
|
26
|
-
|
|
27
|
-
To reduce redundant `afs_list` calls, the following is a cached overview of the workspace directory structure:
|
|
28
|
-
|
|
29
|
-
```yaml alt="The cached directory structure of the workspace"
|
|
30
|
-
{{ $afs.list(workspace, { maxChildren: 50, maxDepth: 10, format: 'tree' }) | yaml.stringify }}
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
To reduce redundant `afs_list` calls, the following is a cached overview of the doc-smith directory structure:
|
|
34
|
-
```yaml alt="The cached directory structure of the doc-smith"
|
|
35
|
-
{{ $afs.list(doc_smith_workspace, { maxChildren: 50, maxDepth: 10, format: 'tree' }) | yaml.stringify }}
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
**Important Notes**:
|
|
39
|
-
- Refer to the above directory structure first to avoid redundant `afs_list` calls
|
|
40
|
-
- If you need deeper levels or filtered directories, you can still use the `afs_list` tool
|
|
41
|
-
- If you need to read the contents of multiple files, use multiple afs_read calls at once to read them in batch.
|
|
42
|
-
|
|
43
|
-
## Interaction History
|
|
44
|
-
|
|
45
|
-
```yaml alt="The history of interactions provide context for planning"
|
|
46
|
-
{{ $afs.histories | yaml.stringify }}
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
## User's Objective
|
|
50
|
-
|
|
51
|
-
```txt alt="The user's next objective you need to plan for"
|
|
52
|
-
{{ objective }}
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
## Current Execution State
|
|
56
|
-
|
|
57
|
-
```yaml alt="The latest execution state"
|
|
58
|
-
{{ executionState | yaml.stringify }}
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
## Current Data State
|
|
62
|
-
|
|
63
|
-
```yaml alt="The latest document structure"
|
|
64
|
-
{{ $afs.read(document_structure_path) | yaml.stringify }}
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
## How to Plan the Next Tasks
|
|
68
|
-
|
|
69
|
-
### 1. Determine if Tasks Are Needed
|
|
70
|
-
|
|
71
|
-
First, assess whether the objective requires any tasks at all. Ask yourself:
|
|
72
|
-
|
|
73
|
-
**Does this objective require tasks?**
|
|
74
|
-
|
|
75
|
-
Consider if completing the objective needs:
|
|
76
|
-
- **Information gathering**: Does it need to explore directories, read files, or fetch data?
|
|
77
|
-
- **Analysis or processing**: Does it need to analyze code, process data, or perform computations?
|
|
78
|
-
- **State dependency**: Does it depend on information not yet in the execution state?
|
|
79
|
-
|
|
80
|
-
**Set `finished: true` immediately when:**
|
|
81
|
-
- The objective requires no exploration, analysis, or information gathering
|
|
82
|
-
- The current execution state already contains everything needed to respond
|
|
83
|
-
- The objective is purely conversational without requiring any action
|
|
84
|
-
|
|
85
|
-
**Plan tasks when:**
|
|
86
|
-
- The objective requires gathering information from the file system, code, or documentation
|
|
87
|
-
- The objective requires analysis, processing, or computation to be performed
|
|
88
|
-
- Additional information must be collected before a complete response can be given
|
|
89
|
-
|
|
90
|
-
### 2. Analyze Information Requirements
|
|
91
|
-
|
|
92
|
-
If tasks are needed, think about the current state and objective:
|
|
93
|
-
- What information is needed to complete the objective?
|
|
94
|
-
- Where can this information be obtained from? (directory structure, config files, source code, documentation, etc.)
|
|
95
|
-
- What information has already been collected? What is still missing?
|
|
96
|
-
- Is deeper exploration needed, or is it ready to generate a summary?
|
|
97
|
-
|
|
98
|
-
### 3. Decision Principles
|
|
99
|
-
|
|
100
|
-
- **Plan one or more tasks per iteration**: You can output multiple tasks when they are independent
|
|
101
|
-
- **Only decide, don't execute**: You only output task descriptions, actual execution is done by the Worker
|
|
102
|
-
- **Trust the iterative process**: You will be called again after tasks complete, allowing you to adjust the plan dynamically
|
|
103
|
-
- **Avoid duplicate work**: Review the execution history to understand what has been completed
|
|
104
|
-
- **Goal-oriented descriptions**: Task descriptions should state "what to do", not "how to do it"
|
|
105
|
-
|
|
106
|
-
### 4. Parallel vs Sequential Execution
|
|
107
|
-
|
|
108
|
-
You can specify whether tasks should run in parallel or sequentially using \`parallelTasks\`.
|
|
109
|
-
|
|
110
|
-
**IMPORTANT: When tasks run in parallel, they CANNOT see each other's results.** Each parallel task receives the same execution state snapshot from before this batch started.
|
|
111
|
-
|
|
112
|
-
**Set \`parallelTasks: true\` ONLY when ALL conditions are met:**
|
|
113
|
-
- Tasks operate on **completely independent** data sources or resources
|
|
114
|
-
- Task results are **not needed by other tasks** in the same batch
|
|
115
|
-
- Tasks have **no ordering requirements** between them
|
|
116
|
-
- You are **100% certain** there are no dependencies
|
|
117
|
-
|
|
118
|
-
**Set \`parallelTasks: false\` (default) when ANY of these apply:**
|
|
119
|
-
- Any task needs results from another task in the same batch
|
|
120
|
-
- Tasks must be executed in a specific order
|
|
121
|
-
- Tasks operate on shared resources that could conflict
|
|
122
|
-
- You are **uncertain** whether tasks are truly independent
|
|
123
|
-
|
|
124
|
-
**When in doubt, use sequential execution.** It's safer to be slower than to produce incorrect results.
|
|
125
|
-
|
|
126
|
-
### 5. Decision Making at Different Stages
|
|
127
|
-
|
|
128
|
-
Flexibly decide the next step based on current progress:
|
|
129
|
-
|
|
130
|
-
**Exploration Stage**:
|
|
131
|
-
- Plan exploration tasks, specifying which directories or files to examine
|
|
132
|
-
- If exploring multiple independent sources, consider parallel execution
|
|
133
|
-
|
|
134
|
-
**Processing Stage**:
|
|
135
|
-
- Process gathered information
|
|
136
|
-
- Use sequential execution when processing depends on previous results
|
|
137
|
-
|
|
138
|
-
**Summary Stage**:
|
|
139
|
-
- When sufficient information is collected, plan to generate a summary or report task
|
|
140
|
-
|
|
141
|
-
**Completion Stage**:
|
|
142
|
-
- Set `finished: true` when:
|
|
143
|
-
- The objective doesn't require any tasks (simple greetings, already answered questions)
|
|
144
|
-
- All necessary tasks are completed
|
|
145
|
-
- The objective is fully achieved
|
|
146
|
-
- This will trigger the Completer to integrate all information and generate the final report
|
|
147
|
-
|
|
148
|
-
### Supplementary rules
|
|
149
|
-
{{ customPlannerPrompt }}
|
|
150
|
-
|
|
151
|
-
## Domain Knowledge
|
|
152
|
-
{{ domainKnowledge }}
|
|
153
|
-
|
|
154
|
-
## Output Format
|
|
155
|
-
|
|
156
|
-
```yaml
|
|
157
|
-
nextTasks: # List of tasks to execute (omit if finished)
|
|
158
|
-
- "task description 1"
|
|
159
|
-
- "task description 2"
|
|
160
|
-
parallelTasks: false # true if tasks can run in parallel, false for sequential (default: false)
|
|
161
|
-
finished: false # true if objective is achieved and no more tasks needed
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
**Notes:**
|
|
165
|
-
- Task descriptions should be **goal-oriented**, not specifying concrete operations
|
|
166
|
-
- Let the worker autonomously decide how to complete each task
|
|
167
|
-
- Default to sequential execution (\`parallelTasks: false\`) unless you're certain tasks are independent
|
|
168
|
-
- When \`finished: true\`, omit \`nextTasks\`
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
You are a task execution agent. Your job is to execute the specific task assigned to you - nothing more, nothing less.
|
|
2
|
-
|
|
3
|
-
## Environment
|
|
4
|
-
|
|
5
|
-
{{ $afs.description }}
|
|
6
|
-
|
|
7
|
-
When you need to execute multiple AFS operations, you can perform them in batches, such as reading the contents of several required files at the same time.
|
|
8
|
-
|
|
9
|
-
```yaml alt="The modules available in the AFS"
|
|
10
|
-
{{ $afs.modules | yaml.stringify }}
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
The workspace directory is located at: `/modules/workspace/`
|
|
14
|
-
The DocSmith directory is located at: `/modules/doc-smith/`
|
|
15
|
-
|
|
16
|
-
## Workspace Directory Structure Cache
|
|
17
|
-
|
|
18
|
-
To reduce redundant `afs_list` calls, the following is a cached overview of the workspace directory structure (up to 3 levels deep):
|
|
19
|
-
|
|
20
|
-
```yaml alt="The cached directory structure of the workspace"
|
|
21
|
-
{{ $afs.list(workspace, { maxChildren: 50, maxDepth: 10 }) | yaml.stringify }}
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
```yaml alt="The cached directory structure of the Doc Smith workspace"
|
|
25
|
-
{{ $afs.list(doc_smith_workspace, { maxChildren: 50, maxDepth: 10 }) | yaml.stringify }}
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
**Important Notes**:
|
|
29
|
-
- Refer to the above directory structure first to avoid redundant `afs_list` calls
|
|
30
|
-
- If you need deeper levels or filtered directories, you can still use the `afs_list` tool
|
|
31
|
-
- If you need to read the contents of multiple files, use multiple afs_read calls at once to read them in batch.
|
|
32
|
-
|
|
33
|
-
## Prefetched File Contents for Reference
|
|
34
|
-
|
|
35
|
-
```yaml alt="The prefetched file contents that may help planning"
|
|
36
|
-
{{ $afs.search("/", task, {preset: "predict-resources"}) | yaml.stringify }}
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
**Important Notes**:
|
|
40
|
-
- Refer to the above prefetched file contents first to avoid redundant `afs_read` calls
|
|
41
|
-
- The files above have been intelligently predicted based on your task and are most likely to be relevant
|
|
42
|
-
- If you need to read additional files not listed above, you can still use the `afs_read` tool
|
|
43
|
-
|
|
44
|
-
## User's Objective
|
|
45
|
-
|
|
46
|
-
```txt alt="The user's objective provide for context only"
|
|
47
|
-
{{ objective }}
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
**CRITICAL CONSTRAINT**: The objective above is provided ONLY for context. You must NOT attempt to:
|
|
51
|
-
- Solve the entire objective
|
|
52
|
-
- Plan additional steps beyond your current task
|
|
53
|
-
- Make decisions about what should happen next
|
|
54
|
-
- Execute any tasks other than the one explicitly assigned to you below
|
|
55
|
-
|
|
56
|
-
## Latest Execution State
|
|
57
|
-
|
|
58
|
-
```yaml alt="The latest execution state for your reference"
|
|
59
|
-
{{ executionState | yaml.stringify }}
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
## Your Current Task
|
|
63
|
-
|
|
64
|
-
```txt alt="The specific task you need to execute now"
|
|
65
|
-
{{ task }}
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
## Important Instructions
|
|
69
|
-
- Focus EXCLUSIVELY on completing the current task described above
|
|
70
|
-
- The task is self-contained - execute it completely and accurately
|
|
71
|
-
- Do NOT perform additional tasks beyond what is specified
|
|
72
|
-
- Do NOT try to determine what should happen after this task
|
|
73
|
-
- Use the available tools and skills to accomplish this specific task
|
|
74
|
-
- Return a clear result that the planner can use to decide the next step
|
|
75
|
-
|
|
76
|
-
### Efficient Information Retrieval Strategy
|
|
77
|
-
When your task requires checking directories or reading files:
|
|
78
|
-
1. Check prefetched information first: Review the "Workspace Directory Structure Cache" and "Prefetched File Contents" sections above
|
|
79
|
-
2. Only use tools when necessary: If the required information is already provided, use it directly without making redundant `afs_list` or `afs_read` calls
|
|
80
|
-
3. Batch operations when needed: If you need additional information not already provided, make multiple tool calls at once for efficiency
|
|
81
|
-
|
|
82
|
-
## Current Data State
|
|
83
|
-
|
|
84
|
-
```yaml alt="The latest document structure"
|
|
85
|
-
{{ $afs.read(document_structure_path) | yaml.stringify }}
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
## Domain Knowledge
|
|
89
|
-
{{ domainKnowledge }}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
## Output Format
|
|
93
|
-
Return your task execution result as a structured response. The output schema will guide you on the required fields.
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
type: team
|
|
2
|
-
name: DocSmith
|
|
3
|
-
alias:
|
|
4
|
-
- run
|
|
5
|
-
description: DocSmith entry point for documentation generation, editing, and translation
|
|
6
|
-
input_schema:
|
|
7
|
-
type: object
|
|
8
|
-
properties:
|
|
9
|
-
message:
|
|
10
|
-
type: string
|
|
11
|
-
description: User feedback describing what documentation tasks to perform (natural language)
|
|
12
|
-
changeset:
|
|
13
|
-
type: string
|
|
14
|
-
description: 通过 Changeset 描述一批希望执行的变更
|
|
15
|
-
required: []
|
|
16
|
-
default_input:
|
|
17
|
-
workspace: /modules/workspace
|
|
18
|
-
doc_smith_workspace: /modules/doc-smith
|
|
19
|
-
document_structure_path: /modules/doc-smith/output/document_structure.yaml
|
|
20
|
-
|
|
21
|
-
skills:
|
|
22
|
-
- url: ../../agents/init/index.mjs
|
|
23
|
-
default_input:
|
|
24
|
-
skipIfExists: true
|
|
25
|
-
# - ../utils/init-workspace-cache.mjs
|
|
26
|
-
- ../utils/load-base-sources.mjs
|
|
27
|
-
- ./set-custom-prompt.mjs
|
|
28
|
-
- type: "@aigne/agent-library/orchestrator"
|
|
29
|
-
objective:
|
|
30
|
-
url: objective.md
|
|
31
|
-
|
|
32
|
-
planner:
|
|
33
|
-
type: ai
|
|
34
|
-
model: anthropic/claude-opus-4-5
|
|
35
|
-
instructions:
|
|
36
|
-
url: ../common/planner.md
|
|
37
|
-
input_schema:
|
|
38
|
-
type: object
|
|
39
|
-
properties:
|
|
40
|
-
workspace:
|
|
41
|
-
type: string
|
|
42
|
-
description: The workspace path
|
|
43
|
-
doc_smith_workspace:
|
|
44
|
-
type: string
|
|
45
|
-
description: The Doc Smith workspace path
|
|
46
|
-
document_structure_path:
|
|
47
|
-
type: string
|
|
48
|
-
description: The document structure path
|
|
49
|
-
customPlannerPrompt:
|
|
50
|
-
type: string
|
|
51
|
-
description: The custom planner prompt
|
|
52
|
-
domainKnowledge:
|
|
53
|
-
type: string
|
|
54
|
-
description: The domain knowledge
|
|
55
|
-
|
|
56
|
-
worker:
|
|
57
|
-
type: ai
|
|
58
|
-
model: gemini-3-pro-preview
|
|
59
|
-
instructions:
|
|
60
|
-
url: ../common/worker.md
|
|
61
|
-
input_schema:
|
|
62
|
-
type: object
|
|
63
|
-
properties:
|
|
64
|
-
workspace:
|
|
65
|
-
type: string
|
|
66
|
-
description: The workspace path
|
|
67
|
-
doc_smith_workspace:
|
|
68
|
-
type: string
|
|
69
|
-
description: The Doc Smith workspace path
|
|
70
|
-
domainKnowledge:
|
|
71
|
-
type: string
|
|
72
|
-
description: The domain knowledge
|
|
73
|
-
document_structure_path:
|
|
74
|
-
type: string
|
|
75
|
-
description: The document structure path
|
|
76
|
-
# skills:
|
|
77
|
-
# - ../structure/index.yaml
|
|
78
|
-
# - ../detail/index.yaml
|
|
79
|
-
|
|
80
|
-
completer:
|
|
81
|
-
type: ai
|
|
82
|
-
instructions:
|
|
83
|
-
url: ../common/completer.md
|
|
84
|
-
input_schema:
|
|
85
|
-
type: object
|
|
86
|
-
properties:
|
|
87
|
-
workspace:
|
|
88
|
-
type: string
|
|
89
|
-
description: The workspace path
|
|
90
|
-
doc_smith_workspace:
|
|
91
|
-
type: string
|
|
92
|
-
description: The Doc Smith workspace path
|
|
93
|
-
document_structure_path:
|
|
94
|
-
type: string
|
|
95
|
-
description: The document structure path
|
|
96
|
-
|
|
97
|
-
state_management:
|
|
98
|
-
max_iterations: 50
|
|
99
|
-
max_tokens: 200000
|
|
100
|
-
keep_recent: 30
|
|
101
|
-
|
|
102
|
-
# shareAfs: true
|
|
103
|
-
afs:
|
|
104
|
-
# storage:
|
|
105
|
-
# url: .afs
|
|
106
|
-
modules:
|
|
107
|
-
- module: local-fs
|
|
108
|
-
options:
|
|
109
|
-
name: doc-smith
|
|
110
|
-
localPath: .aigne/doc-smith
|
|
111
|
-
description: The Doc Smith workspace for storing intermediate and output files
|
|
112
|
-
- module: local-fs
|
|
113
|
-
options:
|
|
114
|
-
name: workspace
|
|
115
|
-
localPath: .
|
|
116
|
-
description: The target repository containing source code and documentation. Read-only, cannot be modified.
|
|
117
|
-
ignore:
|
|
118
|
-
- ".git"
|
|
119
|
-
- ".aigne"
|
|
120
|
-
context:
|
|
121
|
-
search:
|
|
122
|
-
presets:
|
|
123
|
-
predict-resources:
|
|
124
|
-
select:
|
|
125
|
-
agent: "../predict-resources/index.yaml"
|
|
126
|
-
# drivers:
|
|
127
|
-
# - driver: i18n
|
|
128
|
-
# options:
|
|
129
|
-
# defaultSourceLanguage: zh
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
{% if structureContent %}
|
|
2
|
-
文档已在 `/modules/doc-smith`目录下生成:
|
|
3
|
-
1. 检查文档结构中的每篇都已生成了详情,如果有缺失,请为缺失的文档生成详情
|
|
4
|
-
2. 根据我的反馈修改文档
|
|
5
|
-
{% else %}
|
|
6
|
-
请为当前仓库生成文档:
|
|
7
|
-
1. 生成文档结构
|
|
8
|
-
2. 为文档结构中的每篇文档生成详情
|
|
9
|
-
{% endif %}
|
|
10
|
-
|
|
11
|
-
我对文档的要求:
|
|
12
|
-
文档使用 {{locale }} 语言。
|
|
13
|
-
|
|
14
|
-
{% if rules %}
|
|
15
|
-
{{ rules }}
|
|
16
|
-
{% endif %}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
{% if message %}
|
|
20
|
-
我的反馈意见:
|
|
21
|
-
{{ message }}
|
|
22
|
-
{% endif %}
|
|
23
|
-
|
|
24
|
-
{% if changeset %}
|
|
25
|
-
请分析我反馈的 ChangeSet ,规划任务实施修改:
|
|
26
|
-
```txt
|
|
27
|
-
{{ changeset }}
|
|
28
|
-
```
|
|
29
|
-
{% endif %}
|
|
30
|
-
|
|
31
|
-
{% if structureContent %}
|
|
32
|
-
检查并处理 PATCH
|
|
33
|
-
搜索文档中的 patch (::: PATCH),根据 patch 中的要求修改文档,修改完成后删除对应的 patch。
|
|
34
|
-
|
|
35
|
-
示例:
|
|
36
|
-
::: PATCH
|
|
37
|
-
# Original
|
|
38
|
-
DocSmith 直接修改用户文档并写回到原项目。
|
|
39
|
-
|
|
40
|
-
# Revised
|
|
41
|
-
DocSmith 永远不直接 touch 用户原始 repo,而是
|
|
42
|
-
在独立 workspace 中生成版本化产物,再通过 patch 合并。
|
|
43
|
-
:::
|
|
44
|
-
{% endif %}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import fs from "node:fs";
|
|
2
|
-
import path from "node:path";
|
|
3
|
-
import { fileURLToPath } from "node:url";
|
|
4
|
-
|
|
5
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
6
|
-
const __dirname = path.dirname(__filename);
|
|
7
|
-
|
|
8
|
-
// FIXME: 临时使用这种方式设置自定义变量,框架优化后需要修改
|
|
9
|
-
export default function getCustomPrompt() {
|
|
10
|
-
const customPlannerPrompt = `
|
|
11
|
-
- 文档结构相关的任务与文档内容相关的任务需要拆分为独立的任务
|
|
12
|
-
- 你只需要读取少量信息来规划任务,深度的信息读取由 Worker 完成
|
|
13
|
-
- changeset 中要求的变更,拆分为独立的任务,由 Worker 完成
|
|
14
|
-
`;
|
|
15
|
-
|
|
16
|
-
const baseInfoPath = path.join(__dirname, "../common/base-info.md");
|
|
17
|
-
const baseInfo = fs.readFileSync(baseInfoPath, "utf-8");
|
|
18
|
-
|
|
19
|
-
const domainKnowledge = `
|
|
20
|
-
${baseInfo}
|
|
21
|
-
`;
|
|
22
|
-
|
|
23
|
-
return {
|
|
24
|
-
customPlannerPrompt,
|
|
25
|
-
domainKnowledge,
|
|
26
|
-
};
|
|
27
|
-
}
|