dexto 1.0.1 → 1.1.0

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 (166) hide show
  1. package/README.md +14 -12
  2. package/agents/agent-registry.json +53 -0
  3. package/agents/database-agent/README.md +35 -0
  4. package/agents/database-agent/data/example.db +0 -0
  5. package/agents/database-agent/database-agent-example.sql +98 -0
  6. package/agents/database-agent/database-agent.yml +116 -0
  7. package/agents/database-agent/setup-database.sh +64 -0
  8. package/agents/{agent.yml → default-agent.yml} +1 -1
  9. package/agents/image-editor-agent/Lenna.webp +0 -0
  10. package/agents/image-editor-agent/README.md +435 -0
  11. package/agents/image-editor-agent/image-editor-agent.yml +45 -0
  12. package/agents/music-agent/README.md +294 -0
  13. package/agents/music-agent/music-agent.yml +43 -0
  14. package/agents/product-name-researcher/README.md +98 -0
  15. package/agents/product-name-researcher/product-name-researcher.yml +161 -0
  16. package/agents/talk2pdf-agent/README.md +166 -0
  17. package/agents/talk2pdf-agent/talk2pdf-agent.yml +42 -0
  18. package/agents/triage-demo/README.md +337 -0
  19. package/agents/triage-demo/billing-agent.yml +76 -0
  20. package/agents/triage-demo/docs/billing-policies.md +246 -0
  21. package/agents/triage-demo/docs/company-overview.md +94 -0
  22. package/agents/triage-demo/docs/escalation-policies.md +301 -0
  23. package/agents/triage-demo/docs/product-features.md +253 -0
  24. package/agents/triage-demo/docs/technical-documentation.md +226 -0
  25. package/agents/triage-demo/escalation-agent.yml +82 -0
  26. package/agents/triage-demo/product-info-agent.yml +86 -0
  27. package/agents/triage-demo/technical-support-agent.yml +71 -0
  28. package/agents/triage-demo/test-scenarios.md +209 -0
  29. package/agents/triage-demo/triage-agent.yml +172 -0
  30. package/dist/src/app/{chunk-M4OZIDPC.js → chunk-CLDYRNV6.js} +7241 -5753
  31. package/dist/src/app/chunk-DYNVXGAH.js +137 -0
  32. package/dist/src/app/chunk-PW2PHCHR.js +83 -0
  33. package/dist/src/app/chunk-R4Q522DR.js +205 -0
  34. package/dist/src/app/chunk-UXCBS3TR.js +281 -0
  35. package/dist/src/app/chunk-X6LEX724.js +108 -0
  36. package/dist/src/app/chunk-Y33BS5SA.js +39 -0
  37. package/dist/src/app/{cli-confirmation-handler-2APQRKHG.js → cli-confirmation-handler-GJHPLGOL.js} +4 -1
  38. package/dist/src/app/errors-5MNETGOV.js +8 -0
  39. package/dist/src/app/index.js +2184 -612
  40. package/dist/src/app/loader-EFMKWNNQ.js +20 -0
  41. package/dist/src/app/path-7FT4SZMO.js +23 -0
  42. package/dist/src/app/{postgres-backend-7HVVW3RL.js → postgres-backend-U5MIIMUY.js} +12 -1
  43. package/dist/src/app/{redis-backend-2YBZSSSV.js → redis-backend-NGI67ILT.js} +38 -9
  44. package/dist/src/app/registry-RALMVM3P.js +14 -0
  45. package/dist/src/app/sqlite-backend-752UUBD4.js +245 -0
  46. package/dist/src/app/webui/.next/standalone/.next/BUILD_ID +1 -1
  47. package/dist/src/app/webui/.next/standalone/.next/app-build-manifest.json +20 -21
  48. package/dist/src/app/webui/.next/standalone/.next/app-path-routes-manifest.json +0 -1
  49. package/dist/src/app/webui/.next/standalone/.next/build-manifest.json +4 -4
  50. package/dist/src/app/webui/.next/standalone/.next/prerender-manifest.json +4 -82
  51. package/dist/src/app/webui/.next/standalone/.next/required-server-files.json +2 -3
  52. package/dist/src/app/webui/.next/standalone/.next/routes-manifest.json +0 -6
  53. package/dist/src/app/webui/.next/standalone/.next/server/app/_not-found/page.js +1 -1
  54. package/dist/src/app/webui/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
  55. package/dist/src/app/webui/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  56. package/dist/src/app/webui/.next/standalone/.next/server/app/page.js +7 -3
  57. package/dist/src/app/webui/.next/standalone/.next/server/app/page.js.nft.json +1 -1
  58. package/dist/src/app/webui/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  59. package/dist/src/app/webui/.next/standalone/.next/server/app/playground/page.js +8 -8
  60. package/dist/src/app/webui/.next/standalone/.next/server/app/playground/page.js.nft.json +1 -1
  61. package/dist/src/app/webui/.next/standalone/.next/server/app/playground/page_client-reference-manifest.js +1 -1
  62. package/dist/src/app/webui/.next/standalone/.next/server/app-paths-manifest.json +0 -1
  63. package/dist/src/app/webui/.next/standalone/.next/server/chunks/176.js +1 -0
  64. package/dist/src/app/webui/.next/standalone/.next/server/chunks/195.js +24 -0
  65. package/dist/src/app/webui/.next/standalone/.next/server/chunks/620.js +1 -0
  66. package/dist/src/app/webui/.next/standalone/.next/server/chunks/80.js +5 -0
  67. package/dist/src/app/webui/.next/standalone/.next/server/middleware-build-manifest.js +1 -1
  68. package/dist/src/app/webui/.next/standalone/.next/server/pages/500.html +1 -1
  69. package/dist/src/app/webui/.next/standalone/.next/server/pages-manifest.json +1 -2
  70. package/dist/src/app/webui/.next/standalone/.next/server/server-reference-manifest.json +1 -1
  71. package/dist/src/app/webui/.next/standalone/.next/server/webpack-runtime.js +1 -1
  72. package/dist/src/app/webui/.next/standalone/.next/static/chunks/190-b897ef36fde616bf.js +1 -0
  73. package/dist/src/app/webui/.next/standalone/.next/static/chunks/487-a77054bd2c64c79c.js +1 -0
  74. package/dist/src/app/webui/.next/standalone/.next/static/chunks/588-dbe47a44489742dd.js +1 -0
  75. package/dist/src/app/webui/.next/standalone/.next/static/chunks/62-35030b5cb176bd7b.js +1 -0
  76. package/dist/src/app/webui/.next/standalone/.next/static/chunks/app/layout-91c0cb9eb1ee327a.js +1 -0
  77. package/dist/src/app/webui/.next/standalone/.next/static/chunks/app/page-3279aaf14db87f45.js +1 -0
  78. package/dist/src/app/webui/.next/standalone/.next/static/chunks/app/playground/page-200aad53af9ca53f.js +1 -0
  79. package/dist/src/app/webui/.next/standalone/.next/static/css/af71306827be150e.css +3 -0
  80. package/dist/src/app/webui/.next/standalone/.next/static/tpCURR82LyyGfdALJ4Qvl/_buildManifest.js +1 -0
  81. package/dist/src/app/webui/.next/standalone/package.json +4 -3
  82. package/dist/src/app/webui/.next/standalone/public/favicon2.ico +0 -0
  83. package/dist/src/app/webui/.next/standalone/public/logo.svg +1 -0
  84. package/dist/src/app/webui/.next/standalone/public/logo_no_text.png +0 -0
  85. package/dist/src/app/webui/.next/standalone/server.js +1 -1
  86. package/dist/src/app/webui/.next/static/chunks/190-b897ef36fde616bf.js +1 -0
  87. package/dist/src/app/webui/.next/static/chunks/487-a77054bd2c64c79c.js +1 -0
  88. package/dist/src/app/webui/.next/static/chunks/588-dbe47a44489742dd.js +1 -0
  89. package/dist/src/app/webui/.next/static/chunks/62-35030b5cb176bd7b.js +1 -0
  90. package/dist/src/app/webui/.next/static/chunks/app/layout-91c0cb9eb1ee327a.js +1 -0
  91. package/dist/src/app/webui/.next/static/chunks/app/page-3279aaf14db87f45.js +1 -0
  92. package/dist/src/app/webui/.next/static/chunks/app/playground/page-200aad53af9ca53f.js +1 -0
  93. package/dist/src/app/webui/.next/static/css/af71306827be150e.css +3 -0
  94. package/dist/src/app/webui/.next/static/tpCURR82LyyGfdALJ4Qvl/_buildManifest.js +1 -0
  95. package/dist/src/app/webui/package.json +4 -3
  96. package/dist/src/app/webui/public/favicon2.ico +0 -0
  97. package/dist/src/app/webui/public/logo.svg +1 -0
  98. package/dist/src/app/webui/public/logo_no_text.png +0 -0
  99. package/dist/src/core/chunk-7A6NQKQ3.js +193 -0
  100. package/dist/src/core/chunk-CZIXQNMZ.js +12191 -0
  101. package/dist/src/core/index.cjs +10601 -8012
  102. package/dist/src/core/index.d.cts +4356 -3907
  103. package/dist/src/core/index.d.ts +4356 -3907
  104. package/dist/src/core/index.js +117 -8396
  105. package/dist/src/core/{postgres-backend-ERZ6DP76.js → postgres-backend-LOLKTD2T.js} +9 -2
  106. package/dist/src/core/{redis-backend-46O7Y44C.js → redis-backend-APZ576PJ.js} +35 -10
  107. package/dist/src/core/sqlite-backend-KQ75DPR7.js +245 -0
  108. package/package.json +20 -12
  109. package/dist/src/app/chunk-O5YHNFMH.js +0 -435
  110. package/dist/src/app/interactive-api-key-setup-V3GAACLN.js +0 -269
  111. package/dist/src/app/sqlite-backend-KIJZ5IP3.js +0 -180
  112. package/dist/src/app/webui/.next/standalone/.next/server/app/_not-found.html +0 -1
  113. package/dist/src/app/webui/.next/standalone/.next/server/app/_not-found.meta +0 -8
  114. package/dist/src/app/webui/.next/standalone/.next/server/app/_not-found.rsc +0 -21
  115. package/dist/src/app/webui/.next/standalone/.next/server/app/favicon.ico/route.js +0 -1
  116. package/dist/src/app/webui/.next/standalone/.next/server/app/favicon.ico/route.js.nft.json +0 -1
  117. package/dist/src/app/webui/.next/standalone/.next/server/app/favicon.ico.body +0 -0
  118. package/dist/src/app/webui/.next/standalone/.next/server/app/favicon.ico.meta +0 -1
  119. package/dist/src/app/webui/.next/standalone/.next/server/app/index.html +0 -1
  120. package/dist/src/app/webui/.next/standalone/.next/server/app/index.meta +0 -7
  121. package/dist/src/app/webui/.next/standalone/.next/server/app/index.rsc +0 -22
  122. package/dist/src/app/webui/.next/standalone/.next/server/app/playground.html +0 -1
  123. package/dist/src/app/webui/.next/standalone/.next/server/app/playground.meta +0 -7
  124. package/dist/src/app/webui/.next/standalone/.next/server/app/playground.rsc +0 -25
  125. package/dist/src/app/webui/.next/standalone/.next/server/chunks/447.js +0 -20
  126. package/dist/src/app/webui/.next/standalone/.next/server/chunks/504.js +0 -1
  127. package/dist/src/app/webui/.next/standalone/.next/server/chunks/54.js +0 -5
  128. package/dist/src/app/webui/.next/standalone/.next/server/chunks/624.js +0 -1
  129. package/dist/src/app/webui/.next/standalone/.next/server/chunks/985.js +0 -5
  130. package/dist/src/app/webui/.next/standalone/.next/server/pages/404.html +0 -1
  131. package/dist/src/app/webui/.next/standalone/.next/static/H-71qcBOOk528tDEa_ldn/_buildManifest.js +0 -1
  132. package/dist/src/app/webui/.next/standalone/.next/static/chunks/125-9b34ec01f112cdb2.js +0 -1
  133. package/dist/src/app/webui/.next/standalone/.next/static/chunks/487-c6ea8b63ca68db1c.js +0 -1
  134. package/dist/src/app/webui/.next/standalone/.next/static/chunks/588-20dc7f3a8664c387.js +0 -1
  135. package/dist/src/app/webui/.next/standalone/.next/static/chunks/687-3e614f30982093f6.js +0 -1
  136. package/dist/src/app/webui/.next/standalone/.next/static/chunks/879-cf875984faa0b72f.js +0 -1
  137. package/dist/src/app/webui/.next/standalone/.next/static/chunks/app/layout-ed56660b7ecaf47b.js +0 -1
  138. package/dist/src/app/webui/.next/standalone/.next/static/chunks/app/page-b05580de36ce0e36.js +0 -1
  139. package/dist/src/app/webui/.next/standalone/.next/static/chunks/app/playground/page-ac5443cddbe824aa.js +0 -1
  140. package/dist/src/app/webui/.next/standalone/.next/static/css/d44f09bc2605dc76.css +0 -3
  141. package/dist/src/app/webui/.next/standalone/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js +0 -19
  142. package/dist/src/app/webui/.next/standalone/public/favicon.svg +0 -26
  143. package/dist/src/app/webui/.next/standalone/public/logo.png +0 -0
  144. package/dist/src/app/webui/.next/static/H-71qcBOOk528tDEa_ldn/_buildManifest.js +0 -1
  145. package/dist/src/app/webui/.next/static/chunks/125-9b34ec01f112cdb2.js +0 -1
  146. package/dist/src/app/webui/.next/static/chunks/487-c6ea8b63ca68db1c.js +0 -1
  147. package/dist/src/app/webui/.next/static/chunks/588-20dc7f3a8664c387.js +0 -1
  148. package/dist/src/app/webui/.next/static/chunks/687-3e614f30982093f6.js +0 -1
  149. package/dist/src/app/webui/.next/static/chunks/879-cf875984faa0b72f.js +0 -1
  150. package/dist/src/app/webui/.next/static/chunks/app/layout-ed56660b7ecaf47b.js +0 -1
  151. package/dist/src/app/webui/.next/static/chunks/app/page-b05580de36ce0e36.js +0 -1
  152. package/dist/src/app/webui/.next/static/chunks/app/playground/page-ac5443cddbe824aa.js +0 -1
  153. package/dist/src/app/webui/.next/static/css/d44f09bc2605dc76.css +0 -3
  154. package/dist/src/app/webui/public/favicon.svg +0 -26
  155. package/dist/src/app/webui/public/logo.png +0 -0
  156. package/dist/src/core/chunk-BGO5B3L4.js +0 -2124
  157. package/dist/src/core/chunk-BYHW25EA.js +0 -41
  158. package/dist/src/core/sqlite-backend-RKK4WBHE.js +0 -184
  159. /package/dist/src/app/webui/.next/standalone/.next/static/chunks/{4bd1b696-2df85d4b3b58aed5.js → 4bd1b696-c95fa02060335229.js} +0 -0
  160. /package/dist/src/app/webui/.next/standalone/.next/static/chunks/{684-058c08971e023037.js → 684-2e7175657246b549.js} +0 -0
  161. /package/dist/src/app/webui/.next/standalone/.next/static/chunks/app/_not-found/{page-7b137d85f9de4771.js → page-b63df5a8d3225455.js} +0 -0
  162. /package/dist/src/app/webui/.next/standalone/.next/static/{H-71qcBOOk528tDEa_ldn → tpCURR82LyyGfdALJ4Qvl}/_ssgManifest.js +0 -0
  163. /package/dist/src/app/webui/.next/static/chunks/{4bd1b696-2df85d4b3b58aed5.js → 4bd1b696-c95fa02060335229.js} +0 -0
  164. /package/dist/src/app/webui/.next/static/chunks/{684-058c08971e023037.js → 684-2e7175657246b549.js} +0 -0
  165. /package/dist/src/app/webui/.next/static/chunks/app/_not-found/{page-7b137d85f9de4771.js → page-b63df5a8d3225455.js} +0 -0
  166. /package/dist/src/app/webui/.next/static/{H-71qcBOOk528tDEa_ldn → tpCURR82LyyGfdALJ4Qvl}/_ssgManifest.js +0 -0
@@ -1,2124 +0,0 @@
1
- import {
2
- __commonJS,
3
- __toESM,
4
- init_esm_shims
5
- } from "./chunk-BYHW25EA.js";
6
-
7
- // node_modules/eastasianwidth/eastasianwidth.js
8
- var require_eastasianwidth = __commonJS({
9
- "node_modules/eastasianwidth/eastasianwidth.js"(exports, module) {
10
- "use strict";
11
- init_esm_shims();
12
- var eaw = {};
13
- if ("undefined" == typeof module) {
14
- window.eastasianwidth = eaw;
15
- } else {
16
- module.exports = eaw;
17
- }
18
- eaw.eastAsianWidth = function(character) {
19
- var x = character.charCodeAt(0);
20
- var y = character.length == 2 ? character.charCodeAt(1) : 0;
21
- var codePoint = x;
22
- if (55296 <= x && x <= 56319 && (56320 <= y && y <= 57343)) {
23
- x &= 1023;
24
- y &= 1023;
25
- codePoint = x << 10 | y;
26
- codePoint += 65536;
27
- }
28
- if (12288 == codePoint || 65281 <= codePoint && codePoint <= 65376 || 65504 <= codePoint && codePoint <= 65510) {
29
- return "F";
30
- }
31
- if (8361 == codePoint || 65377 <= codePoint && codePoint <= 65470 || 65474 <= codePoint && codePoint <= 65479 || 65482 <= codePoint && codePoint <= 65487 || 65490 <= codePoint && codePoint <= 65495 || 65498 <= codePoint && codePoint <= 65500 || 65512 <= codePoint && codePoint <= 65518) {
32
- return "H";
33
- }
34
- if (4352 <= codePoint && codePoint <= 4447 || 4515 <= codePoint && codePoint <= 4519 || 4602 <= codePoint && codePoint <= 4607 || 9001 <= codePoint && codePoint <= 9002 || 11904 <= codePoint && codePoint <= 11929 || 11931 <= codePoint && codePoint <= 12019 || 12032 <= codePoint && codePoint <= 12245 || 12272 <= codePoint && codePoint <= 12283 || 12289 <= codePoint && codePoint <= 12350 || 12353 <= codePoint && codePoint <= 12438 || 12441 <= codePoint && codePoint <= 12543 || 12549 <= codePoint && codePoint <= 12589 || 12593 <= codePoint && codePoint <= 12686 || 12688 <= codePoint && codePoint <= 12730 || 12736 <= codePoint && codePoint <= 12771 || 12784 <= codePoint && codePoint <= 12830 || 12832 <= codePoint && codePoint <= 12871 || 12880 <= codePoint && codePoint <= 13054 || 13056 <= codePoint && codePoint <= 19903 || 19968 <= codePoint && codePoint <= 42124 || 42128 <= codePoint && codePoint <= 42182 || 43360 <= codePoint && codePoint <= 43388 || 44032 <= codePoint && codePoint <= 55203 || 55216 <= codePoint && codePoint <= 55238 || 55243 <= codePoint && codePoint <= 55291 || 63744 <= codePoint && codePoint <= 64255 || 65040 <= codePoint && codePoint <= 65049 || 65072 <= codePoint && codePoint <= 65106 || 65108 <= codePoint && codePoint <= 65126 || 65128 <= codePoint && codePoint <= 65131 || 110592 <= codePoint && codePoint <= 110593 || 127488 <= codePoint && codePoint <= 127490 || 127504 <= codePoint && codePoint <= 127546 || 127552 <= codePoint && codePoint <= 127560 || 127568 <= codePoint && codePoint <= 127569 || 131072 <= codePoint && codePoint <= 194367 || 177984 <= codePoint && codePoint <= 196605 || 196608 <= codePoint && codePoint <= 262141) {
35
- return "W";
36
- }
37
- if (32 <= codePoint && codePoint <= 126 || 162 <= codePoint && codePoint <= 163 || 165 <= codePoint && codePoint <= 166 || 172 == codePoint || 175 == codePoint || 10214 <= codePoint && codePoint <= 10221 || 10629 <= codePoint && codePoint <= 10630) {
38
- return "Na";
39
- }
40
- if (161 == codePoint || 164 == codePoint || 167 <= codePoint && codePoint <= 168 || 170 == codePoint || 173 <= codePoint && codePoint <= 174 || 176 <= codePoint && codePoint <= 180 || 182 <= codePoint && codePoint <= 186 || 188 <= codePoint && codePoint <= 191 || 198 == codePoint || 208 == codePoint || 215 <= codePoint && codePoint <= 216 || 222 <= codePoint && codePoint <= 225 || 230 == codePoint || 232 <= codePoint && codePoint <= 234 || 236 <= codePoint && codePoint <= 237 || 240 == codePoint || 242 <= codePoint && codePoint <= 243 || 247 <= codePoint && codePoint <= 250 || 252 == codePoint || 254 == codePoint || 257 == codePoint || 273 == codePoint || 275 == codePoint || 283 == codePoint || 294 <= codePoint && codePoint <= 295 || 299 == codePoint || 305 <= codePoint && codePoint <= 307 || 312 == codePoint || 319 <= codePoint && codePoint <= 322 || 324 == codePoint || 328 <= codePoint && codePoint <= 331 || 333 == codePoint || 338 <= codePoint && codePoint <= 339 || 358 <= codePoint && codePoint <= 359 || 363 == codePoint || 462 == codePoint || 464 == codePoint || 466 == codePoint || 468 == codePoint || 470 == codePoint || 472 == codePoint || 474 == codePoint || 476 == codePoint || 593 == codePoint || 609 == codePoint || 708 == codePoint || 711 == codePoint || 713 <= codePoint && codePoint <= 715 || 717 == codePoint || 720 == codePoint || 728 <= codePoint && codePoint <= 731 || 733 == codePoint || 735 == codePoint || 768 <= codePoint && codePoint <= 879 || 913 <= codePoint && codePoint <= 929 || 931 <= codePoint && codePoint <= 937 || 945 <= codePoint && codePoint <= 961 || 963 <= codePoint && codePoint <= 969 || 1025 == codePoint || 1040 <= codePoint && codePoint <= 1103 || 1105 == codePoint || 8208 == codePoint || 8211 <= codePoint && codePoint <= 8214 || 8216 <= codePoint && codePoint <= 8217 || 8220 <= codePoint && codePoint <= 8221 || 8224 <= codePoint && codePoint <= 8226 || 8228 <= codePoint && codePoint <= 8231 || 8240 == codePoint || 8242 <= codePoint && codePoint <= 8243 || 8245 == codePoint || 8251 == codePoint || 8254 == codePoint || 8308 == codePoint || 8319 == codePoint || 8321 <= codePoint && codePoint <= 8324 || 8364 == codePoint || 8451 == codePoint || 8453 == codePoint || 8457 == codePoint || 8467 == codePoint || 8470 == codePoint || 8481 <= codePoint && codePoint <= 8482 || 8486 == codePoint || 8491 == codePoint || 8531 <= codePoint && codePoint <= 8532 || 8539 <= codePoint && codePoint <= 8542 || 8544 <= codePoint && codePoint <= 8555 || 8560 <= codePoint && codePoint <= 8569 || 8585 == codePoint || 8592 <= codePoint && codePoint <= 8601 || 8632 <= codePoint && codePoint <= 8633 || 8658 == codePoint || 8660 == codePoint || 8679 == codePoint || 8704 == codePoint || 8706 <= codePoint && codePoint <= 8707 || 8711 <= codePoint && codePoint <= 8712 || 8715 == codePoint || 8719 == codePoint || 8721 == codePoint || 8725 == codePoint || 8730 == codePoint || 8733 <= codePoint && codePoint <= 8736 || 8739 == codePoint || 8741 == codePoint || 8743 <= codePoint && codePoint <= 8748 || 8750 == codePoint || 8756 <= codePoint && codePoint <= 8759 || 8764 <= codePoint && codePoint <= 8765 || 8776 == codePoint || 8780 == codePoint || 8786 == codePoint || 8800 <= codePoint && codePoint <= 8801 || 8804 <= codePoint && codePoint <= 8807 || 8810 <= codePoint && codePoint <= 8811 || 8814 <= codePoint && codePoint <= 8815 || 8834 <= codePoint && codePoint <= 8835 || 8838 <= codePoint && codePoint <= 8839 || 8853 == codePoint || 8857 == codePoint || 8869 == codePoint || 8895 == codePoint || 8978 == codePoint || 9312 <= codePoint && codePoint <= 9449 || 9451 <= codePoint && codePoint <= 9547 || 9552 <= codePoint && codePoint <= 9587 || 9600 <= codePoint && codePoint <= 9615 || 9618 <= codePoint && codePoint <= 9621 || 9632 <= codePoint && codePoint <= 9633 || 9635 <= codePoint && codePoint <= 9641 || 9650 <= codePoint && codePoint <= 9651 || 9654 <= codePoint && codePoint <= 9655 || 9660 <= codePoint && codePoint <= 9661 || 9664 <= codePoint && codePoint <= 9665 || 9670 <= codePoint && codePoint <= 9672 || 9675 == codePoint || 9678 <= codePoint && codePoint <= 9681 || 9698 <= codePoint && codePoint <= 9701 || 9711 == codePoint || 9733 <= codePoint && codePoint <= 9734 || 9737 == codePoint || 9742 <= codePoint && codePoint <= 9743 || 9748 <= codePoint && codePoint <= 9749 || 9756 == codePoint || 9758 == codePoint || 9792 == codePoint || 9794 == codePoint || 9824 <= codePoint && codePoint <= 9825 || 9827 <= codePoint && codePoint <= 9829 || 9831 <= codePoint && codePoint <= 9834 || 9836 <= codePoint && codePoint <= 9837 || 9839 == codePoint || 9886 <= codePoint && codePoint <= 9887 || 9918 <= codePoint && codePoint <= 9919 || 9924 <= codePoint && codePoint <= 9933 || 9935 <= codePoint && codePoint <= 9953 || 9955 == codePoint || 9960 <= codePoint && codePoint <= 9983 || 10045 == codePoint || 10071 == codePoint || 10102 <= codePoint && codePoint <= 10111 || 11093 <= codePoint && codePoint <= 11097 || 12872 <= codePoint && codePoint <= 12879 || 57344 <= codePoint && codePoint <= 63743 || 65024 <= codePoint && codePoint <= 65039 || 65533 == codePoint || 127232 <= codePoint && codePoint <= 127242 || 127248 <= codePoint && codePoint <= 127277 || 127280 <= codePoint && codePoint <= 127337 || 127344 <= codePoint && codePoint <= 127386 || 917760 <= codePoint && codePoint <= 917999 || 983040 <= codePoint && codePoint <= 1048573 || 1048576 <= codePoint && codePoint <= 1114109) {
41
- return "A";
42
- }
43
- return "N";
44
- };
45
- eaw.characterLength = function(character) {
46
- var code = this.eastAsianWidth(character);
47
- if (code == "F" || code == "W" || code == "A") {
48
- return 2;
49
- } else {
50
- return 1;
51
- }
52
- };
53
- function stringToArray(string) {
54
- return string.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
55
- }
56
- eaw.length = function(string) {
57
- var characters = stringToArray(string);
58
- var len = 0;
59
- for (var i = 0; i < characters.length; i++) {
60
- len = len + this.characterLength(characters[i]);
61
- }
62
- return len;
63
- };
64
- eaw.slice = function(text, start, end) {
65
- textLen = eaw.length(text);
66
- start = start ? start : 0;
67
- end = end ? end : 1;
68
- if (start < 0) {
69
- start = textLen + start;
70
- }
71
- if (end < 0) {
72
- end = textLen + end;
73
- }
74
- var result = "";
75
- var eawLen = 0;
76
- var chars = stringToArray(text);
77
- for (var i = 0; i < chars.length; i++) {
78
- var char = chars[i];
79
- var charLen = eaw.length(char);
80
- if (eawLen >= start - (charLen == 2 ? 1 : 0)) {
81
- if (eawLen + charLen <= end) {
82
- result += char;
83
- } else {
84
- break;
85
- }
86
- }
87
- eawLen += charLen;
88
- }
89
- return result;
90
- };
91
- }
92
- });
93
-
94
- // node_modules/emoji-regex/index.js
95
- var require_emoji_regex = __commonJS({
96
- "node_modules/emoji-regex/index.js"(exports, module) {
97
- "use strict";
98
- init_esm_shims();
99
- module.exports = function() {
100
- return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g;
101
- };
102
- }
103
- });
104
-
105
- // node_modules/cli-boxes/boxes.json
106
- var require_boxes = __commonJS({
107
- "node_modules/cli-boxes/boxes.json"(exports, module) {
108
- module.exports = {
109
- single: {
110
- topLeft: "\u250C",
111
- top: "\u2500",
112
- topRight: "\u2510",
113
- right: "\u2502",
114
- bottomRight: "\u2518",
115
- bottom: "\u2500",
116
- bottomLeft: "\u2514",
117
- left: "\u2502"
118
- },
119
- double: {
120
- topLeft: "\u2554",
121
- top: "\u2550",
122
- topRight: "\u2557",
123
- right: "\u2551",
124
- bottomRight: "\u255D",
125
- bottom: "\u2550",
126
- bottomLeft: "\u255A",
127
- left: "\u2551"
128
- },
129
- round: {
130
- topLeft: "\u256D",
131
- top: "\u2500",
132
- topRight: "\u256E",
133
- right: "\u2502",
134
- bottomRight: "\u256F",
135
- bottom: "\u2500",
136
- bottomLeft: "\u2570",
137
- left: "\u2502"
138
- },
139
- bold: {
140
- topLeft: "\u250F",
141
- top: "\u2501",
142
- topRight: "\u2513",
143
- right: "\u2503",
144
- bottomRight: "\u251B",
145
- bottom: "\u2501",
146
- bottomLeft: "\u2517",
147
- left: "\u2503"
148
- },
149
- singleDouble: {
150
- topLeft: "\u2553",
151
- top: "\u2500",
152
- topRight: "\u2556",
153
- right: "\u2551",
154
- bottomRight: "\u255C",
155
- bottom: "\u2500",
156
- bottomLeft: "\u2559",
157
- left: "\u2551"
158
- },
159
- doubleSingle: {
160
- topLeft: "\u2552",
161
- top: "\u2550",
162
- topRight: "\u2555",
163
- right: "\u2502",
164
- bottomRight: "\u255B",
165
- bottom: "\u2550",
166
- bottomLeft: "\u2558",
167
- left: "\u2502"
168
- },
169
- classic: {
170
- topLeft: "+",
171
- top: "-",
172
- topRight: "+",
173
- right: "|",
174
- bottomRight: "+",
175
- bottom: "-",
176
- bottomLeft: "+",
177
- left: "|"
178
- },
179
- arrow: {
180
- topLeft: "\u2198",
181
- top: "\u2193",
182
- topRight: "\u2199",
183
- right: "\u2190",
184
- bottomRight: "\u2196",
185
- bottom: "\u2191",
186
- bottomLeft: "\u2197",
187
- left: "\u2192"
188
- }
189
- };
190
- }
191
- });
192
-
193
- // node_modules/cli-boxes/index.js
194
- var require_cli_boxes = __commonJS({
195
- "node_modules/cli-boxes/index.js"(exports, module) {
196
- "use strict";
197
- init_esm_shims();
198
- var cliBoxes2 = require_boxes();
199
- module.exports = cliBoxes2;
200
- module.exports.default = cliBoxes2;
201
- }
202
- });
203
-
204
- // node_modules/ansi-align/node_modules/ansi-regex/index.js
205
- var require_ansi_regex = __commonJS({
206
- "node_modules/ansi-align/node_modules/ansi-regex/index.js"(exports, module) {
207
- "use strict";
208
- init_esm_shims();
209
- module.exports = ({ onlyFirst = false } = {}) => {
210
- const pattern = [
211
- "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
212
- "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"
213
- ].join("|");
214
- return new RegExp(pattern, onlyFirst ? void 0 : "g");
215
- };
216
- }
217
- });
218
-
219
- // node_modules/ansi-align/node_modules/strip-ansi/index.js
220
- var require_strip_ansi = __commonJS({
221
- "node_modules/ansi-align/node_modules/strip-ansi/index.js"(exports, module) {
222
- "use strict";
223
- init_esm_shims();
224
- var ansiRegex2 = require_ansi_regex();
225
- module.exports = (string) => typeof string === "string" ? string.replace(ansiRegex2(), "") : string;
226
- }
227
- });
228
-
229
- // node_modules/is-fullwidth-code-point/index.js
230
- var require_is_fullwidth_code_point = __commonJS({
231
- "node_modules/is-fullwidth-code-point/index.js"(exports, module) {
232
- "use strict";
233
- init_esm_shims();
234
- var isFullwidthCodePoint = (codePoint) => {
235
- if (Number.isNaN(codePoint)) {
236
- return false;
237
- }
238
- if (codePoint >= 4352 && (codePoint <= 4447 || // Hangul Jamo
239
- codePoint === 9001 || // LEFT-POINTING ANGLE BRACKET
240
- codePoint === 9002 || // RIGHT-POINTING ANGLE BRACKET
241
- // CJK Radicals Supplement .. Enclosed CJK Letters and Months
242
- 11904 <= codePoint && codePoint <= 12871 && codePoint !== 12351 || // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A
243
- 12880 <= codePoint && codePoint <= 19903 || // CJK Unified Ideographs .. Yi Radicals
244
- 19968 <= codePoint && codePoint <= 42182 || // Hangul Jamo Extended-A
245
- 43360 <= codePoint && codePoint <= 43388 || // Hangul Syllables
246
- 44032 <= codePoint && codePoint <= 55203 || // CJK Compatibility Ideographs
247
- 63744 <= codePoint && codePoint <= 64255 || // Vertical Forms
248
- 65040 <= codePoint && codePoint <= 65049 || // CJK Compatibility Forms .. Small Form Variants
249
- 65072 <= codePoint && codePoint <= 65131 || // Halfwidth and Fullwidth Forms
250
- 65281 <= codePoint && codePoint <= 65376 || 65504 <= codePoint && codePoint <= 65510 || // Kana Supplement
251
- 110592 <= codePoint && codePoint <= 110593 || // Enclosed Ideographic Supplement
252
- 127488 <= codePoint && codePoint <= 127569 || // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane
253
- 131072 <= codePoint && codePoint <= 262141)) {
254
- return true;
255
- }
256
- return false;
257
- };
258
- module.exports = isFullwidthCodePoint;
259
- module.exports.default = isFullwidthCodePoint;
260
- }
261
- });
262
-
263
- // node_modules/ansi-align/node_modules/emoji-regex/index.js
264
- var require_emoji_regex2 = __commonJS({
265
- "node_modules/ansi-align/node_modules/emoji-regex/index.js"(exports, module) {
266
- "use strict";
267
- init_esm_shims();
268
- module.exports = function() {
269
- return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g;
270
- };
271
- }
272
- });
273
-
274
- // node_modules/ansi-align/node_modules/string-width/index.js
275
- var require_string_width = __commonJS({
276
- "node_modules/ansi-align/node_modules/string-width/index.js"(exports, module) {
277
- "use strict";
278
- init_esm_shims();
279
- var stripAnsi2 = require_strip_ansi();
280
- var isFullwidthCodePoint = require_is_fullwidth_code_point();
281
- var emojiRegex2 = require_emoji_regex2();
282
- var stringWidth2 = (string) => {
283
- if (typeof string !== "string" || string.length === 0) {
284
- return 0;
285
- }
286
- string = stripAnsi2(string);
287
- if (string.length === 0) {
288
- return 0;
289
- }
290
- string = string.replace(emojiRegex2(), " ");
291
- let width = 0;
292
- for (let i = 0; i < string.length; i++) {
293
- const code = string.codePointAt(i);
294
- if (code <= 31 || code >= 127 && code <= 159) {
295
- continue;
296
- }
297
- if (code >= 768 && code <= 879) {
298
- continue;
299
- }
300
- if (code > 65535) {
301
- i++;
302
- }
303
- width += isFullwidthCodePoint(code) ? 2 : 1;
304
- }
305
- return width;
306
- };
307
- module.exports = stringWidth2;
308
- module.exports.default = stringWidth2;
309
- }
310
- });
311
-
312
- // node_modules/ansi-align/index.js
313
- var require_ansi_align = __commonJS({
314
- "node_modules/ansi-align/index.js"(exports, module) {
315
- "use strict";
316
- init_esm_shims();
317
- var stringWidth2 = require_string_width();
318
- function ansiAlign2(text, opts) {
319
- if (!text) return text;
320
- opts = opts || {};
321
- const align = opts.align || "center";
322
- if (align === "left") return text;
323
- const split = opts.split || "\n";
324
- const pad = opts.pad || " ";
325
- const widthDiffFn = align !== "right" ? halfDiff : fullDiff;
326
- let returnString = false;
327
- if (!Array.isArray(text)) {
328
- returnString = true;
329
- text = String(text).split(split);
330
- }
331
- let width;
332
- let maxWidth = 0;
333
- text = text.map(function(str) {
334
- str = String(str);
335
- width = stringWidth2(str);
336
- maxWidth = Math.max(width, maxWidth);
337
- return {
338
- str,
339
- width
340
- };
341
- }).map(function(obj) {
342
- return new Array(widthDiffFn(maxWidth, obj.width) + 1).join(pad) + obj.str;
343
- });
344
- return returnString ? text.join(split) : text;
345
- }
346
- ansiAlign2.left = function left(text) {
347
- return ansiAlign2(text, { align: "left" });
348
- };
349
- ansiAlign2.center = function center(text) {
350
- return ansiAlign2(text, { align: "center" });
351
- };
352
- ansiAlign2.right = function right(text) {
353
- return ansiAlign2(text, { align: "right" });
354
- };
355
- module.exports = ansiAlign2;
356
- function halfDiff(maxWidth, curWidth) {
357
- return Math.floor((maxWidth - curWidth) / 2);
358
- }
359
- function fullDiff(maxWidth, curWidth) {
360
- return maxWidth - curWidth;
361
- }
362
- }
363
- });
364
-
365
- // src/core/utils/path.ts
366
- init_esm_shims();
367
- import * as path from "path";
368
- import { existsSync, readFileSync } from "fs";
369
- import { homedir } from "os";
370
- import { createRequire } from "module";
371
-
372
- // src/core/error/index.ts
373
- init_esm_shims();
374
- var ConfigurationError = class extends Error {
375
- /**
376
- * Creates an instance of ConfigurationError.
377
- * @param message - A human-readable description of the error.
378
- * @param configPath - Optional. The path to the configuration file related to the error.
379
- */
380
- constructor(message, configPath) {
381
- super(message);
382
- this.configPath = configPath;
383
- this.name = this.constructor.name;
384
- }
385
- };
386
- var ConfigFileNotFoundError = class extends ConfigurationError {
387
- /**
388
- * Creates an instance of ConfigFileNotFoundError.
389
- * @param configPath - The path to the configuration file that was not found.
390
- */
391
- constructor(configPath) {
392
- super(`Configuration file not found: ${configPath}`, configPath);
393
- }
394
- };
395
- var ConfigFileReadError = class extends ConfigurationError {
396
- /**
397
- * Creates an instance of ConfigFileReadError.
398
- * @param configPath - The path to the configuration file that could not be read.
399
- * @param cause - A string describing the underlying reason for the read failure (e.g., "Permission denied").
400
- */
401
- constructor(configPath, cause) {
402
- super(`Failed to read configuration file: ${cause}`, configPath);
403
- }
404
- };
405
- var ConfigParseError = class extends ConfigurationError {
406
- /**
407
- * Creates an instance of ConfigParseError.
408
- * @param configPath - The path to the configuration file that failed to parse.
409
- * @param cause - A string detailing the parsing error (e.g., "YAMLException: bad indentation").
410
- */
411
- constructor(configPath, cause) {
412
- super(`Failed to parse YAML configuration: ${cause}`, configPath);
413
- }
414
- };
415
- var ConfigEnvVarError = class extends ConfigurationError {
416
- /**
417
- * Creates an instance of ConfigEnvVarError.
418
- * @param configPath - The path to the configuration file where the environment variable issue occurred.
419
- * @param envVar - The name of the environment variable that caused the error.
420
- * @param cause - Optional. A string describing the specific reason for the expansion failure (e.g., "not defined").
421
- */
422
- constructor(configPath, envVar, cause) {
423
- const message = cause ? `Failed to expand environment variable '${envVar}': ${cause}` : `Environment variable '${envVar}' is required but not set`;
424
- super(message, configPath);
425
- this.envVar = envVar;
426
- }
427
- };
428
- var ConfigFileWriteError = class extends ConfigurationError {
429
- /**
430
- * Creates an instance of `ConfigFileWriteError`.
431
- * @param configPath - The path to the configuration file that could not be written.
432
- * @param cause - A string describing the underlying reason for the write failure (e.g., permissions, disk full).
433
- */
434
- constructor(configPath, cause) {
435
- super(`Failed to write configuration file '${configPath}': ${cause}`, configPath);
436
- this.name = "ConfigFileWriteError";
437
- }
438
- };
439
-
440
- // src/core/utils/path.ts
441
- var DEFAULT_CONFIG_PATH = "agents/agent.yml";
442
- function walkUpDirectories(startPath, predicate) {
443
- let currentPath = path.resolve(startPath);
444
- const rootPath = path.parse(currentPath).root;
445
- while (currentPath !== rootPath) {
446
- if (predicate(currentPath)) {
447
- return currentPath;
448
- }
449
- currentPath = path.dirname(currentPath);
450
- }
451
- return null;
452
- }
453
- function hasDextoDependency(dirPath) {
454
- const packageJsonPath = path.join(dirPath, "package.json");
455
- try {
456
- const pkg = JSON.parse(readFileSync(packageJsonPath, "utf-8"));
457
- if (pkg.name === "dexto") {
458
- return true;
459
- }
460
- const allDeps = {
461
- ...pkg.dependencies,
462
- ...pkg.devDependencies,
463
- ...pkg.peerDependencies
464
- };
465
- return "dexto" in allDeps;
466
- } catch {
467
- return false;
468
- }
469
- }
470
- function isDextoProject(startPath = process.cwd()) {
471
- return getDextoProjectRoot(startPath) !== null;
472
- }
473
- function getDextoProjectRoot(startPath = process.cwd()) {
474
- return walkUpDirectories(startPath, hasDextoDependency);
475
- }
476
- function getDextoPath(type, filename, startPath) {
477
- const projectRoot = getDextoProjectRoot(startPath);
478
- let basePath;
479
- if (projectRoot) {
480
- basePath = path.join(projectRoot, ".dexto", type);
481
- } else {
482
- basePath = path.join(homedir(), ".dexto", type);
483
- }
484
- return filename ? path.join(basePath, filename) : basePath;
485
- }
486
- function resolveConfigPath(configPath, startPath) {
487
- if (configPath) {
488
- return path.resolve(configPath);
489
- }
490
- const projectRoot = getDextoProjectRoot(startPath);
491
- if (projectRoot) {
492
- const configPaths = [
493
- path.join(projectRoot, "agents", "agent.yml"),
494
- // Standard
495
- path.join(projectRoot, "src", "agents", "agent.yml"),
496
- // Common
497
- path.join(projectRoot, "src", "dexto", "agents", "agent.yml"),
498
- // Test app structure
499
- path.join(projectRoot, ".dexto", "agent.yml"),
500
- // Hidden
501
- path.join(projectRoot, "agent.yml")
502
- // Root
503
- ];
504
- for (const configPath2 of configPaths) {
505
- if (existsSync(configPath2)) {
506
- return configPath2;
507
- }
508
- }
509
- throw new ConfigFileNotFoundError(
510
- `No agent.yml found in project. Searched: ${configPaths.join(", ")}`
511
- );
512
- } else {
513
- try {
514
- const bundledConfigPath = resolveBundledScript("agents/agent.yml");
515
- if (existsSync(bundledConfigPath)) {
516
- return bundledConfigPath;
517
- }
518
- } catch {
519
- }
520
- throw new ConfigFileNotFoundError(
521
- "Global CLI: No bundled config found and no explicit config provided"
522
- );
523
- }
524
- }
525
- function findPackageRoot(startPath = process.cwd()) {
526
- return walkUpDirectories(startPath, (dirPath) => {
527
- const pkgPath = path.join(dirPath, "package.json");
528
- return existsSync(pkgPath);
529
- });
530
- }
531
- function resolveBundledScript(scriptPath) {
532
- try {
533
- const require2 = createRequire(import.meta.url);
534
- const packageJsonPath = require2.resolve("dexto/package.json");
535
- const packageRoot = path.dirname(packageJsonPath);
536
- return path.resolve(packageRoot, scriptPath);
537
- } catch {
538
- const packageRoot = findPackageRoot();
539
- if (!packageRoot) {
540
- throw new Error(`Cannot resolve bundled script: ${scriptPath}`);
541
- }
542
- return path.resolve(packageRoot, scriptPath);
543
- }
544
- }
545
-
546
- // src/core/logger/logger.ts
547
- init_esm_shims();
548
- import * as winston from "winston";
549
-
550
- // node_modules/chalk/source/index.js
551
- init_esm_shims();
552
-
553
- // node_modules/chalk/source/vendor/ansi-styles/index.js
554
- init_esm_shims();
555
- var ANSI_BACKGROUND_OFFSET = 10;
556
- var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
557
- var wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
558
- var wrapAnsi16m = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`;
559
- var styles = {
560
- modifier: {
561
- reset: [0, 0],
562
- // 21 isn't widely supported and 22 does the same thing
563
- bold: [1, 22],
564
- dim: [2, 22],
565
- italic: [3, 23],
566
- underline: [4, 24],
567
- overline: [53, 55],
568
- inverse: [7, 27],
569
- hidden: [8, 28],
570
- strikethrough: [9, 29]
571
- },
572
- color: {
573
- black: [30, 39],
574
- red: [31, 39],
575
- green: [32, 39],
576
- yellow: [33, 39],
577
- blue: [34, 39],
578
- magenta: [35, 39],
579
- cyan: [36, 39],
580
- white: [37, 39],
581
- // Bright color
582
- blackBright: [90, 39],
583
- gray: [90, 39],
584
- // Alias of `blackBright`
585
- grey: [90, 39],
586
- // Alias of `blackBright`
587
- redBright: [91, 39],
588
- greenBright: [92, 39],
589
- yellowBright: [93, 39],
590
- blueBright: [94, 39],
591
- magentaBright: [95, 39],
592
- cyanBright: [96, 39],
593
- whiteBright: [97, 39]
594
- },
595
- bgColor: {
596
- bgBlack: [40, 49],
597
- bgRed: [41, 49],
598
- bgGreen: [42, 49],
599
- bgYellow: [43, 49],
600
- bgBlue: [44, 49],
601
- bgMagenta: [45, 49],
602
- bgCyan: [46, 49],
603
- bgWhite: [47, 49],
604
- // Bright color
605
- bgBlackBright: [100, 49],
606
- bgGray: [100, 49],
607
- // Alias of `bgBlackBright`
608
- bgGrey: [100, 49],
609
- // Alias of `bgBlackBright`
610
- bgRedBright: [101, 49],
611
- bgGreenBright: [102, 49],
612
- bgYellowBright: [103, 49],
613
- bgBlueBright: [104, 49],
614
- bgMagentaBright: [105, 49],
615
- bgCyanBright: [106, 49],
616
- bgWhiteBright: [107, 49]
617
- }
618
- };
619
- var modifierNames = Object.keys(styles.modifier);
620
- var foregroundColorNames = Object.keys(styles.color);
621
- var backgroundColorNames = Object.keys(styles.bgColor);
622
- var colorNames = [...foregroundColorNames, ...backgroundColorNames];
623
- function assembleStyles() {
624
- const codes = /* @__PURE__ */ new Map();
625
- for (const [groupName, group] of Object.entries(styles)) {
626
- for (const [styleName, style] of Object.entries(group)) {
627
- styles[styleName] = {
628
- open: `\x1B[${style[0]}m`,
629
- close: `\x1B[${style[1]}m`
630
- };
631
- group[styleName] = styles[styleName];
632
- codes.set(style[0], style[1]);
633
- }
634
- Object.defineProperty(styles, groupName, {
635
- value: group,
636
- enumerable: false
637
- });
638
- }
639
- Object.defineProperty(styles, "codes", {
640
- value: codes,
641
- enumerable: false
642
- });
643
- styles.color.close = "\x1B[39m";
644
- styles.bgColor.close = "\x1B[49m";
645
- styles.color.ansi = wrapAnsi16();
646
- styles.color.ansi256 = wrapAnsi256();
647
- styles.color.ansi16m = wrapAnsi16m();
648
- styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
649
- styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
650
- styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
651
- Object.defineProperties(styles, {
652
- rgbToAnsi256: {
653
- value(red, green, blue) {
654
- if (red === green && green === blue) {
655
- if (red < 8) {
656
- return 16;
657
- }
658
- if (red > 248) {
659
- return 231;
660
- }
661
- return Math.round((red - 8) / 247 * 24) + 232;
662
- }
663
- return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
664
- },
665
- enumerable: false
666
- },
667
- hexToRgb: {
668
- value(hex) {
669
- const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
670
- if (!matches) {
671
- return [0, 0, 0];
672
- }
673
- let [colorString] = matches;
674
- if (colorString.length === 3) {
675
- colorString = [...colorString].map((character) => character + character).join("");
676
- }
677
- const integer = Number.parseInt(colorString, 16);
678
- return [
679
- /* eslint-disable no-bitwise */
680
- integer >> 16 & 255,
681
- integer >> 8 & 255,
682
- integer & 255
683
- /* eslint-enable no-bitwise */
684
- ];
685
- },
686
- enumerable: false
687
- },
688
- hexToAnsi256: {
689
- value: (hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)),
690
- enumerable: false
691
- },
692
- ansi256ToAnsi: {
693
- value(code) {
694
- if (code < 8) {
695
- return 30 + code;
696
- }
697
- if (code < 16) {
698
- return 90 + (code - 8);
699
- }
700
- let red;
701
- let green;
702
- let blue;
703
- if (code >= 232) {
704
- red = ((code - 232) * 10 + 8) / 255;
705
- green = red;
706
- blue = red;
707
- } else {
708
- code -= 16;
709
- const remainder = code % 36;
710
- red = Math.floor(code / 36) / 5;
711
- green = Math.floor(remainder / 6) / 5;
712
- blue = remainder % 6 / 5;
713
- }
714
- const value = Math.max(red, green, blue) * 2;
715
- if (value === 0) {
716
- return 30;
717
- }
718
- let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
719
- if (value === 2) {
720
- result += 60;
721
- }
722
- return result;
723
- },
724
- enumerable: false
725
- },
726
- rgbToAnsi: {
727
- value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),
728
- enumerable: false
729
- },
730
- hexToAnsi: {
731
- value: (hex) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),
732
- enumerable: false
733
- }
734
- });
735
- return styles;
736
- }
737
- var ansiStyles = assembleStyles();
738
- var ansi_styles_default = ansiStyles;
739
-
740
- // node_modules/chalk/source/vendor/supports-color/index.js
741
- init_esm_shims();
742
- import process2 from "node:process";
743
- import os from "node:os";
744
- import tty from "node:tty";
745
- function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process2.argv) {
746
- const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
747
- const position = argv.indexOf(prefix + flag);
748
- const terminatorPosition = argv.indexOf("--");
749
- return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
750
- }
751
- var { env } = process2;
752
- var flagForceColor;
753
- if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
754
- flagForceColor = 0;
755
- } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
756
- flagForceColor = 1;
757
- }
758
- function envForceColor() {
759
- if ("FORCE_COLOR" in env) {
760
- if (env.FORCE_COLOR === "true") {
761
- return 1;
762
- }
763
- if (env.FORCE_COLOR === "false") {
764
- return 0;
765
- }
766
- return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
767
- }
768
- }
769
- function translateLevel(level) {
770
- if (level === 0) {
771
- return false;
772
- }
773
- return {
774
- level,
775
- hasBasic: true,
776
- has256: level >= 2,
777
- has16m: level >= 3
778
- };
779
- }
780
- function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
781
- const noFlagForceColor = envForceColor();
782
- if (noFlagForceColor !== void 0) {
783
- flagForceColor = noFlagForceColor;
784
- }
785
- const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
786
- if (forceColor === 0) {
787
- return 0;
788
- }
789
- if (sniffFlags) {
790
- if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
791
- return 3;
792
- }
793
- if (hasFlag("color=256")) {
794
- return 2;
795
- }
796
- }
797
- if ("TF_BUILD" in env && "AGENT_NAME" in env) {
798
- return 1;
799
- }
800
- if (haveStream && !streamIsTTY && forceColor === void 0) {
801
- return 0;
802
- }
803
- const min = forceColor || 0;
804
- if (env.TERM === "dumb") {
805
- return min;
806
- }
807
- if (process2.platform === "win32") {
808
- const osRelease = os.release().split(".");
809
- if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
810
- return Number(osRelease[2]) >= 14931 ? 3 : 2;
811
- }
812
- return 1;
813
- }
814
- if ("CI" in env) {
815
- if (["GITHUB_ACTIONS", "GITEA_ACTIONS", "CIRCLECI"].some((key) => key in env)) {
816
- return 3;
817
- }
818
- if (["TRAVIS", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
819
- return 1;
820
- }
821
- return min;
822
- }
823
- if ("TEAMCITY_VERSION" in env) {
824
- return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
825
- }
826
- if (env.COLORTERM === "truecolor") {
827
- return 3;
828
- }
829
- if (env.TERM === "xterm-kitty") {
830
- return 3;
831
- }
832
- if ("TERM_PROGRAM" in env) {
833
- const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
834
- switch (env.TERM_PROGRAM) {
835
- case "iTerm.app": {
836
- return version >= 3 ? 3 : 2;
837
- }
838
- case "Apple_Terminal": {
839
- return 2;
840
- }
841
- }
842
- }
843
- if (/-256(color)?$/i.test(env.TERM)) {
844
- return 2;
845
- }
846
- if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
847
- return 1;
848
- }
849
- if ("COLORTERM" in env) {
850
- return 1;
851
- }
852
- return min;
853
- }
854
- function createSupportsColor(stream, options = {}) {
855
- const level = _supportsColor(stream, {
856
- streamIsTTY: stream && stream.isTTY,
857
- ...options
858
- });
859
- return translateLevel(level);
860
- }
861
- var supportsColor = {
862
- stdout: createSupportsColor({ isTTY: tty.isatty(1) }),
863
- stderr: createSupportsColor({ isTTY: tty.isatty(2) })
864
- };
865
- var supports_color_default = supportsColor;
866
-
867
- // node_modules/chalk/source/utilities.js
868
- init_esm_shims();
869
- function stringReplaceAll(string, substring, replacer) {
870
- let index = string.indexOf(substring);
871
- if (index === -1) {
872
- return string;
873
- }
874
- const substringLength = substring.length;
875
- let endIndex = 0;
876
- let returnValue = "";
877
- do {
878
- returnValue += string.slice(endIndex, index) + substring + replacer;
879
- endIndex = index + substringLength;
880
- index = string.indexOf(substring, endIndex);
881
- } while (index !== -1);
882
- returnValue += string.slice(endIndex);
883
- return returnValue;
884
- }
885
- function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
886
- let endIndex = 0;
887
- let returnValue = "";
888
- do {
889
- const gotCR = string[index - 1] === "\r";
890
- returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
891
- endIndex = index + 1;
892
- index = string.indexOf("\n", endIndex);
893
- } while (index !== -1);
894
- returnValue += string.slice(endIndex);
895
- return returnValue;
896
- }
897
-
898
- // node_modules/chalk/source/index.js
899
- var { stdout: stdoutColor, stderr: stderrColor } = supports_color_default;
900
- var GENERATOR = Symbol("GENERATOR");
901
- var STYLER = Symbol("STYLER");
902
- var IS_EMPTY = Symbol("IS_EMPTY");
903
- var levelMapping = [
904
- "ansi",
905
- "ansi",
906
- "ansi256",
907
- "ansi16m"
908
- ];
909
- var styles2 = /* @__PURE__ */ Object.create(null);
910
- var applyOptions = (object, options = {}) => {
911
- if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
912
- throw new Error("The `level` option should be an integer from 0 to 3");
913
- }
914
- const colorLevel = stdoutColor ? stdoutColor.level : 0;
915
- object.level = options.level === void 0 ? colorLevel : options.level;
916
- };
917
- var chalkFactory = (options) => {
918
- const chalk2 = (...strings) => strings.join(" ");
919
- applyOptions(chalk2, options);
920
- Object.setPrototypeOf(chalk2, createChalk.prototype);
921
- return chalk2;
922
- };
923
- function createChalk(options) {
924
- return chalkFactory(options);
925
- }
926
- Object.setPrototypeOf(createChalk.prototype, Function.prototype);
927
- for (const [styleName, style] of Object.entries(ansi_styles_default)) {
928
- styles2[styleName] = {
929
- get() {
930
- const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
931
- Object.defineProperty(this, styleName, { value: builder });
932
- return builder;
933
- }
934
- };
935
- }
936
- styles2.visible = {
937
- get() {
938
- const builder = createBuilder(this, this[STYLER], true);
939
- Object.defineProperty(this, "visible", { value: builder });
940
- return builder;
941
- }
942
- };
943
- var getModelAnsi = (model, level, type, ...arguments_) => {
944
- if (model === "rgb") {
945
- if (level === "ansi16m") {
946
- return ansi_styles_default[type].ansi16m(...arguments_);
947
- }
948
- if (level === "ansi256") {
949
- return ansi_styles_default[type].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_));
950
- }
951
- return ansi_styles_default[type].ansi(ansi_styles_default.rgbToAnsi(...arguments_));
952
- }
953
- if (model === "hex") {
954
- return getModelAnsi("rgb", level, type, ...ansi_styles_default.hexToRgb(...arguments_));
955
- }
956
- return ansi_styles_default[type][model](...arguments_);
957
- };
958
- var usedModels = ["rgb", "hex", "ansi256"];
959
- for (const model of usedModels) {
960
- styles2[model] = {
961
- get() {
962
- const { level } = this;
963
- return function(...arguments_) {
964
- const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansi_styles_default.color.close, this[STYLER]);
965
- return createBuilder(this, styler, this[IS_EMPTY]);
966
- };
967
- }
968
- };
969
- const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
970
- styles2[bgModel] = {
971
- get() {
972
- const { level } = this;
973
- return function(...arguments_) {
974
- const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansi_styles_default.bgColor.close, this[STYLER]);
975
- return createBuilder(this, styler, this[IS_EMPTY]);
976
- };
977
- }
978
- };
979
- }
980
- var proto = Object.defineProperties(() => {
981
- }, {
982
- ...styles2,
983
- level: {
984
- enumerable: true,
985
- get() {
986
- return this[GENERATOR].level;
987
- },
988
- set(level) {
989
- this[GENERATOR].level = level;
990
- }
991
- }
992
- });
993
- var createStyler = (open, close, parent) => {
994
- let openAll;
995
- let closeAll;
996
- if (parent === void 0) {
997
- openAll = open;
998
- closeAll = close;
999
- } else {
1000
- openAll = parent.openAll + open;
1001
- closeAll = close + parent.closeAll;
1002
- }
1003
- return {
1004
- open,
1005
- close,
1006
- openAll,
1007
- closeAll,
1008
- parent
1009
- };
1010
- };
1011
- var createBuilder = (self, _styler, _isEmpty) => {
1012
- const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
1013
- Object.setPrototypeOf(builder, proto);
1014
- builder[GENERATOR] = self;
1015
- builder[STYLER] = _styler;
1016
- builder[IS_EMPTY] = _isEmpty;
1017
- return builder;
1018
- };
1019
- var applyStyle = (self, string) => {
1020
- if (self.level <= 0 || !string) {
1021
- return self[IS_EMPTY] ? "" : string;
1022
- }
1023
- let styler = self[STYLER];
1024
- if (styler === void 0) {
1025
- return string;
1026
- }
1027
- const { openAll, closeAll } = styler;
1028
- if (string.includes("\x1B")) {
1029
- while (styler !== void 0) {
1030
- string = stringReplaceAll(string, styler.close, styler.open);
1031
- styler = styler.parent;
1032
- }
1033
- }
1034
- const lfIndex = string.indexOf("\n");
1035
- if (lfIndex !== -1) {
1036
- string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
1037
- }
1038
- return openAll + string + closeAll;
1039
- };
1040
- Object.defineProperties(createChalk.prototype, styles2);
1041
- var chalk = createChalk();
1042
- var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
1043
- var source_default = chalk;
1044
-
1045
- // node_modules/boxen/index.js
1046
- init_esm_shims();
1047
- import process3 from "node:process";
1048
-
1049
- // node_modules/string-width/index.js
1050
- init_esm_shims();
1051
-
1052
- // node_modules/strip-ansi/index.js
1053
- init_esm_shims();
1054
-
1055
- // node_modules/ansi-regex/index.js
1056
- init_esm_shims();
1057
- function ansiRegex({ onlyFirst = false } = {}) {
1058
- const ST = "(?:\\u0007|\\u001B\\u005C|\\u009C)";
1059
- const pattern = [
1060
- `[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?${ST})`,
1061
- "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"
1062
- ].join("|");
1063
- return new RegExp(pattern, onlyFirst ? void 0 : "g");
1064
- }
1065
-
1066
- // node_modules/strip-ansi/index.js
1067
- var regex = ansiRegex();
1068
- function stripAnsi(string) {
1069
- if (typeof string !== "string") {
1070
- throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
1071
- }
1072
- return string.replace(regex, "");
1073
- }
1074
-
1075
- // node_modules/string-width/index.js
1076
- var import_eastasianwidth = __toESM(require_eastasianwidth(), 1);
1077
- var import_emoji_regex = __toESM(require_emoji_regex(), 1);
1078
- function stringWidth(string, options = {}) {
1079
- if (typeof string !== "string" || string.length === 0) {
1080
- return 0;
1081
- }
1082
- options = {
1083
- ambiguousIsNarrow: true,
1084
- ...options
1085
- };
1086
- string = stripAnsi(string);
1087
- if (string.length === 0) {
1088
- return 0;
1089
- }
1090
- string = string.replace((0, import_emoji_regex.default)(), " ");
1091
- const ambiguousCharacterWidth = options.ambiguousIsNarrow ? 1 : 2;
1092
- let width = 0;
1093
- for (const character of string) {
1094
- const codePoint = character.codePointAt(0);
1095
- if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) {
1096
- continue;
1097
- }
1098
- if (codePoint >= 768 && codePoint <= 879) {
1099
- continue;
1100
- }
1101
- const code = import_eastasianwidth.default.eastAsianWidth(character);
1102
- switch (code) {
1103
- case "F":
1104
- case "W":
1105
- width += 2;
1106
- break;
1107
- case "A":
1108
- width += ambiguousCharacterWidth;
1109
- break;
1110
- default:
1111
- width += 1;
1112
- }
1113
- }
1114
- return width;
1115
- }
1116
-
1117
- // node_modules/widest-line/index.js
1118
- init_esm_shims();
1119
- function widestLine(string) {
1120
- let lineWidth = 0;
1121
- for (const line of string.split("\n")) {
1122
- lineWidth = Math.max(lineWidth, stringWidth(line));
1123
- }
1124
- return lineWidth;
1125
- }
1126
-
1127
- // node_modules/boxen/index.js
1128
- var import_cli_boxes = __toESM(require_cli_boxes(), 1);
1129
-
1130
- // node_modules/camelcase/index.js
1131
- init_esm_shims();
1132
- var UPPERCASE = /[\p{Lu}]/u;
1133
- var LOWERCASE = /[\p{Ll}]/u;
1134
- var LEADING_CAPITAL = /^[\p{Lu}](?![\p{Lu}])/gu;
1135
- var IDENTIFIER = /([\p{Alpha}\p{N}_]|$)/u;
1136
- var SEPARATORS = /[_.\- ]+/;
1137
- var LEADING_SEPARATORS = new RegExp("^" + SEPARATORS.source);
1138
- var SEPARATORS_AND_IDENTIFIER = new RegExp(SEPARATORS.source + IDENTIFIER.source, "gu");
1139
- var NUMBERS_AND_IDENTIFIER = new RegExp("\\d+" + IDENTIFIER.source, "gu");
1140
- var preserveCamelCase = (string, toLowerCase, toUpperCase, preserveConsecutiveUppercase2) => {
1141
- let isLastCharLower = false;
1142
- let isLastCharUpper = false;
1143
- let isLastLastCharUpper = false;
1144
- let isLastLastCharPreserved = false;
1145
- for (let index = 0; index < string.length; index++) {
1146
- const character = string[index];
1147
- isLastLastCharPreserved = index > 2 ? string[index - 3] === "-" : true;
1148
- if (isLastCharLower && UPPERCASE.test(character)) {
1149
- string = string.slice(0, index) + "-" + string.slice(index);
1150
- isLastCharLower = false;
1151
- isLastLastCharUpper = isLastCharUpper;
1152
- isLastCharUpper = true;
1153
- index++;
1154
- } else if (isLastCharUpper && isLastLastCharUpper && LOWERCASE.test(character) && (!isLastLastCharPreserved || preserveConsecutiveUppercase2)) {
1155
- string = string.slice(0, index - 1) + "-" + string.slice(index - 1);
1156
- isLastLastCharUpper = isLastCharUpper;
1157
- isLastCharUpper = false;
1158
- isLastCharLower = true;
1159
- } else {
1160
- isLastCharLower = toLowerCase(character) === character && toUpperCase(character) !== character;
1161
- isLastLastCharUpper = isLastCharUpper;
1162
- isLastCharUpper = toUpperCase(character) === character && toLowerCase(character) !== character;
1163
- }
1164
- }
1165
- return string;
1166
- };
1167
- var preserveConsecutiveUppercase = (input, toLowerCase) => {
1168
- LEADING_CAPITAL.lastIndex = 0;
1169
- return input.replace(LEADING_CAPITAL, (m1) => toLowerCase(m1));
1170
- };
1171
- var postProcess = (input, toUpperCase) => {
1172
- SEPARATORS_AND_IDENTIFIER.lastIndex = 0;
1173
- NUMBERS_AND_IDENTIFIER.lastIndex = 0;
1174
- return input.replace(SEPARATORS_AND_IDENTIFIER, (_, identifier) => toUpperCase(identifier)).replace(NUMBERS_AND_IDENTIFIER, (m) => toUpperCase(m));
1175
- };
1176
- function camelCase(input, options) {
1177
- if (!(typeof input === "string" || Array.isArray(input))) {
1178
- throw new TypeError("Expected the input to be `string | string[]`");
1179
- }
1180
- options = {
1181
- pascalCase: false,
1182
- preserveConsecutiveUppercase: false,
1183
- ...options
1184
- };
1185
- if (Array.isArray(input)) {
1186
- input = input.map((x) => x.trim()).filter((x) => x.length).join("-");
1187
- } else {
1188
- input = input.trim();
1189
- }
1190
- if (input.length === 0) {
1191
- return "";
1192
- }
1193
- const toLowerCase = options.locale === false ? (string) => string.toLowerCase() : (string) => string.toLocaleLowerCase(options.locale);
1194
- const toUpperCase = options.locale === false ? (string) => string.toUpperCase() : (string) => string.toLocaleUpperCase(options.locale);
1195
- if (input.length === 1) {
1196
- if (SEPARATORS.test(input)) {
1197
- return "";
1198
- }
1199
- return options.pascalCase ? toUpperCase(input) : toLowerCase(input);
1200
- }
1201
- const hasUpperCase = input !== toLowerCase(input);
1202
- if (hasUpperCase) {
1203
- input = preserveCamelCase(input, toLowerCase, toUpperCase, options.preserveConsecutiveUppercase);
1204
- }
1205
- input = input.replace(LEADING_SEPARATORS, "");
1206
- input = options.preserveConsecutiveUppercase ? preserveConsecutiveUppercase(input, toLowerCase) : toLowerCase(input);
1207
- if (options.pascalCase) {
1208
- input = toUpperCase(input.charAt(0)) + input.slice(1);
1209
- }
1210
- return postProcess(input, toUpperCase);
1211
- }
1212
-
1213
- // node_modules/boxen/index.js
1214
- var import_ansi_align = __toESM(require_ansi_align(), 1);
1215
-
1216
- // node_modules/wrap-ansi/index.js
1217
- init_esm_shims();
1218
-
1219
- // node_modules/ansi-styles/index.js
1220
- init_esm_shims();
1221
- var ANSI_BACKGROUND_OFFSET2 = 10;
1222
- var wrapAnsi162 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
1223
- var wrapAnsi2562 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
1224
- var wrapAnsi16m2 = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`;
1225
- var styles3 = {
1226
- modifier: {
1227
- reset: [0, 0],
1228
- // 21 isn't widely supported and 22 does the same thing
1229
- bold: [1, 22],
1230
- dim: [2, 22],
1231
- italic: [3, 23],
1232
- underline: [4, 24],
1233
- overline: [53, 55],
1234
- inverse: [7, 27],
1235
- hidden: [8, 28],
1236
- strikethrough: [9, 29]
1237
- },
1238
- color: {
1239
- black: [30, 39],
1240
- red: [31, 39],
1241
- green: [32, 39],
1242
- yellow: [33, 39],
1243
- blue: [34, 39],
1244
- magenta: [35, 39],
1245
- cyan: [36, 39],
1246
- white: [37, 39],
1247
- // Bright color
1248
- blackBright: [90, 39],
1249
- gray: [90, 39],
1250
- // Alias of `blackBright`
1251
- grey: [90, 39],
1252
- // Alias of `blackBright`
1253
- redBright: [91, 39],
1254
- greenBright: [92, 39],
1255
- yellowBright: [93, 39],
1256
- blueBright: [94, 39],
1257
- magentaBright: [95, 39],
1258
- cyanBright: [96, 39],
1259
- whiteBright: [97, 39]
1260
- },
1261
- bgColor: {
1262
- bgBlack: [40, 49],
1263
- bgRed: [41, 49],
1264
- bgGreen: [42, 49],
1265
- bgYellow: [43, 49],
1266
- bgBlue: [44, 49],
1267
- bgMagenta: [45, 49],
1268
- bgCyan: [46, 49],
1269
- bgWhite: [47, 49],
1270
- // Bright color
1271
- bgBlackBright: [100, 49],
1272
- bgGray: [100, 49],
1273
- // Alias of `bgBlackBright`
1274
- bgGrey: [100, 49],
1275
- // Alias of `bgBlackBright`
1276
- bgRedBright: [101, 49],
1277
- bgGreenBright: [102, 49],
1278
- bgYellowBright: [103, 49],
1279
- bgBlueBright: [104, 49],
1280
- bgMagentaBright: [105, 49],
1281
- bgCyanBright: [106, 49],
1282
- bgWhiteBright: [107, 49]
1283
- }
1284
- };
1285
- var modifierNames2 = Object.keys(styles3.modifier);
1286
- var foregroundColorNames2 = Object.keys(styles3.color);
1287
- var backgroundColorNames2 = Object.keys(styles3.bgColor);
1288
- var colorNames2 = [...foregroundColorNames2, ...backgroundColorNames2];
1289
- function assembleStyles2() {
1290
- const codes = /* @__PURE__ */ new Map();
1291
- for (const [groupName, group] of Object.entries(styles3)) {
1292
- for (const [styleName, style] of Object.entries(group)) {
1293
- styles3[styleName] = {
1294
- open: `\x1B[${style[0]}m`,
1295
- close: `\x1B[${style[1]}m`
1296
- };
1297
- group[styleName] = styles3[styleName];
1298
- codes.set(style[0], style[1]);
1299
- }
1300
- Object.defineProperty(styles3, groupName, {
1301
- value: group,
1302
- enumerable: false
1303
- });
1304
- }
1305
- Object.defineProperty(styles3, "codes", {
1306
- value: codes,
1307
- enumerable: false
1308
- });
1309
- styles3.color.close = "\x1B[39m";
1310
- styles3.bgColor.close = "\x1B[49m";
1311
- styles3.color.ansi = wrapAnsi162();
1312
- styles3.color.ansi256 = wrapAnsi2562();
1313
- styles3.color.ansi16m = wrapAnsi16m2();
1314
- styles3.bgColor.ansi = wrapAnsi162(ANSI_BACKGROUND_OFFSET2);
1315
- styles3.bgColor.ansi256 = wrapAnsi2562(ANSI_BACKGROUND_OFFSET2);
1316
- styles3.bgColor.ansi16m = wrapAnsi16m2(ANSI_BACKGROUND_OFFSET2);
1317
- Object.defineProperties(styles3, {
1318
- rgbToAnsi256: {
1319
- value: (red, green, blue) => {
1320
- if (red === green && green === blue) {
1321
- if (red < 8) {
1322
- return 16;
1323
- }
1324
- if (red > 248) {
1325
- return 231;
1326
- }
1327
- return Math.round((red - 8) / 247 * 24) + 232;
1328
- }
1329
- return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
1330
- },
1331
- enumerable: false
1332
- },
1333
- hexToRgb: {
1334
- value: (hex) => {
1335
- const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
1336
- if (!matches) {
1337
- return [0, 0, 0];
1338
- }
1339
- let [colorString] = matches;
1340
- if (colorString.length === 3) {
1341
- colorString = [...colorString].map((character) => character + character).join("");
1342
- }
1343
- const integer = Number.parseInt(colorString, 16);
1344
- return [
1345
- /* eslint-disable no-bitwise */
1346
- integer >> 16 & 255,
1347
- integer >> 8 & 255,
1348
- integer & 255
1349
- /* eslint-enable no-bitwise */
1350
- ];
1351
- },
1352
- enumerable: false
1353
- },
1354
- hexToAnsi256: {
1355
- value: (hex) => styles3.rgbToAnsi256(...styles3.hexToRgb(hex)),
1356
- enumerable: false
1357
- },
1358
- ansi256ToAnsi: {
1359
- value: (code) => {
1360
- if (code < 8) {
1361
- return 30 + code;
1362
- }
1363
- if (code < 16) {
1364
- return 90 + (code - 8);
1365
- }
1366
- let red;
1367
- let green;
1368
- let blue;
1369
- if (code >= 232) {
1370
- red = ((code - 232) * 10 + 8) / 255;
1371
- green = red;
1372
- blue = red;
1373
- } else {
1374
- code -= 16;
1375
- const remainder = code % 36;
1376
- red = Math.floor(code / 36) / 5;
1377
- green = Math.floor(remainder / 6) / 5;
1378
- blue = remainder % 6 / 5;
1379
- }
1380
- const value = Math.max(red, green, blue) * 2;
1381
- if (value === 0) {
1382
- return 30;
1383
- }
1384
- let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
1385
- if (value === 2) {
1386
- result += 60;
1387
- }
1388
- return result;
1389
- },
1390
- enumerable: false
1391
- },
1392
- rgbToAnsi: {
1393
- value: (red, green, blue) => styles3.ansi256ToAnsi(styles3.rgbToAnsi256(red, green, blue)),
1394
- enumerable: false
1395
- },
1396
- hexToAnsi: {
1397
- value: (hex) => styles3.ansi256ToAnsi(styles3.hexToAnsi256(hex)),
1398
- enumerable: false
1399
- }
1400
- });
1401
- return styles3;
1402
- }
1403
- var ansiStyles2 = assembleStyles2();
1404
- var ansi_styles_default2 = ansiStyles2;
1405
-
1406
- // node_modules/wrap-ansi/index.js
1407
- var ESCAPES = /* @__PURE__ */ new Set([
1408
- "\x1B",
1409
- "\x9B"
1410
- ]);
1411
- var END_CODE = 39;
1412
- var ANSI_ESCAPE_BELL = "\x07";
1413
- var ANSI_CSI = "[";
1414
- var ANSI_OSC = "]";
1415
- var ANSI_SGR_TERMINATOR = "m";
1416
- var ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;
1417
- var wrapAnsiCode = (code) => `${ESCAPES.values().next().value}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;
1418
- var wrapAnsiHyperlink = (uri) => `${ESCAPES.values().next().value}${ANSI_ESCAPE_LINK}${uri}${ANSI_ESCAPE_BELL}`;
1419
- var wordLengths = (string) => string.split(" ").map((character) => stringWidth(character));
1420
- var wrapWord = (rows, word, columns) => {
1421
- const characters = [...word];
1422
- let isInsideEscape = false;
1423
- let isInsideLinkEscape = false;
1424
- let visible = stringWidth(stripAnsi(rows[rows.length - 1]));
1425
- for (const [index, character] of characters.entries()) {
1426
- const characterLength = stringWidth(character);
1427
- if (visible + characterLength <= columns) {
1428
- rows[rows.length - 1] += character;
1429
- } else {
1430
- rows.push(character);
1431
- visible = 0;
1432
- }
1433
- if (ESCAPES.has(character)) {
1434
- isInsideEscape = true;
1435
- isInsideLinkEscape = characters.slice(index + 1).join("").startsWith(ANSI_ESCAPE_LINK);
1436
- }
1437
- if (isInsideEscape) {
1438
- if (isInsideLinkEscape) {
1439
- if (character === ANSI_ESCAPE_BELL) {
1440
- isInsideEscape = false;
1441
- isInsideLinkEscape = false;
1442
- }
1443
- } else if (character === ANSI_SGR_TERMINATOR) {
1444
- isInsideEscape = false;
1445
- }
1446
- continue;
1447
- }
1448
- visible += characterLength;
1449
- if (visible === columns && index < characters.length - 1) {
1450
- rows.push("");
1451
- visible = 0;
1452
- }
1453
- }
1454
- if (!visible && rows[rows.length - 1].length > 0 && rows.length > 1) {
1455
- rows[rows.length - 2] += rows.pop();
1456
- }
1457
- };
1458
- var stringVisibleTrimSpacesRight = (string) => {
1459
- const words = string.split(" ");
1460
- let last = words.length;
1461
- while (last > 0) {
1462
- if (stringWidth(words[last - 1]) > 0) {
1463
- break;
1464
- }
1465
- last--;
1466
- }
1467
- if (last === words.length) {
1468
- return string;
1469
- }
1470
- return words.slice(0, last).join(" ") + words.slice(last).join("");
1471
- };
1472
- var exec = (string, columns, options = {}) => {
1473
- if (options.trim !== false && string.trim() === "") {
1474
- return "";
1475
- }
1476
- let returnValue = "";
1477
- let escapeCode;
1478
- let escapeUrl;
1479
- const lengths = wordLengths(string);
1480
- let rows = [""];
1481
- for (const [index, word] of string.split(" ").entries()) {
1482
- if (options.trim !== false) {
1483
- rows[rows.length - 1] = rows[rows.length - 1].trimStart();
1484
- }
1485
- let rowLength = stringWidth(rows[rows.length - 1]);
1486
- if (index !== 0) {
1487
- if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {
1488
- rows.push("");
1489
- rowLength = 0;
1490
- }
1491
- if (rowLength > 0 || options.trim === false) {
1492
- rows[rows.length - 1] += " ";
1493
- rowLength++;
1494
- }
1495
- }
1496
- if (options.hard && lengths[index] > columns) {
1497
- const remainingColumns = columns - rowLength;
1498
- const breaksStartingThisLine = 1 + Math.floor((lengths[index] - remainingColumns - 1) / columns);
1499
- const breaksStartingNextLine = Math.floor((lengths[index] - 1) / columns);
1500
- if (breaksStartingNextLine < breaksStartingThisLine) {
1501
- rows.push("");
1502
- }
1503
- wrapWord(rows, word, columns);
1504
- continue;
1505
- }
1506
- if (rowLength + lengths[index] > columns && rowLength > 0 && lengths[index] > 0) {
1507
- if (options.wordWrap === false && rowLength < columns) {
1508
- wrapWord(rows, word, columns);
1509
- continue;
1510
- }
1511
- rows.push("");
1512
- }
1513
- if (rowLength + lengths[index] > columns && options.wordWrap === false) {
1514
- wrapWord(rows, word, columns);
1515
- continue;
1516
- }
1517
- rows[rows.length - 1] += word;
1518
- }
1519
- if (options.trim !== false) {
1520
- rows = rows.map((row) => stringVisibleTrimSpacesRight(row));
1521
- }
1522
- const pre = [...rows.join("\n")];
1523
- for (const [index, character] of pre.entries()) {
1524
- returnValue += character;
1525
- if (ESCAPES.has(character)) {
1526
- const { groups } = new RegExp(`(?:\\${ANSI_CSI}(?<code>\\d+)m|\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`).exec(pre.slice(index).join("")) || { groups: {} };
1527
- if (groups.code !== void 0) {
1528
- const code2 = Number.parseFloat(groups.code);
1529
- escapeCode = code2 === END_CODE ? void 0 : code2;
1530
- } else if (groups.uri !== void 0) {
1531
- escapeUrl = groups.uri.length === 0 ? void 0 : groups.uri;
1532
- }
1533
- }
1534
- const code = ansi_styles_default2.codes.get(Number(escapeCode));
1535
- if (pre[index + 1] === "\n") {
1536
- if (escapeUrl) {
1537
- returnValue += wrapAnsiHyperlink("");
1538
- }
1539
- if (escapeCode && code) {
1540
- returnValue += wrapAnsiCode(code);
1541
- }
1542
- } else if (character === "\n") {
1543
- if (escapeCode && code) {
1544
- returnValue += wrapAnsiCode(escapeCode);
1545
- }
1546
- if (escapeUrl) {
1547
- returnValue += wrapAnsiHyperlink(escapeUrl);
1548
- }
1549
- }
1550
- }
1551
- return returnValue;
1552
- };
1553
- function wrapAnsi(string, columns, options) {
1554
- return String(string).normalize().replace(/\r\n/g, "\n").split("\n").map((line) => exec(line, columns, options)).join("\n");
1555
- }
1556
-
1557
- // node_modules/boxen/index.js
1558
- var import_cli_boxes2 = __toESM(require_cli_boxes(), 1);
1559
- var NEWLINE = "\n";
1560
- var PAD = " ";
1561
- var NONE = "none";
1562
- var terminalColumns = () => {
1563
- const { env: env2, stdout, stderr } = process3;
1564
- if (stdout?.columns) {
1565
- return stdout.columns;
1566
- }
1567
- if (stderr?.columns) {
1568
- return stderr.columns;
1569
- }
1570
- if (env2.COLUMNS) {
1571
- return Number.parseInt(env2.COLUMNS, 10);
1572
- }
1573
- return 80;
1574
- };
1575
- var getObject = (detail) => typeof detail === "number" ? {
1576
- top: detail,
1577
- right: detail * 3,
1578
- bottom: detail,
1579
- left: detail * 3
1580
- } : {
1581
- top: 0,
1582
- right: 0,
1583
- bottom: 0,
1584
- left: 0,
1585
- ...detail
1586
- };
1587
- var getBorderWidth = (borderStyle) => borderStyle === NONE ? 0 : 2;
1588
- var getBorderChars = (borderStyle) => {
1589
- const sides = [
1590
- "topLeft",
1591
- "topRight",
1592
- "bottomRight",
1593
- "bottomLeft",
1594
- "left",
1595
- "right",
1596
- "top",
1597
- "bottom"
1598
- ];
1599
- let characters;
1600
- if (borderStyle === NONE) {
1601
- borderStyle = {};
1602
- for (const side of sides) {
1603
- borderStyle[side] = "";
1604
- }
1605
- }
1606
- if (typeof borderStyle === "string") {
1607
- characters = import_cli_boxes.default[borderStyle];
1608
- if (!characters) {
1609
- throw new TypeError(`Invalid border style: ${borderStyle}`);
1610
- }
1611
- } else {
1612
- if (typeof borderStyle?.vertical === "string") {
1613
- borderStyle.left = borderStyle.vertical;
1614
- borderStyle.right = borderStyle.vertical;
1615
- }
1616
- if (typeof borderStyle?.horizontal === "string") {
1617
- borderStyle.top = borderStyle.horizontal;
1618
- borderStyle.bottom = borderStyle.horizontal;
1619
- }
1620
- for (const side of sides) {
1621
- if (borderStyle[side] === null || typeof borderStyle[side] !== "string") {
1622
- throw new TypeError(`Invalid border style: ${side}`);
1623
- }
1624
- }
1625
- characters = borderStyle;
1626
- }
1627
- return characters;
1628
- };
1629
- var makeTitle = (text, horizontal, alignment) => {
1630
- let title = "";
1631
- const textWidth = stringWidth(text);
1632
- switch (alignment) {
1633
- case "left": {
1634
- title = text + horizontal.slice(textWidth);
1635
- break;
1636
- }
1637
- case "right": {
1638
- title = horizontal.slice(textWidth) + text;
1639
- break;
1640
- }
1641
- default: {
1642
- horizontal = horizontal.slice(textWidth);
1643
- if (horizontal.length % 2 === 1) {
1644
- horizontal = horizontal.slice(Math.floor(horizontal.length / 2));
1645
- title = horizontal.slice(1) + text + horizontal;
1646
- } else {
1647
- horizontal = horizontal.slice(horizontal.length / 2);
1648
- title = horizontal + text + horizontal;
1649
- }
1650
- break;
1651
- }
1652
- }
1653
- return title;
1654
- };
1655
- var makeContentText = (text, { padding, width, textAlignment, height }) => {
1656
- text = (0, import_ansi_align.default)(text, { align: textAlignment });
1657
- let lines = text.split(NEWLINE);
1658
- const textWidth = widestLine(text);
1659
- const max = width - padding.left - padding.right;
1660
- if (textWidth > max) {
1661
- const newLines = [];
1662
- for (const line of lines) {
1663
- const createdLines = wrapAnsi(line, max, { hard: true });
1664
- const alignedLines = (0, import_ansi_align.default)(createdLines, { align: textAlignment });
1665
- const alignedLinesArray = alignedLines.split("\n");
1666
- const longestLength = Math.max(...alignedLinesArray.map((s) => stringWidth(s)));
1667
- for (const alignedLine of alignedLinesArray) {
1668
- let paddedLine;
1669
- switch (textAlignment) {
1670
- case "center": {
1671
- paddedLine = PAD.repeat((max - longestLength) / 2) + alignedLine;
1672
- break;
1673
- }
1674
- case "right": {
1675
- paddedLine = PAD.repeat(max - longestLength) + alignedLine;
1676
- break;
1677
- }
1678
- default: {
1679
- paddedLine = alignedLine;
1680
- break;
1681
- }
1682
- }
1683
- newLines.push(paddedLine);
1684
- }
1685
- }
1686
- lines = newLines;
1687
- }
1688
- if (textAlignment === "center" && textWidth < max) {
1689
- lines = lines.map((line) => PAD.repeat((max - textWidth) / 2) + line);
1690
- } else if (textAlignment === "right" && textWidth < max) {
1691
- lines = lines.map((line) => PAD.repeat(max - textWidth) + line);
1692
- }
1693
- const paddingLeft = PAD.repeat(padding.left);
1694
- const paddingRight = PAD.repeat(padding.right);
1695
- lines = lines.map((line) => paddingLeft + line + paddingRight);
1696
- lines = lines.map((line) => {
1697
- if (width - stringWidth(line) > 0) {
1698
- switch (textAlignment) {
1699
- case "center": {
1700
- return line + PAD.repeat(width - stringWidth(line));
1701
- }
1702
- case "right": {
1703
- return line + PAD.repeat(width - stringWidth(line));
1704
- }
1705
- default: {
1706
- return line + PAD.repeat(width - stringWidth(line));
1707
- }
1708
- }
1709
- }
1710
- return line;
1711
- });
1712
- if (padding.top > 0) {
1713
- lines = [...Array.from({ length: padding.top }).fill(PAD.repeat(width)), ...lines];
1714
- }
1715
- if (padding.bottom > 0) {
1716
- lines = [...lines, ...Array.from({ length: padding.bottom }).fill(PAD.repeat(width))];
1717
- }
1718
- if (height && lines.length > height) {
1719
- lines = lines.slice(0, height);
1720
- } else if (height && lines.length < height) {
1721
- lines = [...lines, ...Array.from({ length: height - lines.length }).fill(PAD.repeat(width))];
1722
- }
1723
- return lines.join(NEWLINE);
1724
- };
1725
- var boxContent = (content, contentWidth, options) => {
1726
- const colorizeBorder = (border) => {
1727
- const newBorder = options.borderColor ? getColorFn(options.borderColor)(border) : border;
1728
- return options.dimBorder ? source_default.dim(newBorder) : newBorder;
1729
- };
1730
- const colorizeContent = (content2) => options.backgroundColor ? getBGColorFn(options.backgroundColor)(content2) : content2;
1731
- const chars = getBorderChars(options.borderStyle);
1732
- const columns = terminalColumns();
1733
- let marginLeft = PAD.repeat(options.margin.left);
1734
- if (options.float === "center") {
1735
- const marginWidth = Math.max((columns - contentWidth - getBorderWidth(options.borderStyle)) / 2, 0);
1736
- marginLeft = PAD.repeat(marginWidth);
1737
- } else if (options.float === "right") {
1738
- const marginWidth = Math.max(columns - contentWidth - options.margin.right - getBorderWidth(options.borderStyle), 0);
1739
- marginLeft = PAD.repeat(marginWidth);
1740
- }
1741
- let result = "";
1742
- if (options.margin.top) {
1743
- result += NEWLINE.repeat(options.margin.top);
1744
- }
1745
- if (options.borderStyle !== NONE || options.title) {
1746
- result += colorizeBorder(marginLeft + chars.topLeft + (options.title ? makeTitle(options.title, chars.top.repeat(contentWidth), options.titleAlignment) : chars.top.repeat(contentWidth)) + chars.topRight) + NEWLINE;
1747
- }
1748
- const lines = content.split(NEWLINE);
1749
- result += lines.map((line) => marginLeft + colorizeBorder(chars.left) + colorizeContent(line) + colorizeBorder(chars.right)).join(NEWLINE);
1750
- if (options.borderStyle !== NONE) {
1751
- result += NEWLINE + colorizeBorder(marginLeft + chars.bottomLeft + chars.bottom.repeat(contentWidth) + chars.bottomRight);
1752
- }
1753
- if (options.margin.bottom) {
1754
- result += NEWLINE.repeat(options.margin.bottom);
1755
- }
1756
- return result;
1757
- };
1758
- var sanitizeOptions = (options) => {
1759
- if (options.fullscreen && process3?.stdout) {
1760
- let newDimensions = [process3.stdout.columns, process3.stdout.rows];
1761
- if (typeof options.fullscreen === "function") {
1762
- newDimensions = options.fullscreen(...newDimensions);
1763
- }
1764
- if (!options.width) {
1765
- options.width = newDimensions[0];
1766
- }
1767
- if (!options.height) {
1768
- options.height = newDimensions[1];
1769
- }
1770
- }
1771
- if (options.width) {
1772
- options.width = Math.max(1, options.width - getBorderWidth(options.borderStyle));
1773
- }
1774
- if (options.height) {
1775
- options.height = Math.max(1, options.height - getBorderWidth(options.borderStyle));
1776
- }
1777
- return options;
1778
- };
1779
- var formatTitle = (title, borderStyle) => borderStyle === NONE ? title : ` ${title} `;
1780
- var determineDimensions = (text, options) => {
1781
- options = sanitizeOptions(options);
1782
- const widthOverride = options.width !== void 0;
1783
- const columns = terminalColumns();
1784
- const borderWidth = getBorderWidth(options.borderStyle);
1785
- const maxWidth = columns - options.margin.left - options.margin.right - borderWidth;
1786
- const widest = widestLine(wrapAnsi(text, columns - borderWidth, { hard: true, trim: false })) + options.padding.left + options.padding.right;
1787
- if (options.title && widthOverride) {
1788
- options.title = options.title.slice(0, Math.max(0, options.width - 2));
1789
- if (options.title) {
1790
- options.title = formatTitle(options.title, options.borderStyle);
1791
- }
1792
- } else if (options.title) {
1793
- options.title = options.title.slice(0, Math.max(0, maxWidth - 2));
1794
- if (options.title) {
1795
- options.title = formatTitle(options.title, options.borderStyle);
1796
- if (stringWidth(options.title) > widest) {
1797
- options.width = stringWidth(options.title);
1798
- }
1799
- }
1800
- }
1801
- options.width = options.width ? options.width : widest;
1802
- if (!widthOverride) {
1803
- if (options.margin.left && options.margin.right && options.width > maxWidth) {
1804
- const spaceForMargins = columns - options.width - borderWidth;
1805
- const multiplier = spaceForMargins / (options.margin.left + options.margin.right);
1806
- options.margin.left = Math.max(0, Math.floor(options.margin.left * multiplier));
1807
- options.margin.right = Math.max(0, Math.floor(options.margin.right * multiplier));
1808
- }
1809
- options.width = Math.min(options.width, columns - borderWidth - options.margin.left - options.margin.right);
1810
- }
1811
- if (options.width - (options.padding.left + options.padding.right) <= 0) {
1812
- options.padding.left = 0;
1813
- options.padding.right = 0;
1814
- }
1815
- if (options.height && options.height - (options.padding.top + options.padding.bottom) <= 0) {
1816
- options.padding.top = 0;
1817
- options.padding.bottom = 0;
1818
- }
1819
- return options;
1820
- };
1821
- var isHex = (color) => color.match(/^#(?:[0-f]{3}){1,2}$/i);
1822
- var isColorValid = (color) => typeof color === "string" && (source_default[color] ?? isHex(color));
1823
- var getColorFn = (color) => isHex(color) ? source_default.hex(color) : source_default[color];
1824
- var getBGColorFn = (color) => isHex(color) ? source_default.bgHex(color) : source_default[camelCase(["bg", color])];
1825
- function boxen(text, options) {
1826
- options = {
1827
- padding: 0,
1828
- borderStyle: "single",
1829
- dimBorder: false,
1830
- textAlignment: "left",
1831
- float: "left",
1832
- titleAlignment: "left",
1833
- ...options
1834
- };
1835
- if (options.align) {
1836
- options.textAlignment = options.align;
1837
- }
1838
- if (options.borderColor && !isColorValid(options.borderColor)) {
1839
- throw new Error(`${options.borderColor} is not a valid borderColor`);
1840
- }
1841
- if (options.backgroundColor && !isColorValid(options.backgroundColor)) {
1842
- throw new Error(`${options.backgroundColor} is not a valid backgroundColor`);
1843
- }
1844
- options.padding = getObject(options.padding);
1845
- options.margin = getObject(options.margin);
1846
- options = determineDimensions(text, options);
1847
- text = makeContentText(text, options);
1848
- return boxContent(text, options.width, options);
1849
- }
1850
-
1851
- // src/core/logger/logger.ts
1852
- import * as fs from "fs";
1853
- import * as path2 from "path";
1854
- var logLevels = {
1855
- error: 0,
1856
- warn: 1,
1857
- info: 2,
1858
- http: 3,
1859
- verbose: 4,
1860
- debug: 5,
1861
- silly: 6
1862
- };
1863
- var consoleFormat = winston.format.printf(({ level, message, timestamp, color }) => {
1864
- const levelColorMap = {
1865
- error: source_default.red,
1866
- warn: source_default.yellow,
1867
- info: source_default.blue,
1868
- http: source_default.cyan,
1869
- verbose: source_default.magenta,
1870
- debug: source_default.gray,
1871
- silly: source_default.gray.dim
1872
- };
1873
- const colorize = levelColorMap[level] || source_default.white;
1874
- const formattedMessage = color && typeof color === "string" && source_default[color] ? source_default[color](message) : message;
1875
- return `${source_default.dim(timestamp)} ${colorize(level.toUpperCase())}: ${formattedMessage}`;
1876
- });
1877
- var SHOULD_REDACT = process.env.REDACT_SECRETS !== "false";
1878
- var SENSITIVE_KEYS = ["apiKey", "password", "secret", "token"];
1879
- var MASK_REGEX = new RegExp(
1880
- `(${SENSITIVE_KEYS.join("|")})(["']?\\s*[:=]\\s*)(["'])?.*?\\3`,
1881
- "gi"
1882
- );
1883
- var maskFormat = winston.format((info) => {
1884
- if (SHOULD_REDACT && typeof info.message === "string") {
1885
- info.message = info.message.replace(MASK_REGEX, "$1$2$3[REDACTED]$3");
1886
- }
1887
- return info;
1888
- });
1889
- var getDefaultLogLevel = () => {
1890
- const envLevel = process.env.DEXTO_LOG_LEVEL;
1891
- if (envLevel && Object.keys(logLevels).includes(envLevel.toLowerCase())) {
1892
- return envLevel.toLowerCase();
1893
- }
1894
- return "info";
1895
- };
1896
- var Logger = class {
1897
- logger;
1898
- isSilent = false;
1899
- logFilePath = null;
1900
- logToConsole = false;
1901
- constructor(options = {}) {
1902
- this.isSilent = options.silent || false;
1903
- this.initializeTransports(options);
1904
- this.logger = winston.createLogger({
1905
- levels: logLevels,
1906
- level: options.level || getDefaultLogLevel(),
1907
- silent: options.silent || false,
1908
- format: winston.format.combine(
1909
- winston.format.timestamp({ format: "YYYY-MM-DD HH:mm:ss" }),
1910
- maskFormat(),
1911
- winston.format.errors({ stack: true }),
1912
- winston.format.splat(),
1913
- winston.format.json()
1914
- ),
1915
- transports: this.createTransports(options)
1916
- });
1917
- }
1918
- initializeTransports(options) {
1919
- const logToConsole = options.logToConsole ?? process.env.DEXTO_LOG_TO_CONSOLE === "true";
1920
- this.logToConsole = logToConsole;
1921
- if (options.customLogPath) {
1922
- this.logFilePath = options.customLogPath;
1923
- } else {
1924
- this.logFilePath = getDextoPath("logs", "dexto.log");
1925
- }
1926
- }
1927
- createTransports(_options) {
1928
- const transports2 = [];
1929
- if (this.logToConsole) {
1930
- transports2.push(
1931
- new winston.transports.Console({
1932
- format: winston.format.combine(
1933
- winston.format.timestamp({ format: "HH:mm:ss" }),
1934
- maskFormat(),
1935
- consoleFormat
1936
- )
1937
- })
1938
- );
1939
- }
1940
- try {
1941
- if (this.logFilePath) {
1942
- const logDir = path2.dirname(this.logFilePath);
1943
- fs.mkdirSync(logDir, { recursive: true });
1944
- transports2.push(
1945
- new winston.transports.File({
1946
- filename: this.logFilePath,
1947
- format: winston.format.combine(
1948
- winston.format.timestamp({ format: "YYYY-MM-DD HH:mm:ss" }),
1949
- maskFormat(),
1950
- winston.format.errors({ stack: true }),
1951
- winston.format.json()
1952
- ),
1953
- // Add daily rotation
1954
- maxsize: 10 * 1024 * 1024,
1955
- // 10MB
1956
- maxFiles: 7,
1957
- // Keep 7 files
1958
- tailable: true
1959
- })
1960
- );
1961
- }
1962
- } catch (error) {
1963
- console.error(`Failed to initialize file logging: ${error}. Falling back to console.`);
1964
- if (!this.logToConsole) {
1965
- this.logToConsole = true;
1966
- transports2.push(
1967
- new winston.transports.Console({
1968
- format: winston.format.combine(
1969
- winston.format.timestamp({ format: "HH:mm:ss" }),
1970
- maskFormat(),
1971
- consoleFormat
1972
- )
1973
- })
1974
- );
1975
- }
1976
- }
1977
- return transports2;
1978
- }
1979
- // General logging methods with optional color parameter
1980
- error(message, meta, color) {
1981
- this.logger.error(message, { ...meta, color });
1982
- }
1983
- warn(message, meta, color) {
1984
- this.logger.warn(message, { ...meta, color });
1985
- }
1986
- info(message, meta, color) {
1987
- this.logger.info(message, { ...meta, color });
1988
- }
1989
- http(message, meta, color) {
1990
- this.logger.http(message, { ...meta, color });
1991
- }
1992
- verbose(message, meta, color) {
1993
- this.logger.verbose(message, { ...meta, color });
1994
- }
1995
- debug(message, meta, color) {
1996
- const formattedMessage = typeof message === "string" ? message : JSON.stringify(message, null, 2);
1997
- this.logger.debug(formattedMessage, { ...meta, color });
1998
- }
1999
- silly(message, meta, color) {
2000
- this.logger.silly(message, { ...meta, color });
2001
- }
2002
- // Display AI response in a box
2003
- displayAIResponse(response) {
2004
- if (this.isSilent) return;
2005
- if (response.content) {
2006
- console.log(
2007
- boxen(source_default.white(response.content), {
2008
- padding: 1,
2009
- borderColor: "yellow",
2010
- title: "\u{1F916} AI Response",
2011
- titleAlignment: "center"
2012
- })
2013
- );
2014
- } else {
2015
- console.log(source_default.yellow("AI is thinking..."));
2016
- }
2017
- }
2018
- // Tool-related logging
2019
- toolCall(toolName, args) {
2020
- if (this.isSilent) return;
2021
- console.log(
2022
- boxen(
2023
- `${source_default.cyan("Tool Call")}: ${source_default.yellow(toolName)}
2024
- ${source_default.dim("Arguments")}:
2025
- ${source_default.white(JSON.stringify(args, null, 2))}`,
2026
- { padding: 1, borderColor: "blue", title: "\u{1F527} Tool Call", titleAlignment: "center" }
2027
- )
2028
- );
2029
- }
2030
- toolResult(result) {
2031
- if (this.isSilent) return;
2032
- let displayText = "";
2033
- let isError = false;
2034
- let borderColor = "green";
2035
- let title = "\u2705 Tool Result";
2036
- if (result?.error || result?.isError) {
2037
- isError = true;
2038
- borderColor = "yellow";
2039
- title = "\u26A0\uFE0F Tool Result (Error)";
2040
- }
2041
- if (result?.content && Array.isArray(result.content)) {
2042
- result.content.forEach((item) => {
2043
- if (item.type === "text") {
2044
- displayText += item.text;
2045
- } else if (item.type === "image" && item.url) {
2046
- displayText += `[Image URL: ${item.url}]`;
2047
- } else if (item.type === "image") {
2048
- displayText += `[Image Data: ${item.mimeType || "unknown type"}]`;
2049
- } else if (item.type === "markdown") {
2050
- displayText += item.markdown;
2051
- } else {
2052
- displayText += `[Unsupported content type: ${item.type}]`;
2053
- }
2054
- displayText += "\n";
2055
- });
2056
- } else if (result?.message) {
2057
- displayText = result.message;
2058
- isError = true;
2059
- borderColor = "red";
2060
- title = "\u274C Tool Error";
2061
- } else if (typeof result === "string") {
2062
- displayText = result;
2063
- } else {
2064
- try {
2065
- displayText = JSON.stringify(result, null, 2);
2066
- } catch {
2067
- displayText = `[Unparseable result: ${typeof result}]`;
2068
- }
2069
- }
2070
- if (!displayText || displayText.trim() === "") {
2071
- displayText = "[Empty result]";
2072
- }
2073
- const textColor = isError ? source_default.yellow : source_default.green;
2074
- console.log(
2075
- boxen(textColor(displayText), {
2076
- padding: 1,
2077
- borderColor,
2078
- title,
2079
- titleAlignment: "center"
2080
- })
2081
- );
2082
- }
2083
- // Configuration
2084
- setLevel(level) {
2085
- if (Object.keys(logLevels).includes(level.toLowerCase())) {
2086
- this.logger.level = level.toLowerCase();
2087
- if (!this.isSilent) {
2088
- console.log(`Log level set to: ${level}`);
2089
- }
2090
- } else {
2091
- this.error(`Invalid log level: ${level}. Using current level: ${this.logger.level}`);
2092
- }
2093
- }
2094
- // Get the current log file path
2095
- getLogFilePath() {
2096
- return this.logFilePath;
2097
- }
2098
- // Get current log level
2099
- getLevel() {
2100
- return this.logger.level;
2101
- }
2102
- };
2103
- var logger = new Logger();
2104
-
2105
- // src/core/logger/index.ts
2106
- init_esm_shims();
2107
-
2108
- export {
2109
- ConfigFileNotFoundError,
2110
- ConfigFileReadError,
2111
- ConfigParseError,
2112
- ConfigEnvVarError,
2113
- ConfigFileWriteError,
2114
- DEFAULT_CONFIG_PATH,
2115
- walkUpDirectories,
2116
- isDextoProject,
2117
- getDextoProjectRoot,
2118
- getDextoPath,
2119
- resolveConfigPath,
2120
- findPackageRoot,
2121
- resolveBundledScript,
2122
- Logger,
2123
- logger
2124
- };