{"id":487320,"date":"2026-07-15T05:10:56","date_gmt":"2026-07-15T05:10:56","guid":{"rendered":"https:\/\/savepearlharbor.com\/?p=487320"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=487320","title":{"rendered":"Claude Code \u0443\u043c\u0435\u0435\u0442 \u0432\u0441\u0451, \u043a\u0440\u043e\u043c\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u2014 \u0441\u043b\u0443\u0448\u0430\u0442\u044c\u0441\u044f \u0432\u0430\u0448\u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443. \u0427\u0438\u043d\u0438\u043c \u044d\u0442\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u043e\u043c ACP"},"content":{"rendered":"<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width \"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/0ed\/779\/6ab\/0ed7796ab0c84c422d221c92df2791bc.png\" alt=\"\u041a\u043e\u0434 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043a\u043e\u0434\u0438\u043d\u0433-\u0430\u0433\u0435\u043d\u0442\u043e\u043c \u043f\u043e ACP\" title=\"\u041a\u043e\u0434 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043a\u043e\u0434\u0438\u043d\u0433-\u0430\u0433\u0435\u043d\u0442\u043e\u043c \u043f\u043e ACP\" width=\"1536\" height=\"1024\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/0ed\/779\/6ab\/0ed7796ab0c84c422d221c92df2791bc.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/0ed\/779\/6ab\/0ed7796ab0c84c422d221c92df2791bc.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u041a\u043e\u0434 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043a\u043e\u0434\u0438\u043d\u0433-\u0430\u0433\u0435\u043d\u0442\u043e\u043c \u043f\u043e ACP<\/figcaption><\/div>\n<\/figure>\n<p>Claude Code, Codex, Gemini CLI \u2014 \u043c\u043e\u0449\u043d\u044b\u0435 \u0448\u0442\u0443\u043a\u0438. \u041d\u043e \u0436\u0438\u0432\u0443\u0442 \u043e\u043d\u0438 \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435: \u0432\u044b \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0435 \u043e\u043a\u043d\u043e, \u043f\u0435\u0447\u0430\u0442\u0430\u0435\u0442\u0435 \u0437\u0430\u0434\u0430\u0447\u0443, \u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435, \u043a\u0430\u043a \u0430\u0433\u0435\u043d\u0442 \u0434\u0443\u043c\u0430\u0435\u0442, \u043b\u0435\u0437\u0435\u0442 \u0432 \u0444\u0430\u0439\u043b\u044b, \u0433\u043e\u043d\u044f\u0435\u0442 \u0442\u0435\u0441\u0442\u044b. \u0414\u043b\u044f \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430 \u2014 \u043e\u0442\u043b\u0438\u0447\u043d\u043e. \u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435, \u0447\u0442\u043e \u0432 \u044d\u0442\u043e \u043a\u0440\u0435\u0441\u043b\u043e \u043f\u0435\u0440\u0435\u0434 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u043e\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0441\u0430\u0434\u0438\u0442\u044c \u043d\u0435 \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430, \u0430 <strong>\u0432\u0430\u0448\u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443<\/strong>: \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0430 \u0441\u0430\u043c\u0430 \u0441\u0442\u0430\u0432\u0438\u043b\u0430 \u0430\u0433\u0435\u043d\u0442\u0443 \u0437\u0430\u0434\u0430\u0447\u0443, \u0432\u0438\u0434\u0435\u043b\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u0435\u0433\u043e \u0448\u0430\u0433 \u0438 \u043c\u043e\u0433\u043b\u0430 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043e\u043f\u0430\u0441\u043d\u043e\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0434\u043e \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043e\u043d\u043e \u0441\u043b\u0443\u0447\u0438\u0442\u0441\u044f.<\/p>\n<p>\u0412\u043e\u0442 \u0442\u0443\u0442 \u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f ACP \u2014 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043b\u044e\u0431\u043e\u043c\u0443 \u043a\u043e\u0434\u0443 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c CLI-\u0430\u0433\u0435\u043d\u0442\u043e\u043c.<\/p>\n<hr\/>\n<h4>TL;DR<\/h4>\n<p><strong>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430: <\/strong>\u0443 CLI-\u043a\u043e\u0434\u0438\u043d\u0433-\u0430\u0433\u0435\u043d\u0442\u043e\u0432 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430, \u0430 \u043d\u0435 \u0434\u043b\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b. \u0425\u043e\u0442\u0438\u0442\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0438\u043c\u0438 \u0438\u0437 \u043a\u043e\u0434\u0430 \u2014 \u0438\u0437\u0432\u043e\u043b\u044c\u0442\u0435 \u043f\u0430\u0440\u0441\u0438\u0442\u044c stdout \u0438 \u043e\u0442\u0432\u0435\u0447\u0430\u0442\u044c \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u00ab\u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443?\u00bb, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435\u043a\u043e\u043c\u0443 \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c.<\/p>\n<p><strong>\u0420\u0435\u0448\u0435\u043d\u0438\u0435: <\/strong>ACP (Agent Client Protocol) \u2014 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 \u00ab\u0445\u043e\u0441\u0442 \u2194 \u043a\u043e\u0434\u0438\u043d\u0433-\u0430\u0433\u0435\u043d\u0442\u00bb. \u0412 AG2 \u043b\u044e\u0431\u043e\u0439 CLI-\u0430\u0433\u0435\u043d\u0442 \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u043e\u0431\u044b\u0447\u043d\u044b\u043c <code>Agent<\/code> \u0432 \u043f\u044f\u0442\u044c \u0441\u0442\u0440\u043e\u043a, \u0430 \u0432\u0441\u0451, \u0447\u0442\u043e \u043e\u043d \u0434\u0435\u043b\u0430\u0435\u0442, \u043f\u0440\u0438\u043b\u0435\u0442\u0430\u0435\u0442 \u043a \u0432\u0430\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u043c\u0438.<\/p>\n<hr\/>\n<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442! \u042f \u0421\u0435\u043c\u0435\u043d \u0424\u0440\u043e\u043b\u043e\u0432 \u2014 \u043a\u043e\u043d\u0442\u0440\u0438\u0431\u044c\u044e\u0442\u043e\u0440 AG2; \u043d\u0435\u0434\u0430\u0432\u043d\u043e \u044f \u0438 \u043f\u0440\u0438\u043d\u0451\u0441 \u0432 \u043d\u0435\u0433\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 ACP, \u043c\u043e\u0434\u0443\u043b\u044c <code>ag2.acp<\/code>. \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c ACP \u043f\u0440\u043e\u0441\u0442\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438: \u043a\u0430\u043a \u043e\u043d \u0443\u0441\u0442\u0440\u043e\u0435\u043d, \u043f\u043e\u0447\u0435\u043c\u0443 \u044d\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u043e \u0438 \u043a\u0430\u043a \u0437\u0430 \u043f\u044f\u0442\u044c \u0441\u0442\u0440\u043e\u043a \u043f\u043e\u0434\u043d\u044f\u0442\u044c Claude Code \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u043c \u0430\u0433\u0435\u043d\u0442\u043e\u043c. \u0410 \u043f\u043e\u0434 \u043a\u043e\u043d\u0435\u0446 \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u043c \u0435\u0433\u043e \u0441\u043b\u0443\u0448\u0430\u0442\u044c\u0441\u044f \u0443\u0434\u0430\u043b\u0451\u043d\u043d\u043e \u2014 \u0433\u043e\u043b\u043e\u0441\u043e\u043c, \u0441 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0445\u043e\u0441\u0442\u0430.<\/p>\n<blockquote>\n<p><strong>\u0421\u0440\u0430\u0437\u0443 \u043f\u0440\u043e \u043f\u0443\u0442\u0430\u043d\u0438\u0446\u0443.<\/strong> \u0410\u0431\u0431\u0440\u0435\u0432\u0438\u0430\u0442\u0443\u0440\u0443 \u00abACP\u00bb \u043d\u043e\u0441\u044f\u0442 \u0434\u0432\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430. \u0415\u0441\u0442\u044c <strong>Agent Communication Protocol<\/strong> \u043e\u0442 IBM (\u0434\u043b\u044f BeeAI, \u043c\u0430\u0440\u0442 2025) \u2014 \u043d\u043e \u0435\u0433\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u043b\u0438 \u0432 Linux Foundation \u0438 <a href=\"https:\/\/lfaidata.foundation\/communityblog\/2025\/08\/29\/acp-joins-forces-with-a2a-under-the-linux-foundations-lf-ai-data\/\" rel=\"noopener noreferrer nofollow\">\u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u043b\u0438 \u0441 A2A<\/a>, \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0441\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u044e\u0442. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 ACP \u2014 \u044d\u0442\u043e \u0432\u0441\u0435\u0433\u0434\u0430 <strong>Agent Client Protocol<\/strong> \u043e\u0442 Zed (<a href=\"https:\/\/agentclientprotocol.com\" rel=\"noopener noreferrer nofollow\">agentclientprotocol.com<\/a>), \u0442\u043e\u0442, \u0447\u0442\u043e \u0436\u0438\u0432\u0451\u0442 \u0438 \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0435\u0442\u0441\u044f.<\/p>\n<\/blockquote>\n<h2>\u041a\u0430\u043a \u0432\u044b \u043e\u0431\u044b\u0447\u043d\u043e \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u0435 \u0441 Claude Code<\/h2>\n<p>\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439: \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b, \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u0447\u0430\u0442, \u0432\u044b \u0432\u043d\u0443\u0442\u0440\u0438 \u0446\u0438\u043a\u043b\u0430. \u041d\u0430\u043f\u0435\u0447\u0430\u0442\u0430\u043b\u0438 \u00ab\u043f\u043e\u0447\u0438\u043d\u0438 \u043f\u0430\u0434\u0430\u044e\u0449\u0438\u0439 \u0442\u0435\u0441\u0442\u00bb \u2014 \u0430\u0433\u0435\u043d\u0442 \u043f\u043e\u0448\u0451\u043b \u0447\u0438\u0442\u0430\u0442\u044c \u0444\u0430\u0439\u043b\u044b, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c pytest, \u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u0434, \u0438 \u0432 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u0440\u043e\u0441\u0438\u0442 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435: \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0432\u043e\u0442 \u044d\u0442\u0443 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0432 \u0448\u0435\u043b\u043b\u0435 \u0438\u043b\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u0440\u0430\u0432\u043a\u0443 \u043a \u0444\u0430\u0439\u043b\u0443? \u0412\u044b \u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u0433\u043b\u0430\u0437\u0430\u043c\u0438, \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442\u0435 \u00ab\u0434\u0430\/\u043d\u0435\u0442\u00bb, \u0438 \u0442\u0430\u043a \u0434\u043e \u043a\u043e\u043d\u0446\u0430.<\/p>\n<p>\u041f\u043e\u043a\u0430 \u0437\u0430 \u0440\u0443\u043b\u0451\u043c \u0447\u0435\u043b\u043e\u0432\u0435\u043a \u2014 \u044d\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u043e. \u0427\u0435\u043b\u043e\u0432\u0435\u043a \u0432\u0438\u0434\u0438\u0442 \u0432\u044b\u0432\u043e\u0434, \u0447\u0435\u043b\u043e\u0432\u0435\u043a \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u0447\u0435\u043b\u043e\u0432\u0435\u043a \u043b\u043e\u0432\u0438\u0442 \u043c\u043e\u043c\u0435\u043d\u0442, \u043a\u043e\u0433\u0434\u0430 \u0430\u0433\u0435\u043d\u0442 \u0441\u043e\u0431\u0440\u0430\u043b\u0441\u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0433\u043b\u0443\u043f\u043e\u0441\u0442\u044c.<\/p>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u0443\u0431\u0435\u0440\u0438\u0442\u0435 \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430 \u0438 \u043f\u043e\u0441\u0430\u0434\u0438\u0442\u0435 \u0437\u0430 \u0440\u0443\u043b\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443. \u0421\u0440\u0430\u0437\u0443 \u0432\u0441\u0451 \u043b\u043e\u043c\u0430\u0435\u0442\u0441\u044f:<\/p>\n<p>&#8212; <strong>\u041d\u0435\u0442 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u0442\u043e\u043a\u0430.<\/strong> \u0410\u0433\u0435\u043d\u0442 \u0441\u044b\u043f\u043b\u0435\u0442 \u0442\u0435\u043a\u0441\u0442 \u0432 stdout \u0432\u043f\u0435\u0440\u0435\u043c\u0435\u0448\u043a\u0443: \u0433\u0434\u0435 \u0442\u0443\u0442 \u00ab\u043c\u044b\u0441\u043b\u044c\u00bb, \u0433\u0434\u0435 \u00ab\u0432\u044b\u0437\u043e\u0432 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u00bb, \u0433\u0434\u0435 \u00ab\u0444\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442\u00bb? \u041f\u0430\u0440\u0441\u0438\u0442\u044c \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043a\u0430\u043c\u0438 \u2014 \u0442\u0443\u043f\u0438\u043a\u043e\u0432\u044b\u0439 \u043f\u0443\u0442\u044c.<\/p>\n<p>&#8212; <strong>\u041d\u0435\u043a\u0443\u0434\u0430 \u0432\u043a\u043b\u0438\u043d\u0438\u0442\u044c\u0441\u044f.<\/strong> \u0410\u0433\u0435\u043d\u0442 \u0441\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0430 \u043e\u043f\u0430\u0441\u043d\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u2014 \u0430 \u043e\u0442\u0432\u0435\u0447\u0430\u0442\u044c-\u0442\u043e \u043d\u0435\u043a\u043e\u043c\u0443. \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435 \u043d\u0443\u0436\u0435\u043d \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u0432\u043e\u043f\u0440\u043e\u0441 \u0438 \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c \u043f\u043e \u0441\u0432\u043e\u0435\u0439 \u043b\u043e\u0433\u0438\u043a\u0435.<\/p>\n<p>&#8212; <strong>\u041d\u0435 \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440.<\/strong> \u0425\u043e\u0447\u0435\u0442\u0441\u044f, \u0447\u0442\u043e\u0431\u044b \u043e\u0434\u0438\u043d \u0430\u0433\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u043a\u043e\u0434, \u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u0435\u0433\u043e \u043e\u0442\u0440\u0435\u0432\u044c\u044e\u0438\u043b \u2014 \u043d\u043e \u0434\u0432\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435 \u0434\u0440\u0443\u0433 \u043e \u0434\u0440\u0443\u0433\u0435 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0437\u043d\u0430\u044e\u0442.<\/p>\n<figure class=\"full-width \"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e5e\/25c\/c7c\/e5e25cc7cc24403c69c8e753c72942d4.png\" alt=\"\u0427\u0435\u043b\u043e\u0432\u0435\u043a \u0443\u0445\u043e\u0434\u0438\u0442 \u043e\u0442 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0430, \u0437\u0430 \u0440\u0443\u043b\u044c \u0441\u0430\u0434\u0438\u0442\u0441\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430\" title=\"\u0427\u0435\u043b\u043e\u0432\u0435\u043a \u0443\u0445\u043e\u0434\u0438\u0442 \u043e\u0442 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0430, \u0437\u0430 \u0440\u0443\u043b\u044c \u0441\u0430\u0434\u0438\u0442\u0441\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430\" width=\"1024\" height=\"1024\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/e5e\/25c\/c7c\/e5e25cc7cc24403c69c8e753c72942d4.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e5e\/25c\/c7c\/e5e25cc7cc24403c69c8e753c72942d4.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u0427\u0435\u043b\u043e\u0432\u0435\u043a \u0443\u0445\u043e\u0434\u0438\u0442 \u043e\u0442 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0430, \u0437\u0430 \u0440\u0443\u043b\u044c \u0441\u0430\u0434\u0438\u0442\u0441\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430<\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b \u2014 \u044d\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430, \u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435 \u043d\u0443\u0436\u0435\u043d \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b. \u041a\u043e\u043d\u0442\u0440\u0430\u043a\u0442. \u0418\u043c \u0438 \u0441\u0442\u0430\u043b ACP.<\/p>\n<h2>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 ACP, \u0435\u0441\u043b\u0438 \u0432 \u0434\u0432\u0443\u0445 \u0441\u043b\u043e\u0432\u0430\u0445<\/h2>\n<p>\u041b\u0443\u0447\u0448\u0430\u044f \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u044f \u2014 <strong>LSP<\/strong>, Language Server Protocol. \u0414\u043e LSP \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u0442\u0430\u0449\u0438\u043b \u0441\u0432\u043e\u044e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430: \u0430\u0432\u0442\u043e\u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 Python \u0432 Vim, \u0432 Emacs, \u0432 Sublime \u2014 \u0442\u0440\u0438 \u0440\u0430\u0437\u043d\u044b\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u0438 \u0442\u043e\u0433\u043e \u0436\u0435. LSP \u044d\u0442\u043e \u0440\u0430\u0437\u0432\u044f\u0437\u0430\u043b: \u044f\u0437\u044b\u043a \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u043e\u0434\u0438\u043d \u0441\u0435\u0440\u0432\u0435\u0440, \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0430, \u0438 <code>N<\/code> \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u043e\u0432 \u00d7 <code>M<\/code> \u044f\u0437\u044b\u043a\u043e\u0432 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u044e\u0442\u0441\u044f \u0438\u0437 <code>N\u00d7M<\/code> \u043a\u043e\u0441\u0442\u044b\u043b\u0435\u0439 \u0432 <code>N+M<\/code>.<\/p>\n<p>ACP \u0434\u0435\u043b\u0430\u0435\u0442 \u0440\u043e\u0432\u043d\u043e \u0442\u043e \u0436\u0435 \u2014 \u043d\u043e \u0434\u043b\u044f \u043a\u043e\u0434\u0438\u043d\u0433-\u0430\u0433\u0435\u043d\u0442\u043e\u0432. \u041f\u043e \u043e\u0434\u043d\u0443 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 <strong>\u0445\u043e\u0441\u0442<\/strong> (\u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u0438\u043b\u0438 \u0432\u0430\u0448 \u043a\u043e\u0434), \u043f\u043e \u0434\u0440\u0443\u0433\u0443\u044e \u2014 <strong>\u0430\u0433\u0435\u043d\u0442<\/strong>, \u0430 \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438 \u0435\u0434\u0438\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442. \u041d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u0430\u0433\u0435\u043d\u0442\u0430 \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u2014 \u0438 \u043e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432 \u043b\u044e\u0431\u043e\u043c ACP-\u0445\u043e\u0441\u0442\u0435, \u0431\u0435\u0437 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043d\u0438\u043a\u0430 \u043f\u043e\u0434 \u043a\u0430\u0436\u0434\u044b\u0439.<\/p>\n<figure class=\"full-width \"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/eca\/097\/3e2\/eca0973e2ce16448a119ffea9c7f63b8.png\" alt=\"\u041e\u0434\u0438\u043d \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u0432\u043c\u0435\u0441\u0442\u043e N\u00d7M \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0439\" title=\"\u041e\u0434\u0438\u043d \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u0432\u043c\u0435\u0441\u0442\u043e N\u00d7M \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0439\" width=\"1024\" height=\"1024\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/eca\/097\/3e2\/eca0973e2ce16448a119ffea9c7f63b8.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/eca\/097\/3e2\/eca0973e2ce16448a119ffea9c7f63b8.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u041e\u0434\u0438\u043d \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u0432\u043c\u0435\u0441\u0442\u043e N\u00d7M \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0439<\/figcaption><\/div>\n<\/figure>\n<p>\u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0444\u0430\u043a\u0442\u043e\u0432, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u043a\u0438\u043d\u0443\u0442\u044c \u0437\u0440\u0435\u043b\u043e\u0441\u0442\u044c:<\/p>\n<p>&#8212; <strong>\u0410\u0432\u0433\u0443\u0441\u0442 2025<\/strong> \u2014 Zed \u0432\u044b\u043a\u0430\u0442\u044b\u0432\u0430\u0435\u0442 ACP. \u0422\u043e\u043b\u0447\u043a\u043e\u043c \u0441\u0442\u0430\u043b Google: \u043f\u0440\u0438\u0448\u0451\u043b \u0441\u043e \u0441\u0432\u043e\u0438\u043c Gemini CLI, \u0438 \u043e\u0431\u0435\u0438\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0433\u043b\u0443\u0431\u0436\u0435, \u0447\u0435\u043c \u00ab\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0442\u0443\u043b\u0437\u0443 \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435\u00bb.<\/p>\n<p>&#8212; \u041f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 (Apache-2.0), \u0432\u044b\u043d\u0435\u0441\u0435\u043d \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u044e <a href=\"https:\/\/github.com\/agentclientprotocol\" rel=\"noopener noreferrer nofollow\">github.com\/agentclientprotocol<\/a>.<\/p>\n<p>&#8212; \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u043e\u0432 \u2014 Zed, JetBrains, VS Code, Neovim, Emacs; \u0432 \u0440\u0435\u0435\u0441\u0442\u0440\u0435 \u0443\u0436\u0435 \u043f\u043e\u0447\u0442\u0438 \u043f\u043e\u043b\u0441\u043e\u0442\u043d\u0438 \u0430\u0433\u0435\u043d\u0442\u043e\u0432: Claude Code, Codex CLI, Copilot CLI, Gemini CLI, OpenCode \u0438 \u0434\u0440\u0443\u0433\u0438\u0435.<\/p>\n<p>\u0422\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0441\u0451 \u043f\u0440\u043e\u0441\u0442\u043e: <strong>JSON-RPC 2.0 \u043f\u043e\u0432\u0435\u0440\u0445 stdio<\/strong>. \u0425\u043e\u0441\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0430\u0433\u0435\u043d\u0442\u0430 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u043c \u0438 \u043e\u0431\u0449\u0430\u0435\u0442\u0441\u044f \u0441 \u043d\u0438\u043c \u0447\u0435\u0440\u0435\u0437 stdin\/stdout. \u041d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u0441\u0435\u0442\u0435\u0432\u043e\u0433\u043e \u0441\u043b\u043e\u044f, \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u043f\u043e\u0440\u0442\u043e\u0432 \u2014 \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u0432\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0438 \u043e\u0434\u0438\u043d \u043a\u0430\u043d\u0430\u043b.<\/p>\n<pre><code>        \u0432\u0430\u0448 \u043a\u043e\u0434 (ACP-\u043a\u043b\u0438\u0435\u043d\u0442 \/ \u0445\u043e\u0441\u0442)                  \u2502                  \u2502  \u0441\u043f\u0430\u0432\u043d\u0438\u0442 subprocess                  \u25bc        \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510        \u2502  claude-agent-acp     \u2502   \u2190 ACP-\u0430\u0433\u0435\u043d\u0442        \u2502  (Claude Code \u0432\u043d\u0443\u0442\u0440\u0438) \u2502        \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518                  \u25b2                  \u2502  JSON-RPC 2.0 \u043f\u043e\u0432\u0435\u0440\u0445 stdin\/stdout                  \u25bc        \u043f\u0440\u043e\u043c\u043f\u0442\u044b  \u2192   \u2190 \u043f\u043e\u0442\u043e\u043a \u0441\u043e\u0431\u044b\u0442\u0438\u0439 (\u043c\u044b\u0441\u043b\u0438, tool-calls, \u043f\u043b\u0430\u043d\u2026)<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:87px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0417\u0430\u043f\u043e\u043c\u043d\u0438\u0442\u0435 \u0440\u043e\u043b\u0438: <strong>\u043a\u043b\u0438\u0435\u043d\u0442<\/strong> \u2014 \u044d\u0442\u043e \u0445\u043e\u0441\u0442, \u0442\u043e\u0442, \u043a\u0442\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442. <strong>\u0410\u0433\u0435\u043d\u0442<\/strong> \u2014 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0445\u043e\u0434\u0438\u0442 \u0432 LLM \u0438 \u0434\u0435\u043b\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0443. \u0414\u0430\u043b\u044c\u0448\u0435 \u0432\u0441\u0451 \u0432\u043e\u043a\u0440\u0443\u0433 \u044d\u0442\u043e\u0439 \u043f\u0430\u0440\u044b.<\/p>\n<blockquote>\n<p>\u0422\u0443\u0442 \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044c \u0441\u043f\u0440\u043e\u0441\u0438\u0442: \u0430 \u0437\u0430\u0447\u0435\u043c \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b, \u0435\u0441\u043b\u0438 \u0443 Claude Code \u0435\u0441\u0442\u044c \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 Claude Agent SDK \u0438 headless-\u0440\u0435\u0436\u0438\u043c, \u0443 Codex \u2014 \u0441\u0432\u043e\u0439 SDK? \u041e\u0442\u0432\u0435\u0442 \u0442\u043e\u0442 \u0436\u0435, \u0447\u0442\u043e \u0438 \u0443 LSP. \u041d\u0430\u043f\u0438\u0448\u0435\u0442\u0435 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e \u043d\u0430 Claude Agent SDK \u2014 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e \u0441 Claude Code, \u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u043d\u0438\u043c. \u0417\u0430\u0445\u043e\u0442\u0438\u0442\u0435 \u0437\u0430\u0432\u0442\u0440\u0430 \u043f\u0440\u043e\u0433\u043d\u0430\u0442\u044c \u0442\u0443 \u0436\u0435 \u0437\u0430\u0434\u0430\u0447\u0443 \u0447\u0435\u0440\u0435\u0437 Codex \u0438\u043b\u0438 OpenCode \u2014 \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u044b\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0434 \u0432\u0442\u043e\u0440\u043e\u0439 SDK, \u043f\u043e\u0442\u043e\u043c \u043f\u043e\u0434 \u0442\u0440\u0435\u0442\u0438\u0439. ACP \u2014 \u044d\u0442\u043e \u043e\u0434\u0438\u043d \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 \u043d\u0430 \u0432\u0441\u0435\u0445: \u043a\u043e\u0434 \u0445\u043e\u0441\u0442\u0430 \u043d\u0435 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f, \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0430\u0433\u0435\u043d\u0442\u0430. \u041f\u043b\u044e\u0441 SDK \u0440\u0435\u0448\u0430\u0435\u0442 \u0437\u0430\u0434\u0430\u0447\u0443 \u00ab\u043c\u043e\u0439 \u043a\u043e\u0434 \u0434\u0451\u0440\u0433\u0430\u0435\u0442 \u0430\u0433\u0435\u043d\u0442\u0430\u00bb, \u0430 ACP \u0437\u0430\u043e\u0434\u043d\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0442\u043e, \u0447\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u0437\u043e\u0431\u0440\u0435\u0442\u0430\u0442\u044c \u0441\u0430\u043c\u043e\u043c\u0443: \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0439, \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0447\u0435\u0440\u0435\u0437 \u0445\u043e\u0441\u0442, \u0444\u043e\u0440\u043c\u0430\u0442 \u043f\u043e\u0442\u043e\u043a\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u0439.<\/p>\n<\/blockquote>\n<h2>\u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440: Claude Code \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u0430\u0433\u0435\u043d\u0442<\/h2>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u2014 \u043a\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0438\u0437 \u043a\u043e\u0434\u0430. \u0412\u043e\u0442 \u043a\u0430\u043a \u0432 AG2 \u043f\u043e\u0434\u043d\u044f\u0442\u044c Claude Code \u0438 \u0434\u0430\u0442\u044c \u0435\u043c\u0443 \u0437\u0430\u0434\u0430\u0447\u0443:<\/p>\n<pre><code class=\"python\">from ag2 import Agentfrom ag2.acp import ClaudeCodeConfigagent = Agent(\"coder\", config=ClaudeCodeConfig(cwd=\"\/path\/to\/repo\"))reply = await agent.ask(\"\u041e\u0442\u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438 \u043c\u043e\u0434\u0443\u043b\u044c auth \u0438 \u0434\u043e\u0431\u0430\u0432\u044c \u0442\u0435\u0441\u0442\u044b\")print(reply.body)<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041f\u044f\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0441\u0442\u0440\u043e\u043a. \u041d\u0438 \u0441\u043b\u043e\u0432\u0430 \u043f\u0440\u043e subprocess, JSON-RPC \u0438\u043b\u0438 stdio. \u0410 \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0432\u0441\u0451, \u0447\u0442\u043e \u043c\u044b \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u043b\u0438: <code>ClaudeCodeConfig<\/code> \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b \u0430\u0434\u0430\u043f\u0442\u0435\u0440 <code>claude-agent-acp<\/code> \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u043c, \u0441\u0434\u0435\u043b\u0430\u043b \u0440\u0443\u043a\u043e\u043f\u043e\u0436\u0430\u0442\u0438\u0435, \u0441\u043e\u0437\u0434\u0430\u043b \u0441\u0435\u0441\u0441\u0438\u044e, \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b \u0432\u0430\u0448 \u043f\u0440\u043e\u043c\u043f\u0442 \u0438 \u0434\u043e\u0436\u0434\u0430\u043b\u0441\u044f \u043e\u0442\u0432\u0435\u0442\u0430.<\/p>\n<p>\u041e\u0434\u0438\u043d <code>ask()<\/code> (\u0438\u043b\u0438 <code>run()<\/code>) \u2014 \u044d\u0442\u043e \u043e\u0434\u0438\u043d <strong>prompt-turn<\/strong> \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u0445 ACP. \u0412\u043d\u0443\u0442\u0440\u0438 \u043d\u0435\u0433\u043e \u0443 \u0430\u0433\u0435\u043d\u0442\u0430 \u043a\u0440\u0443\u0442\u0438\u0442\u0441\u044f \u0435\u0433\u043e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0446\u0438\u043a\u043b \u00ab\u043f\u043e\u0434\u0443\u043c\u0430\u043b \u2192 \u0432\u044b\u0437\u0432\u0430\u043b \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u2192 \u043f\u043e\u0447\u0438\u0442\u0430\u043b \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u2192 \u043f\u043e\u0448\u0451\u043b \u0434\u0430\u043b\u044c\u0448\u0435\u00bb, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u0443\u0436\u043d\u043e. \u0412\u0430\u043c \u043d\u0430\u0440\u0443\u0436\u0443 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442, \u0430 \u0432\u0435\u0441\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u043e \u0434\u043e\u0440\u043e\u0433\u0435 \u2014 \u043f\u043e\u0442\u043e\u043a\u043e\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u0439 (\u043e\u0431 \u044d\u0442\u043e\u043c \u2014 \u043d\u0438\u0436\u0435).<\/p>\n<p>\u0421\u043c\u0435\u043d\u0438\u0442\u044c \u0434\u0432\u0438\u0436\u043e\u043a \u2014 \u044d\u0442\u043e \u0441\u043c\u0435\u043d\u0438\u0442\u044c config, \u043a\u043e\u0434 \u0432\u043e\u043a\u0440\u0443\u0433 \u043d\u0435 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f:<\/p>\n<pre><code class=\"python\">from ag2.acp import CodexConfig, OpenCodeConfigagent = Agent(\"coder\", config=CodexConfig(cwd=\"\/path\/to\/repo\"))     # Codexagent = Agent(\"coder\", config=OpenCodeConfig(cwd=\"\/path\/to\/repo\"))  # OpenCode<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0422\u0443\u0442 \u0441\u0442\u043e\u0438\u0442 \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0430\u0436\u043d\u043e\u0435: \u00ab\u0437\u0430\u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u043f\u043e ACP\u00bb \u0430\u0433\u0435\u043d\u0442\u044b \u0443\u043c\u0435\u044e\u0442 \u043f\u043e-\u0440\u0430\u0437\u043d\u043e\u043c\u0443. <strong>OpenCode \u0438 Gemini CLI \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 ACP \u0441\u0430\u043c\u0438<\/strong> \u2014 \u0443 \u043d\u0438\u0445 \u0435\u0441\u0442\u044c \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u0440\u0435\u0436\u0438\u043c (<code>opencode acp<\/code>, \u0444\u043b\u0430\u0433 <code>--acp<\/code>). \u0410 \u0432\u043e\u0442 <strong>Claude Code \u0438 Codex \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e ACP \u043d\u0435 \u0433\u043e\u0432\u043e\u0440\u044f\u0442<\/strong> \u2014 \u0434\u043b\u044f \u043d\u0438\u0445 \u0435\u0441\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u044b-\u043e\u0431\u0451\u0440\u0442\u043a\u0438 (<code>claude-agent-acp<\/code>, <code>codex-acp<\/code>): \u0441\u043d\u0430\u0440\u0443\u0436\u0438 \u043e\u043d\u0438 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0442 ACP, \u0430 \u0432\u043d\u0443\u0442\u0440\u044c \u0434\u0451\u0440\u0433\u0430\u044e\u0442 \u0430\u0433\u0435\u043d\u0442\u0430 \u043d\u0430 \u0435\u0433\u043e \u00ab\u0440\u043e\u0434\u043d\u043e\u043c\u00bb \u044f\u0437\u044b\u043a\u0435. \u041d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0432\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u0434\u0430 \u0440\u0430\u0437\u043d\u0438\u0446\u044b \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u2014 \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043a\u043e\u043d\u0444\u0438\u0433 \u0432 AG2 \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u043d\u0430\u0435\u0442, \u043a\u0430\u043a\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c; \u0432\u0441\u043f\u043b\u044b\u0432\u0451\u0442 \u043e\u043d\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435.<\/p>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u0442\u0430\u0432\u0438\u043c \u0434\u0432\u0435 \u0432\u0435\u0449\u0438: \u0441\u0430\u043c \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0447\u0435\u0440\u0435\u0437 extra \u0438 \u043d\u0443\u0436\u043d\u044b\u0439 CLI-\u0430\u0433\u0435\u043d\u0442 \u0438\u043b\u0438 \u0435\u0433\u043e \u0430\u0434\u0430\u043f\u0442\u0435\u0440 (\u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b \u043b\u0435\u0436\u0430\u043b \u043d\u0430 <code>PATH<\/code>):<\/p>\n<pre><code class=\"bash\">pip install \"ag2[acp]\"                                 # \u043c\u043e\u0434\u0443\u043b\u044c AG2npm install -g @agentclientprotocol\/claude-agent-acp   # \u0430\u0434\u0430\u043f\u0442\u0435\u0440 \u0434\u043b\u044f Claude Codenpm install -g @agentclientprotocol\/codex-acp          # \u0430\u0434\u0430\u043f\u0442\u0435\u0440 \u0434\u043b\u044f Codex<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<h2>\u0412\u0438\u0434\u043d\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0448\u0430\u0433: \u0442\u0438\u043f\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0442\u043e\u043a \u0441\u043e\u0431\u044b\u0442\u0438\u0439<\/h2>\n<p>\u0412 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435 \u0440\u0430\u0431\u043e\u0442\u0430 \u0430\u0433\u0435\u043d\u0442\u0430 \u2014 \u044d\u0442\u043e \u0431\u0435\u0433\u0443\u0449\u0438\u0439 \u0442\u0435\u043a\u0441\u0442. \u0427\u0435\u0440\u0435\u0437 ACP \u043e\u043d\u0430 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0432 <strong>\u0442\u0438\u043f\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0442\u043e\u043a \u0441\u043e\u0431\u044b\u0442\u0438\u0439<\/strong>, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f.<\/p>\n<figure class=\"full-width \"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/3dc\/2ad\/50e\/3dc2ad50ed5cfff0f9721748addce119.png\" alt=\"\u0420\u0430\u0431\u043e\u0442\u0430 \u0430\u0433\u0435\u043d\u0442\u0430 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c\u044b\u043c \u043f\u043e\u0442\u043e\u043a\u043e\u043c \u0442\u0438\u043f\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u0439\" title=\"\u0420\u0430\u0431\u043e\u0442\u0430 \u0430\u0433\u0435\u043d\u0442\u0430 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c\u044b\u043c \u043f\u043e\u0442\u043e\u043a\u043e\u043c \u0442\u0438\u043f\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u0439\" width=\"1024\" height=\"1024\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/3dc\/2ad\/50e\/3dc2ad50ed5cfff0f9721748addce119.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/3dc\/2ad\/50e\/3dc2ad50ed5cfff0f9721748addce119.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u0420\u0430\u0431\u043e\u0442\u0430 \u0430\u0433\u0435\u043d\u0442\u0430 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c\u044b\u043c \u043f\u043e\u0442\u043e\u043a\u043e\u043c \u0442\u0438\u043f\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u0439<\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c\u0441\u044f \u043d\u0430 \u0441\u0442\u0440\u0438\u043c \u043f\u0440\u043e\u0433\u043e\u043d\u0430 \u0438 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043f\u043e \u0442\u0438\u043f\u0430\u043c:<\/p>\n<pre><code class=\"python\">from ag2 import Agentfrom ag2.acp import ClaudeCodeConfigfrom ag2.events import ModelMessageChunk, ModelReasoningfrom ag2.events.tool_events import BuiltinToolCallEventfrom ag2.acp.events import ACPPlanagent = Agent(\"coder\", config=ClaudeCodeConfig(cwd=\"\/path\/to\/repo\"))def observe(event):    if isinstance(event, ModelReasoning):        print(\"\ud83d\udcad\", event.content)              # \u0430\u0433\u0435\u043d\u0442 \u0434\u0443\u043c\u0430\u0435\u0442    elif isinstance(event, ModelMessageChunk):        print(event.content, end=\"\")            # \u0442\u0435\u043a\u0441\u0442 \u043e\u0442\u0432\u0435\u0442\u0430 \u043f\u043e \u043a\u0443\u0441\u043a\u0430\u043c    elif isinstance(event, BuiltinToolCallEvent):        print(f\"\ud83d\udd27 {event.name}({event.arguments})\") # \u043f\u043e\u0448\u0451\u043b \u0432 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430    elif isinstance(event, ACPPlan):        for step in event.entries:            print(f\"  [{step.status}] {step.content}\")  # \u043f\u043b\u0430\u043d \u0440\u0430\u0431\u043e\u0442\u044basync with agent.run(\"\u0414\u043e\u0431\u0430\u0432\u044c healthcheck-\u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\") as run:    run.stream.subscribe(observe)   # \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f \u0434\u043e \u0441\u0442\u0430\u0440\u0442\u0430    reply = await run.result()<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041a\u0430\u0436\u0434\u044b\u0439 \u0442\u0438\u043f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0432 ACP \u043b\u043e\u0436\u0438\u0442\u0441\u044f \u043d\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 AG2:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"370\" width=\"370\">\n<p align=\"center\"><strong>\u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 ACP<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>\u0421\u043e\u0431\u044b\u0442\u0438\u0435 AG2<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"370\" width=\"370\">\n<p align=\"left\">\u0442\u0435\u043a\u0441\u0442 \u0430\u0433\u0435\u043d\u0442\u0430<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>ModelMessageChunk<\/code> \u2192 \u0438\u0442\u043e\u0433\u043e\u0432\u044b\u0439 <code>ModelResponse<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"370\" width=\"370\">\n<p align=\"left\">\u0440\u0430\u0437\u043c\u044b\u0448\u043b\u0435\u043d\u0438\u044f<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>ModelReasoning<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"370\" width=\"370\">\n<p align=\"left\">\u0432\u044b\u0437\u043e\u0432 \/ \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>BuiltinToolCallEvent<\/code> \/ <code>BuiltinToolResultEvent<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"370\" width=\"370\">\n<p align=\"left\">\u043f\u043b\u0430\u043d \u0440\u0430\u0431\u043e\u0442\u044b<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>ACPPlan<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"370\" width=\"370\">\n<p align=\"left\">\u0441\u043c\u0435\u043d\u0430 \u0440\u0435\u0436\u0438\u043c\u0430<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>ACPModeChange<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"370\" width=\"370\">\n<p align=\"left\">\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>ACPAvailableCommands<\/code><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u00ab\u0427\u0451\u0440\u043d\u044b\u0439 \u044f\u0449\u0438\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0447\u0442\u043e-\u0442\u043e \u043f\u0435\u0447\u0430\u0442\u0430\u0435\u0442 \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u00bb \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441: \u043c\u043e\u0436\u043d\u043e \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u043e\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435, \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0438\u0437 \u043d\u0435\u0433\u043e UI, \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0442\u043e\u043a\u0435\u043d\u044b, \u043b\u043e\u0432\u0438\u0442\u044c \u043c\u043e\u043c\u0435\u043d\u0442, \u043a\u043e\u0433\u0434\u0430 \u0430\u0433\u0435\u043d\u0442 \u043f\u043e\u043b\u0435\u0437 \u043d\u0435 \u0442\u0443\u0434\u0430. \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043d\u0430\u043a\u043e\u043d\u0435\u0446 <em>\u0432\u0438\u0434\u0438\u0442<\/em>, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u0430\u0433\u0435\u043d\u0442, \u2014 \u0430 \u043d\u0435 \u043f\u0430\u0440\u0441\u0438\u0442 \u0435\u0433\u043e \u0432\u044b\u0432\u043e\u0434.<\/p>\n<h2>\u041f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c: \u0440\u0443\u043a\u043e\u043f\u043e\u0436\u0430\u0442\u0438\u0435 \u0438 \u0436\u0438\u0437\u043d\u044c \u0441\u0435\u0441\u0441\u0438\u0438<\/h2>\n<p>\u0415\u0441\u043b\u0438 \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u00ab\u043c\u0430\u0433\u0438\u044e\u00bb \u0438\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u043e\u0431\u043c\u0435\u043d \u043f\u043e ACP \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code>\u250c\u2500 \u0425\u043e\u0441\u0442 (\u0432\u0430\u0448 \u043a\u043e\u0434) \u2500\u2510                          \u250c\u2500 \u0410\u0433\u0435\u043d\u0442 (subprocess) \u2500\u2510\u2502                  \u2502   initialize             \u2502                      \u2502\u2502                  \u2502 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u25ba \u2502  \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043b\u0438         \u2502\u2502                  \u2502 \u25c4\u2500\u2500\u2500\u2500\u2500 capabilities \u2500\u2500\u2500\u2500 \u2502  \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438         \u2502\u2502                  \u2502                          \u2502                      \u2502\u2502                  \u2502   session\/new (cwd, \u2026)   \u2502                      \u2502\u2502                  \u2502 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u25ba \u2502  \u0437\u0430\u0432\u0435\u043b\u0438 \u0441\u0435\u0441\u0441\u0438\u044e       \u2502\u2502                  \u2502 \u25c4\u2500\u2500\u2500\u2500 session_id \u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2502                      \u2502\u2502                  \u2502                          \u2502                      \u2502\u2502                  \u2502   session\/prompt         \u2502                      \u2502\u2502                  \u2502 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u25ba \u2502 \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \u2502\u2502                  \u2502                          \u2502 \u2502 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u0446\u0438\u043a\u043b  \u2502 \u2502\u2502                  \u2502 \u25c4\u2550 session\/update \u2550\u2550\u2550\u2550\u2550\u2550 \u2502 \u2502 \u0430\u0433\u0435\u043d\u0442\u0430: \u0434\u0443\u043c\u0430\u0435\u0442,  \u2502 \u2502\u2502                  \u2502 \u25c4\u2550 session\/update \u2550\u2550\u2550\u2550\u2550\u2550 \u2502 \u2502 \u0437\u043e\u0432\u0451\u0442 tools,     \u2502 \u2502\u2502                  \u2502 \u25c4\u2550 session\/update \u2550\u2550\u2550\u2550\u2550\u2550 \u2502 \u2502 \u043f\u0438\u0448\u0435\u0442 \u0444\u0430\u0439\u043b\u044b\u2026     \u2502 \u2502\u2502                  \u2502                          \u2502 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2502\u2502                  \u2502 \u25c4\u2500\u2500\u2500\u2500 stop_reason \u2500\u2500\u2500\u2500\u2500\u2500 \u2502  turn \u0437\u0430\u0432\u0435\u0440\u0448\u0451\u043d       \u2502\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518                          \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 <code>initialize<\/code> \u2014 \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u0441\u0432\u0435\u0440\u044f\u044e\u0442, \u043a\u0442\u043e \u0447\u0442\u043e \u0443\u043c\u0435\u0435\u0442 (\u044d\u0442\u043e \u0438 \u0435\u0441\u0442\u044c \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439). \u041f\u043e\u0442\u043e\u043c <code>session\/new<\/code> \u0437\u0430\u0432\u043e\u0434\u0438\u0442 \u0441\u0435\u0441\u0441\u0438\u044e \u0441 \u0440\u0430\u0431\u043e\u0447\u0435\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0435\u0439. \u0414\u0430\u043b\u044c\u0448\u0435 \u043a\u0430\u0436\u0434\u044b\u0439 \u0432\u0430\u0448 <code>ask()<\/code> \u2014 \u044d\u0442\u043e <code>session\/prompt<\/code>, \u0432 \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u044b\u043f\u043b\u044e\u0442\u0441\u044f <code>session\/update<\/code> (\u0442\u0435 \u0441\u0430\u043c\u044b\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0438\u0437 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u0441\u0435\u043a\u0446\u0438\u0438), \u043f\u043e\u043a\u0430 turn \u043d\u0435 \u0434\u043e\u0439\u0434\u0451\u0442 \u0434\u043e <code>stop_reason<\/code>.<\/p>\n<p>\u0418 \u0435\u0449\u0451 \u043e\u0434\u043d\u0430 \u043f\u0440\u0438\u044f\u0442\u043d\u0430\u044f \u0434\u0435\u0442\u0430\u043b\u044c: subprocess <strong>\u0441\u043f\u0430\u0432\u043d\u0438\u0442\u0441\u044f \u043b\u0435\u043d\u0438\u0432\u043e, \u043d\u0430 \u043f\u0435\u0440\u0432\u043e\u043c turn, \u0438 \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f<\/strong> \u043d\u0430 \u0432\u0435\u0441\u044c \u043f\u0440\u043e\u0433\u043e\u043d \u2014 \u0441\u0435\u0441\u0441\u0438\u044f \u0436\u0438\u0432\u0451\u0442, \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u043a\u043e\u043f\u0438\u0442\u0441\u044f, \u0437\u0430\u043d\u043e\u0432\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043d\u0435 \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f.<\/p>\n<h2>\u0420\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0438 human-in-the-loop<\/h2>\n<p>\u0412\u0435\u0440\u043d\u0451\u043c\u0441\u044f \u043a \u0442\u043e\u043c\u0443 \u0441\u0430\u043c\u043e\u043c\u0443 \u00ab\u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u044d\u0442\u0443 \u043a\u043e\u043c\u0430\u043d\u0434\u0443?\u00bb. \u041a\u043e\u0433\u0434\u0430 \u0430\u0433\u0435\u043d\u0442 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0447\u0443\u0432\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u2014 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0432 \u0448\u0435\u043b\u043b\u0435, \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u0444\u0430\u0439\u043b \u2014 \u043f\u043e ACP \u043e\u043d \u0448\u043b\u0451\u0442 \u0445\u043e\u0441\u0442\u0443 <strong>\u0437\u0430\u043f\u0440\u043e\u0441 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f<\/strong>. \u0418 \u0432\u043e\u0442 \u0442\u0443\u0442 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0440\u043e\u0432\u043d\u043e \u0442\u0443 \u0432\u043b\u0430\u0441\u0442\u044c, \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0435 \u0431\u044b\u043b\u043e \u0432 \u0433\u043e\u043b\u043e\u043c \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435: \u0440\u0435\u0448\u0438\u0442\u044c, \u0447\u0442\u043e \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c. <\/p>\n<figure class=\"full-width \"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/806\/8bc\/a97\/8068bca976a6926e827eed6d4a5cb033.png\" alt=\"\u0425\u043e\u0441\u0442 \u0440\u0435\u0448\u0430\u0435\u0442: ask, auto \u0438\u043b\u0438 deny\" title=\"\u0425\u043e\u0441\u0442 \u0440\u0435\u0448\u0430\u0435\u0442: ask, auto \u0438\u043b\u0438 deny\" width=\"1024\" height=\"1024\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/806\/8bc\/a97\/8068bca976a6926e827eed6d4a5cb033.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/806\/8bc\/a97\/8068bca976a6926e827eed6d4a5cb033.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u0425\u043e\u0441\u0442 \u0440\u0435\u0448\u0430\u0435\u0442: ask, auto \u0438\u043b\u0438 deny<\/figcaption><\/div>\n<\/figure>\n<p>\u0417\u0430 \u044d\u0442\u043e \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 <code>permission_policy<\/code>:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p align=\"center\"><strong>\u041f\u043e\u043b\u0438\u0442\u0438\u043a\u0430<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>\u0427\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><code>\"ask\"<\/code> (\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e)<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0441\u043f\u0440\u043e\u0441\u0438\u0442\u044c \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430 \u2014 \u0447\u0435\u0440\u0435\u0437 <code>hitl_hook<\/code> \/ <code>context.input<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><code>\"auto\"<\/code> <\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0440\u0430\u0437\u0440\u0435\u0448\u0430\u0442\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 (\u0430\u0432\u0442\u043e\u043d\u043e\u043c\u043d\u044b\u0439 \u043f\u0440\u043e\u0433\u043e\u043d)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><code>\"deny\"<\/code> <\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0437\u0430\u043f\u0440\u0435\u0449\u0430\u0442\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<pre><code class=\"python\">agent = Agent(    \"coder\",    config=ClaudeCodeConfig(        cwd=\"\/repo\",         permission_policy=\"auto\",  # \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0430\u0432\u0442\u043e\u043d\u043e\u043c\u043d\u043e    ),)<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<h2>\u041f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0430: \u0444\u0430\u0439\u043b\u044b \u0438 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b \u043f\u043e\u0434 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0435\u043c \u0445\u043e\u0441\u0442\u0430<\/h2>\n<p>\u0415\u0449\u0451 \u043e\u0434\u0438\u043d \u043d\u044e\u0430\u043d\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435 \u043d\u0435\u0437\u0430\u043c\u0435\u0442\u0435\u043d, \u0430 \u0438\u0437 \u043a\u043e\u0434\u0430 \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u043d: \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0441 \u0444\u0430\u0439\u043b\u0430\u043c\u0438 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a \u043a\u043e\u043c\u0430\u043d\u0434 \u0430\u0433\u0435\u043d\u0442 \u0434\u0435\u043b\u0430\u0435\u0442 <strong>\u043d\u0435 \u0441\u0430\u043c \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e<\/strong>, \u0430 \u043f\u0440\u043e\u0441\u0438\u0442 \u043e\u0431 \u044d\u0442\u043e\u043c \u0445\u043e\u0441\u0442. \u0422\u043e \u0435\u0441\u0442\u044c \u0447\u0442\u0435\u043d\u0438\u0435\/\u0437\u0430\u043f\u0438\u0441\u044c \u0444\u0430\u0439\u043b\u0430 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043f\u0440\u043e\u0445\u043e\u0434\u044f\u0442 \u0447\u0435\u0440\u0435\u0437 \u0432\u0430\u0448 \u043a\u043e\u0434 \u2014 \u0438 AG2 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u0438\u0445 \u043a\u043e\u0440\u043d\u0435\u043c <code>fs_root<\/code> (\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0447\u0430\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f <code>cwd<\/code>).<\/p>\n<figure class=\"full-width \"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ab5\/04b\/558\/ab504b55834a8942d2c24b16a1fea1de.png\" alt=\"\u0410\u0433\u0435\u043d\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u043d\u0443\u0442\u0440\u0438 \u0432\u044b\u0434\u0430\u043d\u043d\u043e\u0439 \u0435\u043c\u0443 \u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u044b fs_root\" title=\"\u0410\u0433\u0435\u043d\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u043d\u0443\u0442\u0440\u0438 \u0432\u044b\u0434\u0430\u043d\u043d\u043e\u0439 \u0435\u043c\u0443 \u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u044b fs_root\" width=\"1024\" height=\"1024\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/ab5\/04b\/558\/ab504b55834a8942d2c24b16a1fea1de.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ab5\/04b\/558\/ab504b55834a8942d2c24b16a1fea1de.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u0410\u0433\u0435\u043d\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u043d\u0443\u0442\u0440\u0438 \u0432\u044b\u0434\u0430\u043d\u043d\u043e\u0439 \u0435\u043c\u0443 \u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u044b fs_root<\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0441\u043c\u044b\u0441\u043b \u043f\u0440\u043e\u0441\u0442\u043e\u0439: \u0430\u0432\u0442\u043e\u043d\u043e\u043c\u043d\u044b\u0439 \u0430\u0433\u0435\u043d\u0442 \u0441 <code>permission_policy=\"auto\"<\/code> \u043d\u0435 \u0443\u0435\u0434\u0435\u0442 \u043f\u0438\u0441\u0430\u0442\u044c \u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u044b \u0432\u044b\u0434\u0430\u043d\u043d\u043e\u0439 \u0435\u043c\u0443 \u043f\u0430\u043f\u043a\u0438. \u041f\u043e\u043f\u044b\u0442\u043a\u0430 \u0432\u044b\u043b\u0435\u0437\u0442\u0438 \u0438\u0437 <code>fs_root<\/code> \u0443\u043f\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0432 \u043e\u0448\u0438\u0431\u043a\u0443, \u0430 \u043d\u0435 \u0432 \u0438\u0441\u043f\u043e\u0440\u0447\u0435\u043d\u043d\u0443\u044e \u0444\u0430\u0439\u043b\u043e\u0432\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443. \u041a\u043e\u0433\u0434\u0430 \u0437\u0430 \u0440\u0443\u043b\u0451\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430, \u0430 \u043d\u0435 \u0447\u0435\u043b\u043e\u0432\u0435\u043a, \u0442\u0430\u043a\u0430\u044f \u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0430 \u2014 \u043d\u0435 \u0440\u043e\u0441\u043a\u043e\u0448\u044c, \u0430 \u0443\u0441\u043b\u043e\u0432\u0438\u0435, \u043f\u0440\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u044d\u0442\u043e \u0432\u043e\u043e\u0431\u0449\u0435 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0431\u0435\u0437 \u043f\u0440\u0438\u0441\u043c\u043e\u0442\u0440\u0430.<\/p>\n<h2>\u041e\u0440\u043a\u0435\u0441\u0442\u0440\u0430\u0446\u0438\u044f: \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0430\u0433\u0435\u043d\u0442\u043e\u0432 \u0432\u043c\u0435\u0441\u0442\u0435<\/h2>\n<p>\u0420\u0430\u0437 \u043a\u0430\u0436\u0434\u044b\u0439 CLI-\u0430\u0433\u0435\u043d\u0442 \u2014 \u044d\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u044b\u0439 <code>Agent<\/code>, \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043e\u0434\u043d\u043e\u0433\u043e \u0430\u0433\u0435\u043d\u0442\u0430 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0447\u0435\u0440\u0435\u0437 <code>.as_tool()<\/code>:<\/p>\n<pre><code class=\"python\">from ag2 import Agentfrom ag2.acp import ClaudeCodeConfigreviewer = Agent(\"reviewer\", config=ClaudeCodeConfig(cwd=\"\/repo\"))manager = Agent(    \"manager\",    config=ClaudeCodeConfig(cwd=\"\/repo\"),    tools=[reviewer.as_tool(description=\"\u041e\u0442\u0440\u0435\u0432\u044c\u044e\u0438\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043d\u0430 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0441\u0442\u044c\")],)<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p><code>manager<\/code> \u043f\u0438\u0448\u0435\u0442 \u043a\u043e\u0434, \u0430 \u0432 \u043d\u0443\u0436\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0441\u0430\u043c \u0434\u0451\u0440\u0433\u0430\u0435\u0442 <code>reviewer<\/code> \u043a\u0430\u043a \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u2014 \u0438 \u0432\u044b \u0432\u0438\u0434\u0438\u0442\u0435 \u043e\u0431\u0430 \u043f\u0440\u043e\u0433\u043e\u043d\u0430 \u043e\u0434\u043d\u0438\u043c \u043f\u043e\u0442\u043e\u043a\u043e\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u0439. \u041d\u0438\u043a\u0442\u043e \u043d\u0435 \u043c\u0435\u0448\u0430\u0435\u0442 \u043f\u043e\u0441\u0430\u0434\u0438\u0442\u044c \u0438\u0445 \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0435 \u0434\u0432\u0438\u0436\u043a\u0438: \u043e\u0434\u0438\u043d \u043d\u0430 Claude Code, \u0434\u0440\u0443\u0433\u043e\u0439 \u043d\u0430 Codex.<\/p>\n<h2>\u0411\u043e\u043d\u0443\u0441: \u043a\u043e\u043c\u0430\u043d\u0434\u0443\u0435\u043c Claude Code \u0433\u043e\u043b\u043e\u0441\u043e\u043c \u2014 \u0441 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0445\u043e\u0441\u0442\u0430 (ACP \u00d7 A2A)<\/h2>\n<p>\u0420\u0430\u0437 \u0443\u0436 \u0434\u043e\u0447\u0438\u0442\u0430\u043b\u0438 \u2014 \u0441\u0430\u043c\u043e\u0435 \u0432\u043a\u0443\u0441\u043d\u043e\u0435. ACP \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0430\u0433\u0435\u043d\u0442\u043e\u043c <em>\u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e<\/em>, \u0447\u0435\u0440\u0435\u0437 stdio. \u041d\u043e \u0440\u0430\u0437 ACP-\u0430\u0433\u0435\u043d\u0442 \u2014 \u044d\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u044b\u0439<strong> <\/strong><code>Agent<\/code>, \u043d\u0438\u0447\u0442\u043e \u043d\u0435 \u043c\u0435\u0448\u0430\u0435\u0442 \u043e\u0442\u0434\u0430\u0442\u044c \u0435\u0433\u043e \u0438 \u043f\u043e \u0441\u0435\u0442\u0438.<\/p>\n<p>\u0417\u0430 \u0441\u0435\u0442\u044c \u0432 AG2 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u043c\u043e\u0434\u0443\u043b\u044c <code>ag2.a2a<\/code>: \u043e\u043d \u043f\u0443\u0431\u043b\u0438\u043a\u0443\u0435\u0442 \u043b\u044e\u0431\u043e\u0433\u043e <code>Agent<\/code> \u043d\u0430\u0440\u0443\u0436\u0443 \u043f\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0443 [A2A](<a href=\"https:\/\/a2a-protocol.org\" rel=\"noopener noreferrer nofollow\">https:\/\/a2a-protocol.org<\/a>) (\u00ab\u0430\u0433\u0435\u043d\u0442 \u2194 \u0430\u0433\u0435\u043d\u0442 \u0447\u0435\u0440\u0435\u0437 \u0441\u0435\u0442\u044c\u00bb). \u0412\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c Claude Code \u043a\u0430\u043a \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u0441\u0435\u0440\u0432\u0438\u0441:<\/p>\n<pre><code class=\"python\">import uvicornfrom ag2 import Agentfrom ag2.acp import ClaudeCodeConfigfrom ag2.a2a import A2AServer, build_card# \u0442\u043e\u0442 \u0436\u0435 \u0430\u0433\u0435\u043d\u0442 \u043d\u0430 Claude Code \u2014 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u0443\u0431\u043b\u0438\u043a\u0443\u0435\u043c \u0435\u0433\u043e \u043f\u043e \u0441\u0435\u0442\u0438coder = Agent(\"coder\", config=ClaudeCodeConfig(cwd=\"\/repo\", permission_policy=\"auto\"))server = A2AServer(coder)card = build_card(coder, url=\"http:\/\/0.0.0.0:8000\")asgi = server.build_jsonrpc(url=\"http:\/\/0.0.0.0:8000\", card=card)uvicorn.run(asgi, host=\"0.0.0.0\", port=8000)<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0449\u0435\u0433\u043e \u044d\u0442\u043e\u0442 \u0443\u0434\u0430\u043b\u0451\u043d\u043d\u044b\u0439 Claude Code \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u0440\u043e\u0441\u0442\u043e \u043a\u0430\u043a \u0430\u0434\u0440\u0435\u0441 \u2014 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 <code>Agent<\/code> \u0441 <code>A2AConfig<\/code>:<\/p>\n<pre><code class=\"python\">from ag2 import Agentfrom ag2.a2a import A2AConfig# Claude Code \u0436\u0438\u0432\u0451\u0442 \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u043c \u0445\u043e\u0441\u0442\u0435 \u2014 \u0434\u043b\u044f \u043d\u0430\u0441 \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e card_urlremote_coder = Agent(\"coder\", config=A2AConfig(card_url=\"http:\/\/coder-host:8000\"))reply = await remote_coder.ask(\"\u041f\u043e\u0447\u0438\u043d\u0438 \u0442\u0435\u0441\u0442 \u0432 core\/\")<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0410 \u0434\u0430\u043b\u044c\u0448\u0435 \u2014 \u043a\u0443\u043b\u044c\u043c\u0438\u043d\u0430\u0446\u0438\u044f. \u0412 AG2 \u0435\u0441\u0442\u044c \u0435\u0449\u0451 \u0438 <code>ag2.live<\/code> \u2014 <strong>\u0433\u043e\u043b\u043e\u0441\u043e\u0432\u044b\u0435 \u0430\u0433\u0435\u043d\u0442\u044b<\/strong> (<code>LiveAgent<\/code>) \u043f\u043e\u0432\u0435\u0440\u0445 realtime-API OpenAI \u0438 Gemini: \u043e\u043d\u0438 \u0441\u043b\u0443\u0448\u0430\u044e\u0442 \u0432\u0430\u0448\u0443 \u0440\u0435\u0447\u044c (live STT), \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0442 \u0433\u043e\u043b\u043e\u0441\u043e\u043c \u0438 \u0443\u043c\u0435\u044e\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b. \u041e\u0442\u0434\u0430\u0439\u0442\u0435 \u0442\u0430\u043a\u043e\u043c\u0443 \u0430\u0433\u0435\u043d\u0442\u0443 <code>remote_coder<\/code> \u043a\u0430\u043a \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u2014 \u0438 Claude Code \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u043c \u0445\u043e\u0441\u0442\u0435 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0442\u0435\u043c, \u0447\u0442\u043e \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0439 \u0430\u0433\u0435\u043d\u0442 \u0434\u0451\u0440\u0433\u0430\u0435\u0442 \u043f\u043e \u0445\u043e\u0434\u0443 \u0440\u0430\u0437\u0433\u043e\u0432\u043e\u0440\u0430. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0446\u0435\u043f\u043e\u0447\u043a\u0430 \u0438\u0437 \u0442\u0440\u0451\u0445 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u043a\u0443\u0441\u043a\u043e\u0432:<\/p>\n<pre><code>   \u0412\u044b          LiveAgent               A2A-\u0441\u0435\u0440\u0432\u0435\u0440           Claude Code (\u0433\u043e\u043b\u043e\u0441)   (OpenAI\/Gemini live)        (\u0434\u0440\u0443\u0433\u043e\u0439 \u0445\u043e\u0441\u0442)        (subprocess)    \u2502             \u2502                          \u2502                   \u2502    \u2502  \u0440\u0435\u0447\u044c (STT) \u2502   \u0437\u0430\u0434\u0430\u0447\u0430 \u043f\u043e A2A          \u2502                   \u2502    \u2502 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u25ba \u2502 \u2500\u2500\u2500 \u043f\u043e \u0441\u0435\u0442\u0438 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u25ba \u2502   prompt \u043f\u043e ACP   \u2502    \u2502             \u2502                          \u2502 \u2500\u2500\u2500\u2500 \u043f\u043e stdio \u2500\u2500\u25ba \u2502    \u2502             \u2502                          \u2502 \u25c4\u2550\u2550 \u0448\u0430\u0433\u0438 \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2502    \u2502 \u25c4\u2500 \u0433\u043e\u043b\u043e\u0441\u043e\u043c \u2500\u2502 \u25c4\u2500\u2500\u2500\u2500 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2502                   \u2502<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0412\u044b \u043f\u0440\u043e\u0433\u043e\u0432\u0430\u0440\u0438\u0432\u0430\u0435\u0442\u0435 \u0437\u0430\u0434\u0430\u0447\u0443 \u0432\u0441\u043b\u0443\u0445 \u2192 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0439 \u0430\u0433\u0435\u043d\u0442 \u043d\u0430 realtime-API OpenAI\/Gemini \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u0442 \u0435\u0451 \u0438 \u043f\u043e A2A \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442 \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u0445\u043e\u0441\u0442 \u2192 \u0442\u0430\u043c Claude Code \u0437\u0430 \u0440\u0443\u043b\u0451\u043c ACP \u043f\u0438\u0448\u0435\u0442 \u043a\u043e\u0434, \u0430 \u0435\u0433\u043e \u0448\u0430\u0433\u0438 (\u043c\u044b\u0441\u043b\u0438, \u043f\u0440\u0430\u0432\u043a\u0438, \u0437\u0430\u043f\u0443\u0441\u043a\u0438 \u0442\u0435\u0441\u0442\u043e\u0432) \u0438\u0434\u0443\u0442 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u043f\u043e \u0446\u0435\u043f\u043e\u0447\u043a\u0435. \u041f\u043e \u0441\u0443\u0442\u0438 \u2014 <strong>\u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u0434\u0438\u043d\u0433-\u0430\u0433\u0435\u043d\u0442\u043e\u043c \u0433\u043e\u043b\u043e\u0441\u043e\u043c, \u0447\u0435\u0440\u0435\u0437 \u0441\u0435\u0442\u044c<\/strong>: \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u0435 \u0437\u0434\u0435\u0441\u044c, \u043a\u043e\u0434 \u043f\u0438\u0448\u0435\u0442\u0441\u044f \u0442\u0430\u043c.<\/p>\n<p>\u0418 \u0432\u043e\u0442 \u044d\u0442\u043e \u2014 \u0432\u0441\u044f \u043f\u0440\u0435\u043b\u0435\u0441\u0442\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043e\u0432. ACP \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u00ab\u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044e\u044e \u043c\u0438\u043b\u044e\u00bb \u0434\u043e \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e CLI-\u0430\u0433\u0435\u043d\u0442\u0430, A2A \u2014 \u0441\u0432\u044f\u0437\u044c \u043f\u043e \u0441\u0435\u0442\u0438, realtime-\u0441\u043b\u043e\u0439 \u2014 \u0433\u043e\u043b\u043e\u0441. \u0422\u0440\u0438 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0445 \u043a\u0443\u0441\u043a\u0430, \u0430 \u0441\u0442\u044b\u043a\u0443\u044e\u0442\u0441\u044f \u0431\u0435\u0437 \u0435\u0434\u0438\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u0447\u043a\u0438 \u0441\u0430\u043c\u043e\u043f\u0438\u0441\u043d\u043e\u0433\u043e \u043a\u043b\u0435\u044f: \u043a\u0430\u0436\u0434\u044b\u0439 \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043d\u0430 \u0441\u0432\u043e\u0451\u043c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u043c \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0435, \u0438 \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u043a\u0430\u043a \u043a\u0443\u0431\u0438\u043a\u0438.<\/p>\n<h2>\u0427\u0442\u043e \u0432 \u0438\u0442\u043e\u0433\u0435<\/h2>\n<p>ACP \u0441\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a \u043e\u0434\u043d\u043e\u0439 \u0438\u0434\u0435\u0435: \u0434\u0430\u0442\u044c \u043b\u044e\u0431\u043e\u043c\u0443 \u0445\u043e\u0441\u0442\u0443 \u2014 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0443 \u0438\u043b\u0438 \u0432\u0430\u0448\u0435\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435 \u2014 \u0435\u0434\u0438\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043a\u043e\u0434\u0438\u043d\u0433-\u0430\u0433\u0435\u043d\u0442\u0430 \u0438 \u0432\u0438\u0434\u0435\u0442\u044c \u043a\u0430\u0436\u0434\u044b\u0439 \u0435\u0433\u043e \u0448\u0430\u0433. \u041f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c \u0432\u0441\u0451 \u0441\u043a\u0440\u043e\u043c\u043d\u043e: JSON-RPC \u043f\u043e\u0432\u0435\u0440\u0445 stdio, <code>initialize \u2192 session\/new \u2192 session\/prompt<\/code>, \u043f\u043e\u0442\u043e\u043a <code>session\/update<\/code> \u043e\u0431\u0440\u0430\u0442\u043d\u043e. \u0410 \u043d\u0430\u0432\u0435\u0440\u0445\u0443 \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0442\u043e, \u0447\u0435\u0433\u043e \u0443 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0430 \u043d\u0435\u0442: \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0442\u043e\u043a \u0441\u043e\u0431\u044b\u0442\u0438\u0439, \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u043d\u0430\u0434 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f\u043c\u0438, \u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0430 \u0438 \u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u044f \u0430\u0433\u0435\u043d\u0442\u043e\u0432 \u2014 \u0445\u043e\u0442\u044c \u0432 \u043e\u0434\u043d\u043e\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435, \u0445\u043e\u0442\u044c \u043f\u043e \u0441\u0435\u0442\u0438 \u0432 \u0441\u0432\u044f\u0437\u043a\u0435 \u0441 A2A.<\/p>\n<p>\u0412 AG2 \u044d\u0442\u043e \u0441\u043f\u0440\u044f\u0442\u0430\u043d\u043e \u0437\u0430 \u043e\u0431\u044b\u0447\u043d\u044b\u043c <code>Agent<\/code> \u0441 \u0434\u0440\u0443\u0433\u0438\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u043e\u043c \u2014 \u0431\u0435\u0440\u0451\u0442\u0435 <code>ClaudeCodeConfig<\/code>, \u0438 Claude Code \u0438\u0437 CLI \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u043e\u0433\u043e \u0430\u0433\u0435\u043d\u0442\u0430 \u0443 \u0432\u0430\u0441 \u0432 \u043a\u043e\u0434\u0435.<\/p>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u043e\u043f\u0440\u043e\u0441, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443 \u043c\u0435\u043d\u044f \u0441\u0430\u043c\u043e\u0433\u043e \u043d\u0435\u0442 \u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u0430: <strong>\u0434\u043e\u0432\u0435\u0440\u0438\u043b\u0438 \u0431\u044b \u0432\u044b \u0430\u0432\u0442\u043e\u043d\u043e\u043c\u043d\u043e\u043c\u0443 \u0430\u0433\u0435\u043d\u0442\u0443 \u0441 <\/strong><code><strong>permission_policy=\"auto\"<\/strong><\/code><strong> \u0441\u0432\u043e\u0439 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u2014 \u0438 \u0433\u0434\u0435 \u0434\u043b\u044f \u0432\u0430\u0441 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u0433\u0440\u0430\u043d\u0438\u0446\u0430, \u0437\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0447\u0435\u043b\u043e\u0432\u0435\u043a \u043e\u0431\u044f\u0437\u0430\u043d \u043e\u0441\u0442\u0430\u0442\u044c\u0441\u044f \u0432 \u0446\u0438\u043a\u043b\u0435?<\/strong> \u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445, \u043a\u0442\u043e \u0433\u0434\u0435 \u0435\u0451 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442.<\/p>\n<p><strong>\u0421\u0441\u044b\u043b\u043a\u0438:<\/strong><\/p>\n<p>&#8212; \u0421\u0430\u0439\u0442 \u0438 \u0441\u043f\u0435\u043a\u0430: <a href=\"https:\/\/agentclientprotocol.com\" rel=\"noopener noreferrer nofollow\">agentclientprotocol.com<\/a><\/p>\n<p>&#8212; ACP \u0443 Zed: <a href=\"https:\/\/zed.dev\/acp\" rel=\"noopener noreferrer nofollow\">zed.dev\/acp<\/a><\/p>\n<p>&#8212; \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0432 AG2: \u043c\u043e\u0434\u0443\u043b\u044c <a href=\"https:\/\/github.com\/ag2ai\/ag2\/tree\/main\/ag2\/acp\" rel=\"noopener noreferrer nofollow\"><code>ag2\/acp<\/code><\/a><\/p>\n<p>&#8212; \u0420\u0435\u0435\u0441\u0442\u0440 \u0430\u0433\u0435\u043d\u0442\u043e\u0432 \u0438 SDK: <a href=\"https:\/\/agentclientprotocol.com\/get-started\/registry\" rel=\"noopener noreferrer nofollow\">agentclientprotocol.com\/get-started\/registry<\/a><\/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\/1059218\/\">https:\/\/habr.com\/ru\/articles\/1059218\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u041a\u043e\u0434 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043a\u043e\u0434\u0438\u043d\u0433-\u0430\u0433\u0435\u043d\u0442\u043e\u043c \u043f\u043e ACPClaude Code, Codex, Gemini CLI \u2014 \u043c\u043e\u0449\u043d\u044b\u0435 \u0448\u0442\u0443\u043a\u0438. \u041d\u043e \u0436\u0438\u0432\u0443\u0442 \u043e\u043d\u0438 \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435: \u0432\u044b \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0435 \u043e\u043a\u043d\u043e, \u043f\u0435\u0447\u0430\u0442\u0430\u0435\u0442\u0435 \u0437\u0430\u0434\u0430\u0447\u0443, \u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435, \u043a\u0430\u043a \u0430\u0433\u0435\u043d\u0442 \u0434\u0443\u043c\u0430\u0435\u0442, \u043b\u0435\u0437\u0435\u0442 \u0432 \u0444\u0430\u0439\u043b\u044b, \u0433\u043e\u043d\u044f\u0435\u0442 \u0442\u0435\u0441\u0442\u044b. \u0414\u043b\u044f \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430 \u2014 \u043e\u0442\u043b\u0438\u0447\u043d\u043e. \u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435, \u0447\u0442\u043e \u0432 \u044d\u0442\u043e \u043a\u0440\u0435\u0441\u043b\u043e \u043f\u0435\u0440\u0435\u0434 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u043e\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0441\u0430\u0434\u0438\u0442\u044c \u043d\u0435 \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430, \u0430 \u0432\u0430\u0448\u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443: \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0430 \u0441\u0430\u043c\u0430 \u0441\u0442\u0430\u0432\u0438\u043b\u0430 \u0430\u0433\u0435\u043d\u0442\u0443 \u0437\u0430\u0434\u0430\u0447\u0443, \u0432\u0438\u0434\u0435\u043b\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u0435\u0433\u043e \u0448\u0430\u0433 \u0438 \u043c\u043e\u0433\u043b\u0430 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043e\u043f\u0430\u0441\u043d\u043e\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0434\u043e \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043e\u043d\u043e \u0441\u043b\u0443\u0447\u0438\u0442\u0441\u044f.\u0412\u043e\u0442 \u0442\u0443\u0442 \u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f ACP \u2014 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043b\u044e\u0431\u043e\u043c\u0443 \u043a\u043e\u0434\u0443 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c CLI-\u0430\u0433\u0435\u043d\u0442\u043e\u043c.TL;DR\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430: \u0443 CLI-\u043a\u043e\u0434\u0438\u043d\u0433-\u0430\u0433\u0435\u043d\u0442\u043e\u0432 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430, \u0430 \u043d\u0435 \u0434\u043b\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b. \u0425\u043e\u0442\u0438\u0442\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0438\u043c\u0438 \u0438\u0437 \u043a\u043e\u0434\u0430 \u2014 \u0438\u0437\u0432\u043e\u043b\u044c\u0442\u0435 \u043f\u0430\u0440\u0441\u0438\u0442\u044c stdout \u0438 \u043e\u0442\u0432\u0435\u0447\u0430\u0442\u044c \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u00ab\u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443?\u00bb, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435\u043a\u043e\u043c\u0443 \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c.\u0420\u0435\u0448\u0435\u043d\u0438\u0435: ACP (Agent Client Protocol) \u2014 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 \u00ab\u0445\u043e\u0441\u0442 \u2194 \u043a\u043e\u0434\u0438\u043d\u0433-\u0430\u0433\u0435\u043d\u0442\u00bb. \u0412 AG2 \u043b\u044e\u0431\u043e\u0439 CLI-\u0430\u0433\u0435\u043d\u0442 \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u043e\u0431\u044b\u0447\u043d\u044b\u043c Agent \u0432 \u043f\u044f\u0442\u044c \u0441\u0442\u0440\u043e\u043a, \u0430 \u0432\u0441\u0451, \u0447\u0442\u043e \u043e\u043d \u0434\u0435\u043b\u0430\u0435\u0442, \u043f\u0440\u0438\u043b\u0435\u0442\u0430\u0435\u0442 \u043a \u0432\u0430\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u043c\u0438.\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442! \u042f \u0421\u0435\u043c\u0435\u043d \u0424\u0440\u043e\u043b\u043e\u0432 \u2014 \u043a\u043e\u043d\u0442\u0440\u0438\u0431\u044c\u044e\u0442\u043e\u0440 AG2; \u043d\u0435\u0434\u0430\u0432\u043d\u043e \u044f \u0438 \u043f\u0440\u0438\u043d\u0451\u0441 \u0432 \u043d\u0435\u0433\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 ACP, \u043c\u043e\u0434\u0443\u043b\u044c ag2.acp. \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c ACP \u043f\u0440\u043e\u0441\u0442\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438: \u043a\u0430\u043a \u043e\u043d \u0443\u0441\u0442\u0440\u043e\u0435\u043d, \u043f\u043e\u0447\u0435\u043c\u0443 \u044d\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u043e \u0438 \u043a\u0430\u043a \u0437\u0430 \u043f\u044f\u0442\u044c \u0441\u0442\u0440\u043e\u043a \u043f\u043e\u0434\u043d\u044f\u0442\u044c Claude Code \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u043c \u0430\u0433\u0435\u043d\u0442\u043e\u043c. \u0410 \u043f\u043e\u0434 \u043a\u043e\u043d\u0435\u0446 \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u043c \u0435\u0433\u043e \u0441\u043b\u0443\u0448\u0430\u0442\u044c\u0441\u044f \u0443\u0434\u0430\u043b\u0451\u043d\u043d\u043e \u2014 \u0433\u043e\u043b\u043e\u0441\u043e\u043c, \u0441 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0445\u043e\u0441\u0442\u0430.\u0421\u0440\u0430\u0437\u0443 \u043f\u0440\u043e \u043f\u0443\u0442\u0430\u043d\u0438\u0446\u0443. \u0410\u0431\u0431\u0440\u0435\u0432\u0438\u0430\u0442\u0443\u0440\u0443 \u00abACP\u00bb \u043d\u043e\u0441\u044f\u0442 \u0434\u0432\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430. \u0415\u0441\u0442\u044c Agent Communication Protocol \u043e\u0442 IBM (\u0434\u043b\u044f BeeAI, \u043c\u0430\u0440\u0442 2025) \u2014 \u043d\u043e \u0435\u0433\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u043b\u0438 \u0432 Linux Foundation \u0438 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u043b\u0438 \u0441 A2A, \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0441\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u044e\u0442. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 ACP \u2014 \u044d\u0442\u043e \u0432\u0441\u0435\u0433\u0434\u0430 Agent Client Protocol \u043e\u0442 Zed (agentclientprotocol.com), \u0442\u043e\u0442, \u0447\u0442\u043e \u0436\u0438\u0432\u0451\u0442 \u0438 \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0435\u0442\u0441\u044f.\u041a\u0430\u043a \u0432\u044b \u043e\u0431\u044b\u0447\u043d\u043e \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u0435 \u0441 Claude Code\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439: \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b, \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u0447\u0430\u0442, \u0432\u044b \u0432\u043d\u0443\u0442\u0440\u0438 \u0446\u0438\u043a\u043b\u0430. \u041d\u0430\u043f\u0435\u0447\u0430\u0442\u0430\u043b\u0438 \u00ab\u043f\u043e\u0447\u0438\u043d\u0438 \u043f\u0430\u0434\u0430\u044e\u0449\u0438\u0439 \u0442\u0435\u0441\u0442\u00bb \u2014 \u0430\u0433\u0435\u043d\u0442 \u043f\u043e\u0448\u0451\u043b \u0447\u0438\u0442\u0430\u0442\u044c \u0444\u0430\u0439\u043b\u044b, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c pytest, \u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u0434, \u0438 \u0432 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u0440\u043e\u0441\u0438\u0442 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435: \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0432\u043e\u0442 \u044d\u0442\u0443 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0432 \u0448\u0435\u043b\u043b\u0435 \u0438\u043b\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u0440\u0430\u0432\u043a\u0443 \u043a \u0444\u0430\u0439\u043b\u0443? \u0412\u044b \u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u0433\u043b\u0430\u0437\u0430\u043c\u0438, \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442\u0435 \u00ab\u0434\u0430\/\u043d\u0435\u0442\u00bb, \u0438 \u0442\u0430\u043a \u0434\u043e \u043a\u043e\u043d\u0446\u0430.\u041f\u043e\u043a\u0430 \u0437\u0430 \u0440\u0443\u043b\u0451\u043c \u0447\u0435\u043b\u043e\u0432\u0435\u043a \u2014 \u044d\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u043e. \u0427\u0435\u043b\u043e\u0432\u0435\u043a \u0432\u0438\u0434\u0438\u0442 \u0432\u044b\u0432\u043e\u0434, \u0447\u0435\u043b\u043e\u0432\u0435\u043a \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u0447\u0435\u043b\u043e\u0432\u0435\u043a \u043b\u043e\u0432\u0438\u0442 \u043c\u043e\u043c\u0435\u043d\u0442, \u043a\u043e\u0433\u0434\u0430 \u0430\u0433\u0435\u043d\u0442 \u0441\u043e\u0431\u0440\u0430\u043b\u0441\u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0433\u043b\u0443\u043f\u043e\u0441\u0442\u044c.\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u0443\u0431\u0435\u0440\u0438\u0442\u0435 \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430 \u0438 \u043f\u043e\u0441\u0430\u0434\u0438\u0442\u0435 \u0437\u0430 \u0440\u0443\u043b\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443. \u0421\u0440\u0430\u0437\u0443 \u0432\u0441\u0451 \u043b\u043e\u043c\u0430\u0435\u0442\u0441\u044f:- \u041d\u0435\u0442 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u0442\u043e\u043a\u0430. \u0410\u0433\u0435\u043d\u0442 \u0441\u044b\u043f\u043b\u0435\u0442 \u0442\u0435\u043a\u0441\u0442 \u0432 stdout \u0432\u043f\u0435\u0440\u0435\u043c\u0435\u0448\u043a\u0443: \u0433\u0434\u0435 \u0442\u0443\u0442 \u00ab\u043c\u044b\u0441\u043b\u044c\u00bb, \u0433\u0434\u0435 \u00ab\u0432\u044b\u0437\u043e\u0432 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u00bb, \u0433\u0434\u0435 \u00ab\u0444\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442\u00bb? \u041f\u0430\u0440\u0441\u0438\u0442\u044c \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043a\u0430\u043c\u0438 \u2014 \u0442\u0443\u043f\u0438\u043a\u043e\u0432\u044b\u0439 \u043f\u0443\u0442\u044c.- \u041d\u0435\u043a\u0443\u0434\u0430 \u0432\u043a\u043b\u0438\u043d\u0438\u0442\u044c\u0441\u044f. \u0410\u0433\u0435\u043d\u0442 \u0441\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0430 \u043e\u043f\u0430\u0441\u043d\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u2014 \u0430 \u043e\u0442\u0432\u0435\u0447\u0430\u0442\u044c-\u0442\u043e \u043d\u0435\u043a\u043e\u043c\u0443. \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435 \u043d\u0443\u0436\u0435\u043d \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u0432\u043e\u043f\u0440\u043e\u0441 \u0438 \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c \u043f\u043e \u0441\u0432\u043e\u0435\u0439 \u043b\u043e\u0433\u0438\u043a\u0435.- \u041d\u0435 \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440. \u0425\u043e\u0447\u0435\u0442\u0441\u044f, \u0447\u0442\u043e\u0431\u044b \u043e\u0434\u0438\u043d \u0430\u0433\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u043a\u043e\u0434, \u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u0435\u0433\u043e \u043e\u0442\u0440\u0435\u0432\u044c\u044e\u0438\u043b \u2014 \u043d\u043e \u0434\u0432\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435 \u0434\u0440\u0443\u0433 \u043e \u0434\u0440\u0443\u0433\u0435 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0437\u043d\u0430\u044e\u0442.\u0427\u0435\u043b\u043e\u0432\u0435\u043a \u0443\u0445\u043e\u0434\u0438\u0442 \u043e\u0442 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0430, \u0437\u0430 \u0440\u0443\u043b\u044c \u0441\u0430\u0434\u0438\u0442\u0441\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b \u2014 \u044d\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430, \u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435 \u043d\u0443\u0436\u0435\u043d \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b. \u041a\u043e\u043d\u0442\u0440\u0430\u043a\u0442. \u0418\u043c \u0438 \u0441\u0442\u0430\u043b ACP.\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 ACP, \u0435\u0441\u043b\u0438 \u0432 \u0434\u0432\u0443\u0445 \u0441\u043b\u043e\u0432\u0430\u0445\u041b\u0443\u0447\u0448\u0430\u044f \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u044f \u2014 LSP, Language Server Protocol. \u0414\u043e LSP \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u0442\u0430\u0449\u0438\u043b \u0441\u0432\u043e\u044e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430: \u0430\u0432\u0442\u043e\u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 Python \u0432 Vim, \u0432 Emacs, \u0432 Sublime \u2014 \u0442\u0440\u0438 \u0440\u0430\u0437\u043d\u044b\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u0438 \u0442\u043e\u0433\u043e \u0436\u0435. LSP \u044d\u0442\u043e \u0440\u0430\u0437\u0432\u044f\u0437\u0430\u043b: \u044f\u0437\u044b\u043a \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u043e\u0434\u0438\u043d \u0441\u0435\u0440\u0432\u0435\u0440, \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0430, \u0438 N \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u043e\u0432 \u00d7 M \u044f\u0437\u044b\u043a\u043e\u0432 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u044e\u0442\u0441\u044f \u0438\u0437 N\u00d7M \u043a\u043e\u0441\u0442\u044b\u043b\u0435\u0439 \u0432 N+M.ACP \u0434\u0435\u043b\u0430\u0435\u0442 \u0440\u043e\u0432\u043d\u043e \u0442\u043e \u0436\u0435 \u2014 \u043d\u043e \u0434\u043b\u044f \u043a\u043e\u0434\u0438\u043d\u0433-\u0430\u0433\u0435\u043d\u0442\u043e\u0432. \u041f\u043e \u043e\u0434\u043d\u0443 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u0445\u043e\u0441\u0442 (\u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u0438\u043b\u0438 \u0432\u0430\u0448 \u043a\u043e\u0434), \u043f\u043e \u0434\u0440\u0443\u0433\u0443\u044e \u2014 \u0430\u0433\u0435\u043d\u0442, \u0430 \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438 \u0435\u0434\u0438\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442. \u041d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u0430\u0433\u0435\u043d\u0442\u0430 \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u2014 \u0438 \u043e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432 \u043b\u044e\u0431\u043e\u043c ACP-\u0445\u043e\u0441\u0442\u0435, \u0431\u0435\u0437 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043d\u0438\u043a\u0430 \u043f\u043e\u0434 \u043a\u0430\u0436\u0434\u044b\u0439.\u041e\u0434\u0438\u043d \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u0432\u043c\u0435\u0441\u0442\u043e N\u00d7M \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0439\u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0444\u0430\u043a\u0442\u043e\u0432, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u043a\u0438\u043d\u0443\u0442\u044c \u0437\u0440\u0435\u043b\u043e\u0441\u0442\u044c:- \u0410\u0432\u0433\u0443\u0441\u0442 2025 \u2014 Zed \u0432\u044b\u043a\u0430\u0442\u044b\u0432\u0430\u0435\u0442 ACP. \u0422\u043e\u043b\u0447\u043a\u043e\u043c \u0441\u0442\u0430\u043b Google: \u043f\u0440\u0438\u0448\u0451\u043b \u0441\u043e \u0441\u0432\u043e\u0438\u043c Gemini CLI, \u0438 \u043e\u0431\u0435\u0438\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0433\u043b\u0443\u0431\u0436\u0435, \u0447\u0435\u043c \u00ab\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0442\u0443\u043b\u0437\u0443 \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435\u00bb.- \u041f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 (Apache-2.0), \u0432\u044b\u043d\u0435\u0441\u0435\u043d \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u044e github.com\/agentclientprotocol.- \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u043e\u0432 \u2014 Zed, JetBrains, VS Code, Neovim, Emacs; \u0432 \u0440\u0435\u0435\u0441\u0442\u0440\u0435 \u0443\u0436\u0435 \u043f\u043e\u0447\u0442\u0438 \u043f\u043e\u043b\u0441\u043e\u0442\u043d\u0438 \u0430\u0433\u0435\u043d\u0442\u043e\u0432: Claude Code, Codex CLI, Copilot CLI, Gemini CLI, OpenCode \u0438 \u0434\u0440\u0443\u0433\u0438\u0435.\u0422\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0441\u0451 \u043f\u0440\u043e\u0441\u0442\u043e: JSON-RPC 2.0 \u043f\u043e\u0432\u0435\u0440\u0445 stdio. \u0425\u043e\u0441\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0430\u0433\u0435\u043d\u0442\u0430 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u043c \u0438 \u043e\u0431\u0449\u0430\u0435\u0442\u0441\u044f \u0441 \u043d\u0438\u043c \u0447\u0435\u0440\u0435\u0437 stdin\/stdout. \u041d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u0441\u0435\u0442\u0435\u0432\u043e\u0433\u043e \u0441\u043b\u043e\u044f, \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u043f\u043e\u0440\u0442\u043e\u0432 \u2014 \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u0432\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0438 \u043e\u0434\u0438\u043d \u043a\u0430\u043d\u0430\u043b.        \u0432\u0430\u0448 \u043a\u043e\u0434 (ACP-\u043a\u043b\u0438\u0435\u043d\u0442 \/ \u0445\u043e\u0441\u0442)                  \u2502                  \u2502  \u0441\u043f\u0430\u0432\u043d\u0438\u0442 subprocess                  \u25bc        \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510        \u2502  claude-agent-acp     \u2502   \u2190 ACP-\u0430\u0433\u0435\u043d\u0442        \u2502  (Claude Code \u0432\u043d\u0443\u0442\u0440\u0438) \u2502        \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518                  \u25b2                  \u2502  JSON-RPC 2.0 \u043f\u043e\u0432\u0435\u0440\u0445 stdin\/stdout                  \u25bc        \u043f\u0440\u043e\u043c\u043f\u0442\u044b  \u2192   \u2190 \u043f\u043e\u0442\u043e\u043a \u0441\u043e\u0431\u044b\u0442\u0438\u0439 (\u043c\u044b\u0441\u043b\u0438, tool-calls, \u043f\u043b\u0430\u043d\u2026)\u0417\u0430\u043f\u043e\u043c\u043d\u0438\u0442\u0435 \u0440\u043e\u043b\u0438: \u043a\u043b\u0438\u0435\u043d\u0442 \u2014 \u044d\u0442\u043e \u0445\u043e\u0441\u0442, \u0442\u043e\u0442, \u043a\u0442\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442. \u0410\u0433\u0435\u043d\u0442 \u2014 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0445\u043e\u0434\u0438\u0442 \u0432 LLM \u0438 \u0434\u0435\u043b\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0443. \u0414\u0430\u043b\u044c\u0448\u0435 \u0432\u0441\u0451 \u0432\u043e\u043a\u0440\u0443\u0433 \u044d\u0442\u043e\u0439 \u043f\u0430\u0440\u044b.\u0422\u0443\u0442 \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044c \u0441\u043f\u0440\u043e\u0441\u0438\u0442: \u0430 \u0437\u0430\u0447\u0435\u043c \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b, \u0435\u0441\u043b\u0438 \u0443 Claude Code \u0435\u0441\u0442\u044c \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 Claude Agent SDK \u0438 headless-\u0440\u0435\u0436\u0438\u043c, \u0443 Codex \u2014 \u0441\u0432\u043e\u0439 SDK? \u041e\u0442\u0432\u0435\u0442 \u0442\u043e\u0442 \u0436\u0435, \u0447\u0442\u043e \u0438 \u0443 LSP. \u041d\u0430\u043f\u0438\u0448\u0435\u0442\u0435 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e \u043d\u0430 Claude Agent SDK \u2014 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e \u0441 Claude Code, \u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u043d\u0438\u043c. \u0417\u0430\u0445\u043e\u0442\u0438\u0442\u0435 \u0437\u0430\u0432\u0442\u0440\u0430 \u043f\u0440\u043e\u0433\u043d\u0430\u0442\u044c \u0442\u0443 \u0436\u0435 \u0437\u0430\u0434\u0430\u0447\u0443 \u0447\u0435\u0440\u0435\u0437 Codex \u0438\u043b\u0438 OpenCode \u2014 \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u044b\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0434 \u0432\u0442\u043e\u0440\u043e\u0439 SDK, \u043f\u043e\u0442\u043e\u043c \u043f\u043e\u0434 \u0442\u0440\u0435\u0442\u0438\u0439. ACP \u2014 \u044d\u0442\u043e \u043e\u0434\u0438\u043d \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 \u043d\u0430 \u0432\u0441\u0435\u0445: \u043a\u043e\u0434 \u0445\u043e\u0441\u0442\u0430 \u043d\u0435 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f, \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0430\u0433\u0435\u043d\u0442\u0430. \u041f\u043b\u044e\u0441 SDK \u0440\u0435\u0448\u0430\u0435\u0442 \u0437\u0430\u0434\u0430\u0447\u0443 \u00ab\u043c\u043e\u0439 \u043a\u043e\u0434 \u0434\u0451\u0440\u0433\u0430\u0435\u0442 \u0430\u0433\u0435\u043d\u0442\u0430\u00bb, \u0430 ACP \u0437\u0430\u043e\u0434\u043d\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0442\u043e, \u0447\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u0437\u043e\u0431\u0440\u0435\u0442\u0430\u0442\u044c \u0441\u0430\u043c\u043e\u043c\u0443: \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0439, \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0447\u0435\u0440\u0435\u0437 \u0445\u043e\u0441\u0442, \u0444\u043e\u0440\u043c\u0430\u0442 \u043f\u043e\u0442\u043e\u043a\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u0439.\u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440: Claude Code \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u0430\u0433\u0435\u043d\u0442\u0422\u0435\u043f\u0435\u0440\u044c \u2014 \u043a\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0438\u0437 \u043a\u043e\u0434\u0430. \u0412\u043e\u0442 \u043a\u0430\u043a \u0432 AG2 \u043f\u043e\u0434\u043d\u044f\u0442\u044c Claude Code \u0438 \u0434\u0430\u0442\u044c \u0435\u043c\u0443 \u0437\u0430\u0434\u0430\u0447\u0443:from ag2 import Agentfrom ag2.acp import ClaudeCodeConfigagent = Agent(&#171;coder&#187;, config=ClaudeCodeConfig(cwd=&#187;\/path\/to\/repo&#187;))reply = await agent.ask(&#171;\u041e\u0442\u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438 \u043c\u043e\u0434\u0443\u043b\u044c auth \u0438 \u0434\u043e\u0431\u0430\u0432\u044c \u0442\u0435\u0441\u0442\u044b&#187;)print(reply.body)\u041f\u044f\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0441\u0442\u0440\u043e\u043a. \u041d\u0438 \u0441\u043b\u043e\u0432\u0430 \u043f\u0440\u043e subprocess, JSON-RPC \u0438\u043b\u0438 stdio. \u0410 \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0432\u0441\u0451, \u0447\u0442\u043e \u043c\u044b \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u043b\u0438: ClaudeCodeConfig \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b \u0430\u0434\u0430\u043f\u0442\u0435\u0440 claude-agent-acp \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u043c, \u0441\u0434\u0435\u043b\u0430\u043b \u0440\u0443\u043a\u043e\u043f\u043e\u0436\u0430\u0442\u0438\u0435, \u0441\u043e\u0437\u0434\u0430\u043b \u0441\u0435\u0441\u0441\u0438\u044e, \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b \u0432\u0430\u0448 \u043f\u0440\u043e\u043c\u043f\u0442 \u0438 \u0434\u043e\u0436\u0434\u0430\u043b\u0441\u044f \u043e\u0442\u0432\u0435\u0442\u0430.\u041e\u0434\u0438\u043d ask() (\u0438\u043b\u0438 run()) \u2014 \u044d\u0442\u043e \u043e\u0434\u0438\u043d prompt-turn \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u0445 ACP. \u0412\u043d\u0443\u0442\u0440\u0438 \u043d\u0435\u0433\u043e \u0443 \u0430\u0433\u0435\u043d\u0442\u0430 \u043a\u0440\u0443\u0442\u0438\u0442\u0441\u044f \u0435\u0433\u043e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0446\u0438\u043a\u043b \u00ab\u043f\u043e\u0434\u0443\u043c\u0430\u043b \u2192 \u0432\u044b\u0437\u0432\u0430\u043b \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u2192 \u043f\u043e\u0447\u0438\u0442\u0430\u043b \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u2192 \u043f\u043e\u0448\u0451\u043b \u0434\u0430\u043b\u044c\u0448\u0435\u00bb, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u0443\u0436\u043d\u043e. \u0412\u0430\u043c \u043d\u0430\u0440\u0443\u0436\u0443 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442, \u0430 \u0432\u0435\u0441\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u043e \u0434\u043e\u0440\u043e\u0433\u0435 \u2014 \u043f\u043e\u0442\u043e\u043a\u043e\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u0439 (\u043e\u0431 \u044d\u0442\u043e\u043c \u2014 \u043d\u0438\u0436\u0435).\u0421\u043c\u0435\u043d\u0438\u0442\u044c \u0434\u0432\u0438\u0436\u043e\u043a \u2014 \u044d\u0442\u043e \u0441\u043c\u0435\u043d\u0438\u0442\u044c config, \u043a\u043e\u0434 \u0432\u043e\u043a\u0440\u0443\u0433 \u043d\u0435 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f:from ag2.acp import CodexConfig, OpenCodeConfigagent = Agent(&#171;coder&#187;, config=CodexConfig(cwd=&#187;\/path\/to\/repo&#187;))     # Codexagent = Agent(&#171;coder&#187;, config=OpenCodeConfig(cwd=&#187;\/path\/to\/repo&#187;))  # OpenCode\u0422\u0443\u0442 \u0441\u0442\u043e\u0438\u0442 \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0430\u0436\u043d\u043e\u0435: \u00ab\u0437\u0430\u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u043f\u043e ACP\u00bb \u0430\u0433\u0435\u043d\u0442\u044b \u0443\u043c\u0435\u044e\u0442 \u043f\u043e-\u0440\u0430\u0437\u043d\u043e\u043c\u0443. OpenCode \u0438 Gemini CLI \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 ACP \u0441\u0430\u043c\u0438 \u2014 \u0443 \u043d\u0438\u0445 \u0435\u0441\u0442\u044c \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u0440\u0435\u0436\u0438\u043c (opencode acp, \u0444\u043b\u0430\u0433 &#8212;acp). \u0410 \u0432\u043e\u0442 Claude Code \u0438 Codex \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e ACP \u043d\u0435 \u0433\u043e\u0432\u043e\u0440\u044f\u0442 \u2014 \u0434\u043b\u044f \u043d\u0438\u0445 \u0435\u0441\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u044b-\u043e\u0431\u0451\u0440\u0442\u043a\u0438 (claude-agent-acp, codex-acp): \u0441\u043d\u0430\u0440\u0443\u0436\u0438 \u043e\u043d\u0438 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0442 ACP, \u0430 \u0432\u043d\u0443\u0442\u0440\u044c \u0434\u0451\u0440\u0433\u0430\u044e\u0442 \u0430\u0433\u0435\u043d\u0442\u0430 \u043d\u0430 \u0435\u0433\u043e \u00ab\u0440\u043e\u0434\u043d\u043e\u043c\u00bb \u044f\u0437\u044b\u043a\u0435. \u041d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0432\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u0434\u0430 \u0440\u0430\u0437\u043d\u0438\u0446\u044b \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u2014 \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043a\u043e\u043d\u0444\u0438\u0433 \u0432 AG2 \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u043d\u0430\u0435\u0442, \u043a\u0430\u043a\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c; \u0432\u0441\u043f\u043b\u044b\u0432\u0451\u0442 \u043e\u043d\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435.\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u0442\u0430\u0432\u0438\u043c \u0434\u0432\u0435 \u0432\u0435\u0449\u0438: \u0441\u0430\u043c \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0447\u0435\u0440\u0435\u0437 extra \u0438 \u043d\u0443\u0436\u043d\u044b\u0439 CLI-\u0430\u0433\u0435\u043d\u0442 \u0438\u043b\u0438 \u0435\u0433\u043e \u0430\u0434\u0430\u043f\u0442\u0435\u0440 (\u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b \u043b\u0435\u0436\u0430\u043b \u043d\u0430 PATH):pip install &#171;ag2[acp]&#187;                                 # \u043c\u043e\u0434\u0443\u043b\u044c AG2npm install -g @agentclientprotocol\/claude-agent-acp   # \u0430\u0434\u0430\u043f\u0442\u0435\u0440 \u0434\u043b\u044f Claude Codenpm install -g @agentclientprotocol\/codex-acp          # \u0430\u0434\u0430\u043f\u0442\u0435\u0440 \u0434\u043b\u044f Codex\u0412\u0438\u0434\u043d\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0448\u0430\u0433: \u0442\u0438\u043f\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0442\u043e\u043a \u0441\u043e\u0431\u044b\u0442\u0438\u0439\u0412 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435 \u0440\u0430\u0431\u043e\u0442\u0430 \u0430\u0433\u0435\u043d\u0442\u0430 \u2014 \u044d\u0442\u043e \u0431\u0435\u0433\u0443\u0449\u0438\u0439 \u0442\u0435\u043a\u0441\u0442. \u0427\u0435\u0440\u0435\u0437 ACP \u043e\u043d\u0430 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u0438\u043f\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0442\u043e\u043a \u0441\u043e\u0431\u044b\u0442\u0438\u0439, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f.\u0420\u0430\u0431\u043e\u0442\u0430 \u0430\u0433\u0435\u043d\u0442\u0430 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c\u044b\u043c \u043f\u043e\u0442\u043e\u043a\u043e\u043c \u0442\u0438\u043f\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u0439\u041f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c\u0441\u044f \u043d\u0430 \u0441\u0442\u0440\u0438\u043c \u043f\u0440\u043e\u0433\u043e\u043d\u0430 \u0438 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043f\u043e \u0442\u0438\u043f\u0430\u043c:from ag2 import Agentfrom ag2.acp import ClaudeCodeConfigfrom ag2.events import ModelMessageChunk, ModelReasoningfrom ag2.events.tool_events import BuiltinToolCallEventfrom ag2.acp.events import ACPPlanagent = Agent(&#171;coder&#187;, config=ClaudeCodeConfig(cwd=&#187;\/path\/to\/repo&#187;))def observe(event):    if isinstance(event, ModelReasoning):        print(&#171;\ud83d\udcad&#187;, event.content)              # \u0430\u0433\u0435\u043d\u0442 \u0434\u0443\u043c\u0430\u0435\u0442    elif isinstance(event, ModelMessageChunk):        print(event.content, end=&#187;&#187;)            # \u0442\u0435\u043a\u0441\u0442 \u043e\u0442\u0432\u0435\u0442\u0430 \u043f\u043e \u043a\u0443\u0441\u043a\u0430\u043c    elif isinstance(event, BuiltinToolCallEvent):        print(f&#187;\ud83d\udd27 {event.name}({event.arguments})&#187;) # \u043f\u043e\u0448\u0451\u043b \u0432 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430    elif isinstance(event, ACPPlan):        for step in event.entries:            print(f&#187;  [{step.status}] {step.content}&#187;)  # \u043f\u043b\u0430\u043d \u0440\u0430\u0431\u043e\u0442\u044basync with agent.run(&#171;\u0414\u043e\u0431\u0430\u0432\u044c healthcheck-\u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442&#187;) as run:    run.stream.subscribe(observe)   # \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f \u0434\u043e \u0441\u0442\u0430\u0440\u0442\u0430    reply = await run.result()\u041a\u0430\u0436\u0434\u044b\u0439 \u0442\u0438\u043f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0432 ACP \u043b\u043e\u0436\u0438\u0442\u0441\u044f \u043d\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 AG2:\u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 ACP\u0421\u043e\u0431\u044b\u0442\u0438\u0435 AG2\u0442\u0435\u043a\u0441\u0442 \u0430\u0433\u0435\u043d\u0442\u0430ModelMessageChunk \u2192 \u0438\u0442\u043e\u0433\u043e\u0432\u044b\u0439 ModelResponse\u0440\u0430\u0437\u043c\u044b\u0448\u043b\u0435\u043d\u0438\u044fModelReasoning\u0432\u044b\u0437\u043e\u0432 \/ \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430BuiltinToolCallEvent \/ BuiltinToolResultEvent\u043f\u043b\u0430\u043d \u0440\u0430\u0431\u043e\u0442\u044bACPPlan\u0441\u043c\u0435\u043d\u0430 \u0440\u0435\u0436\u0438\u043c\u0430ACPModeChange\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044bACPAvailableCommands\u00ab\u0427\u0451\u0440\u043d\u044b\u0439 \u044f\u0449\u0438\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0447\u0442\u043e-\u0442\u043e \u043f\u0435\u0447\u0430\u0442\u0430\u0435\u0442 \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u00bb \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441: \u043c\u043e\u0436\u043d\u043e \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u043e\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435, \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0438\u0437 \u043d\u0435\u0433\u043e UI, \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0442\u043e\u043a\u0435\u043d\u044b, \u043b\u043e\u0432\u0438\u0442\u044c \u043c\u043e\u043c\u0435\u043d\u0442, \u043a\u043e\u0433\u0434\u0430 \u0430\u0433\u0435\u043d\u0442 \u043f\u043e\u043b\u0435\u0437 \u043d\u0435 \u0442\u0443\u0434\u0430. \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043d\u0430\u043a\u043e\u043d\u0435\u0446 \u0432\u0438\u0434\u0438\u0442, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u0430\u0433\u0435\u043d\u0442, \u2014 \u0430 \u043d\u0435 \u043f\u0430\u0440\u0441\u0438\u0442 \u0435\u0433\u043e \u0432\u044b\u0432\u043e\u0434.\u041f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c: \u0440\u0443\u043a\u043e\u043f\u043e\u0436\u0430\u0442\u0438\u0435 \u0438 \u0436\u0438\u0437\u043d\u044c \u0441\u0435\u0441\u0441\u0438\u0438\u0415\u0441\u043b\u0438 \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u00ab\u043c\u0430\u0433\u0438\u044e\u00bb \u0438\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u043e\u0431\u043c\u0435\u043d \u043f\u043e ACP \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:\u250c\u2500 \u0425\u043e\u0441\u0442 (\u0432\u0430\u0448 \u043a\u043e\u0434) \u2500\u2510                          \u250c\u2500 \u0410\u0433\u0435\u043d\u0442 (subprocess) \u2500\u2510\u2502                  \u2502   initialize             \u2502                      \u2502\u2502                  \u2502 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u25ba \u2502  \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043b\u0438         \u2502\u2502                  \u2502 \u25c4\u2500\u2500\u2500\u2500\u2500 capabilities \u2500\u2500\u2500\u2500 \u2502  \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438         \u2502\u2502                  \u2502                          \u2502                      \u2502\u2502                  \u2502   session\/new (cwd, \u2026)   \u2502                      \u2502\u2502                  \u2502 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u25ba \u2502  \u0437\u0430\u0432\u0435\u043b\u0438 \u0441\u0435\u0441\u0441\u0438\u044e       \u2502\u2502                  \u2502 \u25c4\u2500\u2500\u2500\u2500 session_id \u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2502                      \u2502\u2502                  \u2502                          \u2502                      \u2502\u2502                  \u2502&#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-487320","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/487320","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=487320"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/487320\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=487320"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=487320"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=487320"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}