@danya-ai/cli 0.1.0

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 (184) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +336 -0
  3. package/cli-acp.js +82 -0
  4. package/cli.js +105 -0
  5. package/dist/REPL-EYUOXCEC.js +42 -0
  6. package/dist/REPL-EYUOXCEC.js.map +7 -0
  7. package/dist/acp-S5WNCLMD.js +1372 -0
  8. package/dist/acp-S5WNCLMD.js.map +7 -0
  9. package/dist/agentsValidate-RQ2QDGNY.js +373 -0
  10. package/dist/agentsValidate-RQ2QDGNY.js.map +7 -0
  11. package/dist/ask-TX526UBD.js +129 -0
  12. package/dist/ask-TX526UBD.js.map +7 -0
  13. package/dist/autoUpdater-63RAZ24N.js +17 -0
  14. package/dist/autoUpdater-63RAZ24N.js.map +7 -0
  15. package/dist/chunk-2VQWLLDU.js +16 -0
  16. package/dist/chunk-2VQWLLDU.js.map +7 -0
  17. package/dist/chunk-4CLHMO4I.js +656 -0
  18. package/dist/chunk-4CLHMO4I.js.map +7 -0
  19. package/dist/chunk-4ZNNWJZU.js +5696 -0
  20. package/dist/chunk-4ZNNWJZU.js.map +7 -0
  21. package/dist/chunk-66EZC7Y7.js +149 -0
  22. package/dist/chunk-66EZC7Y7.js.map +7 -0
  23. package/dist/chunk-6EPQRP3S.js +96 -0
  24. package/dist/chunk-6EPQRP3S.js.map +7 -0
  25. package/dist/chunk-77IRSDFR.js +195 -0
  26. package/dist/chunk-77IRSDFR.js.map +7 -0
  27. package/dist/chunk-7RZNLBEK.js +136 -0
  28. package/dist/chunk-7RZNLBEK.js.map +7 -0
  29. package/dist/chunk-BNBV2FXC.js +19 -0
  30. package/dist/chunk-BNBV2FXC.js.map +7 -0
  31. package/dist/chunk-CQCREBDO.js +248 -0
  32. package/dist/chunk-CQCREBDO.js.map +7 -0
  33. package/dist/chunk-D77XS6TB.js +74 -0
  34. package/dist/chunk-D77XS6TB.js.map +7 -0
  35. package/dist/chunk-DHYBJN3V.js +474 -0
  36. package/dist/chunk-DHYBJN3V.js.map +7 -0
  37. package/dist/chunk-DLSLSLTR.js +842 -0
  38. package/dist/chunk-DLSLSLTR.js.map +7 -0
  39. package/dist/chunk-ELAE6Z4H.js +514 -0
  40. package/dist/chunk-ELAE6Z4H.js.map +7 -0
  41. package/dist/chunk-ELZQD7ZR.js +531 -0
  42. package/dist/chunk-ELZQD7ZR.js.map +7 -0
  43. package/dist/chunk-F6DEGMX6.js +31269 -0
  44. package/dist/chunk-F6DEGMX6.js.map +7 -0
  45. package/dist/chunk-GDF2AON2.js +124 -0
  46. package/dist/chunk-GDF2AON2.js.map +7 -0
  47. package/dist/chunk-H7BGBV4P.js +498 -0
  48. package/dist/chunk-H7BGBV4P.js.map +7 -0
  49. package/dist/chunk-HIIHGKXP.js +24 -0
  50. package/dist/chunk-HIIHGKXP.js.map +7 -0
  51. package/dist/chunk-HJCCXED7.js +17 -0
  52. package/dist/chunk-HJCCXED7.js.map +7 -0
  53. package/dist/chunk-IQ6VZB2Y.js +139 -0
  54. package/dist/chunk-IQ6VZB2Y.js.map +7 -0
  55. package/dist/chunk-J4D7AELD.js +518 -0
  56. package/dist/chunk-J4D7AELD.js.map +7 -0
  57. package/dist/chunk-JVGG2YQR.js +23 -0
  58. package/dist/chunk-JVGG2YQR.js.map +7 -0
  59. package/dist/chunk-LGEK2NV7.js +939 -0
  60. package/dist/chunk-LGEK2NV7.js.map +7 -0
  61. package/dist/chunk-LWXT5RGE.js +95 -0
  62. package/dist/chunk-LWXT5RGE.js.map +7 -0
  63. package/dist/chunk-M3TKNAUR.js +35 -0
  64. package/dist/chunk-M3TKNAUR.js.map +7 -0
  65. package/dist/chunk-MRFO7QO5.js +170 -0
  66. package/dist/chunk-MRFO7QO5.js.map +7 -0
  67. package/dist/chunk-MVN3DHQF.js +95 -0
  68. package/dist/chunk-MVN3DHQF.js.map +7 -0
  69. package/dist/chunk-O25PXGOC.js +772 -0
  70. package/dist/chunk-O25PXGOC.js.map +7 -0
  71. package/dist/chunk-OBGVKM3N.js +1618 -0
  72. package/dist/chunk-OBGVKM3N.js.map +7 -0
  73. package/dist/chunk-OV5HJXXQ.js +198 -0
  74. package/dist/chunk-OV5HJXXQ.js.map +7 -0
  75. package/dist/chunk-P5VWDMRD.js +249 -0
  76. package/dist/chunk-P5VWDMRD.js.map +7 -0
  77. package/dist/chunk-PDSAJX7G.js +49 -0
  78. package/dist/chunk-PDSAJX7G.js.map +7 -0
  79. package/dist/chunk-RHNEZOPO.js +739 -0
  80. package/dist/chunk-RHNEZOPO.js.map +7 -0
  81. package/dist/chunk-SQGAHZPM.js +3004 -0
  82. package/dist/chunk-SQGAHZPM.js.map +7 -0
  83. package/dist/chunk-U7Z4MXY4.js +21 -0
  84. package/dist/chunk-U7Z4MXY4.js.map +7 -0
  85. package/dist/chunk-UNCTVIS7.js +146 -0
  86. package/dist/chunk-UNCTVIS7.js.map +7 -0
  87. package/dist/chunk-VMEOI6MH.js +1103 -0
  88. package/dist/chunk-VMEOI6MH.js.map +7 -0
  89. package/dist/chunk-WAY3DKFO.js +47 -0
  90. package/dist/chunk-WAY3DKFO.js.map +7 -0
  91. package/dist/chunk-XEYEKVFT.js +24 -0
  92. package/dist/chunk-XEYEKVFT.js.map +7 -0
  93. package/dist/chunk-Y4BQ36T4.js +796 -0
  94. package/dist/chunk-Y4BQ36T4.js.map +7 -0
  95. package/dist/chunk-Y5LQPJWK.js +12 -0
  96. package/dist/chunk-Y5LQPJWK.js.map +7 -0
  97. package/dist/chunk-YIJWUNWF.js +1260 -0
  98. package/dist/chunk-YIJWUNWF.js.map +7 -0
  99. package/dist/chunk-YMIWYEZ7.js +34 -0
  100. package/dist/chunk-YMIWYEZ7.js.map +7 -0
  101. package/dist/cli-PQNZWJX4.js +3952 -0
  102. package/dist/cli-PQNZWJX4.js.map +7 -0
  103. package/dist/commands-HOBCZ3VQ.js +46 -0
  104. package/dist/commands-HOBCZ3VQ.js.map +7 -0
  105. package/dist/config-MLH7ZTFA.js +81 -0
  106. package/dist/config-MLH7ZTFA.js.map +7 -0
  107. package/dist/context-FZ6G4J63.js +30 -0
  108. package/dist/context-FZ6G4J63.js.map +7 -0
  109. package/dist/costTracker-5WKZXN5S.js +19 -0
  110. package/dist/costTracker-5WKZXN5S.js.map +7 -0
  111. package/dist/customCommands-EB4MMZSS.js +25 -0
  112. package/dist/customCommands-EB4MMZSS.js.map +7 -0
  113. package/dist/env-VMEIP4EW.js +28 -0
  114. package/dist/env-VMEIP4EW.js.map +7 -0
  115. package/dist/index.js +36 -0
  116. package/dist/index.js.map +7 -0
  117. package/dist/kodeAgentSessionId-WUT74FSH.js +16 -0
  118. package/dist/kodeAgentSessionId-WUT74FSH.js.map +7 -0
  119. package/dist/kodeAgentSessionLoad-KR4JSD6D.js +21 -0
  120. package/dist/kodeAgentSessionLoad-KR4JSD6D.js.map +7 -0
  121. package/dist/kodeAgentSessionResume-BCD6UV74.js +18 -0
  122. package/dist/kodeAgentSessionResume-BCD6UV74.js.map +7 -0
  123. package/dist/kodeAgentStreamJson-EDHHWNNX.js +15 -0
  124. package/dist/kodeAgentStreamJson-EDHHWNNX.js.map +7 -0
  125. package/dist/kodeAgentStreamJsonSession-G4RBNZRN.js +133 -0
  126. package/dist/kodeAgentStreamJsonSession-G4RBNZRN.js.map +7 -0
  127. package/dist/kodeAgentStructuredStdio-UA5P5UNU.js +11 -0
  128. package/dist/kodeAgentStructuredStdio-UA5P5UNU.js.map +7 -0
  129. package/dist/kodeHooks-EHM6GSIQ.js +37 -0
  130. package/dist/kodeHooks-EHM6GSIQ.js.map +7 -0
  131. package/dist/llm-SJXCV7DA.js +3138 -0
  132. package/dist/llm-SJXCV7DA.js.map +7 -0
  133. package/dist/llmLazy-2QYJVD6K.js +15 -0
  134. package/dist/llmLazy-2QYJVD6K.js.map +7 -0
  135. package/dist/loader-LJX77EFL.js +28 -0
  136. package/dist/loader-LJX77EFL.js.map +7 -0
  137. package/dist/mcp-DOROSLPN.js +49 -0
  138. package/dist/mcp-DOROSLPN.js.map +7 -0
  139. package/dist/mentionProcessor-5UZRHCGH.js +215 -0
  140. package/dist/mentionProcessor-5UZRHCGH.js.map +7 -0
  141. package/dist/messages-N5KBI53P.js +65 -0
  142. package/dist/messages-N5KBI53P.js.map +7 -0
  143. package/dist/model-HPLBR53R.js +30 -0
  144. package/dist/model-HPLBR53R.js.map +7 -0
  145. package/dist/openai-YP4OJYKF.js +29 -0
  146. package/dist/openai-YP4OJYKF.js.map +7 -0
  147. package/dist/outputStyles-NNALI5D7.js +28 -0
  148. package/dist/outputStyles-NNALI5D7.js.map +7 -0
  149. package/dist/package.json +4 -0
  150. package/dist/pluginRuntime-JYYI5BSQ.js +220 -0
  151. package/dist/pluginRuntime-JYYI5BSQ.js.map +7 -0
  152. package/dist/pluginValidation-JWUFPZUE.js +17 -0
  153. package/dist/pluginValidation-JWUFPZUE.js.map +7 -0
  154. package/dist/prompts-B2SS7CWI.js +50 -0
  155. package/dist/prompts-B2SS7CWI.js.map +7 -0
  156. package/dist/query-HIK457UU.js +50 -0
  157. package/dist/query-HIK457UU.js.map +7 -0
  158. package/dist/responsesStreaming-L2BSN37C.js +10 -0
  159. package/dist/responsesStreaming-L2BSN37C.js.map +7 -0
  160. package/dist/ripgrep-GCKI4UTL.js +17 -0
  161. package/dist/ripgrep-GCKI4UTL.js.map +7 -0
  162. package/dist/skillMarketplace-PCTUUX46.js +37 -0
  163. package/dist/skillMarketplace-PCTUUX46.js.map +7 -0
  164. package/dist/state-XJICGOUA.js +18 -0
  165. package/dist/state-XJICGOUA.js.map +7 -0
  166. package/dist/theme-DP7O4SGH.js +14 -0
  167. package/dist/theme-DP7O4SGH.js.map +7 -0
  168. package/dist/toolPermissionContext-DHAGUPEW.js +17 -0
  169. package/dist/toolPermissionContext-DHAGUPEW.js.map +7 -0
  170. package/dist/toolPermissionSettings-PT65MQIQ.js +18 -0
  171. package/dist/toolPermissionSettings-PT65MQIQ.js.map +7 -0
  172. package/dist/tools-BHW37PCF.js +47 -0
  173. package/dist/tools-BHW37PCF.js.map +7 -0
  174. package/dist/userInput-XDRYT5TI.js +316 -0
  175. package/dist/userInput-XDRYT5TI.js.map +7 -0
  176. package/dist/uuid-QUYJMIUV.js +9 -0
  177. package/dist/uuid-QUYJMIUV.js.map +7 -0
  178. package/dist/yoga.wasm +0 -0
  179. package/package.json +115 -0
  180. package/scripts/binary-utils.cjs +62 -0
  181. package/scripts/cli-acp-wrapper.cjs +82 -0
  182. package/scripts/cli-wrapper.cjs +105 -0
  183. package/scripts/postinstall.js +144 -0
  184. package/yoga.wasm +0 -0
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2024 ShareAI Lab
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,336 @@
1
+ # Danya — 游戏开发 AI 编程助手
2
+
3
+ <p align="center">
4
+ <b>专为游戏开发打造的 AI 终端编程助手</b><br>
5
+ 理解游戏引擎 · 门禁链质量管控 · 全自动开发流水线 · 多模型支持
6
+ </p>
7
+
8
+ ---
9
+
10
+ ## 安装
11
+
12
+ ```bash
13
+ # 方式一:npm 安装(推荐)
14
+ npm install -g @danya-ai/cli
15
+
16
+ # 方式二:从源码安装
17
+ git clone https://github.com/zhudanya/danya.git
18
+ cd danya
19
+ bun install && bun run build
20
+ npm install -g .
21
+ ```
22
+
23
+ ```bash
24
+ # 验证安装
25
+ danya --version
26
+ ```
27
+
28
+ ## 快速使用
29
+
30
+ ```bash
31
+ # 初始化游戏项目(自动检测引擎,生成配置和 Hook)
32
+ cd <你的游戏项目>
33
+ danya init
34
+
35
+ # 启动交互模式
36
+ danya
37
+
38
+ # 常用命令
39
+ /review # 评分制代码审查(100 分制)
40
+ /auto-work "添加背包排序功能" # 全自动流水线
41
+ /auto-bugfix "角色状态切换动画异常" # Bug 自动修复
42
+ /parallel-execute prepare "大功能" # 波次并行执行
43
+ ```
44
+
45
+ 快捷键:
46
+ - `Ctrl+G` — 打开外部编辑器(优先 `$EDITOR`,回退 code/nano/vim),关闭后内容自动回填
47
+ - `Shift+Enter` — 输入框内换行但不发送,普通 `Enter` 提交
48
+ - `Ctrl+M` — 快速切换模型
49
+ - `Shift+Tab` — 切换输入模式(普通 / Bash / 记忆)
50
+
51
+ ---
52
+
53
+ ## 功能特性
54
+
55
+ - **AI 驱动的助手** — 使用先进的 AI 模型理解并响应你的请求
56
+ - **多模型协同** — 灵活切换和组合使用多个 AI 模型(20+ 提供商),发挥各自优势
57
+ - **代码编辑** — 直接编辑文件,提供智能建议和改进
58
+ - **代码库理解** — 分析项目结构和代码关系
59
+ - **命令执行** — 实时运行 shell 命令并查看结果
60
+ - **工作流自动化** — 用简单的提示处理复杂的开发任务
61
+ - **交互式界面** — 美观的终端界面,支持语法高亮
62
+ - **工具系统** — 可扩展的架构,为不同任务提供专门的工具(22 通用 + 13 游戏专用)
63
+ - **上下文管理** — 智能的上下文处理,保持对话连续性
64
+ - **游戏引擎感知** — 自动识别 Unity / UE / Godot / Go 服务器,注入引擎领域知识
65
+ - **门禁链质量管控** — 6 道门禁强制执行代码质量标准
66
+ - **评分制审查** — 100 分制量化审查,33 条引擎检查规则
67
+ - **知识自动沉淀** — 开发成果自动文档化,不丢失项目知识
68
+
69
+ ---
70
+
71
+ ## Danya 是什么
72
+
73
+ Danya 是一个运行在终端中的 AI 编程助手,**专门为游戏开发场景设计**。它不是一个通用的代码补全工具,而是一个理解游戏项目架构、强制执行质量标准、并能自动化整个开发工作流的 Agent。
74
+
75
+ 你可以把它理解为:**Claude Code 的游戏开发定制版**,融合了传统 Agent 的成熟工具系统、Kode 的多模型能力、以及 Game Harness Engineering 的质量治理体系。
76
+
77
+ ```
78
+ ┌──────────────────────────┐
79
+ │ Danya │
80
+ │ │
81
+ │ 传统 Agent 的工具系统 │
82
+ │ + Kode 的多模型能力 │
83
+ │ + Game Harness 的质量治理 │
84
+ │ + 游戏开发领域知识 │
85
+ └──────────────────────────┘
86
+ ```
87
+
88
+ ---
89
+
90
+ ## 与 Claude Code / Codex / Kode 的区别
91
+
92
+ ### 一句话总结
93
+
94
+ | 产品 | 定位 | 一句话描述 |
95
+ |------|------|----------|
96
+ | **Claude Code** | 通用编程助手 | Anthropic 官方 CLI,能力强但不懂游戏 |
97
+ | **Codex (OpenAI)** | 通用编程助手 | OpenAI 的终端 Agent,只支持 OpenAI 模型 |
98
+ | **Kode** | 通用编程助手 | Claude Code 开源替代,支持多模型 |
99
+ | **Danya** | **游戏开发编程助手** | 为游戏项目定制:理解引擎、门禁链、评分审查 |
100
+
101
+ ### 详细对比
102
+
103
+ | 能力 | Claude Code | Codex | Kode | **Danya** |
104
+ |------|------------|-------|------|-----------|
105
+ | **游戏引擎理解** | 无 | 无 | 无 | **Unity / UE / Godot 自动识别,注入引擎知识** |
106
+ | **禁区防护** | 无 | 无 | 无 | **自动检测 auto-generated 代码,Hook 硬拦截** |
107
+ | **评分制审查** | 无 | 无 | 无 | **100 分制,33 条引擎检查,质量棘轮** |
108
+ | **门禁链** | 无 | 无 | 无 | **6 道门禁:Guard→Syntax→Verify→Commit→Review→Push** |
109
+ | **全自动流水线** | 无 | 无 | 无 | **/auto-work, /auto-bugfix, /parallel-execute** |
110
+ | **知识沉淀** | 无 | 无 | 无 | **自动写 Docs/(功能/Bug/调研)** |
111
+ | **Harness 自演进** | 无 | 无 | 无 | **Agent 出错后自动更新规则** |
112
+ | 多模型支持 | 仅 Anthropic | 仅 OpenAI | **20+ 提供商** | **20+ 提供商(继承 Kode)** |
113
+ | Hook 系统 | 18 种事件 | 无 | 4 种事件 | **18 种事件** |
114
+ | 权限系统 | 规则层叠 | 简单 | 简单 | **规则层叠** |
115
+ | 工具系统 | 43 个工具 | ~10 | 22 个 | **22 通用 + 13 游戏专用 = 35 个工具** |
116
+
117
+ ### 核心差异:通用 vs 游戏专用
118
+
119
+ Claude Code / Codex / Kode 是**通用编程助手**——它们不知道:
120
+ - Unity 中应该用 `UniTask` 而不是 `Task`
121
+ - 配置和协议目录下的代码是自动生成的,不能手动编辑
122
+ - Go 游戏服务端应该用架构约定特点
123
+ - 游戏项目的多层架构不能反向引用
124
+ - 修改 `.proto` 文件后必须同步客户端和服务端
125
+
126
+ Danya **理解这些**,并且通过机械化的 Hook 和评分制审查来**强制执行**。
127
+
128
+ ---
129
+
130
+ ## 对游戏开发的核心优势
131
+
132
+ ### 1. 引擎感知的系统提示词
133
+
134
+ Danya 启动时自动检测项目引擎类型,注入对应的领域知识:
135
+
136
+ ```
137
+ 在 Unity 项目中启动 → 系统提示词包含:
138
+ - MonoBehaviour 生命周期
139
+ - UniTask 异步模式
140
+ - DOTS/ECS 架构规则
141
+ - 对象池使用规范
142
+ - 事件订阅/退订配对
143
+
144
+ 在 Go 服务端项目中启动 → 系统提示词包含:
145
+ - 10+ 个微服务架构
146
+ - RPC 调用链路
147
+ - ORM 代码生成规则
148
+ - 配置管线流程
149
+ ```
150
+
151
+ 这意味着 Agent 从**第一行输出**就知道项目的规则,不需要你反复提醒。
152
+
153
+ ### 2. 自动生成代码禁区防护
154
+
155
+ 游戏项目中有大量自动生成的代码(配置表、ORM、Protobuf 桩代码)。通用助手不知道这些不能碰,经常修改后被下一次生成覆盖。
156
+
157
+ Danya 的 **Gate 0 (Guard)** 在文件编辑前就拦截:
158
+
159
+ ```
160
+ Agent 尝试编辑 Config/Gen/XXXConfig.cs
161
+ → Guard Hook 检测到禁区
162
+ → ❌ 阻断编辑
163
+ → 告知 Agent:"这是自动生成代码,改 Excel 源文件后重新生成"
164
+ ```
165
+
166
+ ### 3. 评分制代码审查(不再是 PASS/FAIL)
167
+
168
+ 通用助手的代码审查只能给出主观的"看起来不错"。Danya 用**量化的评分系统**:
169
+
170
+ ```
171
+ 初始分:100
172
+ CRITICAL: -30(任何 CRITICAL = 直接 FAIL)
173
+ HIGH: -10
174
+ MEDIUM: -3
175
+ 通过线:≥80 且无 CRITICAL
176
+
177
+ 质量棘轮:分数只升不降,防止"修一个 bug 引入两个新 bug"
178
+ ```
179
+
180
+ 33 条机械检查自动运行(5 套引擎规则),AI 判断补充架构和逻辑审查。
181
+
182
+ ### 4. 全自动开发流水线
183
+
184
+ 一条命令完成整个开发周期:
185
+
186
+ ```bash
187
+ /auto-work "添加背包排序功能"
188
+
189
+ → Stage 0: 分类 → feature
190
+ → Stage 1: 规划 → 3 个文件需要修改
191
+ → Stage 2: 编码 → 写代码 + 自动编译检查(fail-fast)
192
+ → Stage 3: 审查 → 88/100 PASS
193
+ → Stage 4: 提交 → <feat>(inventory) add item sorting
194
+ → Stage 5: 沉淀 → Docs/Version/v1.2/inventory-sorting/summary.md
195
+ → Stage 6: 自演进 → 更新规则文件
196
+
197
+ ═══ AUTO-WORK COMPLETE ═══
198
+ ```
199
+
200
+ Bug 修复有专用流水线,**必须先复现才能修**:
201
+
202
+ ```bash
203
+ /auto-bugfix "角色状态切换时动画异常"
204
+
205
+ → 复现 → 定位根因 → 修复(最多5轮) → 审查 → 提交 → 经验固化
206
+ ```
207
+
208
+ ### 5. 多模型支持(国内团队友好)
209
+
210
+ 不锁定任何一家 AI 提供商。4 种语义指针让不同任务用不同模型:
211
+
212
+ ```yaml
213
+ pointers:
214
+ main: "DeepSeek V3" # 主对话用最强模型
215
+ task: "Qwen Max" # 子任务用便宜模型
216
+ compact: "GLM-4" # 压缩用快速模型
217
+ quick: "GLM-4" # 分类用快速模型
218
+ ```
219
+
220
+ 内置 3 个预设:`china.yaml`(DeepSeek+千问+智谱)、`international.yaml`(Claude+GPT)、`single-model.yaml`(单模型极简配置)。
221
+
222
+ ### 6. 知识不丢失
223
+
224
+ 游戏项目的知识容易随人员流动丢失。Danya 在每次任务完成后**自动沉淀**:
225
+
226
+ ```
227
+ 功能开发 → Docs/Version/<版本>/<功能>/summary.md
228
+ Bug 修复 → Docs/Bugs/<版本>/<bug名>.md
229
+ 技术调研 → Docs/Engine/Research/<课题>/findings.md
230
+ ```
231
+
232
+ 下一个开发者接手时,这些文档已经在那里了。
233
+
234
+ ---
235
+
236
+ ## 13 个游戏专用工具
237
+
238
+ | 工具 | 用途 | 适用引擎 |
239
+ |------|------|---------|
240
+ | **CSharpSyntaxCheck** | Roslyn 即时语法检查 | Unity, Godot |
241
+ | **UnityBuild** | Unity 编译管线 | Unity |
242
+ | **UnrealBuild** | UBT 编译 | UE |
243
+ | **GodotBuild** | GDScript/C# 检查 | Godot |
244
+ | **GameServerBuild** | 分级验证 (lint/build/test) | Go Server |
245
+ | **ProtoCompile** | Protobuf 编译 + 桩代码生成 | 跨引擎 |
246
+ | **ConfigGenerate** | 配置表生成 | 跨引擎 |
247
+ | **OrmGenerate** | ORM 代码生成 | Go Server |
248
+ | **ScoreReview** | 100 分制评分审查 | 跨引擎 |
249
+ | **GateChain** | 门禁链编排 | 跨引擎 |
250
+ | **KnowledgeSediment** | 知识自动沉淀 | 跨引擎 |
251
+ | **ArchitectureGuard** | 依赖方向检查 | 跨引擎 |
252
+ | **AssetCheck** | 资源引用完整性 | Unity, Godot |
253
+
254
+ ---
255
+
256
+ ## 门禁链
257
+
258
+ 每次代码变更经过 6 道质量门禁:
259
+
260
+ ```
261
+ Edit → Guard → Syntax → Verify → Commit → Review → Push
262
+ Hook Hook Tool Hook AI+Tool Hook
263
+ (硬拦截) (即时检查)(编译测试)(lint+test)(评分制)(令牌制)
264
+ ```
265
+
266
+ - **机械执行(Hook)**:Guard / Syntax / Commit / Push — shell 脚本,Agent 无法绕过
267
+ - **AI 判断(评分)**:Review — 需要理解代码质量,靠评分系统量化
268
+
269
+ **Push 令牌制**:审查通过才生成 `push-approved` 令牌,push 时检查并消费(一次性使用)。
270
+
271
+ ---
272
+
273
+ ## 技术架构
274
+
275
+ 融合三个项目的最优设计:
276
+
277
+ | 来源 | 贡献 |
278
+ |------|------|
279
+ | **XXXXXX XXXX** | 工具系统(43工具)、Hook 系统(18事件)、权限层叠、对话压缩、Prompt 缓存 |
280
+ | **Kode** | 多模型系统(20+提供商)、Provider 适配器、模型配置 YAML、React/Ink 终端 UI |
281
+ | **Game Harness Engineering (Danya 原创)** | 门禁链、评分审查、全自动流水线、知识沉淀、Harness 自演进 |
282
+ | **Danya 原创** | 游戏引擎检测、引擎变体提示词、13 个游戏工具、AGENTS.md 模板 |
283
+
284
+ ---
285
+
286
+ ## 支持的引擎
287
+
288
+ | 引擎 | 检测方式 | 构建工具 | 审查规则数 |
289
+ |------|---------|---------|-----------|
290
+ | **Unity** | `ProjectSettings/` + `Assets/` | UnityBuild, CSharpSyntaxCheck | 9 条 (UC-01~09) |
291
+ | **Unreal Engine** | `*.uproject` | UnrealBuild | 6 条 (UE-01~06) |
292
+ | **Godot** | `project.godot` | GodotBuild | 5 条 (GD-01~05) |
293
+ | **Go 游戏服务器** | `go.mod` | GameServerBuild | 9 条 (GO-01~09) |
294
+
295
+ 通用审查规则 4 条 (U-01~04),所有项目自动应用。
296
+
297
+ ---
298
+
299
+ ## 配置
300
+
301
+ ```
302
+ ~/.danya/config.json — 全局配置(API Key、模型配置)
303
+ .danya/settings.json — 项目 Hook 和权限配置
304
+ .danya/gate-chain.json — 门禁链配置
305
+ .danya/guard-rules.json — 禁区规则
306
+ AGENTS.md — 项目指令(AI 读取的规则和上下文)
307
+ ```
308
+
309
+ ---
310
+
311
+ ## 文档
312
+
313
+ - [快速开始](docs/getting-started.md)
314
+ - [配置指南](docs/configuration.md)
315
+ - 引擎指南:[Unity](docs/engine-guides/unity.md) | [Unreal](docs/engine-guides/unreal.md) | [Godot](docs/engine-guides/godot.md) | [Go 服务端](docs/engine-guides/go-server.md)
316
+
317
+ ---
318
+
319
+ ## 学习项目声明
320
+
321
+ Danya 是一个**学习项目**,用于研究 AI Agent 在游戏开发中的工程化实践。它融合了 Claude Code、Kode、Game Harness Engineering 的设计,不用于商业用途。
322
+
323
+ 核心价值不在于"又做了一个 Claude Code",而在于回答一个问题:**AI Agent 专门为游戏开发定制后,能比通用助手好多少?**
324
+
325
+ 答案是:
326
+ - 通用助手改完代码说"改完了",你手动测 5-10 分钟 → Danya 自动验证 + 评分
327
+ - 通用助手不知道自动生成目录不能碰 → Danya Hook 硬拦截
328
+ - 通用助手的审查是 PASS/FAIL → Danya 是 100 分制量化评分
329
+ - 通用助手不沉淀知识 → Danya 自动写文档到 Docs/
330
+ - 将一套经过验证的 Harness 融合到 Agent 中,开箱即用
331
+
332
+ **领域专用 > 通用万能。**
333
+
334
+ ## License
335
+
336
+ Apache-2.0
package/cli-acp.js ADDED
@@ -0,0 +1,82 @@
1
+ #!/usr/bin/env node
2
+
3
+ const fs = require('node:fs')
4
+ const path = require('node:path')
5
+ const { spawnSync } = require('node:child_process')
6
+
7
+ function findPackageRoot(startDir) {
8
+ let dir = startDir
9
+ for (let i = 0; i < 25; i++) {
10
+ if (fs.existsSync(path.join(dir, 'package.json'))) return dir
11
+ const parent = path.dirname(dir)
12
+ if (parent === dir) break
13
+ dir = parent
14
+ }
15
+ return startDir
16
+ }
17
+
18
+ function readPackageJson(packageRoot) {
19
+ try {
20
+ const p = path.join(packageRoot, 'package.json')
21
+ return JSON.parse(fs.readFileSync(p, 'utf8'))
22
+ } catch {
23
+ return null
24
+ }
25
+ }
26
+
27
+ function run(cmd, args) {
28
+ const result = spawnSync(cmd, args, {
29
+ stdio: 'inherit',
30
+ env: { ...process.env, KODE_PACKAGED: process.env.KODE_PACKAGED || '1' },
31
+ })
32
+ if (result.error) {
33
+ throw result.error
34
+ }
35
+ process.exit(typeof result.status === 'number' ? result.status : 1)
36
+ }
37
+
38
+ function main() {
39
+ const packageRoot = findPackageRoot(__dirname)
40
+ const pkg = readPackageJson(packageRoot)
41
+ const version = pkg?.version || ''
42
+ const { getCachedBinaryPath } = require(path.join(
43
+ packageRoot,
44
+ 'scripts',
45
+ 'binary-utils.cjs',
46
+ ))
47
+
48
+ // 1) Prefer native binary (postinstall download)
49
+ if (version) {
50
+ const binPath = getCachedBinaryPath({ version })
51
+ if (fs.existsSync(binPath)) {
52
+ run(binPath, ['--acp', ...process.argv.slice(2)])
53
+ }
54
+ }
55
+
56
+ // 2) Node.js runtime fallback (npm install should work without Bun)
57
+ const distEntry = path.join(packageRoot, 'dist', 'index.js')
58
+ if (fs.existsSync(distEntry)) {
59
+ run(process.execPath, [distEntry, '--acp', ...process.argv.slice(2)])
60
+ }
61
+
62
+ process.stderr.write(
63
+ [
64
+ '❌ kode-acp is not runnable on this system.',
65
+ '',
66
+ 'Tried:',
67
+ '- Native binary (postinstall download)',
68
+ '- Node.js runtime fallback',
69
+ '',
70
+ 'Fix:',
71
+ '- Reinstall (ensure network access), or set KODE_BINARY_BASE_URL to a mirror',
72
+ '- Or download a standalone binary from GitHub Releases',
73
+ '',
74
+ version ? `Package version: ${version}` : '',
75
+ ]
76
+ .filter(Boolean)
77
+ .join('\n'),
78
+ )
79
+ process.exit(1)
80
+ }
81
+
82
+ main()