@shareai-lab/kode 1.0.71 → 1.0.75
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 +160 -1
- package/README.zh-CN.md +65 -1
- package/cli.js +5 -10
- package/package.json +6 -2
- package/src/ProjectOnboarding.tsx +47 -29
- package/src/Tool.ts +33 -4
- package/src/commands/agents.tsx +3401 -0
- package/src/commands/help.tsx +2 -2
- package/src/commands/resume.tsx +2 -1
- package/src/commands/terminalSetup.ts +4 -4
- package/src/commands.ts +3 -0
- package/src/components/ApproveApiKey.tsx +1 -1
- package/src/components/Config.tsx +10 -6
- package/src/components/ConsoleOAuthFlow.tsx +5 -4
- package/src/components/CustomSelect/select-option.tsx +28 -2
- package/src/components/CustomSelect/select.tsx +14 -5
- package/src/components/CustomSelect/theme.ts +45 -0
- package/src/components/Help.tsx +4 -4
- package/src/components/InvalidConfigDialog.tsx +1 -1
- package/src/components/LogSelector.tsx +1 -1
- package/src/components/MCPServerApprovalDialog.tsx +1 -1
- package/src/components/Message.tsx +2 -0
- package/src/components/ModelListManager.tsx +10 -6
- package/src/components/ModelSelector.tsx +201 -23
- package/src/components/ModelStatusDisplay.tsx +7 -5
- package/src/components/PromptInput.tsx +146 -96
- package/src/components/SentryErrorBoundary.ts +9 -3
- package/src/components/StickerRequestForm.tsx +16 -0
- package/src/components/StructuredDiff.tsx +36 -29
- package/src/components/TextInput.tsx +13 -0
- package/src/components/TodoItem.tsx +47 -0
- package/src/components/TrustDialog.tsx +1 -1
- package/src/components/messages/AssistantLocalCommandOutputMessage.tsx +5 -1
- package/src/components/messages/AssistantToolUseMessage.tsx +14 -4
- package/src/components/messages/TaskProgressMessage.tsx +32 -0
- package/src/components/messages/TaskToolMessage.tsx +58 -0
- package/src/components/permissions/FallbackPermissionRequest.tsx +2 -4
- package/src/components/permissions/FileEditPermissionRequest/FileEditPermissionRequest.tsx +1 -1
- package/src/components/permissions/FileEditPermissionRequest/FileEditToolDiff.tsx +5 -3
- package/src/components/permissions/FileWritePermissionRequest/FileWritePermissionRequest.tsx +1 -1
- package/src/components/permissions/FileWritePermissionRequest/FileWriteToolDiff.tsx +5 -3
- package/src/components/permissions/FilesystemPermissionRequest/FilesystemPermissionRequest.tsx +2 -4
- package/src/components/permissions/PermissionRequest.tsx +3 -5
- package/src/constants/macros.ts +2 -0
- package/src/constants/modelCapabilities.ts +179 -0
- package/src/constants/models.ts +90 -0
- package/src/constants/product.ts +1 -1
- package/src/context.ts +7 -7
- package/src/entrypoints/cli.tsx +23 -3
- package/src/entrypoints/mcp.ts +10 -10
- package/src/hooks/useCanUseTool.ts +1 -1
- package/src/hooks/useTextInput.ts +5 -2
- package/src/hooks/useUnifiedCompletion.ts +1405 -0
- package/src/messages.ts +1 -0
- package/src/query.ts +3 -0
- package/src/screens/ConfigureNpmPrefix.tsx +1 -1
- package/src/screens/Doctor.tsx +1 -1
- package/src/screens/REPL.tsx +11 -12
- package/src/services/adapters/base.ts +38 -0
- package/src/services/adapters/chatCompletions.ts +90 -0
- package/src/services/adapters/responsesAPI.ts +170 -0
- package/src/services/claude.ts +198 -62
- package/src/services/customCommands.ts +43 -22
- package/src/services/gpt5ConnectionTest.ts +340 -0
- package/src/services/mcpClient.ts +1 -1
- package/src/services/mentionProcessor.ts +273 -0
- package/src/services/modelAdapterFactory.ts +69 -0
- package/src/services/openai.ts +534 -14
- package/src/services/responseStateManager.ts +90 -0
- package/src/services/systemReminder.ts +113 -12
- package/src/test/testAdapters.ts +96 -0
- package/src/tools/AskExpertModelTool/AskExpertModelTool.tsx +120 -56
- package/src/tools/BashTool/BashTool.tsx +4 -31
- package/src/tools/BashTool/BashToolResultMessage.tsx +1 -1
- package/src/tools/BashTool/OutputLine.tsx +1 -0
- package/src/tools/FileEditTool/FileEditTool.tsx +4 -5
- package/src/tools/FileReadTool/FileReadTool.tsx +43 -10
- package/src/tools/MCPTool/MCPTool.tsx +2 -1
- package/src/tools/MultiEditTool/MultiEditTool.tsx +2 -2
- package/src/tools/NotebookReadTool/NotebookReadTool.tsx +15 -23
- package/src/tools/StickerRequestTool/StickerRequestTool.tsx +1 -1
- package/src/tools/TaskTool/TaskTool.tsx +170 -86
- package/src/tools/TaskTool/prompt.ts +61 -25
- package/src/tools/ThinkTool/ThinkTool.tsx +1 -3
- package/src/tools/TodoWriteTool/TodoWriteTool.tsx +65 -41
- package/src/tools/lsTool/lsTool.tsx +5 -2
- package/src/tools.ts +16 -16
- package/src/types/conversation.ts +51 -0
- package/src/types/logs.ts +58 -0
- package/src/types/modelCapabilities.ts +64 -0
- package/src/types/notebook.ts +87 -0
- package/src/utils/advancedFuzzyMatcher.ts +290 -0
- package/src/utils/agentLoader.ts +284 -0
- package/src/utils/ask.tsx +1 -0
- package/src/utils/commands.ts +1 -1
- package/src/utils/commonUnixCommands.ts +161 -0
- package/src/utils/config.ts +173 -2
- package/src/utils/conversationRecovery.ts +1 -0
- package/src/utils/debugLogger.ts +13 -13
- package/src/utils/exampleCommands.ts +1 -0
- package/src/utils/fuzzyMatcher.ts +328 -0
- package/src/utils/messages.tsx +6 -5
- package/src/utils/model.ts +120 -42
- package/src/utils/responseState.ts +23 -0
- package/src/utils/secureFile.ts +559 -0
- package/src/utils/terminal.ts +1 -0
- package/src/utils/theme.ts +11 -0
- package/src/hooks/useSlashCommandTypeahead.ts +0 -137
package/README.md
CHANGED
|
@@ -2,25 +2,86 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@shareai-lab/kode)
|
|
4
4
|
[](https://opensource.org/licenses/ISC)
|
|
5
|
+
[](https://agents.md)
|
|
5
6
|
|
|
6
7
|
[中文文档](README.zh-CN.md) | [Contributing](CONTRIBUTING.md) | [Documentation](docs/)
|
|
7
8
|
|
|
9
|
+
## 🤝 AGENTS.md Standard Support
|
|
10
|
+
|
|
11
|
+
**Kode proudly supports the [AGENTS.md standard protocol](https://agents.md) initiated by OpenAI** - a simple, open format for guiding programming agents that's used by 20k+ open source projects.
|
|
12
|
+
|
|
13
|
+
### Full Compatibility with Multiple Standards
|
|
14
|
+
|
|
15
|
+
- ✅ **AGENTS.md** - Native support for the OpenAI-initiated standard format
|
|
16
|
+
- ✅ **CLAUDE.md** - Full backward compatibility with Claude Code configurations
|
|
17
|
+
- ✅ **Subagent System** - Advanced agent delegation and task orchestration
|
|
18
|
+
- ✅ **Cross-platform** - Works with 20+ AI models and providers
|
|
19
|
+
|
|
20
|
+
Use `# Your documentation request` to generate and maintain your AGENTS.md file automatically, while maintaining full compatibility with existing Claude Code workflows.
|
|
21
|
+
|
|
22
|
+
## Overview
|
|
23
|
+
|
|
8
24
|
Kode is a powerful AI assistant that lives in your terminal. It can understand your codebase, edit files, run commands, and handle entire workflows for you.
|
|
9
25
|
|
|
26
|
+
> **⚠️ Security Notice**: Kode runs in YOLO mode by default (equivalent to Claude's `--dangerously-skip-permissions` flag), bypassing all permission checks for maximum productivity. YOLO mode is recommended only for trusted, secure environments when working on non-critical projects. If you're working with important files or using models of questionable capability, we strongly recommend using `kode --safe` to enable permission checks and manual approval for all operations.
|
|
27
|
+
>
|
|
28
|
+
> **📊 Model Performance**: For optimal performance, we recommend using newer, more capable models designed for autonomous task completion. Avoid older Q&A-focused models like GPT-4o or Gemini 2.5 Pro, which are optimized for answering questions rather than sustained independent task execution. Choose models specifically trained for agentic workflows and extended reasoning capabilities.
|
|
29
|
+
|
|
10
30
|
## Features
|
|
11
31
|
|
|
32
|
+
### Core Capabilities
|
|
12
33
|
- 🤖 **AI-Powered Assistance** - Uses advanced AI models to understand and respond to your requests
|
|
13
34
|
- 🔄 **Multi-Model Collaboration** - Flexibly switch and combine multiple AI models to leverage their unique strengths
|
|
35
|
+
- 🦜 **Expert Model Consultation** - Use `@ask-model-name` to consult specific AI models for specialized analysis
|
|
36
|
+
- 👤 **Intelligent Agent System** - Use `@run-agent-name` to delegate tasks to specialized subagents
|
|
14
37
|
- 📝 **Code Editing** - Directly edit files with intelligent suggestions and improvements
|
|
15
38
|
- 🔍 **Codebase Understanding** - Analyzes your project structure and code relationships
|
|
16
39
|
- 🚀 **Command Execution** - Run shell commands and see results in real-time
|
|
17
40
|
- 🛠️ **Workflow Automation** - Handle complex development tasks with simple prompts
|
|
41
|
+
|
|
42
|
+
### 🎯 Advanced Intelligent Completion System
|
|
43
|
+
Our state-of-the-art completion system provides unparalleled coding assistance:
|
|
44
|
+
|
|
45
|
+
#### Smart Fuzzy Matching
|
|
46
|
+
- **Hyphen-Aware Matching** - Type `dao` to match `run-agent-dao-qi-harmony-designer`
|
|
47
|
+
- **Abbreviation Support** - `dq` matches `dao-qi`, `nde` matches `node`
|
|
48
|
+
- **Numeric Suffix Handling** - `py3` intelligently matches `python3`
|
|
49
|
+
- **Multi-Algorithm Fusion** - Combines 7+ matching algorithms for best results
|
|
50
|
+
|
|
51
|
+
#### Intelligent Context Detection
|
|
52
|
+
- **No @ Required** - Type `gp5` directly to match `@ask-gpt-5`
|
|
53
|
+
- **Auto-Prefix Addition** - Tab/Enter automatically adds `@` for agents and models
|
|
54
|
+
- **Mixed Completion** - Seamlessly switch between commands, files, agents, and models
|
|
55
|
+
- **Smart Prioritization** - Results ranked by relevance and usage frequency
|
|
56
|
+
|
|
57
|
+
#### Unix Command Optimization
|
|
58
|
+
- **500+ Common Commands** - Curated database of frequently used Unix/Linux commands
|
|
59
|
+
- **System Intersection** - Only shows commands that actually exist on your system
|
|
60
|
+
- **Priority Scoring** - Common commands appear first (git, npm, docker, etc.)
|
|
61
|
+
- **Real-time Loading** - Dynamic command discovery from system PATH
|
|
62
|
+
|
|
63
|
+
### User Experience
|
|
18
64
|
- 🎨 **Interactive UI** - Beautiful terminal interface with syntax highlighting
|
|
19
65
|
- 🔌 **Tool System** - Extensible architecture with specialized tools for different tasks
|
|
20
66
|
- 💾 **Context Management** - Smart context handling to maintain conversation continuity
|
|
67
|
+
- 📋 **AGENTS.md Integration** - Use `# documentation requests` to auto-generate and maintain project documentation
|
|
21
68
|
|
|
22
69
|
## Installation
|
|
23
70
|
|
|
71
|
+
### Recommended: Using Bun (Fastest)
|
|
72
|
+
|
|
73
|
+
First install Bun if you haven't already:
|
|
74
|
+
```bash
|
|
75
|
+
curl -fsSL https://bun.sh/install | bash
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Then install Kode:
|
|
79
|
+
```bash
|
|
80
|
+
bun add -g @shareai-lab/kode
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Alternative: Using npm
|
|
84
|
+
|
|
24
85
|
```bash
|
|
25
86
|
npm install -g @shareai-lab/kode
|
|
26
87
|
```
|
|
@@ -50,6 +111,98 @@ kode -p "explain this function" main.js
|
|
|
50
111
|
kwa -p "explain this function" main.js
|
|
51
112
|
```
|
|
52
113
|
|
|
114
|
+
### Using the @ Mention System
|
|
115
|
+
|
|
116
|
+
Kode supports a powerful @ mention system for intelligent completions:
|
|
117
|
+
|
|
118
|
+
#### 🦜 Expert Model Consultation
|
|
119
|
+
```bash
|
|
120
|
+
# Consult specific AI models for expert opinions
|
|
121
|
+
@ask-claude-sonnet-4 How should I optimize this React component for performance?
|
|
122
|
+
@ask-gpt-5 What are the security implications of this authentication method?
|
|
123
|
+
@ask-o1-preview Analyze the complexity of this algorithm
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
#### 👤 Specialized Agent Delegation
|
|
127
|
+
```bash
|
|
128
|
+
# Delegate tasks to specialized subagents
|
|
129
|
+
@run-agent-simplicity-auditor Review this code for over-engineering
|
|
130
|
+
@run-agent-architect Design a microservices architecture for this system
|
|
131
|
+
@run-agent-test-writer Create comprehensive tests for these modules
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
#### 📁 Smart File References
|
|
135
|
+
```bash
|
|
136
|
+
# Reference files and directories with auto-completion
|
|
137
|
+
@src/components/Button.tsx
|
|
138
|
+
@docs/api-reference.md
|
|
139
|
+
@.env.example
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
The @ mention system provides intelligent completions as you type, showing available models, agents, and files.
|
|
143
|
+
|
|
144
|
+
### AGENTS.md Documentation Mode
|
|
145
|
+
|
|
146
|
+
Use the `#` prefix to generate and maintain your AGENTS.md documentation:
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
# Generate setup instructions
|
|
150
|
+
# How do I set up the development environment?
|
|
151
|
+
|
|
152
|
+
# Create testing documentation
|
|
153
|
+
# What are the testing procedures for this project?
|
|
154
|
+
|
|
155
|
+
# Document deployment process
|
|
156
|
+
# Explain the deployment pipeline and requirements
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
This mode automatically formats responses as structured documentation and appends them to your AGENTS.md file.
|
|
160
|
+
|
|
161
|
+
### Docker Usage
|
|
162
|
+
|
|
163
|
+
#### Alternative: Build from local source
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
# Clone the repository
|
|
167
|
+
git clone https://github.com/shareAI-lab/Kode.git
|
|
168
|
+
cd Kode
|
|
169
|
+
|
|
170
|
+
# Build the image locally
|
|
171
|
+
docker build --no-cache -t kode .
|
|
172
|
+
|
|
173
|
+
# Run in your project directory
|
|
174
|
+
cd your-project
|
|
175
|
+
docker run -it --rm \
|
|
176
|
+
-v $(pwd):/workspace \
|
|
177
|
+
-v ~/.kode:/root/.kode \
|
|
178
|
+
-v ~/.kode.json:/root/.kode.json \
|
|
179
|
+
-w /workspace \
|
|
180
|
+
kode
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
#### Docker Configuration Details
|
|
184
|
+
|
|
185
|
+
The Docker setup includes:
|
|
186
|
+
|
|
187
|
+
- **Volume Mounts**:
|
|
188
|
+
- `$(pwd):/workspace` - Mounts your current project directory
|
|
189
|
+
- `~/.kode:/root/.kode` - Preserves your kode configuration directory between runs
|
|
190
|
+
- `~/.kode.json:/root/.kode.json` - Preserves your kode global configuration file between runs
|
|
191
|
+
|
|
192
|
+
- **Working Directory**: Set to `/workspace` inside the container
|
|
193
|
+
|
|
194
|
+
- **Interactive Mode**: Uses `-it` flags for interactive terminal access
|
|
195
|
+
|
|
196
|
+
- **Cleanup**: `--rm` flag removes the container after exit
|
|
197
|
+
|
|
198
|
+
**Note**: Kode uses both `~/.kode` directory for additional data (like memory files) and `~/.kode.json` file for global configuration.
|
|
199
|
+
|
|
200
|
+
The first time you run the Docker command, it will build the image. Subsequent runs will use the cached image for faster startup.
|
|
201
|
+
|
|
202
|
+
You can use the onboarding to set up the model, or `/model`.
|
|
203
|
+
If you don't see the models you want on the list, you can manually set them in `/config`
|
|
204
|
+
As long as you have an openai-like endpoint, it should work.
|
|
205
|
+
|
|
53
206
|
### Commands
|
|
54
207
|
|
|
55
208
|
- `/help` - Show available commands
|
|
@@ -239,8 +392,14 @@ We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) f
|
|
|
239
392
|
|
|
240
393
|
ISC License - see [LICENSE](LICENSE) for details.
|
|
241
394
|
|
|
395
|
+
## Thanks
|
|
396
|
+
|
|
397
|
+
- Some code from @dnakov's anonkode
|
|
398
|
+
- Some UI learned from gemini-cli
|
|
399
|
+
- Some system design learned from claude code
|
|
400
|
+
|
|
242
401
|
## Support
|
|
243
402
|
|
|
244
403
|
- 📚 [Documentation](docs/)
|
|
245
404
|
- 🐛 [Report Issues](https://github.com/shareAI-lab/kode/issues)
|
|
246
|
-
- 💬 [Discussions](https://github.com/shareAI-lab/kode/discussions)
|
|
405
|
+
- 💬 [Discussions](https://github.com/shareAI-lab/kode/discussions)
|
package/README.zh-CN.md
CHANGED
|
@@ -7,6 +7,10 @@
|
|
|
7
7
|
|
|
8
8
|
Kode 是一个强大的 AI 助手,运行在你的终端中。它能理解你的代码库、编辑文件、运行命令,并为你处理整个开发工作流。
|
|
9
9
|
|
|
10
|
+
> **⚠️ 安全提示**:Kode 默认以 YOLO 模式运行(等同于 Claude 的 `--dangerously-skip-permissions` 标志),跳过所有权限检查以获得最大生产力。YOLO 模式仅建议在安全可信的环境中处理非重要项目时使用。如果您正在处理重要文件或使用能力存疑的模型,我们强烈建议使用 `kode --safe` 启用权限检查和手动审批所有操作。
|
|
11
|
+
>
|
|
12
|
+
> **📊 模型性能建议**:为获得最佳体验,建议使用专为自主任务完成设计的新一代强大模型。避免使用 GPT-4o、Gemini 2.5 Pro 等较老的问答型模型,它们主要针对回答问题进行优化,而非持续的独立任务执行。请选择专门训练用于智能体工作流和扩展推理能力的模型。
|
|
13
|
+
|
|
10
14
|
## 功能特性
|
|
11
15
|
|
|
12
16
|
- 🤖 **AI 驱动的助手** - 使用先进的 AI 模型理解并响应你的请求
|
|
@@ -21,6 +25,20 @@ Kode 是一个强大的 AI 助手,运行在你的终端中。它能理解你
|
|
|
21
25
|
|
|
22
26
|
## 安装
|
|
23
27
|
|
|
28
|
+
### 推荐方式:使用 Bun(最快)
|
|
29
|
+
|
|
30
|
+
首先安装 Bun(如果尚未安装):
|
|
31
|
+
```bash
|
|
32
|
+
curl -fsSL https://bun.sh/install | bash
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
然后安装 Kode:
|
|
36
|
+
```bash
|
|
37
|
+
bun add -g @shareai-lab/kode
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### 备选方式:使用 npm
|
|
41
|
+
|
|
24
42
|
```bash
|
|
25
43
|
npm install -g @shareai-lab/kode
|
|
26
44
|
```
|
|
@@ -50,6 +68,52 @@ kode -p "解释这个函数" main.js
|
|
|
50
68
|
kwa -p "解释这个函数" main.js
|
|
51
69
|
```
|
|
52
70
|
|
|
71
|
+
### Docker 使用说明
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
# 克隆仓库
|
|
75
|
+
git clone https://github.com/shareAI-lab/Kode.git
|
|
76
|
+
cd Kode
|
|
77
|
+
|
|
78
|
+
# 本地构建镜像
|
|
79
|
+
docker build --no-cache -t kode .
|
|
80
|
+
|
|
81
|
+
# 在你的项目目录中运行
|
|
82
|
+
cd your-project
|
|
83
|
+
docker run -it --rm \
|
|
84
|
+
-v $(pwd):/workspace \
|
|
85
|
+
-v ~/.kode:/root/.kode \
|
|
86
|
+
-v ~/.kode.json:/root/.kode.json \
|
|
87
|
+
-w /workspace \
|
|
88
|
+
kode
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
#### Docker 配置详情
|
|
92
|
+
|
|
93
|
+
该 Docker 配置包含以下内容:
|
|
94
|
+
|
|
95
|
+
* **卷挂载(Volume Mounts)**:
|
|
96
|
+
|
|
97
|
+
* `$(pwd):/workspace` - 挂载当前项目目录
|
|
98
|
+
* `~/.kode:/root/.kode` - 在运行间保留 kode 配置目录
|
|
99
|
+
* `~/.kode.json:/root/.kode.json` - 在运行间保留 kode 全局配置文件
|
|
100
|
+
|
|
101
|
+
* **工作目录**:容器内工作目录设置为 `/workspace`
|
|
102
|
+
|
|
103
|
+
* **交互模式**:使用 `-it` 标志以交互式终端方式运行
|
|
104
|
+
|
|
105
|
+
* **清理**:使用 `--rm` 在退出后自动删除容器
|
|
106
|
+
|
|
107
|
+
**注意**:
|
|
108
|
+
Kode 同时使用 `~/.kode` 目录(存放额外数据,如内存文件)和 `~/.kode.json` 文件(全局配置)。
|
|
109
|
+
|
|
110
|
+
第一次运行 Docker 命令时会构建镜像,之后的运行会使用缓存镜像以加快启动速度。
|
|
111
|
+
|
|
112
|
+
你可以通过引导流程(onboarding)来设置模型,或使用 `/model` 命令。
|
|
113
|
+
如果在列表中没有你想要的模型,可以在 `/config` 中手动设置。
|
|
114
|
+
只要你有一个 OpenAI 风格的 API 端点,就可以正常使用。
|
|
115
|
+
|
|
116
|
+
|
|
53
117
|
### 常用命令
|
|
54
118
|
|
|
55
119
|
- `/help` - 显示可用命令
|
|
@@ -243,4 +307,4 @@ ISC 许可证 - 详见 [LICENSE](LICENSE)。
|
|
|
243
307
|
|
|
244
308
|
- 📚 [文档](docs/)
|
|
245
309
|
- 🐛 [报告问题](https://github.com/shareAI-lab/kode/issues)
|
|
246
|
-
- 💬 [讨论](https://github.com/shareAI-lab/kode/discussions)
|
|
310
|
+
- 💬 [讨论](https://github.com/shareAI-lab/kode/discussions)
|
package/cli.js
CHANGED
|
@@ -32,24 +32,19 @@ try {
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
function runWithNode() {
|
|
35
|
-
// Use
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
'--no-warnings',
|
|
39
|
-
cliPath,
|
|
40
|
-
...args
|
|
41
|
-
], {
|
|
35
|
+
// Use local tsx installation
|
|
36
|
+
const tsxPath = path.join(__dirname, 'node_modules', '.bin', 'tsx');
|
|
37
|
+
const child = spawn(tsxPath, [cliPath, ...args], {
|
|
42
38
|
stdio: 'inherit',
|
|
43
39
|
env: {
|
|
44
40
|
...process.env,
|
|
45
|
-
NODE_OPTIONS: '--loader tsx --no-warnings',
|
|
46
41
|
YOGA_WASM_PATH: path.join(__dirname, 'yoga.wasm')
|
|
47
42
|
}
|
|
48
43
|
});
|
|
49
44
|
|
|
50
45
|
child.on('error', (err) => {
|
|
51
|
-
if (err.code === '
|
|
52
|
-
console.error('\nError: tsx is required but not
|
|
46
|
+
if (err.code === 'ENOENT') {
|
|
47
|
+
console.error('\nError: tsx is required but not found.');
|
|
53
48
|
console.error('Please run: npm install');
|
|
54
49
|
process.exit(1);
|
|
55
50
|
} else {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shareai-lab/kode",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.75",
|
|
4
4
|
"bin": {
|
|
5
5
|
"kode": "cli.js",
|
|
6
6
|
"kwa": "cli.js",
|
|
@@ -66,9 +66,12 @@
|
|
|
66
66
|
"env-paths": "^3.0.0",
|
|
67
67
|
"figures": "^6.1.0",
|
|
68
68
|
"glob": "^11.0.3",
|
|
69
|
+
"gray-matter": "^4.0.3",
|
|
69
70
|
"highlight.js": "^11.11.1",
|
|
70
71
|
"ink": "^5.2.1",
|
|
71
72
|
"ink-link": "^4.1.0",
|
|
73
|
+
"ink-select-input": "^6.2.0",
|
|
74
|
+
"ink-text-input": "^6.0.0",
|
|
72
75
|
"lodash-es": "^4.17.21",
|
|
73
76
|
"lru-cache": "^11.1.0",
|
|
74
77
|
"marked": "^15.0.12",
|
|
@@ -86,6 +89,7 @@
|
|
|
86
89
|
},
|
|
87
90
|
"devDependencies": {
|
|
88
91
|
"@types/bun": "latest",
|
|
92
|
+
"@types/jest": "^30.0.0",
|
|
89
93
|
"@types/node": "^24.1.0",
|
|
90
94
|
"bun-types": "latest",
|
|
91
95
|
"prettier": "^3.6.2",
|
|
@@ -109,4 +113,4 @@
|
|
|
109
113
|
"terminal",
|
|
110
114
|
"command-line"
|
|
111
115
|
]
|
|
112
|
-
}
|
|
116
|
+
}
|
|
@@ -87,6 +87,7 @@ export default function ProjectOnboarding({
|
|
|
87
87
|
{showOnboarding && (
|
|
88
88
|
<>
|
|
89
89
|
<Text color={theme.secondaryText}>Tips for getting started:</Text>
|
|
90
|
+
{/* @ts-expect-error - OrderedList children prop issue */}
|
|
90
91
|
<OrderedList>
|
|
91
92
|
{/* Collect all the items that should be displayed */}
|
|
92
93
|
{(() => {
|
|
@@ -94,51 +95,66 @@ export default function ProjectOnboarding({
|
|
|
94
95
|
|
|
95
96
|
if (isWorkspaceDirEmpty) {
|
|
96
97
|
items.push(
|
|
97
|
-
<
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
98
|
+
<React.Fragment key="workspace">
|
|
99
|
+
{/* @ts-expect-error - OrderedList.Item children prop issue */}
|
|
100
|
+
<OrderedList.Item>
|
|
101
|
+
<Text color={theme.secondaryText}>
|
|
102
|
+
Ask {PRODUCT_NAME} to create a new app or clone a
|
|
103
|
+
repository.
|
|
104
|
+
</Text>
|
|
105
|
+
</OrderedList.Item>
|
|
106
|
+
</React.Fragment>,
|
|
103
107
|
)
|
|
104
108
|
}
|
|
105
109
|
if (needsClaudeMd) {
|
|
106
110
|
items.push(
|
|
107
|
-
<
|
|
108
|
-
|
|
109
|
-
|
|
111
|
+
<React.Fragment key="claudemd">
|
|
112
|
+
{/* @ts-expect-error - OrderedList.Item children prop issue */}
|
|
113
|
+
<OrderedList.Item>
|
|
114
|
+
<Text color={theme.secondaryText}>
|
|
115
|
+
Run <Text color={theme.text}>/init</Text> to create
|
|
110
116
|
a
|
|
111
117
|
{PROJECT_FILE} file with instructions for {PRODUCT_NAME}.
|
|
112
118
|
</Text>
|
|
113
|
-
|
|
119
|
+
</OrderedList.Item>
|
|
120
|
+
</React.Fragment>,
|
|
114
121
|
)
|
|
115
122
|
}
|
|
116
123
|
|
|
117
124
|
if (showTerminalTip) {
|
|
118
125
|
items.push(
|
|
119
|
-
<
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
<Text
|
|
123
|
-
|
|
124
|
-
|
|
126
|
+
<React.Fragment key="terminal">
|
|
127
|
+
{/* @ts-expect-error - OrderedList.Item children prop issue */}
|
|
128
|
+
<OrderedList.Item>
|
|
129
|
+
<Text color={theme.secondaryText}>
|
|
130
|
+
Run <Text color={theme.text}>/terminal-setup</Text>
|
|
131
|
+
<Text bold={false}> to set up terminal integration</Text>
|
|
132
|
+
</Text>
|
|
133
|
+
</OrderedList.Item>
|
|
134
|
+
</React.Fragment>,
|
|
125
135
|
)
|
|
126
136
|
}
|
|
127
137
|
|
|
128
138
|
items.push(
|
|
129
|
-
<
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
139
|
+
<React.Fragment key="questions">
|
|
140
|
+
{/* @ts-expect-error - OrderedList.Item children prop issue */}
|
|
141
|
+
<OrderedList.Item>
|
|
142
|
+
<Text color={theme.secondaryText}>
|
|
143
|
+
Ask {PRODUCT_NAME} questions about your codebase.
|
|
144
|
+
</Text>
|
|
145
|
+
</OrderedList.Item>
|
|
146
|
+
</React.Fragment>,
|
|
134
147
|
)
|
|
135
148
|
|
|
136
149
|
items.push(
|
|
137
|
-
<
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
150
|
+
<React.Fragment key="changes">
|
|
151
|
+
{/* @ts-expect-error - OrderedList.Item children prop issue */}
|
|
152
|
+
<OrderedList.Item>
|
|
153
|
+
<Text color={theme.secondaryText}>
|
|
154
|
+
Ask {PRODUCT_NAME} to implement changes to your codebase.
|
|
155
|
+
</Text>
|
|
156
|
+
</OrderedList.Item>
|
|
157
|
+
</React.Fragment>,
|
|
142
158
|
)
|
|
143
159
|
|
|
144
160
|
return items
|
|
@@ -159,9 +175,11 @@ export default function ProjectOnboarding({
|
|
|
159
175
|
</Box>
|
|
160
176
|
<Box flexDirection="column" marginLeft={1}>
|
|
161
177
|
{releaseNotesToShow.map((note, noteIndex) => (
|
|
162
|
-
<
|
|
163
|
-
|
|
164
|
-
|
|
178
|
+
<React.Fragment key={noteIndex}>
|
|
179
|
+
<Text color={getTheme().secondaryText}>
|
|
180
|
+
• {note}
|
|
181
|
+
</Text>
|
|
182
|
+
</React.Fragment>
|
|
165
183
|
))}
|
|
166
184
|
</Box>
|
|
167
185
|
</Box>
|
package/src/Tool.ts
CHANGED
|
@@ -1,11 +1,42 @@
|
|
|
1
1
|
import { z } from 'zod'
|
|
2
|
-
import { UUID } from 'crypto'
|
|
3
2
|
import * as React from 'react'
|
|
4
3
|
|
|
4
|
+
// DEPRECATED: Use domain/tool/Tool.interface.ts for new implementations
|
|
5
|
+
// This interface will be maintained for compatibility during transition
|
|
6
|
+
|
|
7
|
+
export type SetToolJSXFn = (jsx: {
|
|
8
|
+
jsx: React.ReactNode | null
|
|
9
|
+
shouldHidePromptInput: boolean
|
|
10
|
+
} | null) => void
|
|
11
|
+
|
|
5
12
|
export interface ToolUseContext {
|
|
6
|
-
messageId:
|
|
13
|
+
messageId: string | undefined
|
|
7
14
|
agentId?: string
|
|
8
15
|
safeMode?: boolean
|
|
16
|
+
abortController: AbortController
|
|
17
|
+
readFileTimestamps: { [filePath: string]: number }
|
|
18
|
+
options?: {
|
|
19
|
+
commands?: any[]
|
|
20
|
+
tools?: any[]
|
|
21
|
+
verbose?: boolean
|
|
22
|
+
slowAndCapableModel?: string
|
|
23
|
+
safeMode?: boolean
|
|
24
|
+
forkNumber?: number
|
|
25
|
+
messageLogName?: string
|
|
26
|
+
maxThinkingTokens?: any
|
|
27
|
+
isKodingRequest?: boolean
|
|
28
|
+
kodingContext?: string
|
|
29
|
+
isCustomCommand?: boolean
|
|
30
|
+
}
|
|
31
|
+
// GPT-5 Responses API state management
|
|
32
|
+
responseState?: {
|
|
33
|
+
previousResponseId?: string
|
|
34
|
+
conversationId?: string
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface ExtendedToolUseContext extends ToolUseContext {
|
|
39
|
+
setToolJSX: SetToolJSXFn
|
|
9
40
|
}
|
|
10
41
|
|
|
11
42
|
export interface ValidationResult {
|
|
@@ -49,5 +80,3 @@ export interface Tool<
|
|
|
49
80
|
unknown
|
|
50
81
|
>
|
|
51
82
|
}
|
|
52
|
-
|
|
53
|
-
export type { ToolUseContext, ValidationResult }
|