@easbot/agent 0.2.36 → 0.2.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/dist/chunks/acp-DEC72N5Z.mjs +22 -0
  2. package/dist/chunks/adapter-loader-XS6BWT6F.mjs +1 -0
  3. package/dist/chunks/{agent-42R2LKEK.mjs → agent-4RGZCCWP.mjs} +1 -1
  4. package/dist/chunks/agent-FNDCT3LK.mjs +1 -0
  5. package/dist/chunks/app-I5FOXMDF.mjs +1 -0
  6. package/dist/chunks/{auth-3CQMCCCN.mjs → auth-SUHJJM24.mjs} +1 -1
  7. package/dist/chunks/bootstrap-OSZPS6EP.mjs +1 -0
  8. package/dist/chunks/{build-program-DN4GMTCL.mjs → build-program-AADEFCFD.mjs} +1 -1
  9. package/dist/chunks/bus-SCZARFCL.mjs +1 -0
  10. package/dist/chunks/{chunk-ZV27OCHD.mjs → chunk-7LTXB373.mjs} +1 -1
  11. package/dist/chunks/{chunk-DEZT7DOH.mjs → chunk-CCRIJZBK.mjs} +1 -1
  12. package/dist/chunks/{chunk-3INOJAKC.mjs → chunk-H47ICOJP.mjs} +1 -1
  13. package/dist/chunks/{chunk-ANA5RPJQ.mjs → chunk-IILYTWWL.mjs} +1 -1
  14. package/dist/chunks/{chunk-B6I7MJE5.mjs → chunk-IOMVCUO2.mjs} +1 -1
  15. package/dist/chunks/{chunk-SRFQPRTU.mjs → chunk-M7TI655U.mjs} +241 -241
  16. package/dist/chunks/{chunk-IVLHWGNX.mjs → chunk-OMGK2WUC.mjs} +15 -15
  17. package/dist/chunks/{chunk-YJG6NNVY.mjs → chunk-ONU6FQVM.mjs} +1 -1
  18. package/dist/chunks/{chunk-WQU6WFZO.mjs → chunk-OOI4D6ON.mjs} +1 -1
  19. package/dist/chunks/chunk-RK3Y4IMV.mjs +2 -0
  20. package/dist/chunks/{chunk-LQWOCD5V.mjs → chunk-SARDSKUQ.mjs} +1 -1
  21. package/dist/chunks/{chunk-DRWG7AVN.mjs → chunk-UOYFWTSY.mjs} +1 -1
  22. package/dist/chunks/{command-TARCWEDT.mjs → command-HXNWD64P.mjs} +1 -1
  23. package/dist/chunks/compaction-OSH6YUUL.mjs +1 -0
  24. package/dist/chunks/{config-TCMIE43H.mjs → config-7ZUIWRMI.mjs} +1 -1
  25. package/dist/chunks/{debug-IV6AE7PH.mjs → debug-DHBLLGIZ.mjs} +3 -3
  26. package/dist/chunks/event-NO7SFKKX.mjs +1 -0
  27. package/dist/chunks/{export-PNCMUMDM.mjs → export-4CIOZYMY.mjs} +1 -1
  28. package/dist/chunks/file-C3SQUYVR.mjs +1 -0
  29. package/dist/chunks/{gateway-SUNUN7H2.mjs → gateway-YJNOYJAU.mjs} +2 -2
  30. package/dist/chunks/{generate-CDWU5THL.mjs → generate-5SN5EG2R.mjs} +1 -1
  31. package/dist/chunks/{github-4FJJXS4S.mjs → github-EYHQZRKW.mjs} +1 -1
  32. package/dist/chunks/global-FF4MKJCJ.mjs +1 -0
  33. package/dist/chunks/{import-7URPIFDS.mjs → import-RMNXXJJE.mjs} +1 -1
  34. package/dist/chunks/installation-NZGQ2ZXZ.mjs +1 -0
  35. package/dist/chunks/instance-ADSGDDDR.mjs +1 -0
  36. package/dist/chunks/loader-BFMEWP6S.mjs +1 -0
  37. package/dist/chunks/loader-NQMVER4S.mjs +1 -0
  38. package/dist/chunks/lsp-2SQQPXM7.mjs +1 -0
  39. package/dist/chunks/{mcp-4N5YPRUC.mjs → mcp-HO7BWSDW.mjs} +1 -1
  40. package/dist/chunks/mcp-J3UIR35A.mjs +1 -0
  41. package/dist/chunks/models-UTUMURIZ.mjs +1 -0
  42. package/dist/chunks/{pr-57GKW2NH.mjs → pr-HVGP5NLH.mjs} +1 -1
  43. package/dist/chunks/preferences-ZNTUV4JW.mjs +1 -0
  44. package/dist/chunks/project-2D5PGMY4.mjs +1 -0
  45. package/dist/chunks/prompt-DWL63VVN.mjs +1 -0
  46. package/dist/chunks/provider-6LZMREKJ.mjs +1 -0
  47. package/dist/chunks/registry-QRMLBX6F.mjs +1 -0
  48. package/dist/chunks/revert-RLO2K6SP.mjs +1 -0
  49. package/dist/chunks/ripgrep-WPQB3RBY.mjs +1 -0
  50. package/dist/chunks/{run-SQ55OJGX.mjs → run-SACOLR6C.mjs} +5 -5
  51. package/dist/chunks/scheduler-W74P7BZY.mjs +1 -0
  52. package/dist/chunks/server-PSD2LV36.mjs +1 -0
  53. package/dist/chunks/session-3KHGGAUW.mjs +1 -0
  54. package/dist/chunks/{session-NGC7RO7S.mjs → session-QWBUCCTA.mjs} +1 -1
  55. package/dist/chunks/session-UO6W6MN3.mjs +1 -0
  56. package/dist/chunks/share-SUJHB6OU.mjs +1 -0
  57. package/dist/chunks/snapshot-X6DLN3UT.mjs +1 -0
  58. package/dist/chunks/{stats-QSNMP7FP.mjs → stats-RPGHGZUR.mjs} +1 -1
  59. package/dist/chunks/storage-IS4VGLPJ.mjs +1 -0
  60. package/dist/chunks/{tui-OM5OSJIB.mjs → tui-AZ5VJAUO.mjs} +1 -1
  61. package/dist/chunks/tui-TLXLQ6KA.mjs +1 -0
  62. package/dist/chunks/{types-SCQH7CCJ.mjs → types-XJNTBCTU.mjs} +1 -1
  63. package/dist/chunks/{update-QUELQLCK.mjs → update-GCCHHVAX.mjs} +1 -1
  64. package/dist/cli.mjs +2 -2
  65. package/package.json +13 -13
  66. package/dist/chunks/acp-YNV6DSAY.mjs +0 -22
  67. package/dist/chunks/adapter-loader-ZVGLTKEK.mjs +0 -1
  68. package/dist/chunks/agent-CBNCT4JD.mjs +0 -1
  69. package/dist/chunks/app-267XBNKU.mjs +0 -1
  70. package/dist/chunks/bootstrap-YSY5JYBG.mjs +0 -1
  71. package/dist/chunks/bus-MEXPAT3D.mjs +0 -1
  72. package/dist/chunks/chunk-HQE3WXCE.mjs +0 -2
  73. package/dist/chunks/compaction-2RGLDODF.mjs +0 -1
  74. package/dist/chunks/event-A4SSIBOT.mjs +0 -1
  75. package/dist/chunks/file-AOMTS73G.mjs +0 -1
  76. package/dist/chunks/global-7MTUN7RF.mjs +0 -1
  77. package/dist/chunks/installation-RR72B5VK.mjs +0 -1
  78. package/dist/chunks/instance-JRUNVEOY.mjs +0 -1
  79. package/dist/chunks/loader-JM3F4QIB.mjs +0 -1
  80. package/dist/chunks/loader-UNE2FHGW.mjs +0 -1
  81. package/dist/chunks/lsp-BBUMLIWW.mjs +0 -1
  82. package/dist/chunks/mcp-6ZTBDPWC.mjs +0 -1
  83. package/dist/chunks/models-CJXQ73ZY.mjs +0 -1
  84. package/dist/chunks/preferences-Y4LNARDF.mjs +0 -1
  85. package/dist/chunks/project-ZYIU2237.mjs +0 -1
  86. package/dist/chunks/prompt-GS6M2ZBC.mjs +0 -1
  87. package/dist/chunks/provider-O6YLQJVP.mjs +0 -1
  88. package/dist/chunks/registry-AMBTVLLZ.mjs +0 -1
  89. package/dist/chunks/revert-CRWOTK6M.mjs +0 -1
  90. package/dist/chunks/ripgrep-RAHKARMG.mjs +0 -1
  91. package/dist/chunks/scheduler-TA5BQWMN.mjs +0 -1
  92. package/dist/chunks/server-6YDMGLVO.mjs +0 -1
  93. package/dist/chunks/session-5MTHIW6C.mjs +0 -1
  94. package/dist/chunks/session-DKFZNLKJ.mjs +0 -1
  95. package/dist/chunks/share-JA7GTDRM.mjs +0 -1
  96. package/dist/chunks/snapshot-AAJ23W7N.mjs +0 -1
  97. package/dist/chunks/storage-L7PFYGAO.mjs +0 -1
  98. package/dist/chunks/tui-7JLDLNRO.mjs +0 -1
@@ -1,2 +1,2 @@
1
- import {a as a$1}from'./chunk-DRWG7AVN.mjs';import {h,g,e,d}from'./chunk-M3K32WJV.mjs';import'./chunk-SRFQPRTU.mjs';import'./chunk-DEZT7DOH.mjs';import'./chunk-YJG6NNVY.mjs';import'./chunk-ANA5RPJQ.mjs';import'./chunk-ZBRXNYEM.mjs';import'./chunk-LQWOCD5V.mjs';import'./chunk-2RSIOAZV.mjs';import'./chunk-AAJAKVQY.mjs';import {i}from'./chunk-UNBJ6Y7L.mjs';import'./chunk-3INOJAKC.mjs';import'./chunk-B6I7MJE5.mjs';import'./chunk-CJTCCLW4.mjs';import'./chunk-HQE3WXCE.mjs';import {a}from'./chunk-LFYBZHOI.mjs';import'./chunk-ZV27OCHD.mjs';import'./chunk-X6ISXWBN.mjs';import {Semver,Shell,Fetch,PKG}from'@easbot/utils';var m=a.create({service:"cli-command-update"});function H(t,i$1){t.command("update [target]").description(i("update.command.description")).option("--method <method>",i("update.option.method")).action(async(e$1,n)=>{m.debug("Update command started",{target:e$1,method:n.method});try{console.log(h(i("update.starting")));let{Global:s}=await import('./global-7MTUN7RF.mjs'),a=s.getVersion()||"unknown";console.log(g(i("update.current_version",{vars:{version:a}})));let o=e$1||"latest";o==="latest"&&(o=await f(),o==="latest"&&(console.error(e(i("update.latest_fetch_failed"))),process.exit(1))),console.log(g(i("update.target_version",{vars:{version:o}})));let p=o.replace(/^v/,"");Semver.isValid(p)||(console.error(e(i("update.invalid_version",{vars:{version:o}}))),process.exit(1));let v=Semver.compare(a,p);v===0&&(console.log(d(i("update.already_latest",{vars:{version:a}}))),process.exit(0)),v>0&&console.warn(g(i("update.downgrade_warning",{vars:{from:a,to:p}}))),console.log(g(i("update.downloading")));let l=await a$1(i$1.config.directory,()=>x(o,n.method));l.success?(console.log(d(i("update.success",{vars:{version:l.version||o}}))),process.exit(0)):(console.error(e(i("update.failed",{vars:{error:l.error||"Unknown error"}}))),process.exit(1));}catch(s){m.error("Update failed",{error:s instanceof Error?s.message:String(s)}),console.error(e(i("update.error",{vars:{error:s instanceof Error?s.message:String(s)}}))),process.exit(1);}});}async function x(t,i){try{let e=t;t==="latest"?e=await f():(e=t.replace(/^v/,""),Semver.isValid(e)||(e=await f(),m.debug("Invalid version provided, using latest",{target:t,version:e})));let n=i||await E();m.debug("Updating to version",{version:e,method:n});let s=process.platform==="win32"?"cmd":void 0,a=V(n,e);m.debug(`Using ${n} to update`,{version:e,shell:s,command:a});let o=await Shell.run(s,a,{windowsHide:!0,timeout:600*1e3,env:{npm_config_loglevel:"error",PNPM_LOGLEVEL:"error",BUN_LOG_LEVEL:"error"}});return o.code===0?{success:!0,version:e}:{success:!1,error:o.stderr||o.stdout||`Exit code: ${o.code}`||"Update failed"}}catch(e){return {success:false,error:e instanceof Error?e.message:String(e)}}}function V(t,i){let n=`@easbot/agent@${i}`;switch(t){case "pnpm":return `pnpm add -g ${n} --loglevel error`;case "bun":return `bun add -g ${n}`;default:return `npm install -g ${n} --loglevel error`}}async function f(){try{return (await Fetch.get("https://registry.npmjs.org/@easbot/agent/latest")).data?.version||"latest"}catch{return "latest"}}async function E(){let t=await PKG.packageManager();return t?t.name:"npm"}
1
+ import {a as a$1}from'./chunk-UOYFWTSY.mjs';import {h,g,e,d}from'./chunk-M3K32WJV.mjs';import'./chunk-M7TI655U.mjs';import'./chunk-CCRIJZBK.mjs';import'./chunk-ONU6FQVM.mjs';import'./chunk-IILYTWWL.mjs';import'./chunk-ZBRXNYEM.mjs';import'./chunk-SARDSKUQ.mjs';import'./chunk-2RSIOAZV.mjs';import'./chunk-AAJAKVQY.mjs';import {i}from'./chunk-UNBJ6Y7L.mjs';import'./chunk-H47ICOJP.mjs';import'./chunk-IOMVCUO2.mjs';import'./chunk-CJTCCLW4.mjs';import'./chunk-RK3Y4IMV.mjs';import {a}from'./chunk-LFYBZHOI.mjs';import'./chunk-7LTXB373.mjs';import'./chunk-X6ISXWBN.mjs';import {Semver,Shell,Fetch,PKG}from'@easbot/utils';var m=a.create({service:"cli-command-update"});function H(t,i$1){t.command("update [target]").description(i("update.command.description")).option("--method <method>",i("update.option.method")).action(async(e$1,n)=>{m.debug("Update command started",{target:e$1,method:n.method});try{console.log(h(i("update.starting")));let{Global:s}=await import('./global-FF4MKJCJ.mjs'),a=s.getVersion()||"unknown";console.log(g(i("update.current_version",{vars:{version:a}})));let o=e$1||"latest";o==="latest"&&(o=await f(),o==="latest"&&(console.error(e(i("update.latest_fetch_failed"))),process.exit(1))),console.log(g(i("update.target_version",{vars:{version:o}})));let p=o.replace(/^v/,"");Semver.isValid(p)||(console.error(e(i("update.invalid_version",{vars:{version:o}}))),process.exit(1));let v=Semver.compare(a,p);v===0&&(console.log(d(i("update.already_latest",{vars:{version:a}}))),process.exit(0)),v>0&&console.warn(g(i("update.downgrade_warning",{vars:{from:a,to:p}}))),console.log(g(i("update.downloading")));let l=await a$1(i$1.config.directory,()=>x(o,n.method));l.success?(console.log(d(i("update.success",{vars:{version:l.version||o}}))),process.exit(0)):(console.error(e(i("update.failed",{vars:{error:l.error||"Unknown error"}}))),process.exit(1));}catch(s){m.error("Update failed",{error:s instanceof Error?s.message:String(s)}),console.error(e(i("update.error",{vars:{error:s instanceof Error?s.message:String(s)}}))),process.exit(1);}});}async function x(t,i){try{let e=t;t==="latest"?e=await f():(e=t.replace(/^v/,""),Semver.isValid(e)||(e=await f(),m.debug("Invalid version provided, using latest",{target:t,version:e})));let n=i||await E();m.debug("Updating to version",{version:e,method:n});let s=process.platform==="win32"?"cmd":void 0,a=V(n,e);m.debug(`Using ${n} to update`,{version:e,shell:s,command:a});let o=await Shell.run(s,a,{windowsHide:!0,timeout:600*1e3,env:{npm_config_loglevel:"error",PNPM_LOGLEVEL:"error",BUN_LOG_LEVEL:"error"}});return o.code===0?{success:!0,version:e}:{success:!1,error:o.stderr||o.stdout||`Exit code: ${o.code}`||"Update failed"}}catch(e){return {success:false,error:e instanceof Error?e.message:String(e)}}}function V(t,i){let n=`@easbot/agent@${i}`;switch(t){case "pnpm":return `pnpm add -g ${n} --loglevel error`;case "bun":return `bun add -g ${n}`;default:return `npm install -g ${n} --loglevel error`}}async function f(){try{return (await Fetch.get("https://registry.npmjs.org/@easbot/agent/latest")).data?.version||"latest"}catch{return "latest"}}async function E(){let t=await PKG.packageManager();return t?t.name:"npm"}
2
2
  export{H as registerUpdateCommand};
package/dist/cli.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import {e,h}from'./chunks/chunk-M3K32WJV.mjs';import {a}from'./chunks/chunk-LFYBZHOI.mjs';import'./chunks/chunk-X6ISXWBN.mjs';process.noDeprecation=true;async function b(){let{loadEnv:o}=await import('@easbot/utils');o();let{Global:t}=await import('./chunks/global-7MTUN7RF.mjs');await t.init();let r=y(),h$1=()=>r.log_level?r.log_level:E.isLocal()?"DEBUG":"INFO";await a.init({logDir:t.Path.log,print:r.print_logs??false,dev:r.debug??false,level:h$1()});let w=a.create({service:"cli"}),{t:g}=await import('./chunks/i18n-OMQXNLBR.mjs'),{bootstrapProgram:m}=await import('./chunks/bootstrap-YSY5JYBG.mjs'),{Installation:E}=await import('./chunks/installation-RR72B5VK.mjs'),{isTuiMode:d}=await import('./chunks/is-tui-mode-TFK352KK.mjs');await t.init();let f=process.argv.includes("acp")||process.argv.includes("serve")||process.argv.includes("gateway"),p;try{p=(await import('./chunks/app-267XBNKU.mjs')).getGlobalErrorHandler;}catch{}process.on("unhandledRejection",e=>{let c=d(),i=p?.(),a=e instanceof Error?e.message:String(e),n=e instanceof Error?e.stack:"";if(c){if(i){i(e,"unhandledRejection");return}try{process.stderr.write(`[TUI unhandledRejection] ${a}
2
+ import {e,h}from'./chunks/chunk-M3K32WJV.mjs';import {a}from'./chunks/chunk-LFYBZHOI.mjs';import'./chunks/chunk-X6ISXWBN.mjs';process.noDeprecation=true;async function b(){let{loadEnv:o}=await import('@easbot/utils');o();let{Global:t}=await import('./chunks/global-FF4MKJCJ.mjs');await t.init();let r=y(),h$1=()=>r.log_level?r.log_level:E.isLocal()?"DEBUG":"INFO";await a.init({logDir:t.Path.log,print:r.print_logs??false,dev:r.debug??false,level:h$1()});let w=a.create({service:"cli"}),{t:g}=await import('./chunks/i18n-OMQXNLBR.mjs'),{bootstrapProgram:m}=await import('./chunks/bootstrap-OSZPS6EP.mjs'),{Installation:E}=await import('./chunks/installation-NZGQ2ZXZ.mjs'),{isTuiMode:d}=await import('./chunks/is-tui-mode-TFK352KK.mjs');await t.init();let f=process.argv.includes("acp")||process.argv.includes("serve")||process.argv.includes("gateway"),p;try{p=(await import('./chunks/app-I5FOXMDF.mjs')).getGlobalErrorHandler;}catch{}process.on("unhandledRejection",e=>{let c=d(),i=p?.(),a=e instanceof Error?e.message:String(e),n=e instanceof Error?e.stack:"";if(c){if(i){i(e,"unhandledRejection");return}try{process.stderr.write(`[TUI unhandledRejection] ${a}
3
3
  `),n&&process.stderr.write(`${n}
4
4
  `);}catch{}return}try{process.stderr.write(`[unhandledRejection] ${a}
5
5
  `),n&&process.stderr.write(`${n}
@@ -7,4 +7,4 @@ import {e,h}from'./chunks/chunk-M3K32WJV.mjs';import {a}from'./chunks/chunk-LFYB
7
7
  `),n&&process.stderr.write(`${n}
8
8
  `);}catch{}return}try{process.stderr.write(`[uncaughtException] ${a}
9
9
  `),n&&process.stderr.write(`${n}
10
- `);}catch{}f||process.exit(1);});try{let{initModelsRefresh:e}=await import('./chunks/models-CJXQ73ZY.mjs');e(),await(await m(r)).parseAsync(process.argv);}catch(e$1){w.error("CLI failed to execute",{error:e$1});let c=e$1 instanceof Error?e$1.message:String(e$1),i=e$1 instanceof Error?e$1.stack:"";console.error(e(g("cli.error.execution_failed"))),c&&console.error(h(g("cli.error.detail"))),i&&console.error(i),process.exit(1);}finally{await a.close();}}function y(){let s={directory:process.cwd(),print_logs:false,log_level:"INFO",debug:false};for(let o=0;o<process.argv.length;o++){let t=process.argv[o];if(t)if(t==="--cwd"&&o+1<process.argv.length){let r=process.argv[o+1];r&&!r.startsWith("-")&&(s.directory=r,o++);}else if(t.startsWith("--cwd="))s.directory=t.slice(6);else if(t==="--config"&&o+1<process.argv.length){let r=process.argv[o+1];r&&!r.startsWith("-")&&(s.config_path=r,o++);}else if(t.startsWith("--config="))s.config_path=t.slice(9);else if(t==="--print-logs")s.print_logs=true;else if(t==="--log-level"&&o+1<process.argv.length){let r=process.argv[o+1];r&&!r.startsWith("-")&&(s.log_level=r.toUpperCase(),o++);}else t.startsWith("--log-level=")?s.log_level=t.slice(12).toUpperCase():t==="--debug"&&(s.debug=true);}return s}b();
10
+ `);}catch{}f||process.exit(1);});try{let{initModelsRefresh:e}=await import('./chunks/models-UTUMURIZ.mjs');e(),await(await m(r)).parseAsync(process.argv);}catch(e$1){w.error("CLI failed to execute",{error:e$1});let c=e$1 instanceof Error?e$1.message:String(e$1),i=e$1 instanceof Error?e$1.stack:"";console.error(e(g("cli.error.execution_failed"))),c&&console.error(h(g("cli.error.detail"))),i&&console.error(i),process.exit(1);}finally{await a.close();}}function y(){let s={directory:process.cwd(),print_logs:false,log_level:"INFO",debug:false};for(let o=0;o<process.argv.length;o++){let t=process.argv[o];if(t)if(t==="--cwd"&&o+1<process.argv.length){let r=process.argv[o+1];r&&!r.startsWith("-")&&(s.directory=r,o++);}else if(t.startsWith("--cwd="))s.directory=t.slice(6);else if(t==="--config"&&o+1<process.argv.length){let r=process.argv[o+1];r&&!r.startsWith("-")&&(s.config_path=r,o++);}else if(t.startsWith("--config="))s.config_path=t.slice(9);else if(t==="--print-logs")s.print_logs=true;else if(t==="--log-level"&&o+1<process.argv.length){let r=process.argv[o+1];r&&!r.startsWith("-")&&(s.log_level=r.toUpperCase(),o++);}else t.startsWith("--log-level=")?s.log_level=t.slice(12).toUpperCase():t==="--debug"&&(s.debug=true);}return s}b();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easbot/agent",
3
- "version": "0.2.36",
3
+ "version": "0.2.39",
4
4
  "description": "Core Agent for the easbot monorepo ecosystem",
5
5
  "type": "module",
6
6
  "bin": {
@@ -112,18 +112,18 @@
112
112
  "xdg-basedir": "5.1.0",
113
113
  "zod": "^4.4.3",
114
114
  "zod-to-json-schema": "^3.25.2",
115
- "@easbot/codebase": "0.2.36",
116
- "@easbot/gateway": "0.2.36",
117
- "@easbot/local-model-sdk": "0.2.36",
118
- "@easbot/memory": "0.2.36",
119
- "@easbot/plugin": "0.2.36",
120
- "@easbot/note": "0.2.36",
121
- "@easbot/mcp": "0.2.36",
122
- "@easbot/tui": "0.2.36",
123
- "@easbot/ollama-sdk": "0.2.36",
124
- "@easbot/sdk": "0.2.36",
125
- "@easbot/types": "0.2.36",
126
- "@easbot/utils": "0.2.36"
115
+ "@easbot/types": "0.2.39",
116
+ "@easbot/utils": "0.2.39",
117
+ "@easbot/codebase": "0.2.39",
118
+ "@easbot/local-model-sdk": "0.2.39",
119
+ "@easbot/gateway": "0.2.39",
120
+ "@easbot/memory": "0.2.39",
121
+ "@easbot/note": "0.2.39",
122
+ "@easbot/mcp": "0.2.39",
123
+ "@easbot/ollama-sdk": "0.2.39",
124
+ "@easbot/plugin": "0.2.39",
125
+ "@easbot/sdk": "0.2.39",
126
+ "@easbot/tui": "0.2.39"
127
127
  },
128
128
  "devDependencies": {
129
129
  "@actions/core": "^3.0.1",
@@ -1,22 +0,0 @@
1
- import {a as a$2}from'./chunk-LAHYVX5K.mjs';import {a as a$3}from'./chunk-DRWG7AVN.mjs';import'./chunk-VII7JKGB.mjs';import {g,e as e$1,d,k,i as i$1,b as b$2,h,c,a as a$4}from'./chunk-M3K32WJV.mjs';import {Ha,xa,Oa,qb,la,ma,za,Aa,pb,Q as Q$1}from'./chunk-SRFQPRTU.mjs';import'./chunk-DEZT7DOH.mjs';import'./chunk-YJG6NNVY.mjs';import'./chunk-ANA5RPJQ.mjs';import'./chunk-ZBRXNYEM.mjs';import'./chunk-LQWOCD5V.mjs';import {e,f}from'./chunk-2RSIOAZV.mjs';import'./chunk-AAJAKVQY.mjs';import {i}from'./chunk-UNBJ6Y7L.mjs';import {b}from'./chunk-3INOJAKC.mjs';import'./chunk-B6I7MJE5.mjs';import'./chunk-CJTCCLW4.mjs';import'./chunk-HQE3WXCE.mjs';import {a}from'./chunk-LFYBZHOI.mjs';import {a as a$1}from'./chunk-ZV27OCHD.mjs';import {b as b$1}from'./chunk-X6ISXWBN.mjs';import'commander';import {parseModelId,PKG,createServer,getProxyConfig}from'@easbot/utils';import {applyPatch}from'diff';import Ke from'path';import {z}from'zod';import {WebSocketServer}from'ws';import {pathToFileURL}from'url';import {ndJsonStream,AgentSideConnection,RequestError}from'@agentclientprotocol/sdk';var w=a.create({service:"acp-event-bridge"}),Qe={Info:z.object({id:z.string(),content:z.string(),status:z.enum(["in_progress","pending","completed","cancelled"]),priority:z.enum(["high","medium","low"])})},j=class{constructor(e,t){b$1(this,"sdk");b$1(this,"connection");b$1(this,"abortController",null);b$1(this,"started",false);b$1(this,"permissionQueues",new Map);b$1(this,"permissionOptions",[{optionId:"once",kind:"allow_once",name:"Allow once"},{optionId:"always",kind:"allow_always",name:"Always allow"},{optionId:"reject",kind:"reject_once",name:"Reject"}]);b$1(this,"acpService");this.sdk=e,this.connection=t;}setService(e){this.acpService=e;}async start(){if(this.started){w.warn("AcpEventBridge already started");return}this.started=true,this.abortController=new AbortController,w.info("starting ACP event bridge"),this.runEventSubscription().catch(e=>{this.abortController?.signal.aborted||w.error("event subscription failed",{error:e});});}async stop(){this.started&&(w.info("stopping ACP event bridge"),this.started=false,this.abortController?.abort(),this.abortController=null,this.permissionQueues.clear(),w.info("ACP event bridge stopped"));}async runEventSubscription(){for(;;){if(this.abortController?.signal.aborted)return;let e=await this.sdk.global.event({signal:this.abortController?.signal??void 0});for await(let t of e.stream){if(this.abortController?.signal.aborted)return;let n=t?.payload;n&&await this.handleEvent(n).catch(s=>{w.error("failed to handle event",{error:s,type:n.type});});}}}async handleEvent(e){switch(e.type){case "permission.asked":await this.handlePermissionAsked(e.properties);break;case "question.asked":await this.handleQuestionAsked(e.properties);break;case "message.part.updated":await this.handleMessagePartUpdated(e.properties);break;case "session.status":await this.handleSessionStatus(e.properties);break;case "session.deleted":await this.handleSessionDeleted(e.properties);break}}async handleSessionStatus(e){let{sessionID:t,status:n}=e;if(w.debug("Handling session status event in ACP bridge",{sessionID:t,status:n}),!this.connection){w.warn("No connection available to publish session status");return}try{await this.connection.extNotification("session.status",{sessionId:t,status:n}),w.debug("Session status published via extNotification",{sessionID:t,status:n});}catch(s){w.error("Failed to publish session status via extNotification",{sessionID:t,status:n,error:s});}}async handleSessionDeleted(e){let{sessionID:t}=e;if(w.info("Handling session deleted event in ACP bridge",{sessionID:t}),!this.connection){w.warn("No connection available to notify session deletion");return}try{await this.connection.sessionUpdate({sessionId:t,update:{sessionUpdate:"agent_message_chunk",content:{type:"text",text:"[System] Session has been deleted by the backend. This session is no longer available."}}}),w.debug("Session deletion notified to client",{sessionID:t});}catch(n){w.error("Failed to notify session deletion to client",{sessionID:t,error:n});}}async handlePermissionAsked(e){let{id:t,sessionID:n,permission:s,tool:o,metadata:r}=e,a=(this.permissionQueues.get(n)??Promise.resolve()).then(async()=>{let g=r?.directory??"",P=s==="external_directory"&&r?.tool?me(r.tool):me(s),I=s==="external_directory"&&r?.tool?ge(r.tool,r):ge(s,r),p=await this.connection.requestPermission({sessionId:n,toolCall:{callID:o?.callID??t,status:"pending",title:s,rawInput:r,kind:P,locations:(I??[]).map(u=>u.path)},options:this.permissionOptions}).catch(async u=>{w.error("failed to request permission from ACP",{error:u,permissionID:t,sessionID:n}),await this.sdk.permission.reply({requestID:t,reply:"reject",directory:g});});if(p){if(p.outcome.outcome!=="selected"){await this.sdk.permission.reply({requestID:t,reply:"reject",directory:g});return}if(p.outcome.optionId!=="reject"&&s==="edit"){let u=r?.filepath??r?.filePath??"",d=r?.diff??"";if(u&&d){let c=PKG.file(u),f=await c.exists()?await c.text():"",m=Je(f,d);m&&await this.connection.extMethod("client.writeTextFile",{sessionId:n,path:u,content:m});}}await this.sdk.permission.reply({requestID:t,reply:p.outcome.optionId,directory:g});}}).catch(g=>{w.error("failed to handle permission",{error:g,permissionID:t});}).finally(()=>{this.permissionQueues.get(n)===a&&this.permissionQueues.delete(n);});this.permissionQueues.set(n,a);}async handleQuestionAsked(e){let{id:t,sessionID:n,questions:s}=e,o="";w.debug("Handling question asked in ACP bridge",{requestID:t,sessionID:n,questionCount:s.length});try{let r=await this.connection.extMethod("client.requestQuestion",{sessionId:n,requestId:t,questions:s});if(!r){w.warn("Question request returned no result"),await this.sdk.question.reject({requestID:t,directory:o});return}w.debug("Question request completed",{requestID:t,outcome:r.outcome,answerCount:r.answers?.length??0}),r.outcome==="selected"&&r.answers&&r.answers.length>0?(await this.sdk.question.reply({requestID:t,answers:r.answers.map(l=>[l.answer]),directory:o}),w.debug("Question answers submitted",{requestID:t})):(await this.sdk.question.reject({requestID:t,directory:o}),w.debug("Question rejected",{requestID:t}));}catch(r){w.error("Failed to handle question via extMethod",{error:r instanceof Error?r.message:String(r),requestID:t,sessionID:n}),await this.sdk.question.reject({requestID:t,directory:o});}}async handleMessagePartUpdated(e){let{part:t}=e;w.debug("message part updated",{event:e});let n=await this.sdk.session.message({sessionID:t.sessionID,messageID:t.messageID},{throwOnError:true}).then(s=>s.data).catch(s=>{s instanceof Error&&s.name==="NotFoundError"?w.debug("message not found, skipping",{sessionID:t.sessionID,messageID:t.messageID}):w.error("unexpected error when fetching message",{error:s});});!n||n.info.role!=="assistant"||(t.type==="tool"?await this.handleToolPart(t):t.type==="text"?await this.handleTextPart(t,e.delta):t.type==="reasoning"?await this.handleReasoningPart(t,e.delta):t.type==="step-finish"&&await this.handleStepFinishPart(t));}async handleToolPart(e){let{sessionID:t,callID:n,tool:s,state:o,messageID:r}=e,l=me(s);switch(o.status){case "pending":await this.connection.sessionUpdate({sessionId:t,update:{sessionUpdate:"tool_call",toolCallId:n,title:s,kind:l,status:"pending",locations:[],rawInput:{},_meta:{messageId:r}}}).catch(a=>{w.error("failed to send tool pending to ACP",{error:a});});return;case "running":await this.connection.sessionUpdate({sessionId:t,update:{sessionUpdate:"tool_call_update",toolCallId:n,status:"in_progress",kind:l,title:s,locations:ge(s,o.input),rawInput:o.input,_meta:{messageId:r}}}).catch(a=>{w.error("failed to send tool in_progress to ACP",{error:a});});return;case "completed":{let a=[{type:"content",content:{type:"text",text:o.output}}];if(l==="edit"){let g=o.input,P=g.filePath??g.filepath??"",I=g.oldString??"",p=g.newString??g.content??"";a.push({type:"diff",path:P,oldText:I,newText:p});}if(s==="todo"){let g=Qe.Info.array().safeParse(JSON.parse(o.output));g.success&&o.input.operation==="write"&&await this.connection.sessionUpdate({sessionId:t,update:{sessionUpdate:"plan",entries:g.data.map(P=>{let I=P.status==="cancelled"?"completed":P.status;return {priority:P.priority,status:I,content:P.content}})}}).catch(P=>{w.error("failed to send session update for todo",{error:P});});}await this.connection.sessionUpdate({sessionId:t,update:{sessionUpdate:"tool_call_update",toolCallId:n,status:"completed",kind:l,content:a,title:o.title??s,rawInput:o.input,rawOutput:{output:o.output,metadata:o.metadata},_meta:{messageId:r}}}).catch(g=>{w.error("failed to send tool completed to ACP",{error:g});});return}case "error":await this.connection.sessionUpdate({sessionId:t,update:{sessionUpdate:"tool_call_update",toolCallId:n,status:"failed",kind:l,title:s,rawInput:o.input,content:[{type:"content",content:{type:"text",text:o.error}}],rawOutput:{error:o.error},_meta:{messageId:r}}}).catch(a=>{w.error("failed to send tool error to ACP",{error:a});});return}}async handleTextPart(e,t){if(e.ignored===true||!("time"in e&&e.time&&typeof e.time=="object"&&"end"in e.time&&!!e.time.end))return;let s=e.text;s&&await this.connection.sessionUpdate({sessionId:e.sessionID,update:{sessionUpdate:"agent_message_chunk",messageId:e.messageID,content:{type:"text",text:s}}}).catch(o=>{w.error("failed to send text to ACP",{error:o});});}async handleReasoningPart(e,t){if(!("time"in e&&e.time&&typeof e.time=="object"&&"end"in e.time&&!!e.time.end))return;let s=e.text;s&&await this.connection.sessionUpdate({sessionId:e.sessionID,update:{sessionUpdate:"agent_thought_chunk",messageId:e.messageID,content:{type:"text",text:s}}}).catch(o=>{w.error("failed to send reasoning to ACP",{error:o});});}async handleStepFinishPart(e){let{sessionID:t,messageID:n,tokens:s}=e;if(!this.connection)return;let o=(s?.input??0)+(s?.reasoning??0),r=await this.getContextLimit(t,n);await this.connection.sessionUpdate({sessionId:t,update:{sessionUpdate:"usage_update",used:o,size:r,_meta:{messageId:n}}}).catch(l=>{w.error("failed to send usage_update for step-finish",{error:l});});}async getContextLimit(e,t){try{let s=(await this.sdk.session.messages({sessionID:e}).then(o=>o.data).catch(()=>{}))?.find(o=>o.info.id===t);if(s){let o=s.info;if(o.providerID&&o.modelID)return (await this.sdk.config.providers({}).then(g=>g.data?.providers??[]).catch(()=>[])).find(g=>g.id===o.providerID)?.models[o.modelID]?.limit?.context??2e5}}catch(n){w.debug("failed to get context limit",{error:n});}return 2e5}};function me(i){switch(i.toLowerCase()){case "bash":return "execute";case "webfetch":return "fetch";case "edit":case "patch":case "write":return "edit";case "grep":case "glob":case "lsp":case "context7_resolve_library_id":case "context7_get_library_docs":return "search";case "list":case "read":return "read";default:return "other"}}function ge(i,e){if(!e)return [];switch(i.toLowerCase()){case "read":case "edit":case "write":case "patch":case "lsp":{let n=e.filePath??e.filepath??"";return n?[{path:n}]:[]}case "glob":case "grep":return e.path?[{path:e.path}]:[];case "list":return e.path?[{path:e.path}]:[];case "bash":case "shell":{let n=e.cwd??"";return n?[{path:n}]:[]}case "external_directory":{let n=e.tool?.toLowerCase(),s=e.filepath??"",o=e.realPath??"",r=e.parentDir??"";if(n==="read"||n==="edit"||n==="write"||n==="patch"||n==="lsp")return o?[{path:o}]:s?[{path:s}]:[];if(n==="list"||n==="glob"||n==="grep"){let a=o??s,g=a?Ke.posix.dirname(a):r;return g?[{path:g}]:[]}let l=o??s;return l?[{path:l}]:r?[{path:r}]:[]}default:return []}}function Je(i,e){try{let t=applyPatch(i,e);return t===!1?null:t}catch{return null}}var L={HTTP:"http",STDIO:"stdio",WEBSOCKET:"websocket"},Q=class i extends Error{constructor(t,n=[]){super(t);b$1(this,"conflictingModes");this.name="ServiceModeConflictError",this.conflictingModes=n,Object.setPrototypeOf(this,i.prototype);}getConflictingModesDescription(){return this.conflictingModes.length===0?"No modes specified":this.conflictingModes.join(", ")}};function Ye(i){let e=[];return i.channel&&e.push(i.channel),e}function Me(i){let e=Ye(i);if(e.length===0)throw new Q("No service mode specified. Please specify exactly one of: http, stdio, websocket",[]);if(e.length>1)throw new Q(`Multiple service modes specified: ${e.join(", ")}. Please specify exactly one mode.`,e)}var Oe={channel:L.WEBSOCKET,port:3e3,hostname:"localhost",timeout:3e4,historyScope:"session",historyWindowSize:10,degradePolicy:"streaming_first",sessionExpireMs:300*1e3};var q=a.create({service:"acp-server-config"}),F="EAS_";function De(i){return !(!i||i.trim()===""||i.startsWith("-")||i.endsWith("-")||!/^[a-zA-Z0-9]([a-zA-Z0-9.-]*[a-zA-Z0-9])?$/.test(i))}function Ne(i){return Number.isInteger(i)&&i>=1&&i<=65535}function qe(i){return Number.isFinite(i)&&i>0}function Ue(i){let e={...Oe,...i};try{Me(e);}catch(t){throw t instanceof Q&&q.error("Invalid service mode configuration",{message:t.message,conflictingModes:t.conflictingModes}),t}if(e.port!==void 0&&!Ne(e.port)){let t=new Error(`Invalid port number: ${e.port}. Must be between 1 and 65535`);throw q.error("Invalid port configuration",{port:e.port}),t}if(e.hostname!==void 0&&!De(e.hostname)){let t=new Error(`Invalid hostname: ${e.hostname}`);throw q.error("Invalid hostname configuration",{hostname:e.hostname}),t}if(e.timeout!==void 0&&!qe(e.timeout)){let t=new Error(`Invalid timeout: ${e.timeout}. Must be a positive number`);throw q.error("Invalid timeout configuration",{timeout:e.timeout}),t}if(e.channel===L.STDIO&&e.stdio&&(!e.stdio.command||e.stdio.command.trim()==="")){let t=new Error("STDIO command is required");throw q.error("Invalid stdio configuration",{command:e.stdio.command}),t}return q.debug("ACPServer config loaded",{channel:e.channel,port:e.port,hostname:e.hostname}),e}function Ze(){let i={},e=process.env[`${F}ACP_CHANNEL`];if(e){let a=e.toLowerCase();Object.values(L).includes(a)?i.channel=a:q.warn("Invalid EAS_ACP_CHANNEL environment variable",{value:e});}let t=process.env[`${F}ACP_PORT`];if(t){let a=parseInt(t,10);Ne(a)?i.port=a:q.warn("Invalid EAS_ACP_PORT environment variable",{value:t});}let n=process.env[`${F}ACP_HOSTNAME`];n&&(De(n)?i.hostname=n:q.warn("Invalid EAS_ACP_HOSTNAME environment variable",{value:n}));let s=process.env[`${F}ACP_TIMEOUT`];if(s){let a=parseInt(s,10);qe(a)?i.timeout=a:q.warn("Invalid EAS_ACP_TIMEOUT environment variable",{value:s});}let o=process.env[`${F}ACP_HISTORY_SCOPE`];o&&(["session","peer","global"].includes(o)?i.historyScope=o:q.warn("Invalid EAS_ACP_HISTORY_SCOPE environment variable",{value:o}));let r=process.env[`${F}ACP_HISTORY_WINDOW_SIZE`];if(r){let a=parseInt(r,10);Number.isInteger(a)&&a>0?i.historyWindowSize=a:q.warn("Invalid EAS_ACP_HISTORY_WINDOW_SIZE environment variable",{value:r});}let l=process.env[`${F}ACP_DEGRADE_POLICY`];return l&&(["polling_only","streaming_first"].includes(l)?i.degradePolicy=l:q.warn("Invalid EAS_ACP_DEGRADE_POLICY environment variable",{value:l})),q.debug("Config loaded from environment",{config:i}),i}function Le(i){let e=Ze(),t={...e,...i};return q.info("ACPServer config with environment overrides",{original:{channel:e.channel,port:e.port,hostname:e.hostname},overrides:i,final:{channel:t.channel,port:t.port,hostname:t.hostname}}),t}var he=a.create({service:"acp-rpc-handler"}),Xe={INTERNAL_ERROR:-32603},J=class{constructor(e){b$1(this,"agent");this.agent=e;}async handle(e){let{method:t,params:n,id:s}=e;he.debug("AcpRpcHandler.handle",{method:t,hasParams:!!n,id:s});try{let o;switch(t){case "initialize":o=await this.handleInitialize(n);break;case "authenticate":o=await this.handleAuthenticate(n);break;case "session.new":case "newSession":o=await this.handleNewSession(n);break;case "session.load":case "loadSession":o=await this.handleLoadSession(n);break;case "session.close":case "closeSession":o=await this.handleCloseSession(n);break;case "session.prompt":case "prompt":o=await this.handlePrompt(n);break;case "session.cancel":case "cancel":await this.handleCancel(n),o={success:!0};break;case "session.list":case "listSessions":o=await this.handleListSessions(n);break;case "session.fork":case "forkSession":o=await this.handleForkSession(n);break;case "session.resume":case "resumeSession":o=await this.handleResumeSession(n);break;case "session.setMode":case "setSessionMode":o=await this.handleSetSessionMode(n);break;case "session.setConfigOption":case "setSessionConfigOption":o=await this.handleSetSessionConfigOption(n);break;case "status":o=this.handleStatus();break;case "subscriptions":o=this.handleSubscriptions();break;default:throw he.warn("Unknown method",{method:t}),new Error(`Method not found: ${t}`)}return {jsonrpc:"2.0",id:s,result:o}}catch(o){return he.error("AcpRpcHandler error",{method:t,error:o instanceof Error?o.message:String(o)}),{jsonrpc:"2.0",id:s,error:{code:Xe.INTERNAL_ERROR,message:o instanceof Error?o.message:String(o)}}}}async handleInitialize(e){return this.agent.initialize(e)}async handleAuthenticate(e){return this.agent.authenticate(e)}async handleNewSession(e){return this.agent.newSession(e)}async handleLoadSession(e){return this.agent.loadSession(e)}async handleCloseSession(e){return this.agent.closeSession(e)}async handlePrompt(e){return this.agent.prompt(e)}async handleCancel(e){return this.agent.cancel(e)}async handleListSessions(e){return this.agent.listSessions(e)}async handleForkSession(e){return this.agent.unstable_forkSession(e)}async handleResumeSession(e){return this.agent.resumeSession(e)}async handleSetSessionMode(e){return this.agent.setSessionMode(e)}async handleSetSessionConfigOption(e){return this.agent.setSessionConfigOption(e)}handleStatus(){return {status:"running",channel:"http",timestamp:Date.now(),uptime:process.uptime()}}handleSubscriptions(){return {sessions:[]}}};var oe=a.create({service:"server-agent-side-connection"}),Y=class{constructor(){b$1(this,"broadcaster",null);b$1(this,"sessionIds",new Set);}setBroadcaster(e){this.broadcaster=e;}addSession(e){this.sessionIds.add(e);}removeSession(e){this.sessionIds.delete(e);}clearSessions(){this.sessionIds.clear();}getSessions(){return Array.from(this.sessionIds)}async sessionUpdate(e){let{sessionId:t,update:n}=e;oe.debug("ServerAgentSideConnection.sessionUpdate",{sessionId:t,updateType:n.sessionUpdate}),this.broadcaster&&this.broadcaster.broadcast(t,e);}async requestPermission(e){return oe.debug("ServerAgentSideConnection.requestPermission",{sessionId:e.sessionId}),{outcome:{outcome:"cancelled"}}}async extMethod(e,t){return oe.debug("ServerAgentSideConnection.extMethod",{method:e}),{}}async extNotification(e,t){if(oe.debug("ServerAgentSideConnection.extNotification",{method:e,params:t}),this.broadcaster&&t){let n=t.sessionId||t.sessionID;if(n&&this.sessionIds.has(n)){let s={sessionId:n,update:{sessionUpdate:e,...t}};this.broadcaster.broadcast(n,s);}}}};var H=a.create({service:"http-server"});async function ze(i,e){if(H.info("Starting HTTP server",{port:e.port,hostname:e.hostname}),e.channel!==L.HTTP)throw new Error("Invalid channel type for HTTP server");let t=new Map,n=new Map,s=new Y,o={broadcast:(c,f)=>{P(c,f);}};s.setBroadcaster(o);let r=new J(i),l=i.getSDK();if(!l)throw new Error("SDK not configured");let a=new j(l,s);a.setService(i),await a.start();let g=(c,f)=>{let m=t.get(c);if(!m)return false;try{return m.controller.enqueue(new TextEncoder().encode(f)),m.lastHeartbeat=Date.now(),!0}catch(h){return H.warn("Failed to push to SSE connection",{connectionId:c,error:h instanceof Error?h.message:String(h)}),false}},P=(c,f)=>{let m=n.get(c);if(!m||m.size===0)return;let S={jsonrpc:"2.0",method:f.update.sessionUpdate,params:{sessionId:c,...f.update,timestamp:Date.now()}},v=`data: ${JSON.stringify(S)}
2
-
3
- `;for(let E of m)g(E,v)||(t.delete(E),m.delete(E));},I=(c,f)=>(s.addSession(c),new ReadableStream({start:m=>{let h={id:f,controller:m,sessionId:c,createdAt:Date.now(),lastHeartbeat:Date.now()};t.set(f,h),n.has(c)||n.set(c,new Set),n.get(c).add(f),H.info("SSE client connected",{connectionId:f,sessionId:c});let S=`data: ${JSON.stringify({type:"connected",connectionId:f,sessionId:c})}
4
-
5
- `;m.enqueue(new TextEncoder().encode(S));},cancel:()=>{let m=t.get(f);if(m){t.delete(f);let h=n.get(m.sessionId);h&&(h.delete(f),h.size===0&&(n.delete(m.sessionId),s.removeSession(m.sessionId))),H.info("SSE client disconnected",{connectionId:f,sessionId:m.sessionId});}}})),p=setInterval(()=>{let c=Date.now(),f=3e5;for(let[m,h]of t.entries())if(c-h.lastHeartbeat>f){H.warn("SSE connection timeout, closing",{connectionId:m});try{h.controller.close();}catch{}t.delete(m);let S=n.get(h.sessionId);S&&S.delete(m);}else try{h.controller.enqueue(new TextEncoder().encode(`: heartbeat
6
-
7
- `)),h.lastHeartbeat=c;}catch{}},1e4),u=[{method:"post",path:"/acp",handler:async c=>{let f=await c.req.json().catch(()=>null);if(!f||typeof f!="object")return c.json({jsonrpc:"2.0",error:{code:-32700,message:"Parse error"}},400);let m=f;if(!m.method||m.jsonrpc!=="2.0")return c.json({jsonrpc:"2.0",error:{code:-32600,message:"Invalid Request"}},400);if(m.method==="session.prompt")return r.handle(m).catch(S=>{H.error("HTTP server: session.prompt error",{error:String(S)});}),c.json({jsonrpc:"2.0",id:m.id,result:{accepted:true}},202);let h=await r.handle(m);if(m.method==="initialize"){let S=`conn_${Date.now()}_${Math.random().toString(36).substring(2,9)}`;return c.json(h,200,{"Acp-Connection-Id":S})}return c.json(h)}},{method:"get",path:"/acp",handler:c=>{let f=c.req.header("Acp-Connection-Id"),m=c.req.header("Acp-Session-Id");if(!c.req.header("Accept")?.includes("text/event-stream"))return c.json({error:"Not Acceptable"},406);let S=f||`conn_${Date.now()}_${Math.random().toString(36).substring(2,9)}`;if(m){let k=`sse_${Date.now()}_${Math.random().toString(36).substring(2,9)}`,R=I(m,k);return new Response(R,{headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive","X-Accel-Buffering":"no","Acp-Connection-Id":S,"Acp-Session-Id":m}})}let v=`conn_sse_${Date.now()}_${Math.random().toString(36).substring(2,9)}`,E=I("__connection__",v);return new Response(E,{headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive","X-Accel-Buffering":"no","Acp-Connection-Id":S}})}},{method:"delete",path:"/acp",handler:async c=>{let f=c.req.header("Acp-Connection-Id");return H.debug("HTTP server: connection terminated",{connectionId:f}),c.json({success:true})}}],d=createServer({port:e.port,hostname:e.hostname,routes:u,timeout:e.timeout,cors:true});return H.info("HTTP server started",{url:`http://${e.hostname}:${e.port}`}),{server:d,stop:async()=>{H.info("Stopping HTTP server"),clearInterval(p),await a.stop();for(let c of t.values())try{c.controller.close();}catch{}t.clear(),n.clear(),s.clearSessions(),await d.stop(),H.info("HTTP server stopped");}}}var $=a.create({service:"websocket-server"});function st(i){try{let e=new URL(i),t=e.hostname,n=parseInt(e.port,10);if(t&&!Number.isNaN(n)&&n>0&&n<=65535)return {port:n,hostname:t}}catch{}}async function $e(i,e){let t=e.ws?st(e.ws.url):void 0,n=t?.port??e.port??3e3,s=t?.hostname??e.hostname??"localhost",o="/acp";if($.info("Starting WebSocket server",{port:n,hostname:s,wsUrl:e.ws?.url}),e.channel!==L.WEBSOCKET)throw new Error("Invalid channel type for WebSocket server");let r=new Map,l=new Map,a=new Y,g={broadcast:(h,S)=>{u(h,S);}};a.setBroadcaster(g);let P=new J(i),I=i.getSDK();if(!I)throw new Error("SDK not configured");let p=new j(I,a);p.setService(i),await p.start();let u=(h,S)=>{let E={jsonrpc:"2.0",method:S.update.sessionUpdate,params:{sessionId:h,...S.update,timestamp:Date.now()}},k=JSON.stringify(E);for(let[R,z]of l.entries())if(z.subscribedSessions.has(h)){let b=r.get(R);b&&b.ws.readyState===b.ws.OPEN&&b.ws.send(k);}},d=h=>{for(let[S,v]of r.entries())if(v.ws===h)return S},c={onOpen:(h,S)=>{let v=`ws_${Date.now()}_${Math.random().toString(36).substring(2,9)}`;r.set(v,{id:v,ws:S,createdAt:Date.now()}),l.set(v,{clientId:v,subscribedSessions:new Set}),$.info("WebSocket client connected",{clientId:v}),S.send(JSON.stringify({type:"connected",clientId:v}));},onMessage:async(h,S)=>{try{let v=JSON.parse(h.data.toString());if(v.type==="ping"){S.send(JSON.stringify({type:"pong"}));return}let E=d(S);if(!E)return;let k,R;if(v.type==="message"||v.type==="request")k={jsonrpc:"2.0",id:v.id,method:v.method,params:v.params},R=v.sessionId;else if(v.jsonrpc==="2.0"&&v.method)k={jsonrpc:"2.0",id:v.id,method:v.method,params:v.params},R=v.params?.sessionId;else {$.warn("WebSocket server: unknown message format",{data:v});return}if(k.method==="session.subscribe"){if(R){let b=l.get(E);b&&(b.subscribedSessions.add(R),a.addSession(R));}S.send(JSON.stringify({type:"response",id:k.id,result:{subscribed:!0,sessionId:R}}));return}if(k.method==="session.unsubscribe"){if(R){let b=l.get(E);b&&(b.subscribedSessions.delete(R),b.subscribedSessions.size===0&&a.removeSession(R));}S.send(JSON.stringify({type:"response",id:k.id,result:{unsubscribed:!0,sessionId:R}}));return}if(k.method==="session.interrupt"){let b={jsonrpc:"2.0",method:"session.cancel",params:{sessionId:R}},U=await P.handle(b);S.send(JSON.stringify({type:"response",id:k.id,result:U.result,error:U.error}));return}if(k.method==="session.prompt"){if(S.send(JSON.stringify({jsonrpc:"2.0",id:k.id,result:{accepted:!0}})),R){let b=r.get(E);b&&(b.sessionId=R);let U=l.get(E);U&&(U.subscribedSessions.add(R),a.addSession(R));}P.handle(k).catch(b=>{$.error("WebSocket server: session.prompt error",{error:String(b)});});return}if(R){let b=r.get(E);b&&(b.sessionId=R);let U=l.get(E);U&&(U.subscribedSessions.add(R),a.addSession(R));}let z=await P.handle(k);S.send(JSON.stringify({type:"response",id:z.id,result:z.result,error:z.error}));}catch(v){$.error("WebSocket server: error handling message",{error:String(v)});}},onClose:(h,S)=>{let v=d(S);if(v){r.delete(v);let E=l.get(v);if(E){for(let k of E.subscribedSessions)a.removeSession(k);l.delete(v);}$.info("WebSocket client disconnected",{clientId:v});}},onError:(h,S)=>{$.error("WebSocket error",{error:h.type});}},f=createServer({port:n,hostname:s,routes:[{method:"post",path:"/acp",handler:async h=>{let S=await h.req.json().catch(()=>null);if(!S||typeof S!="object")return h.json({jsonrpc:"2.0",error:{code:-32700,message:"Parse error"}});let v=S;if(!v.method||v.jsonrpc!=="2.0")return h.json({jsonrpc:"2.0",error:{code:-32600,message:"Invalid Request"}});let E=await P.handle(v);return h.json(E)}},{method:"delete",path:"/acp",handler:async h=>{let S=h.req.header("Acp-Connection-Id");return $.debug("WebSocket server: connection terminated",{connectionId:S}),h.json({success:true})}}],timeout:e.timeout,cors:true}),m=f.raw;if(m){let h=new WebSocketServer({noServer:true});m.on("upgrade",(S,v,E)=>{try{let R=new URL(S.url||"/",`http://${S.headers.host}`).pathname,z=S.headers.upgrade?.toLowerCase();R===o&&z==="websocket"&&h.handleUpgrade(S,v,E,b=>{c.onOpen?.({type:"open"},b),b.on("message",U=>{c.onMessage?.({data:U},b);}),b.on("close",(U,Fe)=>{c.onClose?.({code:U,reason:Fe},b);}),b.on("error",U=>{c.onError?.({type:"error",message:U.message},b);});});}catch{}});}return $.info("WebSocket server started",{url:e.ws?.url||`ws://${s}:${n}`,path:o}),{server:f,stop:async()=>{$.info("Stopping WebSocket server"),await p.stop();for(let h of r.values())try{h.ws.close();}catch{}r.clear(),l.clear(),a.clearSessions(),await f.stop(),$.info("WebSocket server stopped");}}}var re=a.create({service:"acp-server"});async function Be(i,e){let t=Le(Ue(e||{}));re.info("Starting ACPServer",{channel:t.channel,port:t.port,hostname:t.hostname});let n,s;switch(t.channel){case L.HTTP:({server:n,stop:s}=await ze(i,t));break;case L.WEBSOCKET:({server:n,stop:s}=await $e(i,t));break;default:throw new Error(`Unsupported service mode: ${t.channel}`)}let o={type:t.channel,server:n,agent:i,stop:async()=>{re.info("Stopping ACPServer",{type:t.channel}),await s();},healthCheck:async()=>{if(typeof n=="object"&&n!==null&&"healthCheck"in n){let r=n.healthCheck;if(typeof r=="function")return r()}return true}};return re.info("ACPServer started successfully",{type:o.type,url:ot(t)}),o}function ot(i){switch(i.channel){case L.STDIO:return "stdio://process";case L.HTTP:return `http://${i.hostname}:${i.port}`;case L.WEBSOCKET:return `ws://${i.hostname}:${i.port}`;default:return "unknown://"}}async function rt(i){await Promise.all(i.map(async e=>{try{await e.stop();}catch(t){re.error("Error stopping server",{type:e.type,error:String(t)});}}));}async function He(i){await rt([i]);}z.object({agentId:z.string(),agentType:z.string(),directory:z.string(),timestamp:z.number()});z.object({agentId:z.string(),reason:z.enum(["normal","error","timeout"]),timestamp:z.number()});z.object({sessionId:z.string(),messageType:z.enum(["text","tool_call","tool_result"]),content:z.any(),timestamp:z.number()});z.object({agentId:z.string(),error:z.string(),context:z.record(z.string(),z.any()).optional(),timestamp:z.number()});z.object({agentId:z.string(),status:z.enum(["idle","busy","error"]),timestamp:z.number()});var ie=a.create({service:"acp-session-manager"}),ne=class{constructor(e){b$1(this,"sessions",new Map);b$1(this,"sdk");this.sdk=e;}tryGet(e){return this.sessions.get(e)}async create(e,t,n,s){let r={id:e,cwd:t,mcpServers:n,createdAt:new Date,model:s};return ie.info("creating_session",{state:r}),this.sessions.set(e,r),r}async load(e,t,n,s){let o=await this.sdk.session.get({sessionID:e,directory:t},{throwOnError:true}).then(a=>a.data),r=s,l={id:e,cwd:t,mcpServers:n,createdAt:new Date(o.time.created),model:r};return ie.info("loading_session",{state:l}),this.sessions.set(e,l),l}get(e){let t=this.sessions.get(e);if(!t)throw ie.error("session not found",{sessionId:e}),RequestError.invalidParams(JSON.stringify({error:`Session not found: ${e}`}));return t}getModel(e){return this.get(e).model}setModel(e,t){let n=this.get(e);return n.model=t,this.sessions.set(e,n),n}getVariant(e){return this.get(e).variant}setVariant(e,t){let n=this.get(e);return n.variant=t,this.sessions.set(e,n),n}setMode(e,t){let n=this.get(e);return n.modeId=t,this.sessions.set(e,n),n}setContextMode(e,t){let n=this.get(e);return n.contextMode=t,this.sessions.set(e,n),n}setAgent(e,t){let n=this.get(e);return n.agent=t,this.sessions.set(e,n),n}close(e){return this.sessions.delete(e)}dispose(){this.sessions.clear(),ie.debug("all sessions cleared");}resolveConnectionState(e){}};var A=a.create({service:"acp-service"}),se=class{constructor(e,t){b$1(this,"config");b$1(this,"serviceMode");b$1(this,"connection");b$1(this,"sdk");b$1(this,"connectionRegistry",null);b$1(this,"sessionRouter",null);b$1(this,"sessionManager");b$1(this,"executorInitialized",false);b$1(this,"status","initializing");this.connection=e,this.config=t,this.sdk=t.acp.sdk,this.serviceMode=t.serviceMode,this.sessionManager=new ne(this.sdk),t.connectionRegistry&&(this.connectionRegistry=t.connectionRegistry),t.sessionRouter&&(this.sessionRouter=t.sessionRouter),A.info("ACPService instance created",{channel:t.channel.type,hasConnection:!!e,hasProvidedRegistry:!!t.connectionRegistry,hasProvidedRouter:!!t.sessionRouter});}async initializeExecutor(){if(this.executorInitialized){A.warn("Executor components already initialized");return}this.connectionRegistry||(this.connectionRegistry=await la.create(),A.debug("ConnectionRegistry created")),this.sessionRouter||(this.sessionRouter=ma.fromRegistry({resolve:e=>this.connectionRegistry.resolve(e),getConnectionsByPeer:e=>this.connectionRegistry.getConnectionsByAgent(e),getConnectionsByService:e=>this.connectionRegistry.getConnectionsByService(e)}),A.debug("SessionRouter created")),this.executorInitialized=true,A.info("Executor components initialized");}setStatus(e,t="agent"){let n=this.status;if(n===e)return;this.status=e,A.info("Agent status changed",{oldStatus:n,newStatus:e,agentId:t});}getStatus(){return this.status}authenticate(e){return Promise.resolve(void 0)}async newSession(e){A.info("ACP newSession requested",{cwd:e.cwd});let t=e.cwd,s=(await this.sdk.model.default())?.data,r=(await this.sdk.session.create({directory:t})).data?.id;if(!r)throw new Error("Failed to create session: no session ID returned");let l=await this.sessionManager.create(r,t,e.mcpServers,s),a=await this.buildSessionStateResponse(l.id,t);return {sessionId:l.id,...a,_meta:{}}}async loadSession(e){A.info("ACP loadSession requested",{sessionId:e.sessionId});let t=e.cwd,s=(await this.sdk.model.default())?.data;return await this.sessionManager.load(e.sessionId,t,e.mcpServers,s),{...await this.buildSessionStateResponse(e.sessionId,t),_meta:{}}}async prompt(e){let t=e.sessionId,n=this.sessionManager.get(t),s=n.cwd,r=n.model??(await this.sdk.model.default())?.data,l=n.agent??(await this.sdk.agent.default({directory:s}))?.data?.name??"build";await this.sendAvailableCommandsUpdate(t,s);let a=[];for(let p of e.prompt)switch(p.type){case "text":{let u=p.annotations?.audience,d=u?.length===1&&u[0]==="assistant",c=u?.length===1&&u[0]==="user";a.push({type:"text",text:p.text,...d&&{synthetic:true},...c&&{ignored:true}});break}case "image":{let u=this.parseUri(p.uri??""),d=u.type==="file"?u.filename:"image";p.data?a.push({type:"file",url:`data:${p.mimeType};base64,${p.data}`,filename:d,mime:p.mimeType}):p.uri?.startsWith("http:")&&a.push({type:"file",url:p.uri,filename:d,mime:p.mimeType});break}case "resource_link":{let u=this.parseUri(p.uri);p.name&&u.type==="file"&&(u.filename=p.name),a.push(u);break}case "resource":{let u=p.resource;if("text"in u&&u.text)a.push({type:"text",text:u.text});else if("blob"in u&&u.blob&&u.mimeType){let d=this.parseUri(u.uri??""),c=d.type==="file"?d.filename:"file";a.push({type:"file",url:`data:${u.mimeType};base64,${u.blob}`,filename:c,mime:u.mimeType});}break}}A.info("prompt parts",{sessionID:t,parts:a});let g=(()=>{let p=a.filter(c=>c.type==="text").map(c=>c.text).join("").trim();if(!p.startsWith("/"))return;let[u,...d]=p.slice(1).split(/\s+/);return {name:u,args:d.join(" ").trim()}})(),P=p=>({totalTokens:p.tokens.input+p.tokens.output+p.tokens.reasoning+(p.tokens.cache?.read??0)+(p.tokens.cache?.write??0),inputTokens:p.tokens.input,outputTokens:p.tokens.output,thoughtTokens:p.tokens.reasoning||void 0,cachedReadTokens:p.tokens.cache?.read||void 0,cachedWriteTokens:p.tokens.cache?.write||void 0});if(!g){let u=(await this.sdk.session.prompt({sessionID:t,model:{providerID:r.providerID,modelID:r.modelID},parts:a,agent:l,directory:s,variant:n.variant,contextMode:n.contextMode})).data?.info;return {stopReason:"end_turn",usage:u?P(u):void 0,_meta:{}}}let I=await this.sdk.command.list({directory:s},{throwOnError:true}).then(p=>p.data?.find(u=>u.name===g.name));if(I){let p=await za.get(g.name),u=await Aa.command({sessionID:t,agent:l,model:r.providerID+"/"+r.modelID,arguments:g.args,command:I.name});if(await this.sendUsageUpdate(t,s),p?.commandType==="local"&&this.connection){let d=u.success?u.output:`[Error] ${u.error??"Command execution failed"}`;await this.connection.sessionUpdate({sessionId:t,update:{sessionUpdate:"agent_message_chunk",content:{type:"text",text:d}}});}return {stopReason:"end_turn",usage:u.info?P({tokens:{input:u.info.tokens.input,output:u.info.tokens.output,reasoning:u.info.tokens.reasoning,cache:u.info.tokens.cache}}):void 0,_meta:{}}}switch(g.name){case "compact":if(!r.providerID||!r.modelID)throw new Error("Model providerID and modelID are required for compact command");await this.sdk.session.summarize({sessionID:t,directory:s,providerID:r.providerID,modelID:r.modelID},{throwOnError:true});break}return await this.sendUsageUpdate(t,s),{stopReason:"end_turn",_meta:{}}}async cancel(e){let n=this.sessionManager.tryGet(e.sessionId)?.cwd??"";try{this.sdk&&await this.sdk.session.abort({sessionID:e.sessionId,directory:n}).catch(s=>{A.warn("SDK abort failed",{sessionId:e.sessionId,error:String(s)});}),A.info("Session cancelled",{sessionId:e.sessionId});}catch(s){throw A.error("Failed to cancel session",{sessionId:e.sessionId,error:s instanceof Error?s.message:String(s)}),s}}parseUri(e){try{if(e.startsWith("file://")){let t=e.slice(7),n=t.split("/").pop()||t;return {type:"file",url:e,filename:n,mime:"text/plain"}}if(e.startsWith("zed://")){let n=new URL(e).searchParams.get("path");if(n){let s=n.split("/").pop()||n;return {type:"file",url:pathToFileURL(n).href,filename:s,mime:"text/plain"}}}return {type:"text",text:e}}catch{return {type:"text",text:e}}}async sendUsageUpdate(e,t){if(!this.sdk||!this.connection)return;let n=await this.sdk.session.messages({sessionID:e,directory:t},{throwOnError:true}).then(g=>g.data).catch(g=>{A.error("failed to fetch messages for usage update",{error:g});});if(!n)return;let s=n.filter(g=>g.info.role==="assistant"),o=s[s.length-1];if(!o)return;let r=o.info,l=await this.getContextLimit(r.providerID,r.modelID,t);if(!l)return;let a=r.tokens.input+(r.tokens.cache?.read??0);await this.connection.sessionUpdate({sessionId:e,update:{sessionUpdate:"usage_update",used:a,size:l}});}async sendAvailableCommandsUpdate(e,t){if(this.sdk&&this.connection)try{let s=(await this.sdk.command.list({directory:t},{throwOnError:!0})).data?.map(o=>({name:o.name,description:o.description??""}))??[];await this.connection.sessionUpdate({sessionId:e,update:{sessionUpdate:"available_commands_update",availableCommands:s}});}catch(n){A.error("failed to send available commands update",{error:n});}}async sendConfigOptionUpdate(e,t,n){if(this.connection)try{let o=(n??await this.buildSessionStateResponse(e,t)).configOptions;if(!o||o.length===0)return;await this.connection.sessionUpdate({sessionId:e,update:{sessionUpdate:"config_option_update",configOptions:o}});}catch(s){A.error("failed to send config_option_update to ACP client",{sessionId:e,error:s});}}async sendCurrentModeUpdate(e,t){if(this.connection)try{await this.connection.sessionUpdate({sessionId:e,update:{sessionUpdate:"current_mode_update",currentModeId:t}});}catch(n){A.error("failed to send current_mode_update to ACP client",{sessionId:e,modeId:t,error:n});}}async getContextLimit(e,t,n){return this.sdk?(await this.sdk.config.providers({directory:n}).then(l=>l.data?.providers??[]).catch(l=>(A.error("failed to get providers for context limit",{error:l}),[]))).find(l=>l.id===e)?.models[t]?.limit.context??2e5:null}async unstable_forkSession(e){A.info("ACP forkSession requested",{sessionId:e.sessionId});let t=e.cwd,n=e.mcpServers??[],o=(await this.sdk.model.default())?.data,r=await this.sdk.session.fork({sessionID:e.sessionId,directory:t},{throwOnError:true}).then(P=>P.data);if(!r)throw new Error("Fork session returned no data");let l=r.id;await this.sessionManager.load(l,t,n,o);let g=await this.buildSessionStateResponse(l,t);return A.info("fork_session",{sessionId:l,mcpServers:n.length}),{sessionId:l,...g,_meta:{}}}async resumeSession(e){A.info("ACP resumeSession requested",{sessionId:e.sessionId});let t=e.cwd,n=e.sessionId,s=e.mcpServers??[],r=(await this.sdk.model.default())?.data;await this.sessionManager.load(n,t,s,r);let a=await this.buildSessionStateResponse(n,t);return A.info("resume_session",{sessionId:n,mcpServers:s.length}),{...a,_meta:{}}}async listSessions(e){let t=e.cursor?Number(e.cursor):void 0,n=100,o=(await this.sdk.session.list({directory:e.cwd??void 0,roots:true},{throwOnError:true}).then(I=>I.data??[])).toSorted((I,p)=>p.time.updated-I.time.updated),l=(t?o.filter(I=>I.time.updated<t):o).slice(0,n),a=l.map(I=>({sessionId:I.id,cwd:I.directory,title:I.title??`Session ${I.id}`,updatedAt:new Date(I.time.updated).toISOString()})),g=l[l.length-1],P=l.length===n&&g?String(g.time.updated):void 0;return {sessions:a,nextCursor:P}}async setSessionMode(e){A.info("ACP setSessionMode requested",{sessionId:e.sessionId,modeId:e.modeId}),this.sessionManager.setMode(e.sessionId,e.modeId);let t=this.sessionManager.get(e.sessionId);return await this.sendCurrentModeUpdate(e.sessionId,e.modeId),await this.sendConfigOptionUpdate(e.sessionId,t.cwd),{_meta:{}}}async setSessionConfigOption(e$1){if(A.info("ACP setSessionConfigOption requested",{sessionId:e$1.sessionId,configId:e$1.configId,value:e$1.value}),e$1.configId==="model"){let s=typeof e$1.value=="string"?e$1.value:void 0;if(s){let o=this.parseModelSelection(s);this.sessionManager.setModel(e$1.sessionId,o.model);}}else if(e$1.configId==="agent"){let s=typeof e$1.value=="string"?e$1.value:void 0;this.sessionManager.setAgent(e$1.sessionId,s);}else if(e$1.configId==="thought_level"){let s=typeof e$1.value=="string"?e$1.value:void 0;this.sessionManager.setVariant(e$1.sessionId,s);}else if(e$1.configId==="context_mode"){let s=typeof e$1.value=="string"&&e.includes(e$1.value)?e$1.value:void 0;this.sessionManager.setContextMode(e$1.sessionId,s);}let t=this.sessionManager.get(e$1.sessionId),n=await this.buildSessionStateResponse(e$1.sessionId,t.cwd);return await this.sendConfigOptionUpdate(e$1.sessionId,t.cwd,n),{_meta:{},configOptions:n.configOptions??[]}}async closeSession(e){return A.info("ACP closeSession requested",{sessionId:e.sessionId}),await this.cancel({sessionId:e.sessionId}),this.sessionManager.close(e.sessionId),{_meta:{}}}async buildSessionStateResponse(e$1,t){let n=this.sessionManager.tryGet(e$1),s=n?.model??(await this.sdk.model.default())?.data,o=s?.providerID&&s?.modelID?`${s.providerID}/${s.modelID}`:void 0,r=[];try{r=(await this.sdk.config.providers({directory:t}).then(u=>u.data?.providers??[])).flatMap(u=>{let d=u.models??{};return Object.keys(d).map(c=>({modelId:`${u.id}/${c}`,name:`${u.id}/${c}`}))});}catch(p){A.warn("failed to build available models for session state",{sessionId:e$1,error:p instanceof Error?p.message:String(p)});}o&&!r.some(p=>p.modelId===o)&&(r=[{modelId:o,name:o},...r]);let l=[];try{l=((await this.sdk.app.agents({directory:t})).data??[]).filter(d=>d.hidden!==!0&&d.mode!=="subagent").map(d=>({id:d.name,name:d.name,description:d.description}));}catch(p){A.warn("failed to build available agents for session state",{sessionId:e$1,error:p instanceof Error?p.message:String(p)});}let a=n?.modeId,g=n?.variant??"low",P=n?.contextMode??f,I=n?.agent??"build";return await this.sendAvailableCommandsUpdate(e$1,t),{models:o?{currentModelId:o,availableModels:r}:void 0,modes:a?{currentModeId:a,availableModes:[{id:a,name:a}]}:void 0,configOptions:[{id:"model",name:"Model",category:"model",type:"select",currentValue:o??"",options:r.map(p=>({value:p.modelId,name:p.name,description:p.description??null}))},{id:"agent",name:"Agent",category:"agent",type:"select",currentValue:I,options:l.map(p=>({value:p.id,name:p.name,description:p.description??null}))},{id:"thought_level",name:"Thought Level",category:"thought_level",type:"select",currentValue:g,options:[{value:"off",name:"Off"},{value:"low",name:"Low"},{value:"medium",name:"Medium"},{value:"high",name:"High"}]},{id:"context_mode",name:"Context Mode",category:"context_mode",type:"select",currentValue:P,options:e.map(p=>({value:p,name:p.charAt(0).toUpperCase()+p.slice(1)}))}]}}parseModelSelection(e){let{provider:t,model:n}=parseModelId(e);return t&&n?{model:{providerID:t,modelID:n}}:{model:{providerID:"unknown",modelID:e}}}setConnection(e){this.connection=e,A.info("ACPService connection updated");}getConnection(){return this.connection}abortConnection(){this.connection&&A.debug("Connection aborted");}closeConnection(){this.connection&&A.debug("Connection closed");}getConnectionRegistry(){return this.connectionRegistry}getSessionRouter(){return this.sessionRouter}createConnection(e,t,n,s){if(!this.connectionRegistry)throw new Error("ConnectionRegistry not initialized. Call initializeExecutor() first.");if(!t||!n)throw new Error("localAgentId and remoteAgentId are required");return this.connectionRegistry.connect(e,t,n,s)}async routeToConnection(e){if(!this.sessionRouter)throw new Error("SessionRouter not initialized. Call initializeExecutor() first.");return this.sessionRouter.route(e)}async dispose(){A.info("Disposing ACPService"),this.sessionManager&&(this.sessionManager.dispose?.(),A.debug("SessionManager disposed")),this.connectionRegistry&&(await this.connectionRegistry.close(),this.connectionRegistry=null,A.debug("ConnectionRegistry closed")),this.sessionRouter=null,this.executorInitialized=false,A.info("ACPService disposed");}};var N=a.create({service:"easbot-agent"}),Z=class i extends se{constructor(t,n){super(t,n);b$1(this,"acpEventBridge",null);b$1(this,"server",null);b$1(this,"isAgentInitialized",false);N.info("EasBotAgent instance created",{serviceMode:this.serviceMode});}static async create(t){N.info("creating EasBotAgent",{serviceMode:t.serviceMode});let n=t.serviceMode==="stdio",s=new i(void 0,t);if(n&&t.stdioStream){let{stream:o}=t.stdioStream,r={initialize:async a=>s.initialize(a),newSession:async a=>s.newSession(a),loadSession:async a=>s.loadSession(a),prompt:async a=>s.prompt(a),cancel:async a=>s.cancel(a),authenticate:async a=>s.authenticate(a),setSessionMode:async a=>s.setSessionMode(a),setSessionConfigOption:async a=>s.setSessionConfigOption(a),listSessions:async a=>s.listSessions(a),unstable_forkSession:async a=>s.unstable_forkSession(a),resumeSession:async a=>s.resumeSession(a),closeSession:async a=>s.closeSession(a)},l=new AgentSideConnection(()=>r,o);s.setConnection(l);}return N.info("EasBotAgent created successfully",{serviceMode:t.serviceMode,hasConnection:n&&!!t.stdioStream}),s}async initialize(t){return N.info("ACP initialize requested",{protocolVersion:t.protocolVersion}),this.isAgentInitialized||await this.initializeAgent(),{protocolVersion:t.protocolVersion,agentCapabilities:{loadSession:true,positionEncoding:"utf-8",mcpCapabilities:{http:true,sse:true},promptCapabilities:{image:true,embeddedContext:true,audio:false},sessionCapabilities:{close:{},fork:{},list:{},resume:{}},_meta:{history_scope:true,session_management:true}},agentInfo:{name:"EasBot Agent",version:a$1.getVersion(),title:"Multi-Agent Collaboration Ecosystem Agent"},authMethods:[{id:"easbot-token",name:"EasBot Token Authentication",description:"Authenticate using EasBot API token"}]}}async initializeAgent(){if(this.isAgentInitialized){N.warn("EasBotAgent already initialized");return}N.info("initializing EasBotAgent internals");try{await this.initializeExecutor(),this.config.acpServerConfig||await this.initializeAcpEventBridge(),this.isAgentInitialized=!0,this.setStatus("ready"),N.info("EasBotAgent internals initialized successfully");}catch(t){throw this.setStatus("error"),N.error("failed to initialize EasBotAgent",{error:String(t)}),t}}async start(){if(this.status==="running"){N.warn("EasBotAgent already running");return}this.isAgentInitialized||await this.initializeAgent();let t=this.config;t.acpServerConfig&&!this.server&&(this.server=await Be(this,t.acpServerConfig)),this.setStatus("running"),N.info("EasBotAgent started");}async stop(){if(this.status==="stopped"){N.warn("EasBotAgent already stopped");return}N.info("stopping EasBotAgent");try{this.server&&(await He(this.server),this.server=null),this.acpEventBridge&&(await this.acpEventBridge.stop(),this.acpEventBridge=null),await this.dispose(),this.setStatus("stopped"),this.isAgentInitialized=!1,N.info("EasBotAgent stopped successfully");}catch(t){throw this.setStatus("error"),N.error("error stopping EasBotAgent",{error:String(t)}),t}}async initializeAcpEventBridge(){if(this.acpEventBridge){N.warn("ACP event bridge already initialized");return}let n=this.config.acp?.sdk,s=this.getConnection();if(!n)throw N.error("Cannot initialize ACP event bridge: missing SDK client"),new Error("SDK client is required for ACP event bridge");if(!s)throw N.error("Cannot initialize ACP event bridge: missing ACP connection"),new Error("ACP connection is required for ACP event bridge");this.acpEventBridge=new j(n,s),this.acpEventBridge.setService(this),await this.acpEventBridge.start(),N.info("ACP event bridge initialized");}getServiceMode(){return this.serviceMode}getServerInstance(){return this.server}getSDK(){return this.sdk}};var W=class i extends Error{constructor(t,n,s){super(t);b$1(this,"type");b$1(this,"stage");b$1(this,"cause");this.type="AdapterEnvironmentInitializationError",this.stage=n,this.cause=s,Error.captureStackTrace&&Error.captureStackTrace(this,i);}},X=a.create({service:"adapter.bootstrap"}),fe;function ut(){return fe||(fe=Oa.state(async()=>({initialized:false,initPromise:null,instancePromise:null,handlersInstalled:false,directory:".easbot",sdk:null,activeChannel:null,agent:null,acpConnection:null}),async i=>{let e=i.agent;e&&await e.stop().catch(()=>{}),i.agent=null,i.sdk=null,i.acpConnection=null;})),fe}async function B(){return ut()()}function We(i){let e=["ECONNRESET","EPIPE","ETIMEDOUT","ECONNREFUSED","ENOTFOUND","EHOSTUNREACH","ENETUNREACH"],t=i.code;return e.includes(t??"")}function mt(i){i.handlersInstalled||(process.on("unhandledRejection",e=>{let t=e instanceof Error?e:new Error(String(e));We(t)||X.error("unhandled promise rejection",{error:t.message,stack:t.stack});}),process.on("uncaughtException",e=>{We(e)||(X.error("uncaught exception",{error:e.message,stack:e.stack}),process.exit(1));}),i.handlersInstalled=true);}async function gt(i){return i.instancePromise||(i.instancePromise=Oa.provide({directory:i.directory,init:qb,fn:async()=>{X.debug("instance bootstrap completed");}}).then(()=>{})),i.instancePromise}async function ht(){try{await Oa.dispose(),X.debug("instance disposed");}catch(i){X.warn("failed to dispose instance",{error:i instanceof Error?i.message:String(i)});}}var G;(u=>{function i(d,c){return d.sdk||(d.sdk=xa({directory:c})),d.sdk}function e(d){switch(d){case "http":return "http";case "stdio":return "stdio";case "websocket":return "websocket";default:return "stdio"}}async function t(d){let c=await B();if(c.initialized)return;if(c.initPromise)return c.initPromise;let f={directory:d?.directory??".easbot",initModels:d?.initModels??true,printLogs:d?.printLogs??false,logLevel:d?.logLevel??"INFO",channel:d?.channel??"stdio"};if(c.directory=f.directory,i(c,c.directory),c.activeChannel&&c.activeChannel!==f.channel)throw new Error(`Adapter already initialized with channel ${c.activeChannel}, cannot re-init with ${f.channel}`);return c.activeChannel=f.channel,c.initPromise=(async()=>{try{await a$1.init();}catch(m){throw new W("Failed to initialize global directories","global",m instanceof Error?m:void 0)}try{await a.init({logDir:a$1.Path.log,print:f.printLogs??!1,level:f.logLevel??"INFO"});}catch(m){throw new W("Failed to initialize log infrastructure","log",m instanceof Error?m:void 0)}if(f.initModels)try{b();}catch(m){throw new W("Failed to initialize models refresh","models",m instanceof Error?m:void 0)}try{mt(c);}catch(m){throw new W("Failed to install unhandled exception handlers","handlers",m instanceof Error?m:void 0)}try{await gt(c);}catch(m){throw new W("Failed to initialize instance","instance",m instanceof Error?m:void 0)}c.initialized=true;})(),c.initPromise}u.init=t;async function n(){let d=await B();if(d.initialized){await Ha.stop().catch(()=>{});try{let{MCP:c}=await import('./mcp-6ZTBDPWC.mjs'),f=await c.clients();for(let[m,h]of Object.entries(f))await h.disconnect().catch(()=>{});}catch{}d.agent&&(await d.agent.stop().catch(()=>{}),d.agent=null),await ht(),d.initialized=false,d.initPromise=null,d.instancePromise=null,d.activeChannel=null,d.sdk=null,d.agent=null,d.acpConnection=null;}}u.destroy=n;async function s(){return (await B()).initialized}u.isInitialized=s;async function o(d){let c=await B();c.agent=d;}u.setAgent=o;async function r(){return (await B()).agent}u.getAgent=r;async function l(){let c=(await B()).agent?.getServerInstance();return c||null}u.getServer=l;async function a$2(){return (await B()).sdk}u.getSDK=a$2;async function g(){return (await B()).acpConnection}u.getACPConnection=g;async function P(){let d=await B(),c=!!d.agent?.getServerInstance();return {initialized:d.initialized,directory:d.directory,activeChannel:d.activeChannel,hasSDK:!!d.sdk,hasAgent:!!d.agent,hasACPConnection:!!d.acpConnection,hasServer:c}}u.getState=P;async function I(d){await t({channel:d.channel,directory:d.directory});let c=await B(),f=i(c,c.directory);if(d.channel==="stdio")return p({directory:d.directory});if(c.agent?.getServerInstance()&&c.activeChannel&&c.activeChannel!==d.channel)throw new Error(`ACP service already started with channel ${c.activeChannel}, cannot switch to ${d.channel}`);if(c.agent){let v=c.agent.getServerInstance();if(v)return {sdk:f,agent:c.agent,server:v}}let h=await Z.create({serviceMode:e(d.channel),acp:{sdk:f},acpServerConfig:d,channel:{type:d.channel,timeout:d.timeout}});await h.start();let S=h.getServerInstance();if(!S)throw new Error("ACP server failed to start");return c.agent=h,c.activeChannel=d.channel,{sdk:f,agent:h,server:S}}u.ensureACPService=I;async function p(d){await t({channel:"stdio",directory:d.directory});let c=await B(),f=i(c,c.directory);if(c.agent)return {sdk:f,agent:c.agent};let m=new WritableStream({write(E){return new Promise((k,R)=>{try{process.stdout.write(E)?k():process.stdout.once("drain",k);}catch(z){let b=z;b.code==="EPIPE"||b.code==="EIO"?R(new Error("stdout pipe broken")):R(z);}})}}),h=new ReadableStream({start(E){process.stdin.on("data",k=>{E.enqueue(new Uint8Array(k));}),process.stdin.on("end",()=>E.close()),process.stdin.on("error",k=>E.error(k));}}),S=ndJsonStream(m,h),v=await Z.create({serviceMode:"stdio",acp:{sdk:f},channel:{type:"stdio",timeout:6e4},stdioStream:{stream:S}});return c.acpConnection=v.getConnection()??null,await v.start(),c.agent=v,c.activeChannel="stdio",X.info("Stdio ACP service started, waiting for client..."),process.stdin.resume(),{sdk:f,agent:v}}u.ensureACPServiceStdio=p;})(G||(G={}));var x=a.create({service:"cli-command-acp"});async function vt(i,e){let t=await pb.getACPServerConfig();x.debug("Merging ACP configuration",{baseConfig:{channel:t.channel,port:t.port,hostname:t.hostname,timeout:t.timeout},cliOptions:{channel:e.channel,port:e.port,hostname:e.hostname,timeout:e.timeout}});let n={};if(e.channel!==void 0){let o=e.channel.toLowerCase();Object.values(Q$1).includes(o)?(n.channel=o,x.debug("CLI override: channel",{value:n.channel})):x.warn("Invalid channel type from command line",{value:e.channel});}if(e.port!==void 0&&(e.port>0&&e.port<=65535?(n.port=e.port,x.debug("CLI override: port",{value:n.port})):x.warn("Invalid port from command line",{value:e.port})),e.hostname!==void 0&&(n.hostname=e.hostname,x.debug("CLI override: hostname",{value:n.hostname})),e.timeout!==void 0&&(e.timeout>0?(n.timeout=e.timeout,x.debug("CLI override: timeout",{value:n.timeout})):x.warn("Invalid timeout from command line",{value:e.timeout})),e.hostname!==void 0||e.port!==void 0){let o=e.hostname??t.hostname??"127.0.0.1",r=e.port??t.port??3e3;t.ws&&(n.ws={...t.ws,url:`ws://${o}:${r}`}),t.http&&(n.http={...t.http,baseUrl:`http://${o}:${r}`}),x.debug("CLI override: ws.url and http.baseUrl updated",{hostname:e.hostname,port:e.port,wsUrl:n.ws?.url,httpBaseUrl:n.http?.baseUrl});}e.timeout!==void 0&&(n.ws||n.http)&&(n.ws&&(n.ws.timeout=e.timeout),n.http&&(n.http.timeout=e.timeout),x.debug("CLI override: ws.timeout and http.timeout updated",{timeout:e.timeout}));let s={...t,...n};return x.debug("Merged ACP configuration",{channel:s.channel,port:s.port,hostname:s.hostname,timeout:s.timeout}),s}async function Ct(i$2,e,t){x.info("Starting ACP service",{channel:e.channel,port:e.port,hostname:e.hostname,debug:t.config.debug}),await G.init({directory:i$2,printLogs:t.config.print_logs,logLevel:t.config.log_level,channel:e.channel});await G.ensureACPService(e);console.log(""),console.log(d(i("acp.server.started"))),console.log(k(60)),console.log(i$1(i("acp.field.directory"),i$2,15)),console.log(i$1(i("acp.field.worktree"),Oa.project.worktree||"N/A",15)),console.log(i$1(i("acp.field.channel"),e.channel,15));let s=b$2();switch(e.channel){case "websocket":{let r,l="/";if(e.ws?.url)try{let a=new URL(e.ws.url),g=a.port||"3000",P=a.hostname;l=a.pathname||"/",r=`ws://${P}:${g}${l==="/"?"":l}`;}catch{r=e.ws.url;}else r=`ws://${e.hostname}:${e.port}`;console.log(i$1(i("acp.field.ws_url"),r,15)),console.log(i$1(i("acp.field.ws_path"),l,15)),e.ws?(console.log(h(i("acp.websocket.config"))),console.log(i$1(i("acp.field.timeout"),`${e.ws.timeout??e.timeout}ms`,15)),console.log(i$1(i("acp.field.batch_size"),`${e.ws.batchSize??10}`,15)),console.log(i$1(i("acp.field.batch_interval"),`${e.ws.batchInterval??50}ms`,15)),console.log(i$1(i("acp.field.heartbeat"),`${e.ws.heartbeatInterval??3e4}ms`,15))):console.log(i$1(i("acp.field.timeout"),`${e.timeout}ms`,15));break}case "http":e.http?.baseUrl?console.log(i$1(i("acp.field.base_url"),e.http.baseUrl,15)):console.log(i$1(i("acp.field.host"),`${e.hostname}:${e.port}`,15)),e.http?.timeout?console.log(i$1(i("acp.field.timeout"),`${e.http.timeout}ms`,15)):console.log(i$1(i("acp.field.timeout"),`${e.timeout}ms`,15));break;case "stdio":console.log(i$1(i("acp.field.mode"),i("acp.mode.stdio"),15)),console.log(i$1(i("acp.field.protocol"),i("acp.protocol"),15)),console.log(i$1(i("acp.field.timeout"),`${e.timeout}ms`,15));break;default:console.log(i$1(i("acp.field.host"),`${e.hostname}:${e.port}`,15)),console.log(i$1(i("acp.field.timeout"),`${e.timeout}ms`,15));}console.log(i$1(i("acp.field.debug"),t.config.debug?c(s,a$4.success,i("common.enabled")):c(s,a$4.muted,i("common.disabled")),15));let o=getProxyConfig();if(o.enabled){let r=o.https||o.http||"configured";console.log(i$1(i("acp.field.proxy"),r,15));}console.log(k(60)),console.log(""),x.info("ACPServer started successfully"),yt();}function yt(){let i$1=process.env.EASBOT_RUN_MODE==="ephemeral"||!process.stdin.isTTY&&process.env.EASBOT_RUN_MODE!=="persistent",e=async t=>{x.debug(`Received ${t}, shutting down...`),i$1||console.log(`
8
- ${i("acp.shutdown.received",{vars:{signal:t}})}`);try{await G.destroy(),x.debug("EasbotAdapter state destroyed"),i$1||console.log(d(i("acp.shutdown.completed")));}catch(n){x.error("Error during shutdown",{error:n instanceof Error?n.message:String(n)});}i$1?process.kill(process.pid,"SIGKILL"):process.exit(0);};process.on("SIGINT",()=>{e("SIGINT").catch(console.error);}),process.on("SIGTERM",()=>{e("SIGTERM").catch(console.error);}),process.stdout.on("error",t=>{(t.code==="EPIPE"||t.code==="EIO")&&(x.info("stdout pipe broken, exiting"),e("stdout-broken").catch(()=>{i$1?process.kill(process.pid,"SIGKILL"):process.exit(0);}));});}async function wt(i$1,e,t){x.debug("ACP command executed",{options:e});let n=t?.config?.debug??false,s=t?.config?.print_logs??false,o=t?.config?.log_level??"INFO";x.debug("Global options from context",{debug:t?.config?.debug,print_logs:t?.config?.print_logs,log_level:t?.config?.log_level,isDebug:n,printLogs:s,logLevel:o});try{let r=t.config.directory?Ke.resolve(t.config.directory):process.cwd();x.debug("Working directory resolved",{directory:r});let l=a$2(r);if(!l.valid)throw x.error("Working directory validation failed",{directory:r,error:l.error}),new Error(`Invalid working directory: ${l.error}`);let a=l.normalizedPath;x.debug("Working directory validated",{validatedDirectory:a}),console.log(g(i("acp.directory.resolved",{vars:{cwd:a}}))),await a$3(a,async()=>{let g$1=await vt(a,e);if(x.debug("ACP server configuration",{channel:g$1.channel,port:g$1.port,hostname:g$1.hostname,timeout:g$1.timeout,enabled:g$1.enabled}),!g$1.enabled){x.warn("ACP server is disabled by configuration"),console.log(g(i("acp.disabled")));return}await Ct(a,g$1,t),x.info("ACP server started successfully");});}catch(r){x.error("Failed to start ACP server",{error:r instanceof Error?r.message:String(r)}),console.error(e$1(i("acp.error.start_failed",{vars:{error:r instanceof Error?r.message:String(r)}}))),process.exit(1);}}function go(i$1,e){let t=i$1.command("acp").description(i("acp.command.description")).addHelpText("after",`
9
-
10
- ${i("acp.help.examples")}
11
- $ agent acp # ${i("acp.help.example.default")}
12
- $ agent acp --channel http # ${i("acp.help.example.http")}
13
- $ agent acp --port 8080 # ${i("acp.help.example.port")}
14
- $ agent acp --hostname 0.0.0.0 # ${i("acp.help.example.hostname")}
15
- $ agent acp --channel ws --debug # ${i("acp.help.example.debug")}
16
-
17
- ${i("acp.help.env")}
18
- ACP_CHANNEL ${i("acp.help.env.channel")}
19
- ACP_PORT ${i("acp.help.env.port")}
20
- ACP_HOSTNAME ${i("acp.help.env.hostname")}
21
- ACP_TIMEOUT ${i("acp.help.env.timeout")}
22
- ACP_ENABLED ${i("acp.help.env.enabled")}`);t.option("-c, --channel <type>",i("acp.option.channel")).option("-p, --port <number>",i("acp.option.port"),n=>parseInt(n,10)).option("-H, --hostname <address>",i("acp.option.hostname")).option("-t, --timeout <milliseconds>",i("acp.option.timeout"),n=>parseInt(n,10)),t.command("*",{isDefault:true}).action(async()=>{let n=t.opts();await wt(t,n,e);});}export{go as registerAcpCommand};
@@ -1 +0,0 @@
1
- export{U as getACPClientsConfig,T as getACPServerConfig,X as getAcpAgentName,V as getAcpAgentRuntimeConfig,W as getAcpModelConfig,S as loadACPConfig}from'./chunk-SRFQPRTU.mjs';import'./chunk-DEZT7DOH.mjs';import'./chunk-YJG6NNVY.mjs';import'./chunk-ANA5RPJQ.mjs';import'./chunk-ZBRXNYEM.mjs';import'./chunk-LQWOCD5V.mjs';import'./chunk-2RSIOAZV.mjs';import'./chunk-AAJAKVQY.mjs';import'./chunk-UNBJ6Y7L.mjs';import'./chunk-3INOJAKC.mjs';import'./chunk-B6I7MJE5.mjs';import'./chunk-CJTCCLW4.mjs';import'./chunk-HQE3WXCE.mjs';import'./chunk-LFYBZHOI.mjs';import'./chunk-ZV27OCHD.mjs';import'./chunk-X6ISXWBN.mjs';
@@ -1 +0,0 @@
1
- import {e}from'./chunk-M3K32WJV.mjs';import {j,na,k,Ma}from'./chunk-SRFQPRTU.mjs';import'./chunk-DEZT7DOH.mjs';import'./chunk-YJG6NNVY.mjs';import'./chunk-ANA5RPJQ.mjs';import'./chunk-ZBRXNYEM.mjs';import'./chunk-LQWOCD5V.mjs';import'./chunk-2RSIOAZV.mjs';import'./chunk-AAJAKVQY.mjs';import {i}from'./chunk-UNBJ6Y7L.mjs';import'./chunk-3INOJAKC.mjs';import'./chunk-B6I7MJE5.mjs';import'./chunk-CJTCCLW4.mjs';import'./chunk-HQE3WXCE.mjs';import {a}from'./chunk-LFYBZHOI.mjs';import'./chunk-ZV27OCHD.mjs';import'./chunk-X6ISXWBN.mjs';import {basename}from'path';import {iife,Identifier}from'@easbot/utils';var D=a.create({service:"debug.agent"});function z(r,o,e$1){(async()=>{D.debug("Getting agent info",{agentName:o});let t=(await r.sdk.agent.get({agentID:o})).data;t||(console.error(e(i("debug.agent.error.not_found",{vars:{agentName:o,command:basename(process.execPath)}}))),process.exit(1));let a=t,d=await C(a),i$1=await P(a,d);if(e$1.tool){let c=d.find(A=>A.id===e$1.tool);c||(console.error(e(i("debug.agent.tool.error.not_found",{vars:{toolID:e$1.tool,agentName:o}}))),process.exit(1)),i$1[e$1.tool]===false&&(console.error(e(i("debug.agent.tool.error.disabled",{vars:{toolID:e$1.tool,agentName:o}}))),process.exit(1));let g=T(e$1.params),b=await E(a,r);D.debug("Executing tool",{toolID:e$1.tool,params:g});let y=await c.execute(g,b);console.log(JSON.stringify({tool:e$1.tool,input:g,result:y},null,2));return}let m={...t,tools:i$1};console.log(JSON.stringify(m,null,2));})();}async function C(r){let o=r.model??await j.defaultModel();return o.providerID||(o={...o,providerID:"default-provider"}),na.tools(o,r)}async function P(r,o){let e=k.disabled(o.map(t=>t.id),r.permission),s={};for(let t of o)s[t.id]=!e.has(t.id);return s}function T(r){if(!r)return {};let o=r.trim();if(o.length===0)return {};let e=iife(()=>{try{return JSON.parse(o)}catch(s){try{return new Function(`return (${o})`)()}catch(t){throw new Error(i("debug.agent.tool.params.parse_error",{vars:{jsonError:s,evalError:t}}))}}});if(!e||typeof e!="object"||Array.isArray(e))throw new Error(i("debug.agent.tool.params.must_be_object"));return e}async function E(r,o){let e=await Ma.create({title:`Debug tool run (${r.name})`}),s=Identifier.ascending("message"),t=r.model??await j.defaultModel();t.providerID||(t={...t,providerID:t.providerID||"default-provider"});let a=Date.now(),d={id:s,sessionID:e.id,role:"assistant",time:{created:a},parentID:s,modelID:t.modelID,providerID:t.providerID,mode:"debug",agent:r.name,path:{cwd:o.config.directory,root:o.config.worktree},cost:0,tokens:{input:0,output:0,reasoning:0,cache:{read:0,write:0}}};await Ma.updateMessage(d);let i=k.merge(r.permission,e.permission??[]);return {sessionID:e.id,messageID:s,callID:Identifier.ascending("part"),agent:r.name,abort:new AbortController().signal,messages:[],metadata:()=>{},async ask(m){for(let c of m.patterns)if(k.evaluate(m.permission,c,i).action==="deny")throw new k.DeniedError(i)}}}export{z as registerAgentCommand};
@@ -1 +0,0 @@
1
- export{h as createTuiApp,g as getGlobalErrorHandler,e as registerGlobalErrorHandler,f as unregisterGlobalErrorHandler}from'./chunk-IVLHWGNX.mjs';import'./chunk-CQVEAYYW.mjs';import'./chunk-SRFQPRTU.mjs';import'./chunk-DEZT7DOH.mjs';import'./chunk-YJG6NNVY.mjs';import'./chunk-ANA5RPJQ.mjs';import'./chunk-ZBRXNYEM.mjs';import'./chunk-LQWOCD5V.mjs';import'./chunk-2RSIOAZV.mjs';import'./chunk-AAJAKVQY.mjs';import'./chunk-UNBJ6Y7L.mjs';import'./chunk-3INOJAKC.mjs';import'./chunk-B6I7MJE5.mjs';import'./chunk-CJTCCLW4.mjs';import'./chunk-HQE3WXCE.mjs';import'./chunk-LFYBZHOI.mjs';import'./chunk-ZV27OCHD.mjs';import'./chunk-X6ISXWBN.mjs';
@@ -1 +0,0 @@
1
- export{a as bootstrap,b as bootstrapProgram}from'./chunk-DRWG7AVN.mjs';import'./chunk-SRFQPRTU.mjs';import'./chunk-DEZT7DOH.mjs';import'./chunk-YJG6NNVY.mjs';import'./chunk-ANA5RPJQ.mjs';import'./chunk-ZBRXNYEM.mjs';import'./chunk-LQWOCD5V.mjs';import'./chunk-2RSIOAZV.mjs';import'./chunk-AAJAKVQY.mjs';import'./chunk-UNBJ6Y7L.mjs';import'./chunk-3INOJAKC.mjs';import'./chunk-B6I7MJE5.mjs';import'./chunk-CJTCCLW4.mjs';import'./chunk-HQE3WXCE.mjs';import'./chunk-LFYBZHOI.mjs';import'./chunk-ZV27OCHD.mjs';import'./chunk-X6ISXWBN.mjs';
@@ -1 +0,0 @@
1
- export{a as Bus}from'./chunk-SRFQPRTU.mjs';import'./chunk-DEZT7DOH.mjs';import'./chunk-YJG6NNVY.mjs';import'./chunk-ANA5RPJQ.mjs';import'./chunk-ZBRXNYEM.mjs';import'./chunk-LQWOCD5V.mjs';import'./chunk-2RSIOAZV.mjs';import'./chunk-AAJAKVQY.mjs';import'./chunk-UNBJ6Y7L.mjs';import'./chunk-3INOJAKC.mjs';import'./chunk-B6I7MJE5.mjs';import'./chunk-CJTCCLW4.mjs';import'./chunk-HQE3WXCE.mjs';import'./chunk-LFYBZHOI.mjs';import'./chunk-ZV27OCHD.mjs';import'./chunk-X6ISXWBN.mjs';
@@ -1,2 +0,0 @@
1
- import {a}from'./chunk-LFYBZHOI.mjs';import {a as a$1}from'./chunk-ZV27OCHD.mjs';import {c,d}from'./chunk-X6ISXWBN.mjs';import s from'path';import a$2 from'fs/promises';import {NamedError,lazy,Filesystem,PKG,$ as $$1,Lock}from'@easbot/utils';import E from'zod';import {glob}from'glob';var $;(J=>{let d$1=a.create({service:"storage"});J.NotFoundError=NamedError.create("NotFoundError",E.object({message:E.string()}));let O=[async n=>{let o=s.resolve(n,"../project");if(await Filesystem.isDir(o))for await(let i of new PKG.Glob("*").scan({cwd:o})){d$1.info(`migrating project ${i}`);let t=i,r=s.join(o,i),e="/";if(t!=="global"){let g=await glob("storage/session/message/*/*.json",{cwd:s.join(o,i),absolute:true});for(let c of g)if(e=(await a$2.readFile(c,"utf-8").then(m=>JSON.parse(m))).path?.root??"",e)break;if(!e||!await Filesystem.isDir(e))continue;let[u]=await $$1`git rev-list --max-parents=0 --all`.quiet().nothrow().cwd(e).text().then(c=>c.split(`
2
- `).filter(Boolean).map(w=>w.trim()).toSorted());if(!u)continue;t=u,await PKG.write(s.join(n,"project",t+".json"),JSON.stringify({id:u,vcs:"git",worktree:e,time:{created:Date.now(),initialized:Date.now()}})),d$1.info(`migrating sessions for project ${t}`);for await(let c of new PKG.Glob("storage/session/info/*.json").scan({cwd:r,absolute:true})){let w=s.join(n,"session",t,s.basename(c));d$1.info("copying",{sessionFile:c,dest:w});let m=await a$2.readFile(c,"utf-8").then(p=>JSON.parse(p));await a$2.writeFile(w,JSON.stringify(m)),d$1.info(`migrating messages for session ${m.id}`);for await(let p of new PKG.Glob(`storage/session/message/${m.id}/*.json`).scan({cwd:r,absolute:true})){let S=s.join(n,"message",m.id,s.basename(p));d$1.info("copying",{msgFile:p,dest:S});let h=await a$2.readFile(p,"utf-8").then(j=>JSON.parse(j));await a$2.writeFile(S,JSON.stringify(h)),d$1.info(`migrating parts for message ${h.id}`);for await(let j of new PKG.Glob(`storage/session/part/${m.id}/${h.id}/*.json`).scan({cwd:r,absolute:true})){let T=s.join(n,"part",h.id,s.basename(j)),P=await PKG.file(j).json();d$1.info("copying",{partFile:j,dest:T}),await PKG.write(T,JSON.stringify(P));}}}}}},async n=>{for await(let o of new PKG.Glob("session/*/*.json").scan({cwd:n,absolute:true})){let i=await PKG.file(o).json();if(!i.projectID||!i.summary?.diffs)continue;let{diffs:t}=i.summary;await PKG.write(s.join(n,"session_diff",i.id+".json"),JSON.stringify(t)),await PKG.write(s.join(n,"session",i.projectID,i.id+".json"),JSON.stringify({...i,summary:{additions:t.reduce((r,e)=>r+e.additions,0),deletions:t.reduce((r,e)=>r+e.deletions,0)}}));}}],l=lazy(async()=>{let n=s.join(a$1.Path.data,"storage");await a$2.mkdir(n,{recursive:true});let o=s.join(n,"migration"),i=await a$2.readFile(o,"utf-8").then(t=>parseInt(t,10)).catch(()=>0);for(let t=i;t<O.length;t++){d$1.info("running migration",{index:t});let r=O[t];r&&(await r(n).catch(()=>d$1.error("failed to run migration",{index:t})),await a$2.writeFile(o,(t+1).toString(),"utf-8"));}return {dir:n}});async function M(n){let o=await l().then(t=>t.dir),i=s.join(o,...n)+".json";return y(async()=>{await a$2.unlink(i).catch(()=>{});})}J.remove=M;async function R(n){let o=await l().then(t=>t.dir),i=s.join(o,...n)+".json";return y(async()=>{var e=[];try{let t=c(e,await Lock.read(i));let r=await a$2.readFile(i,"utf-8");return JSON.parse(r)}catch(g){var u=g,c$1=true;}finally{d(e,u,c$1);}})}J.read=R;async function A(n,o){let i=await l().then(r=>r.dir),t=s.join(i,...n)+".json";return y(async()=>{var g=[];try{let r=c(g,await Lock.write(t));let e=await a$2.readFile(t,"utf-8").then(m=>JSON.parse(m));o(e);await a$2.writeFile(t,JSON.stringify(e,null,2),"utf-8");return e}catch(u){var c$1=u,w=true;}finally{d(g,c$1,w);}})}J.update=A;async function B(n,o){let i=await l().then(r=>r.dir),t=s.join(i,...n)+".json";return y(async()=>{var e=[];try{let r=c(e,await Lock.write(t));await a$2.mkdir(s.dirname(t),{recursive:!0});await a$2.writeFile(t,JSON.stringify(o,null,2),"utf-8");}catch(g){var u=g,c$1=true;}finally{d(e,u,c$1);}})}J.write=B;async function y(n){return n().catch(o=>{if(!(o instanceof Error))throw o;let i=o;throw i.code==="ENOENT"?new J.NotFoundError({message:`Resource not found: ${i.path}`}):o})}let k="**/*";async function q(n){let o=await l().then(i=>i.dir);try{let t=(await glob(k,{cwd:s.join(o,...n),nodir:!0})).map(r=>[...n,...r.slice(0,-5).split(s.sep)]);return t.sort(),t}catch{return []}}J.list=q;})($||($={}));export{$ as a};
@@ -1 +0,0 @@
1
- export{O as Compaction,o as CompactionCache,n as DEFAULT_CACHE_CONFIG,p as createCompactionCache,q as subscribeCacheEvents}from'./chunk-SRFQPRTU.mjs';import'./chunk-DEZT7DOH.mjs';import'./chunk-YJG6NNVY.mjs';import'./chunk-ANA5RPJQ.mjs';import'./chunk-ZBRXNYEM.mjs';import'./chunk-LQWOCD5V.mjs';import'./chunk-2RSIOAZV.mjs';import'./chunk-AAJAKVQY.mjs';import'./chunk-UNBJ6Y7L.mjs';import'./chunk-3INOJAKC.mjs';import'./chunk-B6I7MJE5.mjs';import'./chunk-CJTCCLW4.mjs';import'./chunk-HQE3WXCE.mjs';import'./chunk-LFYBZHOI.mjs';import'./chunk-ZV27OCHD.mjs';import'./chunk-X6ISXWBN.mjs';
@@ -1 +0,0 @@
1
- export{c as TuiEvent}from'./chunk-DEZT7DOH.mjs';import'./chunk-CJTCCLW4.mjs';import'./chunk-LFYBZHOI.mjs';import'./chunk-X6ISXWBN.mjs';
@@ -1 +0,0 @@
1
- export{ka as File}from'./chunk-SRFQPRTU.mjs';import'./chunk-DEZT7DOH.mjs';import'./chunk-YJG6NNVY.mjs';import'./chunk-ANA5RPJQ.mjs';import'./chunk-ZBRXNYEM.mjs';import'./chunk-LQWOCD5V.mjs';import'./chunk-2RSIOAZV.mjs';import'./chunk-AAJAKVQY.mjs';import'./chunk-UNBJ6Y7L.mjs';import'./chunk-3INOJAKC.mjs';import'./chunk-B6I7MJE5.mjs';import'./chunk-CJTCCLW4.mjs';import'./chunk-HQE3WXCE.mjs';import'./chunk-LFYBZHOI.mjs';import'./chunk-ZV27OCHD.mjs';import'./chunk-X6ISXWBN.mjs';
@@ -1 +0,0 @@
1
- export{a as Global}from'./chunk-ZV27OCHD.mjs';import'./chunk-X6ISXWBN.mjs';
@@ -1 +0,0 @@
1
- export{b as Installation}from'./chunk-B6I7MJE5.mjs';import'./chunk-CJTCCLW4.mjs';import'./chunk-LFYBZHOI.mjs';import'./chunk-ZV27OCHD.mjs';import'./chunk-X6ISXWBN.mjs';
@@ -1 +0,0 @@
1
- export{Oa as Instance}from'./chunk-SRFQPRTU.mjs';import'./chunk-DEZT7DOH.mjs';import'./chunk-YJG6NNVY.mjs';import'./chunk-ANA5RPJQ.mjs';import'./chunk-ZBRXNYEM.mjs';import'./chunk-LQWOCD5V.mjs';import'./chunk-2RSIOAZV.mjs';import'./chunk-AAJAKVQY.mjs';import'./chunk-UNBJ6Y7L.mjs';import'./chunk-3INOJAKC.mjs';import'./chunk-B6I7MJE5.mjs';import'./chunk-CJTCCLW4.mjs';import'./chunk-HQE3WXCE.mjs';import'./chunk-LFYBZHOI.mjs';import'./chunk-ZV27OCHD.mjs';import'./chunk-X6ISXWBN.mjs';
@@ -1 +0,0 @@
1
- export{H as directories,G as get,J as getGlobal,I as global,E as state,F as waitForDependencies}from'./chunk-SRFQPRTU.mjs';import'./chunk-DEZT7DOH.mjs';import'./chunk-YJG6NNVY.mjs';import'./chunk-ANA5RPJQ.mjs';import'./chunk-ZBRXNYEM.mjs';import'./chunk-LQWOCD5V.mjs';import'./chunk-2RSIOAZV.mjs';import'./chunk-AAJAKVQY.mjs';import'./chunk-UNBJ6Y7L.mjs';import'./chunk-3INOJAKC.mjs';import'./chunk-B6I7MJE5.mjs';import'./chunk-CJTCCLW4.mjs';import'./chunk-HQE3WXCE.mjs';import'./chunk-LFYBZHOI.mjs';import'./chunk-ZV27OCHD.mjs';import'./chunk-X6ISXWBN.mjs';
@@ -1 +0,0 @@
1
- export{a as PluginLoader,b as createPluginLoader}from'./chunk-WQU6WFZO.mjs';import'./chunk-SRFQPRTU.mjs';import'./chunk-DEZT7DOH.mjs';import'./chunk-YJG6NNVY.mjs';import'./chunk-ANA5RPJQ.mjs';import'./chunk-ZBRXNYEM.mjs';import'./chunk-LQWOCD5V.mjs';import'./chunk-2RSIOAZV.mjs';import'./chunk-AAJAKVQY.mjs';import'./chunk-UNBJ6Y7L.mjs';import'./chunk-3INOJAKC.mjs';import'./chunk-B6I7MJE5.mjs';import'./chunk-CJTCCLW4.mjs';import'./chunk-HQE3WXCE.mjs';import'./chunk-LFYBZHOI.mjs';import'./chunk-ZV27OCHD.mjs';import'./chunk-X6ISXWBN.mjs';
@@ -1 +0,0 @@
1
- export{b as LSP}from'./chunk-SRFQPRTU.mjs';import'./chunk-DEZT7DOH.mjs';import'./chunk-YJG6NNVY.mjs';import'./chunk-ANA5RPJQ.mjs';import'./chunk-ZBRXNYEM.mjs';import'./chunk-LQWOCD5V.mjs';import'./chunk-2RSIOAZV.mjs';import'./chunk-AAJAKVQY.mjs';import'./chunk-UNBJ6Y7L.mjs';import'./chunk-3INOJAKC.mjs';import'./chunk-B6I7MJE5.mjs';import'./chunk-CJTCCLW4.mjs';import'./chunk-HQE3WXCE.mjs';import'./chunk-LFYBZHOI.mjs';import'./chunk-ZV27OCHD.mjs';import'./chunk-X6ISXWBN.mjs';
@@ -1 +0,0 @@
1
- export{P as MCP}from'./chunk-SRFQPRTU.mjs';import'./chunk-DEZT7DOH.mjs';import'./chunk-YJG6NNVY.mjs';import'./chunk-ANA5RPJQ.mjs';import'./chunk-ZBRXNYEM.mjs';import'./chunk-LQWOCD5V.mjs';import'./chunk-2RSIOAZV.mjs';import'./chunk-AAJAKVQY.mjs';import'./chunk-UNBJ6Y7L.mjs';import'./chunk-3INOJAKC.mjs';import'./chunk-B6I7MJE5.mjs';import'./chunk-CJTCCLW4.mjs';import'./chunk-HQE3WXCE.mjs';import'./chunk-LFYBZHOI.mjs';import'./chunk-ZV27OCHD.mjs';import'./chunk-X6ISXWBN.mjs';
@@ -1 +0,0 @@
1
- export{a as ModelsDev,b as initModelsRefresh}from'./chunk-3INOJAKC.mjs';import'./chunk-B6I7MJE5.mjs';import'./chunk-CJTCCLW4.mjs';import'./chunk-LFYBZHOI.mjs';import'./chunk-ZV27OCHD.mjs';import'./chunk-X6ISXWBN.mjs';
@@ -1 +0,0 @@
1
- export{a as loadTuiState,b as saveTuiStateToStorage}from'./chunk-LQWOCD5V.mjs';import'./chunk-HQE3WXCE.mjs';import'./chunk-LFYBZHOI.mjs';import'./chunk-ZV27OCHD.mjs';import'./chunk-X6ISXWBN.mjs';
@@ -1 +0,0 @@
1
- export{Na as Project}from'./chunk-SRFQPRTU.mjs';import'./chunk-DEZT7DOH.mjs';import'./chunk-YJG6NNVY.mjs';import'./chunk-ANA5RPJQ.mjs';import'./chunk-ZBRXNYEM.mjs';import'./chunk-LQWOCD5V.mjs';import'./chunk-2RSIOAZV.mjs';import'./chunk-AAJAKVQY.mjs';import'./chunk-UNBJ6Y7L.mjs';import'./chunk-3INOJAKC.mjs';import'./chunk-B6I7MJE5.mjs';import'./chunk-CJTCCLW4.mjs';import'./chunk-HQE3WXCE.mjs';import'./chunk-LFYBZHOI.mjs';import'./chunk-ZV27OCHD.mjs';import'./chunk-X6ISXWBN.mjs';
@@ -1 +0,0 @@
1
- export{Aa as SessionPrompt}from'./chunk-SRFQPRTU.mjs';import'./chunk-DEZT7DOH.mjs';import'./chunk-YJG6NNVY.mjs';import'./chunk-ANA5RPJQ.mjs';import'./chunk-ZBRXNYEM.mjs';import'./chunk-LQWOCD5V.mjs';import'./chunk-2RSIOAZV.mjs';import'./chunk-AAJAKVQY.mjs';import'./chunk-UNBJ6Y7L.mjs';import'./chunk-3INOJAKC.mjs';import'./chunk-B6I7MJE5.mjs';import'./chunk-CJTCCLW4.mjs';import'./chunk-HQE3WXCE.mjs';import'./chunk-LFYBZHOI.mjs';import'./chunk-ZV27OCHD.mjs';import'./chunk-X6ISXWBN.mjs';
@@ -1 +0,0 @@
1
- export{j as Provider}from'./chunk-SRFQPRTU.mjs';import'./chunk-DEZT7DOH.mjs';import'./chunk-YJG6NNVY.mjs';import'./chunk-ANA5RPJQ.mjs';import'./chunk-ZBRXNYEM.mjs';import'./chunk-LQWOCD5V.mjs';import'./chunk-2RSIOAZV.mjs';import'./chunk-AAJAKVQY.mjs';import'./chunk-UNBJ6Y7L.mjs';import'./chunk-3INOJAKC.mjs';import'./chunk-B6I7MJE5.mjs';import'./chunk-CJTCCLW4.mjs';import'./chunk-HQE3WXCE.mjs';import'./chunk-LFYBZHOI.mjs';import'./chunk-ZV27OCHD.mjs';import'./chunk-X6ISXWBN.mjs';
@@ -1 +0,0 @@
1
- export{na as ToolRegistry}from'./chunk-SRFQPRTU.mjs';import'./chunk-DEZT7DOH.mjs';import'./chunk-YJG6NNVY.mjs';import'./chunk-ANA5RPJQ.mjs';import'./chunk-ZBRXNYEM.mjs';import'./chunk-LQWOCD5V.mjs';import'./chunk-2RSIOAZV.mjs';import'./chunk-AAJAKVQY.mjs';import'./chunk-UNBJ6Y7L.mjs';import'./chunk-3INOJAKC.mjs';import'./chunk-B6I7MJE5.mjs';import'./chunk-CJTCCLW4.mjs';import'./chunk-HQE3WXCE.mjs';import'./chunk-LFYBZHOI.mjs';import'./chunk-ZV27OCHD.mjs';import'./chunk-X6ISXWBN.mjs';
@@ -1 +0,0 @@
1
- export{l as SessionRevert}from'./chunk-SRFQPRTU.mjs';import'./chunk-DEZT7DOH.mjs';import'./chunk-YJG6NNVY.mjs';import'./chunk-ANA5RPJQ.mjs';import'./chunk-ZBRXNYEM.mjs';import'./chunk-LQWOCD5V.mjs';import'./chunk-2RSIOAZV.mjs';import'./chunk-AAJAKVQY.mjs';import'./chunk-UNBJ6Y7L.mjs';import'./chunk-3INOJAKC.mjs';import'./chunk-B6I7MJE5.mjs';import'./chunk-CJTCCLW4.mjs';import'./chunk-HQE3WXCE.mjs';import'./chunk-LFYBZHOI.mjs';import'./chunk-ZV27OCHD.mjs';import'./chunk-X6ISXWBN.mjs';
@@ -1 +0,0 @@
1
- export{a as Ripgrep}from'./chunk-YJG6NNVY.mjs';import'./chunk-LFYBZHOI.mjs';import'./chunk-ZV27OCHD.mjs';import'./chunk-X6ISXWBN.mjs';
@@ -1 +0,0 @@
1
- export{Ca as DEFAULT_HEARTBEAT_TEMPLATE,Da as DEFAULT_SCHEDULED_TEMPLATE,Ia as HookEvent,Ea as PromptTemplate,Ha as Scheduler,Fa as TaskHistory,c as TaskStorage,d as TaskStore,i as describeCron,h as formatCronExpression,g as getNextFireTime,f as isValidCron,e as parseCronExpression,Ga as recordTaskExecution}from'./chunk-SRFQPRTU.mjs';import'./chunk-DEZT7DOH.mjs';import'./chunk-YJG6NNVY.mjs';import'./chunk-ANA5RPJQ.mjs';import'./chunk-ZBRXNYEM.mjs';import'./chunk-LQWOCD5V.mjs';import'./chunk-2RSIOAZV.mjs';import'./chunk-AAJAKVQY.mjs';import'./chunk-UNBJ6Y7L.mjs';import'./chunk-3INOJAKC.mjs';import'./chunk-B6I7MJE5.mjs';import'./chunk-CJTCCLW4.mjs';import'./chunk-HQE3WXCE.mjs';import'./chunk-LFYBZHOI.mjs';import'./chunk-ZV27OCHD.mjs';import'./chunk-X6ISXWBN.mjs';
@@ -1 +0,0 @@
1
- export{wa as Server}from'./chunk-SRFQPRTU.mjs';import'./chunk-DEZT7DOH.mjs';import'./chunk-YJG6NNVY.mjs';import'./chunk-ANA5RPJQ.mjs';import'./chunk-ZBRXNYEM.mjs';import'./chunk-LQWOCD5V.mjs';import'./chunk-2RSIOAZV.mjs';import'./chunk-AAJAKVQY.mjs';import'./chunk-UNBJ6Y7L.mjs';import'./chunk-3INOJAKC.mjs';import'./chunk-B6I7MJE5.mjs';import'./chunk-CJTCCLW4.mjs';import'./chunk-HQE3WXCE.mjs';import'./chunk-LFYBZHOI.mjs';import'./chunk-ZV27OCHD.mjs';import'./chunk-X6ISXWBN.mjs';
@@ -1 +0,0 @@
1
- export{Ma as Session,Z as Task}from'./chunk-SRFQPRTU.mjs';import'./chunk-DEZT7DOH.mjs';import'./chunk-YJG6NNVY.mjs';import'./chunk-ANA5RPJQ.mjs';import'./chunk-ZBRXNYEM.mjs';import'./chunk-LQWOCD5V.mjs';import'./chunk-2RSIOAZV.mjs';import'./chunk-AAJAKVQY.mjs';import'./chunk-UNBJ6Y7L.mjs';import'./chunk-3INOJAKC.mjs';import'./chunk-B6I7MJE5.mjs';import'./chunk-CJTCCLW4.mjs';import'./chunk-HQE3WXCE.mjs';import'./chunk-LFYBZHOI.mjs';import'./chunk-ZV27OCHD.mjs';import'./chunk-X6ISXWBN.mjs';
@@ -1 +0,0 @@
1
- export{Ma as Session}from'./chunk-SRFQPRTU.mjs';import'./chunk-DEZT7DOH.mjs';import'./chunk-YJG6NNVY.mjs';import'./chunk-ANA5RPJQ.mjs';import'./chunk-ZBRXNYEM.mjs';import'./chunk-LQWOCD5V.mjs';import'./chunk-2RSIOAZV.mjs';import'./chunk-AAJAKVQY.mjs';import'./chunk-UNBJ6Y7L.mjs';import'./chunk-3INOJAKC.mjs';import'./chunk-B6I7MJE5.mjs';import'./chunk-CJTCCLW4.mjs';import'./chunk-HQE3WXCE.mjs';import'./chunk-LFYBZHOI.mjs';import'./chunk-ZV27OCHD.mjs';import'./chunk-X6ISXWBN.mjs';
@@ -1 +0,0 @@
1
- export{La as Share}from'./chunk-SRFQPRTU.mjs';import'./chunk-DEZT7DOH.mjs';import'./chunk-YJG6NNVY.mjs';import'./chunk-ANA5RPJQ.mjs';import'./chunk-ZBRXNYEM.mjs';import'./chunk-LQWOCD5V.mjs';import'./chunk-2RSIOAZV.mjs';import'./chunk-AAJAKVQY.mjs';import'./chunk-UNBJ6Y7L.mjs';import'./chunk-3INOJAKC.mjs';import'./chunk-B6I7MJE5.mjs';import'./chunk-CJTCCLW4.mjs';import'./chunk-HQE3WXCE.mjs';import'./chunk-LFYBZHOI.mjs';import'./chunk-ZV27OCHD.mjs';import'./chunk-X6ISXWBN.mjs';
@@ -1 +0,0 @@
1
- export{Ja as Snapshot}from'./chunk-SRFQPRTU.mjs';import'./chunk-DEZT7DOH.mjs';import'./chunk-YJG6NNVY.mjs';import'./chunk-ANA5RPJQ.mjs';import'./chunk-ZBRXNYEM.mjs';import'./chunk-LQWOCD5V.mjs';import'./chunk-2RSIOAZV.mjs';import'./chunk-AAJAKVQY.mjs';import'./chunk-UNBJ6Y7L.mjs';import'./chunk-3INOJAKC.mjs';import'./chunk-B6I7MJE5.mjs';import'./chunk-CJTCCLW4.mjs';import'./chunk-HQE3WXCE.mjs';import'./chunk-LFYBZHOI.mjs';import'./chunk-ZV27OCHD.mjs';import'./chunk-X6ISXWBN.mjs';
@@ -1 +0,0 @@
1
- export{a as Storage}from'./chunk-HQE3WXCE.mjs';import'./chunk-LFYBZHOI.mjs';import'./chunk-ZV27OCHD.mjs';import'./chunk-X6ISXWBN.mjs';
@@ -1 +0,0 @@
1
- export{a as CustomEditor,h as createTuiApp,d as editorTheme,c as selectListTheme,b as theme}from'./chunk-IVLHWGNX.mjs';import'./chunk-CQVEAYYW.mjs';import'./chunk-SRFQPRTU.mjs';import'./chunk-DEZT7DOH.mjs';import'./chunk-YJG6NNVY.mjs';import'./chunk-ANA5RPJQ.mjs';import'./chunk-ZBRXNYEM.mjs';import'./chunk-LQWOCD5V.mjs';import'./chunk-2RSIOAZV.mjs';import'./chunk-AAJAKVQY.mjs';import'./chunk-UNBJ6Y7L.mjs';import'./chunk-3INOJAKC.mjs';import'./chunk-B6I7MJE5.mjs';import'./chunk-CJTCCLW4.mjs';import'./chunk-HQE3WXCE.mjs';import'./chunk-LFYBZHOI.mjs';import'./chunk-ZV27OCHD.mjs';import'./chunk-X6ISXWBN.mjs';