@danya-ai/cli 0.1.1 → 0.1.2
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/README.md +27 -3
- package/dist/REPL-URLRZ4T4.js +42 -0
- package/dist/{acp-XPFY5L23.js → acp-OF52BP4A.js} +26 -26
- package/dist/{agentsValidate-YP7GA4ER.js → agentsValidate-WUX5I4FS.js} +7 -7
- package/dist/{ask-F53PCNWW.js → ask-5P2J7UA5.js} +25 -25
- package/dist/{autoUpdater-PAZTRW74.js → autoUpdater-6ABURQZA.js} +3 -3
- package/dist/{chunk-5GADLAR7.js → chunk-2VUDETSP.js} +1 -1
- package/dist/{chunk-TLCZFEI3.js → chunk-3GLLMJKA.js} +3 -3
- package/dist/{chunk-DYHI3HU4.js → chunk-5ONWVNJH.js} +1 -1
- package/dist/{chunk-3LC6LWSN.js → chunk-6GABS3DM.js} +1 -1
- package/dist/{chunk-WTLJM7O2.js → chunk-6IH7H2LH.js} +3 -3
- package/dist/{chunk-JKRPU66R.js → chunk-6KD43S3G.js} +4 -4
- package/dist/{chunk-RIE2FUKS.js → chunk-7I3UELIX.js} +2 -2
- package/dist/{chunk-DH6PY5WA.js → chunk-BAYPSZHG.js} +1 -1
- package/dist/{chunk-EOZSZNKR.js → chunk-BTAVLAZT.js} +3 -3
- package/dist/{chunk-JIBQDOXO.js → chunk-CZ5UJ3RL.js} +1 -1
- package/dist/chunk-DKOCP6VD.js.map +7 -0
- package/dist/{chunk-QUV2YCUP.js → chunk-ESHU3HUM.js} +32 -32
- package/dist/{chunk-QUV2YCUP.js.map → chunk-ESHU3HUM.js.map} +1 -1
- package/dist/{chunk-DQ3YBGNC.js → chunk-H3P32G2A.js} +3 -3
- package/dist/{chunk-UOERQDSJ.js → chunk-HNK7M2ZO.js} +1 -1
- package/dist/{chunk-CDS5HL6U.js → chunk-HRXRIW33.js} +2 -2
- package/dist/{chunk-4FOB6KC5.js → chunk-JF5D7ADP.js} +3 -3
- package/dist/{chunk-5XPLGRCI.js → chunk-JNAMM7A6.js} +11 -11
- package/dist/{chunk-LO3O7WT2.js → chunk-KS52NNBY.js} +2 -2
- package/dist/{chunk-L4IPQYSY.js → chunk-M75PDOOM.js} +3 -3
- package/dist/{chunk-KS5K2JLY.js → chunk-N74L4GAM.js} +1 -1
- package/dist/{chunk-UYR5Q3GS.js → chunk-PTQTKIR2.js} +1 -1
- package/dist/{chunk-UYR5Q3GS.js.map → chunk-PTQTKIR2.js.map} +1 -1
- package/dist/{chunk-ZS6GNOVF.js → chunk-QJMLHIGS.js} +2 -2
- package/dist/{chunk-7NTVKI6U.js → chunk-QUAOJLG6.js} +1 -1
- package/dist/{chunk-QOWU527O.js → chunk-RO73O3Q7.js} +4 -4
- package/dist/{chunk-5552MSXN.js → chunk-SSS2WVMA.js} +1 -1
- package/dist/{chunk-NFMXSWNI.js → chunk-T6RTYOJB.js} +3 -3
- package/dist/{chunk-2ON4OVWS.js → chunk-U7ZJW3CQ.js} +2 -2
- package/dist/{chunk-DVRQKRHN.js → chunk-VMJRNHDU.js} +2 -2
- package/dist/{cli-74WUWFKO.js → cli-FE6CUZI3.js} +78 -78
- package/dist/commands-6DP3QW2F.js +46 -0
- package/dist/{config-KBJLBJ4F.js → config-JEGZHGSM.js} +4 -4
- package/dist/{context-SUQRQHNG.js → context-LEXLLT4O.js} +5 -5
- package/dist/{customCommands-4H5TDSCI.js → customCommands-RLUKKBRZ.js} +4 -4
- package/dist/{env-EBAMYGTP.js → env-4PRTNVDJ.js} +2 -2
- package/dist/index.js +3 -3
- package/dist/{kodeAgentSessionLoad-OEYEYLKG.js → kodeAgentSessionLoad-LUKUH23S.js} +4 -4
- package/dist/{kodeAgentSessionResume-53WMZDR6.js → kodeAgentSessionResume-FDZ6H3PX.js} +4 -4
- package/dist/{kodeAgentStreamJsonSession-QQV52SDB.js → kodeAgentStreamJsonSession-VE2UG5B2.js} +1 -1
- package/dist/{kodeHooks-LXHKYCVC.js → kodeHooks-ZVNRQTZM.js} +4 -4
- package/dist/{llm-5DSL623J.js → llm-IFU62ZT4.js} +28 -28
- package/dist/{llm-5DSL623J.js.map → llm-IFU62ZT4.js.map} +2 -2
- package/dist/{llmLazy-EMO4BVVB.js → llmLazy-45EGHX2A.js} +1 -1
- package/dist/{loader-DSVKWJVQ.js → loader-TITFI6LS.js} +4 -4
- package/dist/{mcp-3CCDCYYX.js → mcp-DE5HUK63.js} +7 -7
- package/dist/{mentionProcessor-HRUF4ANP.js → mentionProcessor-SAPYBDCK.js} +5 -5
- package/dist/{messages-KZTRKY2I.js → messages-BARXRPB4.js} +1 -1
- package/dist/{model-PHL6VTAG.js → model-PC6MMS2S.js} +5 -5
- package/dist/{openai-M3RAQFGM.js → openai-AVJO73FG.js} +5 -5
- package/dist/{outputStyles-6VVYMSWK.js → outputStyles-VL7EKGIQ.js} +4 -4
- package/dist/{pluginRuntime-TCH3K4F6.js → pluginRuntime-IG2H3W7C.js} +6 -6
- package/dist/{pluginValidation-X4A5NSMU.js → pluginValidation-TOBMLJ5A.js} +6 -6
- package/dist/prompts-JGBWXN2Z.js +50 -0
- package/dist/query-4DUM4QP7.js +50 -0
- package/dist/{ripgrep-TVXVT4WE.js → ripgrep-HID6XW3J.js} +3 -3
- package/dist/{skillMarketplace-AXUCUS3B.js → skillMarketplace-YBS7NR7Q.js} +3 -3
- package/dist/{state-SDEP3HY3.js → state-5OBXGJX6.js} +2 -2
- package/dist/{theme-SPQRPQ7O.js → theme-U2POECGP.js} +5 -5
- package/dist/{toolPermissionSettings-H6TWVANG.js → toolPermissionSettings-AYX5MEOW.js} +6 -6
- package/dist/tools-JL434UMR.js +47 -0
- package/dist/{userInput-QU3SH2SR.js → userInput-RXNBLFAH.js} +27 -27
- package/package.json +1 -1
- package/dist/REPL-JPCWUTDB.js +0 -42
- package/dist/chunk-HJCCXED7.js.map +0 -7
- package/dist/commands-2ZN5PXG5.js +0 -46
- package/dist/prompts-IVLP5KLQ.js +0 -50
- package/dist/query-JIRCNAY5.js +0 -50
- package/dist/tools-G2P3XRE7.js +0 -47
- /package/dist/{REPL-JPCWUTDB.js.map → REPL-URLRZ4T4.js.map} +0 -0
- /package/dist/{acp-XPFY5L23.js.map → acp-OF52BP4A.js.map} +0 -0
- /package/dist/{agentsValidate-YP7GA4ER.js.map → agentsValidate-WUX5I4FS.js.map} +0 -0
- /package/dist/{ask-F53PCNWW.js.map → ask-5P2J7UA5.js.map} +0 -0
- /package/dist/{autoUpdater-PAZTRW74.js.map → autoUpdater-6ABURQZA.js.map} +0 -0
- /package/dist/{chunk-5GADLAR7.js.map → chunk-2VUDETSP.js.map} +0 -0
- /package/dist/{chunk-TLCZFEI3.js.map → chunk-3GLLMJKA.js.map} +0 -0
- /package/dist/{chunk-DYHI3HU4.js.map → chunk-5ONWVNJH.js.map} +0 -0
- /package/dist/{chunk-3LC6LWSN.js.map → chunk-6GABS3DM.js.map} +0 -0
- /package/dist/{chunk-WTLJM7O2.js.map → chunk-6IH7H2LH.js.map} +0 -0
- /package/dist/{chunk-JKRPU66R.js.map → chunk-6KD43S3G.js.map} +0 -0
- /package/dist/{chunk-RIE2FUKS.js.map → chunk-7I3UELIX.js.map} +0 -0
- /package/dist/{chunk-DH6PY5WA.js.map → chunk-BAYPSZHG.js.map} +0 -0
- /package/dist/{chunk-EOZSZNKR.js.map → chunk-BTAVLAZT.js.map} +0 -0
- /package/dist/{chunk-JIBQDOXO.js.map → chunk-CZ5UJ3RL.js.map} +0 -0
- /package/dist/{chunk-HJCCXED7.js → chunk-DKOCP6VD.js} +0 -0
- /package/dist/{chunk-DQ3YBGNC.js.map → chunk-H3P32G2A.js.map} +0 -0
- /package/dist/{chunk-UOERQDSJ.js.map → chunk-HNK7M2ZO.js.map} +0 -0
- /package/dist/{chunk-CDS5HL6U.js.map → chunk-HRXRIW33.js.map} +0 -0
- /package/dist/{chunk-4FOB6KC5.js.map → chunk-JF5D7ADP.js.map} +0 -0
- /package/dist/{chunk-5XPLGRCI.js.map → chunk-JNAMM7A6.js.map} +0 -0
- /package/dist/{chunk-LO3O7WT2.js.map → chunk-KS52NNBY.js.map} +0 -0
- /package/dist/{chunk-L4IPQYSY.js.map → chunk-M75PDOOM.js.map} +0 -0
- /package/dist/{chunk-KS5K2JLY.js.map → chunk-N74L4GAM.js.map} +0 -0
- /package/dist/{chunk-ZS6GNOVF.js.map → chunk-QJMLHIGS.js.map} +0 -0
- /package/dist/{chunk-7NTVKI6U.js.map → chunk-QUAOJLG6.js.map} +0 -0
- /package/dist/{chunk-QOWU527O.js.map → chunk-RO73O3Q7.js.map} +0 -0
- /package/dist/{chunk-5552MSXN.js.map → chunk-SSS2WVMA.js.map} +0 -0
- /package/dist/{chunk-NFMXSWNI.js.map → chunk-T6RTYOJB.js.map} +0 -0
- /package/dist/{chunk-2ON4OVWS.js.map → chunk-U7ZJW3CQ.js.map} +0 -0
- /package/dist/{chunk-DVRQKRHN.js.map → chunk-VMJRNHDU.js.map} +0 -0
- /package/dist/{cli-74WUWFKO.js.map → cli-FE6CUZI3.js.map} +0 -0
- /package/dist/{commands-2ZN5PXG5.js.map → commands-6DP3QW2F.js.map} +0 -0
- /package/dist/{config-KBJLBJ4F.js.map → config-JEGZHGSM.js.map} +0 -0
- /package/dist/{context-SUQRQHNG.js.map → context-LEXLLT4O.js.map} +0 -0
- /package/dist/{customCommands-4H5TDSCI.js.map → customCommands-RLUKKBRZ.js.map} +0 -0
- /package/dist/{env-EBAMYGTP.js.map → env-4PRTNVDJ.js.map} +0 -0
- /package/dist/{kodeAgentSessionLoad-OEYEYLKG.js.map → kodeAgentSessionLoad-LUKUH23S.js.map} +0 -0
- /package/dist/{kodeAgentSessionResume-53WMZDR6.js.map → kodeAgentSessionResume-FDZ6H3PX.js.map} +0 -0
- /package/dist/{kodeAgentStreamJsonSession-QQV52SDB.js.map → kodeAgentStreamJsonSession-VE2UG5B2.js.map} +0 -0
- /package/dist/{kodeHooks-LXHKYCVC.js.map → kodeHooks-ZVNRQTZM.js.map} +0 -0
- /package/dist/{llmLazy-EMO4BVVB.js.map → llmLazy-45EGHX2A.js.map} +0 -0
- /package/dist/{loader-DSVKWJVQ.js.map → loader-TITFI6LS.js.map} +0 -0
- /package/dist/{mcp-3CCDCYYX.js.map → mcp-DE5HUK63.js.map} +0 -0
- /package/dist/{mentionProcessor-HRUF4ANP.js.map → mentionProcessor-SAPYBDCK.js.map} +0 -0
- /package/dist/{messages-KZTRKY2I.js.map → messages-BARXRPB4.js.map} +0 -0
- /package/dist/{model-PHL6VTAG.js.map → model-PC6MMS2S.js.map} +0 -0
- /package/dist/{openai-M3RAQFGM.js.map → openai-AVJO73FG.js.map} +0 -0
- /package/dist/{outputStyles-6VVYMSWK.js.map → outputStyles-VL7EKGIQ.js.map} +0 -0
- /package/dist/{pluginRuntime-TCH3K4F6.js.map → pluginRuntime-IG2H3W7C.js.map} +0 -0
- /package/dist/{pluginValidation-X4A5NSMU.js.map → pluginValidation-TOBMLJ5A.js.map} +0 -0
- /package/dist/{prompts-IVLP5KLQ.js.map → prompts-JGBWXN2Z.js.map} +0 -0
- /package/dist/{query-JIRCNAY5.js.map → query-4DUM4QP7.js.map} +0 -0
- /package/dist/{ripgrep-TVXVT4WE.js.map → ripgrep-HID6XW3J.js.map} +0 -0
- /package/dist/{skillMarketplace-AXUCUS3B.js.map → skillMarketplace-YBS7NR7Q.js.map} +0 -0
- /package/dist/{state-SDEP3HY3.js.map → state-5OBXGJX6.js.map} +0 -0
- /package/dist/{theme-SPQRPQ7O.js.map → theme-U2POECGP.js.map} +0 -0
- /package/dist/{toolPermissionSettings-H6TWVANG.js.map → toolPermissionSettings-AYX5MEOW.js.map} +0 -0
- /package/dist/{tools-G2P3XRE7.js.map → tools-JL434UMR.js.map} +0 -0
- /package/dist/{userInput-QU3SH2SR.js.map → userInput-RXNBLFAH.js.map} +0 -0
package/README.md
CHANGED
|
@@ -32,7 +32,7 @@ danya --version
|
|
|
32
32
|
cd <你的游戏项目>
|
|
33
33
|
danya init
|
|
34
34
|
|
|
35
|
-
#
|
|
35
|
+
# 启动交互模式(首次启动会引导配置 AI 模型)
|
|
36
36
|
danya
|
|
37
37
|
|
|
38
38
|
# 常用命令
|
|
@@ -42,6 +42,30 @@ danya
|
|
|
42
42
|
/parallel-execute prepare "大功能" # 波次并行执行
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
+
### 配置 / 切换 AI 模型
|
|
46
|
+
|
|
47
|
+
在 danya 对话中输入 `/model`:
|
|
48
|
+
|
|
49
|
+
1. 选 **Manage Model List** → 添加新模型
|
|
50
|
+
2. 选择 Provider:
|
|
51
|
+
- **Custom Messages API** — Claude 系列(Anthropic 官方接口)
|
|
52
|
+
- **Custom OpenAI-Compatible API** — GPT / DeepSeek / 千问 / GLM 等
|
|
53
|
+
- **Ollama** — 本地模型
|
|
54
|
+
3. 粘贴 API Key → 后续步骤一路回车(使用默认值即可)
|
|
55
|
+
4. 回到 `/model` 页面,选择要用的模型
|
|
56
|
+
|
|
57
|
+
常用模型配置参考:
|
|
58
|
+
|
|
59
|
+
| 模型 | Provider | Base URL | Model ID | Max Tokens | Context |
|
|
60
|
+
|------|----------|----------|----------|------------|---------|
|
|
61
|
+
| Claude Opus 4.6 | Messages API | `https://api.anthropic.com` | `claude-opus-4-6` | 16K | 200K |
|
|
62
|
+
| Claude Sonnet 4.6 | Messages API | `https://api.anthropic.com` | `claude-sonnet-4-6` | 16K | 200K |
|
|
63
|
+
| DeepSeek V3 | Messages API | `https://api.deepseek.com/anthropic` | `deepseek-chat` | 8K | 128K |
|
|
64
|
+
| GPT-4o | OpenAI-Compatible | `https://api.openai.com/v1` | `gpt-4o` | 16K | 128K |
|
|
65
|
+
| 千问 Max | OpenAI-Compatible | `https://dashscope.aliyuncs.com/compatible-mode/v1` | `qwen-max` | 8K | 128K |
|
|
66
|
+
|
|
67
|
+
模型配置保存在 `~/.danya/config.json`,无需手动编辑。
|
|
68
|
+
|
|
45
69
|
快捷键:
|
|
46
70
|
- `Ctrl+G` — 打开外部编辑器(优先 `$EDITOR`,回退 code/nano/vim),关闭后内容自动回填
|
|
47
71
|
- `Shift+Enter` — 输入框内换行但不发送,普通 `Enter` 提交
|
|
@@ -331,6 +355,6 @@ Danya 是一个**学习项目**,用于研究 AI Agent 在游戏开发中的工
|
|
|
331
355
|
|
|
332
356
|
**领域专用 > 通用万能。**
|
|
333
357
|
|
|
334
|
-
##
|
|
358
|
+
## 许可证
|
|
335
359
|
|
|
336
|
-
Apache
|
|
360
|
+
Apache 2.0 许可证 - 详见 [LICENSE](LICENSE)。
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { createRequire as __kodeCreateRequire } from "node:module";
|
|
2
|
+
const require = __kodeCreateRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
REPL
|
|
5
|
+
} from "./chunk-ESHU3HUM.js";
|
|
6
|
+
import "./chunk-5ONWVNJH.js";
|
|
7
|
+
import "./chunk-RO73O3Q7.js";
|
|
8
|
+
import "./chunk-6IH7H2LH.js";
|
|
9
|
+
import "./chunk-6GABS3DM.js";
|
|
10
|
+
import "./chunk-HNK7M2ZO.js";
|
|
11
|
+
import "./chunk-U7ZJW3CQ.js";
|
|
12
|
+
import "./chunk-Y5LQPJWK.js";
|
|
13
|
+
import "./chunk-JVGG2YQR.js";
|
|
14
|
+
import "./chunk-H3P32G2A.js";
|
|
15
|
+
import "./chunk-U7Z4MXY4.js";
|
|
16
|
+
import "./chunk-HRXRIW33.js";
|
|
17
|
+
import "./chunk-VMJRNHDU.js";
|
|
18
|
+
import "./chunk-6KD43S3G.js";
|
|
19
|
+
import "./chunk-SSS2WVMA.js";
|
|
20
|
+
import "./chunk-KS52NNBY.js";
|
|
21
|
+
import "./chunk-M75PDOOM.js";
|
|
22
|
+
import "./chunk-2VUDETSP.js";
|
|
23
|
+
import "./chunk-MVN3DHQF.js";
|
|
24
|
+
import "./chunk-QJMLHIGS.js";
|
|
25
|
+
import "./chunk-XEYEKVFT.js";
|
|
26
|
+
import "./chunk-7I3UELIX.js";
|
|
27
|
+
import "./chunk-WAY3DKFO.js";
|
|
28
|
+
import "./chunk-2VQWLLDU.js";
|
|
29
|
+
import "./chunk-QUAOJLG6.js";
|
|
30
|
+
import "./chunk-BTAVLAZT.js";
|
|
31
|
+
import "./chunk-JF5D7ADP.js";
|
|
32
|
+
import "./chunk-N74L4GAM.js";
|
|
33
|
+
import "./chunk-T6RTYOJB.js";
|
|
34
|
+
import "./chunk-HIIHGKXP.js";
|
|
35
|
+
import "./chunk-CZ5UJ3RL.js";
|
|
36
|
+
import "./chunk-BAYPSZHG.js";
|
|
37
|
+
import "./chunk-PTQTKIR2.js";
|
|
38
|
+
import "./chunk-LWXT5RGE.js";
|
|
39
|
+
import "./chunk-M3TKNAUR.js";
|
|
40
|
+
export {
|
|
41
|
+
REPL
|
|
42
|
+
};
|
|
@@ -6,60 +6,60 @@ import {
|
|
|
6
6
|
} from "./chunk-PDSAJX7G.js";
|
|
7
7
|
import {
|
|
8
8
|
getTools
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-JNAMM7A6.js";
|
|
10
10
|
import {
|
|
11
11
|
getCommands,
|
|
12
12
|
getSystemPrompt,
|
|
13
13
|
grantReadPermissionForOriginalDir,
|
|
14
14
|
hasPermissionsToUseTool,
|
|
15
15
|
query
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import "./chunk-
|
|
16
|
+
} from "./chunk-ESHU3HUM.js";
|
|
17
|
+
import "./chunk-5ONWVNJH.js";
|
|
18
18
|
import {
|
|
19
19
|
getClients
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
23
|
-
import "./chunk-
|
|
24
|
-
import "./chunk-
|
|
20
|
+
} from "./chunk-RO73O3Q7.js";
|
|
21
|
+
import "./chunk-6IH7H2LH.js";
|
|
22
|
+
import "./chunk-6GABS3DM.js";
|
|
23
|
+
import "./chunk-HNK7M2ZO.js";
|
|
24
|
+
import "./chunk-U7ZJW3CQ.js";
|
|
25
25
|
import "./chunk-Y5LQPJWK.js";
|
|
26
26
|
import "./chunk-JVGG2YQR.js";
|
|
27
|
-
import "./chunk-
|
|
27
|
+
import "./chunk-H3P32G2A.js";
|
|
28
28
|
import "./chunk-U7Z4MXY4.js";
|
|
29
|
-
import "./chunk-
|
|
30
|
-
import "./chunk-
|
|
31
|
-
import "./chunk-
|
|
32
|
-
import "./chunk-
|
|
33
|
-
import "./chunk-
|
|
29
|
+
import "./chunk-HRXRIW33.js";
|
|
30
|
+
import "./chunk-VMJRNHDU.js";
|
|
31
|
+
import "./chunk-6KD43S3G.js";
|
|
32
|
+
import "./chunk-SSS2WVMA.js";
|
|
33
|
+
import "./chunk-KS52NNBY.js";
|
|
34
34
|
import {
|
|
35
35
|
loadToolPermissionContextFromDisk,
|
|
36
36
|
persistToolPermissionUpdateToDisk
|
|
37
|
-
} from "./chunk-
|
|
38
|
-
import "./chunk-
|
|
37
|
+
} from "./chunk-M75PDOOM.js";
|
|
38
|
+
import "./chunk-2VUDETSP.js";
|
|
39
39
|
import {
|
|
40
40
|
applyToolPermissionContextUpdates
|
|
41
41
|
} from "./chunk-MVN3DHQF.js";
|
|
42
|
-
import "./chunk-
|
|
42
|
+
import "./chunk-QJMLHIGS.js";
|
|
43
43
|
import "./chunk-XEYEKVFT.js";
|
|
44
|
-
import "./chunk-
|
|
44
|
+
import "./chunk-7I3UELIX.js";
|
|
45
45
|
import "./chunk-WAY3DKFO.js";
|
|
46
46
|
import "./chunk-2VQWLLDU.js";
|
|
47
47
|
import {
|
|
48
48
|
createAssistantMessage,
|
|
49
49
|
createUserMessage
|
|
50
|
-
} from "./chunk-
|
|
51
|
-
import "./chunk-
|
|
50
|
+
} from "./chunk-QUAOJLG6.js";
|
|
51
|
+
import "./chunk-BTAVLAZT.js";
|
|
52
52
|
import {
|
|
53
53
|
getContext
|
|
54
|
-
} from "./chunk-
|
|
55
|
-
import "./chunk-
|
|
54
|
+
} from "./chunk-JF5D7ADP.js";
|
|
55
|
+
import "./chunk-N74L4GAM.js";
|
|
56
56
|
import {
|
|
57
57
|
enableConfigs
|
|
58
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-T6RTYOJB.js";
|
|
59
59
|
import "./chunk-HIIHGKXP.js";
|
|
60
60
|
import {
|
|
61
61
|
initDebugLogger
|
|
62
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-CZ5UJ3RL.js";
|
|
63
63
|
import {
|
|
64
64
|
PRODUCT_COMMAND,
|
|
65
65
|
getKodeBaseDir,
|
|
@@ -72,11 +72,11 @@ import {
|
|
|
72
72
|
logError,
|
|
73
73
|
setCwd,
|
|
74
74
|
setOriginalCwd
|
|
75
|
-
} from "./chunk-
|
|
75
|
+
} from "./chunk-BAYPSZHG.js";
|
|
76
76
|
import {
|
|
77
77
|
MACRO,
|
|
78
78
|
init_macros
|
|
79
|
-
} from "./chunk-
|
|
79
|
+
} from "./chunk-PTQTKIR2.js";
|
|
80
80
|
import "./chunk-LWXT5RGE.js";
|
|
81
81
|
import "./chunk-M3TKNAUR.js";
|
|
82
82
|
|
|
@@ -2,12 +2,12 @@ import { createRequire as __kodeCreateRequire } from "node:module";
|
|
|
2
2
|
const require = __kodeCreateRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
getModelManager
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-BTAVLAZT.js";
|
|
6
|
+
import "./chunk-T6RTYOJB.js";
|
|
7
7
|
import "./chunk-HIIHGKXP.js";
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-CZ5UJ3RL.js";
|
|
9
|
+
import "./chunk-BAYPSZHG.js";
|
|
10
|
+
import "./chunk-PTQTKIR2.js";
|
|
11
11
|
import "./chunk-M3TKNAUR.js";
|
|
12
12
|
|
|
13
13
|
// src/entrypoints/cli/agentsValidate.ts
|
|
@@ -344,8 +344,8 @@ async function validateAgentTemplates(args) {
|
|
|
344
344
|
let knownToolNames;
|
|
345
345
|
if (args.checkTools) {
|
|
346
346
|
try {
|
|
347
|
-
const { getTools } = await import("./tools-
|
|
348
|
-
const { getCurrentProjectConfig } = await import("./config-
|
|
347
|
+
const { getTools } = await import("./tools-JL434UMR.js");
|
|
348
|
+
const { getCurrentProjectConfig } = await import("./config-JEGZHGSM.js");
|
|
349
349
|
const allTools = await getTools(getCurrentProjectConfig().enableArchitectTool);
|
|
350
350
|
knownToolNames = new Set(allTools.map((t) => t.name));
|
|
351
351
|
} catch {
|
|
@@ -3,51 +3,51 @@ const require = __kodeCreateRequire(import.meta.url);
|
|
|
3
3
|
import {
|
|
4
4
|
getSystemPrompt,
|
|
5
5
|
query
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-ESHU3HUM.js";
|
|
7
|
+
import "./chunk-5ONWVNJH.js";
|
|
8
|
+
import "./chunk-RO73O3Q7.js";
|
|
9
|
+
import "./chunk-6IH7H2LH.js";
|
|
10
|
+
import "./chunk-6GABS3DM.js";
|
|
11
|
+
import "./chunk-HNK7M2ZO.js";
|
|
12
|
+
import "./chunk-U7ZJW3CQ.js";
|
|
13
13
|
import "./chunk-Y5LQPJWK.js";
|
|
14
14
|
import "./chunk-JVGG2YQR.js";
|
|
15
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-H3P32G2A.js";
|
|
16
16
|
import "./chunk-U7Z4MXY4.js";
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
23
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-HRXRIW33.js";
|
|
18
|
+
import "./chunk-VMJRNHDU.js";
|
|
19
|
+
import "./chunk-6KD43S3G.js";
|
|
20
|
+
import "./chunk-SSS2WVMA.js";
|
|
21
|
+
import "./chunk-KS52NNBY.js";
|
|
22
|
+
import "./chunk-M75PDOOM.js";
|
|
23
|
+
import "./chunk-2VUDETSP.js";
|
|
24
24
|
import "./chunk-MVN3DHQF.js";
|
|
25
|
-
import "./chunk-
|
|
25
|
+
import "./chunk-QJMLHIGS.js";
|
|
26
26
|
import "./chunk-XEYEKVFT.js";
|
|
27
|
-
import "./chunk-
|
|
27
|
+
import "./chunk-7I3UELIX.js";
|
|
28
28
|
import "./chunk-WAY3DKFO.js";
|
|
29
29
|
import "./chunk-2VQWLLDU.js";
|
|
30
30
|
import {
|
|
31
31
|
createUserMessage
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-QUAOJLG6.js";
|
|
33
33
|
import {
|
|
34
34
|
getModelManager
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-BTAVLAZT.js";
|
|
36
36
|
import {
|
|
37
37
|
getContext
|
|
38
|
-
} from "./chunk-
|
|
39
|
-
import "./chunk-
|
|
40
|
-
import "./chunk-
|
|
38
|
+
} from "./chunk-JF5D7ADP.js";
|
|
39
|
+
import "./chunk-N74L4GAM.js";
|
|
40
|
+
import "./chunk-T6RTYOJB.js";
|
|
41
41
|
import "./chunk-HIIHGKXP.js";
|
|
42
|
-
import "./chunk-
|
|
42
|
+
import "./chunk-CZ5UJ3RL.js";
|
|
43
43
|
import {
|
|
44
44
|
getMessagesPath,
|
|
45
45
|
init_log,
|
|
46
46
|
init_state,
|
|
47
47
|
overwriteLog,
|
|
48
48
|
setCwd
|
|
49
|
-
} from "./chunk-
|
|
50
|
-
import "./chunk-
|
|
49
|
+
} from "./chunk-BAYPSZHG.js";
|
|
50
|
+
import "./chunk-PTQTKIR2.js";
|
|
51
51
|
import {
|
|
52
52
|
getTotalCost
|
|
53
53
|
} from "./chunk-LWXT5RGE.js";
|
|
@@ -5,9 +5,9 @@ import {
|
|
|
5
5
|
checkAndNotifyUpdate,
|
|
6
6
|
getLatestVersion,
|
|
7
7
|
getUpdateCommandSuggestions
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-3GLLMJKA.js";
|
|
9
|
+
import "./chunk-BAYPSZHG.js";
|
|
10
|
+
import "./chunk-PTQTKIR2.js";
|
|
11
11
|
import "./chunk-M3TKNAUR.js";
|
|
12
12
|
export {
|
|
13
13
|
assertMinVersion,
|
|
@@ -7,11 +7,11 @@ import {
|
|
|
7
7
|
init_log,
|
|
8
8
|
init_product,
|
|
9
9
|
logError
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-BAYPSZHG.js";
|
|
11
11
|
import {
|
|
12
12
|
MACRO,
|
|
13
13
|
init_macros
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-PTQTKIR2.js";
|
|
15
15
|
|
|
16
16
|
// src/utils/session/autoUpdater.ts
|
|
17
17
|
init_execFileNoThrow();
|
|
@@ -90,7 +90,7 @@ async function checkAndNotifyUpdate() {
|
|
|
90
90
|
const [
|
|
91
91
|
{ isAutoUpdaterDisabled, getGlobalConfig, saveGlobalConfig },
|
|
92
92
|
{ env }
|
|
93
|
-
] = await Promise.all([import("./config-
|
|
93
|
+
] = await Promise.all([import("./config-JEGZHGSM.js"), import("./env-4PRTNVDJ.js")]);
|
|
94
94
|
if (await isAutoUpdaterDisabled()) return;
|
|
95
95
|
if (await env.getIsDocker()) return;
|
|
96
96
|
if (!await env.hasInternetAccess()) return;
|
|
@@ -2,14 +2,14 @@ import { createRequire as __kodeCreateRequire } from "node:module";
|
|
|
2
2
|
const require = __kodeCreateRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
MarketplaceManifestSchema
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-6GABS3DM.js";
|
|
6
6
|
import {
|
|
7
7
|
parseFrontmatter
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-KS52NNBY.js";
|
|
9
9
|
import {
|
|
10
10
|
getCwd,
|
|
11
11
|
init_state
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-BAYPSZHG.js";
|
|
13
13
|
|
|
14
14
|
// src/services/plugins/pluginValidation.ts
|
|
15
15
|
init_state();
|
|
@@ -3,7 +3,7 @@ const require = __kodeCreateRequire(import.meta.url);
|
|
|
3
3
|
|
|
4
4
|
// src/services/ai/llmLazy.ts
|
|
5
5
|
async function queryLLM(messages, systemPrompt, maxThinkingTokens, tools, signal, options) {
|
|
6
|
-
const { queryLLM: inner } = await import("./llm-
|
|
6
|
+
const { queryLLM: inner } = await import("./llm-IFU62ZT4.js");
|
|
7
7
|
return inner(
|
|
8
8
|
messages,
|
|
9
9
|
systemPrompt,
|
|
@@ -14,15 +14,15 @@ async function queryLLM(messages, systemPrompt, maxThinkingTokens, tools, signal
|
|
|
14
14
|
);
|
|
15
15
|
}
|
|
16
16
|
async function queryQuick(args) {
|
|
17
|
-
const { queryQuick: inner } = await import("./llm-
|
|
17
|
+
const { queryQuick: inner } = await import("./llm-IFU62ZT4.js");
|
|
18
18
|
return inner(args);
|
|
19
19
|
}
|
|
20
20
|
async function verifyApiKey(apiKey, baseURL, provider) {
|
|
21
|
-
const { verifyApiKey: inner } = await import("./llm-
|
|
21
|
+
const { verifyApiKey: inner } = await import("./llm-IFU62ZT4.js");
|
|
22
22
|
return inner(apiKey, baseURL, provider);
|
|
23
23
|
}
|
|
24
24
|
async function fetchAnthropicModels(apiKey, baseURL) {
|
|
25
|
-
const { fetchAnthropicModels: inner } = await import("./llm-
|
|
25
|
+
const { fetchAnthropicModels: inner } = await import("./llm-IFU62ZT4.js");
|
|
26
26
|
return inner(apiKey, baseURL);
|
|
27
27
|
}
|
|
28
28
|
|
|
@@ -8,13 +8,13 @@ import {
|
|
|
8
8
|
} from "./chunk-2VQWLLDU.js";
|
|
9
9
|
import {
|
|
10
10
|
debug
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-CZ5UJ3RL.js";
|
|
12
12
|
import {
|
|
13
13
|
getCwd,
|
|
14
14
|
init_log,
|
|
15
15
|
init_state,
|
|
16
16
|
logError
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-BAYPSZHG.js";
|
|
18
18
|
|
|
19
19
|
// src/utils/agent/loader.ts
|
|
20
20
|
init_state();
|
|
@@ -3,14 +3,14 @@ const require = __kodeCreateRequire(import.meta.url);
|
|
|
3
3
|
import {
|
|
4
4
|
getGlobalConfig,
|
|
5
5
|
saveGlobalConfig
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-T6RTYOJB.js";
|
|
7
7
|
import {
|
|
8
8
|
debug
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-CZ5UJ3RL.js";
|
|
10
10
|
import {
|
|
11
11
|
init_log,
|
|
12
12
|
logError
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-BAYPSZHG.js";
|
|
14
14
|
|
|
15
15
|
// src/utils/model/index.ts
|
|
16
16
|
init_log();
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/core/tools/tool.ts"],
|
|
4
|
+
"sourcesContent": ["import { z } from 'zod'\nimport type * as React from 'react'\nimport type { PermissionMode } from '@kode-types/permissionMode'\nimport type { ToolPermissionContext } from '@kode-types/toolPermissionContext'\nimport type {\n PermissionResult,\n PermissionDecision,\n} from '../../types/permissions'\n\nexport type SetToolJSXFn = (\n jsx: {\n jsx: React.ReactNode | null\n shouldHidePromptInput: boolean\n } | null,\n) => void\n\nexport interface ToolUseContext {\n messageId: string | undefined\n toolUseId?: string\n agentId?: string\n safeMode?: boolean\n abortController: AbortController\n readFileTimestamps: { [filePath: string]: number }\n options?: {\n commands?: any[]\n tools?: any[]\n verbose?: boolean\n slowAndCapableModel?: string\n safeMode?: boolean\n permissionMode?: PermissionMode\n toolPermissionContext?: ToolPermissionContext\n lastUserPrompt?: string\n forkNumber?: number\n messageLogName?: string\n maxThinkingTokens?: any\n model?: string\n commandAllowedTools?: string[]\n isKodingRequest?: boolean\n kodingContext?: string\n isCustomCommand?: boolean\n mcpClients?: any[]\n disableSlashCommands?: boolean\n persistSession?: boolean\n shouldAvoidPermissionPrompts?: boolean\n }\n responseState?: {\n previousResponseId?: string\n conversationId?: string\n }\n}\n\nexport interface ExtendedToolUseContext extends ToolUseContext {\n setToolJSX: SetToolJSXFn\n}\n\nexport interface ValidationResult {\n result: boolean\n message?: string\n errorCode?: number\n meta?: any\n}\n\n// ============================================================================\n// Tool Progress\n// ============================================================================\n\nexport type ToolProgressData = Record<string, unknown>\n\nexport type ToolProgress<P extends ToolProgressData = ToolProgressData> = {\n toolUseID: string\n data: P\n}\n\nexport type ToolCallProgress<P extends ToolProgressData = ToolProgressData> = (\n progress: ToolProgress<P>,\n) => void\n\n// ============================================================================\n// Tool Result\n// ============================================================================\n\nexport type ToolResult<T = unknown> = {\n data: T\n newMessages?: unknown[]\n contextModifier?: {\n modifyContext: (ctx: ToolUseContext) => ToolUseContext\n }\n}\n\n// ============================================================================\n// Tool Interface\n// ============================================================================\n\nexport interface Tool<\n TInput extends z.ZodTypeAny = z.ZodTypeAny,\n TOutput = any,\n> {\n // \u2500\u2500 Identity \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n name: string\n description?: string | ((input?: z.infer<TInput>) => Promise<string>)\n inputSchema: TInput\n inputJSONSchema?: Record<string, unknown>\n prompt: (options?: { safeMode?: boolean }) => Promise<string>\n userFacingName?: (input?: z.infer<TInput>) => string\n cachedDescription?: string\n\n /** 3-10 word hint for tool discovery */\n searchHint?: string\n\n // \u2500\u2500 State Queries \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n isEnabled: () => Promise<boolean>\n isReadOnly: (input?: z.infer<TInput>) => boolean\n isConcurrencySafe: (input?: z.infer<TInput>) => boolean\n needsPermissions: (input?: z.infer<TInput>) => boolean\n requiresUserInteraction?: (input?: z.infer<TInput>) => boolean\n\n /**\n * Whether the tool performs an irreversible action (delete, send, overwrite).\n * Used for risk assessment in gate chain and destructive command detection.\n */\n isDestructive?: (input?: z.infer<TInput>) => boolean\n\n /**\n * Extract the primary file path from tool input (for file-based tools).\n * Used by permission system for path-based rule matching.\n */\n getPath?: (input: z.infer<TInput>) => string\n\n /**\n * Maximum result size in characters before persisting to disk.\n * Large results are saved to file and the model gets a preview + path.\n */\n maxResultSizeChars?: number\n\n // \u2500\u2500 Validation & Permissions \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n validateInput?: (\n input: z.infer<TInput>,\n context?: ToolUseContext,\n ) => Promise<ValidationResult>\n\n /**\n * Rich permission checking that returns allow/ask/deny with reasons.\n * Provides richer feedback than needsPermissions().\n * If both checkPermissions and needsPermissions exist, checkPermissions takes precedence.\n */\n checkPermissions?: (\n input: z.infer<TInput>,\n context: ToolUseContext,\n ) => Promise<PermissionResult>\n\n /**\n * Prepare a matcher function for checking this tool's input against permission rules.\n * Returns a function that takes a rule pattern and returns whether it matches.\n */\n preparePermissionMatcher?: (\n input: z.infer<TInput>,\n ) => Promise<(rulePattern: string) => boolean>\n\n // \u2500\u2500 Rendering \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n renderResultForAssistant: (output: TOutput) => string | any[]\n renderToolUseMessage: (\n input: z.infer<TInput>,\n options: { verbose: boolean },\n ) => string | React.ReactElement | null\n renderToolUseRejectedMessage?: (...args: any[]) => React.ReactElement\n renderToolResultMessage?: (\n output: TOutput,\n options: { verbose: boolean },\n ) => React.ReactNode\n\n /**\n * Description for the status spinner during tool execution.\n * Returns something like \"Reading src/foo.ts\" or \"Searching codebase\".\n */\n getActivityDescription?: (input: z.infer<TInput>) => string | null\n\n // \u2500\u2500 Execution \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n /**\n * Async generator-based execution (Kode's pattern).\n * Yields progress events and a final result.\n */\n call: (\n input: z.infer<TInput>,\n context: ToolUseContext,\n ) => AsyncGenerator<\n | {\n type: 'result'\n data: TOutput\n resultForAssistant?: string | any[]\n newMessages?: unknown[]\n contextModifier?: {\n modifyContext: (ctx: ToolUseContext) => ToolUseContext\n }\n }\n | {\n type: 'progress'\n content: any\n normalizedMessages?: any[]\n tools?: any[]\n },\n void,\n unknown\n >\n}\n\n// ============================================================================\n// Utility Functions\n// ============================================================================\n\nexport function getToolDescription(tool: Tool): string {\n if (tool.cachedDescription) {\n return tool.cachedDescription\n }\n\n if (typeof tool.description === 'string') {\n return tool.description\n }\n\n return `Tool: ${tool.name}`\n}\n\n/**\n * Find a tool by name from a tool array.\n */\nexport function findToolByName(tools: Tool[], name: string): Tool | undefined {\n return tools.find((t) => t.name === name)\n}\n\n/**\n * Check if a tool is safe to run in parallel based on its input.\n * Read-only tools are always safe. Non-read-only tools check isConcurrencySafe.\n */\nexport function isToolParallelSafe(tool: Tool, input?: unknown): boolean {\n if (tool.isReadOnly(input)) return true\n return tool.isConcurrencySafe(input)\n}\n\n/**\n * Partition tool calls into parallel-safe and serial batches.\n */\nexport function partitionToolCalls<T extends { tool: Tool; input: unknown }>(\n calls: T[],\n): { parallel: T[]; serial: T[] } {\n const parallel: T[] = []\n const serial: T[] = []\n\n for (const call of calls) {\n if (isToolParallelSafe(call.tool, call.input)) {\n parallel.push(call)\n } else {\n serial.push(call)\n }\n }\n\n return { parallel, serial }\n}\n"],
|
|
5
|
+
"mappings": ";;;;AAiNO,SAAS,mBAAmB,MAAoB;AACrD,MAAI,KAAK,mBAAmB;AAC1B,WAAO,KAAK;AAAA,EACd;AAEA,MAAI,OAAO,KAAK,gBAAgB,UAAU;AACxC,WAAO,KAAK;AAAA,EACd;AAEA,SAAO,SAAS,KAAK,IAAI;AAC3B;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|