@serjm/deepseek-code 0.3.1

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 (216) hide show
  1. package/CONTRIBUTING.md +73 -0
  2. package/README.md +194 -0
  3. package/README.ru.md +194 -0
  4. package/dist/api/index.d.ts +77 -0
  5. package/dist/api/index.d.ts.map +1 -0
  6. package/dist/api/index.js +263 -0
  7. package/dist/api/index.js.map +1 -0
  8. package/dist/cli/headless.d.ts +22 -0
  9. package/dist/cli/headless.d.ts.map +1 -0
  10. package/dist/cli/headless.js +122 -0
  11. package/dist/cli/headless.js.map +1 -0
  12. package/dist/cli/index.d.ts +3 -0
  13. package/dist/cli/index.d.ts.map +1 -0
  14. package/dist/cli/index.js +90 -0
  15. package/dist/cli/index.js.map +1 -0
  16. package/dist/cli/interactive.d.ts +18 -0
  17. package/dist/cli/interactive.d.ts.map +1 -0
  18. package/dist/cli/interactive.js +75 -0
  19. package/dist/cli/interactive.js.map +1 -0
  20. package/dist/commands/index.d.ts +30 -0
  21. package/dist/commands/index.d.ts.map +1 -0
  22. package/dist/commands/index.js +964 -0
  23. package/dist/commands/index.js.map +1 -0
  24. package/dist/config/defaults.d.ts +37 -0
  25. package/dist/config/defaults.d.ts.map +1 -0
  26. package/dist/config/defaults.js +39 -0
  27. package/dist/config/defaults.js.map +1 -0
  28. package/dist/config/loader.d.ts +4 -0
  29. package/dist/config/loader.d.ts.map +1 -0
  30. package/dist/config/loader.js +76 -0
  31. package/dist/config/loader.js.map +1 -0
  32. package/dist/core/agent-loop.d.ts +111 -0
  33. package/dist/core/agent-loop.d.ts.map +1 -0
  34. package/dist/core/agent-loop.js +485 -0
  35. package/dist/core/agent-loop.js.map +1 -0
  36. package/dist/core/checkpoint.d.ts +10 -0
  37. package/dist/core/checkpoint.d.ts.map +1 -0
  38. package/dist/core/checkpoint.js +83 -0
  39. package/dist/core/checkpoint.js.map +1 -0
  40. package/dist/core/extensions.d.ts +55 -0
  41. package/dist/core/extensions.d.ts.map +1 -0
  42. package/dist/core/extensions.js +113 -0
  43. package/dist/core/extensions.js.map +1 -0
  44. package/dist/core/git.d.ts +68 -0
  45. package/dist/core/git.d.ts.map +1 -0
  46. package/dist/core/git.js +148 -0
  47. package/dist/core/git.js.map +1 -0
  48. package/dist/core/hooks.d.ts +37 -0
  49. package/dist/core/hooks.d.ts.map +1 -0
  50. package/dist/core/hooks.js +77 -0
  51. package/dist/core/hooks.js.map +1 -0
  52. package/dist/core/i18n.d.ts +90 -0
  53. package/dist/core/i18n.d.ts.map +1 -0
  54. package/dist/core/i18n.js +253 -0
  55. package/dist/core/i18n.js.map +1 -0
  56. package/dist/core/lsp.d.ts +74 -0
  57. package/dist/core/lsp.d.ts.map +1 -0
  58. package/dist/core/lsp.js +239 -0
  59. package/dist/core/lsp.js.map +1 -0
  60. package/dist/core/mcp.d.ts +49 -0
  61. package/dist/core/mcp.d.ts.map +1 -0
  62. package/dist/core/mcp.js +195 -0
  63. package/dist/core/mcp.js.map +1 -0
  64. package/dist/core/memory.d.ts +38 -0
  65. package/dist/core/memory.d.ts.map +1 -0
  66. package/dist/core/memory.js +231 -0
  67. package/dist/core/memory.js.map +1 -0
  68. package/dist/core/metrics.d.ts +36 -0
  69. package/dist/core/metrics.d.ts.map +1 -0
  70. package/dist/core/metrics.js +111 -0
  71. package/dist/core/metrics.js.map +1 -0
  72. package/dist/core/review.d.ts +27 -0
  73. package/dist/core/review.d.ts.map +1 -0
  74. package/dist/core/review.js +201 -0
  75. package/dist/core/review.js.map +1 -0
  76. package/dist/core/sandbox.d.ts +52 -0
  77. package/dist/core/sandbox.d.ts.map +1 -0
  78. package/dist/core/sandbox.js +140 -0
  79. package/dist/core/sandbox.js.map +1 -0
  80. package/dist/core/scheduler.d.ts +56 -0
  81. package/dist/core/scheduler.d.ts.map +1 -0
  82. package/dist/core/scheduler.js +167 -0
  83. package/dist/core/scheduler.js.map +1 -0
  84. package/dist/core/session.d.ts +49 -0
  85. package/dist/core/session.d.ts.map +1 -0
  86. package/dist/core/session.js +127 -0
  87. package/dist/core/session.js.map +1 -0
  88. package/dist/core/skills.d.ts +36 -0
  89. package/dist/core/skills.d.ts.map +1 -0
  90. package/dist/core/skills.js +90 -0
  91. package/dist/core/skills.js.map +1 -0
  92. package/dist/core/subagent.d.ts +45 -0
  93. package/dist/core/subagent.d.ts.map +1 -0
  94. package/dist/core/subagent.js +130 -0
  95. package/dist/core/subagent.js.map +1 -0
  96. package/dist/core/themes.d.ts +35 -0
  97. package/dist/core/themes.d.ts.map +1 -0
  98. package/dist/core/themes.js +188 -0
  99. package/dist/core/themes.js.map +1 -0
  100. package/dist/tools/bash.d.ts +3 -0
  101. package/dist/tools/bash.d.ts.map +1 -0
  102. package/dist/tools/bash.js +92 -0
  103. package/dist/tools/bash.js.map +1 -0
  104. package/dist/tools/chrome-manager.d.ts +35 -0
  105. package/dist/tools/chrome-manager.d.ts.map +1 -0
  106. package/dist/tools/chrome-manager.js +163 -0
  107. package/dist/tools/chrome-manager.js.map +1 -0
  108. package/dist/tools/chrome.d.ts +78 -0
  109. package/dist/tools/chrome.d.ts.map +1 -0
  110. package/dist/tools/chrome.js +1058 -0
  111. package/dist/tools/chrome.js.map +1 -0
  112. package/dist/tools/edit.d.ts +3 -0
  113. package/dist/tools/edit.d.ts.map +1 -0
  114. package/dist/tools/edit.js +81 -0
  115. package/dist/tools/edit.js.map +1 -0
  116. package/dist/tools/glob.d.ts +3 -0
  117. package/dist/tools/glob.d.ts.map +1 -0
  118. package/dist/tools/glob.js +41 -0
  119. package/dist/tools/glob.js.map +1 -0
  120. package/dist/tools/grep.d.ts +3 -0
  121. package/dist/tools/grep.d.ts.map +1 -0
  122. package/dist/tools/grep.js +74 -0
  123. package/dist/tools/grep.js.map +1 -0
  124. package/dist/tools/path-safety.d.ts +3 -0
  125. package/dist/tools/path-safety.d.ts.map +1 -0
  126. package/dist/tools/path-safety.js +19 -0
  127. package/dist/tools/path-safety.js.map +1 -0
  128. package/dist/tools/read.d.ts +3 -0
  129. package/dist/tools/read.d.ts.map +1 -0
  130. package/dist/tools/read.js +58 -0
  131. package/dist/tools/read.js.map +1 -0
  132. package/dist/tools/registry.d.ts +4 -0
  133. package/dist/tools/registry.d.ts.map +1 -0
  134. package/dist/tools/registry.js +43 -0
  135. package/dist/tools/registry.js.map +1 -0
  136. package/dist/tools/types.d.ts +47 -0
  137. package/dist/tools/types.d.ts.map +1 -0
  138. package/dist/tools/types.js +90 -0
  139. package/dist/tools/types.js.map +1 -0
  140. package/dist/tools/write.d.ts +3 -0
  141. package/dist/tools/write.d.ts.map +1 -0
  142. package/dist/tools/write.js +51 -0
  143. package/dist/tools/write.js.map +1 -0
  144. package/dist/ui/activity-cards.d.ts +50 -0
  145. package/dist/ui/activity-cards.d.ts.map +1 -0
  146. package/dist/ui/activity-cards.js +185 -0
  147. package/dist/ui/activity-cards.js.map +1 -0
  148. package/dist/ui/app.d.ts +9 -0
  149. package/dist/ui/app.d.ts.map +1 -0
  150. package/dist/ui/app.js +852 -0
  151. package/dist/ui/app.js.map +1 -0
  152. package/dist/ui/chat-view.d.ts +10 -0
  153. package/dist/ui/chat-view.d.ts.map +1 -0
  154. package/dist/ui/chat-view.js +94 -0
  155. package/dist/ui/chat-view.js.map +1 -0
  156. package/dist/ui/error-boundary.d.ts +13 -0
  157. package/dist/ui/error-boundary.d.ts.map +1 -0
  158. package/dist/ui/error-boundary.js +16 -0
  159. package/dist/ui/error-boundary.js.map +1 -0
  160. package/dist/ui/fade-in.d.ts +8 -0
  161. package/dist/ui/fade-in.d.ts.map +1 -0
  162. package/dist/ui/fade-in.js +14 -0
  163. package/dist/ui/fade-in.js.map +1 -0
  164. package/dist/ui/input-bar.d.ts +16 -0
  165. package/dist/ui/input-bar.d.ts.map +1 -0
  166. package/dist/ui/input-bar.js +269 -0
  167. package/dist/ui/input-bar.js.map +1 -0
  168. package/dist/ui/markdown-view.d.ts +9 -0
  169. package/dist/ui/markdown-view.d.ts.map +1 -0
  170. package/dist/ui/markdown-view.js +240 -0
  171. package/dist/ui/markdown-view.js.map +1 -0
  172. package/dist/ui/matrix-rain.d.ts +2 -0
  173. package/dist/ui/matrix-rain.d.ts.map +1 -0
  174. package/dist/ui/matrix-rain.js +134 -0
  175. package/dist/ui/matrix-rain.js.map +1 -0
  176. package/dist/ui/reasoning-view.d.ts +12 -0
  177. package/dist/ui/reasoning-view.d.ts.map +1 -0
  178. package/dist/ui/reasoning-view.js +34 -0
  179. package/dist/ui/reasoning-view.js.map +1 -0
  180. package/dist/ui/results-panel.d.ts +11 -0
  181. package/dist/ui/results-panel.d.ts.map +1 -0
  182. package/dist/ui/results-panel.js +17 -0
  183. package/dist/ui/results-panel.js.map +1 -0
  184. package/dist/ui/setup-wizard.d.ts +30 -0
  185. package/dist/ui/setup-wizard.d.ts.map +1 -0
  186. package/dist/ui/setup-wizard.js +166 -0
  187. package/dist/ui/setup-wizard.js.map +1 -0
  188. package/dist/ui/status-bar.d.ts +14 -0
  189. package/dist/ui/status-bar.d.ts.map +1 -0
  190. package/dist/ui/status-bar.js +63 -0
  191. package/dist/ui/status-bar.js.map +1 -0
  192. package/dist/ui/tool-activity-card.d.ts +9 -0
  193. package/dist/ui/tool-activity-card.d.ts.map +1 -0
  194. package/dist/ui/tool-activity-card.js +172 -0
  195. package/dist/ui/tool-activity-card.js.map +1 -0
  196. package/dist/ui/tool-call-view.d.ts +9 -0
  197. package/dist/ui/tool-call-view.d.ts.map +1 -0
  198. package/dist/ui/tool-call-view.js +149 -0
  199. package/dist/ui/tool-call-view.js.map +1 -0
  200. package/dist/utils/clipboard.d.ts +6 -0
  201. package/dist/utils/clipboard.d.ts.map +1 -0
  202. package/dist/utils/clipboard.js +56 -0
  203. package/dist/utils/clipboard.js.map +1 -0
  204. package/dist/utils/ignore.d.ts +6 -0
  205. package/dist/utils/ignore.d.ts.map +1 -0
  206. package/dist/utils/ignore.js +40 -0
  207. package/dist/utils/ignore.js.map +1 -0
  208. package/dist/utils/logger.d.ts +4 -0
  209. package/dist/utils/logger.d.ts.map +1 -0
  210. package/dist/utils/logger.js +13 -0
  211. package/dist/utils/logger.js.map +1 -0
  212. package/dist/utils/string-width.d.ts +6 -0
  213. package/dist/utils/string-width.d.ts.map +1 -0
  214. package/dist/utils/string-width.js +37 -0
  215. package/dist/utils/string-width.js.map +1 -0
  216. package/package.json +68 -0
@@ -0,0 +1,73 @@
1
+ # Contributing to DeepSeek Code
2
+
3
+ Thank you for your interest in contributing! 🎉
4
+
5
+ ## Development Setup
6
+
7
+ ```bash
8
+ # Clone the repository
9
+ git clone https://github.com/deepseek-ai/deepseek-code.git
10
+ cd deepseek-code
11
+
12
+ # Install dependencies
13
+ npm install
14
+
15
+ # Build TypeScript
16
+ npm run build
17
+
18
+ # Run in development mode
19
+ node dist/cli.js
20
+ ```
21
+
22
+ ## Project Structure
23
+
24
+ ```
25
+ src/
26
+ ├── api/ # DeepSeek API client
27
+ ├── cli/ # CLI entry points (interactive, headless)
28
+ ├── config/ # Configuration loading and defaults
29
+ ├── core/ # Core logic (AgentLoop, memory, MCP, etc.)
30
+ ├── tools/ # Tool definitions (read, write, edit, bash, etc.)
31
+ ├── ui/ # TUI components (Ink/React)
32
+ └── utils/ # Utilities (logger, ignore)
33
+ ```
34
+
35
+ ## Coding Standards
36
+
37
+ - **TypeScript** with strict mode
38
+ - **ES modules** (`import`/`export`)
39
+ - Follow existing code style (naming, formatting, patterns)
40
+ - No `any` types — use proper generics or `unknown`
41
+ - Async/await for asynchronous code
42
+
43
+ ## Before Submitting a PR
44
+
45
+ 1. **Build**: `npm run build` — must compile without errors
46
+ 2. **Lint**: `npm run lint` — must pass
47
+ 3. **Typecheck**: `npm run typecheck` — must pass
48
+ 4. **Tests**: Add tests for new functionality
49
+ 5. **Commit**: Use clear, descriptive commit messages
50
+
51
+ ## Commit Messages
52
+
53
+ Follow conventional commits:
54
+
55
+ ```
56
+ feat: add context-aware system prompt
57
+ fix: approval dialog now shows confirmation prompt
58
+ refactor: rename tools to snake_case
59
+ docs: add CONTRIBUTING.md
60
+ test: add unit tests for tool types
61
+ ```
62
+
63
+ ## Code Review
64
+
65
+ All PRs require review. Focus on:
66
+ - Correctness
67
+ - Security (no dangerous defaults)
68
+ - Performance (no unnecessary I/O or polling)
69
+ - Consistency with existing patterns
70
+
71
+ ## Questions?
72
+
73
+ Open an issue or discussion on GitHub.
package/README.md ADDED
@@ -0,0 +1,194 @@
1
+ <div align="center">
2
+ <br/>
3
+ <h1>DeepSeek Code</h1>
4
+ <p><strong>Open-source AI coding agent for developers who want a fast terminal workflow without Copilot pricing.</strong></p>
5
+
6
+ <p>
7
+ <a href="https://github.com/SerjMihashin/deepseek-code/blob/master/LICENSE">
8
+ <img src="https://img.shields.io/badge/license-Apache--2.0-blue" alt="License"/>
9
+ </a>
10
+ <img src="https://img.shields.io/badge/TypeScript-5.7-blue" alt="TypeScript"/>
11
+ <img src="https://img.shields.io/badge/DeepSeek-API-orange" alt="DeepSeek"/>
12
+ <img src="https://img.shields.io/badge/status-alpha-yellow" alt="Status"/>
13
+ </p>
14
+
15
+ <p>
16
+ <b>English</b> · <a href="README.ru.md">Русский</a>
17
+ </p>
18
+ <br/>
19
+ </div>
20
+
21
+ ---
22
+
23
+ ## The Short Version
24
+
25
+ DeepSeek Code is a terminal-first AI coding agent. It reads your project, edits files, runs commands, reviews code, remembers context, and can automate Chrome when a task needs a browser.
26
+
27
+ It is built for developers who want a practical local workflow:
28
+
29
+ - **Lower cost**: use DeepSeek API directly instead of a fixed monthly coding subscription.
30
+ - **Real project work**: inspect files, patch code, run tests, and continue from previous sessions.
31
+ - **Terminal-native**: no IDE lock-in, no heavy desktop app, no cloud workspace requirement.
32
+ - **User-controlled automation**: choose read-only planning, manual approvals, auto-edit, or full turbo mode.
33
+
34
+ ---
35
+
36
+ ## Install
37
+
38
+ ```bash
39
+ npm install -g @serjm/deepseek-code
40
+ ```
41
+
42
+ Run it:
43
+
44
+ ```bash
45
+ deepseek-code
46
+ ```
47
+
48
+ Or run without installing:
49
+
50
+ ```bash
51
+ npx @serjm/deepseek-code
52
+ ```
53
+
54
+ Short alias:
55
+
56
+ ```bash
57
+ dsc
58
+ dsc -p "Find the bug in auth.ts and patch it"
59
+ dsc --headless --json -p "Review this repository"
60
+ ```
61
+
62
+ ---
63
+
64
+ ## Why Use It
65
+
66
+ | Need | DeepSeek Code |
67
+ |---|---|
68
+ | Fix code from the terminal | Reads files, proposes patches, and runs verification commands |
69
+ | Keep costs predictable | Uses your DeepSeek API key directly |
70
+ | Work inside existing repos | Runs where your code already lives |
71
+ | Avoid blind automation | Approval modes keep edits and shell commands under your control |
72
+ | Debug browser flows | Built-in Chrome automation for pages, forms, console, screenshots, and network state |
73
+ | Keep context over time | Project memory and resumable sessions help with longer work |
74
+
75
+ ---
76
+
77
+ ## What It Can Do
78
+
79
+ ```text
80
+ You: "Find why checkout fails after login and fix it"
81
+
82
+ DeepSeek Code:
83
+ 1. Searches the relevant files
84
+ 2. Reads the auth and checkout code
85
+ 3. Applies a focused patch
86
+ 4. Runs tests or the command you approve
87
+ 5. Summarizes the change
88
+ ```
89
+
90
+ Core features:
91
+
92
+ - **Autonomous coding agent**: plans, reads, edits, searches, and runs commands.
93
+ - **Full terminal UI**: streaming output, tool activity, status, costs, and context usage.
94
+ - **Approval modes**: Plan, Default, Auto-Edit, and Turbo.
95
+ - **Browser automation**: open pages, click, fill forms, inspect console/network, take screenshots.
96
+ - **MCP support**: connect external tool servers for custom workflows.
97
+ - **Persistent memory**: save project facts with `/remember`.
98
+ - **AI code review**: use `/review` to inspect bugs, risks, and security issues.
99
+ - **Headless mode**: CI-friendly JSON output with `--headless --json`.
100
+
101
+ ---
102
+
103
+ ## Commands
104
+
105
+ | Command | Description |
106
+ |---|---|
107
+ | `/help` | Show available commands |
108
+ | `/setup` | Configure API key, language, and approval mode |
109
+ | `/remember <text>` | Save project context |
110
+ | `/memory` | Show saved memories |
111
+ | `/review` | Run AI code review |
112
+ | `/checkpoint` | Save a git checkpoint |
113
+ | `/restore` | Restore a checkpoint |
114
+ | `/theme` | Switch terminal theme |
115
+ | `/lang` | Switch language |
116
+ | `/git <cmd>` | Run git operations |
117
+ | `/loop <interval> <task>` | Schedule recurring work |
118
+ | `/sandbox` | Run commands in Docker isolation |
119
+ | `/mcp` | Manage MCP servers |
120
+ | `/stats` | Show session statistics |
121
+ | `/clear` | Clear chat |
122
+
123
+ ---
124
+
125
+ ## Configuration
126
+
127
+ Use environment variables:
128
+
129
+ ```bash
130
+ export DEEPSEEK_API_KEY="sk-..."
131
+ export DEEPSEEK_MODEL="deepseek-chat"
132
+ ```
133
+
134
+ Or create `.deepseek-code/settings.json` in your project:
135
+
136
+ ```json
137
+ {
138
+ "apiKey": "sk-...",
139
+ "model": "deepseek-chat",
140
+ "approvalMode": "default",
141
+ "temperature": 0.7
142
+ }
143
+ ```
144
+
145
+ ---
146
+
147
+ ## Safety Model
148
+
149
+ DeepSeek Code is designed around explicit control:
150
+
151
+ - **Plan**: read-only analysis.
152
+ - **Default**: asks before edits and commands.
153
+ - **Auto-Edit**: file edits are automatic, shell commands still need approval.
154
+ - **Turbo**: full automation for trusted local work.
155
+
156
+ It also supports command sanitization, file size limits, `.deepseekignore`, checkpoints, and optional Docker sandboxing.
157
+
158
+ ---
159
+
160
+ ## Development
161
+
162
+ ```bash
163
+ git clone https://github.com/SerjMihashin/deepseek-code.git
164
+ cd deepseek-code
165
+ npm install
166
+ npm run build
167
+ npm test
168
+ ```
169
+
170
+ Package check:
171
+
172
+ ```bash
173
+ npm pack --dry-run
174
+ npm publish --dry-run --access public
175
+ ```
176
+
177
+ Publish to npm:
178
+
179
+ ```bash
180
+ npm login
181
+ npm publish --access public
182
+ ```
183
+
184
+ If npm asks for two-factor authentication:
185
+
186
+ ```bash
187
+ npm publish --access public --otp=123456
188
+ ```
189
+
190
+ ---
191
+
192
+ ## License
193
+
194
+ Apache-2.0 © 2026 Serj Mikhashin
package/README.ru.md ADDED
@@ -0,0 +1,194 @@
1
+ <div align="center">
2
+ <br/>
3
+ <h1>DeepSeek Code</h1>
4
+ <p><strong>Open-source AI-агент для разработки в терминале: дешевле подписок, ближе к вашему коду, без привязки к IDE.</strong></p>
5
+
6
+ <p>
7
+ <a href="https://github.com/SerjMihashin/deepseek-code/blob/master/LICENSE">
8
+ <img src="https://img.shields.io/badge/license-Apache--2.0-blue" alt="License"/>
9
+ </a>
10
+ <img src="https://img.shields.io/badge/TypeScript-5.7-blue" alt="TypeScript"/>
11
+ <img src="https://img.shields.io/badge/DeepSeek-API-orange" alt="DeepSeek"/>
12
+ <img src="https://img.shields.io/badge/status-alpha-yellow" alt="Status"/>
13
+ </p>
14
+
15
+ <p>
16
+ <a href="README.md">English</a> · <b>Русский</b>
17
+ </p>
18
+ <br/>
19
+ </div>
20
+
21
+ ---
22
+
23
+ ## Коротко
24
+
25
+ DeepSeek Code — это AI-агент для разработки прямо в терминале. Он читает проект, редактирует файлы, запускает команды, делает code review, запоминает контекст и умеет управлять Chrome, когда задача выходит за пределы кода.
26
+
27
+ Он подходит, если нужен практичный локальный workflow:
28
+
29
+ - **Ниже стоимость**: используется ваш DeepSeek API key, без дорогой фиксированной подписки.
30
+ - **Реальная работа с проектом**: поиск по коду, патчи, тесты, продолжение прошлых сессий.
31
+ - **Терминальный подход**: без привязки к конкретной IDE и без отдельного облачного workspace.
32
+ - **Контроль над автоматизацией**: режимы от read-only анализа до полного turbo.
33
+
34
+ ---
35
+
36
+ ## Установка
37
+
38
+ ```bash
39
+ npm install -g @serjm/deepseek-code
40
+ ```
41
+
42
+ Запуск:
43
+
44
+ ```bash
45
+ deepseek-code
46
+ ```
47
+
48
+ Запуск без установки:
49
+
50
+ ```bash
51
+ npx @serjm/deepseek-code
52
+ ```
53
+
54
+ Короткий алиас:
55
+
56
+ ```bash
57
+ dsc
58
+ dsc -p "Найди баг в auth.ts и исправь"
59
+ dsc --headless --json -p "Сделай review репозитория"
60
+ ```
61
+
62
+ ---
63
+
64
+ ## Зачем он нужен
65
+
66
+ | Задача | Что делает DeepSeek Code |
67
+ |---|---|
68
+ | Исправить код из терминала | Читает файлы, предлагает патчи и запускает проверочные команды |
69
+ | Держать расходы под контролем | Работает напрямую через ваш DeepSeek API key |
70
+ | Работать в существующих репозиториях | Запускается там, где уже лежит код |
71
+ | Не отдавать все на автопилот | Режимы подтверждений контролируют правки и shell-команды |
72
+ | Отлаживать browser flow | Встроенный Chrome: страницы, формы, консоль, network, скриншоты |
73
+ | Не терять контекст | Память проекта и продолжение сессий помогают на длинных задачах |
74
+
75
+ ---
76
+
77
+ ## Что он умеет
78
+
79
+ ```text
80
+ Вы: "Найди, почему checkout падает после логина, и исправь"
81
+
82
+ DeepSeek Code:
83
+ 1. Ищет релевантные файлы
84
+ 2. Читает auth и checkout код
85
+ 3. Вносит точечный патч
86
+ 4. Запускает тесты или команду после подтверждения
87
+ 5. Кратко объясняет результат
88
+ ```
89
+
90
+ Основные возможности:
91
+
92
+ - **Автономный coding agent**: планирует, читает, редактирует, ищет и запускает команды.
93
+ - **Полноценный terminal UI**: streaming output, цепочка инструментов, статус, стоимость и контекст.
94
+ - **Режимы подтверждений**: Plan, Default, Auto-Edit и Turbo.
95
+ - **Автоматизация браузера**: открыть страницу, кликнуть, заполнить форму, проверить console/network, сделать screenshot.
96
+ - **MCP support**: подключение внешних tool-серверов для своих workflows.
97
+ - **Постоянная память**: сохраняйте факты проекта через `/remember`.
98
+ - **AI code review**: команда `/review` ищет баги, риски и проблемы безопасности.
99
+ - **Headless mode**: JSON-вывод для CI и скриптов через `--headless --json`.
100
+
101
+ ---
102
+
103
+ ## Команды
104
+
105
+ | Команда | Описание |
106
+ |---|---|
107
+ | `/help` | Показать команды |
108
+ | `/setup` | Настроить API key, язык и режим подтверждений |
109
+ | `/remember <text>` | Сохранить контекст проекта |
110
+ | `/memory` | Показать сохраненную память |
111
+ | `/review` | Запустить AI code review |
112
+ | `/checkpoint` | Сохранить git checkpoint |
113
+ | `/restore` | Восстановить checkpoint |
114
+ | `/theme` | Сменить тему |
115
+ | `/lang` | Сменить язык |
116
+ | `/git <cmd>` | Git-операции |
117
+ | `/loop <interval> <task>` | Запланировать повторяющуюся задачу |
118
+ | `/sandbox` | Запуск через Docker isolation |
119
+ | `/mcp` | Управление MCP-серверами |
120
+ | `/stats` | Статистика сессии |
121
+ | `/clear` | Очистить чат |
122
+
123
+ ---
124
+
125
+ ## Конфигурация
126
+
127
+ Через переменные окружения:
128
+
129
+ ```bash
130
+ export DEEPSEEK_API_KEY="sk-..."
131
+ export DEEPSEEK_MODEL="deepseek-chat"
132
+ ```
133
+
134
+ Или через `.deepseek-code/settings.json` в корне проекта:
135
+
136
+ ```json
137
+ {
138
+ "apiKey": "sk-...",
139
+ "model": "deepseek-chat",
140
+ "approvalMode": "default",
141
+ "temperature": 0.7
142
+ }
143
+ ```
144
+
145
+ ---
146
+
147
+ ## Контроль и безопасность
148
+
149
+ DeepSeek Code построен вокруг явного контроля:
150
+
151
+ - **Plan**: только read-only анализ.
152
+ - **Default**: спрашивает перед правками и командами.
153
+ - **Auto-Edit**: правки файлов автоматические, shell-команды требуют подтверждения.
154
+ - **Turbo**: полная автоматизация для доверенной локальной работы.
155
+
156
+ Также есть санитизация команд, лимиты размера файлов, `.deepseekignore`, checkpoints и опциональный Docker sandbox.
157
+
158
+ ---
159
+
160
+ ## Разработка
161
+
162
+ ```bash
163
+ git clone https://github.com/SerjMihashin/deepseek-code.git
164
+ cd deepseek-code
165
+ npm install
166
+ npm run build
167
+ npm test
168
+ ```
169
+
170
+ Проверить пакет:
171
+
172
+ ```bash
173
+ npm pack --dry-run
174
+ npm publish --dry-run --access public
175
+ ```
176
+
177
+ Опубликовать в npm:
178
+
179
+ ```bash
180
+ npm login
181
+ npm publish --access public
182
+ ```
183
+
184
+ Если npm просит двухфакторный код:
185
+
186
+ ```bash
187
+ npm publish --access public --otp=123456
188
+ ```
189
+
190
+ ---
191
+
192
+ ## Лицензия
193
+
194
+ Apache-2.0 © 2026 Serj Mikhashin
@@ -0,0 +1,77 @@
1
+ import { type DeepSeekConfig } from '../config/defaults.js';
2
+ import type { OpenAITool } from '../tools/types.js';
3
+ export type { OpenAITool };
4
+ export type ContentBlock = {
5
+ type: 'text';
6
+ text: string;
7
+ } | {
8
+ type: 'image_url';
9
+ image_url: {
10
+ url: string;
11
+ };
12
+ };
13
+ export interface ChatMessage {
14
+ role: 'system' | 'user' | 'assistant' | 'tool';
15
+ content: string | ContentBlock[];
16
+ tool_call_id?: string;
17
+ tool_calls?: Array<{
18
+ id: string;
19
+ type: 'function';
20
+ function: {
21
+ name: string;
22
+ arguments: string;
23
+ };
24
+ }>;
25
+ }
26
+ export interface StreamChunk {
27
+ type: 'text' | 'tool_use' | 'tool_result' | 'reasoning' | 'usage';
28
+ content: string;
29
+ toolName?: string;
30
+ toolInput?: Record<string, unknown>;
31
+ toolResult?: string;
32
+ toolCallId?: string;
33
+ usage?: {
34
+ input: number;
35
+ output: number;
36
+ total: number;
37
+ };
38
+ }
39
+ export interface ToolCallResult {
40
+ role: 'tool';
41
+ content: string;
42
+ tool_call_id: string;
43
+ }
44
+ export interface ToolCallMessage {
45
+ role: 'assistant';
46
+ content: string | null;
47
+ tool_calls: NonNullable<ChatMessage['tool_calls']>;
48
+ }
49
+ export declare class DeepSeekAPI {
50
+ private client;
51
+ private model;
52
+ private systemPrompt;
53
+ constructor(config: DeepSeekConfig);
54
+ streamChat(messages: ChatMessage[], tools?: OpenAITool[]): AsyncGenerator<StreamChunk>;
55
+ /**
56
+ * Non-streaming chat with optional tools support.
57
+ * Returns either text content or tool_calls.
58
+ */
59
+ chat(messages: ChatMessage[], tools?: OpenAITool[]): Promise<{
60
+ content: string;
61
+ toolCalls?: ToolCallMessage['tool_calls'];
62
+ usage?: {
63
+ input: number;
64
+ output: number;
65
+ };
66
+ }>;
67
+ /** Validate API key by making a minimal models list request */
68
+ validateKey(): Promise<{
69
+ valid: boolean;
70
+ error?: string;
71
+ }>;
72
+ /**
73
+ * Get embedding vector for a text string using DeepSeek's embeddings API.
74
+ */
75
+ getEmbedding(text: string): Promise<number[]>;
76
+ }
77
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAGnD,YAAY,EAAE,UAAU,EAAE,CAAA;AAE1B,MAAM,MAAM,YAAY,GACpB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC9B;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,SAAS,EAAE;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,CAAA;AAErD,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,WAAW,GAAG,MAAM,CAAC;IAC/C,OAAO,EAAE,MAAM,GAAG,YAAY,EAAE,CAAC;IACjC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,KAAK,CAAC;QACjB,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,UAAU,CAAC;QACjB,QAAQ,EAAE;YACR,IAAI,EAAE,MAAM,CAAC;YACb,SAAS,EAAE,MAAM,CAAC;SACnB,CAAC;KACH,CAAC,CAAC;CACJ;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,aAAa,GAAG,WAAW,GAAG,OAAO,CAAC;IAClE,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE;QACN,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;CACH;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,WAAW,CAAC;IAClB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,UAAU,EAAE,WAAW,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC,CAAC;CACpD;AA8BD,qBAAa,WAAW;IACtB,OAAO,CAAC,MAAM,CAAQ;IACtB,OAAO,CAAC,KAAK,CAAQ;IACrB,OAAO,CAAC,YAAY,CAAQ;gBAEf,MAAM,EAAE,cAAc;IAS3B,UAAU,CAChB,QAAQ,EAAE,WAAW,EAAE,EACvB,KAAK,CAAC,EAAE,UAAU,EAAE,GACnB,cAAc,CAAC,WAAW,CAAC;IAmI9B;;;OAGG;IACG,IAAI,CACR,QAAQ,EAAE,WAAW,EAAE,EACvB,KAAK,CAAC,EAAE,UAAU,EAAE,GACnB,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,eAAe,CAAC,YAAY,CAAC,CAAC;QAAC,KAAK,CAAC,EAAE;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,CAAC;IAsCrH,+DAA+D;IACzD,WAAW,IAAK,OAAO,CAAC;QAAE,KAAK,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAiBjE;;OAEG;IACG,YAAY,CAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;CAOrD"}