@aigne/doc-smith 0.8.11-beta.6 → 0.8.11-beta.7

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.
Files changed (116) hide show
  1. package/.aigne/doc-smith/config.yaml +2 -0
  2. package/.aigne/doc-smith/output/structure-plan.json +2 -2
  3. package/.aigne/doc-smith/preferences.yml +28 -20
  4. package/.aigne/doc-smith/upload-cache.yaml +702 -0
  5. package/.release-please-manifest.json +1 -1
  6. package/CHANGELOG.md +13 -0
  7. package/README.md +1 -1
  8. package/agents/generate/document-structure-tools/add-document.mjs +35 -10
  9. package/agents/generate/document-structure-tools/delete-document.mjs +35 -12
  10. package/agents/generate/document-structure-tools/move-document.mjs +43 -17
  11. package/agents/generate/document-structure-tools/update-document.mjs +37 -10
  12. package/agents/generate/update-document-structure.yaml +1 -7
  13. package/agents/generate/user-review-document-structure.mjs +5 -4
  14. package/agents/translate/translate-document.yaml +1 -9
  15. package/agents/update/check-update-is-single.mjs +2 -1
  16. package/agents/update/document-tools/update-document-content.mjs +24 -14
  17. package/agents/update/fs-tools/glob.mjs +184 -0
  18. package/agents/update/fs-tools/grep.mjs +317 -0
  19. package/agents/update/fs-tools/read-file.mjs +307 -0
  20. package/agents/update/generate-document.yaml +4 -7
  21. package/agents/update/update-document-detail.yaml +6 -10
  22. package/agents/update/user-review-document.mjs +13 -13
  23. package/assets/screenshots/doc-complete-setup.png +0 -0
  24. package/assets/screenshots/doc-generate-docs.png +0 -0
  25. package/assets/screenshots/doc-generate.png +0 -0
  26. package/assets/screenshots/doc-generated-successfully.png +0 -0
  27. package/assets/screenshots/doc-publish.png +0 -0
  28. package/assets/screenshots/doc-regenerate.png +0 -0
  29. package/assets/screenshots/doc-translate-langs.png +0 -0
  30. package/assets/screenshots/doc-translate.png +0 -0
  31. package/assets/screenshots/doc-update.png +0 -0
  32. package/docs/advanced-how-it-works.ja.md +31 -31
  33. package/docs/advanced-how-it-works.md +9 -9
  34. package/docs/advanced-how-it-works.zh-TW.md +24 -24
  35. package/docs/advanced-how-it-works.zh.md +20 -20
  36. package/docs/advanced-quality-assurance.ja.md +57 -61
  37. package/docs/advanced-quality-assurance.md +57 -61
  38. package/docs/advanced-quality-assurance.zh-TW.md +57 -61
  39. package/docs/advanced-quality-assurance.zh.md +57 -61
  40. package/docs/advanced.ja.md +8 -4
  41. package/docs/advanced.md +7 -3
  42. package/docs/advanced.zh-TW.md +9 -5
  43. package/docs/advanced.zh.md +9 -5
  44. package/docs/changelog.ja.md +206 -29
  45. package/docs/changelog.md +177 -0
  46. package/docs/changelog.zh-TW.md +229 -52
  47. package/docs/changelog.zh.md +204 -27
  48. package/docs/cli-reference.ja.md +82 -52
  49. package/docs/cli-reference.md +56 -26
  50. package/docs/cli-reference.zh-TW.md +82 -52
  51. package/docs/cli-reference.zh.md +70 -40
  52. package/docs/configuration-interactive-setup.ja.md +45 -42
  53. package/docs/configuration-interactive-setup.md +8 -5
  54. package/docs/configuration-interactive-setup.zh-TW.md +26 -23
  55. package/docs/configuration-interactive-setup.zh.md +25 -22
  56. package/docs/configuration-language-support.ja.md +33 -63
  57. package/docs/configuration-language-support.md +32 -62
  58. package/docs/configuration-language-support.zh-TW.md +35 -65
  59. package/docs/configuration-language-support.zh.md +32 -62
  60. package/docs/configuration-llm-setup.ja.md +25 -23
  61. package/docs/configuration-llm-setup.md +20 -18
  62. package/docs/configuration-llm-setup.zh-TW.md +21 -19
  63. package/docs/configuration-llm-setup.zh.md +20 -18
  64. package/docs/configuration-preferences.ja.md +67 -52
  65. package/docs/configuration-preferences.md +56 -41
  66. package/docs/configuration-preferences.zh-TW.md +69 -54
  67. package/docs/configuration-preferences.zh.md +68 -53
  68. package/docs/configuration.ja.md +65 -81
  69. package/docs/configuration.md +19 -35
  70. package/docs/configuration.zh-TW.md +62 -79
  71. package/docs/configuration.zh.md +50 -67
  72. package/docs/features-generate-documentation.ja.md +44 -69
  73. package/docs/features-generate-documentation.md +36 -61
  74. package/docs/features-generate-documentation.zh-TW.md +42 -67
  75. package/docs/features-generate-documentation.zh.md +41 -67
  76. package/docs/features-publish-your-docs.ja.md +36 -36
  77. package/docs/features-publish-your-docs.md +2 -2
  78. package/docs/features-publish-your-docs.zh-TW.md +21 -21
  79. package/docs/features-publish-your-docs.zh.md +23 -23
  80. package/docs/features-translate-documentation.ja.md +40 -31
  81. package/docs/features-translate-documentation.md +15 -6
  82. package/docs/features-translate-documentation.zh-TW.md +37 -28
  83. package/docs/features-translate-documentation.zh.md +23 -14
  84. package/docs/features-update-and-refine.ja.md +68 -118
  85. package/docs/features-update-and-refine.md +58 -108
  86. package/docs/features-update-and-refine.zh-TW.md +67 -116
  87. package/docs/features-update-and-refine.zh.md +64 -114
  88. package/docs/features.ja.md +29 -19
  89. package/docs/features.md +25 -15
  90. package/docs/features.zh-TW.md +28 -18
  91. package/docs/features.zh.md +31 -21
  92. package/docs/getting-started.ja.md +40 -43
  93. package/docs/getting-started.md +36 -39
  94. package/docs/getting-started.zh-TW.md +38 -41
  95. package/docs/getting-started.zh.md +45 -48
  96. package/docs/overview.ja.md +63 -11
  97. package/docs/overview.md +60 -8
  98. package/docs/overview.zh-TW.md +67 -15
  99. package/docs/overview.zh.md +62 -10
  100. package/media.md +9 -9
  101. package/package.json +1 -1
  102. package/prompts/detail/custom/custom-components.md +304 -188
  103. package/prompts/detail/document-rules.md +4 -4
  104. package/prompts/detail/generate-document.md +21 -8
  105. package/prompts/detail/update-document.md +8 -12
  106. package/prompts/structure/update-document-structure.md +12 -8
  107. package/prompts/utils/feedback-refiner.md +3 -3
  108. package/tests/agents/generate/document-structure-tools/move-document.test.mjs +9 -9
  109. package/tests/agents/generate/user-review-document-structure.test.mjs +29 -8
  110. package/tests/agents/update/document-tools/update-document-content.test.mjs +115 -112
  111. package/tests/agents/update/fs-tools/glob.test.mjs +438 -0
  112. package/tests/agents/update/fs-tools/grep.test.mjs +279 -0
  113. package/tests/agents/update/fs-tools/read-file.test.mjs +553 -0
  114. package/tests/agents/update/user-review-document.test.mjs +48 -27
  115. package/types/document-schema.mjs +5 -6
  116. package/types/document-structure-schema.mjs +20 -8
@@ -1,44 +1,46 @@
1
1
  # LLM 设置
2
2
 
3
- AIGNE DocSmith 使用大语言模型 (LLMs) 生成文档内容。您可以通过两种方式配置 AI 模型提供商:使用集成的 AIGNE Hub,或连接您自己的自定义 API 密钥。
3
+ AIGNE DocSmith 使用大语言模型 (LLM) 生成文档内容。配置 AI 模型提供商主要有两种方法:利用集成的 AIGNE Hub,或连接您选择的提供商的自定义 API 密钥。
4
4
 
5
5
  ## AIGNE Hub (推荐)
6
6
 
7
- 最直接的入门方式是使用 AIGNE Hub。它充当多个 LLM 提供商的网关,提供两大主要优势:
7
+ 配置 LLM 最直接的方法是通过 AIGNE Hub。它作为多个 LLM 提供商的网关,提供两大优势:
8
8
 
9
9
  - **无需 API 密钥:** 您无需管理自己的 API 密钥或服务订阅即可生成文档。
10
- - **轻松切换模型:** 您可以使用 `--model` 标志为任何命令更改 AI 模型。
10
+ - **灵活切换模型:** 您可以使用 `--model` 标志为任何命令更改 AI 模型。
11
11
 
12
- 要通过 AIGNE Hub 使用特定模型,请在命令中添加 `--model` 标志。以下是一些示例:
12
+ 要通过 AIGNE Hub 使用特定模型,请在命令后附加 `--model` 标志。以下示例演示了其用法:
13
13
 
14
14
  ```bash 通过 AIGNE Hub 使用不同模型 icon=mdi:code-braces
15
- # 使用 Google 的 Gemini 2.5 Flash 模型
16
- aigne doc generate --model google:gemini-2.5-flash
17
-
18
- # 使用 Anthropic 的 Claude 3.5 Sonnet 模型
19
- aigne doc generate --model claude:claude-3-5-sonnet
20
-
21
15
  # 使用 OpenAI 的 GPT-4o 模型
22
16
  aigne doc generate --model openai:gpt-4o
17
+
18
+ # 使用 Anthropic 的 Claude 4.5 Sonnet 模型
19
+ aigne doc generate --model anthropic:claude-sonnet-4-5
20
+
21
+ # 使用 Google 的 Gemini 2.5 Pro 模型
22
+ aigne doc generate --model google:gemini-2.5-pro
23
23
  ```
24
24
 
25
- 如果您未指定模型,DocSmith 将使用您项目配置中定义的默认模型。
25
+ 如果未指定 `--model` 标志,DocSmith 将默认使用项目配置文件中定义的模型。
26
26
 
27
27
  ## 使用自定义 API 密钥
28
28
 
29
- 如果您更喜欢使用自己在 OpenAI 或 Anthropic 等提供商处的账户,可以用您的个人 API 密钥配置 DocSmith。这种方法让您可以直接控制 API 的使用和计费。
29
+ 对于希望使用自己在 OpenAI、AnthropicGoogle 等提供商处的账户的用户,可以使用个人 API 密钥配置 DocSmith。这种方法可以对 API 使用和计费进行直接控制。
30
30
 
31
- 配置通过一个交互式向导进行。要启动它,请运行以下命令:
31
+ 配置通过交互式向导进行。要启动它,请运行以下命令:
32
32
 
33
- ```bash
33
+ ```bash 启动交互式向导 icon=lucide:magic-wand
34
34
  aigne doc init
35
35
  ```
36
36
 
37
- 该向导将提示您选择提供商并输入凭据。有关完整指南,请参阅 [交互式设置](./configuration-interactive-setup.md) 文档。
37
+ 向导将提示您选择提供商并输入必要的凭据。有关此过程的完整分步指南,请参阅[交互式设置](./configuration-interactive-setup.md)文档。
38
38
 
39
39
  ## 设置默认模型
40
40
 
41
- 为了在所有文档生成任务中保持一致性,您可以在项目的 `aigne.yaml` 配置文件中设置一个默认 LLM。任何不包含 `--model` 标志的命令都将使用此模型。
41
+ 为了在所有文档生成任务中保持一致性,可以在项目的 `aigne.yaml` 配置文件中设置默认的 LLM。任何未明确包含 `--model` 标志的命令都将使用此模型。
42
+
43
+ 以下是配置示例:
42
44
 
43
45
  ```yaml aigne.yaml icon=mdi:file-code
44
46
  chat_model:
@@ -47,8 +49,8 @@ chat_model:
47
49
  temperature: 0.8
48
50
  ```
49
51
 
50
- 在此示例中,DocSmith 被配置为默认使用 Google 的 `gemini-2.5-pro` 模型,并将 `temperature` 设置为 `0.8`。
52
+ 在此示例中,DocSmith 配置为使用 Google 的 `gemini-2.5-pro` 模型,并将 `temperature` 设置为 `0.8` 作为所有生成任务的默认值。
51
53
 
52
54
  ---
53
55
 
54
- 配置好您的 LLM 提供商后,您就可以管理文档的语言设置了。请继续阅读 [语言支持](./configuration-language-support.md) 指南,以查看支持语言的完整列表并了解如何启用它们。
56
+ 配置好 LLM 提供商后,下一步是管理文档的语言设置。请前往[语言支持](./configuration-language-support.md)指南,查看支持的语言完整列表并了解如何启用它们。
@@ -1,78 +1,93 @@
1
1
  # プリファレンスの管理
2
2
 
3
- AIGNE DocSmithは、ユーザーのフィードバックから学習するように設計されています。生成されたコンテンツを調整または修正すると、DocSmithはそのフィードバックを「プリファレンス」と呼ばれる永続的なルールに変換できます。これらのルールにより、特定のスタイル、構造要件、コンテンツポリシーが将来のドキュメント作成タスクで一貫して適用されるようになります。すべてのプリファレンスは、プロジェクトのルートにある人間が読めるYAMLファイル `.aigne/doc-smith/preferences.yml` に保存されます。
3
+ AIGNE DocSmith は、フィードバックから学習するように設計されています。生成されたコンテンツを改良または修正すると、DocSmith はそのフィードバックをプリファレンスと呼ばれる永続的なルールに変換できます。これらのルールにより、特定のスタイル、構造要件、コンテンツポリシーが将来のドキュメント作成タスクで一貫して適用されるようになります。すべてのプリファレンスは、プロジェクトルートの `.aigne/doc-smith/preferences.yml` にある人間が読めるYAMLファイルに保存されます。
4
4
 
5
5
  ## プリファレンスのライフサイクル
6
6
 
7
- 次の図は、フィードバックが再利用可能なルールとなり、将来のタスクに適用され、コマンドラインから管理されるまでの流れを示しています。
7
+ 次の図は、フィードバックが再利用可能なルールになり、将来のタスクに適用され、コマンドラインから管理される方法を示しています。
8
8
 
9
9
  ```d2 プリファレンスのライフサイクル
10
10
  direction: down
11
11
 
12
- feedback: {
13
- label: "1. ユーザーが「refine」または「translate」中に\nフィードバックを提供"
14
- shape: rectangle
12
+ developer: {
13
+ label: "開発者"
14
+ shape: person
15
15
  }
16
16
 
17
- refiner: {
18
- label: "2. Feedback Refiner Agentが\nフィードバックを分析"
17
+ docsmith_system: {
18
+ label: "AIGNE DocSmith システム"
19
19
  shape: rectangle
20
- }
21
20
 
22
- decision: {
23
- label: "再利用可能なポリシーか?"
24
- shape: diamond
21
+ cli: {
22
+ label: "CLI コマンド\n(refine / translate)"
23
+ shape: rectangle
24
+ }
25
+
26
+ agent: {
27
+ label: "内部分析 Agent"
28
+ shape: rectangle
29
+ }
30
+
31
+ decision: {
32
+ label: "フィードバックは\n再利用可能なポリシーか?"
33
+ shape: diamond
34
+ }
35
+
36
+ create_rule: {
37
+ label: "新しいプリファレンスルールを作成"
38
+ shape: rectangle
39
+ }
25
40
  }
26
41
 
27
- pref_file: {
28
- label: "3. preferences.yml\nルールが保存される"
42
+ preferences_file: {
43
+ label: ".aigne/doc-smith/preferences.yml"
29
44
  shape: cylinder
30
45
  }
31
46
 
32
- future_tasks: {
33
- label: "4. 将来のタスク\n保存されたルールが適用される"
34
- shape: rectangle
35
- }
36
-
37
- cli: {
38
- label: "5. CLI管理\n('aigne doc prefs')"
39
- shape: rectangle
47
+ one_time_fix: {
48
+ label: "一度限りの修正として適用"
49
+ shape: oval
40
50
  }
41
51
 
42
- feedback -> refiner: "入力"
43
- refiner -> decision: "分析"
44
- decision -> pref_file: "はい"
45
- decision -> "破棄(一度限りの修正)": "いいえ"
46
- pref_file -> future_tasks: "適用される"
47
- cli <-> pref_file: "管理"
48
-
52
+ developer -> docsmith_system.cli: "1. フィードバックを提供"
53
+ docsmith_system.cli -> docsmith_system.agent: "2. フィードバックをキャプチャ"
54
+ docsmith_system.agent -> docsmith_system.decision: "3. 分析"
55
+ docsmith_system.decision -> docsmith_system.create_rule: "はい"
56
+ docsmith_system.create_rule -> preferences_file: "4. ルールをファイルに保存"
57
+ docsmith_system.decision -> one_time_fix: "いいえ"
49
58
  ```
50
59
 
51
- ### プリファレンスが作成される仕組み
60
+ ### プリファレンスの作成方法
52
61
 
53
- `refine` または `translate` の段階でフィードバックを提供すると、内部のAgentがその入力を分析します。フィードバックが一度限りの修正(例:タイポの修正)なのか、再利用可能なポリシー(例:「コードコメントは常に英語で書く」)なのかを判断します。それが永続的な指示であると判断された場合、新しいプリファレンスルールが作成されます。
62
+ `refine` または `translate` の段階でフィードバックを提供すると、内部 Agent が入力を分析します。フィードバックが一度限りの修正(例:タイポの修正)か、再利用可能なポリシー(例:「コードコメントは常に英語で書く」)かを判断します。それが永続的な指示を表す場合、新しいプリファレンスルールを作成し、プロジェクトの `preferences.yml` ファイルに保存します。
54
63
 
55
64
  ### ルールのプロパティ
56
65
 
57
- `preferences.yml` に保存される各ルールは、次の構造を持っています:
58
-
59
- <x-field data-name="id" data-type="string" data-desc="ルールの一意なランダムに生成された識別子(例:pref_a1b2c3d4e5f6g7h8)。"></x-field>
60
- <x-field data-name="active" data-type="boolean" data-desc="ルールが現在有効かどうかを示します。無効なルールは生成タスク中に無視されます。"></x-field>
61
- <x-field data-name="scope" data-type="string" data-desc="ルールをいつ適用するかを定義します。有効なスコープは 'global'、'structure'、'document'、または 'translation' です。"></x-field>
62
- <x-field data-name="rule" data-type="string" data-desc="将来のタスクでAIに渡される、具体的で洗練された指示。"></x-field>
63
- <x-field data-name="feedback" data-type="string" data-desc="参照用に保存される、ユーザーが提供した元の自然言語のフィードバック。"></x-field>
64
- <x-field data-name="createdAt" data-type="string" data-desc="ルールが作成された日時を示すISO 8601形式のタイムスタンプ。"></x-field>
65
- <x-field data-name="paths" data-type="string[]" data-required="false" data-desc="オプションのファイルパスのリスト。存在する場合、ルールはこれらの特定のソースファイルに対して生成されたコンテンツにのみ適用されます。"></x-field>
66
+ `preferences.yml` に保存される各ルールは、次の構造を持ちます。
67
+
68
+ <x-field-group>
69
+ <x-field data-name="id" data-type="string" data-desc="ルールの一意でランダムに生成された識別子(例:pref_a1b2c3d4e5f6g7h8)。"></x-field>
70
+ <x-field data-name="active" data-type="boolean" data-desc="ルールが現在有効かどうかを示します。無効なルールは生成タスク中に無視されます。"></x-field>
71
+ <x-field data-name="scope" data-type="string">
72
+ <x-field-desc markdown>ルールをいつ適用するかを定義します。有効なスコープは `global`、`structure`、`document`、または `translation` です。</x-field-desc>
73
+ </x-field>
74
+ <x-field data-name="rule" data-type="string" data-desc="将来のタスクでAIに渡される、具体的で洗練された指示。"></x-field>
75
+ <x-field data-name="feedback" data-type="string" data-desc="ユーザーから提供された元の自然言語のフィードバック。参照用に保存されます。"></x-field>
76
+ <x-field data-name="createdAt" data-type="string" data-desc="ルールが作成された日時を示すISO 8601タイムスタンプ。"></x-field>
77
+ <x-field data-name="paths" data-type="string[]" data-required="false">
78
+ <x-field-desc markdown>オプションのファイルパスのリスト。存在する場合、ルールはこれらの特定のソースファイルに対して生成されたコンテンツにのみ適用されます。</x-field-desc>
79
+ </x-field>
80
+ </x-field-group>
66
81
 
67
82
  ## CLIによるプリファレンスの管理
68
83
 
69
- `aigne doc prefs` コマンドを使用して、保存されているすべてのプリファレンスを表示および管理できます。これにより、ルールの一覧表示、有効化、無効化、または恒久的な削除が可能です。
84
+ `aigne doc prefs` コマンドを使用して、保存されているすべてのプリファレンスを表示および管理できます。これにより、ルールの一覧表示、有効化、無効化、または永久に削除することができます。
70
85
 
71
- ### すべてのプリファレンスを一覧表示する
86
+ ### すべてのプリファレンスを一覧表示
72
87
 
73
- 有効なものと無効なものを含め、保存されているすべてのプリファレンスを表示するには、`--list` フラグを使用します。
88
+ 保存されているすべてのプリファレンス(有効なものと無効なものの両方)の完全なリストを表示するには、`--list` フラグを使用します。
74
89
 
75
- ```bash すべてのプリファレンスを一覧表示する icon=lucide:terminal
90
+ ```bash すべてのプリファレンスを一覧表示 icon=lucide:terminal
76
91
  aigne doc prefs --list
77
92
  ```
78
93
 
@@ -83,12 +98,12 @@ aigne doc prefs --list
83
98
 
84
99
  **フォーマットの説明:**
85
100
  - 🟢 = 有効なプリファレンス, ⚪ = 無効なプリファレンス
86
- - [scope] = プリファレンスのスコープ (global, structure, document, translation)
101
+ - [scope] = プリファレンススコープ (global, structure, document, translation)
87
102
  - ID = 一意のプリファレンス識別子
88
103
  - Paths = 特定のファイルパス(該当する場合)
89
104
 
90
105
  🟢 [structure] pref_a1b2c3d4e5f6g7h8 | Paths: overview.md
91
- 概要ドキュメントの末尾に「次のステップ」セクションを追加する。
106
+ 概要ドキュメントの最後に「次のステップ」セクションを追加します。
92
107
 
93
108
  ⚪ [document] pref_i9j0k1l2m3n4o5p6
94
109
  コードコメントは英語で記述する必要があります。
@@ -96,13 +111,13 @@ aigne doc prefs --list
96
111
 
97
112
  ### プリファレンスの無効化と再有効化
98
113
 
99
- ルールを削除せずに一時的に無効にしたい場合は、`--toggle` フラグを使用してアクティブステータスを切り替えることができます。IDなしでコマンドを実行すると、対話モードが起動し、切り替えたいプリファレンスを1つ以上選択できます。
114
+ ルールを削除せずに一時的に無効にする必要がある場合は、`--toggle` フラグで有効ステータスを切り替えることができます。IDなしでコマンドを実行すると対話モードが起動し、切り替えるプリファレンスを1つ以上選択できます。
100
115
 
101
- ```bash 対話形式でプリファレンスを切り替える icon=lucide:terminal
116
+ ```bash プリファレンスを対話的に切り替える icon=lucide:terminal
102
117
  aigne doc prefs --toggle
103
118
  ```
104
119
 
105
- 特定のルールを直接切り替えるには、`--id` フラグでそのIDを指定します。これは `deactivateRule` 関数に対応しており、ルールの `active` プロパティを `false` に設定します。
120
+ 特定のルールを直接切り替えるには、`--id` フラグでそのIDを指定します。このアクションは、ルールの `active` プロパティを変更します。
106
121
 
107
122
  ```bash 特定のプリファレンスを切り替える icon=lucide:terminal
108
123
  aigne doc prefs --toggle --id pref_i9j0k1l2m3n4o5p6
@@ -110,15 +125,15 @@ aigne doc prefs --toggle --id pref_i9j0k1l2m3n4o5p6
110
125
 
111
126
  ### プリファレンスの削除
112
127
 
113
- 1つ以上のプリファレンスを完全に削除するには、`--remove` フラグを使用します。この操作は `removeRule` 関数に対応し、元に戻すことはできません。
128
+ 1つ以上のプリファレンスを完全に削除するには、`--remove` フラグを使用します。この操作は元に戻せません。
114
129
 
115
130
  対話的な選択プロンプトを表示するには、IDなしでコマンドを実行します。
116
131
 
117
- ```bash 対話形式でプリファレンスを削除する icon=lucide:terminal
132
+ ```bash プリファレンスを対話的に削除する icon=lucide:terminal
118
133
  aigne doc prefs --remove
119
134
  ```
120
135
 
121
- 特定のルールをIDで直接削除するには、`--id` フラグを使用します。
136
+ 特定のルールを直接削除するには、`--id` フラグでそのIDを指定します。
122
137
 
123
138
  ```bash 特定のプリファレンスを削除する icon=lucide:terminal
124
139
  aigne doc prefs --remove --id pref_a1b2c3d4e5f6g7h8
@@ -126,4 +141,4 @@ aigne doc prefs --remove --id pref_a1b2c3d4e5f6g7h8
126
141
 
127
142
  ## 次のステップ
128
143
 
129
- プリファレンスの管理は、DocSmithをプロジェクトの特定のニーズに合わせて調整するための重要な部分です。さらなるカスタマイズオプションについては、メインの[設定ガイド](./configuration.md)をご覧ください。
144
+ プリファレンスの管理は、DocSmithをプロジェクトの特定のニーズに合わせて調整する上で重要な部分です。その他のカスタマイズオプションについては、メインの[設定ガイド](./configuration.md)をご覧ください。
@@ -9,68 +9,83 @@ The following diagram illustrates how your feedback becomes a reusable rule that
9
9
  ```d2 The Preference Lifecycle
10
10
  direction: down
11
11
 
12
- feedback: {
13
- label: "1. User provides feedback\nduring 'refine' or 'translate'"
14
- shape: rectangle
12
+ developer: {
13
+ label: "Developer"
14
+ shape: person
15
15
  }
16
16
 
17
- refiner: {
18
- label: "2. Feedback Refiner Agent\nAnalyzes feedback"
17
+ docsmith_system: {
18
+ label: "AIGNE DocSmith System"
19
19
  shape: rectangle
20
- }
21
20
 
22
- decision: {
23
- label: "Is it a reusable policy?"
24
- shape: diamond
21
+ cli: {
22
+ label: "CLI Command\n(refine / translate)"
23
+ shape: rectangle
24
+ }
25
+
26
+ agent: {
27
+ label: "Internal Analysis Agent"
28
+ shape: rectangle
29
+ }
30
+
31
+ decision: {
32
+ label: "Is feedback a\nreusable policy?"
33
+ shape: diamond
34
+ }
35
+
36
+ create_rule: {
37
+ label: "Create New Preference Rule"
38
+ shape: rectangle
39
+ }
25
40
  }
26
41
 
27
- pref_file: {
28
- label: "3. preferences.yml\nRule is saved"
42
+ preferences_file: {
43
+ label: ".aigne/doc-smith/preferences.yml"
29
44
  shape: cylinder
30
45
  }
31
46
 
32
- future_tasks: {
33
- label: "4. Future Tasks\nSaved rules are applied"
34
- shape: rectangle
47
+ one_time_fix: {
48
+ label: "Apply as a one-time fix"
49
+ shape: oval
35
50
  }
36
51
 
37
- cli: {
38
- label: "5. CLI Management\n('aigne doc prefs')"
39
- shape: rectangle
40
- }
41
-
42
- feedback -> refiner: "Input"
43
- refiner -> decision: "Analyzes"
44
- decision -> pref_file: "Yes"
45
- decision -> "Discard (One-time fix)": "No"
46
- pref_file -> future_tasks: "Applies to"
47
- cli <-> pref_file: "Manages"
48
-
52
+ developer -> docsmith_system.cli: "1. Provides feedback"
53
+ docsmith_system.cli -> docsmith_system.agent: "2. Captures feedback"
54
+ docsmith_system.agent -> docsmith_system.decision: "3. Analyzes"
55
+ docsmith_system.decision -> docsmith_system.create_rule: "Yes"
56
+ docsmith_system.create_rule -> preferences_file: "4. Saves rule to file"
57
+ docsmith_system.decision -> one_time_fix: "No"
49
58
  ```
50
59
 
51
60
  ### How Preferences are Created
52
61
 
53
- When you provide feedback during the `refine` or `translate` stages, an internal agent analyzes your input. It determines if the feedback is a one-time fix (e.g., correcting a typo) or a reusable policy (e.g., "always write code comments in English"). If it represents a lasting instruction, it creates a new preference rule.
62
+ When you provide feedback during the `refine` or `translate` stages, an internal agent analyzes your input. It determines if the feedback is a one-time fix (e.g., correcting a typo) or a reusable policy (e.g., "always write code comments in English"). If it represents a lasting instruction, it creates a new preference rule and saves it to your project's `preferences.yml` file.
54
63
 
55
64
  ### Rule Properties
56
65
 
57
66
  Each rule saved in `preferences.yml` has the following structure:
58
67
 
59
- <x-field data-name="id" data-type="string" data-desc="A unique, randomly generated identifier for the rule (e.g., pref_a1b2c3d4e5f6g7h8)."></x-field>
60
- <x-field data-name="active" data-type="boolean" data-desc="Indicates if the rule is currently enabled. Inactive rules are ignored during generation tasks."></x-field>
61
- <x-field data-name="scope" data-type="string" data-desc="Defines when the rule should be applied. Valid scopes are 'global', 'structure', 'document', or 'translation'."></x-field>
62
- <x-field data-name="rule" data-type="string" data-desc="The specific, distilled instruction that will be passed to the AI in future tasks."></x-field>
63
- <x-field data-name="feedback" data-type="string" data-desc="The original, natural language feedback provided by the user, preserved for reference."></x-field>
64
- <x-field data-name="createdAt" data-type="string" data-desc="The ISO 8601 timestamp indicating when the rule was created."></x-field>
65
- <x-field data-name="paths" data-type="string[]" data-required="false" data-desc="An optional list of file paths. If present, the rule only applies to content generated for these specific source files."></x-field>
68
+ <x-field-group>
69
+ <x-field data-name="id" data-type="string" data-desc="A unique, randomly generated identifier for the rule (e.g., pref_a1b2c3d4e5f6g7h8)."></x-field>
70
+ <x-field data-name="active" data-type="boolean" data-desc="Indicates if the rule is currently enabled. Inactive rules are ignored during generation tasks."></x-field>
71
+ <x-field data-name="scope" data-type="string">
72
+ <x-field-desc markdown>Defines when the rule should be applied. Valid scopes are `global`, `structure`, `document`, or `translation`.</x-field-desc>
73
+ </x-field>
74
+ <x-field data-name="rule" data-type="string" data-desc="The specific, distilled instruction that will be passed to the AI in future tasks."></x-field>
75
+ <x-field data-name="feedback" data-type="string" data-desc="The original, natural language feedback provided by the user, preserved for reference."></x-field>
76
+ <x-field data-name="createdAt" data-type="string" data-desc="The ISO 8601 timestamp indicating when the rule was created."></x-field>
77
+ <x-field data-name="paths" data-type="string[]" data-required="false">
78
+ <x-field-desc markdown>An optional list of file paths. If present, the rule only applies to content generated for these specific source files.</x-field-desc>
79
+ </x-field>
80
+ </x-field-group>
66
81
 
67
82
  ## Managing Preferences with the CLI
68
83
 
69
- View and manage all your saved preferences using the `aigne doc prefs` command. You can list, activate, deactivate, or permanently remove rules.
84
+ You can view and manage all your saved preferences using the `aigne doc prefs` command. This allows you to list, activate, deactivate, or permanently remove rules.
70
85
 
71
86
  ### Listing All Preferences
72
87
 
73
- To see all saved preferences, both active and inactive, use the `--list` flag.
88
+ To see a complete list of all saved preferences, both active and inactive, use the `--list` flag.
74
89
 
75
90
  ```bash List all preferences icon=lucide:terminal
76
91
  aigne doc prefs --list
@@ -96,13 +111,13 @@ The command displays a formatted list showing the status, scope, ID, and any pat
96
111
 
97
112
  ### Deactivating and Reactivating Preferences
98
113
 
99
- If you want to temporarily disable a rule without deleting it, you can toggle its active status using the `--toggle` flag. Running the command without an ID will launch an interactive mode, allowing you to select one or more preferences to toggle.
114
+ If you need to temporarily disable a rule without deleting it, you can toggle its active status with the `--toggle` flag. Running the command without an ID will launch an interactive mode, allowing you to select one or more preferences to toggle.
100
115
 
101
116
  ```bash Toggle preferences interactively icon=lucide:terminal
102
117
  aigne doc prefs --toggle
103
118
  ```
104
119
 
105
- To toggle a specific rule directly, provide its ID using the `--id` flag. This corresponds to the `deactivateRule` function, which sets the rule's `active` property to `false`.
120
+ To toggle a specific rule directly, provide its ID using the `--id` flag. This action changes the rule's `active` property.
106
121
 
107
122
  ```bash Toggle a specific preference icon=lucide:terminal
108
123
  aigne doc prefs --toggle --id pref_i9j0k1l2m3n4o5p6
@@ -110,7 +125,7 @@ aigne doc prefs --toggle --id pref_i9j0k1l2m3n4o5p6
110
125
 
111
126
  ### Removing Preferences
112
127
 
113
- To permanently delete one or more preferences, use the `--remove` flag. This action, which corresponds to the `removeRule` function, cannot be undone.
128
+ To permanently delete one or more preferences, use the `--remove` flag. This action cannot be undone.
114
129
 
115
130
  For an interactive selection prompt, run the command without an ID.
116
131
 
@@ -118,7 +133,7 @@ For an interactive selection prompt, run the command without an ID.
118
133
  aigne doc prefs --remove
119
134
  ```
120
135
 
121
- To remove a specific rule directly by its ID, use the `--id` flag.
136
+ To remove a specific rule directly, provide its ID using the `--id` flag.
122
137
 
123
138
  ```bash Remove a specific preference icon=lucide:terminal
124
139
  aigne doc prefs --remove --id pref_a1b2c3d4e5f6g7h8
@@ -126,4 +141,4 @@ aigne doc prefs --remove --id pref_a1b2c3d4e5f6g7h8
126
141
 
127
142
  ## Next Steps
128
143
 
129
- Managing preferences is a key part of tailoring DocSmith to your project's specific needs. For more customization options, explore the main [Configuration Guide](./configuration.md).
144
+ Managing preferences is a key part of tailoring DocSmith to your project's specific needs. For more customization options, explore the main [Configuration Guide](./configuration.md).
@@ -1,90 +1,105 @@
1
1
  # 管理偏好設定
2
2
 
3
- AIGNE DocSmith 旨在從您的回饋中學習。當您對生成的內容進行優化或更正時,DocSmith 可以將這些回饋轉換為持久性規則,稱為偏好設定。這些規則確保您特定的風格、結構要求和內容策略在未來的文件任務中得到一致的應用。所有偏好設定都儲存在專案根目錄下的 `.aigne/doc-smith/preferences.yml` 中,這是一個易於閱讀的 YAML 檔案。
3
+ AIGNE DocSmith 的設計旨在從您的回饋中學習。當您優化或修正生成的內容時,DocSmith 可以將該回饋轉化為持久性規則,稱為偏好設定。這些規則確保您特定的風格、結構要求和內容策略在未來的文檔任務中得到一致應用。所有偏好設定都儲存在您專案根目錄下一個人類可讀的 YAML 檔案中,路徑為 `.aigne/doc-smith/preferences.yml`。
4
4
 
5
5
  ## 偏好設定的生命週期
6
6
 
7
- 下圖說明了您的回饋如何成為一個可重複使用的規則,該規則可以應用於未來的任務,並可透過命令列進行管理。
7
+ 下圖說明了您的回饋如何成為一個可重複使用的規則,該規則可應用於未來的任務,並可透過命令列進行管理。
8
8
 
9
- ```d2 The Preference Lifecycle
9
+ ```d2 偏好設定的生命週期
10
10
  direction: down
11
11
 
12
- feedback: {
13
- label: "1. 使用者在 'refine' 或 'translate' 過程中提供回饋"
14
- shape: rectangle
12
+ developer: {
13
+ label: "開發者"
14
+ shape: person
15
15
  }
16
16
 
17
- refiner: {
18
- label: "2. Feedback Refiner Agent\n分析回饋"
17
+ docsmith_system: {
18
+ label: "AIGNE DocSmith 系統"
19
19
  shape: rectangle
20
- }
21
20
 
22
- decision: {
23
- label: "這是一個可重複使用的策略嗎?"
24
- shape: diamond
21
+ cli: {
22
+ label: "CLI 指令\n(refine / translate)"
23
+ shape: rectangle
24
+ }
25
+
26
+ agent: {
27
+ label: "內部分析 Agent"
28
+ shape: rectangle
29
+ }
30
+
31
+ decision: {
32
+ label: "回饋是否為\n可重複使用的策略?"
33
+ shape: diamond
34
+ }
35
+
36
+ create_rule: {
37
+ label: "建立新的偏好設定規則"
38
+ shape: rectangle
39
+ }
25
40
  }
26
41
 
27
- pref_file: {
28
- label: "3. preferences.yml\n規則已儲存"
42
+ preferences_file: {
43
+ label: ".aigne/doc-smith/preferences.yml"
29
44
  shape: cylinder
30
45
  }
31
46
 
32
- future_tasks: {
33
- label: "4. 未來的任務\n已儲存的規則被應用"
34
- shape: rectangle
47
+ one_time_fix: {
48
+ label: "作為一次性修復應用"
49
+ shape: oval
35
50
  }
36
51
 
37
- cli: {
38
- label: "5. CLI 管理\n('aigne doc prefs')"
39
- shape: rectangle
40
- }
41
-
42
- feedback -> refiner: "輸入"
43
- refiner -> decision: "分析"
44
- decision -> pref_file: "是"
45
- decision -> "捨棄(一次性修復)": "否"
46
- pref_file -> future_tasks: "應用於"
47
- cli <-> pref_file: "管理"
48
-
52
+ developer -> docsmith_system.cli: "1. 提供回饋"
53
+ docsmith_system.cli -> docsmith_system.agent: "2. 捕捉回饋"
54
+ docsmith_system.agent -> docsmith_system.decision: "3. 進行分析"
55
+ docsmith_system.decision -> docsmith_system.create_rule: "是"
56
+ docsmith_system.create_rule -> preferences_file: "4. 將規則儲存至檔案"
57
+ docsmith_system.decision -> one_time_fix: ""
49
58
  ```
50
59
 
51
60
  ### 如何建立偏好設定
52
61
 
53
- 當您在 `refine` 或 `translate` 階段提供回饋時,一個內部 agent 會分析您的輸入。它會判斷該回饋是一次性的修復(例如,更正錯字)還是可重複使用的策略(例如,「總是使用英文撰寫程式碼註解」)。如果它代表一個持久性的指令,就會建立一個新的偏好設定規則。
62
+ 當您在 `refine` 或 `translate` 階段提供回饋時,一個內部 Agent 會分析您的輸入。它會判斷該回饋是一次性修復(例如,修正一個錯字)還是可重複使用的策略(例如,「程式碼註解必須以英文撰寫」)。如果它代表一個持久性的指令,它會建立一個新的偏好設定規則,並將其儲存到您專案的 `preferences.yml` 檔案中。
54
63
 
55
64
  ### 規則屬性
56
65
 
57
66
  儲存在 `preferences.yml` 中的每個規則都具有以下結構:
58
67
 
59
- <x-field data-name="id" data-type="string" data-desc="規則的唯一、隨機產生的識別碼(例如,pref_a1b2c3d4e5f6g7h8)。"></x-field>
60
- <x-field data-name="active" data-type="boolean" data-desc="表示該規則目前是否啟用。未啟用的規則在生成任務期間會被忽略。"></x-field>
61
- <x-field data-name="scope" data-type="string" data-desc="定義該規則應在何時應用。有效的範圍是 'global'、'structure'、'document' 或 'translation'。"></x-field>
62
- <x-field data-name="rule" data-type="string" data-desc="將在未來任務中傳遞給 AI 的具體、精煉的指令。"></x-field>
63
- <x-field data-name="feedback" data-type="string" data-desc="使用者提供的原始自然語言回饋,保留以供參考。"></x-field>
64
- <x-field data-name="createdAt" data-type="string" data-desc="表示規則建立時間的 ISO 8601 時間戳記。"></x-field>
65
- <x-field data-name="paths" data-type="string[]" data-required="false" data-desc="一個可選的檔案路徑列表。如果存在,該規則僅適用於為這些特定來源檔案生成的內容。"></x-field>
68
+ <x-field-group>
69
+ <x-field data-name="id" data-type="string" data-desc="規則的唯一隨機生成識別碼(例如:pref_a1b2c3d4e5f6g7h8)。"></x-field>
70
+ <x-field data-name="active" data-type="boolean" data-desc="表示規則目前是否啟用。未啟用的規則在生成任務期間會被忽略。"></x-field>
71
+ <x-field data-name="scope" data-type="string">
72
+ <x-field-desc markdown>定義規則應在何時應用。有效的範圍為 `global`、`structure`、`document` 或 `translation`。</x-field-desc>
73
+ </x-field>
74
+ <x-field data-name="rule" data-type="string" data-desc="在未來任務中將傳遞給 AI 的具體、精煉的指令。"></x-field>
75
+ <x-field data-name="feedback" data-type="string" data-desc="使用者提供的原始自然語言回饋,保留以供參考。"></x-field>
76
+ <x-field data-name="createdAt" data-type="string" data-desc="表示規則建立時間的 ISO 8601 時間戳記。"></x-field>
77
+ <x-field data-name="paths" data-type="string[]" data-required="false">
78
+ <x-field-desc markdown>可選的檔案路徑列表。如果存在,此規則僅適用於為這些特定來源檔案生成的內容。</x-field-desc>
79
+ </x-field>
80
+ </x-field-group>
66
81
 
67
82
  ## 使用 CLI 管理偏好設定
68
83
 
69
- 您可以使用 `aigne doc prefs` 命令來查看和管理所有已儲存的偏好設定。這讓您可以列出、啟用、停用或永久移除規則。
84
+ 您可以使用 `aigne doc prefs` 指令來檢視和管理所有已儲存的偏好設定。這讓您可以列出、啟用、停用或永久移除規則。
70
85
 
71
86
  ### 列出所有偏好設定
72
87
 
73
- 若要查看所有已儲存的偏好設定,包括啟用和未啟用的,請使用 `--list` 旗標。
88
+ 要查看所有已儲存偏好設定的完整列表(包括啟用和未啟用的),請使用 `--list` 標記。
74
89
 
75
- ```bash List all preferences icon=lucide:terminal
90
+ ```bash 列出所有偏好設定 icon=lucide:terminal
76
91
  aigne doc prefs --list
77
92
  ```
78
93
 
79
- 該命令會顯示一個格式化的列表,顯示每個規則的狀態、範圍、ID 和任何路徑限制。
94
+ 該指令會顯示一個格式化的列表,顯示每個規則的狀態、範圍、ID 以及任何路徑限制。
80
95
 
81
- ```text Example Output icon=lucide:clipboard-list
96
+ ```text 輸出範例 icon=lucide:clipboard-list
82
97
  # 使用者偏好設定
83
98
 
84
99
  **格式說明:**
85
100
  - 🟢 = 啟用中的偏好設定,⚪ = 未啟用的偏好設定
86
101
  - [scope] = 偏好設定範圍 (global, structure, document, translation)
87
- - ID = 唯一的偏好設定識別碼
102
+ - ID = 唯一偏好設定識別碼
88
103
  - Paths = 特定檔案路徑(如果適用)
89
104
 
90
105
  🟢 [structure] pref_a1b2c3d4e5f6g7h8 | Paths: overview.md
@@ -94,36 +109,36 @@ aigne doc prefs --list
94
109
  程式碼註解必須以英文撰寫。
95
110
  ```
96
111
 
97
- ### 停用和重新啟用偏好設定
112
+ ### 停用與重新啟用偏好設定
98
113
 
99
- 如果您想暫時停用某個規則而不刪除它,可以使用 `--toggle` 旗標來切換其啟用狀態。在沒有 ID 的情況下執行該命令將啟動互動模式,讓您可以選擇一個或多個偏好設定進行切換。
114
+ 如果您需要暫時停用一個規則而不刪除它,您可以使用 `--toggle` 標記來切換其啟用狀態。若執行指令時不帶 ID,將會啟動互動模式,讓您選擇一個或多個偏好設定進行切換。
100
115
 
101
- ```bash Toggle preferences interactively icon=lucide:terminal
116
+ ```bash 以互動模式切換偏好設定 icon=lucide:terminal
102
117
  aigne doc prefs --toggle
103
118
  ```
104
119
 
105
- 若要直接切換特定規則,請使用 `--id` 旗標提供其 ID。這對應於 `deactivateRule` 函式,該函式會將規則的 `active` 屬性設定為 `false`。
120
+ 要直接切換特定規則,請使用 `--id` 標記提供其 ID。此操作會更改規則的 `active` 屬性。
106
121
 
107
- ```bash Toggle a specific preference icon=lucide:terminal
122
+ ```bash 切換特定偏好設定 icon=lucide:terminal
108
123
  aigne doc prefs --toggle --id pref_i9j0k1l2m3n4o5p6
109
124
  ```
110
125
 
111
126
  ### 移除偏好設定
112
127
 
113
- 若要永久刪除一個或多個偏好設定,請使用 `--remove` 旗標。此操作對應於 `removeRule` 函式,且無法復原。
128
+ 要永久刪除一個或多個偏好設定,請使用 `--remove` 標記。此操作無法復原。
114
129
 
115
- 若要進入互動式選擇提示,請在不帶 ID 的情況下執行此命令。
130
+ 若要進入互動式選擇提示,請在不帶 ID 的情況下執行該指令。
116
131
 
117
- ```bash Remove preferences interactively icon=lucide:terminal
132
+ ```bash 以互動模式移除偏好設定 icon=lucide:terminal
118
133
  aigne doc prefs --remove
119
134
  ```
120
135
 
121
- 若要透過 ID 直接移除特定規則,請使用 `--id` 旗標。
136
+ 要直接移除特定規則,請使用 `--id` 標記提供其 ID。
122
137
 
123
- ```bash Remove a specific preference icon=lucide:terminal
138
+ ```bash 移除特定偏好設定 icon=lucide:terminal
124
139
  aigne doc prefs --remove --id pref_a1b2c3d4e5f6g7h8
125
140
  ```
126
141
 
127
142
  ## 後續步驟
128
143
 
129
- 管理偏好設定是根據專案特定需求量身打造 DocSmith 的關鍵部分。若要了解更多自訂選項,請探索主要的 [設定指南](./configuration.md)。
144
+ 管理偏好設定是根據您專案的特定需求量身打造 DocSmith 的關鍵部分。如需更多自訂選項,請探索主要的[設定指南](./configuration.md)。