@easbot/acp 0.3.29 → 0.3.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/README.en.md +54 -27
  2. package/README.md +85 -34
  3. package/dist/chunks/bootstrap-GGS3N5CF.cjs +1 -0
  4. package/dist/chunks/bootstrap-MZQICOGZ.mjs +1 -0
  5. package/dist/chunks/cache-3R3ORBTY.cjs +1 -0
  6. package/dist/chunks/cache-76CBF3LU.mjs +1 -0
  7. package/dist/chunks/chunk-2KOCPHVP.mjs +1 -0
  8. package/dist/chunks/chunk-33M2R2US.mjs +1 -0
  9. package/dist/chunks/chunk-3DHMW4DB.mjs +11 -0
  10. package/dist/chunks/chunk-5HWD3B3N.cjs +11 -0
  11. package/dist/chunks/chunk-7RWES66A.cjs +2 -0
  12. package/dist/chunks/chunk-B3ANZALB.mjs +2 -0
  13. package/dist/chunks/chunk-BNSJ6COS.cjs +1 -0
  14. package/dist/chunks/chunk-D4TSQ2TT.mjs +0 -0
  15. package/dist/chunks/chunk-D7S7ARXV.mjs +8 -0
  16. package/dist/chunks/chunk-DX35VSAT.cjs +1 -0
  17. package/dist/chunks/chunk-ITV7SWGU.cjs +8 -0
  18. package/dist/chunks/chunk-JLO7UYKQ.cjs +1 -0
  19. package/dist/chunks/chunk-NHXAYBZH.mjs +1 -0
  20. package/dist/chunks/chunk-PATHHDWE.mjs +1 -0
  21. package/dist/chunks/chunk-RHW6YR3D.mjs +2 -0
  22. package/dist/chunks/chunk-SNWAB3QJ.cjs +2 -0
  23. package/dist/chunks/chunk-VVGGER23.cjs +1 -0
  24. package/dist/chunks/chunk-Z3YEK7DD.cjs +1 -0
  25. package/dist/chunks/cli-handler-6XB6B5DV.mjs +1 -0
  26. package/dist/chunks/cli-handler-IU3YUTOU.cjs +1 -0
  27. package/dist/chunks/config-FTGKCGYZ.mjs +1 -0
  28. package/dist/chunks/config-ZVDYJ7TW.cjs +1 -0
  29. package/dist/chunks/interfaces-6ZCF5T55.cjs +1 -0
  30. package/dist/chunks/{interfaces-UB3BFHJN.mjs → interfaces-TXNKX4HT.mjs} +1 -1
  31. package/dist/chunks/loader-3KX33KJQ.cjs +1 -0
  32. package/dist/chunks/loader-6HBCWO6Y.mjs +1 -0
  33. package/dist/chunks/types-BZWPIPG6.mjs +1 -0
  34. package/dist/chunks/types-R3VOD4XE.cjs +1 -0
  35. package/dist/cli.cjs +1 -1
  36. package/dist/cli.mjs +1 -1
  37. package/dist/index.cjs +1 -1
  38. package/dist/index.d.cts +1157 -374
  39. package/dist/index.d.ts +1157 -374
  40. package/dist/index.mjs +1 -1
  41. package/package.json +5 -5
  42. package/dist/chunks/bootstrap-5LQOAO3Q.cjs +0 -1
  43. package/dist/chunks/bootstrap-VXDGNMPK.mjs +0 -1
  44. package/dist/chunks/cache-EJ4Y2PSY.cjs +0 -1
  45. package/dist/chunks/cache-SOYLU2DS.mjs +0 -1
  46. package/dist/chunks/chunk-3OTURNTA.cjs +0 -11
  47. package/dist/chunks/chunk-CIOYWMQM.cjs +0 -1
  48. package/dist/chunks/chunk-DS4SO4NN.cjs +0 -2
  49. package/dist/chunks/chunk-ER7EK5Z3.mjs +0 -8
  50. package/dist/chunks/chunk-F44AHCPJ.cjs +0 -8
  51. package/dist/chunks/chunk-HA3RF4AE.cjs +0 -1
  52. package/dist/chunks/chunk-MFINI6BI.mjs +0 -1
  53. package/dist/chunks/chunk-PEMSMRYT.mjs +0 -1
  54. package/dist/chunks/chunk-RTXRNSMY.mjs +0 -1
  55. package/dist/chunks/chunk-SHXWJMFY.mjs +0 -11
  56. package/dist/chunks/chunk-UTBY7IJT.mjs +0 -2
  57. package/dist/chunks/chunk-Z4D2PWDQ.cjs +0 -1
  58. package/dist/chunks/cli-handler-2KK2I4DG.mjs +0 -1
  59. package/dist/chunks/cli-handler-EM2BY47U.cjs +0 -1
  60. package/dist/chunks/config-KX5CSYLV.mjs +0 -1
  61. package/dist/chunks/config-YIR7GKPG.cjs +0 -1
  62. package/dist/chunks/interfaces-6BMD3FTB.cjs +0 -1
  63. package/dist/chunks/types-CHN33Z37.mjs +0 -1
  64. package/dist/chunks/types-XGBPFI7X.cjs +0 -1
@@ -1,11 +0,0 @@
1
- import {b}from'./chunk-MFINI6BI.mjs';import {NamedError,Log,NameErrors,ServiceErrorBus,errorMeta}from'@easbot/utils';export{ServiceError as k}from'@easbot/utils';import {emitJsonOk,printHuman,emitJsonError,formatSuccess,formatKeyValue,formatError,Symbol,colorize,isRich,theme}from'@easbot/terminal';import g from'zod';var G={languages:[{value:"zh-CN",name:"\u7B80\u4F53\u4E2D\u6587",example:"\u4F60\u597D\uFF0CEASBOT\uFF01",supported:true},{value:"en-US",name:"English (United States)",example:"Hello, EASBOT!",supported:true}]};var pe=G.languages,fe=pe.filter(e=>e.supported).map(e=>e.value),E={defaultLocale:"zh-CN",timeZone:"Asia/Shanghai",locales:fe},R={},D=(e,i)=>{let o=R[e]||{translation:{}};return R[e]={translation:{...o.translation,...i.translation}},R[e]},I=(e=E.defaultLocale)=>(R[e]||D(e,{translation:{}}),{locale:e,resources:R[e]||{translation:{}}}),Fe=e=>I(e),ze=e=>R[e];var ge={translation:{"cli.banner.title":"easbot-acp \u2014 EASBot ACP\uFF08Agent Communication Protocol\uFF09\u9002\u914D\u5C42","cli.banner.usage":"\u7528\u6CD5: easbot-acp <command> [options]","cli.banner.section.lifecycle":"\u547D\u4EE4\uFF08\u751F\u547D\u5468\u671F\uFF09:","cli.banner.section.server":"\u547D\u4EE4\uFF08\u670D\u52A1\uFF09:","cli.banner.section.external":"\u5916\u90E8\u63A5\u53E3:","cli.banner.hint.run_help":"\u8FD0\u884C `easbot-acp <command> --help` \u67E5\u770B\u8BE6\u60C5\u3002","cli.banner.global_flags":"\u5168\u5C40\u9009\u9879: --cwd <dir> --config <path> --log-level <L> --print-logs --debug","cli.banner.local.title":"\u72EC\u7ACB CLI:","cli.banner.local.agent":"Agent CLI \u7528\u6237: `easbot acp <command> ...`","cli.banner.local.standalone":"\u72EC\u7ACB\u7528\u6237: `easbot-acp <command> ...`","cli.cmd.init.description":"\u521D\u59CB\u5316 acp \u5DE5\u4F5C\u533A\uFF08\u521B\u5EFA .easbot/acp.json\uFF09","cli.cmd.status.description":"\u663E\u793A acp \u914D\u7F6E\u6458\u8981\uFF08\u670D\u52A1\u901A\u9053 / \u7AEF\u53E3 / \u5BA2\u6237\u7AEF\uFF09","cli.cmd.doctor.description":"\u8FD0\u884C\u5065\u5EB7\u68C0\u67E5\uFF08\u914D\u7F6E\u53EF\u52A0\u8F7D / schema \u5408\u6CD5 / \u4F9D\u8D56\u5B8C\u6574\uFF09","cli.cmd.start.description":"\u542F\u52A8 ACP \u670D\u52A1\uFF08stdio / http / websocket\uFF09\u5E76\u963B\u585E","cli.cmd.config.description":"\u663E\u793A / \u66F4\u65B0 acp \u914D\u7F6E\uFF08get / set key=value\uFF09","cli.shared.show_help":"\u663E\u793A\u6B64\u5E2E\u52A9","cli.init.usage":"\u7528\u6CD5: easbot-acp init [--channel <stdio|http|websocket>] [--port <n>] [--hostname <addr>] [--force] [--json]","cli.init.opt.channel":"--channel \u9ED8\u8BA4\u901A\u9053\uFF08\u9ED8\u8BA4 websocket\uFF09","cli.init.opt.port":"--port HTTP/WebSocket \u7AEF\u53E3\uFF08\u9ED8\u8BA4 3000\uFF09","cli.init.opt.hostname":"--hostname \u4E3B\u673A\u540D\uFF08\u9ED8\u8BA4 localhost\uFF09","cli.init.opt.force":"--force, -f \u8986\u76D6\u5DF2\u5B58\u5728\u7684\u914D\u7F6E","cli.init.opt.json":"--json \u4EE5 JSON \u683C\u5F0F\u8F93\u51FA\uFF08\u65E0 ANSI\uFF09","cli.init.exists":"acp \u914D\u7F6E\u5DF2\u5B58\u5728\u4E8E {{path}}\uFF08\u4F7F\u7528 --force \u8986\u76D6\uFF09","cli.init.created":"\u2713 acp \u914D\u7F6E\u5DF2\u521D\u59CB\u5316\u5230 {{path}}","cli.init.title":"\u521D\u59CB\u5316 acp \u5DE5\u4F5C\u533A","cli.init.error.title":"\u521D\u59CB\u5316\u5931\u8D25","cli.init.error.field":"\u8DEF\u5F84","cli.init.error.hint":"\u4F7F\u7528 --force \u8986\u76D6\uFF0C\u6216\u76F4\u63A5\u7F16\u8F91\u5DF2\u6709\u6587\u4EF6\u3002","cli.start.usage":"\u7528\u6CD5: easbot-acp start [--channel <stdio|http|websocket>] [--port <n>] [--hostname <addr>] [--timeout <ms>]","cli.start.description":"\u542F\u52A8 ACP \u670D\u52A1\uFF0C\u963B\u585E\u76F4\u5230 Ctrl+C / SIGTERM\u3002","cli.start.channel_default":"\u901A\u9053\u9ED8\u8BA4\u503C\u4E3A acp.json \u4E2D\u7684 server.channel\uFF08\u9ED8\u8BA4: websocket\uFF09\u3002","cli.start.opt.channel":"--channel \u901A\u9053\u7C7B\u578B\uFF08\u8986\u76D6\u914D\u7F6E\u6587\u4EF6\uFF09","cli.start.opt.port":"--port \u7AEF\u53E3\uFF08\u9ED8\u8BA4 3000\uFF09","cli.start.opt.hostname":"--hostname \u4E3B\u673A\u540D\uFF08\u9ED8\u8BA4 localhost\uFF09","cli.start.opt.timeout":"--timeout <ms> \u8BF7\u6C42\u8D85\u65F6\uFF08\u6BEB\u79D2\uFF09","cli.status.usage":"\u7528\u6CD5: easbot-acp status [--json]","cli.status.field.directory":"\u5DE5\u4F5C\u76EE\u5F55","cli.status.field.server":"\u670D\u52A1","cli.status.field.server_channel":"\u670D\u52A1\u901A\u9053","cli.status.field.server_port":"\u670D\u52A1\u7AEF\u53E3","cli.status.field.server_hostname":"\u670D\u52A1\u4E3B\u673A\u540D","cli.status.field.server_enabled":"\u670D\u52A1\u542F\u7528","cli.status.field.clients":"\u5BA2\u6237\u7AEF\u6570\u91CF","cli.doctor.usage":"\u7528\u6CD5: easbot-acp doctor [--json]","cli.doctor.field.acp_json_path":"acp.json \u8DEF\u5F84","cli.doctor.field.acp_json_exists":"acp.json \u5B58\u5728","cli.doctor.field.config_loadable":"\u914D\u7F6E\u53EF\u52A0\u8F7D","cli.doctor.field.config_error":"\u914D\u7F6E\u9519\u8BEF","cli.doctor.field.sdk_version":"SDK \u7248\u672C","cli.doctor.yes":"\u662F","cli.doctor.no":"\u5426","cli.config.usage":"\u7528\u6CD5: easbot-acp config <get|set> [key] [value] [--json]","cli.config.description":"\u8BFB\u53D6\u6216\u5199\u5165 acp \u914D\u7F6E\u3002","cli.config.subcommands":"\u5B50\u547D\u4EE4:","cli.config.get_help":"get [key] \u663E\u793A\u5168\u90E8\u5B57\u6BB5\uFF08\u6216\u6307\u5B9A key\uFF09","cli.config.set_help":"set <key> <value> \u66F4\u65B0\u5B57\u6BB5\uFF08\u81EA\u52A8\u8BC6\u522B number / boolean\uFF09","cli.config.examples":"\u793A\u4F8B:","cli.config.example_get":" easbot-acp config get server.channel","cli.config.example_set":" easbot-acp config set server.port 8080","cli.config.opt.json":"--json \u4EE5 JSON \u683C\u5F0F\u8F93\u51FA","cli.config.no_subcommand":"config \u9700\u8981\u5B50\u547D\u4EE4: get | set","cli.config.invalid_key":"\u65E0\u6548\u7684 key: {{key}}","cli.config.set_done":"\u2713 \u5DF2\u8BBE\u7F6E {{key}} = {{value}}","cli.config.get_done":"{{key}}: {{value}}","cli.config.field.key":"key","cli.config.field.value":"\u503C","cli.config.error.invalid_key.title":"\u65E0\u6548\u7684 key","cli.config.error.field.key":"key","cli.config.error.invalid_key.hint":'\u4F7F\u7528\u70B9\u53F7\u8DEF\u5F84\uFF0C\u4F8B\u5982 "server.channel"\u3002',"cli.config.error.no_subcommand.title":"\u7F3A\u5C11\u5B50\u547D\u4EE4","cli.config.error.no_subcommand.hint":'\u4F7F\u7528 "easbot-acp config get [key]" \u6216 "easbot-acp config set <key> <value>"\u3002',"acp.cli.command_failed":"acp CLI \u547D\u4EE4\u5931\u8D25","acp.cli.command_failed_title":"\u547D\u4EE4\u6267\u884C\u5931\u8D25","acp.cli.error_prefix":"[acp] {{cwd}} :: {{command}} \u5931\u8D25: {{message}}","acp.cli.error.field.command":"\u547D\u4EE4","acp.cli.error_hint":"\u4F7F\u7528 --debug \u91CD\u8DD1\u4EE5\u67E5\u770B\u5B8C\u6574\u5806\u6808\u3002","acp.cli.json_error_failed":"JSON \u8F93\u51FA\u5931\u8D25: {{message}}","acp.error.unknown_command":"\u672A\u77E5\u547D\u4EE4: {{command}}","acp.error.unknown_command.title":"\u672A\u77E5\u547D\u4EE4","acp.error.unknown_command.field":"\u547D\u4EE4","acp.error.field_label":"\u5B57\u6BB5","acp.error.message_label":"\u6D88\u606F","acp.error.hint_label":"\u63D0\u793A","acp.start.bootstrapping":"\u6B63\u5728\u542F\u52A8 ACP \u670D\u52A1","acp.start.started":"ACP \u670D\u52A1\u542F\u52A8\u6210\u529F","acp.server.started":"ACP \u670D\u52A1\u5DF2\u542F\u52A8","acp.server.started_head":"ACP \u670D\u52A1\u5DF2\u542F\u52A8","acp.field.directory":"\u5DE5\u4F5C\u76EE\u5F55","acp.field.channel":"\u901A\u9053","acp.field.host":"\u5730\u5740","acp.field.timeout":"\u8D85\u65F6","acp.field.proxy":"\u4EE3\u7406","acp.shutdown.received":"\u6536\u5230\u4FE1\u53F7 {{signal}}\uFF0C\u6B63\u5728\u5173\u95ED","acp.shutdown.error":"\u5173\u95ED\u8FC7\u7A0B\u4E2D\u51FA\u9519","acp.shutdown.destroy_error":"EasbotAdapter.destroy \u5931\u8D25","acp.shutdown.stdout_broken":"stdout pipe \u65AD\u5F00\uFF0C\u8FDB\u7A0B\u9000\u51FA","acp.error.config_not_found":"acp \u914D\u7F6E\u672A\u627E\u5230; \u8BF7\u5148\u8FD0\u884C `easbot-acp init` \u521B\u5EFA .easbot/acp.json","acp.error.config_validation":"acp \u914D\u7F6E schema \u6821\u9A8C\u5931\u8D25: {{path}}","acp.error.server_start_failed":"\u670D\u52A1\u542F\u52A8\u5931\u8D25\uFF08\u901A\u9053={{channel}}, \u7AEF\u53E3={{port}}, code={{code}}\uFF09","acp.error.client_connection_failed":"\u5BA2\u6237\u7AEF\u8FDE\u63A5\u5931\u8D25\uFF08clientId={{clientId}}, \u901A\u9053={{channel}}\uFF09","acp.error.rpc_parse_failed":"JSON-RPC frame \u89E3\u6790\u5931\u8D25\uFF08method={{method}}\uFF09"}},H=ge;var ue={translation:{"cli.banner.title":"easbot-acp \u2014 EASBot ACP (Agent Communication Protocol) Adapter","cli.banner.usage":"Usage: easbot-acp <command> [options]","cli.banner.section.lifecycle":"Commands (lifecycle):","cli.banner.section.server":"Commands (server):","cli.banner.section.external":"External:","cli.banner.hint.run_help":"Run `easbot-acp <command> --help` for details.","cli.banner.global_flags":"Global flags: --cwd <dir> --config <path> --log-level <L> --print-logs --debug","cli.banner.local.title":"Standalone CLI:","cli.banner.local.agent":"Agent CLI users: `easbot acp <command> ...`","cli.banner.local.standalone":"Standalone users: `easbot-acp <command> ...`","cli.cmd.init.description":"Initialize acp workspace (creates .easbot/acp.json)","cli.cmd.status.description":"Show acp config summary (server channel / port / clients)","cli.cmd.doctor.description":"Run health checks (config loadable / schema valid / deps)","cli.cmd.start.description":"Start ACP server (stdio / http / websocket) and block","cli.cmd.config.description":"Show / update acp configuration (get / set key=value)","cli.shared.show_help":"Show this help","cli.init.usage":"Usage: easbot-acp init [--channel <stdio|http|websocket>] [--port <n>] [--hostname <addr>] [--force] [--json]","cli.init.opt.channel":"--channel Default channel (default: websocket)","cli.init.opt.port":"--port HTTP/WebSocket port (default: 3000)","cli.init.opt.hostname":"--hostname Hostname (default: localhost)","cli.init.opt.force":"--force, -f Overwrite existing config","cli.init.opt.json":"--json Output as JSON (no ANSI)","cli.init.exists":"acp config already exists at {{path}} (use --force to overwrite)","cli.init.created":"\u2713 acp config initialized at {{path}}","cli.init.title":"init acp workspace","cli.init.error.title":"init failed","cli.init.error.field":"path","cli.init.error.hint":"Pass --force to overwrite, or edit the existing file.","cli.start.usage":"Usage: easbot-acp start [--channel <stdio|http|websocket>] [--port <n>] [--hostname <addr>] [--timeout <ms>]","cli.start.description":"Start an ACP server. Blocks until Ctrl+C / SIGTERM.","cli.start.channel_default":"Channel defaults to acp.json server.channel (default: websocket).","cli.start.opt.channel":"--channel Channel type (overrides config file)","cli.start.opt.port":"--port Port (default: 3000)","cli.start.opt.hostname":"--hostname Hostname (default: localhost)","cli.start.opt.timeout":"--timeout <ms> Request timeout in milliseconds","cli.status.usage":"Usage: easbot-acp status [--json]","cli.status.field.directory":"directory","cli.status.field.server":"server","cli.status.field.server_channel":"server.channel","cli.status.field.server_port":"server.port","cli.status.field.server_hostname":"server.hostname","cli.status.field.server_enabled":"server.enabled","cli.status.field.clients":"clients","cli.doctor.usage":"Usage: easbot-acp doctor [--json]","cli.doctor.field.acp_json_path":"acp.json path","cli.doctor.field.acp_json_exists":"acp.json exists","cli.doctor.field.config_loadable":"config loadable","cli.doctor.field.config_error":"config error","cli.doctor.field.sdk_version":"SDK version","cli.doctor.yes":"yes","cli.doctor.no":"no","cli.config.usage":"Usage: easbot-acp config <get|set> [key] [value] [--json]","cli.config.description":"Read or write acp configuration.","cli.config.subcommands":"Subcommands:","cli.config.get_help":"get [key] Show all fields (or a specific key)","cli.config.set_help":"set <key> <value> Update a field (auto-detects number / boolean)","cli.config.examples":"Examples:","cli.config.example_get":" easbot-acp config get server.channel","cli.config.example_set":" easbot-acp config set server.port 8080","cli.config.opt.json":"--json Output as JSON","cli.config.no_subcommand":"config requires a subcommand: get | set","cli.config.invalid_key":"Invalid key: {{key}}","cli.config.set_done":"\u2713 set {{key}} = {{value}}","cli.config.get_done":"{{key}}: {{value}}","cli.config.field.key":"key","cli.config.field.value":"value","cli.config.error.invalid_key.title":"invalid key","cli.config.error.field.key":"key","cli.config.error.invalid_key.hint":'Use dotted path like "server.channel".',"cli.config.error.no_subcommand.title":"missing subcommand","cli.config.error.no_subcommand.hint":'Use "easbot-acp config get [key]" or "easbot-acp config set <key> <value>".',"acp.cli.command_failed":"acp CLI command failed","acp.cli.command_failed_title":"command failed","acp.cli.error_prefix":"[acp] {{cwd}} :: {{command}} failed: {{message}}","acp.cli.error.field.command":"command","acp.cli.error_hint":"Re-run with --debug for full stack.","acp.cli.json_error_failed":"JSON output failed: {{message}}","acp.error.unknown_command":"Unknown command: {{command}}","acp.error.unknown_command.title":"unknown command","acp.error.unknown_command.field":"command","acp.error.field_label":"field","acp.error.message_label":"message","acp.error.hint_label":"hint","acp.start.bootstrapping":"Bootstrapping ACP server","acp.start.started":"ACP server started successfully","acp.server.started":"ACP Server Started","acp.server.started_head":"ACP Server Started","acp.field.directory":"directory","acp.field.channel":"channel","acp.field.host":"host","acp.field.timeout":"timeout","acp.field.proxy":"proxy","acp.shutdown.received":"Received signal {{signal}}, shutting down...","acp.shutdown.error":"Error during shutdown","acp.shutdown.destroy_error":"EasbotAdapter.destroy failed","acp.shutdown.stdout_broken":"stdout pipe broken, exiting","acp.error.config_not_found":"acp config not found; run `easbot-acp init` first to create .easbot/acp.json","acp.error.config_validation":"acp config schema validation failed: {{path}}","acp.error.server_start_failed":"server start failed (channel={{channel}}, port={{port}}, code={{code}})","acp.error.client_connection_failed":"client connection failed (clientId={{clientId}}, channel={{channel}})","acp.error.rpc_parse_failed":"JSON-RPC frame parse failed (method={{method}})"}},K=ue;var me=()=>{I("zh-CN"),I("en-US"),D("zh-CN",H),D("en-US",K);};me();var J=new Map;var he=e=>{if(J.has(e))return J.get(e);let i=/{{\s*(\w+)\s*}}/g,o=[],n;for(;(n=i.exec(e))!==null;){let a=n[1];a&&!o.includes(a)&&o.push(a);}let c=new RegExp("{{\\s*("+o.join("|")+")\\s*}}","g"),r={keys:o,regex:c};return J.set(e,r),r},V=(e,i)=>{if(!e||typeof e!="string")return "";if(!i||Object.keys(i).length===0)return e;let{regex:o,keys:n}=he(e);return n.length===0||!n.some(r=>r in i)?e:e.replace(o,(r,a)=>{let p=i[a];return p==null?"":String(p)})},q=e=>{if(e&&E.locales.includes(e))return e;let i=process.env.EASBOT_LANG?.trim()||process.env.LANG?.trim();if(i){let o=i.replace(/_/g,"-");if(E.locales.includes(o))return o;let n=o.split("-")[0];if(n==="zh")return "zh-CN";if(n==="en")return "en-US"}return E.defaultLocale},M=e=>I(e).resources,W=(e,i={})=>{let o=q(i.locale),c=M(o)?.translation[e];if(c&&typeof c=="string"){let r=V(c,i.vars);return r!=null?String(r):String(e)}if(o!==E.defaultLocale){let a=M(E.defaultLocale)?.translation[e];if(a&&typeof a=="string"){let p=V(a,i.vars);return p!=null?String(p):String(e)}}return String(i.fallback??e)},t=W,Xe=(e,i={})=>({message:W(e,i),locale:q(i.locale),context:i.context??{}});var st=NameErrors,Z;(r=>(r.ConfigNotFoundError=NamedError.create("AcpConfigNotFoundError",g.object({message:g.string(),path:g.string()})),r.ConfigValidationError=NamedError.create("AcpConfigValidationError",g.object({message:g.string(),path:g.string().optional()})),r.ServerStartFailedError=NamedError.create("AcpServerStartFailedError",g.object({message:g.string(),channel:g.string().optional(),port:g.number().optional(),code:g.string().optional()})),r.ClientConnectionFailedError=NamedError.create("AcpClientConnectionFailedError",g.object({message:g.string(),clientId:g.string().optional(),channel:g.string().optional(),code:g.string().optional()})),r.RpcParseFailedError=NamedError.create("AcpRpcParseFailedError",g.object({message:g.string(),frame:g.string().optional(),method:g.string().optional()}))))(Z||(Z={}));var ye=new Set(["NOT_FOUND","AMBIGUOUS","INTERNAL","CONNECTION_FAILED","SERVER_START_FAILED"]),ke={NOT_FOUND:"acp config not found; run acp init first to create .easbot/acp.json",INTERNAL:"acp service internal invariant broken; check acp.json schema + workspaceDir are non-empty",CONNECTION_FAILED:"remote ACP agent unreachable; verify channel (stdio/http/ws) + hostname/port + auth",SERVER_START_FAILED:"port may be in use; check --port and EADDRINUSE; verify --channel matches server capability"};async function Q(){await ServiceErrorBus.register("acp",ye,ke);}function X(){return {version:1,created_at:new Date().toISOString(),server:{enabled:true,channel:"websocket",port:3e3,hostname:"localhost",timeout:3e4,http:{baseUrl:"http://localhost:3000",timeout:3e5},ws:{url:"ws://localhost:3000",timeout:3e5,batchSize:10,batchInterval:50,heartbeatInterval:3e4}},clients:{clients:[{id:"easbot-self",name:"EasBot Self",type:"easbot",channel:"websocket",connection:{ws:{url:"ws://localhost:3000",timeout:3e5,batchSize:10,batchInterval:50,heartbeatInterval:3e4}},autoConnect:false,priority:0}],defaultClientId:"easbot-self"}}}b.WS;var Se={directory:"directory",server:"server",channel:"channel",port:"port",hostname:"hostname",enabled:"enabled",clients:"clients"},Ce={acpJsonPath:"acp.json path",acpJsonExists:"acp.json exists",configLoadable:"config loadable",configError:"config error",sdkVersion:"SDK version"},Ee={directory:"directory",channel:"channel",host:"host",timeout:"timeout"},Le={key:"key",value:"value"};function $(e){return e?Symbol.colorize("\u2713","success"):Symbol.colorize("\u2717","error")}function Re(e){return colorize(isRich(),theme.heading,e)}function ee(e){let i=[],o=e.skipped?"config already exists at":"initialized at",n=formatSuccess(`acp ${o} ${e.configPath}`);return i.push(n),e.channel!==void 0&&i.push(formatKeyValue("channel",e.channel)),i.join(`
2
- `)}function te(e,i){let o={...Se,...i},n=[];n.push(formatKeyValue(o.directory,e.directory)),n.push(` ${Re(o.server)}`);let c=e.server??{},r=c.channel??"websocket",a=c.port??3e3,p=c.hostname??"localhost",u=c.enabled??true;return n.push(` ${formatKeyValue(o.channel,r)}`),n.push(` ${formatKeyValue(o.port,String(a))}`),n.push(` ${formatKeyValue(o.hostname,p)}`),n.push(` ${formatKeyValue(o.enabled,$(u))}`),n.push(formatKeyValue(o.clients,String(e.clientCount))),n.join(`
3
- `)}function oe(e,i){let o={...Ce,...i},n=[];return n.push(formatKeyValue(o.acpJsonPath,e.acpJsonPath)),n.push(formatKeyValue(o.acpJsonExists,$(e.acpJsonExists))),n.push(formatKeyValue(o.configLoadable,$(e.configLoadable))),n.push(formatKeyValue(o.sdkVersion,e.sdkVersion)),!e.configLoadable&&e.configError&&n.push(formatKeyValue(o.configError,e.configError)),n.join(`
4
- `)}function ne(e,i){let o={...Ee,...i},n=[];return e.head&&n.push(formatSuccess(e.head)),n.push(formatKeyValue(o.directory,e.directory)),n.push(formatKeyValue(o.channel,e.channel)),n.push(formatKeyValue(o.host,e.host)),n.push(formatKeyValue(o.timeout,e.timeout)),n.join(`
5
- `)}function re(e,i){let o={...Le,...i},n=[],c=e.key??"(root)";return n.push(formatKeyValue(o.key,c)),n.push(formatKeyValue(o.value,e.value)),n.join(`
6
- `)}function ie(e){return formatSuccess(`set ${e.key} = ${e.value}`)}var Ie={field:"field",message:"message",hint:"hint"};function ae(e,i){let o={...Ie,...i},n=[];return n.push(formatError(e.title)),e.field!==void 0&&n.push(formatKeyValue(o.field,e.value??"")),n.push(formatKeyValue(o.message,e.message)),e.hint&&n.push(formatKeyValue(o.hint,e.hint)),n.join(`
7
- `)}var je=[{i18nKey:"cli.cmd.init.description",name:"init",description:"Initialize acp workspace (.easbot/acp.json)",group:"lifecycle"},{i18nKey:"cli.cmd.status.description",name:"status",description:"Show acp config summary (server channel / port / clients)",group:"lifecycle"},{i18nKey:"cli.cmd.doctor.description",name:"doctor",description:"Run health checks (config loadable, schema valid, deps)",group:"lifecycle"},{i18nKey:"cli.cmd.start.description",name:"start",description:"Start ACP server (stdio / http / websocket) and block",group:"server"},{i18nKey:"cli.cmd.config.description",name:"config",description:"Show / update acp configuration (get / set key=value)",group:"external"}];function N(e){return `\x1B[2m${e}\x1B[0m`}function se(e){return `\x1B[1m${e}\x1B[0m`}function Ne(e){return `\x1B[36m${e}\x1B[0m`}function Oe(){return N("$")}function F(e,i){let o=je.filter(c=>c.group===e),n=t(i);return `${se(n)}
8
- `+o.map(c=>` ${Oe()} easbot-acp ${c.name.padEnd(14)} ${N(t(c.i18nKey,{fallback:c.description}))}`).join(`
9
- `)}function De(){let e=[`${se(Ne("easbot-acp"))} \xB7 ${t("cli.banner.title",{fallback:"EASBot ACP (Agent Communication Protocol) Adapter"})}`,t("cli.banner.usage",{fallback:"Usage: easbot-acp <command> [options]"}),"",F("lifecycle","cli.banner.section.lifecycle"),"",F("server","cli.banner.section.server"),"",F("external","cli.banner.section.external")];console.log(e.join(`
10
- `));}function Ue(){De(),console.log(""),console.log(N(t("cli.banner.global_flags",{fallback:"Global flags: --cwd <dir> --config <path> --log-level <L> --print-logs --debug"}))),console.log(N(`${t("cli.banner.local.standalone",{fallback:"Standalone users"})}: easbot-acp <command>`)),console.log(N(`${t("cli.banner.local.agent",{fallback:"Agent CLI users"})}: easbot acp <command>`));}var _=Log.create({service:"acp-cli"}),ce=false;async function Je(){if(!ce){ce=true;try{await Q();}catch(e){_.warn("registerBusinessErrors failed",{error:errorMeta(e)});}}}function j(e,i,o,n){let c=n?.exitCode??1;if(i)emitJsonError(e,o.message);else {let r=n?.labels??{field:t("acp.error.field_label",{fallback:"field"}),message:t("acp.error.message_label",{fallback:"message"}),hint:t("acp.error.hint_label",{fallback:"hint"})};printHuman([ae(o,r)],{title:"error",boxed:true,tone:"error",stream:"stderr"});}return {code:c,handled:c===1,command:c===1?e:null}}async function At(e,i){let[o,...n]=e;if(!o)return Ue(),{code:0,handled:true,command:null};await Je();let c=n.includes("--json");try{switch(o){case "init":{if(n.includes("--help")||n.includes("-h"))return console.log(t("cli.init.usage")),console.log(""),console.log(t("cli.init.opt.channel")),console.log(t("cli.init.opt.port")),console.log(t("cli.init.opt.hostname")),console.log(t("cli.init.opt.force")),console.log(t("cli.init.opt.json")),{code:0,handled:!0,command:o};let{AcpCache:r}=await import('./cache-SOYLU2DS.mjs'),a=await r.getConfigPath(),p=await r.exists(),u=n.includes("--force");if(p&&!u){let l=t("cli.init.exists",{vars:{path:a}});return _.warn(l),j(o,c,{title:t("cli.init.error.title",{fallback:"init failed"}),field:t("cli.init.error.field",{fallback:"path"}),value:a,message:l,hint:t("cli.init.error.hint",{fallback:"Pass --force to overwrite, or edit the existing file."})})}let s=X();for(let l=0;l<n.length;l++){let h=n[l],m=n[l+1];h==="--channel"&&m?(s.server={...s.server??{},channel:m},l++):h==="--port"&&m?(s.server={...s.server??{},port:Number(m)},l++):h==="--hostname"&&m&&(s.server={...s.server??{},hostname:m},l++);}await r.writeAcpJson(s);let b={configPath:a},d=s.server?.channel;return c?emitJsonOk(b,{command:o}):printHuman([ee({configPath:a,channel:d})],{title:t("cli.init.title",{fallback:"init acp workspace"}),boxed:!0}),{code:0,handled:!0,command:o}}case "start":{if(n.includes("--help")||n.includes("-h"))return console.log(t("cli.start.usage")),console.log(""),console.log(t("cli.start.description")),console.log(t("cli.start.channel_default")),console.log(""),console.log(t("cli.start.opt.channel")),console.log(t("cli.start.opt.port")),console.log(t("cli.start.opt.hostname")),console.log(t("cli.start.opt.timeout")),{code:0,handled:!0,command:o};let r={};for(let v=0;v<n.length;v++){let C=n[v],y=n[v+1];C==="--channel"&&y?(r.channel=y,v++):C==="--port"&&y?(r.port=Number(y),v++):C==="--hostname"&&y?(r.hostname=y,v++):C==="--timeout"&&y&&(r.timeout=Number(y),v++);}let{loadConfig:a}=await import('./config-KX5CSYLV.mjs'),s={...(await a()).server??{}};r.channel!==void 0&&(s.channel=r.channel),r.port!==void 0&&(s.port=r.port),r.hostname!==void 0&&(s.hostname=r.hostname),r.timeout!==void 0&&(s.timeout=r.timeout);let b=s.channel??"websocket",d=b==="stdio"||b==="http"||b==="websocket"?b:"websocket",l=typeof s.port=="number"?s.port:3e3,h=typeof s.hostname=="string"?s.hostname:"localhost",m=typeof s.timeout=="number"?s.timeout:3e4;_.info(t("acp.start.bootstrapping"),{channel:d,port:l,hostname:h,timeout:m});let{EasbotAdapter:k}=await import('./bootstrap-VXDGNMPK.mjs'),{ChannelType:A}=await import('./types-CHN33Z37.mjs');await k.init({directory:i?.cwd??process.cwd(),printLogs:!1,logLevel:"INFO",channel:d==="stdio"?A.STDIO:d==="http"?A.HTTP:A.WS});let S=await k.ensureACPService({directory:i?.cwd??process.cwd(),enabled:!0,channel:d,port:l,hostname:h,timeout:m});_.info(t("acp.start.started"),{type:S.server?.type,url:S.server?.type==="websocket"?`ws://${h}:${l}`:S.server?.type==="http"?`http://${h}:${l}`:"stdio://local"});let le={directory:t("acp.field.directory"),channel:t("acp.field.channel"),host:t("acp.field.host"),timeout:t("acp.field.timeout")};printHuman([ne({directory:i?.cwd??process.cwd(),channel:d,host:`${h}:${l}`,timeout:`${m}ms`,head:t("acp.server.started_head",{fallback:"ACP Server Started"})},le)],{title:t("acp.server.started"),boxed:!0}),await new Promise(v=>{let C=!1,y=O=>{C||(C=!0,_.info(t("acp.shutdown.received"),{signal:O}),v());};process.once("SIGINT",()=>y("SIGINT")),process.once("SIGTERM",()=>y("SIGTERM")),process.stdout.on("error",O=>{(O.code==="EPIPE"||O.code==="EIO")&&(_.info(t("acp.shutdown.stdout_broken")),y("STDOUT-BROKEN"));});});try{await k.destroy();}catch(v){_.warn(t("acp.shutdown.destroy_error"),{error:errorMeta(v)});}return {code:0,handled:!0,command:o}}case "status":{if(n.includes("--help")||n.includes("-h"))return console.log(t("cli.status.usage")),{code:0,handled:!0,command:o};let{loadConfig:r,getConfigDirectory:a}=await import('./config-KX5CSYLV.mjs'),p=await r(),u={directory:a(),server:p.server,clientCount:p.clients?.clients?.length??0};if(c)emitJsonOk(u,{command:o});else {let s={directory:t("cli.status.field.directory"),server:t("cli.status.field.server"),channel:t("cli.status.field.server_channel"),port:t("cli.status.field.server_port"),hostname:t("cli.status.field.server_hostname"),enabled:t("cli.status.field.server_enabled"),clients:t("cli.status.field.clients")};printHuman([te({directory:u.directory,server:u.server,clientCount:u.clientCount},s)],{title:"acp status",boxed:!0});}return {code:0,handled:!0,command:o}}case "doctor":{if(n.includes("--help")||n.includes("-h"))return console.log(t("cli.doctor.usage")),{code:0,handled:!0,command:o};let{AcpCache:r}=await import('./cache-SOYLU2DS.mjs'),{loadConfig:a}=await import('./config-KX5CSYLV.mjs'),p=await r.getConfigPath(),u=await r.exists(),s=!1,b;try{await a(),s=!0;}catch(l){b=errorMeta(l).message;}let d={acpJson:{path:p,exists:u},configLoadable:s,configError:b,sdkVersion:"@agentclientprotocol/sdk (workspace dep)"};if(c)emitJsonOk(d,{command:o});else {let l={acpJsonPath:t("cli.doctor.field.acp_json_path"),acpJsonExists:t("cli.doctor.field.acp_json_exists"),configLoadable:t("cli.doctor.field.config_loadable"),configError:t("cli.doctor.field.config_error"),sdkVersion:t("cli.doctor.field.sdk_version")};printHuman([oe({acpJsonPath:p,acpJsonExists:u,configLoadable:s,configError:b,sdkVersion:"@agentclientprotocol/sdk (workspace dep)"},l)],{title:"acp doctor",boxed:!0});}return {code:0,handled:!0,command:o}}case "config":{if(n.includes("--help")||n.includes("-h"))return console.log(t("cli.config.usage")),console.log(""),console.log(t("cli.config.description")),console.log(t("cli.config.subcommands")),console.log(` ${t("cli.config.get_help")}`),console.log(` ${t("cli.config.set_help")}`),console.log(""),console.log(t("cli.config.examples")),console.log(t("cli.config.example_get")),console.log(t("cli.config.example_set")),{code:0,handled:!0,command:o};let r=n[0],a=n[1],p=n[2],{AcpCache:u}=await import('./cache-SOYLU2DS.mjs'),{clearConfigCache:s}=await import('./config-KX5CSYLV.mjs');if(r==="set"&&a!==void 0&&p!==void 0){let b=await u.getAcpJson()??{},d=a.split(".").filter(k=>k.length>0);if(d.length===0)return j(o,c,{title:t("cli.config.error.invalid_key.title",{fallback:"invalid key"}),field:t("cli.config.error.field.key",{fallback:"key"}),value:a,message:t("cli.config.invalid_key",{vars:{key:a}}),hint:t("cli.config.error.invalid_key.hint",{fallback:'Use dotted path like "server.channel".'})});let l=b;for(let k=0;k<d.length-1;k++){let A=d[k],S=l[A];(typeof S!="object"||S===null||Array.isArray(S))&&(l[A]={}),l=l[A];}let h=d[d.length-1],m=p;return p==="true"?m=!0:p==="false"?m=!1:/^-?\d+(\.\d+)?$/.test(p)&&(m=Number(p)),l[h]=m,await u.writeAcpJson(b),s(),c?emitJsonOk({key:a,value:m},{command:o}):printHuman([ie({key:a,value:JSON.stringify(m)})],{title:"acp config set",boxed:!0}),{code:0,handled:!0,command:o}}if(r==="get"){let d=await u.getAcpJson()??{};if(a){let l=a.split(".");for(let h of l)if(d&&typeof d=="object"&&h in d)d=d[h];else {d=void 0;break}}if(c)emitJsonOk({key:a,value:d},{command:o});else {let l={key:t("cli.config.field.key"),value:t("cli.config.field.value")},h=d==null?String(d):typeof d=="object"?JSON.stringify(d,null,2):String(d);printHuman([re({key:a,value:h},l)],{title:"acp config get",boxed:!0});}return {code:0,handled:!0,command:o}}return console.error(t("cli.config.usage")),j(o,c,{title:t("cli.config.error.no_subcommand.title",{fallback:"missing subcommand"}),message:t("cli.config.usage"),hint:t("cli.config.error.no_subcommand.hint",{fallback:'Use "easbot-acp config get [key]" or "easbot-acp config set <key> <value>".'})})}default:{let r=t("acp.error.unknown_command",{vars:{command:o}}),a=t("cli.banner.hint.run_help");return _.warn(r),j(o??"__unknown__",c,{title:t("acp.error.unknown_command.title",{fallback:"unknown command"}),field:t("acp.error.unknown_command.field",{fallback:"command"}),value:o,message:r,hint:a},{exitCode:2})}}}catch(r){let a=errorMeta(r),p=a.message;_.error(t("acp.cli.command_failed"),{command:o,error:a});let u=i?.cwd??"",s=t("acp.cli.error_prefix",{vars:{cwd:u,command:o,message:p}});return j(o??"__unknown__",c,{title:t("acp.cli.command_failed_title",{fallback:"command failed"}),message:s,hint:t("acp.cli.error_hint",{fallback:"Re-run with --debug for full stack."})})}}
11
- export{pe as a,fe as b,E as c,D as d,I as e,Fe as f,ze as g,W as h,t as i,Xe as j,st as l,Z as m,ye as n,ke as o,Q as p,je as q,De as r,Ue as s,At as t};
@@ -1,2 +0,0 @@
1
- import {b as b$1}from'./chunk-PEMSMRYT.mjs';import {f,c}from'./chunk-RTXRNSMY.mjs';import {ACPInfoACPConfigSchema,ACPServerConfigSchema,ACP_DEFAULT_SERVER_CONFIG}from'@easbot/types';export{ACPStdioConnectionConfigSchema as a,ACPHttpConnectionConfigSchema as b,ACPWebSocketConnectionConfigSchema as c,ACPConnectionConfigSchema as d,ACPModelConfigSchema as e,ACPAgentRuntimeConfigSchema as f,ACPServerConfigSchema as g,ACPClientConfigSchema as h,ACPClientsConfigSchema as i,ACPInfoACPServerConfigSchema as j,ACPInfoACPClientsConfigSchema as k,ACPInfoACPConfigSchema as l,ACP_DEFAULT_SERVER_CONFIG as m,ACP_DEFAULT_CLIENT_CONFIG as n,ACPValidateConfig as o,ACPParsePartialConfig as p}from'@easbot/types';import O from'path';import {z as z$1}from'zod';import {Log,ConfigFileParse}from'@easbot/utils';var r=Log.create({service:"acp:config"}),J=z$1.object({acp:ACPInfoACPConfigSchema.optional()}).loose(),g,s=null;async function V(){let e=c(),o=f(),n=[];n.push(e.Path.config),n.push(o.directory);try{let{Filesystem:i}=await import('@easbot/utils'),C=await Array.fromAsync(i.up({targets:[".easbot"],start:o.directory,stop:o.worktree}));n.push(...C);}catch{r.debug("Filesystem utils not available, using basic directories");}let t=process.env.EASBOT_CONFIG_DIR;return t&&(n.push(t),r.debug("Using EASBOT_CONFIG_DIR",{path:t})),[...new Set(n)]}async function B(e){let o=[],n=[{file:".easbot/acp.json",mode:"direct"},{file:"acp.json",mode:"direct"},{file:"easbot.json",mode:"easbotJson"}];for(let{file:t,mode:i}of n){let C=O.join(e,t);if(i==="direct"){let a=null;try{a=await ConfigFileParse.loadFile(C,{schema:ACPInfoACPConfigSchema});}catch(c){r.debug("acp.json load failed; skipping partial",{file:C,error:c instanceof Error?c.message:String(c)});}a&&(o.push(a),r.debug("Loaded acp config from file",{file:C}));}else {let a=null;try{a=await ConfigFileParse.loadFile(C,{schema:J});}catch(c){r.debug("easbot.json load failed; skipping partial",{file:C,error:c instanceof Error?c.message:String(c)});}a?.acp&&(o.push(a.acp),r.debug("Loaded acp config from easbot.json acp field",{file:C}));}}return o}function A(){return g||(g=async()=>{let e=await b$1.getAcpJson();if(e&&Object.keys(e).length>0){let i=ACPInfoACPConfigSchema.parse(e);return s=i,r.debug("ACP config from AcpCache (project-level .easbot/acp.json)",{channel:i.server?.channel,clientCount:i.clients?.clients?.length??0}),{config:i,directories:["<AcpCache>"]}}let o=await V(),n=[];for(let i of o){let C=await B(i);n.push(...C);}let t=ACPInfoACPConfigSchema.parse(ConfigFileParse.merge(n));return s=t,r.info("ACP config loaded via multi-dir fallback (AcpCache miss)",{directories:o.length,serverEnabled:t.server?.enabled,channel:t.server?.channel,clientCount:t.clients?.clients?.length??0}),{config:t,directories:o}}),g}async function I(){return (await A()()).config}function H(){return s}function M(){return s!==null}function b(){g=void 0,s=null,r.debug("Config cache cleared");}function W(){return f().directory}async function $(){return b(),I()}async function z(){let{config:e}=await A()();return ACPServerConfigSchema.parse(ConfigFileParse.merge([ACP_DEFAULT_SERVER_CONFIG,e.server??{}]))}async function u(){let{config:e}=await A()(),o=e.clients?.clients??[],n=e.clients?.defaultClientId;return {clients:o,defaultClientId:n}}async function q(e){return (await u()).clients.find(n=>n.id===e)}async function K(){let e=await u();if(e.clients.length!==0){if(e.defaultClientId){let o=e.clients.find(n=>n.id===e.defaultClientId);if(o)return o}return e.clients[0]}}async function Q(){let{config:e}=await A()();if(!(e.client?.autoRegister??true))return;if(e.client?.gatewayUrl)return e.client.gatewayUrl;let n=e.server,t=n?.hostname??"localhost",i=n?.port??3e3,C=n?.path||"/acp";return `ws://${t}:${i}${C}`}
2
- export{Q as A,I as q,H as r,M as s,b as t,W as u,$ as v,z as w,u as x,q as y,K as z};
@@ -1 +0,0 @@
1
- 'use strict';var chunkM2YU5LAI_cjs=require('./chunk-M2YU5LAI.cjs'),types=require('@easbot/types'),zod=require('zod');var g=(s=>(s.INITIALIZING="initializing",s.READY="ready",s.RUNNING="running",s.STOPPED="stopped",s.ERROR="error",s))(g||{});var C=zod.z.object({agentId:zod.z.string(),agentType:zod.z.string(),directory:zod.z.string(),timestamp:zod.z.number()}),b=zod.z.object({agentId:zod.z.string(),reason:zod.z.enum(["normal","error","timeout"]),timestamp:zod.z.number()}),f=zod.z.object({sessionId:zod.z.string(),messageType:zod.z.enum(["text","tool_call","tool_result"]),content:zod.z.any(),timestamp:zod.z.number()}),v=zod.z.object({agentId:zod.z.string(),error:zod.z.string(),context:zod.z.record(zod.z.string(),zod.z.any()).optional(),timestamp:zod.z.number()}),R=zod.z.object({agentId:zod.z.string(),status:zod.z.enum(["idle","busy","error"]),timestamp:zod.z.number()}),N={STARTED:"agent.started",STOPPED:"agent.stopped",MESSAGE:"agent.message",ERROR:"agent.error",STATUS:"agent.status"};var m=(t=>(t.CHANNEL_ERROR="channel_error",t.CHANNEL_TIMEOUT="channel_timeout",t.CHANNEL_UNAVAILABLE="channel_unavailable",t.NETWORK_ERROR="network_error",t.CONNECTION_FAILED="connection_failed",t.CONNECTION_TIMEOUT="connection_timeout",t.ACP_ERROR="acp_error",t.ACP_AUTH_FAILED="acp_auth_failed",t.ACP_SESSION_NOT_FOUND="acp_session_not_found",t.CONFIG_ERROR="config_error",t.CONFIG_INVALID="config_invalid",t.SYSTEM_ERROR="system_error",t.INITIALIZATION_FAILED="initialization_failed",t))(m||{}),i=class r extends Error{constructor(o,c,d,s){super(c);chunkM2YU5LAI_cjs.a(this,"type",o);chunkM2YU5LAI_cjs.a(this,"context",d);chunkM2YU5LAI_cjs.a(this,"cause",s);this.name="AdapterError",Object.setPrototypeOf(this,r.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,r);}toJSON(){return {name:this.name,type:this.type,message:this.message,context:this.context,cause:this.cause?{name:this.cause.name,message:this.cause.message,stack:this.cause.stack}:void 0,stack:this.stack}}isRetryable(){return ["network_error","connection_failed","connection_timeout","channel_timeout"].includes(this.type)}isFatal(){return ["config_error","config_invalid","initialization_failed"].includes(this.type)}};function O(r,n,o){return new i("channel_error",r,n,o)}function S(r,n,o){return new i("network_error",r,n,o)}function _(r,n){return new i("config_error",r,n)}function P(r,n,o){return new i("channel_timeout",r,{...o,timeout:n})}Object.defineProperty(exports,"b",{enumerable:true,get:function(){return types.ChannelType}});exports.a=g;exports.c=C;exports.d=b;exports.e=f;exports.f=v;exports.g=R;exports.h=N;exports.i=m;exports.j=i;exports.k=O;exports.l=S;exports.m=_;exports.n=P;
@@ -1 +0,0 @@
1
- export{q as COMMANDS_HELP,t as handleAcpCli,r as renderBanner,s as renderHelp}from'./chunk-SHXWJMFY.mjs';import'./chunk-MFINI6BI.mjs';import'./chunk-HQBRVVXS.mjs';
@@ -1 +0,0 @@
1
- 'use strict';var chunk3OTURNTA_cjs=require('./chunk-3OTURNTA.cjs');require('./chunk-Z4D2PWDQ.cjs'),require('./chunk-M2YU5LAI.cjs');Object.defineProperty(exports,"COMMANDS_HELP",{enumerable:true,get:function(){return chunk3OTURNTA_cjs.q}});Object.defineProperty(exports,"handleAcpCli",{enumerable:true,get:function(){return chunk3OTURNTA_cjs.t}});Object.defineProperty(exports,"renderBanner",{enumerable:true,get:function(){return chunk3OTURNTA_cjs.r}});Object.defineProperty(exports,"renderHelp",{enumerable:true,get:function(){return chunk3OTURNTA_cjs.s}});
@@ -1 +0,0 @@
1
- export{f as ACPAgentRuntimeConfigSchema,h as ACPClientConfigSchema,i as ACPClientsConfigSchema,d as ACPConnectionConfigSchema,b as ACPHttpConnectionConfigSchema,k as ACPInfoACPClientsConfigSchema,l as ACPInfoACPConfigSchema,j as ACPInfoACPServerConfigSchema,e as ACPModelConfigSchema,p as ACPParsePartialConfig,g as ACPServerConfigSchema,a as ACPStdioConnectionConfigSchema,o as ACPValidateConfig,c as ACPWebSocketConnectionConfigSchema,n as ACP_DEFAULT_CLIENT_CONFIG,m as ACP_DEFAULT_SERVER_CONFIG,t as clearConfigCache,y as getClientById,x as getClientsConfig,r as getConfig,u as getConfigDirectory,z as getDefaultClient,A as getGatewayClientUrl,w as getServerConfig,s as isConfigLoaded,q as loadConfig,v as reloadConfig}from'./chunk-UTBY7IJT.mjs';import'./chunk-PEMSMRYT.mjs';import'./chunk-RTXRNSMY.mjs';import'./chunk-HQBRVVXS.mjs';
@@ -1 +0,0 @@
1
- 'use strict';var chunkDS4SO4NN_cjs=require('./chunk-DS4SO4NN.cjs');require('./chunk-CIOYWMQM.cjs'),require('./chunk-HA3RF4AE.cjs'),require('./chunk-M2YU5LAI.cjs');Object.defineProperty(exports,"ACPAgentRuntimeConfigSchema",{enumerable:true,get:function(){return chunkDS4SO4NN_cjs.f}});Object.defineProperty(exports,"ACPClientConfigSchema",{enumerable:true,get:function(){return chunkDS4SO4NN_cjs.h}});Object.defineProperty(exports,"ACPClientsConfigSchema",{enumerable:true,get:function(){return chunkDS4SO4NN_cjs.i}});Object.defineProperty(exports,"ACPConnectionConfigSchema",{enumerable:true,get:function(){return chunkDS4SO4NN_cjs.d}});Object.defineProperty(exports,"ACPHttpConnectionConfigSchema",{enumerable:true,get:function(){return chunkDS4SO4NN_cjs.b}});Object.defineProperty(exports,"ACPInfoACPClientsConfigSchema",{enumerable:true,get:function(){return chunkDS4SO4NN_cjs.k}});Object.defineProperty(exports,"ACPInfoACPConfigSchema",{enumerable:true,get:function(){return chunkDS4SO4NN_cjs.l}});Object.defineProperty(exports,"ACPInfoACPServerConfigSchema",{enumerable:true,get:function(){return chunkDS4SO4NN_cjs.j}});Object.defineProperty(exports,"ACPModelConfigSchema",{enumerable:true,get:function(){return chunkDS4SO4NN_cjs.e}});Object.defineProperty(exports,"ACPParsePartialConfig",{enumerable:true,get:function(){return chunkDS4SO4NN_cjs.p}});Object.defineProperty(exports,"ACPServerConfigSchema",{enumerable:true,get:function(){return chunkDS4SO4NN_cjs.g}});Object.defineProperty(exports,"ACPStdioConnectionConfigSchema",{enumerable:true,get:function(){return chunkDS4SO4NN_cjs.a}});Object.defineProperty(exports,"ACPValidateConfig",{enumerable:true,get:function(){return chunkDS4SO4NN_cjs.o}});Object.defineProperty(exports,"ACPWebSocketConnectionConfigSchema",{enumerable:true,get:function(){return chunkDS4SO4NN_cjs.c}});Object.defineProperty(exports,"ACP_DEFAULT_CLIENT_CONFIG",{enumerable:true,get:function(){return chunkDS4SO4NN_cjs.n}});Object.defineProperty(exports,"ACP_DEFAULT_SERVER_CONFIG",{enumerable:true,get:function(){return chunkDS4SO4NN_cjs.m}});Object.defineProperty(exports,"clearConfigCache",{enumerable:true,get:function(){return chunkDS4SO4NN_cjs.t}});Object.defineProperty(exports,"getClientById",{enumerable:true,get:function(){return chunkDS4SO4NN_cjs.y}});Object.defineProperty(exports,"getClientsConfig",{enumerable:true,get:function(){return chunkDS4SO4NN_cjs.x}});Object.defineProperty(exports,"getConfig",{enumerable:true,get:function(){return chunkDS4SO4NN_cjs.r}});Object.defineProperty(exports,"getConfigDirectory",{enumerable:true,get:function(){return chunkDS4SO4NN_cjs.u}});Object.defineProperty(exports,"getDefaultClient",{enumerable:true,get:function(){return chunkDS4SO4NN_cjs.z}});Object.defineProperty(exports,"getGatewayClientUrl",{enumerable:true,get:function(){return chunkDS4SO4NN_cjs.A}});Object.defineProperty(exports,"getServerConfig",{enumerable:true,get:function(){return chunkDS4SO4NN_cjs.w}});Object.defineProperty(exports,"isConfigLoaded",{enumerable:true,get:function(){return chunkDS4SO4NN_cjs.s}});Object.defineProperty(exports,"loadConfig",{enumerable:true,get:function(){return chunkDS4SO4NN_cjs.q}});Object.defineProperty(exports,"reloadConfig",{enumerable:true,get:function(){return chunkDS4SO4NN_cjs.v}});
@@ -1 +0,0 @@
1
- 'use strict';var chunkHA3RF4AE_cjs=require('./chunk-HA3RF4AE.cjs');require('./chunk-M2YU5LAI.cjs');Object.defineProperty(exports,"getGlobal",{enumerable:true,get:function(){return chunkHA3RF4AE_cjs.c}});Object.defineProperty(exports,"getHomeDir",{enumerable:true,get:function(){return chunkHA3RF4AE_cjs.j}});Object.defineProperty(exports,"getInstance",{enumerable:true,get:function(){return chunkHA3RF4AE_cjs.f}});Object.defineProperty(exports,"getProjectDirectory",{enumerable:true,get:function(){return chunkHA3RF4AE_cjs.m}});Object.defineProperty(exports,"getSdk",{enumerable:true,get:function(){return chunkHA3RF4AE_cjs.i}});Object.defineProperty(exports,"getWorktree",{enumerable:true,get:function(){return chunkHA3RF4AE_cjs.l}});Object.defineProperty(exports,"getXdgData",{enumerable:true,get:function(){return chunkHA3RF4AE_cjs.k}});Object.defineProperty(exports,"resetEasbotClientAdapter",{enumerable:true,get:function(){return chunkHA3RF4AE_cjs.h}});Object.defineProperty(exports,"resetGlobalAdapter",{enumerable:true,get:function(){return chunkHA3RF4AE_cjs.b}});Object.defineProperty(exports,"resetInstanceAdapter",{enumerable:true,get:function(){return chunkHA3RF4AE_cjs.e}});Object.defineProperty(exports,"setEasbotClientAdapter",{enumerable:true,get:function(){return chunkHA3RF4AE_cjs.g}});Object.defineProperty(exports,"setGlobalAdapter",{enumerable:true,get:function(){return chunkHA3RF4AE_cjs.a}});Object.defineProperty(exports,"setInstanceAdapter",{enumerable:true,get:function(){return chunkHA3RF4AE_cjs.d}});
@@ -1 +0,0 @@
1
- export{j as AdapterError,f as AgentErrorSchema,h as AgentEventType,e as AgentMessageSchema,c as AgentStartedSchema,a as AgentStatus,g as AgentStatusSchema,d as AgentStoppedSchema,b as ChannelType,i as ErrorType,k as createChannelError,m as createConfigError,l as createNetworkError,n as createTimeoutError}from'./chunk-MFINI6BI.mjs';import'./chunk-HQBRVVXS.mjs';
@@ -1 +0,0 @@
1
- 'use strict';var chunkZ4D2PWDQ_cjs=require('./chunk-Z4D2PWDQ.cjs');require('./chunk-M2YU5LAI.cjs');Object.defineProperty(exports,"AdapterError",{enumerable:true,get:function(){return chunkZ4D2PWDQ_cjs.j}});Object.defineProperty(exports,"AgentErrorSchema",{enumerable:true,get:function(){return chunkZ4D2PWDQ_cjs.f}});Object.defineProperty(exports,"AgentEventType",{enumerable:true,get:function(){return chunkZ4D2PWDQ_cjs.h}});Object.defineProperty(exports,"AgentMessageSchema",{enumerable:true,get:function(){return chunkZ4D2PWDQ_cjs.e}});Object.defineProperty(exports,"AgentStartedSchema",{enumerable:true,get:function(){return chunkZ4D2PWDQ_cjs.c}});Object.defineProperty(exports,"AgentStatus",{enumerable:true,get:function(){return chunkZ4D2PWDQ_cjs.a}});Object.defineProperty(exports,"AgentStatusSchema",{enumerable:true,get:function(){return chunkZ4D2PWDQ_cjs.g}});Object.defineProperty(exports,"AgentStoppedSchema",{enumerable:true,get:function(){return chunkZ4D2PWDQ_cjs.d}});Object.defineProperty(exports,"ChannelType",{enumerable:true,get:function(){return chunkZ4D2PWDQ_cjs.b}});Object.defineProperty(exports,"ErrorType",{enumerable:true,get:function(){return chunkZ4D2PWDQ_cjs.i}});Object.defineProperty(exports,"createChannelError",{enumerable:true,get:function(){return chunkZ4D2PWDQ_cjs.k}});Object.defineProperty(exports,"createConfigError",{enumerable:true,get:function(){return chunkZ4D2PWDQ_cjs.m}});Object.defineProperty(exports,"createNetworkError",{enumerable:true,get:function(){return chunkZ4D2PWDQ_cjs.l}});Object.defineProperty(exports,"createTimeoutError",{enumerable:true,get:function(){return chunkZ4D2PWDQ_cjs.n}});