@easbot/acp 0.3.44 → 0.3.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +1 -1
- package/README.md +1 -1
- package/dist/chunks/chunk-4KXIT6D6.cjs +8 -0
- package/dist/chunks/chunk-KDKI44F7.mjs +8 -0
- package/dist/chunks/cli-handler-CO57N72R.cjs +1 -0
- package/dist/chunks/{cli-handler-KXE6M3TJ.mjs → cli-handler-XERZGNNN.mjs} +1 -1
- package/dist/cli.cjs +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +6 -5
- package/dist/chunks/chunk-HYB6NTEA.mjs +0 -11
- package/dist/chunks/chunk-U3ROO3HG.cjs +0 -11
- package/dist/chunks/cli-handler-MRP3BABU.cjs +0 -1
package/README.en.md
CHANGED
package/README.md
CHANGED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
'use strict';var chunkSNWAB3QJ_cjs=require('./chunk-SNWAB3QJ.cjs'),chunkRGGMCKYA_cjs=require('./chunk-RGGMCKYA.cjs'),utils=require('@easbot/utils'),terminal=require('@easbot/terminal');var z={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 le=z.languages,de=le.filter(e=>e.supported).map(e=>e.value),x={defaultLocale:"zh-CN",timeZone:"Asia/Shanghai",locales:de},C={},P=(e,r)=>{let t=C[e]||{translation:{}};return C[e]={translation:{...t.translation,...r.translation}},C[e]},R=(e=x.defaultLocale)=>(C[e]||P(e,{translation:{}}),{locale:e,resources:C[e]||{translation:{}}}),je=e=>R(e),Oe=e=>C[e];var pe={translation:{"cli.banner.title":"easbot-acp \u2014 EASBot ACP\uFF08Agent Communication Protocol\uFF09\u9002\u914D\u5C42","cli.banner.usage":"Usage: easbot acp [options] [command]","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.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=pe;var fe={translation:{"cli.banner.title":"easbot-acp \u2014 EASBot ACP (Agent Communication Protocol) Adapter","cli.banner.usage":"Usage: easbot acp [options] [command]","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":"address","acp.field.timeout":"timeout","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=fe;var ge=()=>{R("zh-CN"),R("en-US"),P("zh-CN",H),P("en-US",K);};ge();var O=new Map;var ue=e=>{if(O.has(e))return O.get(e);let r=/{{\s*(\w+)\s*}}/g,t=[],n;for(;(n=r.exec(e))!==null;){let i=n[1];i&&!t.includes(i)&&t.push(i);}let l=new RegExp("{{\\s*("+t.join("|")+")\\s*}}","g"),c={keys:t,regex:l};return O.set(e,c),c},G=(e,r)=>{if(!e||typeof e!="string")return "";if(!r||Object.keys(r).length===0)return e;let{regex:t,keys:n}=ue(e);return n.length===0||!n.some(c=>c in r)?e:e.replace(t,(c,i)=>{let p=r[i];return p==null?"":String(p)})},F=e=>{if(e&&x.locales.includes(e))return e;let r=process.env.EASBOT_LANG?.trim()||process.env.LANG?.trim();if(r){let t=r.replace(/_/g,"-");if(x.locales.includes(t))return t;let n=t.split("-")[0];if(n==="zh")return "zh-CN";if(n==="en")return "en-US"}return x.defaultLocale},M=e=>R(e).resources,V=(e,r={})=>{let t=F(r.locale),l=M(t)?.translation[e];if(l&&typeof l=="string"){let c=G(l,r.vars);return c!=null?String(c):String(e)}if(t!==x.defaultLocale){let i=M(x.defaultLocale)?.translation[e];if(i&&typeof i=="string"){let p=G(i,r.vars);return p!=null?String(p):String(e)}}return String(r.fallback??e)},o=V,Ge=(e,r={})=>({message:V(e,r),locale:F(r.locale),context:r.context??{}});function q(){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"}}}chunkRGGMCKYA_cjs.b.WS;var ke={directory:"directory",server:"server",channel:"channel",port:"port",hostname:"hostname",enabled:"enabled",clients:"clients"},ye={acpJsonPath:"acp.json path",acpJsonExists:"acp.json exists",configLoadable:"config loadable",configError:"config error",sdkVersion:"SDK version"},_e={directory:"directory",channel:"channel",host:"address",timeout:"timeout"},we={key:"key",value:"value"};function N(e){return e?terminal.Symbol.colorize("\u2713","success"):terminal.Symbol.colorize("\u2717","error")}function Ae(e){return terminal.colorize(terminal.isRich(),terminal.theme.heading,e)}function Y(e){let r=[],t=e.skipped?"config already exists at":"initialized at",n=terminal.formatSuccess(`acp ${t} ${e.configPath}`);return r.push(n),e.channel!==void 0&&r.push(terminal.formatKeyValue("channel",e.channel)),r.join(`
|
|
2
|
+
`)}function Z(e,r){let t={...ke,...r},n=[];n.push(terminal.formatKeyValue(t.directory,e.directory)),n.push(` ${Ae(t.server)}`);let l=e.server??{},c=l.channel??"websocket",i=l.port??3e3,p=l.hostname??"localhost",g=l.enabled??true;return n.push(` ${terminal.formatKeyValue(t.channel,c)}`),n.push(` ${terminal.formatKeyValue(t.port,String(i))}`),n.push(` ${terminal.formatKeyValue(t.hostname,p)}`),n.push(` ${terminal.formatKeyValue(t.enabled,N(g))}`),n.push(terminal.formatKeyValue(t.clients,String(e.clientCount))),n.join(`
|
|
3
|
+
`)}function Q(e,r){let t={...ye,...r},n=[];return n.push(terminal.formatKeyValue(t.acpJsonPath,e.acpJsonPath)),n.push(terminal.formatKeyValue(t.acpJsonExists,N(e.acpJsonExists))),n.push(terminal.formatKeyValue(t.configLoadable,N(e.configLoadable))),n.push(terminal.formatKeyValue(t.sdkVersion,e.sdkVersion)),!e.configLoadable&&e.configError&&n.push(terminal.formatKeyValue(t.configError,e.configError)),n.join(`
|
|
4
|
+
`)}function X(e,r){let t={..._e,...r},n=[];return e.head&&n.push(terminal.formatSuccess(e.head)),n.push(terminal.formatKeyValue(t.directory,e.directory)),n.push(terminal.formatKeyValue(t.channel,e.channel)),n.push(terminal.formatKeyValue(t.host,e.host)),n.push(terminal.formatKeyValue(t.timeout,e.timeout)),n.join(`
|
|
5
|
+
`)}function ee(e,r){let t={...we,...r},n=[],l=e.key??"(root)";return n.push(terminal.formatKeyValue(t.key,l)),n.push(terminal.formatKeyValue(t.value,e.value)),n.join(`
|
|
6
|
+
`)}function te(e){return terminal.formatSuccess(`set ${e.key} = ${e.value}`)}var xe={field:"field",message:"message",hint:"hint"};function ne(e,r){let t={...xe,...r},n=[];return n.push(terminal.formatError(e.title)),e.field!==void 0&&n.push(terminal.formatKeyValue(t.field,e.value??"")),n.push(terminal.formatKeyValue(t.message,e.message)),e.hint&&n.push(terminal.formatKeyValue(t.hint,e.hint)),n.join(`
|
|
7
|
+
`)}var oe="@agentclientprotocol/sdk/unstable (workspace dep)",Le=[{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 ce(){let e=[["lifecycle","cli.banner.section.lifecycle"],["server","cli.banner.section.server"],["external","cli.banner.section.external"]];return {usage:o("cli.banner.usage",{fallback:"Usage: easbot acp [options] [command]"}),description:o("cli.banner.title",{fallback:"EASBot ACP (Agent Communication Protocol) Adapter"}),options:[{flags:"-h, --help",description:o("cli.shared.show_help",{fallback:"Show this help"})}],sections:e.map(([r,t])=>({title:o(t),commands:Le.filter(n=>n.group===r).map(n=>({name:n.name,description:o(n.i18nKey,{fallback:n.description})}))})),footer:[o("cli.banner.global_flags",{fallback:"Global flags: --cwd <dir> --config <path> --log-level <L> --print-logs --debug"}),`${o("cli.banner.local.standalone",{fallback:"Standalone users"})}: easbot-acp <command>`,`${o("cli.banner.local.agent",{fallback:"Agent CLI users"})}: easbot acp <command>`]}}function pt(){terminal.renderCliHelp(ce());}function Ee(){terminal.renderCliHelp(ce());}var y=utils.Log.create({service:"acp.cli"}),re=false;async function Re(){if(!re){re=true;try{await chunkSNWAB3QJ_cjs.r();}catch(e){y.warn("registerBusinessErrors failed",{error:utils.errorMeta(e)});}}}function Te(e,r){let t={...e??{}};return r.channel!==void 0&&(t.channel=r.channel),r.port!==void 0&&(t.port=r.port),r.hostname!==void 0&&(t.hostname=r.hostname),r.timeout!==void 0&&(t.timeout=r.timeout),t}function I(e,r,t,n){let l=n?.exitCode??1;if(r)terminal.emitJsonError(e,t.message);else {let c=n?.labels??{field:o("acp.error.field_label",{fallback:"field"}),message:o("acp.error.message_label",{fallback:"message"}),hint:o("acp.error.hint_label",{fallback:"hint"})};terminal.printHuman([ne(t,c)],{title:"error",boxed:true,tone:"error",stream:"stderr"});}return {code:l,handled:l===1,command:l===1?e:null}}async function ft(e,r){let[t,...n]=e;if(!t)return Ee(),{code:0,handled:true,command:null};await Re();let l=n.includes("--json");try{switch(t){case "init":{if(n.includes("--help")||n.includes("-h"))return console.log(o("cli.init.usage")),console.log(""),console.log(o("cli.init.opt.channel")),console.log(o("cli.init.opt.port")),console.log(o("cli.init.opt.hostname")),console.log(o("cli.init.opt.force")),console.log(o("cli.init.opt.json")),{code:0,handled:!0,command:t};let{AcpCache:c}=await import('./cache-5PSUWHGW.cjs'),i=await c.getConfigPath(),p=await c.exists(),g=n.includes("--force");if(p&&!g){let s=o("cli.init.exists",{vars:{path:i}});return y.warn(s),I(t,l,{title:o("cli.init.error.title",{fallback:"init failed"}),field:o("cli.init.error.field",{fallback:"path"}),value:i,message:s,hint:o("cli.init.error.hint",{fallback:"Pass --force to overwrite, or edit the existing file."})})}let d=q();for(let s=0;s<n.length;s++){let m=n[s],u=n[s+1];m==="--channel"&&u?(d.server={...d.server??{},channel:u},s++):m==="--port"&&u?(d.server={...d.server??{},port:Number(u)},s++):m==="--hostname"&&u&&(d.server={...d.server??{},hostname:u},s++);}await c.writeAcpJson(d);let h={configPath:i},a=d.server?.channel;return l?terminal.emitJsonOk(h,{command:t}):terminal.printHuman([Y({configPath:i,channel:a})],{title:o("cli.init.title",{fallback:"init acp workspace"}),boxed:!0}),{code:0,handled:!0,command:t}}case "start":{if(n.includes("--help")||n.includes("-h"))return console.log(o("cli.start.usage")),console.log(""),console.log(o("cli.start.description")),console.log(o("cli.start.channel_default")),console.log(""),console.log(o("cli.start.opt.channel")),console.log(o("cli.start.opt.port")),console.log(o("cli.start.opt.hostname")),console.log(o("cli.start.opt.timeout")),{code:0,handled:!0,command:t};let c={};for(let b=0;b<n.length;b++){let w=n[b],v=n[b+1];w==="--channel"&&v?(c.channel=v,b++):w==="--port"&&v?(c.port=Number(v),b++):w==="--hostname"&&v?(c.hostname=v,b++):w==="--timeout"&&v&&(c.timeout=Number(v),b++);}let{loadConfig:i}=await import('./config-QMFC2VIL.cjs'),g=(await i()).server??{},d=Te(g,c),h=d.channel??"websocket",a=h==="stdio"||h==="http"||h==="websocket"?h:"websocket",s=typeof d.port=="number"?d.port:3e3,m=typeof d.hostname=="string"?d.hostname:"localhost",u=typeof d.timeout=="number"?d.timeout:3e4;y.info("Bootstrapping ACP server",{channel:a,port:s,hostname:m,timeout:u,agentId:d.agentId});let{EasbotAdapter:k}=await import('./bootstrap-62VQO6JQ.cjs'),{ChannelType:_}=await import('./types-MQMNYZEY.cjs');await k.init({directory:r?.cwd??process.cwd(),printLogs:!1,logLevel:"INFO",channel:a==="stdio"?_.STDIO:a==="http"?_.HTTP:_.WS});let L=await k.ensureACPService({...d,directory:r?.cwd??process.cwd(),enabled:!0,channel:a,port:s,hostname:m,timeout:u}),U=chunkSNWAB3QJ_cjs.t({channel:a,hostname:m,port:s})??`unknown://${m}:${s}`;y.info("ACP server started successfully",{type:L.server?.type,url:U});let ae={directory:o("acp.field.directory"),channel:o("acp.field.channel"),host:o("acp.field.host"),timeout:o("acp.field.timeout")};terminal.printHuman([X({directory:r?.cwd??process.cwd(),channel:a,host:U,timeout:`${u}ms`,head:o("acp.server.started_head",{fallback:"ACP Server Started"})},ae)],{title:o("acp.server.started"),boxed:!0}),await new Promise(b=>{let w=!1,v=E=>{w||(w=!0,y.info(`Received ${E}, shutting down ACP server`,{signal:E}),b());};process.once("SIGINT",()=>v("SIGINT")),process.once("SIGTERM",()=>v("SIGTERM")),process.stdout.on("error",E=>{(E.code==="EPIPE"||E.code==="EIO")&&(y.info("stdout pipe broken, exiting ACP server"),v("STDOUT-BROKEN"));});});try{await k.destroy();}catch(b){y.warn("EasbotAdapter.destroy failed",{error:utils.errorMeta(b)});}return {code:0,handled:!0,command:t}}case "status":{if(n.includes("--help")||n.includes("-h"))return console.log(o("cli.status.usage")),{code:0,handled:!0,command:t};let{loadConfig:c,getConfigDirectory:i}=await import('./config-QMFC2VIL.cjs'),p=await c(),g={directory:i(),server:p.server,clientCount:p.clients?.clients?.length??0};if(l)terminal.emitJsonOk(g,{command:t});else {let d={directory:o("cli.status.field.directory"),server:o("cli.status.field.server"),channel:o("cli.status.field.server_channel"),port:o("cli.status.field.server_port"),hostname:o("cli.status.field.server_hostname"),enabled:o("cli.status.field.server_enabled"),clients:o("cli.status.field.clients")};terminal.printHuman([Z({directory:g.directory,server:g.server,clientCount:g.clientCount},d)],{title:"acp status",boxed:!0});}return {code:0,handled:!0,command:t}}case "doctor":{if(n.includes("--help")||n.includes("-h"))return console.log(o("cli.doctor.usage")),{code:0,handled:!0,command:t};let{AcpCache:c}=await import('./cache-5PSUWHGW.cjs'),{loadConfig:i}=await import('./config-QMFC2VIL.cjs'),p=await c.getConfigPath(),g=await c.exists(),d=!1,h;try{await i(),d=!0;}catch(s){h=utils.errorMeta(s).message;}let a={acpJson:{path:p,exists:g},configLoadable:d,configError:h,sdkVersion:oe};if(l)terminal.emitJsonOk(a,{command:t});else {let s={acpJsonPath:o("cli.doctor.field.acp_json_path"),acpJsonExists:o("cli.doctor.field.acp_json_exists"),configLoadable:o("cli.doctor.field.config_loadable"),configError:o("cli.doctor.field.config_error"),sdkVersion:o("cli.doctor.field.sdk_version")};terminal.printHuman([Q({acpJsonPath:p,acpJsonExists:g,configLoadable:d,configError:h,sdkVersion:oe},s)],{title:"acp doctor",boxed:!0});}return {code:0,handled:!0,command:t}}case "config":{if(n.includes("--help")||n.includes("-h"))return console.log(o("cli.config.usage")),console.log(""),console.log(o("cli.config.description")),console.log(o("cli.config.subcommands")),console.log(` ${o("cli.config.get_help")}`),console.log(` ${o("cli.config.set_help")}`),console.log(""),console.log(o("cli.config.examples")),console.log(o("cli.config.example_get")),console.log(o("cli.config.example_set")),{code:0,handled:!0,command:t};let c=n[0],i=n[1],p=n[2],{AcpCache:g}=await import('./cache-5PSUWHGW.cjs'),{clearConfigCache:d}=await import('./config-QMFC2VIL.cjs');if(c==="set"&&i!==void 0&&p!==void 0){let h=await g.getAcpJson()??{},a=i.split(".").filter(k=>k.length>0);if(a.length===0)return I(t,l,{title:o("cli.config.error.invalid_key.title",{fallback:"invalid key"}),field:o("cli.config.error.field.key",{fallback:"key"}),value:i,message:o("cli.config.invalid_key",{vars:{key:i}}),hint:o("cli.config.error.invalid_key.hint",{fallback:'Use dotted path like "server.channel".'})});let s=h;for(let k=0;k<a.length-1;k++){let _=a[k],L=s[_];(typeof L!="object"||L===null||Array.isArray(L))&&(s[_]={}),s=s[_];}let m=a[a.length-1],u=p;return p==="true"?u=!0:p==="false"?u=!1:/^-?\d+(\.\d+)?$/.test(p)&&(u=Number(p)),s[m]=u,await g.writeAcpJson(h),d(),l?terminal.emitJsonOk({key:i,value:u},{command:t}):terminal.printHuman([te({key:i,value:JSON.stringify(u)})],{title:"acp config set",boxed:!0}),{code:0,handled:!0,command:t}}if(c==="get"){let a=await g.getAcpJson()??{};if(i){let s=i.split(".");for(let m of s)if(a&&typeof a=="object"&&m in a)a=a[m];else {a=void 0;break}}if(l)terminal.emitJsonOk({key:i,value:a},{command:t});else {let s={key:o("cli.config.field.key"),value:o("cli.config.field.value")},m=a==null?String(a):typeof a=="object"?JSON.stringify(a,null,2):String(a);terminal.printHuman([ee({key:i,value:m},s)],{title:"acp config get",boxed:!0});}return {code:0,handled:!0,command:t}}return console.error(o("cli.config.usage")),I(t,l,{title:o("cli.config.error.no_subcommand.title",{fallback:"missing subcommand"}),message:o("cli.config.usage"),hint:o("cli.config.error.no_subcommand.hint",{fallback:'Use "easbot-acp config get [key]" or "easbot-acp config set <key> <value>".'})})}default:{let c=o("acp.error.unknown_command",{vars:{command:t}}),i=o("cli.banner.hint.run_help");return y.warn(c),I(t??"__unknown__",l,{title:o("acp.error.unknown_command.title",{fallback:"unknown command"}),field:o("acp.error.unknown_command.field",{fallback:"command"}),value:t,message:c,hint:i},{exitCode:2})}}}catch(c){let i=utils.errorMeta(c),p=i.message;y.error(`acp command ${t} failed`,{command:t,error:i});let g=r?.cwd??"",d=o("acp.cli.error_prefix",{vars:{cwd:g,command:t,message:p}});return I(t??"__unknown__",l,{title:o("acp.cli.command_failed_title",{fallback:"command failed"}),message:d,hint:o("acp.cli.error_hint",{fallback:"Re-run with --debug for full stack."})})}}
|
|
8
|
+
exports.a=le;exports.b=de;exports.c=x;exports.d=P;exports.e=R;exports.f=je;exports.g=Oe;exports.h=V;exports.i=o;exports.j=Ge;exports.k=Le;exports.l=pt;exports.m=Ee;exports.n=Te;exports.o=ft;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import {t,r}from'./chunk-B3ANZALB.mjs';import {b}from'./chunk-WFIRDYOS.mjs';import {Log,errorMeta}from'@easbot/utils';import {renderCliHelp,emitJsonOk,printHuman,emitJsonError,formatSuccess,formatKeyValue,formatError,Symbol,colorize,isRich,theme}from'@easbot/terminal';var H={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 de=H.languages,pe=de.filter(e=>e.supported).map(e=>e.value),S={defaultLocale:"zh-CN",timeZone:"Asia/Shanghai",locales:pe},L={},j=(e,r)=>{let t=L[e]||{translation:{}};return L[e]={translation:{...t.translation,...r.translation}},L[e]},T=(e=S.defaultLocale)=>(L[e]||j(e,{translation:{}}),{locale:e,resources:L[e]||{translation:{}}}),Oe=e=>T(e),Ne=e=>L[e];var fe={translation:{"cli.banner.title":"easbot-acp \u2014 EASBot ACP\uFF08Agent Communication Protocol\uFF09\u9002\u914D\u5C42","cli.banner.usage":"Usage: easbot acp [options] [command]","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.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"}},K=fe;var ge={translation:{"cli.banner.title":"easbot-acp \u2014 EASBot ACP (Agent Communication Protocol) Adapter","cli.banner.usage":"Usage: easbot acp [options] [command]","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":"address","acp.field.timeout":"timeout","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}})"}},G=ge;var ue=()=>{T("zh-CN"),T("en-US"),j("zh-CN",K),j("en-US",G);};ue();var N=new Map;var me=e=>{if(N.has(e))return N.get(e);let r=/{{\s*(\w+)\s*}}/g,t=[],n;for(;(n=r.exec(e))!==null;){let i=n[1];i&&!t.includes(i)&&t.push(i);}let l=new RegExp("{{\\s*("+t.join("|")+")\\s*}}","g"),c={keys:t,regex:l};return N.set(e,c),c},M=(e,r)=>{if(!e||typeof e!="string")return "";if(!r||Object.keys(r).length===0)return e;let{regex:t,keys:n}=me(e);return n.length===0||!n.some(c=>c in r)?e:e.replace(t,(c,i)=>{let p=r[i];return p==null?"":String(p)})},V=e=>{if(e&&S.locales.includes(e))return e;let r=process.env.EASBOT_LANG?.trim()||process.env.LANG?.trim();if(r){let t=r.replace(/_/g,"-");if(S.locales.includes(t))return t;let n=t.split("-")[0];if(n==="zh")return "zh-CN";if(n==="en")return "en-US"}return S.defaultLocale},F=e=>T(e).resources,q=(e,r={})=>{let t=V(r.locale),l=F(t)?.translation[e];if(l&&typeof l=="string"){let c=M(l,r.vars);return c!=null?String(c):String(e)}if(t!==S.defaultLocale){let i=F(S.defaultLocale)?.translation[e];if(i&&typeof i=="string"){let p=M(i,r.vars);return p!=null?String(p):String(e)}}return String(r.fallback??e)},o=q,Me=(e,r={})=>({message:q(e,r),locale:V(r.locale),context:r.context??{}});function W(){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 ye={directory:"directory",server:"server",channel:"channel",port:"port",hostname:"hostname",enabled:"enabled",clients:"clients"},_e={acpJsonPath:"acp.json path",acpJsonExists:"acp.json exists",configLoadable:"config loadable",configError:"config error",sdkVersion:"SDK version"},we={directory:"directory",channel:"channel",host:"address",timeout:"timeout"},Ae={key:"key",value:"value"};function J(e){return e?Symbol.colorize("\u2713","success"):Symbol.colorize("\u2717","error")}function xe(e){return colorize(isRich(),theme.heading,e)}function Z(e){let r=[],t=e.skipped?"config already exists at":"initialized at",n=formatSuccess(`acp ${t} ${e.configPath}`);return r.push(n),e.channel!==void 0&&r.push(formatKeyValue("channel",e.channel)),r.join(`
|
|
2
|
+
`)}function Q(e,r){let t={...ye,...r},n=[];n.push(formatKeyValue(t.directory,e.directory)),n.push(` ${xe(t.server)}`);let l=e.server??{},c=l.channel??"websocket",i=l.port??3e3,p=l.hostname??"localhost",g=l.enabled??true;return n.push(` ${formatKeyValue(t.channel,c)}`),n.push(` ${formatKeyValue(t.port,String(i))}`),n.push(` ${formatKeyValue(t.hostname,p)}`),n.push(` ${formatKeyValue(t.enabled,J(g))}`),n.push(formatKeyValue(t.clients,String(e.clientCount))),n.join(`
|
|
3
|
+
`)}function X(e,r){let t={..._e,...r},n=[];return n.push(formatKeyValue(t.acpJsonPath,e.acpJsonPath)),n.push(formatKeyValue(t.acpJsonExists,J(e.acpJsonExists))),n.push(formatKeyValue(t.configLoadable,J(e.configLoadable))),n.push(formatKeyValue(t.sdkVersion,e.sdkVersion)),!e.configLoadable&&e.configError&&n.push(formatKeyValue(t.configError,e.configError)),n.join(`
|
|
4
|
+
`)}function ee(e,r){let t={...we,...r},n=[];return e.head&&n.push(formatSuccess(e.head)),n.push(formatKeyValue(t.directory,e.directory)),n.push(formatKeyValue(t.channel,e.channel)),n.push(formatKeyValue(t.host,e.host)),n.push(formatKeyValue(t.timeout,e.timeout)),n.join(`
|
|
5
|
+
`)}function te(e,r){let t={...Ae,...r},n=[],l=e.key??"(root)";return n.push(formatKeyValue(t.key,l)),n.push(formatKeyValue(t.value,e.value)),n.join(`
|
|
6
|
+
`)}function ne(e){return formatSuccess(`set ${e.key} = ${e.value}`)}var Se={field:"field",message:"message",hint:"hint"};function oe(e,r){let t={...Se,...r},n=[];return n.push(formatError(e.title)),e.field!==void 0&&n.push(formatKeyValue(t.field,e.value??"")),n.push(formatKeyValue(t.message,e.message)),e.hint&&n.push(formatKeyValue(t.hint,e.hint)),n.join(`
|
|
7
|
+
`)}var re="@agentclientprotocol/sdk/unstable (workspace dep)",Ee=[{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 ae(){let e=[["lifecycle","cli.banner.section.lifecycle"],["server","cli.banner.section.server"],["external","cli.banner.section.external"]];return {usage:o("cli.banner.usage",{fallback:"Usage: easbot acp [options] [command]"}),description:o("cli.banner.title",{fallback:"EASBot ACP (Agent Communication Protocol) Adapter"}),options:[{flags:"-h, --help",description:o("cli.shared.show_help",{fallback:"Show this help"})}],sections:e.map(([r,t])=>({title:o(t),commands:Ee.filter(n=>n.group===r).map(n=>({name:n.name,description:o(n.i18nKey,{fallback:n.description})}))})),footer:[o("cli.banner.global_flags",{fallback:"Global flags: --cwd <dir> --config <path> --log-level <L> --print-logs --debug"}),`${o("cli.banner.local.standalone",{fallback:"Standalone users"})}: easbot-acp <command>`,`${o("cli.banner.local.agent",{fallback:"Agent CLI users"})}: easbot acp <command>`]}}function ft(){renderCliHelp(ae());}function Re(){renderCliHelp(ae());}var y=Log.create({service:"acp.cli"}),ie=false;async function Te(){if(!ie){ie=true;try{await r();}catch(e){y.warn("registerBusinessErrors failed",{error:errorMeta(e)});}}}function Ie(e,r){let t={...e??{}};return r.channel!==void 0&&(t.channel=r.channel),r.port!==void 0&&(t.port=r.port),r.hostname!==void 0&&(t.hostname=r.hostname),r.timeout!==void 0&&(t.timeout=r.timeout),t}function P(e,r,t,n){let l=n?.exitCode??1;if(r)emitJsonError(e,t.message);else {let c=n?.labels??{field:o("acp.error.field_label",{fallback:"field"}),message:o("acp.error.message_label",{fallback:"message"}),hint:o("acp.error.hint_label",{fallback:"hint"})};printHuman([oe(t,c)],{title:"error",boxed:true,tone:"error",stream:"stderr"});}return {code:l,handled:l===1,command:l===1?e:null}}async function gt(e,r){let[t$1,...n]=e;if(!t$1)return Re(),{code:0,handled:true,command:null};await Te();let l=n.includes("--json");try{switch(t$1){case "init":{if(n.includes("--help")||n.includes("-h"))return console.log(o("cli.init.usage")),console.log(""),console.log(o("cli.init.opt.channel")),console.log(o("cli.init.opt.port")),console.log(o("cli.init.opt.hostname")),console.log(o("cli.init.opt.force")),console.log(o("cli.init.opt.json")),{code:0,handled:!0,command:t$1};let{AcpCache:c}=await import('./cache-O43SNRV2.mjs'),i=await c.getConfigPath(),p=await c.exists(),g=n.includes("--force");if(p&&!g){let s=o("cli.init.exists",{vars:{path:i}});return y.warn(s),P(t$1,l,{title:o("cli.init.error.title",{fallback:"init failed"}),field:o("cli.init.error.field",{fallback:"path"}),value:i,message:s,hint:o("cli.init.error.hint",{fallback:"Pass --force to overwrite, or edit the existing file."})})}let d=W();for(let s=0;s<n.length;s++){let m=n[s],u=n[s+1];m==="--channel"&&u?(d.server={...d.server??{},channel:u},s++):m==="--port"&&u?(d.server={...d.server??{},port:Number(u)},s++):m==="--hostname"&&u&&(d.server={...d.server??{},hostname:u},s++);}await c.writeAcpJson(d);let h={configPath:i},a=d.server?.channel;return l?emitJsonOk(h,{command:t$1}):printHuman([Z({configPath:i,channel:a})],{title:o("cli.init.title",{fallback:"init acp workspace"}),boxed:!0}),{code:0,handled:!0,command:t$1}}case "start":{if(n.includes("--help")||n.includes("-h"))return console.log(o("cli.start.usage")),console.log(""),console.log(o("cli.start.description")),console.log(o("cli.start.channel_default")),console.log(""),console.log(o("cli.start.opt.channel")),console.log(o("cli.start.opt.port")),console.log(o("cli.start.opt.hostname")),console.log(o("cli.start.opt.timeout")),{code:0,handled:!0,command:t$1};let c={};for(let b=0;b<n.length;b++){let w=n[b],v=n[b+1];w==="--channel"&&v?(c.channel=v,b++):w==="--port"&&v?(c.port=Number(v),b++):w==="--hostname"&&v?(c.hostname=v,b++):w==="--timeout"&&v&&(c.timeout=Number(v),b++);}let{loadConfig:i}=await import('./config-FVZNV76C.mjs'),g=(await i()).server??{},d=Ie(g,c),h=d.channel??"websocket",a=h==="stdio"||h==="http"||h==="websocket"?h:"websocket",s=typeof d.port=="number"?d.port:3e3,m=typeof d.hostname=="string"?d.hostname:"localhost",u=typeof d.timeout=="number"?d.timeout:3e4;y.info("Bootstrapping ACP server",{channel:a,port:s,hostname:m,timeout:u,agentId:d.agentId});let{EasbotAdapter:k}=await import('./bootstrap-U2GTL57G.mjs'),{ChannelType:_}=await import('./types-GMPQJ4DC.mjs');await k.init({directory:r?.cwd??process.cwd(),printLogs:!1,logLevel:"INFO",channel:a==="stdio"?_.STDIO:a==="http"?_.HTTP:_.WS});let E=await k.ensureACPService({...d,directory:r?.cwd??process.cwd(),enabled:!0,channel:a,port:s,hostname:m,timeout:u}),D=t({channel:a,hostname:m,port:s})??`unknown://${m}:${s}`;y.info("ACP server started successfully",{type:E.server?.type,url:D});let se={directory:o("acp.field.directory"),channel:o("acp.field.channel"),host:o("acp.field.host"),timeout:o("acp.field.timeout")};printHuman([ee({directory:r?.cwd??process.cwd(),channel:a,host:D,timeout:`${u}ms`,head:o("acp.server.started_head",{fallback:"ACP Server Started"})},se)],{title:o("acp.server.started"),boxed:!0}),await new Promise(b=>{let w=!1,v=R=>{w||(w=!0,y.info(`Received ${R}, shutting down ACP server`,{signal:R}),b());};process.once("SIGINT",()=>v("SIGINT")),process.once("SIGTERM",()=>v("SIGTERM")),process.stdout.on("error",R=>{(R.code==="EPIPE"||R.code==="EIO")&&(y.info("stdout pipe broken, exiting ACP server"),v("STDOUT-BROKEN"));});});try{await k.destroy();}catch(b){y.warn("EasbotAdapter.destroy failed",{error:errorMeta(b)});}return {code:0,handled:!0,command:t$1}}case "status":{if(n.includes("--help")||n.includes("-h"))return console.log(o("cli.status.usage")),{code:0,handled:!0,command:t$1};let{loadConfig:c,getConfigDirectory:i}=await import('./config-FVZNV76C.mjs'),p=await c(),g={directory:i(),server:p.server,clientCount:p.clients?.clients?.length??0};if(l)emitJsonOk(g,{command:t$1});else {let d={directory:o("cli.status.field.directory"),server:o("cli.status.field.server"),channel:o("cli.status.field.server_channel"),port:o("cli.status.field.server_port"),hostname:o("cli.status.field.server_hostname"),enabled:o("cli.status.field.server_enabled"),clients:o("cli.status.field.clients")};printHuman([Q({directory:g.directory,server:g.server,clientCount:g.clientCount},d)],{title:"acp status",boxed:!0});}return {code:0,handled:!0,command:t$1}}case "doctor":{if(n.includes("--help")||n.includes("-h"))return console.log(o("cli.doctor.usage")),{code:0,handled:!0,command:t$1};let{AcpCache:c}=await import('./cache-O43SNRV2.mjs'),{loadConfig:i}=await import('./config-FVZNV76C.mjs'),p=await c.getConfigPath(),g=await c.exists(),d=!1,h;try{await i(),d=!0;}catch(s){h=errorMeta(s).message;}let a={acpJson:{path:p,exists:g},configLoadable:d,configError:h,sdkVersion:re};if(l)emitJsonOk(a,{command:t$1});else {let s={acpJsonPath:o("cli.doctor.field.acp_json_path"),acpJsonExists:o("cli.doctor.field.acp_json_exists"),configLoadable:o("cli.doctor.field.config_loadable"),configError:o("cli.doctor.field.config_error"),sdkVersion:o("cli.doctor.field.sdk_version")};printHuman([X({acpJsonPath:p,acpJsonExists:g,configLoadable:d,configError:h,sdkVersion:re},s)],{title:"acp doctor",boxed:!0});}return {code:0,handled:!0,command:t$1}}case "config":{if(n.includes("--help")||n.includes("-h"))return console.log(o("cli.config.usage")),console.log(""),console.log(o("cli.config.description")),console.log(o("cli.config.subcommands")),console.log(` ${o("cli.config.get_help")}`),console.log(` ${o("cli.config.set_help")}`),console.log(""),console.log(o("cli.config.examples")),console.log(o("cli.config.example_get")),console.log(o("cli.config.example_set")),{code:0,handled:!0,command:t$1};let c=n[0],i=n[1],p=n[2],{AcpCache:g}=await import('./cache-O43SNRV2.mjs'),{clearConfigCache:d}=await import('./config-FVZNV76C.mjs');if(c==="set"&&i!==void 0&&p!==void 0){let h=await g.getAcpJson()??{},a=i.split(".").filter(k=>k.length>0);if(a.length===0)return P(t$1,l,{title:o("cli.config.error.invalid_key.title",{fallback:"invalid key"}),field:o("cli.config.error.field.key",{fallback:"key"}),value:i,message:o("cli.config.invalid_key",{vars:{key:i}}),hint:o("cli.config.error.invalid_key.hint",{fallback:'Use dotted path like "server.channel".'})});let s=h;for(let k=0;k<a.length-1;k++){let _=a[k],E=s[_];(typeof E!="object"||E===null||Array.isArray(E))&&(s[_]={}),s=s[_];}let m=a[a.length-1],u=p;return p==="true"?u=!0:p==="false"?u=!1:/^-?\d+(\.\d+)?$/.test(p)&&(u=Number(p)),s[m]=u,await g.writeAcpJson(h),d(),l?emitJsonOk({key:i,value:u},{command:t$1}):printHuman([ne({key:i,value:JSON.stringify(u)})],{title:"acp config set",boxed:!0}),{code:0,handled:!0,command:t$1}}if(c==="get"){let a=await g.getAcpJson()??{};if(i){let s=i.split(".");for(let m of s)if(a&&typeof a=="object"&&m in a)a=a[m];else {a=void 0;break}}if(l)emitJsonOk({key:i,value:a},{command:t$1});else {let s={key:o("cli.config.field.key"),value:o("cli.config.field.value")},m=a==null?String(a):typeof a=="object"?JSON.stringify(a,null,2):String(a);printHuman([te({key:i,value:m},s)],{title:"acp config get",boxed:!0});}return {code:0,handled:!0,command:t$1}}return console.error(o("cli.config.usage")),P(t$1,l,{title:o("cli.config.error.no_subcommand.title",{fallback:"missing subcommand"}),message:o("cli.config.usage"),hint:o("cli.config.error.no_subcommand.hint",{fallback:'Use "easbot-acp config get [key]" or "easbot-acp config set <key> <value>".'})})}default:{let c=o("acp.error.unknown_command",{vars:{command:t$1}}),i=o("cli.banner.hint.run_help");return y.warn(c),P(t$1??"__unknown__",l,{title:o("acp.error.unknown_command.title",{fallback:"unknown command"}),field:o("acp.error.unknown_command.field",{fallback:"command"}),value:t$1,message:c,hint:i},{exitCode:2})}}}catch(c){let i=errorMeta(c),p=i.message;y.error(`acp command ${t$1} failed`,{command:t$1,error:i});let g=r?.cwd??"",d=o("acp.cli.error_prefix",{vars:{cwd:g,command:t$1,message:p}});return P(t$1??"__unknown__",l,{title:o("acp.cli.command_failed_title",{fallback:"command failed"}),message:d,hint:o("acp.cli.error_hint",{fallback:"Re-run with --debug for full stack."})})}}
|
|
8
|
+
export{de as a,pe as b,S as c,j as d,T as e,Oe as f,Ne as g,q as h,o as i,Me as j,Ee as k,ft as l,Re as m,Ie as n,gt as o};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunk4KXIT6D6_cjs=require('./chunk-4KXIT6D6.cjs');require('./chunk-SNWAB3QJ.cjs'),require('./chunk-RGGMCKYA.cjs'),require('./chunk-ISDIC2R6.cjs');Object.defineProperty(exports,"COMMANDS_HELP",{enumerable:true,get:function(){return chunk4KXIT6D6_cjs.k}});Object.defineProperty(exports,"handleAcpCli",{enumerable:true,get:function(){return chunk4KXIT6D6_cjs.o}});Object.defineProperty(exports,"mergeStartServerConfig",{enumerable:true,get:function(){return chunk4KXIT6D6_cjs.n}});Object.defineProperty(exports,"renderBanner",{enumerable:true,get:function(){return chunk4KXIT6D6_cjs.l}});Object.defineProperty(exports,"renderHelp",{enumerable:true,get:function(){return chunk4KXIT6D6_cjs.m}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{k as COMMANDS_HELP,o as handleAcpCli,n as mergeStartServerConfig,l as renderBanner,m as renderHelp}from'./chunk-
|
|
1
|
+
export{k as COMMANDS_HELP,o as handleAcpCli,n as mergeStartServerConfig,l as renderBanner,m as renderHelp}from'./chunk-KDKI44F7.mjs';import'./chunk-B3ANZALB.mjs';import'./chunk-WFIRDYOS.mjs';import'./chunk-HQBRVVXS.mjs';
|
package/dist/cli.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
'use strict';var chunkISDIC2R6_cjs=require('./chunks/chunk-ISDIC2R6.cjs'),fs=require('fs'),path=require('path'),url=require('url'),terminal=require('@easbot/terminal');var b=path.dirname(url.fileURLToPath(chunkISDIC2R6_cjs.b));function E(){try{let e=path.join(b,"..","package.json");return JSON.parse(fs.readFileSync(e,"utf-8")).version??"0.0.0"}catch{return "0.0.0"}}var p=new Set(["DEBUG","INFO","WARN","ERROR"]);function A(e){let n=[];for(let o=0;o<e.length;o++){let t=e[o];if(t){if(t==="--cwd"||t==="--config"||t==="--log-level"||t==="--print-logs"||t==="--debug"){if(t!=="--print-logs"&&t!=="--debug"){let i=e[o+1];i&&!i.startsWith("-")&&o++;}continue}t.startsWith("--cwd=")||t.startsWith("--config=")||t.startsWith("--log-level=")||n.push(t);}}return n}function G(e){let n={logLevel:"INFO",printLogs:false,debug:false};for(let o=0;o<e.length;o++){let t=e[o];if(t)if(t==="--cwd"&&o+1<e.length){let i=e[o+1];i&&!i.startsWith("-")&&(n.cwd=i,o++);}else if(t.startsWith("--cwd="))n.cwd=t.slice(6);else if(t==="--config"&&o+1<e.length){let i=e[o+1];i&&!i.startsWith("-")&&(n.configPath=i,o++);}else if(t.startsWith("--config="))n.configPath=t.slice(9);else if(t==="--log-level"&&o+1<e.length){let i=e[o+1];if(i&&!i.startsWith("-")){let s=i.toUpperCase();p.has(s)&&(n.logLevel=s,o++);}}else if(t.startsWith("--log-level=")){let i=t.slice(12).toUpperCase();p.has(i)&&(n.logLevel=i);}else t==="--print-logs"?n.printLogs=true:t==="--debug"&&(n.debug=true);}return n}async function N(){let{loadConfig:e}=await import('./chunks/config-QMFC2VIL.cjs'),{setGatewayUrlAdapter:n}=await import('./chunks/interfaces-CGLEY6OS.cjs'),o;try{o=await e();}catch{return}let t=o.client;t?.gatewayUrl&&t.autoRegister!==false&&n({url:t.gatewayUrl,autoRegister:true});}async function R(){let e=process.argv.slice(2),n=E(),{loadEnv:o}=await import('@easbot/utils');o(),process.env.EASBOT_LANG||(process.env.EASBOT_LANG="en-US"),process.env.EASBOT_CLIENT||(process.env.EASBOT_CLIENT="acp");let t=G(e),{Log:i}=await import('@easbot/utils'),{getXdgData:s}=await import('./chunks/interfaces-CGLEY6OS.cjs'),f=path.join(s(),"acp","log");if(await i.init({logDir:f,print:t.printLogs,dev:t.debug||false,level:t.logLevel}),e.length===0){let{renderBanner:a}=await import('./chunks/cli-handler-
|
|
2
|
+
'use strict';var chunkISDIC2R6_cjs=require('./chunks/chunk-ISDIC2R6.cjs'),fs=require('fs'),path=require('path'),url=require('url'),terminal=require('@easbot/terminal');var b=path.dirname(url.fileURLToPath(chunkISDIC2R6_cjs.b));function E(){try{let e=path.join(b,"..","package.json");return JSON.parse(fs.readFileSync(e,"utf-8")).version??"0.0.0"}catch{return "0.0.0"}}var p=new Set(["DEBUG","INFO","WARN","ERROR"]);function A(e){let n=[];for(let o=0;o<e.length;o++){let t=e[o];if(t){if(t==="--cwd"||t==="--config"||t==="--log-level"||t==="--print-logs"||t==="--debug"){if(t!=="--print-logs"&&t!=="--debug"){let i=e[o+1];i&&!i.startsWith("-")&&o++;}continue}t.startsWith("--cwd=")||t.startsWith("--config=")||t.startsWith("--log-level=")||n.push(t);}}return n}function G(e){let n={logLevel:"INFO",printLogs:false,debug:false};for(let o=0;o<e.length;o++){let t=e[o];if(t)if(t==="--cwd"&&o+1<e.length){let i=e[o+1];i&&!i.startsWith("-")&&(n.cwd=i,o++);}else if(t.startsWith("--cwd="))n.cwd=t.slice(6);else if(t==="--config"&&o+1<e.length){let i=e[o+1];i&&!i.startsWith("-")&&(n.configPath=i,o++);}else if(t.startsWith("--config="))n.configPath=t.slice(9);else if(t==="--log-level"&&o+1<e.length){let i=e[o+1];if(i&&!i.startsWith("-")){let s=i.toUpperCase();p.has(s)&&(n.logLevel=s,o++);}}else if(t.startsWith("--log-level=")){let i=t.slice(12).toUpperCase();p.has(i)&&(n.logLevel=i);}else t==="--print-logs"?n.printLogs=true:t==="--debug"&&(n.debug=true);}return n}async function N(){let{loadConfig:e}=await import('./chunks/config-QMFC2VIL.cjs'),{setGatewayUrlAdapter:n}=await import('./chunks/interfaces-CGLEY6OS.cjs'),o;try{o=await e();}catch{return}let t=o.client;t?.gatewayUrl&&t.autoRegister!==false&&n({url:t.gatewayUrl,autoRegister:true});}async function R(){let e=process.argv.slice(2),n=E(),{loadEnv:o}=await import('@easbot/utils');o(),process.env.EASBOT_LANG||(process.env.EASBOT_LANG="en-US"),process.env.EASBOT_CLIENT||(process.env.EASBOT_CLIENT="acp");let t=G(e),{Log:i}=await import('@easbot/utils'),{getXdgData:s}=await import('./chunks/interfaces-CGLEY6OS.cjs'),f=path.join(s(),"acp","log");if(await i.init({logDir:f,print:t.printLogs,dev:t.debug||false,level:t.logLevel}),e.length===0){let{renderBanner:a}=await import('./chunks/cli-handler-CO57N72R.cjs');a();return}if(e[0]==="--help"||e[0]==="-h"){let{renderHelp:a}=await import('./chunks/cli-handler-CO57N72R.cjs');a();return}if(e[0]==="--version"||e[0]==="-v"){terminal.printHuman([terminal.formatInfo(n)]);return}let r=t.cwd??process.cwd(),{setInstanceAdapter:d}=await import('./chunks/interfaces-CGLEY6OS.cjs');d({directory:r,worktree:r}),await N();let u=A(e),{handleAcpCli:h}=await import('./chunks/cli-handler-CO57N72R.cjs'),{Instance:w}=await import('@easbot/utils'),c=await w.provide({directory:r,fn:()=>h(u,{version:n,cwd:r})});c.code!==0&&(process.exitCode=c.code);}R().catch(async e=>{try{let{Log:n,errorMeta:o}=await import('@easbot/utils');n.create({service:"acp.cli.standalone"}).error("acp CLI crashed",{error:o(e)});}catch{console.error(e);}process.exitCode=1;}).finally(async()=>{try{let{Log:e}=await import('@easbot/utils');await e.close();}catch{}process.exit(process.exitCode??0);});
|
package/dist/cli.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {readFileSync}from'fs';import {dirname,join}from'path';import {fileURLToPath}from'url';import {printHuman,formatInfo}from'@easbot/terminal';var O=dirname(fileURLToPath(import.meta.url));function b(){try{let e=join(O,"..","package.json");return JSON.parse(readFileSync(e,"utf-8")).version??"0.0.0"}catch{return "0.0.0"}}var l=new Set(["DEBUG","INFO","WARN","ERROR"]);function E(e){let n=[];for(let o=0;o<e.length;o++){let t=e[o];if(t){if(t==="--cwd"||t==="--config"||t==="--log-level"||t==="--print-logs"||t==="--debug"){if(t!=="--print-logs"&&t!=="--debug"){let i=e[o+1];i&&!i.startsWith("-")&&o++;}continue}t.startsWith("--cwd=")||t.startsWith("--config=")||t.startsWith("--log-level=")||n.push(t);}}return n}function A(e){let n={logLevel:"INFO",printLogs:false,debug:false};for(let o=0;o<e.length;o++){let t=e[o];if(t)if(t==="--cwd"&&o+1<e.length){let i=e[o+1];i&&!i.startsWith("-")&&(n.cwd=i,o++);}else if(t.startsWith("--cwd="))n.cwd=t.slice(6);else if(t==="--config"&&o+1<e.length){let i=e[o+1];i&&!i.startsWith("-")&&(n.configPath=i,o++);}else if(t.startsWith("--config="))n.configPath=t.slice(9);else if(t==="--log-level"&&o+1<e.length){let i=e[o+1];if(i&&!i.startsWith("-")){let s=i.toUpperCase();l.has(s)&&(n.logLevel=s,o++);}}else if(t.startsWith("--log-level=")){let i=t.slice(12).toUpperCase();l.has(i)&&(n.logLevel=i);}else t==="--print-logs"?n.printLogs=true:t==="--debug"&&(n.debug=true);}return n}async function G(){let{loadConfig:e}=await import('./chunks/config-FVZNV76C.mjs'),{setGatewayUrlAdapter:n}=await import('./chunks/interfaces-HUTPEB67.mjs'),o;try{o=await e();}catch{return}let t=o.client;t?.gatewayUrl&&t.autoRegister!==false&&n({url:t.gatewayUrl,autoRegister:true});}async function N(){let e=process.argv.slice(2),n=b(),{loadEnv:o}=await import('@easbot/utils');o(),process.env.EASBOT_LANG||(process.env.EASBOT_LANG="en-US"),process.env.EASBOT_CLIENT||(process.env.EASBOT_CLIENT="acp");let t=A(e),{Log:i}=await import('@easbot/utils'),{getXdgData:s}=await import('./chunks/interfaces-HUTPEB67.mjs'),g=join(s(),"acp","log");if(await i.init({logDir:g,print:t.printLogs,dev:t.debug||false,level:t.logLevel}),e.length===0){let{renderBanner:a}=await import('./chunks/cli-handler-
|
|
2
|
+
import {readFileSync}from'fs';import {dirname,join}from'path';import {fileURLToPath}from'url';import {printHuman,formatInfo}from'@easbot/terminal';var O=dirname(fileURLToPath(import.meta.url));function b(){try{let e=join(O,"..","package.json");return JSON.parse(readFileSync(e,"utf-8")).version??"0.0.0"}catch{return "0.0.0"}}var l=new Set(["DEBUG","INFO","WARN","ERROR"]);function E(e){let n=[];for(let o=0;o<e.length;o++){let t=e[o];if(t){if(t==="--cwd"||t==="--config"||t==="--log-level"||t==="--print-logs"||t==="--debug"){if(t!=="--print-logs"&&t!=="--debug"){let i=e[o+1];i&&!i.startsWith("-")&&o++;}continue}t.startsWith("--cwd=")||t.startsWith("--config=")||t.startsWith("--log-level=")||n.push(t);}}return n}function A(e){let n={logLevel:"INFO",printLogs:false,debug:false};for(let o=0;o<e.length;o++){let t=e[o];if(t)if(t==="--cwd"&&o+1<e.length){let i=e[o+1];i&&!i.startsWith("-")&&(n.cwd=i,o++);}else if(t.startsWith("--cwd="))n.cwd=t.slice(6);else if(t==="--config"&&o+1<e.length){let i=e[o+1];i&&!i.startsWith("-")&&(n.configPath=i,o++);}else if(t.startsWith("--config="))n.configPath=t.slice(9);else if(t==="--log-level"&&o+1<e.length){let i=e[o+1];if(i&&!i.startsWith("-")){let s=i.toUpperCase();l.has(s)&&(n.logLevel=s,o++);}}else if(t.startsWith("--log-level=")){let i=t.slice(12).toUpperCase();l.has(i)&&(n.logLevel=i);}else t==="--print-logs"?n.printLogs=true:t==="--debug"&&(n.debug=true);}return n}async function G(){let{loadConfig:e}=await import('./chunks/config-FVZNV76C.mjs'),{setGatewayUrlAdapter:n}=await import('./chunks/interfaces-HUTPEB67.mjs'),o;try{o=await e();}catch{return}let t=o.client;t?.gatewayUrl&&t.autoRegister!==false&&n({url:t.gatewayUrl,autoRegister:true});}async function N(){let e=process.argv.slice(2),n=b(),{loadEnv:o}=await import('@easbot/utils');o(),process.env.EASBOT_LANG||(process.env.EASBOT_LANG="en-US"),process.env.EASBOT_CLIENT||(process.env.EASBOT_CLIENT="acp");let t=A(e),{Log:i}=await import('@easbot/utils'),{getXdgData:s}=await import('./chunks/interfaces-HUTPEB67.mjs'),g=join(s(),"acp","log");if(await i.init({logDir:g,print:t.printLogs,dev:t.debug||false,level:t.logLevel}),e.length===0){let{renderBanner:a}=await import('./chunks/cli-handler-XERZGNNN.mjs');a();return}if(e[0]==="--help"||e[0]==="-h"){let{renderHelp:a}=await import('./chunks/cli-handler-XERZGNNN.mjs');a();return}if(e[0]==="--version"||e[0]==="-v"){printHuman([formatInfo(n)]);return}let r=t.cwd??process.cwd(),{setInstanceAdapter:f}=await import('./chunks/interfaces-HUTPEB67.mjs');f({directory:r,worktree:r}),await G();let d=E(e),{handleAcpCli:u}=await import('./chunks/cli-handler-XERZGNNN.mjs'),{Instance:h}=await import('@easbot/utils'),c=await h.provide({directory:r,fn:()=>u(d,{version:n,cwd:r})});c.code!==0&&(process.exitCode=c.code);}N().catch(async e=>{try{let{Log:n,errorMeta:o}=await import('@easbot/utils');n.create({service:"acp.cli.standalone"}).error("acp CLI crashed",{error:o(e)});}catch{console.error(e);}process.exitCode=1;}).finally(async()=>{try{let{Log:e}=await import('@easbot/utils');await e.close();}catch{}process.exit(process.exitCode??0);});
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var chunkU3ROO3HG_cjs=require('./chunks/chunk-U3ROO3HG.cjs');require('./chunks/chunk-JLO7UYKQ.cjs');var chunkH57INME2_cjs=require('./chunks/chunk-H57INME2.cjs'),chunkMIFRHOYO_cjs=require('./chunks/chunk-MIFRHOYO.cjs'),chunkSNWAB3QJ_cjs=require('./chunks/chunk-SNWAB3QJ.cjs');require('./chunks/chunk-OQH5ALTQ.cjs');var chunk6VF3MZ6H_cjs=require('./chunks/chunk-6VF3MZ6H.cjs'),chunk663BEBE4_cjs=require('./chunks/chunk-663BEBE4.cjs'),chunkRGGMCKYA_cjs=require('./chunks/chunk-RGGMCKYA.cjs');require('./chunks/chunk-ISDIC2R6.cjs');Object.defineProperty(exports,"COMMANDS_HELP",{enumerable:true,get:function(){return chunkU3ROO3HG_cjs.k}});Object.defineProperty(exports,"I18n",{enumerable:true,get:function(){return chunkU3ROO3HG_cjs.c}});Object.defineProperty(exports,"LanguagesSupported",{enumerable:true,get:function(){return chunkU3ROO3HG_cjs.b}});Object.defineProperty(exports,"changeI18nLanguage",{enumerable:true,get:function(){return chunkU3ROO3HG_cjs.f}});Object.defineProperty(exports,"formatLog",{enumerable:true,get:function(){return chunkU3ROO3HG_cjs.j}});Object.defineProperty(exports,"getRegisteredResources",{enumerable:true,get:function(){return chunkU3ROO3HG_cjs.g}});Object.defineProperty(exports,"handleAcpCli",{enumerable:true,get:function(){return chunkU3ROO3HG_cjs.o}});Object.defineProperty(exports,"initI18n",{enumerable:true,get:function(){return chunkU3ROO3HG_cjs.e}});Object.defineProperty(exports,"languages",{enumerable:true,get:function(){return chunkU3ROO3HG_cjs.a}});Object.defineProperty(exports,"registerI18nResources",{enumerable:true,get:function(){return chunkU3ROO3HG_cjs.d}});Object.defineProperty(exports,"renderBanner",{enumerable:true,get:function(){return chunkU3ROO3HG_cjs.l}});Object.defineProperty(exports,"renderHelp",{enumerable:true,get:function(){return chunkU3ROO3HG_cjs.m}});Object.defineProperty(exports,"t",{enumerable:true,get:function(){return chunkU3ROO3HG_cjs.i}});Object.defineProperty(exports,"translate",{enumerable:true,get:function(){return chunkU3ROO3HG_cjs.h}});Object.defineProperty(exports,"clearConfigCache",{enumerable:true,get:function(){return chunkH57INME2_cjs.e}});Object.defineProperty(exports,"getClientById",{enumerable:true,get:function(){return chunkH57INME2_cjs.j}});Object.defineProperty(exports,"getClientsConfig",{enumerable:true,get:function(){return chunkH57INME2_cjs.i}});Object.defineProperty(exports,"getConfig",{enumerable:true,get:function(){return chunkH57INME2_cjs.c}});Object.defineProperty(exports,"getConfigDirectory",{enumerable:true,get:function(){return chunkH57INME2_cjs.g}});Object.defineProperty(exports,"getDefaultClient",{enumerable:true,get:function(){return chunkH57INME2_cjs.k}});Object.defineProperty(exports,"getGatewayClientUrl",{enumerable:true,get:function(){return chunkH57INME2_cjs.l}});Object.defineProperty(exports,"getServerConfig",{enumerable:true,get:function(){return chunkH57INME2_cjs.h}});Object.defineProperty(exports,"isConfigLoaded",{enumerable:true,get:function(){return chunkH57INME2_cjs.d}});Object.defineProperty(exports,"loadConfig",{enumerable:true,get:function(){return chunkH57INME2_cjs.b}});Object.defineProperty(exports,"reloadConfig",{enumerable:true,get:function(){return chunkH57INME2_cjs.f}});Object.defineProperty(exports,"AcpEventBridge",{enumerable:true,get:function(){return chunkMIFRHOYO_cjs.a}});Object.defineProperty(exports,"AdapterBootstrap",{enumerable:true,get:function(){return chunkMIFRHOYO_cjs.y}});Object.defineProperty(exports,"EasBotAgent",{enumerable:true,get:function(){return chunkMIFRHOYO_cjs.r}});Object.defineProperty(exports,"EasbotAdapter",{enumerable:true,get:function(){return chunkMIFRHOYO_cjs.x}});Object.defineProperty(exports,"RegistrySessionRouter",{enumerable:true,get:function(){return chunkMIFRHOYO_cjs.f}});Object.defineProperty(exports,"RoutingErrorCode",{enumerable:true,get:function(){return chunkMIFRHOYO_cjs.c}});Object.defineProperty(exports,"SdkPeer",{enumerable:true,get:function(){return chunkMIFRHOYO_cjs.g}});Object.defineProperty(exports,"ServerAgentSideConnection",{enumerable:true,get:function(){return chunkMIFRHOYO_cjs.m}});Object.defineProperty(exports,"ServerConnectionRegistry",{enumerable:true,get:function(){return chunkMIFRHOYO_cjs.b}});Object.defineProperty(exports,"ServiceMode",{enumerable:true,get:function(){return chunkMIFRHOYO_cjs.h}});Object.defineProperty(exports,"SessionRouter",{enumerable:true,get:function(){return chunkMIFRHOYO_cjs.e}});Object.defineProperty(exports,"applyEnvironmentOverrides",{enumerable:true,get:function(){return chunkMIFRHOYO_cjs.l}});Object.defineProperty(exports,"createACPServerInstance",{enumerable:true,get:function(){return chunkMIFRHOYO_cjs.q}});Object.defineProperty(exports,"createAdapterEnvironmentInitializationError",{enumerable:true,get:function(){return chunkMIFRHOYO_cjs.w}});Object.defineProperty(exports,"createRoutingError",{enumerable:true,get:function(){return chunkMIFRHOYO_cjs.d}});Object.defineProperty(exports,"createServiceModeConflictError",{enumerable:true,get:function(){return chunkMIFRHOYO_cjs.i}});Object.defineProperty(exports,"deregisterFromGateway",{enumerable:true,get:function(){return chunkMIFRHOYO_cjs.u}});Object.defineProperty(exports,"getAgentAddress",{enumerable:true,get:function(){return chunkMIFRHOYO_cjs.s}});Object.defineProperty(exports,"hasRegistrationSession",{enumerable:true,get:function(){return chunkMIFRHOYO_cjs.v}});Object.defineProperty(exports,"loadACPServerConfig",{enumerable:true,get:function(){return chunkMIFRHOYO_cjs.j}});Object.defineProperty(exports,"loadConfigFromEnv",{enumerable:true,get:function(){return chunkMIFRHOYO_cjs.k}});Object.defineProperty(exports,"registerToGateway",{enumerable:true,get:function(){return chunkMIFRHOYO_cjs.t}});Object.defineProperty(exports,"startACPServer",{enumerable:true,get:function(){return chunkMIFRHOYO_cjs.p}});Object.defineProperty(exports,"startHttpServer",{enumerable:true,get:function(){return chunkMIFRHOYO_cjs.n}});Object.defineProperty(exports,"startWebSocketServer",{enumerable:true,get:function(){return chunkMIFRHOYO_cjs.o}});Object.defineProperty(exports,"ACP_BUSINESS_CODES",{enumerable:true,get:function(){return chunkSNWAB3QJ_cjs.p}});Object.defineProperty(exports,"ACP_BUSINESS_HINTS",{enumerable:true,get:function(){return chunkSNWAB3QJ_cjs.q}});Object.defineProperty(exports,"ACP_STDIO_COMMAND",{enumerable:true,get:function(){return chunkSNWAB3QJ_cjs.s}});Object.defineProperty(exports,"AcpError",{enumerable:true,get:function(){return chunkSNWAB3QJ_cjs.c}});Object.defineProperty(exports,"ErrorType",{enumerable:true,get:function(){return chunkSNWAB3QJ_cjs.d}});Object.defineProperty(exports,"NameErrors",{enumerable:true,get:function(){return chunkSNWAB3QJ_cjs.b}});Object.defineProperty(exports,"ServiceError",{enumerable:true,get:function(){return chunkSNWAB3QJ_cjs.a}});Object.defineProperty(exports,"createAdapterError",{enumerable:true,get:function(){return chunkSNWAB3QJ_cjs.k}});Object.defineProperty(exports,"createChannelError",{enumerable:true,get:function(){return chunkSNWAB3QJ_cjs.l}});Object.defineProperty(exports,"createConfigError",{enumerable:true,get:function(){return chunkSNWAB3QJ_cjs.n}});Object.defineProperty(exports,"createNetworkError",{enumerable:true,get:function(){return chunkSNWAB3QJ_cjs.m}});Object.defineProperty(exports,"createTimeoutError",{enumerable:true,get:function(){return chunkSNWAB3QJ_cjs.o}});Object.defineProperty(exports,"getAcpEndpointUrl",{enumerable:true,get:function(){return chunkSNWAB3QJ_cjs.t}});Object.defineProperty(exports,"isAdapterEnvironmentInitializationError",{enumerable:true,get:function(){return chunkSNWAB3QJ_cjs.h}});Object.defineProperty(exports,"isAdapterError",{enumerable:true,get:function(){return chunkSNWAB3QJ_cjs.e}});Object.defineProperty(exports,"isAdapterErrorFatal",{enumerable:true,get:function(){return chunkSNWAB3QJ_cjs.j}});Object.defineProperty(exports,"isAdapterErrorRetryable",{enumerable:true,get:function(){return chunkSNWAB3QJ_cjs.i}});Object.defineProperty(exports,"isRoutingError",{enumerable:true,get:function(){return chunkSNWAB3QJ_cjs.g}});Object.defineProperty(exports,"isServiceModeConflictError",{enumerable:true,get:function(){return chunkSNWAB3QJ_cjs.f}});Object.defineProperty(exports,"registerBusinessErrors",{enumerable:true,get:function(){return chunkSNWAB3QJ_cjs.r}});Object.defineProperty(exports,"ACPAgentRuntimeConfigSchema",{enumerable:true,get:function(){return chunk6VF3MZ6H_cjs.l}});Object.defineProperty(exports,"ACPClientConfigSchema",{enumerable:true,get:function(){return chunk6VF3MZ6H_cjs.b}});Object.defineProperty(exports,"ACPClientsConfigSchema",{enumerable:true,get:function(){return chunk6VF3MZ6H_cjs.c}});Object.defineProperty(exports,"ACPConnectionConfigSchema",{enumerable:true,get:function(){return chunk6VF3MZ6H_cjs.j}});Object.defineProperty(exports,"ACPHttpConnectionConfigSchema",{enumerable:true,get:function(){return chunk6VF3MZ6H_cjs.h}});Object.defineProperty(exports,"ACPInfoACPClientsConfigSchema",{enumerable:true,get:function(){return chunk6VF3MZ6H_cjs.n}});Object.defineProperty(exports,"ACPInfoACPConfigSchema",{enumerable:true,get:function(){return chunk6VF3MZ6H_cjs.d}});Object.defineProperty(exports,"ACPInfoACPServerConfigSchema",{enumerable:true,get:function(){return chunk6VF3MZ6H_cjs.m}});Object.defineProperty(exports,"ACPModelConfigSchema",{enumerable:true,get:function(){return chunk6VF3MZ6H_cjs.k}});Object.defineProperty(exports,"ACPParsePartialConfig",{enumerable:true,get:function(){return chunk6VF3MZ6H_cjs.f}});Object.defineProperty(exports,"ACPServerConfigSchema",{enumerable:true,get:function(){return chunk6VF3MZ6H_cjs.a}});Object.defineProperty(exports,"ACPStdioConnectionConfigSchema",{enumerable:true,get:function(){return chunk6VF3MZ6H_cjs.g}});Object.defineProperty(exports,"ACPValidateConfig",{enumerable:true,get:function(){return chunk6VF3MZ6H_cjs.e}});Object.defineProperty(exports,"ACPWebSocketConnectionConfigSchema",{enumerable:true,get:function(){return chunk6VF3MZ6H_cjs.i}});Object.defineProperty(exports,"ACP_DEFAULT_CLIENT_CONFIG",{enumerable:true,get:function(){return chunk6VF3MZ6H_cjs.p}});Object.defineProperty(exports,"ACP_DEFAULT_SERVER_CONFIG",{enumerable:true,get:function(){return chunk6VF3MZ6H_cjs.o}});Object.defineProperty(exports,"ACP_JSON_REL_PATH",{enumerable:true,get:function(){return chunk6VF3MZ6H_cjs.q}});Object.defineProperty(exports,"AcpCache",{enumerable:true,get:function(){return chunk6VF3MZ6H_cjs.r}});Object.defineProperty(exports,"getGatewayUrlAdapter",{enumerable:true,get:function(){return chunk663BEBE4_cjs.l}});Object.defineProperty(exports,"getGlobal",{enumerable:true,get:function(){return chunk663BEBE4_cjs.c}});Object.defineProperty(exports,"getHomeDir",{enumerable:true,get:function(){return chunk663BEBE4_cjs.m}});Object.defineProperty(exports,"getInstance",{enumerable:true,get:function(){return chunk663BEBE4_cjs.f}});Object.defineProperty(exports,"getProjectDirectory",{enumerable:true,get:function(){return chunk663BEBE4_cjs.p}});Object.defineProperty(exports,"getSdk",{enumerable:true,get:function(){return chunk663BEBE4_cjs.i}});Object.defineProperty(exports,"getWorktree",{enumerable:true,get:function(){return chunk663BEBE4_cjs.o}});Object.defineProperty(exports,"getXdgData",{enumerable:true,get:function(){return chunk663BEBE4_cjs.n}});Object.defineProperty(exports,"resetEasbotClientAdapter",{enumerable:true,get:function(){return chunk663BEBE4_cjs.h}});Object.defineProperty(exports,"resetGatewayUrlAdapter",{enumerable:true,get:function(){return chunk663BEBE4_cjs.k}});Object.defineProperty(exports,"resetGlobalAdapter",{enumerable:true,get:function(){return chunk663BEBE4_cjs.b}});Object.defineProperty(exports,"resetInstanceAdapter",{enumerable:true,get:function(){return chunk663BEBE4_cjs.e}});Object.defineProperty(exports,"setEasbotClientAdapter",{enumerable:true,get:function(){return chunk663BEBE4_cjs.g}});Object.defineProperty(exports,"setGatewayUrlAdapter",{enumerable:true,get:function(){return chunk663BEBE4_cjs.j}});Object.defineProperty(exports,"setGlobalAdapter",{enumerable:true,get:function(){return chunk663BEBE4_cjs.a}});Object.defineProperty(exports,"setInstanceAdapter",{enumerable:true,get:function(){return chunk663BEBE4_cjs.d}});Object.defineProperty(exports,"AgentStatus",{enumerable:true,get:function(){return chunkRGGMCKYA_cjs.a}});Object.defineProperty(exports,"ChannelType",{enumerable:true,get:function(){return chunkRGGMCKYA_cjs.b}});
|
|
1
|
+
'use strict';var chunk4KXIT6D6_cjs=require('./chunks/chunk-4KXIT6D6.cjs');require('./chunks/chunk-JLO7UYKQ.cjs');var chunkH57INME2_cjs=require('./chunks/chunk-H57INME2.cjs'),chunkMIFRHOYO_cjs=require('./chunks/chunk-MIFRHOYO.cjs'),chunkSNWAB3QJ_cjs=require('./chunks/chunk-SNWAB3QJ.cjs');require('./chunks/chunk-OQH5ALTQ.cjs');var chunk6VF3MZ6H_cjs=require('./chunks/chunk-6VF3MZ6H.cjs'),chunk663BEBE4_cjs=require('./chunks/chunk-663BEBE4.cjs'),chunkRGGMCKYA_cjs=require('./chunks/chunk-RGGMCKYA.cjs');require('./chunks/chunk-ISDIC2R6.cjs');Object.defineProperty(exports,"COMMANDS_HELP",{enumerable:true,get:function(){return chunk4KXIT6D6_cjs.k}});Object.defineProperty(exports,"I18n",{enumerable:true,get:function(){return chunk4KXIT6D6_cjs.c}});Object.defineProperty(exports,"LanguagesSupported",{enumerable:true,get:function(){return chunk4KXIT6D6_cjs.b}});Object.defineProperty(exports,"changeI18nLanguage",{enumerable:true,get:function(){return chunk4KXIT6D6_cjs.f}});Object.defineProperty(exports,"formatLog",{enumerable:true,get:function(){return chunk4KXIT6D6_cjs.j}});Object.defineProperty(exports,"getRegisteredResources",{enumerable:true,get:function(){return chunk4KXIT6D6_cjs.g}});Object.defineProperty(exports,"handleAcpCli",{enumerable:true,get:function(){return chunk4KXIT6D6_cjs.o}});Object.defineProperty(exports,"initI18n",{enumerable:true,get:function(){return chunk4KXIT6D6_cjs.e}});Object.defineProperty(exports,"languages",{enumerable:true,get:function(){return chunk4KXIT6D6_cjs.a}});Object.defineProperty(exports,"registerI18nResources",{enumerable:true,get:function(){return chunk4KXIT6D6_cjs.d}});Object.defineProperty(exports,"renderBanner",{enumerable:true,get:function(){return chunk4KXIT6D6_cjs.l}});Object.defineProperty(exports,"renderHelp",{enumerable:true,get:function(){return chunk4KXIT6D6_cjs.m}});Object.defineProperty(exports,"t",{enumerable:true,get:function(){return chunk4KXIT6D6_cjs.i}});Object.defineProperty(exports,"translate",{enumerable:true,get:function(){return chunk4KXIT6D6_cjs.h}});Object.defineProperty(exports,"clearConfigCache",{enumerable:true,get:function(){return chunkH57INME2_cjs.e}});Object.defineProperty(exports,"getClientById",{enumerable:true,get:function(){return chunkH57INME2_cjs.j}});Object.defineProperty(exports,"getClientsConfig",{enumerable:true,get:function(){return chunkH57INME2_cjs.i}});Object.defineProperty(exports,"getConfig",{enumerable:true,get:function(){return chunkH57INME2_cjs.c}});Object.defineProperty(exports,"getConfigDirectory",{enumerable:true,get:function(){return chunkH57INME2_cjs.g}});Object.defineProperty(exports,"getDefaultClient",{enumerable:true,get:function(){return chunkH57INME2_cjs.k}});Object.defineProperty(exports,"getGatewayClientUrl",{enumerable:true,get:function(){return chunkH57INME2_cjs.l}});Object.defineProperty(exports,"getServerConfig",{enumerable:true,get:function(){return chunkH57INME2_cjs.h}});Object.defineProperty(exports,"isConfigLoaded",{enumerable:true,get:function(){return chunkH57INME2_cjs.d}});Object.defineProperty(exports,"loadConfig",{enumerable:true,get:function(){return chunkH57INME2_cjs.b}});Object.defineProperty(exports,"reloadConfig",{enumerable:true,get:function(){return chunkH57INME2_cjs.f}});Object.defineProperty(exports,"AcpEventBridge",{enumerable:true,get:function(){return chunkMIFRHOYO_cjs.a}});Object.defineProperty(exports,"AdapterBootstrap",{enumerable:true,get:function(){return chunkMIFRHOYO_cjs.y}});Object.defineProperty(exports,"EasBotAgent",{enumerable:true,get:function(){return chunkMIFRHOYO_cjs.r}});Object.defineProperty(exports,"EasbotAdapter",{enumerable:true,get:function(){return chunkMIFRHOYO_cjs.x}});Object.defineProperty(exports,"RegistrySessionRouter",{enumerable:true,get:function(){return chunkMIFRHOYO_cjs.f}});Object.defineProperty(exports,"RoutingErrorCode",{enumerable:true,get:function(){return chunkMIFRHOYO_cjs.c}});Object.defineProperty(exports,"SdkPeer",{enumerable:true,get:function(){return chunkMIFRHOYO_cjs.g}});Object.defineProperty(exports,"ServerAgentSideConnection",{enumerable:true,get:function(){return chunkMIFRHOYO_cjs.m}});Object.defineProperty(exports,"ServerConnectionRegistry",{enumerable:true,get:function(){return chunkMIFRHOYO_cjs.b}});Object.defineProperty(exports,"ServiceMode",{enumerable:true,get:function(){return chunkMIFRHOYO_cjs.h}});Object.defineProperty(exports,"SessionRouter",{enumerable:true,get:function(){return chunkMIFRHOYO_cjs.e}});Object.defineProperty(exports,"applyEnvironmentOverrides",{enumerable:true,get:function(){return chunkMIFRHOYO_cjs.l}});Object.defineProperty(exports,"createACPServerInstance",{enumerable:true,get:function(){return chunkMIFRHOYO_cjs.q}});Object.defineProperty(exports,"createAdapterEnvironmentInitializationError",{enumerable:true,get:function(){return chunkMIFRHOYO_cjs.w}});Object.defineProperty(exports,"createRoutingError",{enumerable:true,get:function(){return chunkMIFRHOYO_cjs.d}});Object.defineProperty(exports,"createServiceModeConflictError",{enumerable:true,get:function(){return chunkMIFRHOYO_cjs.i}});Object.defineProperty(exports,"deregisterFromGateway",{enumerable:true,get:function(){return chunkMIFRHOYO_cjs.u}});Object.defineProperty(exports,"getAgentAddress",{enumerable:true,get:function(){return chunkMIFRHOYO_cjs.s}});Object.defineProperty(exports,"hasRegistrationSession",{enumerable:true,get:function(){return chunkMIFRHOYO_cjs.v}});Object.defineProperty(exports,"loadACPServerConfig",{enumerable:true,get:function(){return chunkMIFRHOYO_cjs.j}});Object.defineProperty(exports,"loadConfigFromEnv",{enumerable:true,get:function(){return chunkMIFRHOYO_cjs.k}});Object.defineProperty(exports,"registerToGateway",{enumerable:true,get:function(){return chunkMIFRHOYO_cjs.t}});Object.defineProperty(exports,"startACPServer",{enumerable:true,get:function(){return chunkMIFRHOYO_cjs.p}});Object.defineProperty(exports,"startHttpServer",{enumerable:true,get:function(){return chunkMIFRHOYO_cjs.n}});Object.defineProperty(exports,"startWebSocketServer",{enumerable:true,get:function(){return chunkMIFRHOYO_cjs.o}});Object.defineProperty(exports,"ACP_BUSINESS_CODES",{enumerable:true,get:function(){return chunkSNWAB3QJ_cjs.p}});Object.defineProperty(exports,"ACP_BUSINESS_HINTS",{enumerable:true,get:function(){return chunkSNWAB3QJ_cjs.q}});Object.defineProperty(exports,"ACP_STDIO_COMMAND",{enumerable:true,get:function(){return chunkSNWAB3QJ_cjs.s}});Object.defineProperty(exports,"AcpError",{enumerable:true,get:function(){return chunkSNWAB3QJ_cjs.c}});Object.defineProperty(exports,"ErrorType",{enumerable:true,get:function(){return chunkSNWAB3QJ_cjs.d}});Object.defineProperty(exports,"NameErrors",{enumerable:true,get:function(){return chunkSNWAB3QJ_cjs.b}});Object.defineProperty(exports,"ServiceError",{enumerable:true,get:function(){return chunkSNWAB3QJ_cjs.a}});Object.defineProperty(exports,"createAdapterError",{enumerable:true,get:function(){return chunkSNWAB3QJ_cjs.k}});Object.defineProperty(exports,"createChannelError",{enumerable:true,get:function(){return chunkSNWAB3QJ_cjs.l}});Object.defineProperty(exports,"createConfigError",{enumerable:true,get:function(){return chunkSNWAB3QJ_cjs.n}});Object.defineProperty(exports,"createNetworkError",{enumerable:true,get:function(){return chunkSNWAB3QJ_cjs.m}});Object.defineProperty(exports,"createTimeoutError",{enumerable:true,get:function(){return chunkSNWAB3QJ_cjs.o}});Object.defineProperty(exports,"getAcpEndpointUrl",{enumerable:true,get:function(){return chunkSNWAB3QJ_cjs.t}});Object.defineProperty(exports,"isAdapterEnvironmentInitializationError",{enumerable:true,get:function(){return chunkSNWAB3QJ_cjs.h}});Object.defineProperty(exports,"isAdapterError",{enumerable:true,get:function(){return chunkSNWAB3QJ_cjs.e}});Object.defineProperty(exports,"isAdapterErrorFatal",{enumerable:true,get:function(){return chunkSNWAB3QJ_cjs.j}});Object.defineProperty(exports,"isAdapterErrorRetryable",{enumerable:true,get:function(){return chunkSNWAB3QJ_cjs.i}});Object.defineProperty(exports,"isRoutingError",{enumerable:true,get:function(){return chunkSNWAB3QJ_cjs.g}});Object.defineProperty(exports,"isServiceModeConflictError",{enumerable:true,get:function(){return chunkSNWAB3QJ_cjs.f}});Object.defineProperty(exports,"registerBusinessErrors",{enumerable:true,get:function(){return chunkSNWAB3QJ_cjs.r}});Object.defineProperty(exports,"ACPAgentRuntimeConfigSchema",{enumerable:true,get:function(){return chunk6VF3MZ6H_cjs.l}});Object.defineProperty(exports,"ACPClientConfigSchema",{enumerable:true,get:function(){return chunk6VF3MZ6H_cjs.b}});Object.defineProperty(exports,"ACPClientsConfigSchema",{enumerable:true,get:function(){return chunk6VF3MZ6H_cjs.c}});Object.defineProperty(exports,"ACPConnectionConfigSchema",{enumerable:true,get:function(){return chunk6VF3MZ6H_cjs.j}});Object.defineProperty(exports,"ACPHttpConnectionConfigSchema",{enumerable:true,get:function(){return chunk6VF3MZ6H_cjs.h}});Object.defineProperty(exports,"ACPInfoACPClientsConfigSchema",{enumerable:true,get:function(){return chunk6VF3MZ6H_cjs.n}});Object.defineProperty(exports,"ACPInfoACPConfigSchema",{enumerable:true,get:function(){return chunk6VF3MZ6H_cjs.d}});Object.defineProperty(exports,"ACPInfoACPServerConfigSchema",{enumerable:true,get:function(){return chunk6VF3MZ6H_cjs.m}});Object.defineProperty(exports,"ACPModelConfigSchema",{enumerable:true,get:function(){return chunk6VF3MZ6H_cjs.k}});Object.defineProperty(exports,"ACPParsePartialConfig",{enumerable:true,get:function(){return chunk6VF3MZ6H_cjs.f}});Object.defineProperty(exports,"ACPServerConfigSchema",{enumerable:true,get:function(){return chunk6VF3MZ6H_cjs.a}});Object.defineProperty(exports,"ACPStdioConnectionConfigSchema",{enumerable:true,get:function(){return chunk6VF3MZ6H_cjs.g}});Object.defineProperty(exports,"ACPValidateConfig",{enumerable:true,get:function(){return chunk6VF3MZ6H_cjs.e}});Object.defineProperty(exports,"ACPWebSocketConnectionConfigSchema",{enumerable:true,get:function(){return chunk6VF3MZ6H_cjs.i}});Object.defineProperty(exports,"ACP_DEFAULT_CLIENT_CONFIG",{enumerable:true,get:function(){return chunk6VF3MZ6H_cjs.p}});Object.defineProperty(exports,"ACP_DEFAULT_SERVER_CONFIG",{enumerable:true,get:function(){return chunk6VF3MZ6H_cjs.o}});Object.defineProperty(exports,"ACP_JSON_REL_PATH",{enumerable:true,get:function(){return chunk6VF3MZ6H_cjs.q}});Object.defineProperty(exports,"AcpCache",{enumerable:true,get:function(){return chunk6VF3MZ6H_cjs.r}});Object.defineProperty(exports,"getGatewayUrlAdapter",{enumerable:true,get:function(){return chunk663BEBE4_cjs.l}});Object.defineProperty(exports,"getGlobal",{enumerable:true,get:function(){return chunk663BEBE4_cjs.c}});Object.defineProperty(exports,"getHomeDir",{enumerable:true,get:function(){return chunk663BEBE4_cjs.m}});Object.defineProperty(exports,"getInstance",{enumerable:true,get:function(){return chunk663BEBE4_cjs.f}});Object.defineProperty(exports,"getProjectDirectory",{enumerable:true,get:function(){return chunk663BEBE4_cjs.p}});Object.defineProperty(exports,"getSdk",{enumerable:true,get:function(){return chunk663BEBE4_cjs.i}});Object.defineProperty(exports,"getWorktree",{enumerable:true,get:function(){return chunk663BEBE4_cjs.o}});Object.defineProperty(exports,"getXdgData",{enumerable:true,get:function(){return chunk663BEBE4_cjs.n}});Object.defineProperty(exports,"resetEasbotClientAdapter",{enumerable:true,get:function(){return chunk663BEBE4_cjs.h}});Object.defineProperty(exports,"resetGatewayUrlAdapter",{enumerable:true,get:function(){return chunk663BEBE4_cjs.k}});Object.defineProperty(exports,"resetGlobalAdapter",{enumerable:true,get:function(){return chunk663BEBE4_cjs.b}});Object.defineProperty(exports,"resetInstanceAdapter",{enumerable:true,get:function(){return chunk663BEBE4_cjs.e}});Object.defineProperty(exports,"setEasbotClientAdapter",{enumerable:true,get:function(){return chunk663BEBE4_cjs.g}});Object.defineProperty(exports,"setGatewayUrlAdapter",{enumerable:true,get:function(){return chunk663BEBE4_cjs.j}});Object.defineProperty(exports,"setGlobalAdapter",{enumerable:true,get:function(){return chunk663BEBE4_cjs.a}});Object.defineProperty(exports,"setInstanceAdapter",{enumerable:true,get:function(){return chunk663BEBE4_cjs.d}});Object.defineProperty(exports,"AgentStatus",{enumerable:true,get:function(){return chunkRGGMCKYA_cjs.a}});Object.defineProperty(exports,"ChannelType",{enumerable:true,get:function(){return chunkRGGMCKYA_cjs.b}});
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{k as COMMANDS_HELP,c as I18n,b as LanguagesSupported,f as changeI18nLanguage,j as formatLog,g as getRegisteredResources,o as handleAcpCli,e as initI18n,a as languages,d as registerI18nResources,l as renderBanner,m as renderHelp,i as t,h as translate}from'./chunks/chunk-
|
|
1
|
+
export{k as COMMANDS_HELP,c as I18n,b as LanguagesSupported,f as changeI18nLanguage,j as formatLog,g as getRegisteredResources,o as handleAcpCli,e as initI18n,a as languages,d as registerI18nResources,l as renderBanner,m as renderHelp,i as t,h as translate}from'./chunks/chunk-KDKI44F7.mjs';import'./chunks/chunk-D4TSQ2TT.mjs';export{e as clearConfigCache,j as getClientById,i as getClientsConfig,c as getConfig,g as getConfigDirectory,k as getDefaultClient,l as getGatewayClientUrl,h as getServerConfig,d as isConfigLoaded,b as loadConfig,f as reloadConfig}from'./chunks/chunk-JEYD2VIG.mjs';export{a as AcpEventBridge,y as AdapterBootstrap,r as EasBotAgent,x as EasbotAdapter,f as RegistrySessionRouter,c as RoutingErrorCode,g as SdkPeer,m as ServerAgentSideConnection,b as ServerConnectionRegistry,h as ServiceMode,e as SessionRouter,l as applyEnvironmentOverrides,q as createACPServerInstance,w as createAdapterEnvironmentInitializationError,d as createRoutingError,i as createServiceModeConflictError,u as deregisterFromGateway,s as getAgentAddress,v as hasRegistrationSession,j as loadACPServerConfig,k as loadConfigFromEnv,t as registerToGateway,p as startACPServer,n as startHttpServer,o as startWebSocketServer}from'./chunks/chunk-ONPG7IJS.mjs';export{p as ACP_BUSINESS_CODES,q as ACP_BUSINESS_HINTS,s as ACP_STDIO_COMMAND,c as AcpError,d as ErrorType,b as NameErrors,a as ServiceError,k as createAdapterError,l as createChannelError,n as createConfigError,m as createNetworkError,o as createTimeoutError,t as getAcpEndpointUrl,h as isAdapterEnvironmentInitializationError,e as isAdapterError,j as isAdapterErrorFatal,i as isAdapterErrorRetryable,g as isRoutingError,f as isServiceModeConflictError,r as registerBusinessErrors}from'./chunks/chunk-B3ANZALB.mjs';import'./chunks/chunk-ZGY6CLVQ.mjs';export{l as ACPAgentRuntimeConfigSchema,b as ACPClientConfigSchema,c as ACPClientsConfigSchema,j as ACPConnectionConfigSchema,h as ACPHttpConnectionConfigSchema,n as ACPInfoACPClientsConfigSchema,d as ACPInfoACPConfigSchema,m as ACPInfoACPServerConfigSchema,k as ACPModelConfigSchema,f as ACPParsePartialConfig,a as ACPServerConfigSchema,g as ACPStdioConnectionConfigSchema,e as ACPValidateConfig,i as ACPWebSocketConnectionConfigSchema,p as ACP_DEFAULT_CLIENT_CONFIG,o as ACP_DEFAULT_SERVER_CONFIG,q as ACP_JSON_REL_PATH,r as AcpCache}from'./chunks/chunk-FAYVTNTB.mjs';export{l as getGatewayUrlAdapter,c as getGlobal,m as getHomeDir,f as getInstance,p as getProjectDirectory,i as getSdk,o as getWorktree,n as getXdgData,h as resetEasbotClientAdapter,k as resetGatewayUrlAdapter,b as resetGlobalAdapter,e as resetInstanceAdapter,g as setEasbotClientAdapter,j as setGatewayUrlAdapter,a as setGlobalAdapter,d as setInstanceAdapter}from'./chunks/chunk-ZZK2JEUF.mjs';export{a as AgentStatus,b as ChannelType}from'./chunks/chunk-WFIRDYOS.mjs';import'./chunks/chunk-HQBRVVXS.mjs';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@easbot/acp",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.45",
|
|
4
4
|
"description": "EASBot ACP (Agent Communication Protocol) adapter — multi-channel server / client / connection layer for the Agent Client Protocol (stdio / http / websocket), with config loader, L2 cache and standalone CLI.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"format": "biome format .",
|
|
31
31
|
"format:fix": "biome format --write .",
|
|
32
32
|
"type-check": "tsc --noEmit",
|
|
33
|
+
"plugin:check": "echo @easbot/acp has no plugin distribution to check",
|
|
33
34
|
"clean": "rimraf dist node_modules",
|
|
34
35
|
"prepare": "echo norun",
|
|
35
36
|
"publish:npm": "bash scripts/publish.sh",
|
|
@@ -67,10 +68,10 @@
|
|
|
67
68
|
],
|
|
68
69
|
"dependencies": {
|
|
69
70
|
"@agentclientprotocol/sdk": "^2.7.0",
|
|
70
|
-
"@easbot/types": "^0.3.
|
|
71
|
-
"@easbot/sdk": "^0.3.
|
|
72
|
-
"@easbot/utils": "^0.3.
|
|
73
|
-
"@easbot/terminal": "^0.3.
|
|
71
|
+
"@easbot/types": "^0.3.45",
|
|
72
|
+
"@easbot/sdk": "^0.3.45",
|
|
73
|
+
"@easbot/utils": "^0.3.45",
|
|
74
|
+
"@easbot/terminal": "^0.3.45",
|
|
74
75
|
"diff": "^9.0.0",
|
|
75
76
|
"ws": "^8.20.0",
|
|
76
77
|
"zod": "^4.6.7"
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import {t,r}from'./chunk-B3ANZALB.mjs';import {b}from'./chunk-WFIRDYOS.mjs';import {Log,errorMeta}from'@easbot/utils';import {emitJsonOk,printHuman,emitJsonError,formatSuccess,formatKeyValue,formatError,Symbol,colorize,isRich,theme}from'@easbot/terminal';var H={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=H.languages,fe=pe.filter(e=>e.supported).map(e=>e.value),S={defaultLocale:"zh-CN",timeZone:"Asia/Shanghai",locales:fe},L={},N=(e,r)=>{let t=L[e]||{translation:{}};return L[e]={translation:{...t.translation,...r.translation}},L[e]},T=(e=S.defaultLocale)=>(L[e]||N(e,{translation:{}}),{locale:e,resources:L[e]||{translation:{}}}),De=e=>T(e),$e=e=>L[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.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"}},M=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":"address","acp.field.timeout":"timeout","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}})"}},F=ue;var me=()=>{T("zh-CN"),T("en-US"),N("zh-CN",M),N("en-US",F);};me();var J=new Map;var he=e=>{if(J.has(e))return J.get(e);let r=/{{\s*(\w+)\s*}}/g,t=[],o;for(;(o=r.exec(e))!==null;){let i=o[1];i&&!t.includes(i)&&t.push(i);}let s=new RegExp("{{\\s*("+t.join("|")+")\\s*}}","g"),c={keys:t,regex:s};return J.set(e,c),c},V=(e,r)=>{if(!e||typeof e!="string")return "";if(!r||Object.keys(r).length===0)return e;let{regex:t,keys:o}=he(e);return o.length===0||!o.some(c=>c in r)?e:e.replace(t,(c,i)=>{let p=r[i];return p==null?"":String(p)})},W=e=>{if(e&&S.locales.includes(e))return e;let r=process.env.EASBOT_LANG?.trim()||process.env.LANG?.trim();if(r){let t=r.replace(/_/g,"-");if(S.locales.includes(t))return t;let o=t.split("-")[0];if(o==="zh")return "zh-CN";if(o==="en")return "en-US"}return S.defaultLocale},q=e=>T(e).resources,Y=(e,r={})=>{let t=W(r.locale),s=q(t)?.translation[e];if(s&&typeof s=="string"){let c=V(s,r.vars);return c!=null?String(c):String(e)}if(t!==S.defaultLocale){let i=q(S.defaultLocale)?.translation[e];if(i&&typeof i=="string"){let p=V(i,r.vars);return p!=null?String(p):String(e)}}return String(r.fallback??e)},n=Y,We=(e,r={})=>({message:Y(e,r),locale:W(r.locale),context:r.context??{}});function Z(){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 _e={directory:"directory",server:"server",channel:"channel",port:"port",hostname:"hostname",enabled:"enabled",clients:"clients"},we={acpJsonPath:"acp.json path",acpJsonExists:"acp.json exists",configLoadable:"config loadable",configError:"config error",sdkVersion:"SDK version"},Ae={directory:"directory",channel:"channel",host:"address",timeout:"timeout"},xe={key:"key",value:"value"};function U(e){return e?Symbol.colorize("\u2713","success"):Symbol.colorize("\u2717","error")}function Se(e){return colorize(isRich(),theme.heading,e)}function X(e){let r=[],t=e.skipped?"config already exists at":"initialized at",o=formatSuccess(`acp ${t} ${e.configPath}`);return r.push(o),e.channel!==void 0&&r.push(formatKeyValue("channel",e.channel)),r.join(`
|
|
2
|
-
`)}function ee(e,r){let t={..._e,...r},o=[];o.push(formatKeyValue(t.directory,e.directory)),o.push(` ${Se(t.server)}`);let s=e.server??{},c=s.channel??"websocket",i=s.port??3e3,p=s.hostname??"localhost",g=s.enabled??true;return o.push(` ${formatKeyValue(t.channel,c)}`),o.push(` ${formatKeyValue(t.port,String(i))}`),o.push(` ${formatKeyValue(t.hostname,p)}`),o.push(` ${formatKeyValue(t.enabled,U(g))}`),o.push(formatKeyValue(t.clients,String(e.clientCount))),o.join(`
|
|
3
|
-
`)}function te(e,r){let t={...we,...r},o=[];return o.push(formatKeyValue(t.acpJsonPath,e.acpJsonPath)),o.push(formatKeyValue(t.acpJsonExists,U(e.acpJsonExists))),o.push(formatKeyValue(t.configLoadable,U(e.configLoadable))),o.push(formatKeyValue(t.sdkVersion,e.sdkVersion)),!e.configLoadable&&e.configError&&o.push(formatKeyValue(t.configError,e.configError)),o.join(`
|
|
4
|
-
`)}function ne(e,r){let t={...Ae,...r},o=[];return e.head&&o.push(formatSuccess(e.head)),o.push(formatKeyValue(t.directory,e.directory)),o.push(formatKeyValue(t.channel,e.channel)),o.push(formatKeyValue(t.host,e.host)),o.push(formatKeyValue(t.timeout,e.timeout)),o.join(`
|
|
5
|
-
`)}function oe(e,r){let t={...xe,...r},o=[],s=e.key??"(root)";return o.push(formatKeyValue(t.key,s)),o.push(formatKeyValue(t.value,e.value)),o.join(`
|
|
6
|
-
`)}function re(e){return formatSuccess(`set ${e.key} = ${e.value}`)}var Ce={field:"field",message:"message",hint:"hint"};function ie(e,r){let t={...Ce,...r},o=[];return o.push(formatError(e.title)),e.field!==void 0&&o.push(formatKeyValue(t.field,e.value??"")),o.push(formatKeyValue(t.message,e.message)),e.hint&&o.push(formatKeyValue(t.hint,e.hint)),o.join(`
|
|
7
|
-
`)}var ce="@agentclientprotocol/sdk/unstable (workspace dep)",Re=[{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 j(e){return `\x1B[2m${e}\x1B[0m`}function ae(e){return `\x1B[1m${e}\x1B[0m`}function Te(e){return `\x1B[36m${e}\x1B[0m`}function Ie(){return j("$")}function $(e,r){let t=Re.filter(s=>s.group===e),o=n(r);return `${ae(o)}
|
|
8
|
-
`+t.map(s=>` ${Ie()} easbot-acp ${s.name.padEnd(14)} ${j(n(s.i18nKey,{fallback:s.description}))}`).join(`
|
|
9
|
-
`)}function Pe(){let e=[`${ae(Te("easbot-acp"))} \xB7 ${n("cli.banner.title",{fallback:"EASBot ACP (Agent Communication Protocol) Adapter"})}`,n("cli.banner.usage",{fallback:"Usage: easbot-acp <command> [options]"}),"",$("lifecycle","cli.banner.section.lifecycle"),"",$("server","cli.banner.section.server"),"",$("external","cli.banner.section.external")];console.log(e.join(`
|
|
10
|
-
`));}function je(){Pe(),console.log(""),console.log(j(n("cli.banner.global_flags",{fallback:"Global flags: --cwd <dir> --config <path> --log-level <L> --print-logs --debug"}))),console.log(j(`${n("cli.banner.local.standalone",{fallback:"Standalone users"})}: easbot-acp <command>`)),console.log(j(`${n("cli.banner.local.agent",{fallback:"Agent CLI users"})}: easbot acp <command>`));}var y=Log.create({service:"acp.cli"}),se=false;async function Ne(){if(!se){se=true;try{await r();}catch(e){y.warn("registerBusinessErrors failed",{error:errorMeta(e)});}}}function Oe(e,r){let t={...e??{}};return r.channel!==void 0&&(t.channel=r.channel),r.port!==void 0&&(t.port=r.port),r.hostname!==void 0&&(t.hostname=r.hostname),r.timeout!==void 0&&(t.timeout=r.timeout),t}function P(e,r,t,o){let s=o?.exitCode??1;if(r)emitJsonError(e,t.message);else {let c=o?.labels??{field:n("acp.error.field_label",{fallback:"field"}),message:n("acp.error.message_label",{fallback:"message"}),hint:n("acp.error.hint_label",{fallback:"hint"})};printHuman([ie(t,c)],{title:"error",boxed:true,tone:"error",stream:"stderr"});}return {code:s,handled:s===1,command:s===1?e:null}}async function ht(e,r){let[t$1,...o]=e;if(!t$1)return je(),{code:0,handled:true,command:null};await Ne();let s=o.includes("--json");try{switch(t$1){case "init":{if(o.includes("--help")||o.includes("-h"))return console.log(n("cli.init.usage")),console.log(""),console.log(n("cli.init.opt.channel")),console.log(n("cli.init.opt.port")),console.log(n("cli.init.opt.hostname")),console.log(n("cli.init.opt.force")),console.log(n("cli.init.opt.json")),{code:0,handled:!0,command:t$1};let{AcpCache:c}=await import('./cache-O43SNRV2.mjs'),i=await c.getConfigPath(),p=await c.exists(),g=o.includes("--force");if(p&&!g){let l=n("cli.init.exists",{vars:{path:i}});return y.warn(l),P(t$1,s,{title:n("cli.init.error.title",{fallback:"init failed"}),field:n("cli.init.error.field",{fallback:"path"}),value:i,message:l,hint:n("cli.init.error.hint",{fallback:"Pass --force to overwrite, or edit the existing file."})})}let d=Z();for(let l=0;l<o.length;l++){let m=o[l],u=o[l+1];m==="--channel"&&u?(d.server={...d.server??{},channel:u},l++):m==="--port"&&u?(d.server={...d.server??{},port:Number(u)},l++):m==="--hostname"&&u&&(d.server={...d.server??{},hostname:u},l++);}await c.writeAcpJson(d);let h={configPath:i},a=d.server?.channel;return s?emitJsonOk(h,{command:t$1}):printHuman([X({configPath:i,channel:a})],{title:n("cli.init.title",{fallback:"init acp workspace"}),boxed:!0}),{code:0,handled:!0,command:t$1}}case "start":{if(o.includes("--help")||o.includes("-h"))return console.log(n("cli.start.usage")),console.log(""),console.log(n("cli.start.description")),console.log(n("cli.start.channel_default")),console.log(""),console.log(n("cli.start.opt.channel")),console.log(n("cli.start.opt.port")),console.log(n("cli.start.opt.hostname")),console.log(n("cli.start.opt.timeout")),{code:0,handled:!0,command:t$1};let c={};for(let b=0;b<o.length;b++){let w=o[b],v=o[b+1];w==="--channel"&&v?(c.channel=v,b++):w==="--port"&&v?(c.port=Number(v),b++):w==="--hostname"&&v?(c.hostname=v,b++):w==="--timeout"&&v&&(c.timeout=Number(v),b++);}let{loadConfig:i}=await import('./config-FVZNV76C.mjs'),g=(await i()).server??{},d=Oe(g,c),h=d.channel??"websocket",a=h==="stdio"||h==="http"||h==="websocket"?h:"websocket",l=typeof d.port=="number"?d.port:3e3,m=typeof d.hostname=="string"?d.hostname:"localhost",u=typeof d.timeout=="number"?d.timeout:3e4;y.info("Bootstrapping ACP server",{channel:a,port:l,hostname:m,timeout:u,agentId:d.agentId});let{EasbotAdapter:k}=await import('./bootstrap-U2GTL57G.mjs'),{ChannelType:_}=await import('./types-GMPQJ4DC.mjs');await k.init({directory:r?.cwd??process.cwd(),printLogs:!1,logLevel:"INFO",channel:a==="stdio"?_.STDIO:a==="http"?_.HTTP:_.WS});let E=await k.ensureACPService({...d,directory:r?.cwd??process.cwd(),enabled:!0,channel:a,port:l,hostname:m,timeout:u}),B=t({channel:a,hostname:m,port:l})??`unknown://${m}:${l}`;y.info("ACP server started successfully",{type:E.server?.type,url:B});let le={directory:n("acp.field.directory"),channel:n("acp.field.channel"),host:n("acp.field.host"),timeout:n("acp.field.timeout")};printHuman([ne({directory:r?.cwd??process.cwd(),channel:a,host:B,timeout:`${u}ms`,head:n("acp.server.started_head",{fallback:"ACP Server Started"})},le)],{title:n("acp.server.started"),boxed:!0}),await new Promise(b=>{let w=!1,v=R=>{w||(w=!0,y.info(`Received ${R}, shutting down ACP server`,{signal:R}),b());};process.once("SIGINT",()=>v("SIGINT")),process.once("SIGTERM",()=>v("SIGTERM")),process.stdout.on("error",R=>{(R.code==="EPIPE"||R.code==="EIO")&&(y.info("stdout pipe broken, exiting ACP server"),v("STDOUT-BROKEN"));});});try{await k.destroy();}catch(b){y.warn("EasbotAdapter.destroy failed",{error:errorMeta(b)});}return {code:0,handled:!0,command:t$1}}case "status":{if(o.includes("--help")||o.includes("-h"))return console.log(n("cli.status.usage")),{code:0,handled:!0,command:t$1};let{loadConfig:c,getConfigDirectory:i}=await import('./config-FVZNV76C.mjs'),p=await c(),g={directory:i(),server:p.server,clientCount:p.clients?.clients?.length??0};if(s)emitJsonOk(g,{command:t$1});else {let d={directory:n("cli.status.field.directory"),server:n("cli.status.field.server"),channel:n("cli.status.field.server_channel"),port:n("cli.status.field.server_port"),hostname:n("cli.status.field.server_hostname"),enabled:n("cli.status.field.server_enabled"),clients:n("cli.status.field.clients")};printHuman([ee({directory:g.directory,server:g.server,clientCount:g.clientCount},d)],{title:"acp status",boxed:!0});}return {code:0,handled:!0,command:t$1}}case "doctor":{if(o.includes("--help")||o.includes("-h"))return console.log(n("cli.doctor.usage")),{code:0,handled:!0,command:t$1};let{AcpCache:c}=await import('./cache-O43SNRV2.mjs'),{loadConfig:i}=await import('./config-FVZNV76C.mjs'),p=await c.getConfigPath(),g=await c.exists(),d=!1,h;try{await i(),d=!0;}catch(l){h=errorMeta(l).message;}let a={acpJson:{path:p,exists:g},configLoadable:d,configError:h,sdkVersion:ce};if(s)emitJsonOk(a,{command:t$1});else {let l={acpJsonPath:n("cli.doctor.field.acp_json_path"),acpJsonExists:n("cli.doctor.field.acp_json_exists"),configLoadable:n("cli.doctor.field.config_loadable"),configError:n("cli.doctor.field.config_error"),sdkVersion:n("cli.doctor.field.sdk_version")};printHuman([te({acpJsonPath:p,acpJsonExists:g,configLoadable:d,configError:h,sdkVersion:ce},l)],{title:"acp doctor",boxed:!0});}return {code:0,handled:!0,command:t$1}}case "config":{if(o.includes("--help")||o.includes("-h"))return console.log(n("cli.config.usage")),console.log(""),console.log(n("cli.config.description")),console.log(n("cli.config.subcommands")),console.log(` ${n("cli.config.get_help")}`),console.log(` ${n("cli.config.set_help")}`),console.log(""),console.log(n("cli.config.examples")),console.log(n("cli.config.example_get")),console.log(n("cli.config.example_set")),{code:0,handled:!0,command:t$1};let c=o[0],i=o[1],p=o[2],{AcpCache:g}=await import('./cache-O43SNRV2.mjs'),{clearConfigCache:d}=await import('./config-FVZNV76C.mjs');if(c==="set"&&i!==void 0&&p!==void 0){let h=await g.getAcpJson()??{},a=i.split(".").filter(k=>k.length>0);if(a.length===0)return P(t$1,s,{title:n("cli.config.error.invalid_key.title",{fallback:"invalid key"}),field:n("cli.config.error.field.key",{fallback:"key"}),value:i,message:n("cli.config.invalid_key",{vars:{key:i}}),hint:n("cli.config.error.invalid_key.hint",{fallback:'Use dotted path like "server.channel".'})});let l=h;for(let k=0;k<a.length-1;k++){let _=a[k],E=l[_];(typeof E!="object"||E===null||Array.isArray(E))&&(l[_]={}),l=l[_];}let m=a[a.length-1],u=p;return p==="true"?u=!0:p==="false"?u=!1:/^-?\d+(\.\d+)?$/.test(p)&&(u=Number(p)),l[m]=u,await g.writeAcpJson(h),d(),s?emitJsonOk({key:i,value:u},{command:t$1}):printHuman([re({key:i,value:JSON.stringify(u)})],{title:"acp config set",boxed:!0}),{code:0,handled:!0,command:t$1}}if(c==="get"){let a=await g.getAcpJson()??{};if(i){let l=i.split(".");for(let m of l)if(a&&typeof a=="object"&&m in a)a=a[m];else {a=void 0;break}}if(s)emitJsonOk({key:i,value:a},{command:t$1});else {let l={key:n("cli.config.field.key"),value:n("cli.config.field.value")},m=a==null?String(a):typeof a=="object"?JSON.stringify(a,null,2):String(a);printHuman([oe({key:i,value:m},l)],{title:"acp config get",boxed:!0});}return {code:0,handled:!0,command:t$1}}return console.error(n("cli.config.usage")),P(t$1,s,{title:n("cli.config.error.no_subcommand.title",{fallback:"missing subcommand"}),message:n("cli.config.usage"),hint:n("cli.config.error.no_subcommand.hint",{fallback:'Use "easbot-acp config get [key]" or "easbot-acp config set <key> <value>".'})})}default:{let c=n("acp.error.unknown_command",{vars:{command:t$1}}),i=n("cli.banner.hint.run_help");return y.warn(c),P(t$1??"__unknown__",s,{title:n("acp.error.unknown_command.title",{fallback:"unknown command"}),field:n("acp.error.unknown_command.field",{fallback:"command"}),value:t$1,message:c,hint:i},{exitCode:2})}}}catch(c){let i=errorMeta(c),p=i.message;y.error(`acp command ${t$1} failed`,{command:t$1,error:i});let g=r?.cwd??"",d=n("acp.cli.error_prefix",{vars:{cwd:g,command:t$1,message:p}});return P(t$1??"__unknown__",s,{title:n("acp.cli.command_failed_title",{fallback:"command failed"}),message:d,hint:n("acp.cli.error_hint",{fallback:"Re-run with --debug for full stack."})})}}
|
|
11
|
-
export{pe as a,fe as b,S as c,N as d,T as e,De as f,$e as g,Y as h,n as i,We as j,Re as k,Pe as l,je as m,Oe as n,ht as o};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkSNWAB3QJ_cjs=require('./chunk-SNWAB3QJ.cjs'),chunkRGGMCKYA_cjs=require('./chunk-RGGMCKYA.cjs'),utils=require('@easbot/utils'),terminal=require('@easbot/terminal');var K={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 de=K.languages,pe=de.filter(e=>e.supported).map(e=>e.value),x={defaultLocale:"zh-CN",timeZone:"Asia/Shanghai",locales:pe},C={},j=(e,r)=>{let t=C[e]||{translation:{}};return C[e]={translation:{...t.translation,...r.translation}},C[e]},R=(e=x.defaultLocale)=>(C[e]||j(e,{translation:{}}),{locale:e,resources:C[e]||{translation:{}}}),Ue=e=>R(e),De=e=>C[e];var fe={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.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=fe;var ge={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":"address","acp.field.timeout":"timeout","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}})"}},M=ge;var ue=()=>{R("zh-CN"),R("en-US"),j("zh-CN",H),j("en-US",M);};ue();var O=new Map;var me=e=>{if(O.has(e))return O.get(e);let r=/{{\s*(\w+)\s*}}/g,t=[],o;for(;(o=r.exec(e))!==null;){let i=o[1];i&&!t.includes(i)&&t.push(i);}let s=new RegExp("{{\\s*("+t.join("|")+")\\s*}}","g"),c={keys:t,regex:s};return O.set(e,c),c},F=(e,r)=>{if(!e||typeof e!="string")return "";if(!r||Object.keys(r).length===0)return e;let{regex:t,keys:o}=me(e);return o.length===0||!o.some(c=>c in r)?e:e.replace(t,(c,i)=>{let p=r[i];return p==null?"":String(p)})},q=e=>{if(e&&x.locales.includes(e))return e;let r=process.env.EASBOT_LANG?.trim()||process.env.LANG?.trim();if(r){let t=r.replace(/_/g,"-");if(x.locales.includes(t))return t;let o=t.split("-")[0];if(o==="zh")return "zh-CN";if(o==="en")return "en-US"}return x.defaultLocale},V=e=>R(e).resources,W=(e,r={})=>{let t=q(r.locale),s=V(t)?.translation[e];if(s&&typeof s=="string"){let c=F(s,r.vars);return c!=null?String(c):String(e)}if(t!==x.defaultLocale){let i=V(x.defaultLocale)?.translation[e];if(i&&typeof i=="string"){let p=F(i,r.vars);return p!=null?String(p):String(e)}}return String(r.fallback??e)},n=W,qe=(e,r={})=>({message:W(e,r),locale:q(r.locale),context:r.context??{}});function Y(){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"}}}chunkRGGMCKYA_cjs.b.WS;var ye={directory:"directory",server:"server",channel:"channel",port:"port",hostname:"hostname",enabled:"enabled",clients:"clients"},_e={acpJsonPath:"acp.json path",acpJsonExists:"acp.json exists",configLoadable:"config loadable",configError:"config error",sdkVersion:"SDK version"},we={directory:"directory",channel:"channel",host:"address",timeout:"timeout"},Ae={key:"key",value:"value"};function J(e){return e?terminal.Symbol.colorize("\u2713","success"):terminal.Symbol.colorize("\u2717","error")}function xe(e){return terminal.colorize(terminal.isRich(),terminal.theme.heading,e)}function Q(e){let r=[],t=e.skipped?"config already exists at":"initialized at",o=terminal.formatSuccess(`acp ${t} ${e.configPath}`);return r.push(o),e.channel!==void 0&&r.push(terminal.formatKeyValue("channel",e.channel)),r.join(`
|
|
2
|
-
`)}function X(e,r){let t={...ye,...r},o=[];o.push(terminal.formatKeyValue(t.directory,e.directory)),o.push(` ${xe(t.server)}`);let s=e.server??{},c=s.channel??"websocket",i=s.port??3e3,p=s.hostname??"localhost",g=s.enabled??true;return o.push(` ${terminal.formatKeyValue(t.channel,c)}`),o.push(` ${terminal.formatKeyValue(t.port,String(i))}`),o.push(` ${terminal.formatKeyValue(t.hostname,p)}`),o.push(` ${terminal.formatKeyValue(t.enabled,J(g))}`),o.push(terminal.formatKeyValue(t.clients,String(e.clientCount))),o.join(`
|
|
3
|
-
`)}function ee(e,r){let t={..._e,...r},o=[];return o.push(terminal.formatKeyValue(t.acpJsonPath,e.acpJsonPath)),o.push(terminal.formatKeyValue(t.acpJsonExists,J(e.acpJsonExists))),o.push(terminal.formatKeyValue(t.configLoadable,J(e.configLoadable))),o.push(terminal.formatKeyValue(t.sdkVersion,e.sdkVersion)),!e.configLoadable&&e.configError&&o.push(terminal.formatKeyValue(t.configError,e.configError)),o.join(`
|
|
4
|
-
`)}function te(e,r){let t={...we,...r},o=[];return e.head&&o.push(terminal.formatSuccess(e.head)),o.push(terminal.formatKeyValue(t.directory,e.directory)),o.push(terminal.formatKeyValue(t.channel,e.channel)),o.push(terminal.formatKeyValue(t.host,e.host)),o.push(terminal.formatKeyValue(t.timeout,e.timeout)),o.join(`
|
|
5
|
-
`)}function ne(e,r){let t={...Ae,...r},o=[],s=e.key??"(root)";return o.push(terminal.formatKeyValue(t.key,s)),o.push(terminal.formatKeyValue(t.value,e.value)),o.join(`
|
|
6
|
-
`)}function oe(e){return terminal.formatSuccess(`set ${e.key} = ${e.value}`)}var Se={field:"field",message:"message",hint:"hint"};function re(e,r){let t={...Se,...r},o=[];return o.push(terminal.formatError(e.title)),e.field!==void 0&&o.push(terminal.formatKeyValue(t.field,e.value??"")),o.push(terminal.formatKeyValue(t.message,e.message)),e.hint&&o.push(terminal.formatKeyValue(t.hint,e.hint)),o.join(`
|
|
7
|
-
`)}var ie="@agentclientprotocol/sdk/unstable (workspace dep)",Ee=[{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 P(e){return `\x1B[2m${e}\x1B[0m`}function se(e){return `\x1B[1m${e}\x1B[0m`}function Re(e){return `\x1B[36m${e}\x1B[0m`}function Te(){return P("$")}function D(e,r){let t=Ee.filter(s=>s.group===e),o=n(r);return `${se(o)}
|
|
8
|
-
`+t.map(s=>` ${Te()} easbot-acp ${s.name.padEnd(14)} ${P(n(s.i18nKey,{fallback:s.description}))}`).join(`
|
|
9
|
-
`)}function Ie(){let e=[`${se(Re("easbot-acp"))} \xB7 ${n("cli.banner.title",{fallback:"EASBot ACP (Agent Communication Protocol) Adapter"})}`,n("cli.banner.usage",{fallback:"Usage: easbot-acp <command> [options]"}),"",D("lifecycle","cli.banner.section.lifecycle"),"",D("server","cli.banner.section.server"),"",D("external","cli.banner.section.external")];console.log(e.join(`
|
|
10
|
-
`));}function Pe(){Ie(),console.log(""),console.log(P(n("cli.banner.global_flags",{fallback:"Global flags: --cwd <dir> --config <path> --log-level <L> --print-logs --debug"}))),console.log(P(`${n("cli.banner.local.standalone",{fallback:"Standalone users"})}: easbot-acp <command>`)),console.log(P(`${n("cli.banner.local.agent",{fallback:"Agent CLI users"})}: easbot acp <command>`));}var y=utils.Log.create({service:"acp.cli"}),ce=false;async function je(){if(!ce){ce=true;try{await chunkSNWAB3QJ_cjs.r();}catch(e){y.warn("registerBusinessErrors failed",{error:utils.errorMeta(e)});}}}function Ne(e,r){let t={...e??{}};return r.channel!==void 0&&(t.channel=r.channel),r.port!==void 0&&(t.port=r.port),r.hostname!==void 0&&(t.hostname=r.hostname),r.timeout!==void 0&&(t.timeout=r.timeout),t}function I(e,r,t,o){let s=o?.exitCode??1;if(r)terminal.emitJsonError(e,t.message);else {let c=o?.labels??{field:n("acp.error.field_label",{fallback:"field"}),message:n("acp.error.message_label",{fallback:"message"}),hint:n("acp.error.hint_label",{fallback:"hint"})};terminal.printHuman([re(t,c)],{title:"error",boxed:true,tone:"error",stream:"stderr"});}return {code:s,handled:s===1,command:s===1?e:null}}async function mt(e,r){let[t,...o]=e;if(!t)return Pe(),{code:0,handled:true,command:null};await je();let s=o.includes("--json");try{switch(t){case "init":{if(o.includes("--help")||o.includes("-h"))return console.log(n("cli.init.usage")),console.log(""),console.log(n("cli.init.opt.channel")),console.log(n("cli.init.opt.port")),console.log(n("cli.init.opt.hostname")),console.log(n("cli.init.opt.force")),console.log(n("cli.init.opt.json")),{code:0,handled:!0,command:t};let{AcpCache:c}=await import('./cache-5PSUWHGW.cjs'),i=await c.getConfigPath(),p=await c.exists(),g=o.includes("--force");if(p&&!g){let l=n("cli.init.exists",{vars:{path:i}});return y.warn(l),I(t,s,{title:n("cli.init.error.title",{fallback:"init failed"}),field:n("cli.init.error.field",{fallback:"path"}),value:i,message:l,hint:n("cli.init.error.hint",{fallback:"Pass --force to overwrite, or edit the existing file."})})}let d=Y();for(let l=0;l<o.length;l++){let m=o[l],u=o[l+1];m==="--channel"&&u?(d.server={...d.server??{},channel:u},l++):m==="--port"&&u?(d.server={...d.server??{},port:Number(u)},l++):m==="--hostname"&&u&&(d.server={...d.server??{},hostname:u},l++);}await c.writeAcpJson(d);let h={configPath:i},a=d.server?.channel;return s?terminal.emitJsonOk(h,{command:t}):terminal.printHuman([Q({configPath:i,channel:a})],{title:n("cli.init.title",{fallback:"init acp workspace"}),boxed:!0}),{code:0,handled:!0,command:t}}case "start":{if(o.includes("--help")||o.includes("-h"))return console.log(n("cli.start.usage")),console.log(""),console.log(n("cli.start.description")),console.log(n("cli.start.channel_default")),console.log(""),console.log(n("cli.start.opt.channel")),console.log(n("cli.start.opt.port")),console.log(n("cli.start.opt.hostname")),console.log(n("cli.start.opt.timeout")),{code:0,handled:!0,command:t};let c={};for(let b=0;b<o.length;b++){let w=o[b],v=o[b+1];w==="--channel"&&v?(c.channel=v,b++):w==="--port"&&v?(c.port=Number(v),b++):w==="--hostname"&&v?(c.hostname=v,b++):w==="--timeout"&&v&&(c.timeout=Number(v),b++);}let{loadConfig:i}=await import('./config-QMFC2VIL.cjs'),g=(await i()).server??{},d=Ne(g,c),h=d.channel??"websocket",a=h==="stdio"||h==="http"||h==="websocket"?h:"websocket",l=typeof d.port=="number"?d.port:3e3,m=typeof d.hostname=="string"?d.hostname:"localhost",u=typeof d.timeout=="number"?d.timeout:3e4;y.info("Bootstrapping ACP server",{channel:a,port:l,hostname:m,timeout:u,agentId:d.agentId});let{EasbotAdapter:k}=await import('./bootstrap-62VQO6JQ.cjs'),{ChannelType:_}=await import('./types-MQMNYZEY.cjs');await k.init({directory:r?.cwd??process.cwd(),printLogs:!1,logLevel:"INFO",channel:a==="stdio"?_.STDIO:a==="http"?_.HTTP:_.WS});let L=await k.ensureACPService({...d,directory:r?.cwd??process.cwd(),enabled:!0,channel:a,port:l,hostname:m,timeout:u}),$=chunkSNWAB3QJ_cjs.t({channel:a,hostname:m,port:l})??`unknown://${m}:${l}`;y.info("ACP server started successfully",{type:L.server?.type,url:$});let ae={directory:n("acp.field.directory"),channel:n("acp.field.channel"),host:n("acp.field.host"),timeout:n("acp.field.timeout")};terminal.printHuman([te({directory:r?.cwd??process.cwd(),channel:a,host:$,timeout:`${u}ms`,head:n("acp.server.started_head",{fallback:"ACP Server Started"})},ae)],{title:n("acp.server.started"),boxed:!0}),await new Promise(b=>{let w=!1,v=E=>{w||(w=!0,y.info(`Received ${E}, shutting down ACP server`,{signal:E}),b());};process.once("SIGINT",()=>v("SIGINT")),process.once("SIGTERM",()=>v("SIGTERM")),process.stdout.on("error",E=>{(E.code==="EPIPE"||E.code==="EIO")&&(y.info("stdout pipe broken, exiting ACP server"),v("STDOUT-BROKEN"));});});try{await k.destroy();}catch(b){y.warn("EasbotAdapter.destroy failed",{error:utils.errorMeta(b)});}return {code:0,handled:!0,command:t}}case "status":{if(o.includes("--help")||o.includes("-h"))return console.log(n("cli.status.usage")),{code:0,handled:!0,command:t};let{loadConfig:c,getConfigDirectory:i}=await import('./config-QMFC2VIL.cjs'),p=await c(),g={directory:i(),server:p.server,clientCount:p.clients?.clients?.length??0};if(s)terminal.emitJsonOk(g,{command:t});else {let d={directory:n("cli.status.field.directory"),server:n("cli.status.field.server"),channel:n("cli.status.field.server_channel"),port:n("cli.status.field.server_port"),hostname:n("cli.status.field.server_hostname"),enabled:n("cli.status.field.server_enabled"),clients:n("cli.status.field.clients")};terminal.printHuman([X({directory:g.directory,server:g.server,clientCount:g.clientCount},d)],{title:"acp status",boxed:!0});}return {code:0,handled:!0,command:t}}case "doctor":{if(o.includes("--help")||o.includes("-h"))return console.log(n("cli.doctor.usage")),{code:0,handled:!0,command:t};let{AcpCache:c}=await import('./cache-5PSUWHGW.cjs'),{loadConfig:i}=await import('./config-QMFC2VIL.cjs'),p=await c.getConfigPath(),g=await c.exists(),d=!1,h;try{await i(),d=!0;}catch(l){h=utils.errorMeta(l).message;}let a={acpJson:{path:p,exists:g},configLoadable:d,configError:h,sdkVersion:ie};if(s)terminal.emitJsonOk(a,{command:t});else {let l={acpJsonPath:n("cli.doctor.field.acp_json_path"),acpJsonExists:n("cli.doctor.field.acp_json_exists"),configLoadable:n("cli.doctor.field.config_loadable"),configError:n("cli.doctor.field.config_error"),sdkVersion:n("cli.doctor.field.sdk_version")};terminal.printHuman([ee({acpJsonPath:p,acpJsonExists:g,configLoadable:d,configError:h,sdkVersion:ie},l)],{title:"acp doctor",boxed:!0});}return {code:0,handled:!0,command:t}}case "config":{if(o.includes("--help")||o.includes("-h"))return console.log(n("cli.config.usage")),console.log(""),console.log(n("cli.config.description")),console.log(n("cli.config.subcommands")),console.log(` ${n("cli.config.get_help")}`),console.log(` ${n("cli.config.set_help")}`),console.log(""),console.log(n("cli.config.examples")),console.log(n("cli.config.example_get")),console.log(n("cli.config.example_set")),{code:0,handled:!0,command:t};let c=o[0],i=o[1],p=o[2],{AcpCache:g}=await import('./cache-5PSUWHGW.cjs'),{clearConfigCache:d}=await import('./config-QMFC2VIL.cjs');if(c==="set"&&i!==void 0&&p!==void 0){let h=await g.getAcpJson()??{},a=i.split(".").filter(k=>k.length>0);if(a.length===0)return I(t,s,{title:n("cli.config.error.invalid_key.title",{fallback:"invalid key"}),field:n("cli.config.error.field.key",{fallback:"key"}),value:i,message:n("cli.config.invalid_key",{vars:{key:i}}),hint:n("cli.config.error.invalid_key.hint",{fallback:'Use dotted path like "server.channel".'})});let l=h;for(let k=0;k<a.length-1;k++){let _=a[k],L=l[_];(typeof L!="object"||L===null||Array.isArray(L))&&(l[_]={}),l=l[_];}let m=a[a.length-1],u=p;return p==="true"?u=!0:p==="false"?u=!1:/^-?\d+(\.\d+)?$/.test(p)&&(u=Number(p)),l[m]=u,await g.writeAcpJson(h),d(),s?terminal.emitJsonOk({key:i,value:u},{command:t}):terminal.printHuman([oe({key:i,value:JSON.stringify(u)})],{title:"acp config set",boxed:!0}),{code:0,handled:!0,command:t}}if(c==="get"){let a=await g.getAcpJson()??{};if(i){let l=i.split(".");for(let m of l)if(a&&typeof a=="object"&&m in a)a=a[m];else {a=void 0;break}}if(s)terminal.emitJsonOk({key:i,value:a},{command:t});else {let l={key:n("cli.config.field.key"),value:n("cli.config.field.value")},m=a==null?String(a):typeof a=="object"?JSON.stringify(a,null,2):String(a);terminal.printHuman([ne({key:i,value:m},l)],{title:"acp config get",boxed:!0});}return {code:0,handled:!0,command:t}}return console.error(n("cli.config.usage")),I(t,s,{title:n("cli.config.error.no_subcommand.title",{fallback:"missing subcommand"}),message:n("cli.config.usage"),hint:n("cli.config.error.no_subcommand.hint",{fallback:'Use "easbot-acp config get [key]" or "easbot-acp config set <key> <value>".'})})}default:{let c=n("acp.error.unknown_command",{vars:{command:t}}),i=n("cli.banner.hint.run_help");return y.warn(c),I(t??"__unknown__",s,{title:n("acp.error.unknown_command.title",{fallback:"unknown command"}),field:n("acp.error.unknown_command.field",{fallback:"command"}),value:t,message:c,hint:i},{exitCode:2})}}}catch(c){let i=utils.errorMeta(c),p=i.message;y.error(`acp command ${t} failed`,{command:t,error:i});let g=r?.cwd??"",d=n("acp.cli.error_prefix",{vars:{cwd:g,command:t,message:p}});return I(t??"__unknown__",s,{title:n("acp.cli.command_failed_title",{fallback:"command failed"}),message:d,hint:n("acp.cli.error_hint",{fallback:"Re-run with --debug for full stack."})})}}
|
|
11
|
-
exports.a=de;exports.b=pe;exports.c=x;exports.d=j;exports.e=R;exports.f=Ue;exports.g=De;exports.h=W;exports.i=n;exports.j=qe;exports.k=Ee;exports.l=Ie;exports.m=Pe;exports.n=Ne;exports.o=mt;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkU3ROO3HG_cjs=require('./chunk-U3ROO3HG.cjs');require('./chunk-SNWAB3QJ.cjs'),require('./chunk-RGGMCKYA.cjs'),require('./chunk-ISDIC2R6.cjs');Object.defineProperty(exports,"COMMANDS_HELP",{enumerable:true,get:function(){return chunkU3ROO3HG_cjs.k}});Object.defineProperty(exports,"handleAcpCli",{enumerable:true,get:function(){return chunkU3ROO3HG_cjs.o}});Object.defineProperty(exports,"mergeStartServerConfig",{enumerable:true,get:function(){return chunkU3ROO3HG_cjs.n}});Object.defineProperty(exports,"renderBanner",{enumerable:true,get:function(){return chunkU3ROO3HG_cjs.l}});Object.defineProperty(exports,"renderHelp",{enumerable:true,get:function(){return chunkU3ROO3HG_cjs.m}});
|