{"id":479740,"date":"2026-05-14T12:24:46","date_gmt":"2026-05-14T12:24:46","guid":{"rendered":"https:\/\/savepearlharbor.com\/?p=479740"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=479740","title":{"rendered":"\u041a\u0430\u043a \u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u0441\u0432\u043e\u0439 Claude Code \u043d\u0430 DeepSeek \u0437\u0430 \u0432\u0435\u0447\u0435\u0440"},"content":{"rendered":"<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p># \u0417\u0430\u0447\u0435\u043c \u044d\u0442\u043e \u0432\u0441\u0451<br \/>Claude Code \u2014 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 AI-\u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442 \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u043f\u0440\u0438\u043a\u0440\u0443\u0442\u0438\u0442\u044c \u0414\u0438\u043f\u0441\u0438\u043a, \u043d\u043e \u0435\u0441\u0442\u044c \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0430\u044f \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 &#8212; \u043e\u043d \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d \u043a API Anthropic.<\/p>\n<p>\u0415\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0437\u0430\u043f\u0438\u043b\u0438\u0442\u044c \u0441\u0432\u043e\u0439 \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434 \u0441 \u0447\u0435\u0440\u043d\u044b\u043c CMD \u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c\u0438 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0449\u0438\u0435 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0438: tool use, permissions, memory, compaction, subagents \u2014 \u043d\u043e \u0441 \u043d\u0443\u043b\u044f, \u043d\u0430 \u0447\u0438\u0441\u0442\u043e\u043c Node.js.\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u2014 <strong>deepseek-agent<\/strong>: ~2000 \u0441\u0442\u0440\u043e\u043a \u043a\u043e\u0434\u0430, 4 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 (<code>openai<\/code>, <code>fast-glob<\/code>, <code>dotenv<\/code>, <code>@modelcontextprotocol\/sdk<\/code>), \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432.\u041a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b, \u043d\u0435 \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043b\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0438\u043b\u0438\u0442\u044c \u0441\u0432\u043e\u0435\u0433\u043e \u0430\u0433\u0435\u043d\u0442\u0430, \u043d\u043e \u0435\u0441\u0442\u044c \u043d\u044e\u0430\u043d\u0441\u044b.\u0418 \u0442\u0430\u043a \u043f\u043e\u0435\u0445\u0430\u043b\u0438<\/p>\n<p>\u0421 \u0445\u043e\u0434\u0443 \u043f\u0438\u043b\u0438\u043c \u0442\u0430\u043a\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443:&#171;<code>index.js            \u2014 \u0442\u043e\u0447\u043a\u0430 \u0432\u0445\u043e\u0434\u0430, REPLsrc\/agent.js        \u2014 agent loopsrc\/config.js       \u2014 .agent\/settings.jsonsrc\/memory.js       \u2014 <\/code><a href=\"http:\/\/AGENT.md\" rel=\"noopener noreferrer nofollow\"><code>AGENT.md<\/code><\/a><code> \u2192 system promptsrc\/permissions.js  \u2014 alwaysAllow \/ neverAllow \/ [y\/N]src\/hooks.js        \u2014 PreToolUse \/ PostToolUse \u0441\u043e\u0431\u044b\u0442\u0438\u044fsrc\/compactor.js    \u2014 \u0430\u0432\u0442\u043e\u0441\u0436\u0430\u0442\u0438\u0435 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u0447\u0435\u0440\u0435\u0437 LLMsrc\/mcp.js          \u2014 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 MCP-\u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432src\/thinking.js     \u2014 deepseek-reasoner (--think)src\/worktree.js     \u2014 git worktree \u0438\u0437\u043e\u043b\u044f\u0446\u0438\u044fsrc\/output.js       \u2014 JSON-\u0440\u0435\u0436\u0438\u043c \u0434\u043b\u044f CIsrc\/ui.js           \u2014 ANSI-\u0446\u0432\u0435\u0442\u0430src\/tools\/          \u2014 9 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432<\/code>`<code>\u041a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435: \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u2014 \u044d\u0442\u043e \u043e\u0431\u044a\u0435\u043a\u0442 \u0441 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439:<\/code>`<code><em>js<\/em>{  name: \"read_file\",  description: \"Read the contents of a text file.\",  parameters: { \/* JSON Schema <em>\/ },  isReadOnly: true,       \/\/ false = \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435  async execute(args) {    return \"\u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u0442\u0440\u043e\u043a\u043e\u0439\"  }}<\/em><\/code><em>`<\/em><\/p>\n<p><code><em>\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 = \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 \u0438 \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0435\u0433\u043e \u0432 \u043c\u0430\u0441\u0441\u0438\u0432 <\/em><\/code><em>TOOLS<\/em><code><em>. \u041c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u044f, JSON Schema \u0434\u043b\u044f API, \u0445\u0443\u043a\u0438, \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u2014 \u0432\u0441\u0451 \u043f\u043e\u0434\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438.\u043d\u043e \u0447\u0435\u0433\u043e-\u0442\u043e \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442, \u0434\u0430\u0432\u0430\u0439 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u0435\u0441\u0441\u0438\u0438, \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e\u0435\u0449\u0435 \u0442\u0440\u0438 \u043a\u043e\u043c\u043c\u0438\u0442\u0430.\u0412\u044b\u043d\u0435\u0441 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043a\u043e\u043c\u0430\u043d\u0434 (<\/em><\/code><em>\/clear<\/em><code><em>, <\/em><\/code><em>\/compact<\/em><code><em>, <\/em><\/code><em>\/diff<\/em><code><em>, <\/em><\/code><em>\/review<\/em><code><em>, ...) \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 <\/em><\/code><em>commands.js<\/em><code><em>. \u0414\u043e\u0431\u0430\u0432\u0438\u043b <\/em><\/code><em>session.js<\/em><code><em> \u2014 \u0441\u0435\u0441\u0441\u0438\u0438 \u0441 \u0447\u0435\u043a\u043f\u043e\u0438\u043d\u0442\u0430\u043c\u0438. \u041f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u043b README.\u0417\u0434\u0435\u0441\u044c \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0432\u0430\u0436\u043d\u0430\u044f \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u044f: <\/em>*\u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u2014 \u0440\u0430\u0437\u043d\u044b\u0435 \u0432\u0435\u0449\u0438**. \u041a\u043e\u043c\u0430\u043d\u0434\u044b (<\/code>\/clear<code>, <\/code>\/rewind<code>) \u2014 \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b (<\/code>read_file<code>, <\/code>bash<code>) \u2014 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438. \u041a\u043e\u043c\u0430\u043d\u0434\u044b \u043c\u043e\u0433\u0443\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c <\/code>agentLoop()<code>, \u043d\u043e \u043d\u0435 \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442.\u0417\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043b \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <\/code>agent<code> \u0447\u0435\u0440\u0435\u0437 <\/code>npm link<code> \u0438 \u043f\u043e\u043b\u0435 <\/code>bin<code> \u0432 <\/code>package.json<code>. \u0422\u0435\u043f\u0435\u0440\u044c \u0432\u043c\u0435\u0441\u0442\u043e <\/code>npm start<code> \u2014 \u043f\u0440\u043e\u0441\u0442\u043e <\/code>agent<code> \u0438\u0437 \u043b\u044e\u0431\u043e\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438.\u041a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b \u0432\u0441\u0435 \u0445\u043e\u0440\u043e\u0448\u043e, \u043d\u043e \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435 \u043d\u0435\u0442 (\u0430 \u043a\u0430\u043a \u0442\u044b \u0445\u043e\u0442\u0435\u043b) \u0415\u0449\u0435 \u043f\u043e\u043b \u0434\u043d\u044f \u043d\u0430 \u043f\u043e\u043b\u0438\u0440\u043e\u0432\u043a\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0430.\u041a\u0430\u0436\u0434\u044b\u0439 \u043a\u043e\u043c\u043c\u0438\u0442 \u2014 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430, \u0432\u0440\u043e\u0434\u0435 \u043c\u0435\u043b\u043e\u0447\u0438, \u0430 \u0441\u0438\u043b\u044c\u043d\u043e \u043f\u043e\u0440\u0442\u044f\u0442 \u043a\u0430\u0440\u0442\u0438\u043d\u0443.---## \u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430### Agent Loop \u2014 \u0441\u0435\u0440\u0434\u0446\u0435 \u0430\u0433\u0435\u043d\u0442\u0430\u0412\u0441\u0451 \u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f \u0432\u043e\u043a\u0440\u0443\u0433 \u043e\u0434\u043d\u043e\u0433\u043e \u0446\u0438\u043a\u043b\u0430 \u0432 <\/code>agent.js<code>:<\/code>`<code>agentLoop(userMessage)  \u251c\u2500 pushMessage({ role: \"user\", content: userMessage })  \u2514\u2500 while(true)       \u251c\u2500 compactIfNeeded() \u2014 \u0441\u0436\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0435\u0441\u043b\u0438 &gt; 80% \u043b\u0438\u043c\u0438\u0442\u0430       \u251c\u2500 chat.completions.create({ stream: true })       \u2502    \u251c\u2500 \u0441\u043e\u0431\u0440\u0430\u0442\u044c fullContent (\u0442\u0435\u043a\u0441\u0442 \u043e\u0442\u0432\u0435\u0442\u0430)       \u2502    \u2514\u2500 \u0441\u043e\u0431\u0440\u0430\u0442\u044c toolCalls (\u0432\u044b\u0437\u043e\u0432\u044b \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432)       \u251c\u2500 finish_reason === \"stop\" \u2192 return       \u2514\u2500 finish_reason === \"tool_calls\"            \u2514\u2500 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430:                 \u251c\u2500 PreToolUse hook                 \u251c\u2500 checkPermission()                 \u251c\u2500 tool.execute(args)                 \u251c\u2500 PostToolUse hook                 \u2514\u2500 pushMessage({ role: \"tool\", result })<\/code>`<code>\u041c\u043e\u0434\u0435\u043b\u044c \u0441\u0430\u043c\u0430 \u0440\u0435\u0448\u0430\u0435\u0442, \u043a\u0430\u043a\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0432\u044b\u0437\u0432\u0430\u0442\u044c. \u0410\u0433\u0435\u043d\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0432\u044b\u0437\u043e\u0432 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442. \u0426\u0438\u043a\u043b \u043a\u0440\u0443\u0442\u0438\u0442\u0441\u044f, \u043f\u043e\u043a\u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u043d\u0435 \u043e\u0442\u0432\u0435\u0442\u0438\u0442 <\/code>stop<code>.DeepSeek API \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c \u0441 OpenAI \u2014 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0430\u043a\u0435\u0442 <\/code>openai<code> \u0441 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u043c <\/code>baseURL<code>:<\/code>`<code><em>js<\/em>const client = new OpenAI({  baseURL: \"<\/code><a href=\"https:\/\/api.deepseek.com\" rel=\"noopener noreferrer nofollow\"><code>https:\/\/api.deepseek.com<\/code><\/a><code>\",  apiKey: process.env.DEEPSEEK_API_KEY})<\/code>`<code>### \u0421\u0442\u0440\u0438\u043c\u0438\u043d\u0433: \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c tool_calls \u0438\u0437 \u0434\u0435\u043b\u044c\u0442\u041f\u0440\u0438 \u0441\u0442\u0440\u0438\u043c\u0438\u043d\u0433\u0435 tool_calls \u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0442 \u043f\u043e \u0447\u0430\u0441\u0442\u044f\u043c. \u0418\u043c\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0434\u0440\u043e\u0431\u044f\u0442\u0441\u044f \u043d\u0430 \u0447\u0430\u043d\u043a\u0438:<\/code>`<code><em>js<\/em>for await (const chunk of stream) {  if (delta?.tool_calls) {    for (const tc of delta.tool_calls) {      if (!toolCalls[tc.index]) {        toolCalls[tc.index] = {          id: \"\", type: \"function\",          function: { name: \"\", arguments: \"\" }        }      }      if (<\/code><a href=\"http:\/\/tc.id\" rel=\"noopener noreferrer nofollow\"><code>tc.id<\/code><\/a><code>) toolCalls[tc.index].id += <\/code><a href=\"http:\/\/tc.id\" rel=\"noopener noreferrer nofollow\"><code>tc.id<\/code><\/a><code>      if (tc.function?.name)        toolCalls[tc.index].<\/code><a href=\"http:\/\/function.name\" rel=\"noopener noreferrer nofollow\"><code>function.name<\/code><\/a><code> += <\/code><a href=\"http:\/\/tc.function.name\" rel=\"noopener noreferrer nofollow\"><code>tc.function.name<\/code><\/a><code>      if (tc.function?.arguments)        toolCalls[tc.index].function.arguments += tc.function.arguments    }  }}<\/code>`<code>\u041a\u043b\u044e\u0447\u0435\u0432\u043e\u0439 \u043c\u043e\u043c\u0435\u043d\u0442: <\/code>tc.index<code> \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442, \u043a \u043a\u0430\u043a\u043e\u043c\u0443 tool_call \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u0434\u0435\u043b\u044c\u0442\u0430. \u0411\u0435\u0437 \u044d\u0442\u043e\u0433\u043e \u043d\u0435\u043b\u044c\u0437\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0435 \u0432\u044b\u0437\u043e\u0432\u044b.---## \u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b: 9 \u0448\u0442\u0443\u043a, \u043a\u0430\u0436\u0434\u044b\u0439 \u2014 \u043e\u0434\u0438\u043d \u0444\u0430\u0439\u043b### read_file \u2014 \u0447\u0442\u0435\u043d\u0438\u0435 \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0438\u041d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e <\/code>fs.readFile<code>. \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0443 \u043f\u043e BOM:<\/code>`<code><em>js<\/em>if (buf[0] === 0xEF &amp;&amp; buf[1] === 0xBB &amp;&amp; buf[2] === 0xBF) {  return buf.slice(3).toString(\"utf-8\")    \/\/ UTF-8 BOM}if (buf[0] === 0xFF &amp;&amp; buf[1] === 0xFE) {  return buf.slice(2).toString(\"utf16le\")  \/\/ UTF-16 LE}<\/code>`<code>\u0411\u0438\u043d\u0430\u0440\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043f\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044e \u2014 \u0431\u0435\u0437 \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0434\u0435\u043b\u044c \u0440\u0430\u0434\u043e\u0441\u0442\u043d\u043e \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u00ab\u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c\u00bb .png \u0438 .exe, \u0442\u0440\u0430\u0442\u044f \u0442\u043e\u043a\u0435\u043d\u044b \u043d\u0430 \u043c\u0443\u0441\u043e\u0440.### bash \u2014 \u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0430\u0411\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u043c \u043e\u043f\u0430\u0441\u043d\u044b\u0435 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e:<\/code>`<code><em>js<\/em>const SANDBOX_BLOCKED = [  \/\\bcurl\\b\/, \/\\bwget\\b\/,           \/\/ \u0441\u0435\u0442\u044c  \/\\brm\\s+-rf\\s+\\\/\/,                \/\/ \u0434\u0435\u0441\u0442\u0440\u0443\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438  \/\\bsudo\\b\/, \/\\bsu\\b\/              \/\/ \u043f\u0440\u0438\u0432\u0438\u043b\u0435\u0433\u0438\u0438]<\/code>`<code>\u041d\u0430 Windows \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u043a\u043e\u0434\u043e\u0432\u0443\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0432 UTF-8 \u043f\u0435\u0440\u0435\u0434 \u043a\u0430\u0436\u0434\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/code>`<code><em>js<\/em>const cmd = process.platform === \"win32\"  ? <\/code>chcp 65001 &gt;nul 2&gt;&amp;1 &amp; ${command}<code>  : command<\/code>`<code>\u0412\u044b\u0432\u043e\u0434 \u043e\u0431\u0440\u0435\u0437\u0430\u0435\u0442\u0441\u044f \u0434\u043e 8000 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u2014 \u0431\u0435\u0437 \u044d\u0442\u043e\u0433\u043e \u043e\u0434\u0438\u043d <\/code>cat<code> \u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0444\u0430\u0439\u043b \u0441\u044a\u0435\u0441\u0442 \u0432\u0435\u0441\u044c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442.### edit_file \u2014 \u0442\u043e\u0447\u043d\u0430\u044f \u0437\u0430\u043c\u0435\u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0412\u043c\u0435\u0441\u0442\u043e line-based diff \u2014 exact string replacement. \u041c\u043e\u0434\u0435\u043b\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442 <\/code>old_string<code> \u0438 <\/code>new_string<code>. \u0415\u0441\u043b\u0438 \u0441\u0442\u0440\u043e\u043a\u0430 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u0442\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u0430 \u2014 \u043e\u0448\u0438\u0431\u043a\u0430:<\/code>`<code><em>js<\/em>const count = original.split(old_string).length - 1if (count &gt; 1) {  return <\/code>Error: old_string found ${count} times \u2014 make it more specific<code>}<\/code>`<code>\u041a\u0440\u0430\u0441\u0438\u0432\u044b\u0439 diff \u0441 ANSI-\u043f\u043e\u0434\u0441\u0432\u0435\u0442\u043a\u043e\u0439 \u2014 \u0443\u0434\u0430\u043b\u0451\u043d\u043d\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u043d\u0430 \u0442\u0451\u043c\u043d\u043e-\u043a\u0440\u0430\u0441\u043d\u043e\u043c \u0444\u043e\u043d\u0435, \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u043d\u0430 \u0437\u0435\u043b\u0451\u043d\u043e\u043c, \u0441 3 \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430.### web_search \u2014 DuckDuckGo \u0431\u0435\u0437 API \u043a\u043b\u044e\u0447\u0430\u041f\u0430\u0440\u0441\u0438\u043c HTML DuckDuckGo \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u2014 \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e API \u043a\u043b\u044e\u0447\u0430 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e:<\/code>`<code><em>js<\/em>const url = <\/code><a href=\"https:\/\/html.duckduckgo.com\/html\/?q=%24%7BencodeURIComponent(query)%7D%60\" rel=\"noopener noreferrer nofollow\">https:\/\/html.duckduckgo.com\/html\/?q=${encodeURIComponent(query)}<\/a><code>const html = await fetch(url).then(r =&gt; r.text())\/\/ \u0418\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043a\u043e\u0439const resultRegex = \/&lt;a[^&gt;]+class=\"result__a\"[^&gt;]*href=\"([^\"]+)\"[^&gt;]*&gt;([^&lt;]+)&lt;\\\/a&gt;...<\/code>`<code>### task \u2014 \u0441\u0443\u0431\u0430\u0433\u0435\u043d\u0442\u044b\u0420\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 <\/code>agentLoop()<code> \u2014 \u0441\u0443\u0431\u0430\u0433\u0435\u043d\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0441\u0432\u043e\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e:<\/code>`<code><em>js<\/em>\/\/ \u041f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043econst results = await Promise.all(  <\/code><a href=\"http:\/\/parallel.map\" rel=\"noopener noreferrer nofollow\"><code>parallel.map<\/code><\/a><code>(desc =&gt; <em>agentLoop(desc)))\/\/ \u0424\u043e\u043d\u043e\u0432\u043econst entry = { done: false, result: null }entry.promise = <\/em>agentLoop(description).then(result =&gt; {  entry.done = true  entry.result = result})<\/code>`<code>\u0414\u043b\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0438\u043d\u044a\u0435\u043a\u0446\u0438\u044f: <\/code>initTaskTool(agentLoop)<code>. \u042d\u0442\u043e \u0440\u0435\u0448\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0446\u0438\u043a\u043b\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u2014 <\/code>task.js<code> \u043d\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442 <\/code>agent.js<code>.### todo \u2014 \u0437\u0430\u0434\u0430\u0447\u0438 \u0441 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438\u0412\u043d\u0443\u0442\u0440\u0438\u0441\u0435\u0441\u0441\u0438\u043e\u043d\u043d\u044b\u0439 \u0442\u0440\u0435\u043a\u0435\u0440 \u0437\u0430\u0434\u0430\u0447. \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 <\/code>blockedBy<code> \u2014 \u0437\u0430\u0434\u0430\u0447\u0430 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u0432 <\/code>in_progress<code>, \u043f\u043e\u043a\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043d\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u044b:<\/code>`<code><em>js<\/em>if (status === \"in_progress\" &amp;&amp; isBlocked(todo)) {  const blocking = todo.blockedBy.filter(    depId =&gt; getTodo(depId)?.status !== \"done\"  )  return <\/code>Cannot start #${id} \u2014 blocked by: ${blocking.join(&#171;, &#171;)}<code>}<\/code>`<code>---## \u0421\u0438\u0441\u0442\u0435\u043c\u0430 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0439\u0422\u0440\u0438 \u0443\u0440\u043e\u0432\u043d\u044f:1. <strong>alwaysAllow<\/strong> \u2014 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0431\u0435\u0437 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 (<\/code>read_file<code>, <\/code>glob<code>, <\/code>grep<code>)2. <strong>neverAllow<\/strong> \u2014 \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u043d\u0430\u0432\u0441\u0435\u0433\u0434\u04303. <strong>\u0418\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441<\/strong> \u2014 \u0434\u043b\u044f \u0432\u0441\u0435\u0433\u043e \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0433\u043e\u0414\u043b\u044f \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u2014 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438:<\/code>`<code>\u250c [?] write_file \u2192 src\/utils.js\u2514 [y] \u043e\u0434\u0438\u043d \u0440\u0430\u0437  [d] \u0437\u0430\u043f\u043e\u043c\u043d\u0438\u0442\u044c \u043f\u0430\u043f\u043a\u0443 \"src\"  [N] \u043e\u0442\u043a\u043b\u043e\u043d\u0438\u0442\u044c:<\/code>`<code>\u041d\u0430\u0436\u0430\u043b <\/code>d<code> \u2014 \u043f\u0430\u043f\u043a\u0430 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u0432 <\/code>.agent\/settings.json<code>. \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0440\u0430\u0437 \u043d\u0435 \u0441\u043f\u0440\u043e\u0441\u0438\u0442.\u0414\u043b\u044f <\/code>bash<code> \u2014 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430:<\/code>`<code>\u250c [?] bash: {\"command\":\"npm test\"}\u2514 [y] \u043e\u0434\u0438\u043d \u0440\u0430\u0437  [a] \u0437\u0430\u043f\u043e\u043c\u043d\u0438\u0442\u044c \u0434\u043b\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430  [N] \u043e\u0442\u043a\u043b\u043e\u043d\u0438\u0442\u044c:<\/code>`<code>\u041d\u0430\u0436\u0430\u043b <\/code>a<code> \u2014 bash \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 <\/code>alwaysAllow<code> \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0435.---## \u041a\u043e\u043c\u043f\u0430\u043a\u0442\u043e\u0440: \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0447\u0435\u0440\u0435\u0437 \u0441\u0443\u043c\u043c\u0430\u0440\u0438\u0437\u0430\u0446\u0438\u044e\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430: \u0443 DeepSeek \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043d\u043e\u0435 \u043e\u043a\u043d\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043e. \u041f\u043e\u0441\u043b\u0435 10\u201315 \u0445\u043e\u0434\u043e\u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f.\u0420\u0435\u0448\u0435\u043d\u0438\u0435: \u043f\u0435\u0440\u0435\u0434 \u043a\u0430\u0436\u0434\u044b\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c \u043a API \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0440\u0430\u0437\u043c\u0435\u0440 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430. \u0415\u0441\u043b\u0438 &gt; 80% \u043b\u0438\u043c\u0438\u0442\u0430 \u2014 \u0441\u0443\u043c\u043c\u0430\u0440\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0432\u0441\u044e \u0438\u0441\u0442\u043e\u0440\u0438\u044e \u0447\u0435\u0440\u0435\u0437 \u0442\u0443 \u0436\u0435 \u043c\u043e\u0434\u0435\u043b\u044c:<\/code>`<code><em>js<\/em>if (!force &amp;&amp; tokens &lt; contextLimit <em> 0.8) return messages\/\/ \u041e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c system prompt, \u0441\u0443\u043c\u043c\u0430\u0440\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435const summaryResponse = await <\/em><\/code><a href=\"http:\/\/client.chat\" rel=\"noopener noreferrer nofollow\"><code><em>client.chat<\/em><\/code><\/a><code><em>.completions.create({  model: getModel(),  messages: [    { role: \"system\", content: \"Summarize the conversation...\" },    { role: \"user\", content: <\/em><\/code><a href=\"http:\/\/rest.map\" rel=\"noopener noreferrer nofollow\"><code><em>rest.map<\/em><\/code><\/a><code><em>(m =&gt; <\/em><\/code><em>[${m.role}]: ${m.content}<\/em><code><em>).join(\"\\n\") }  ]})return [system, { role: \"user\", content: <\/em><\/code><em>[Summary]:\\n${summary}<\/em><code><em> },        { role: \"assistant\", content: \"Understood.\" }]<\/em><\/code><em>`<\/em><code><em>\u041e\u0446\u0435\u043d\u043a\u0430 \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u2014 \u0433\u0440\u0443\u0431\u0430\u044f, \u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442: ~3 \u0441\u0438\u043c\u0432\u043e\u043b\u0430 = 1 \u0442\u043e\u043a\u0435\u043d. Base64-\u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0441\u0447\u0438\u0442\u0430\u044e\u0442\u0441\u044f \u043f\u043e \u0434\u043b\u0438\u043d\u0435 \u0441\u0442\u0440\u043e\u043a\u0438.---## MCP \u2014 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0439 \u0447\u0443\u0436\u0438\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044bModel Context Protocol \u2014 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 \u043e\u0442 Anthropic \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432. \u041a\u043e\u043d\u0444\u0438\u0433 \u0432 <\/em><\/code><em>.agent\/settings.json<\/em><code><em>:<\/em><\/code><em>`<\/em><code><em>json\"mcpServers\": {  \"fs\": {    \"command\": \"npx\",    \"args\": [\"-y\", \"@modelcontextprotocol\/server-filesystem\", \"\/path\"]  }}<\/em><\/code><em>`<\/em><code><em>\u041f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435 \u0430\u0433\u0435\u043d\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u0447\u0435\u0440\u0435\u0437 stdio, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0438 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442 \u0438\u0445 \u0441 \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u043e\u043c <\/em><\/code><em>mcp__&lt;server&gt;__&lt;tool&gt;<\/em><code><em>:<\/em><\/code><em>`<\/em><code><em>jsconst transport = new StdioClientTransport({  command: cfg.command, args: cfg.args ?? []})const client = new Client({ name: \"deepseek-agent\", version: \"0.1.0\" })await client.connect(transport)const { tools: serverTools } = await client.listTools()<\/em><\/code><em>`<\/em><code><em>\u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b MCP \u043f\u0440\u043e\u0445\u043e\u0434\u044f\u0442 \u0447\u0435\u0440\u0435\u0437 \u0442\u0443 \u0436\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0439.---## \u041f\u0430\u043c\u044f\u0442\u044c: <\/em><\/code><a href=\"http:\/\/AGENT.md\" rel=\"noopener noreferrer nofollow\"><code><em>AGENT.md<\/em><\/code><\/a><code><em>\u0422\u0440\u0438 \u0443\u0440\u043e\u0432\u043d\u044f \u043f\u0430\u043c\u044f\u0442\u0438, \u0432\u0441\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u044e\u0442\u0441\u044f \u0432 system prompt:| \u0424\u0430\u0439\u043b | \u041d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 ||---|---|| <\/em><\/code><em>~\/.agent\/<\/em><a href=\"http:\/\/AGENT.md\" rel=\"noopener noreferrer nofollow\"><em>AGENT.md<\/em><\/a><code><em> | \u0413\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 (\u0441\u0442\u0438\u043b\u044c, \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0435\u043d\u0438\u044f) || <\/em><\/code><em>.agent\/<\/em><a href=\"http:\/\/AGENT.md\" rel=\"noopener noreferrer nofollow\"><em>AGENT.md<\/em><\/a><code><em> | \u0418\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 (\u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430, \u0441\u0442\u0435\u043a) || <\/em><\/code><a href=\"http:\/\/AGENT.md\" rel=\"noopener noreferrer nofollow\"><em>AGENT.md<\/em><\/a><code><em> | \u0418\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0432 \u043a\u043e\u0440\u043d\u0435 \u0440\u0435\u043f\u043e |\u042d\u0442\u043e \u0430\u043d\u0430\u043b\u043e\u0433 <\/em><\/code><a href=\"http:\/\/CLAUDE.md\" rel=\"noopener noreferrer nofollow\"><code><em>CLAUDE.md<\/em><\/code><\/a><code><em> \u0432 Claude Code. \u041c\u043e\u0434\u0435\u043b\u044c \u0432\u0438\u0434\u0438\u0442 \u044d\u0442\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u0434\u0438\u0430\u043b\u043e\u0433\u0435.---## \u0425\u0443\u043a\u0438: \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0441\u043e \u0441\u0432\u043e\u0438\u043c\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u0430\u043c\u0438<\/em><\/code><em>.agent\/hooks.json<\/em><code><em> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c shell-\u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043d\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0430\u0433\u0435\u043d\u0442\u0430:<\/em><\/code><em>`<\/em><code><em>json{  \"PreToolUse\":  [{ \"command\": \"cat &gt;&gt; agent.log\" }],  \"PostToolUse\": [],  \"Stop\":        []}<\/em><\/code><em>`<\/em><code><em><\/em><\/code><em>PreToolUse<\/em><code><em> \u0441 \u043d\u0435\u043d\u0443\u043b\u0435\u0432\u044b\u043c exit code \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430. Payload \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0447\u0435\u0440\u0435\u0437 stdin \u043a\u0430\u043a JSON \u2014 \u043c\u043e\u0436\u043d\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e \u0438\u043c\u0435\u043d\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430, \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u043c.---## \u0421\u043b\u0435\u0448-\u043a\u043e\u043c\u0430\u043d\u0434\u044b: 17 \u0448\u0442\u0443\u043a\u0412\u0441\u0451 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u2014 \u0447\u0435\u0440\u0435\u0437 <\/em><\/code><em>\/<\/em><code><em>-\u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432 \u0447\u0430\u0442\u0435:- <\/em><\/code><em>\/clear<\/em><code><em> \u2014 \u0441\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442- <\/em><\/code><em>\/compact<\/em><code><em> \u2014 \u043f\u0440\u0438\u043d\u0443\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u0436\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442- <\/em><\/code><em>\/context<\/em><code><em> \u2014 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441-\u0431\u0430\u0440 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430- <\/em><\/code><em>\/btw &lt;\u0432\u043e\u043f\u0440\u043e\u0441&gt;<\/em><code><em> \u2014 \u0432\u043e\u043f\u0440\u043e\u0441 \u0431\u0435\u0437 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0432 \u0438\u0441\u0442\u043e\u0440\u0438\u044e- <\/em><\/code><em>\/rewind<\/em><code><em> \u2014 \u043e\u0442\u043a\u0430\u0442 \u043a \u0447\u0435\u043a\u043f\u043e\u0438\u043d\u0442\u0443 (\u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u043a\u0430\u0436\u0434\u044b\u0439 \u0445\u043e\u0434)- <\/em><\/code><em>\/review<\/em><code><em> \u2014 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c <\/em><\/code><em>git diff<\/em><code><em> \u043d\u0430 \u0440\u0435\u0432\u044c\u044e- <\/em><\/code><em>\/security-review<\/em><code><em> \u2014 \u0430\u043d\u0430\u043b\u0438\u0437 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438- <\/em><\/code><em>\/simplify<\/em><code><em> \u2014 \u0442\u0440\u0438 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u0430\u0433\u0435\u043d\u0442\u0430: DRY, \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e, \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c- <\/em><\/code><em>\/batch &lt;\u0437\u0430\u0434\u0430\u0447\u0430&gt;<\/em><code><em> \u2014 \u0430\u0433\u0435\u043d\u0442 \u0434\u0435\u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0440\u0443\u0435\u0442 \u0437\u0430\u0434\u0430\u0447\u0443 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e- <\/em><\/code><em>\/loop 5m &lt;\u043f\u0440\u043e\u043c\u043f\u0442&gt;<\/em><code><em> \u2014 \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0437\u0430\u043f\u0443\u0441\u043a (\u0430\u043d\u0430\u043b\u043e\u0433 cron)- <\/em><\/code><em>\/resume<\/em><code><em> \u2014 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0443\u044e \u0441\u0435\u0441\u0441\u0438\u044e- <\/em><\/code><em>\/export<\/em><code><em> \u2014 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0434\u0438\u0430\u043b\u043e\u0433 \u0432 \u0444\u0430\u0439\u043b<\/em><\/code><em>\/simplify<\/em><code><em> \u2014 \u043f\u0440\u0438\u043c\u0435\u0440 \u043c\u043e\u0449\u0438 \u0441\u0443\u0431\u0430\u0433\u0435\u043d\u0442\u043e\u0432. \u0422\u0440\u0438 \u0430\u0433\u0435\u043d\u0442\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0442\u0441\u044f \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e \u0447\u0435\u0440\u0435\u0437 <\/em><\/code><em>Promise.all<\/em><code><em>, \u043a\u0430\u0436\u0434\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u0451\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u043f\u043e\u0434 \u0441\u0432\u043e\u0438\u043c \u0443\u0433\u043b\u043e\u043c:<\/em><\/code><em>`<\/em><code><em>jsconst tasks = [  \"Review for code reuse opportunities and DRY violations...\",  \"Review for code quality: naming, complexity, readability...\",  \"Review for performance and efficiency issues...\"]await taskTool.execute({ parallel: tasks })<\/em><\/code><em>`<\/em><code><em>---## \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0440\u0435\u0448\u0430\u0442\u044c### \u041f\u0440\u043e\u0436\u043e\u0440\u043b\u0438\u0432\u043e\u0441\u0442\u044c \u043f\u043e \u0442\u043e\u043a\u0435\u043d\u0430\u043c\u041a\u043e\u043c\u043c\u0438\u0442 <\/em><\/code><em>fa04583<\/em><code><em>: \u043c\u043e\u0434\u0435\u043b\u044c \u0447\u0438\u0442\u0430\u043b\u0430 \u0444\u0430\u0439\u043b\u044b \u0446\u0435\u043b\u0438\u043a\u043e\u043c \u0438 \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u043b\u0430 \u0438\u0445 \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442. \u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u2014 \u043e\u0431\u0440\u0435\u0437\u043a\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432:<\/em><\/code><em>`<\/em><code><em>jsconst CONTEXT_LIMIT = 12000const toolContent = full.length &gt; CONTEXT_LIMIT  ? full.slice(0, CONTEXT_LIMIT) + <\/em><\/code><em>\\n[&#8230; truncated, ${full.length &#8212; CONTEXT_LIMIT} chars omitted]<\/em><code><em>  : full<\/em><\/code><em>`<\/em><code><em>\u0412\u044b\u0432\u043e\u0434 bash \u0442\u043e\u0436\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d: 8000 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432.### \u0411\u0438\u043d\u0430\u0440\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b\u041a\u043e\u043c\u043c\u0438\u0442 <\/em><\/code><em>56116a1<\/em><code><em>: \u043c\u043e\u0434\u0435\u043b\u044c \u043b\u0435\u0437\u043b\u0430 \u0432 .exe, .png, .zip \u0431\u0435\u0437 \u0441\u043f\u0440\u043e\u0441\u0430. \u0414\u043e\u0431\u0430\u0432\u0438\u043b \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0443 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0445 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0439 \u0432 <\/em><\/code><em>read_file<\/em><code><em> \u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a\u043e\u0432 \u0432 <\/em><\/code><em>grep<\/em><code><em>.### Windows: \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0430\u041a\u043e\u043c\u043c\u0438\u0442 <\/em><\/code><em>a5193ac<\/em><code><em>: \u043d\u0430 Windows <\/em><\/code><em>stdout<\/em><code><em> \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 cp1251. \u0420\u0443\u0441\u0441\u043a\u0438\u0439 \u0442\u0435\u043a\u0441\u0442 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u043b\u0441\u044f \u0432 \u043a\u0440\u0430\u043a\u043e\u0437\u044f\u0431\u0440\u044b. \u0420\u0435\u0448\u0435\u043d\u0438\u0435: <\/em><\/code><em>chcp 65001<\/em><code><em> \u043f\u0435\u0440\u0435\u0434 \u043a\u0430\u0436\u0434\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 bash \u0438 BOM-\u0434\u0435\u0442\u0435\u043a\u0446\u0438\u044f \u0432 <\/em><\/code><em>read_file<\/em><code><em>.### \u0424\u0430\u0439\u043b\u044b \u0432\u0430\u043b\u044f\u0442\u0441\u044f \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u041a\u043e\u043c\u043c\u0438\u0442 <\/em><\/code><em>499a9ff<\/em><code><em>: \u043a\u043e\u0433\u0434\u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u0447\u0438\u0442\u0430\u043b\u0430 \u0444\u0430\u0439\u043b, \u0435\u0433\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0432\u044b\u0432\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b \u0446\u0435\u043b\u0438\u043a\u043e\u043c. \u0414\u043e\u0431\u0430\u0432\u0438\u043b <\/em><\/code><em>formatToolResult()<\/em><code><em> \u2014 \u0434\u043b\u044f <\/em><\/code><em>read_file<\/em><code><em> \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u00ab42 \u0441\u0442\u0440\u043e\u043a\u0438, 1200 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432\u00bb, \u0430 \u043d\u0435 \u0432\u0435\u0441\u044c \u0444\u0430\u0439\u043b.### \u0420\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0430 \u043f\u0430\u043f\u043a\u0443\u041a\u043e\u043c\u043c\u0438\u0442 <\/em><\/code><em>028d4e4<\/em><code><em>: \u043f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0444\u0430\u0439\u043b \u0430\u0433\u0435\u043d\u0442 \u0441\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u043b \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435. \u041f\u0440\u0438 \u0432\u0442\u043e\u0440\u043e\u0439 \u2014 \u0441\u043d\u043e\u0432\u0430. \u0414\u043e\u0431\u0430\u0432\u0438\u043b \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c <\/em><\/code><em>approvedDirs<\/em><code><em> \u2014 \u043e\u0434\u043e\u0431\u0440\u044f\u0435\u0448\u044c \u043f\u0430\u043f\u043a\u0443, \u0438 \u0432\u0441\u0435 \u0444\u0430\u0439\u043b\u044b \u0432 \u043d\u0435\u0439 \u043f\u0438\u0448\u0443\u0442\u0441\u044f \u0431\u0435\u0437 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432.### \u041f\u0435\u0440\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u043d\u043e\u0441\u0442\u044c \u0441\u0435\u0441\u0441\u0438\u0439\u041a\u043e\u043c\u043c\u0438\u0442 <\/em><\/code><em>86e21e0<\/em><code><em>: \u043f\u0440\u0438 \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u0438 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0430 \u0432\u0441\u044f \u0438\u0441\u0442\u043e\u0440\u0438\u044f \u0442\u0435\u0440\u044f\u043b\u0430\u0441\u044c. \u0414\u043e\u0431\u0430\u0432\u0438\u043b \u0430\u0432\u0442\u043e\u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0432 <\/em><\/code><em>.agent\/session.json<\/em><code><em> \u043f\u0440\u0438 \u0432\u044b\u0445\u043e\u0434\u0435 \u0438 <\/em><\/code><em>\/resume<\/em><code><em> \u0434\u043b\u044f \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f.---## \u0427\u0442\u043e \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c: \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438\u0412\u0441\u0435\u0433\u043e 4 \u043f\u0430\u043a\u0435\u0442\u0430:| \u041f\u0430\u043a\u0435\u0442 | \u0417\u0430\u0447\u0435\u043c ||---|---|| <\/em><\/code><em>openai<\/em><code><em> | \u041a\u043b\u0438\u0435\u043d\u0442 DeepSeek API (\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c \u0441 OpenAI) || <\/em><\/code><em>fast-glob<\/em><code><em> | \u041f\u043e\u0438\u0441\u043a \u0444\u0430\u0439\u043b\u043e\u0432 \u043f\u043e \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430\u043c \u0432 <\/em><\/code><em>glob<\/em><code><em> \u0438 <\/em><\/code><em>grep<\/em><code><em> || <\/em><\/code><em>dotenv<\/em><code><em> | \u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 <\/em><\/code><em>.env<\/em><code><em> || <\/em><\/code><em>@modelcontextprotocol\/sdk<\/em><code><em> | \u041a\u043b\u0438\u0435\u043d\u0442 MCP |\u041d\u0438\u043a\u0430\u043a\u0438\u0445 chalk, inquirer, commander, yargs. ANSI-\u0446\u0432\u0435\u0442\u0430 \u2014 6 \u0441\u0442\u0440\u043e\u043a. CLI-\u043f\u0430\u0440\u0441\u0438\u043d\u0433 \u2014 <\/em><\/code><em>process.argv.slice(2)<\/em><code><em>. readline \u2014 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 <\/em><\/code><em>node:readline<\/em><code><em>.---## \u041f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0435\u0439\u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f OpenAI-\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u043c\u0443 API, \u0430\u0433\u0435\u043d\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0441 DeepSeek:<\/em><\/code><em>`<\/em><code><em>DeepSeek      baseURL: <\/em><\/code><a href=\"https:\/\/api.deepseek.com\" rel=\"noopener noreferrer nofollow\"><code><em>https:\/\/api.deepseek.com<\/em><\/code><\/a><code><em>        model: deepseek-chatOpenAI        \u0431\u0435\u0437 baseURL                               model: gpt-4oOllama        baseURL: <\/em><\/code><a href=\"http:\/\/localhost:11434\/v1\" rel=\"noopener noreferrer nofollow\"><code><em>http:\/\/localhost:11434\/v1<\/em><\/code><\/a><code><em>         model: qwen2.5-coderGroq          baseURL: <\/em><\/code><a href=\"https:\/\/api.groq.com\/openai\/v1\" rel=\"noopener noreferrer nofollow\"><code><em>https:\/\/api.groq.com\/openai\/v1<\/em><\/code><\/a><code><em>   model: llama-3.3-70b-versatile<\/em><\/code><em>`<\/em><code><em>\u041c\u0435\u043d\u044f\u0435\u0448\u044c <\/em><\/code><em>baseURL<\/em><code><em> \u0432 \u043a\u043e\u0434\u0435 \u0438 <\/em><\/code><em>model<\/em><code><em> \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0435 \u2014 \u0433\u043e\u0442\u043e\u0432\u043e.---## \u0420\u0435\u0436\u0438\u043c extended thinking\u0424\u043b\u0430\u0433 <\/em><\/code><em>&#8212;think<\/em><code><em> \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u043d\u0430 <\/em><\/code><em>deepseek-reasoner<\/em><code><em>. \u042d\u0442\u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <\/em><\/code><em>reasoning_content<\/em><code><em> \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043e\u0442 \u043e\u0442\u0432\u0435\u0442\u0430 \u2014 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 chain-of-thought:<\/em><\/code><em>`<\/em><code><em>jsexport function printReasoning(chunk) {  const delta = chunk.choices[0]?.delta  if (delta?.reasoning_content) {    process.stdout.write(c.dim(delta.reasoning_content))    return true  }  return false}<\/em><\/code><em>`<\/em><code><em>\u0412 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435 reasoning \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u0440\u0438\u0433\u043b\u0443\u0448\u0451\u043d\u043d\u044b\u043c \u0446\u0432\u0435\u0442\u043e\u043c \u043c\u0435\u0436\u0434\u0443 \u043c\u0430\u0440\u043a\u0435\u0440\u0430\u043c\u0438 <\/em><\/code><em>[thinking]<\/em><code><em>\/<\/em><\/code><em>[\/thinking]<\/em><code><em>.---## JSON-\u0440\u0435\u0436\u0438\u043c \u0434\u043b\u044f CI<\/em><\/code><em>`<\/em><code><em>bashagent --output-format=json \"\u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 index.js?\"<\/em><\/code><em>`<\/em><code><em>\u041a\u0430\u0436\u0434\u043e\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u2014 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f JSON-\u0441\u0442\u0440\u043e\u043a\u0430:<\/em><\/code><em>`<\/em><code><em>json{ \"type\": \"text\", \"text\": \"\u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043e\u0442\u0432\u0435\u0442\u0430\" }{ \"type\": \"tool_call\", \"tool\": \"bash\", \"args\": { \"command\": \"ls\" } }{ \"type\": \"tool_result\", \"tool\": \"bash\", \"result\": \"file1.js\" }<\/em><\/code><em>`<\/em><code><em>\u041e\u0431\u044b\u0447\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434 \u043f\u043e\u0434\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u2014 \u0444\u0443\u043d\u043a\u0446\u0438\u044f <\/em><\/code><em>print()<\/em><code><em> \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u0435\u0442 \u0432 JSON-\u0440\u0435\u0436\u0438\u043c\u0435:<\/em><\/code><em>`<\/em><code><em>jsexport function print(text) {  if (_format !== \"json\") process.stdout.write(text)}<\/em><\/code><em>`<\/em><code><em>---## \u0418\u0442\u043e\u0433\u0438<\/em>*\u0427\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c:**- ~2000 \u0441\u0442\u0440\u043e\u043a JavaScript (ES modules)- 27 \u043a\u043e\u043c\u043c\u0438\u0442\u043e\u0432 \u0437\u0430 \u043d\u0435\u0434\u0435\u043b\u044e- 4 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438, \u043d\u043e\u043b\u044c \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432- 9 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 + MCP \u0434\u043b\u044f \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f- \u0421\u0438\u0441\u0442\u0435\u043c\u0430 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u0441 \u043f\u0435\u0440\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u043d\u043e\u0441\u0442\u044c\u044e- \u0410\u0432\u0442\u043e\u043a\u043e\u043c\u043f\u0430\u043a\u0446\u0438\u044f \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430- \u0421\u0443\u0431\u0430\u0433\u0435\u043d\u0442\u044b (\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0435, \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0435, \u0444\u043e\u043d\u043e\u0432\u044b\u0435)- 17 \u0441\u043b\u0435\u0448-\u043a\u043e\u043c\u0430\u043d\u0434- \u0425\u0443\u043a\u0438, \u043f\u0430\u043c\u044f\u0442\u044c, \u0441\u0435\u0441\u0441\u0438\u0438, git worktree- \u0420\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 Windows, Linux, macOS**\u0427\u0442\u043e \u044f \u0432\u044b\u043d\u0435\u0441:**1. <strong>OpenAI SDK \u2014 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u0438\u0435\u043d\u0442.<\/strong> DeepSeek, Groq, Ollama \u2014 \u0432\u0441\u0435 \u0433\u043e\u0432\u043e\u0440\u044f\u0442 \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0435. \u041e\u0434\u0438\u043d \u043f\u0430\u043a\u0435\u0442 \u043f\u043e\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0432\u0441\u0435\u0445.2. <strong>Tool use \u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e.<\/strong> JSON Schema \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u043c\u043e\u0434\u0435\u043b\u044c \u0441\u0430\u043c\u0430 \u0440\u0435\u0448\u0430\u0435\u0442 \u043a\u043e\u0433\u0434\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c. \u041d\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0430\u0440\u0441\u0438\u0442\u044c \u0442\u0435\u043a\u0441\u0442, \u0438\u0441\u043a\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432 \u043e\u0442\u0432\u0435\u0442\u0435 \u2014 API \u0432\u0441\u0451 \u0434\u0435\u043b\u0430\u0435\u0442.3. <strong>\u0421\u0442\u0440\u0438\u043c\u0438\u043d\u0433 tool_calls \u2014 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c.<\/strong> \u0414\u0435\u043b\u044c\u0442\u044b \u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0442 \u043f\u043e \u0447\u0430\u0441\u0442\u044f\u043c, \u043d\u0443\u0436\u043d\u043e \u0441\u043a\u043b\u0435\u0438\u0432\u0430\u0442\u044c \u043f\u043e \u0438\u043d\u0434\u0435\u043a\u0441\u0443. \u041d\u043e \u043a\u043e\u0433\u0434\u0430 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u0448\u044c\u0441\u044f \u2014 \u044d\u0442\u043e 15 \u0441\u0442\u0440\u043e\u043a \u043a\u043e\u0434\u0430.4. <strong>\u041a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u2014 \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u0440\u0435\u0441\u0443\u0440\u0441.<\/strong> 80% \u0431\u0430\u0433\u043e\u0432 \u0431\u044b\u043b\u0438 \u043f\u0440\u043e \u00ab\u043c\u043e\u0434\u0435\u043b\u044c \u0441\u044a\u0435\u043b\u0430 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e \u0442\u043e\u043a\u0435\u043d\u043e\u0432\u00bb. \u041e\u0431\u0440\u0435\u0437\u043a\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432, \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0430 \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a\u043e\u0432, \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043e\u0440 \u2014 \u0432\u0441\u0451 \u0440\u0430\u0434\u0438 \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0438 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430.5. <strong>\u041c\u0438\u043d\u0438\u043c\u0430\u043b\u0438\u0437\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<\/strong> \u0411\u0435\u0437 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432 \u043f\u0440\u043e\u0449\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442. ANSI-\u0446\u0432\u0435\u0442\u0430 \u0437\u0430 6 \u0441\u0442\u0440\u043e\u043a \u0432\u043c\u0435\u0441\u0442\u043e chalk. <\/code>process.argv` \u0432\u043c\u0435\u0441\u0442\u043e yargs. readline \u0432\u043c\u0435\u0441\u0442\u043e inquirer.\u0412\u0435\u0441\u044c \u043a\u043e\u0434 \u2014 [\u043d\u0430 GitHub](<a href=\"https:\/\/github.com\/skydeex\/deepseekAgent\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/skydeex\/deepseekAgent<\/a>).<\/p>\n<p>\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043d\u0430\u043f\u0438\u0448\u0443 \u043a\u0430\u043a \u044f \u0437\u0430\u043f\u0438\u043b\u0438\u043b \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0442\u043e\u0440 \u0440\u0430\u0441\u0445\u043e\u0434\u0430 \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u0434\u043b\u044f ai \u043a\u043e\u0434\u043e\u0432\u044b\u0445 \u0430\u0433\u0435\u043d\u0442\u043e\u0432 <\/p>\n<\/div>\n<p>\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/1035194\/\">https:\/\/habr.com\/ru\/articles\/1035194\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p># \u0417\u0430\u0447\u0435\u043c \u044d\u0442\u043e \u0432\u0441\u0451Claude Code \u2014 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 AI-\u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442 \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u043f\u0440\u0438\u043a\u0440\u0443\u0442\u0438\u0442\u044c \u0414\u0438\u043f\u0441\u0438\u043a, \u043d\u043e \u0435\u0441\u0442\u044c \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0430\u044f \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 &#8212; \u043e\u043d \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d \u043a API Anthropic.\u0415\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0437\u0430\u043f\u0438\u043b\u0438\u0442\u044c \u0441\u0432\u043e\u0439 \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434 \u0441 \u0447\u0435\u0440\u043d\u044b\u043c CMD \u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c\u0438 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0449\u0438\u0435 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0438: tool use, permissions, memory, compaction, subagents \u2014 \u043d\u043e \u0441 \u043d\u0443\u043b\u044f, \u043d\u0430 \u0447\u0438\u0441\u0442\u043e\u043c Node.js.\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u2014 deepseek-agent: ~2000 \u0441\u0442\u0440\u043e\u043a \u043a\u043e\u0434\u0430, 4 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 (openai, fast-glob, dotenv, @modelcontextprotocol\/sdk), \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432.\u041a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b, \u043d\u0435 \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043b\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0438\u043b\u0438\u0442\u044c \u0441\u0432\u043e\u0435\u0433\u043e \u0430\u0433\u0435\u043d\u0442\u0430, \u043d\u043e \u0435\u0441\u0442\u044c \u043d\u044e\u0430\u043d\u0441\u044b.\u0418 \u0442\u0430\u043a \u043f\u043e\u0435\u0445\u0430\u043b\u0438\u0421 \u0445\u043e\u0434\u0443 \u043f\u0438\u043b\u0438\u043c \u0442\u0430\u043a\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443:&#171;index.js            \u2014 \u0442\u043e\u0447\u043a\u0430 \u0432\u0445\u043e\u0434\u0430, REPLsrc\/agent.js        \u2014 agent loopsrc\/config.js       \u2014 .agent\/settings.jsonsrc\/memory.js       \u2014 AGENT.md \u2192 system promptsrc\/permissions.js  \u2014 alwaysAllow \/ neverAllow \/ [y\/N]src\/hooks.js        \u2014 PreToolUse \/ PostToolUse \u0441\u043e\u0431\u044b\u0442\u0438\u044fsrc\/compactor.js    \u2014 \u0430\u0432\u0442\u043e\u0441\u0436\u0430\u0442\u0438\u0435 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u0447\u0435\u0440\u0435\u0437 LLMsrc\/mcp.js          \u2014 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 MCP-\u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432src\/thinking.js     \u2014 deepseek-reasoner (&#8212;think)src\/worktree.js     \u2014 git worktree \u0438\u0437\u043e\u043b\u044f\u0446\u0438\u044fsrc\/output.js       \u2014 JSON-\u0440\u0435\u0436\u0438\u043c \u0434\u043b\u044f CIsrc\/ui.js           \u2014 ANSI-\u0446\u0432\u0435\u0442\u0430src\/tools\/          \u2014 9 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432`\u041a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435: \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u2014 \u044d\u0442\u043e \u043e\u0431\u044a\u0435\u043a\u0442 \u0441 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439:`js{  name: &#171;read_file&#187;,  description: &#171;Read the contents of a text file.&#187;,  parameters: { \/* JSON Schema \/ },  isReadOnly: true,       \/\/ false = \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435  async execute(args) {    return &#171;\u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u0442\u0440\u043e\u043a\u043e\u0439&#187;  }}`\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 = \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 \u0438 \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0435\u0433\u043e \u0432 \u043c\u0430\u0441\u0441\u0438\u0432 TOOLS. \u041c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u044f, JSON Schema \u0434\u043b\u044f API, \u0445\u0443\u043a\u0438, \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u2014 \u0432\u0441\u0451 \u043f\u043e\u0434\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438.\u043d\u043e \u0447\u0435\u0433\u043e-\u0442\u043e \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442, \u0434\u0430\u0432\u0430\u0439 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u0435\u0441\u0441\u0438\u0438, \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e\u0435\u0449\u0435 \u0442\u0440\u0438 \u043a\u043e\u043c\u043c\u0438\u0442\u0430.\u0412\u044b\u043d\u0435\u0441 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043a\u043e\u043c\u0430\u043d\u0434 (\/clear, \/compact, \/diff, \/review, &#8230;) \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 commands.js. \u0414\u043e\u0431\u0430\u0432\u0438\u043b session.js \u2014 \u0441\u0435\u0441\u0441\u0438\u0438 \u0441 \u0447\u0435\u043a\u043f\u043e\u0438\u043d\u0442\u0430\u043c\u0438. \u041f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u043b README.\u0417\u0434\u0435\u0441\u044c \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0432\u0430\u0436\u043d\u0430\u044f \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u044f: *\u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u2014 \u0440\u0430\u0437\u043d\u044b\u0435 \u0432\u0435\u0449\u0438**. \u041a\u043e\u043c\u0430\u043d\u0434\u044b (\/clear, \/rewind) \u2014 \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b (read_file, bash) \u2014 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438. \u041a\u043e\u043c\u0430\u043d\u0434\u044b \u043c\u043e\u0433\u0443\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c agentLoop(), \u043d\u043e \u043d\u0435 \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442.\u0417\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043b \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443 agent \u0447\u0435\u0440\u0435\u0437 npm link \u0438 \u043f\u043e\u043b\u0435 bin \u0432 package.json. \u0422\u0435\u043f\u0435\u0440\u044c \u0432\u043c\u0435\u0441\u0442\u043e npm start \u2014 \u043f\u0440\u043e\u0441\u0442\u043e agent \u0438\u0437 \u043b\u044e\u0431\u043e\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438.\u041a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b \u0432\u0441\u0435 \u0445\u043e\u0440\u043e\u0448\u043e, \u043d\u043e \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435 \u043d\u0435\u0442 (\u0430 \u043a\u0430\u043a \u0442\u044b \u0445\u043e\u0442\u0435\u043b) \u0415\u0449\u0435 \u043f\u043e\u043b \u0434\u043d\u044f \u043d\u0430 \u043f\u043e\u043b\u0438\u0440\u043e\u0432\u043a\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0430.\u041a\u0430\u0436\u0434\u044b\u0439 \u043a\u043e\u043c\u043c\u0438\u0442 \u2014 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430, \u0432\u0440\u043e\u0434\u0435 \u043c\u0435\u043b\u043e\u0447\u0438, \u0430 \u0441\u0438\u043b\u044c\u043d\u043e \u043f\u043e\u0440\u0442\u044f\u0442 \u043a\u0430\u0440\u0442\u0438\u043d\u0443.&#8212;## \u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430### Agent Loop \u2014 \u0441\u0435\u0440\u0434\u0446\u0435 \u0430\u0433\u0435\u043d\u0442\u0430\u0412\u0441\u0451 \u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f \u0432\u043e\u043a\u0440\u0443\u0433 \u043e\u0434\u043d\u043e\u0433\u043e \u0446\u0438\u043a\u043b\u0430 \u0432 agent.js:`agentLoop(userMessage)  \u251c\u2500 pushMessage({ role: &#171;user&#187;, content: userMessage })  \u2514\u2500 while(true)       \u251c\u2500 compactIfNeeded() \u2014 \u0441\u0436\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0435\u0441\u043b\u0438 &gt; 80% \u043b\u0438\u043c\u0438\u0442\u0430       \u251c\u2500 chat.completions.create({ stream: true })       \u2502    \u251c\u2500 \u0441\u043e\u0431\u0440\u0430\u0442\u044c fullContent (\u0442\u0435\u043a\u0441\u0442 \u043e\u0442\u0432\u0435\u0442\u0430)       \u2502    \u2514\u2500 \u0441\u043e\u0431\u0440\u0430\u0442\u044c toolCalls (\u0432\u044b\u0437\u043e\u0432\u044b \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432)       \u251c\u2500 finish_reason === &#171;stop&#187; \u2192 return       \u2514\u2500 finish_reason === &#171;tool_calls&#187;            \u2514\u2500 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430:                 \u251c\u2500 PreToolUse hook                 \u251c\u2500 checkPermission()                 \u251c\u2500 tool.execute(args)                 \u251c\u2500 PostToolUse hook                 \u2514\u2500 pushMessage({ role: &#171;tool&#187;, result })`\u041c\u043e\u0434\u0435\u043b\u044c \u0441\u0430\u043c\u0430 \u0440\u0435\u0448\u0430\u0435\u0442, \u043a\u0430\u043a\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0432\u044b\u0437\u0432\u0430\u0442\u044c. \u0410\u0433\u0435\u043d\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0432\u044b\u0437\u043e\u0432 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442. \u0426\u0438\u043a\u043b \u043a\u0440\u0443\u0442\u0438\u0442\u0441\u044f, \u043f\u043e\u043a\u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u043d\u0435 \u043e\u0442\u0432\u0435\u0442\u0438\u0442 stop.DeepSeek API \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c \u0441 OpenAI \u2014 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0430\u043a\u0435\u0442 openai \u0441 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u043c baseURL:`jsconst client = new OpenAI({  baseURL: &#171;https:\/\/api.deepseek.com&#187;,  apiKey: process.env.DEEPSEEK_API_KEY})`### \u0421\u0442\u0440\u0438\u043c\u0438\u043d\u0433: \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c tool_calls \u0438\u0437 \u0434\u0435\u043b\u044c\u0442\u041f\u0440\u0438 \u0441\u0442\u0440\u0438\u043c\u0438\u043d\u0433\u0435 tool_calls \u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0442 \u043f\u043e \u0447\u0430\u0441\u0442\u044f\u043c. \u0418\u043c\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0434\u0440\u043e\u0431\u044f\u0442\u0441\u044f \u043d\u0430 \u0447\u0430\u043d\u043a\u0438:`jsfor await (const chunk of stream) {  if (delta?.tool_calls) {    for (const tc of delta.tool_calls) {      if (!toolCalls[tc.index]) {        toolCalls[tc.index] = {          id: &#171;&#187;, type: &#171;function&#187;,          function: { name: &#171;&#187;, arguments: &#171;&#187; }        }      }      if (tc.id) toolCalls[tc.index].id += tc.id      if (tc.function?.name)        toolCalls[tc.index].function.name += tc.function.name      if (tc.function?.arguments)        toolCalls[tc.index].function.arguments += tc.function.arguments    }  }}`\u041a\u043b\u044e\u0447\u0435\u0432\u043e\u0439 \u043c\u043e\u043c\u0435\u043d\u0442: tc.index \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442, \u043a \u043a\u0430\u043a\u043e\u043c\u0443 tool_call \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u0434\u0435\u043b\u044c\u0442\u0430. \u0411\u0435\u0437 \u044d\u0442\u043e\u0433\u043e \u043d\u0435\u043b\u044c\u0437\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0435 \u0432\u044b\u0437\u043e\u0432\u044b.&#8212;## \u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b: 9 \u0448\u0442\u0443\u043a, \u043a\u0430\u0436\u0434\u044b\u0439 \u2014 \u043e\u0434\u0438\u043d \u0444\u0430\u0439\u043b### read_file \u2014 \u0447\u0442\u0435\u043d\u0438\u0435 \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0438\u041d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e fs.readFile. \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0443 \u043f\u043e BOM:`jsif (buf[0] === 0xEF &amp;&amp; buf[1] === 0xBB &amp;&amp; buf[2] === 0xBF) {  return buf.slice(3).toString(&#171;utf-8&#187;)    \/\/ UTF-8 BOM}if (buf[0] === 0xFF &amp;&amp; buf[1] === 0xFE) {  return buf.slice(2).toString(&#171;utf16le&#187;)  \/\/ UTF-16 LE}`\u0411\u0438\u043d\u0430\u0440\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043f\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044e \u2014 \u0431\u0435\u0437 \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0434\u0435\u043b\u044c \u0440\u0430\u0434\u043e\u0441\u0442\u043d\u043e \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u00ab\u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c\u00bb .png \u0438 .exe, \u0442\u0440\u0430\u0442\u044f \u0442\u043e\u043a\u0435\u043d\u044b \u043d\u0430 \u043c\u0443\u0441\u043e\u0440.### bash \u2014 \u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0430\u0411\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u043c \u043e\u043f\u0430\u0441\u043d\u044b\u0435 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e:`jsconst SANDBOX_BLOCKED = [  \/\\bcurl\\b\/, \/\\bwget\\b\/,           \/\/ \u0441\u0435\u0442\u044c  \/\\brm\\s+-rf\\s+\\\/\/,                \/\/ \u0434\u0435\u0441\u0442\u0440\u0443\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438  \/\\bsudo\\b\/, \/\\bsu\\b\/              \/\/ \u043f\u0440\u0438\u0432\u0438\u043b\u0435\u0433\u0438\u0438]`\u041d\u0430 Windows \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u043a\u043e\u0434\u043e\u0432\u0443\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0432 UTF-8 \u043f\u0435\u0440\u0435\u0434 \u043a\u0430\u0436\u0434\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:`jsconst cmd = process.platform === &#171;win32&#8243;  ? chcp 65001 &gt;nul 2&gt;&amp;1 &amp; ${command}  : command`\u0412\u044b\u0432\u043e\u0434 \u043e\u0431\u0440\u0435\u0437\u0430\u0435\u0442\u0441\u044f \u0434\u043e 8000 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u2014 \u0431\u0435\u0437 \u044d\u0442\u043e\u0433\u043e \u043e\u0434\u0438\u043d cat \u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0444\u0430\u0439\u043b \u0441\u044a\u0435\u0441\u0442 \u0432\u0435\u0441\u044c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442.### edit_file \u2014 \u0442\u043e\u0447\u043d\u0430\u044f \u0437\u0430\u043c\u0435\u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0412\u043c\u0435\u0441\u0442\u043e line-based diff \u2014 exact string replacement. \u041c\u043e\u0434\u0435\u043b\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442 old_string \u0438 new_string. \u0415\u0441\u043b\u0438 \u0441\u0442\u0440\u043e\u043a\u0430 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u0442\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u0430 \u2014 \u043e\u0448\u0438\u0431\u043a\u0430:`jsconst count = original.split(old_string).length &#8212; 1if (count &gt; 1) {  return Error: old_string found ${count} times \u2014 make it more specific}`\u041a\u0440\u0430\u0441\u0438\u0432\u044b\u0439 diff \u0441 ANSI-\u043f\u043e\u0434\u0441\u0432\u0435\u0442\u043a\u043e\u0439 \u2014 \u0443\u0434\u0430\u043b\u0451\u043d\u043d\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u043d\u0430 \u0442\u0451\u043c\u043d\u043e-\u043a\u0440\u0430\u0441\u043d\u043e\u043c \u0444\u043e\u043d\u0435, \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u043d\u0430 \u0437\u0435\u043b\u0451\u043d\u043e\u043c, \u0441 3 \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430.### web_search \u2014 DuckDuckGo \u0431\u0435\u0437 API \u043a\u043b\u044e\u0447\u0430\u041f\u0430\u0440\u0441\u0438\u043c HTML DuckDuckGo \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u2014 \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e API \u043a\u043b\u044e\u0447\u0430 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e:`jsconst url = https:\/\/html.duckduckgo.com\/html\/?q=${encodeURIComponent(query)}const html = await fetch(url).then(r =&gt; r.text())\/\/ \u0418\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043a\u043e\u0439const resultRegex = \/&lt;a[^&gt;]+class=&#187;result__a&#187;[^&gt;]*href=&#187;([^&#187;]+)&#187;[^&gt;]*&gt;([^&lt;]+)&lt;\\\/a&gt;&#8230;`### task \u2014 \u0441\u0443\u0431\u0430\u0433\u0435\u043d\u0442\u044b\u0420\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 agentLoop() \u2014 \u0441\u0443\u0431\u0430\u0433\u0435\u043d\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0441\u0432\u043e\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e:`js\/\/ \u041f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043econst results = await Promise.all(  parallel.map(desc =&gt; agentLoop(desc)))\/\/ \u0424\u043e\u043d\u043e\u0432\u043econst entry = { done: false, result: null }entry.promise = agentLoop(description).then(result =&gt; {  entry.done = true  entry.result = result})`\u0414\u043b\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0438\u043d\u044a\u0435\u043a\u0446\u0438\u044f: initTaskTool(agentLoop). \u042d\u0442\u043e \u0440\u0435\u0448\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0446\u0438\u043a\u043b\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u2014 task.js \u043d\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442 agent.js.### todo \u2014 \u0437\u0430\u0434\u0430\u0447\u0438 \u0441 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438\u0412\u043d\u0443\u0442\u0440\u0438\u0441\u0435\u0441\u0441\u0438\u043e\u043d\u043d\u044b\u0439 \u0442\u0440\u0435\u043a\u0435\u0440 \u0437\u0430\u0434\u0430\u0447. \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 blockedBy \u2014 \u0437\u0430\u0434\u0430\u0447\u0430 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u0432 in_progress, \u043f\u043e\u043a\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043d\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u044b:`jsif (status === &#171;in_progress&#187; &amp;&amp; isBlocked(todo)) {  const blocking = todo.blockedBy.filter(    depId =&gt; getTodo(depId)?.status !== &#171;done&#187;  )  return Cannot start #${id} \u2014 blocked by: ${blocking.join(&#171;, &#171;)}}`&#8212;## \u0421\u0438\u0441\u0442\u0435\u043c\u0430 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0439\u0422\u0440\u0438 \u0443\u0440\u043e\u0432\u043d\u044f:1. alwaysAllow \u2014 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0431\u0435\u0437 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 (read_file, glob, grep)2. neverAllow \u2014 \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u043d\u0430\u0432\u0441\u0435\u0433\u0434\u04303. \u0418\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u2014 \u0434\u043b\u044f \u0432\u0441\u0435\u0433\u043e \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0433\u043e\u0414\u043b\u044f \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u2014 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438:`\u250c [?] write_file \u2192 src\/utils.js\u2514 [y] \u043e\u0434\u0438\u043d \u0440\u0430\u0437  [d] \u0437\u0430\u043f\u043e\u043c\u043d\u0438\u0442\u044c \u043f\u0430\u043f\u043a\u0443 &#171;src&#187;  [N] \u043e\u0442\u043a\u043b\u043e\u043d\u0438\u0442\u044c:`\u041d\u0430\u0436\u0430\u043b d \u2014 \u043f\u0430\u043f\u043a\u0430 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u0432 .agent\/settings.json. \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0440\u0430\u0437 \u043d\u0435 \u0441\u043f\u0440\u043e\u0441\u0438\u0442.\u0414\u043b\u044f bash \u2014 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430:`\u250c [?] bash: {&#171;command&#187;:&#187;npm test&#187;}\u2514 [y] \u043e\u0434\u0438\u043d \u0440\u0430\u0437  [a] \u0437\u0430\u043f\u043e\u043c\u043d\u0438\u0442\u044c \u0434\u043b\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430  [N] \u043e\u0442\u043a\u043b\u043e\u043d\u0438\u0442\u044c:`\u041d\u0430\u0436\u0430\u043b a \u2014 bash \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 alwaysAllow \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0435.&#8212;## \u041a\u043e\u043c\u043f\u0430\u043a\u0442\u043e\u0440: \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0447\u0435\u0440\u0435\u0437 \u0441\u0443\u043c\u043c\u0430\u0440\u0438\u0437\u0430\u0446\u0438\u044e\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430: \u0443 DeepSeek \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043d\u043e\u0435 \u043e\u043a\u043d\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043e. \u041f\u043e\u0441\u043b\u0435 10\u201315 \u0445\u043e\u0434\u043e\u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f.\u0420\u0435\u0448\u0435\u043d\u0438\u0435: \u043f\u0435\u0440\u0435\u0434 \u043a\u0430\u0436\u0434\u044b\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c \u043a API \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0440\u0430\u0437\u043c\u0435\u0440 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430. \u0415\u0441\u043b\u0438 &gt; 80% \u043b\u0438\u043c\u0438\u0442\u0430 \u2014 \u0441\u0443\u043c\u043c\u0430\u0440\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0432\u0441\u044e \u0438\u0441\u0442\u043e\u0440\u0438\u044e \u0447\u0435\u0440\u0435\u0437 \u0442\u0443 \u0436\u0435 \u043c\u043e\u0434\u0435\u043b\u044c:`jsif (!force &amp;&amp; tokens &lt; contextLimit  0.8) return messages\/\/ \u041e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c system prompt, \u0441\u0443\u043c\u043c\u0430\u0440\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435const summaryResponse = await client.chat.completions.create({  model: getModel(),  messages: [    { role: &#171;system&#187;, content: &#171;Summarize the conversation&#8230;&#187; },    { role: &#171;user&#187;, content: rest.map(m =&gt; [${m.role}]: ${m.content}).join(&#171;\\n&#187;) }  ]})return [system, { role: &#171;user&#187;, content: [Summary]:\\n${summary} },        { role: &#171;assistant&#187;, content: &#171;Understood.&#187; }]`\u041e\u0446\u0435\u043d\u043a\u0430 \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u2014 \u0433\u0440\u0443\u0431\u0430\u044f, \u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442: ~3 \u0441\u0438\u043c\u0432\u043e\u043b\u0430 = 1 \u0442\u043e\u043a\u0435\u043d. Base64-\u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0441\u0447\u0438\u0442\u0430\u044e\u0442\u0441\u044f \u043f\u043e \u0434\u043b\u0438\u043d\u0435 \u0441\u0442\u0440\u043e\u043a\u0438.&#8212;## MCP \u2014 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0439 \u0447\u0443\u0436\u0438\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044bModel Context Protocol \u2014 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 \u043e\u0442 Anthropic \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432. \u041a\u043e\u043d\u0444\u0438\u0433 \u0432 .agent\/settings.json:`json&#187;mcpServers&#187;: {  &#171;fs&#187;: {    &#171;command&#187;: &#171;npx&#187;,    &#171;args&#187;: [&#171;-y&#187;, &#171;@modelcontextprotocol\/server-filesystem&#187;, &#171;\/path&#187;]  }}`\u041f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435 \u0430\u0433\u0435\u043d\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u0447\u0435\u0440\u0435\u0437 stdio, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0438 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442 \u0438\u0445 \u0441 \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u043e\u043c mcp__&lt;server&gt;__&lt;tool&gt;:`jsconst transport = new StdioClientTransport({  command: cfg.command, args: cfg.args ?? []})const client = new Client({ name: &#171;deepseek-agent&#187;, version: &#171;0.1.0&#187; })await client.connect(transport)const { tools: serverTools } = await client.listTools()`\u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b MCP \u043f\u0440\u043e\u0445\u043e\u0434\u044f\u0442 \u0447\u0435\u0440\u0435\u0437 \u0442\u0443 \u0436\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0439.&#8212;## \u041f\u0430\u043c\u044f\u0442\u044c: AGENT.md\u0422\u0440\u0438 \u0443\u0440\u043e\u0432\u043d\u044f \u043f\u0430\u043c\u044f\u0442\u0438, \u0432\u0441\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u044e\u0442\u0441\u044f \u0432 system prompt:| \u0424\u0430\u0439\u043b | \u041d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 ||&#8212;|&#8212;|| ~\/.agent\/AGENT.md | \u0413\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 (\u0441\u0442\u0438\u043b\u044c, \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0435\u043d\u0438\u044f) || .agent\/AGENT.md | \u0418\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 (\u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430, \u0441\u0442\u0435\u043a) || AGENT.md | \u0418\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0432 \u043a\u043e\u0440\u043d\u0435 \u0440\u0435\u043f\u043e |\u042d\u0442\u043e \u0430\u043d\u0430\u043b\u043e\u0433 CLAUDE.md \u0432 Claude Code. \u041c\u043e\u0434\u0435\u043b\u044c \u0432\u0438\u0434\u0438\u0442 \u044d\u0442\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u0434\u0438\u0430\u043b\u043e\u0433\u0435.&#8212;## \u0425\u0443\u043a\u0438: \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0441\u043e \u0441\u0432\u043e\u0438\u043c\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u0430\u043c\u0438.agent\/hooks.json \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c shell-\u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043d\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0430\u0433\u0435\u043d\u0442\u0430:`json{  &#171;PreToolUse&#187;:  [{ &#171;command&#187;: &#171;cat &gt;&gt; agent.log&#187; }],  &#171;PostToolUse&#187;: [],  &#171;Stop&#187;:        []}`PreToolUse \u0441 \u043d\u0435\u043d\u0443\u043b\u0435\u0432\u044b\u043c exit code \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430. Payload \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0447\u0435\u0440\u0435\u0437 stdin \u043a\u0430\u043a JSON \u2014 \u043c\u043e\u0436\u043d\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e \u0438\u043c\u0435\u043d\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430, \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u043c.&#8212;## \u0421\u043b\u0435\u0448-\u043a\u043e\u043c\u0430\u043d\u0434\u044b: 17 \u0448\u0442\u0443\u043a\u0412\u0441\u0451 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u2014 \u0447\u0435\u0440\u0435\u0437 \/-\u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432 \u0447\u0430\u0442\u0435:- \/clear \u2014 \u0441\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442- \/compact \u2014 \u043f\u0440\u0438\u043d\u0443\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u0436\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442-&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-479740","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/479740","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=479740"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/479740\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=479740"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=479740"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=479740"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}