@aigne/cli 1.60.0-beta → 1.74.0-beta

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 (360) hide show
  1. package/README.md +12 -12
  2. package/dist/_virtual/rolldown_runtime.cjs +29 -0
  3. package/dist/bunwrapper.cjs +22 -0
  4. package/dist/bunwrapper.d.cts +1 -0
  5. package/dist/bunwrapper.d.mts +1 -0
  6. package/dist/bunwrapper.mjs +23 -0
  7. package/dist/bunwrapper.mjs.map +1 -0
  8. package/dist/cli.cjs +42 -0
  9. package/dist/cli.d.cts +9 -0
  10. package/dist/cli.d.cts.map +1 -0
  11. package/dist/cli.d.mts +10 -0
  12. package/dist/cli.d.mts.map +1 -0
  13. package/dist/cli.mjs +41 -0
  14. package/dist/cli.mjs.map +1 -0
  15. package/dist/commands/aigne.cjs +23 -0
  16. package/dist/commands/aigne.mjs +22 -0
  17. package/dist/commands/aigne.mjs.map +1 -0
  18. package/dist/commands/app/agent.cjs +117 -0
  19. package/dist/commands/app/agent.mjs +113 -0
  20. package/dist/commands/app/agent.mjs.map +1 -0
  21. package/dist/commands/app/app.cjs +92 -0
  22. package/dist/commands/app/app.mjs +90 -0
  23. package/dist/commands/app/app.mjs.map +1 -0
  24. package/dist/commands/app/cli.cjs +6 -0
  25. package/dist/commands/app/cli.d.cts +1 -0
  26. package/dist/commands/app/cli.d.mts +1 -0
  27. package/dist/commands/app/cli.mjs +8 -0
  28. package/dist/commands/app/cli.mjs.map +1 -0
  29. package/dist/commands/app/upgrade.cjs +243 -0
  30. package/dist/commands/app/upgrade.mjs +240 -0
  31. package/dist/commands/app/upgrade.mjs.map +1 -0
  32. package/dist/commands/app.cjs +53 -0
  33. package/dist/commands/app.mjs +53 -0
  34. package/dist/commands/app.mjs.map +1 -0
  35. package/dist/commands/create.cjs +66 -0
  36. package/dist/commands/create.mjs +65 -0
  37. package/dist/commands/create.mjs.map +1 -0
  38. package/dist/commands/deploy.cjs +237 -0
  39. package/dist/commands/deploy.mjs +237 -0
  40. package/dist/commands/deploy.mjs.map +1 -0
  41. package/dist/commands/eval.cjs +88 -0
  42. package/dist/commands/eval.mjs +88 -0
  43. package/dist/commands/eval.mjs.map +1 -0
  44. package/dist/commands/hub.cjs +297 -0
  45. package/dist/commands/hub.mjs +294 -0
  46. package/dist/commands/hub.mjs.map +1 -0
  47. package/dist/commands/observe.cjs +49 -0
  48. package/dist/commands/observe.mjs +46 -0
  49. package/dist/commands/observe.mjs.map +1 -0
  50. package/dist/commands/run-skill.cjs +84 -0
  51. package/dist/commands/run-skill.mjs +81 -0
  52. package/dist/commands/run-skill.mjs.map +1 -0
  53. package/dist/commands/run.cjs +172 -0
  54. package/dist/commands/run.mjs +171 -0
  55. package/dist/commands/run.mjs.map +1 -0
  56. package/dist/commands/serve-mcp.cjs +68 -0
  57. package/dist/commands/serve-mcp.mjs +67 -0
  58. package/dist/commands/serve-mcp.mjs.map +1 -0
  59. package/dist/commands/test.cjs +40 -0
  60. package/dist/commands/test.mjs +39 -0
  61. package/dist/commands/test.mjs.map +1 -0
  62. package/dist/constants.cjs +28 -0
  63. package/dist/constants.d.cts +9 -0
  64. package/dist/constants.d.cts.map +1 -0
  65. package/dist/constants.d.mts +9 -0
  66. package/dist/constants.d.mts.map +1 -0
  67. package/dist/constants.mjs +24 -0
  68. package/dist/constants.mjs.map +1 -0
  69. package/dist/global.d.cjs +0 -0
  70. package/dist/global.d.cts +6 -0
  71. package/dist/global.d.cts.map +1 -0
  72. package/dist/global.d.mts +6 -0
  73. package/dist/global.d.mts.map +1 -0
  74. package/dist/index.cjs +0 -0
  75. package/dist/index.d.cts +2 -0
  76. package/dist/index.d.mts +2 -0
  77. package/dist/index.mjs +1 -0
  78. package/dist/tracer/terminal.cjs +336 -0
  79. package/dist/tracer/terminal.mjs +332 -0
  80. package/dist/tracer/terminal.mjs.map +1 -0
  81. package/dist/type.cjs +0 -0
  82. package/dist/type.d.cts +10 -0
  83. package/dist/type.d.cts.map +1 -0
  84. package/dist/type.d.mts +10 -0
  85. package/dist/type.d.mts.map +1 -0
  86. package/dist/type.mjs +1 -0
  87. package/dist/ui/utils/terminal-input.cjs +145 -0
  88. package/dist/ui/utils/terminal-input.mjs +144 -0
  89. package/dist/ui/utils/terminal-input.mjs.map +1 -0
  90. package/dist/ui/utils/text-buffer.cjs +865 -0
  91. package/dist/ui/utils/text-buffer.mjs +865 -0
  92. package/dist/ui/utils/text-buffer.mjs.map +1 -0
  93. package/dist/ui/utils/text-utils.cjs +85 -0
  94. package/dist/ui/utils/text-utils.mjs +78 -0
  95. package/dist/ui/utils/text-utils.mjs.map +1 -0
  96. package/dist/utils/agent-v1.cjs +180 -0
  97. package/dist/utils/agent-v1.d.cts +138 -0
  98. package/dist/utils/agent-v1.d.cts.map +1 -0
  99. package/dist/utils/agent-v1.d.mts +138 -0
  100. package/dist/utils/agent-v1.d.mts.map +1 -0
  101. package/dist/utils/agent-v1.mjs +179 -0
  102. package/dist/utils/agent-v1.mjs.map +1 -0
  103. package/dist/utils/aigne-hub/constants.cjs +22 -0
  104. package/dist/utils/aigne-hub/constants.mjs +18 -0
  105. package/dist/utils/aigne-hub/constants.mjs.map +1 -0
  106. package/dist/utils/aigne-hub/credential.cjs +179 -0
  107. package/dist/utils/aigne-hub/credential.mjs +175 -0
  108. package/dist/utils/aigne-hub/credential.mjs.map +1 -0
  109. package/dist/utils/aigne-hub/crypto.cjs +41 -0
  110. package/dist/utils/aigne-hub/crypto.mjs +33 -0
  111. package/dist/utils/aigne-hub/crypto.mjs.map +1 -0
  112. package/dist/utils/aigne-hub/model.cjs +112 -0
  113. package/dist/utils/aigne-hub/model.d.cts +19 -0
  114. package/dist/utils/aigne-hub/model.d.cts.map +1 -0
  115. package/dist/utils/aigne-hub/model.d.mts +19 -0
  116. package/dist/utils/aigne-hub/model.d.mts.map +1 -0
  117. package/dist/utils/aigne-hub/model.mjs +106 -0
  118. package/dist/utils/aigne-hub/model.mjs.map +1 -0
  119. package/dist/utils/aigne-hub/store/file.cjs +64 -0
  120. package/dist/utils/aigne-hub/store/file.mjs +64 -0
  121. package/dist/utils/aigne-hub/store/file.mjs.map +1 -0
  122. package/dist/utils/aigne-hub/store/index.cjs +37 -0
  123. package/dist/utils/aigne-hub/store/index.mjs +37 -0
  124. package/dist/utils/aigne-hub/store/index.mjs.map +1 -0
  125. package/dist/utils/aigne-hub/store/keytar.cjs +61 -0
  126. package/dist/utils/aigne-hub/store/keytar.mjs +61 -0
  127. package/dist/utils/aigne-hub/store/keytar.mjs.map +1 -0
  128. package/dist/utils/aigne-hub/store/migrate.cjs +46 -0
  129. package/dist/utils/aigne-hub/store/migrate.mjs +45 -0
  130. package/dist/utils/aigne-hub/store/migrate.mjs.map +1 -0
  131. package/dist/utils/aigne-hub/type.d.cts +18 -0
  132. package/dist/utils/aigne-hub/type.d.cts.map +1 -0
  133. package/dist/utils/aigne-hub/type.d.mts +18 -0
  134. package/dist/utils/aigne-hub/type.d.mts.map +1 -0
  135. package/dist/utils/aigne-hub-user.cjs +11 -0
  136. package/dist/utils/aigne-hub-user.d.cts +23 -0
  137. package/dist/utils/aigne-hub-user.d.cts.map +1 -0
  138. package/dist/utils/aigne-hub-user.d.mts +23 -0
  139. package/dist/utils/aigne-hub-user.d.mts.map +1 -0
  140. package/dist/utils/aigne-hub-user.mjs +11 -0
  141. package/dist/utils/aigne-hub-user.mjs.map +1 -0
  142. package/dist/utils/ascii-logo.cjs +30 -0
  143. package/dist/utils/ascii-logo.d.cts +5 -0
  144. package/dist/utils/ascii-logo.d.cts.map +1 -0
  145. package/dist/utils/ascii-logo.d.mts +5 -0
  146. package/dist/utils/ascii-logo.d.mts.map +1 -0
  147. package/dist/utils/{ascii-logo.js → ascii-logo.mjs} +13 -3
  148. package/dist/utils/ascii-logo.mjs.map +1 -0
  149. package/dist/utils/download.cjs +25 -0
  150. package/dist/utils/download.d.cts +7 -0
  151. package/dist/utils/download.d.cts.map +1 -0
  152. package/dist/utils/download.d.mts +7 -0
  153. package/dist/utils/download.d.mts.map +1 -0
  154. package/dist/utils/download.mjs +25 -0
  155. package/dist/utils/download.mjs.map +1 -0
  156. package/dist/utils/evaluation/core.cjs +84 -0
  157. package/dist/utils/evaluation/core.mjs +84 -0
  158. package/dist/utils/evaluation/core.mjs.map +1 -0
  159. package/dist/utils/evaluation/dataset.cjs +47 -0
  160. package/dist/utils/evaluation/dataset.mjs +46 -0
  161. package/dist/utils/evaluation/dataset.mjs.map +1 -0
  162. package/dist/utils/evaluation/evaluator.cjs +109 -0
  163. package/dist/utils/evaluation/{evaluator.js → evaluator.mjs} +48 -45
  164. package/dist/utils/evaluation/evaluator.mjs.map +1 -0
  165. package/dist/utils/evaluation/reporter.cjs +225 -0
  166. package/dist/utils/evaluation/reporter.mjs +220 -0
  167. package/dist/utils/evaluation/reporter.mjs.map +1 -0
  168. package/dist/utils/evaluation/runner.cjs +85 -0
  169. package/dist/utils/evaluation/runner.mjs +85 -0
  170. package/dist/utils/evaluation/runner.mjs.map +1 -0
  171. package/dist/utils/get-url-origin.cjs +12 -0
  172. package/dist/utils/get-url-origin.d.cts +5 -0
  173. package/dist/utils/get-url-origin.d.cts.map +1 -0
  174. package/dist/utils/get-url-origin.d.mts +5 -0
  175. package/dist/utils/get-url-origin.d.mts.map +1 -0
  176. package/dist/utils/get-url-origin.mjs +12 -0
  177. package/dist/utils/get-url-origin.mjs.map +1 -0
  178. package/dist/utils/inquirer/checkbox.cjs +265 -0
  179. package/dist/utils/inquirer/checkbox.mjs +262 -0
  180. package/dist/utils/inquirer/checkbox.mjs.map +1 -0
  181. package/dist/utils/listr.cjs +226 -0
  182. package/dist/utils/listr.d.cts +71 -0
  183. package/dist/utils/listr.d.cts.map +1 -0
  184. package/dist/utils/listr.d.mts +71 -0
  185. package/dist/utils/listr.d.mts.map +1 -0
  186. package/dist/utils/listr.mjs +222 -0
  187. package/dist/utils/listr.mjs.map +1 -0
  188. package/dist/utils/load-aigne.cjs +77 -0
  189. package/dist/utils/load-aigne.d.cts +29 -0
  190. package/dist/utils/load-aigne.d.cts.map +1 -0
  191. package/dist/utils/load-aigne.d.mts +29 -0
  192. package/dist/utils/load-aigne.d.mts.map +1 -0
  193. package/dist/utils/load-aigne.mjs +74 -0
  194. package/dist/utils/load-aigne.mjs.map +1 -0
  195. package/dist/utils/run-chat-loop.cjs +90 -0
  196. package/dist/utils/run-chat-loop.d.cts +20 -0
  197. package/dist/utils/run-chat-loop.d.cts.map +1 -0
  198. package/dist/utils/run-chat-loop.d.mts +20 -0
  199. package/dist/utils/run-chat-loop.d.mts.map +1 -0
  200. package/dist/utils/run-chat-loop.mjs +89 -0
  201. package/dist/utils/run-chat-loop.mjs.map +1 -0
  202. package/dist/utils/run-with-aigne.cjs +131 -0
  203. package/dist/utils/run-with-aigne.d.cts +46 -0
  204. package/dist/utils/run-with-aigne.d.cts.map +1 -0
  205. package/dist/utils/run-with-aigne.d.mts +46 -0
  206. package/dist/utils/run-with-aigne.d.mts.map +1 -0
  207. package/dist/utils/run-with-aigne.mjs +126 -0
  208. package/dist/utils/run-with-aigne.mjs.map +1 -0
  209. package/dist/utils/serve-mcp.cjs +91 -0
  210. package/dist/utils/serve-mcp.d.cts +20 -0
  211. package/dist/utils/serve-mcp.d.cts.map +1 -0
  212. package/dist/utils/serve-mcp.d.mts +20 -0
  213. package/dist/utils/serve-mcp.d.mts.map +1 -0
  214. package/dist/utils/serve-mcp.mjs +89 -0
  215. package/dist/utils/serve-mcp.mjs.map +1 -0
  216. package/dist/utils/spinner.cjs +19 -0
  217. package/dist/utils/spinner.d.cts +5 -0
  218. package/dist/utils/spinner.d.cts.map +1 -0
  219. package/dist/utils/spinner.d.mts +5 -0
  220. package/dist/utils/spinner.d.mts.map +1 -0
  221. package/dist/utils/spinner.mjs +19 -0
  222. package/dist/utils/spinner.mjs.map +1 -0
  223. package/dist/utils/string-utils.cjs +11 -0
  224. package/dist/utils/string-utils.d.cts +5 -0
  225. package/dist/utils/string-utils.d.cts.map +1 -0
  226. package/dist/utils/string-utils.d.mts +5 -0
  227. package/dist/utils/string-utils.d.mts.map +1 -0
  228. package/dist/utils/string-utils.mjs +10 -0
  229. package/dist/utils/string-utils.mjs.map +1 -0
  230. package/dist/utils/time.cjs +14 -0
  231. package/dist/utils/time.d.cts +5 -0
  232. package/dist/utils/time.d.cts.map +1 -0
  233. package/dist/utils/time.d.mts +5 -0
  234. package/dist/utils/time.d.mts.map +1 -0
  235. package/dist/utils/time.mjs +14 -0
  236. package/dist/utils/time.mjs.map +1 -0
  237. package/dist/utils/url.cjs +8 -0
  238. package/dist/utils/url.d.cts +5 -0
  239. package/dist/utils/url.d.cts.map +1 -0
  240. package/dist/utils/url.d.mts +5 -0
  241. package/dist/utils/url.d.mts.map +1 -0
  242. package/dist/utils/url.mjs +8 -0
  243. package/dist/utils/url.mjs.map +1 -0
  244. package/dist/utils/yargs.cjs +191 -0
  245. package/dist/utils/yargs.d.cts +96 -0
  246. package/dist/utils/yargs.d.cts.map +1 -0
  247. package/dist/utils/yargs.d.mts +96 -0
  248. package/dist/utils/yargs.d.mts.map +1 -0
  249. package/dist/utils/yargs.mjs +186 -0
  250. package/dist/utils/yargs.mjs.map +1 -0
  251. package/package.json +122 -45
  252. package/CHANGELOG.md +0 -5019
  253. package/dist/bunwrapper.d.ts +0 -2
  254. package/dist/bunwrapper.js +0 -18
  255. package/dist/cli.d.ts +0 -7
  256. package/dist/cli.js +0 -42
  257. package/dist/commands/aigne.d.ts +0 -4
  258. package/dist/commands/aigne.js +0 -35
  259. package/dist/commands/app/agent.d.ts +0 -26
  260. package/dist/commands/app/agent.js +0 -122
  261. package/dist/commands/app/app.d.ts +0 -7
  262. package/dist/commands/app/app.js +0 -92
  263. package/dist/commands/app/cli.d.ts +0 -1
  264. package/dist/commands/app/cli.js +0 -2
  265. package/dist/commands/app/upgrade.d.ts +0 -54
  266. package/dist/commands/app/upgrade.js +0 -236
  267. package/dist/commands/app.d.ts +0 -4
  268. package/dist/commands/app.js +0 -54
  269. package/dist/commands/create.d.ts +0 -6
  270. package/dist/commands/create.js +0 -74
  271. package/dist/commands/deploy.d.ts +0 -11
  272. package/dist/commands/deploy.js +0 -255
  273. package/dist/commands/eval.d.ts +0 -11
  274. package/dist/commands/eval.js +0 -110
  275. package/dist/commands/hub.d.ts +0 -3
  276. package/dist/commands/hub.js +0 -323
  277. package/dist/commands/observe.d.ts +0 -7
  278. package/dist/commands/observe.js +0 -41
  279. package/dist/commands/run-skill.d.ts +0 -6
  280. package/dist/commands/run-skill.js +0 -102
  281. package/dist/commands/run.d.ts +0 -9
  282. package/dist/commands/run.js +0 -187
  283. package/dist/commands/serve-mcp.d.ts +0 -20
  284. package/dist/commands/serve-mcp.js +0 -67
  285. package/dist/commands/test.d.ts +0 -9
  286. package/dist/commands/test.js +0 -33
  287. package/dist/constants.d.ts +0 -7
  288. package/dist/constants.js +0 -21
  289. package/dist/index.d.ts +0 -1
  290. package/dist/index.js +0 -1
  291. package/dist/tracer/terminal.d.ts +0 -62
  292. package/dist/tracer/terminal.js +0 -404
  293. package/dist/type.d.ts +0 -5
  294. package/dist/type.js +0 -1
  295. package/dist/ui/utils/terminal-input.d.ts +0 -19
  296. package/dist/ui/utils/terminal-input.js +0 -123
  297. package/dist/ui/utils/text-buffer.d.ts +0 -87
  298. package/dist/ui/utils/text-buffer.js +0 -1059
  299. package/dist/ui/utils/text-utils.d.ts +0 -37
  300. package/dist/ui/utils/text-utils.js +0 -185
  301. package/dist/utils/agent-v1.d.ts +0 -134
  302. package/dist/utils/agent-v1.js +0 -213
  303. package/dist/utils/aigne-hub/constants.d.ts +0 -6
  304. package/dist/utils/aigne-hub/constants.js +0 -12
  305. package/dist/utils/aigne-hub/credential.d.ts +0 -20
  306. package/dist/utils/aigne-hub/credential.js +0 -182
  307. package/dist/utils/aigne-hub/crypto.d.ts +0 -4
  308. package/dist/utils/aigne-hub/crypto.js +0 -30
  309. package/dist/utils/aigne-hub/model.d.ts +0 -13
  310. package/dist/utils/aigne-hub/model.js +0 -122
  311. package/dist/utils/aigne-hub/store/file.d.ts +0 -15
  312. package/dist/utils/aigne-hub/store/file.js +0 -69
  313. package/dist/utils/aigne-hub/store/index.d.ts +0 -5
  314. package/dist/utils/aigne-hub/store/index.js +0 -43
  315. package/dist/utils/aigne-hub/store/keytar.d.ts +0 -15
  316. package/dist/utils/aigne-hub/store/keytar.js +0 -67
  317. package/dist/utils/aigne-hub/store/migrate.d.ts +0 -2
  318. package/dist/utils/aigne-hub/store/migrate.js +0 -57
  319. package/dist/utils/aigne-hub/type.d.ts +0 -38
  320. package/dist/utils/aigne-hub/type.js +0 -1
  321. package/dist/utils/aigne-hub-user.d.ts +0 -16
  322. package/dist/utils/aigne-hub-user.js +0 -10
  323. package/dist/utils/ascii-logo.d.ts +0 -1
  324. package/dist/utils/download.d.ts +0 -3
  325. package/dist/utils/download.js +0 -19
  326. package/dist/utils/evaluation/core.d.ts +0 -8
  327. package/dist/utils/evaluation/core.js +0 -83
  328. package/dist/utils/evaluation/dataset.d.ts +0 -15
  329. package/dist/utils/evaluation/dataset.js +0 -61
  330. package/dist/utils/evaluation/evaluator.d.ts +0 -9
  331. package/dist/utils/evaluation/reporter.d.ts +0 -28
  332. package/dist/utils/evaluation/reporter.js +0 -221
  333. package/dist/utils/evaluation/runner.d.ts +0 -16
  334. package/dist/utils/evaluation/runner.js +0 -129
  335. package/dist/utils/evaluation/type.d.ts +0 -69
  336. package/dist/utils/evaluation/type.js +0 -1
  337. package/dist/utils/get-url-origin.d.ts +0 -1
  338. package/dist/utils/get-url-origin.js +0 -8
  339. package/dist/utils/inquirer/checkbox.d.ts +0 -55
  340. package/dist/utils/inquirer/checkbox.js +0 -319
  341. package/dist/utils/listr.d.ts +0 -64
  342. package/dist/utils/listr.js +0 -265
  343. package/dist/utils/load-aigne.d.ts +0 -18
  344. package/dist/utils/load-aigne.js +0 -80
  345. package/dist/utils/run-chat-loop.d.ts +0 -15
  346. package/dist/utils/run-chat-loop.js +0 -87
  347. package/dist/utils/run-with-aigne.d.ts +0 -27
  348. package/dist/utils/run-with-aigne.js +0 -157
  349. package/dist/utils/serve-mcp.d.ts +0 -9
  350. package/dist/utils/serve-mcp.js +0 -93
  351. package/dist/utils/spinner.d.ts +0 -1
  352. package/dist/utils/spinner.js +0 -14
  353. package/dist/utils/string-utils.d.ts +0 -1
  354. package/dist/utils/string-utils.js +0 -4
  355. package/dist/utils/time.d.ts +0 -1
  356. package/dist/utils/time.js +0 -12
  357. package/dist/utils/url.d.ts +0 -1
  358. package/dist/utils/url.js +0 -3
  359. package/dist/utils/yargs.d.ts +0 -94
  360. package/dist/utils/yargs.js +0 -210
@@ -1,20 +0,0 @@
1
- import type { AIGNE } from "@aigne/core";
2
- import type { CommandModule } from "yargs";
3
- interface ServeMCPOptions {
4
- path: string;
5
- host: string;
6
- port?: number;
7
- pathname: string;
8
- aigneHubUrl?: string;
9
- }
10
- export declare const DEFAULT_PORT: () => number;
11
- export declare function createServeMCPCommand({ aigneFilePath, }?: {
12
- aigneFilePath?: string;
13
- }): CommandModule<unknown, ServeMCPOptions>;
14
- export declare function serveMCPServerFromDir(options: {
15
- aigne: AIGNE;
16
- host: string;
17
- port?: number;
18
- pathname: string;
19
- }): Promise<void>;
20
- export {};
@@ -1,67 +0,0 @@
1
- import { isAbsolute, resolve } from "node:path";
2
- import { tryOrThrow } from "@aigne/core/utils/type-utils.js";
3
- import { loadAIGNE } from "../utils/load-aigne.js";
4
- import { serveMCPServer } from "../utils/serve-mcp.js";
5
- export const DEFAULT_PORT = () => tryOrThrow(() => {
6
- const { PORT } = process.env;
7
- if (!PORT)
8
- return 3000;
9
- const port = Number.parseInt(PORT, 10);
10
- if (!port || !Number.isInteger(port))
11
- throw new Error(`Invalid PORT: ${PORT}`);
12
- return port;
13
- }, (error) => new Error(`parse PORT error ${error.message}`));
14
- export function createServeMCPCommand({ aigneFilePath, } = {}) {
15
- return {
16
- command: "serve-mcp",
17
- describe: "Serve the agents in the specified directory as a MCP server (streamable http)",
18
- builder: (yargs) => {
19
- return yargs
20
- .option("path", {
21
- describe: "Path to the agents directory or URL to aigne project",
22
- type: "string",
23
- default: ".",
24
- alias: ["url"],
25
- })
26
- .option("host", {
27
- describe: "Host to run the MCP server on, use 0.0.0.0 to publicly expose the server",
28
- type: "string",
29
- default: "localhost",
30
- })
31
- .option("port", {
32
- describe: "Port to run the MCP server on",
33
- type: "number",
34
- })
35
- .option("pathname", {
36
- describe: "Pathname to the service",
37
- type: "string",
38
- default: "/mcp",
39
- })
40
- .option("aigne-hub-url", {
41
- describe: "Custom AIGNE Hub service URL. Used to fetch remote agent definitions or models. ",
42
- type: "string",
43
- });
44
- },
45
- handler: async (options) => {
46
- const path = aigneFilePath || options.path;
47
- const absolutePath = isAbsolute(path) ? path : resolve(process.cwd(), path);
48
- const aigne = await loadAIGNE({
49
- path: absolutePath,
50
- modelOptions: { aigneHubUrl: options.aigneHubUrl },
51
- });
52
- await serveMCPServerFromDir({ ...options, aigne });
53
- },
54
- };
55
- }
56
- export async function serveMCPServerFromDir(options) {
57
- const port = options.port || DEFAULT_PORT();
58
- await serveMCPServer({
59
- aigne: options.aigne,
60
- host: options.host,
61
- port,
62
- pathname: options.pathname,
63
- });
64
- console.log(`MCP server is running on http://${options.host}:${port}${options.pathname}`);
65
- if (!process.env.CI && process.env.NODE_ENV !== "test")
66
- await new Promise(() => { }); // Keep the server running
67
- }
@@ -1,9 +0,0 @@
1
- import type { CommandModule } from "yargs";
2
- interface TestOptions {
3
- path: string;
4
- aigneHubUrl?: string;
5
- }
6
- export declare function createTestCommand({ aigneFilePath, }?: {
7
- aigneFilePath?: string;
8
- }): CommandModule<unknown, TestOptions>;
9
- export {};
@@ -1,33 +0,0 @@
1
- import assert from "node:assert";
2
- import { spawnSync } from "node:child_process";
3
- import { isAbsolute, resolve } from "node:path";
4
- import { loadAIGNE } from "../utils/load-aigne.js";
5
- export function createTestCommand({ aigneFilePath, } = {}) {
6
- return {
7
- command: "test",
8
- describe: "Run tests in the specified agents directory",
9
- builder: (yargs) => {
10
- return yargs
11
- .option("path", {
12
- describe: "Path to the agents directory or URL to aigne project",
13
- type: "string",
14
- default: ".",
15
- alias: ["url"],
16
- })
17
- .option("aigne-hub-url", {
18
- describe: "Custom AIGNE Hub service URL. Used to fetch remote agent definitions or models. ",
19
- type: "string",
20
- });
21
- },
22
- handler: async (options) => {
23
- const path = aigneFilePath || options.path;
24
- const absolutePath = isAbsolute(path) ? path : resolve(process.cwd(), path);
25
- const aigne = await loadAIGNE({
26
- path: absolutePath,
27
- modelOptions: { aigneHubUrl: options?.aigneHubUrl },
28
- });
29
- assert(aigne.rootDir);
30
- spawnSync("node", ["--test"], { cwd: aigne.rootDir, stdio: "inherit" });
31
- },
32
- };
33
- }
@@ -1,7 +0,0 @@
1
- import { DefaultMemory } from "@aigne/default-memory";
2
- export declare const AIGNE_CLI_VERSION: any;
3
- export declare const availableMemories: (typeof DefaultMemory)[];
4
- export declare const AIGNE_HUB_CREDITS_NOT_ENOUGH_ERROR_TYPE = "NOT_ENOUGH";
5
- export declare const CHAT_MODEL_OPTIONS: string[];
6
- export declare const DEFAULT_USER_ID = "cli-user";
7
- export declare const DEFAULT_AFS_EXPLORER_PORT = 9670;
package/dist/constants.js DELETED
@@ -1,21 +0,0 @@
1
- import { createRequire } from "node:module";
2
- import { AgenticMemory } from "@aigne/agentic-memory";
3
- import { DefaultMemory } from "@aigne/default-memory";
4
- const require = createRequire(import.meta.url);
5
- export const AIGNE_CLI_VERSION = require("../package.json").version;
6
- export const availableMemories = [DefaultMemory, AgenticMemory];
7
- export const AIGNE_HUB_CREDITS_NOT_ENOUGH_ERROR_TYPE = "NOT_ENOUGH";
8
- export const CHAT_MODEL_OPTIONS = [
9
- "aigneHubUrl",
10
- "model",
11
- "temperature",
12
- "topP",
13
- "frequencyPenalty",
14
- "presencePenalty",
15
- "parallelToolCalls",
16
- "modalities",
17
- "preferInputFileType",
18
- "reasoningEffort",
19
- ];
20
- export const DEFAULT_USER_ID = "cli-user";
21
- export const DEFAULT_AFS_EXPLORER_PORT = 9670;
package/dist/index.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from "./type.js";
package/dist/index.js DELETED
@@ -1 +0,0 @@
1
- export * from "./type.js";
@@ -1,62 +0,0 @@
1
- import { type InspectOptions } from "node:util";
2
- import { type Agent, type Context, type ContextUsage, type InvokeOptions, type Message } from "@aigne/core";
3
- import { promiseWithResolvers } from "@aigne/core/utils/promise.js";
4
- import { type Listr } from "@aigne/listr2";
5
- import { type AIGNEListrTaskWrapper } from "../utils/listr.js";
6
- export interface TerminalTracerOptions {
7
- outputKey?: string;
8
- outputFileKey?: string;
9
- }
10
- export declare class TerminalTracer {
11
- readonly context: Context;
12
- readonly options: TerminalTracerOptions;
13
- constructor(context: Context, options?: TerminalTracerOptions);
14
- private tasks;
15
- run(agent: Agent, input: Message, options?: InvokeOptions): Promise<{
16
- result: Message;
17
- context: Context<import("@aigne/core").UserContext>;
18
- }>;
19
- private listr?;
20
- private proxiedPrompts;
21
- private buyCreditsPromptPromise;
22
- private promptBuyCredits;
23
- formatAigneHubCredits(credits: number, creditPrefix?: string): [string, string];
24
- formatTokenUsage(usage: Partial<ContextUsage>, extra?: {
25
- [key: string]: string;
26
- }): string;
27
- formatTimeUsage(startTime: number, endTime: number): string;
28
- formatTaskTitle(agent: Agent, { task, usage, time, input }: {
29
- task?: Task;
30
- usage?: boolean;
31
- time?: boolean;
32
- input: Message;
33
- }): Promise<string>;
34
- private marked;
35
- get outputKey(): string;
36
- get outputFileKey(): string;
37
- formatRequest(agent: Agent, _context: Context, m?: Message, { running }?: {
38
- running?: boolean | undefined;
39
- }): string | undefined;
40
- formatResult(agent: Agent, context: Context, m?: Message, { running, renderImage }?: {
41
- running?: boolean | undefined;
42
- renderImage?: boolean | undefined;
43
- }): string | Promise<string>;
44
- formatResultData(output: Message): Promise<string | undefined>;
45
- protected runningInspectOptions: InspectOptions;
46
- }
47
- type Task = ReturnType<typeof promiseWithResolvers<void>> & {
48
- listr: ReturnType<typeof promiseWithResolvers<{
49
- ctx: object;
50
- subtask: Listr;
51
- taskWrapper: AIGNEListrTaskWrapper;
52
- }>>;
53
- agent: Agent;
54
- input: Message;
55
- startTime?: number;
56
- endTime?: number;
57
- usage?: Partial<ContextUsage>;
58
- extraTitleMetadata?: {
59
- [key: string]: string;
60
- };
61
- };
62
- export {};
@@ -1,404 +0,0 @@
1
- import { EOL } from "node:os";
2
- import { inspect } from "node:util";
3
- import { AIAgent, ChatModel, DEFAULT_OUTPUT_FILE_KEY, DEFAULT_OUTPUT_KEY, mergeContextUsage, newEmptyContextUsage, UserAgent, } from "@aigne/core";
4
- import { promiseWithResolvers } from "@aigne/core/utils/promise.js";
5
- import { flat, omit } from "@aigne/core/utils/type-utils.js";
6
- import { figures } from "@aigne/listr2";
7
- import { markedTerminal } from "@aigne/marked-terminal";
8
- import * as prompts from "@inquirer/prompts";
9
- import chalk from "chalk";
10
- import { Marked } from "marked";
11
- import terminalImage from "terminal-image";
12
- import terminalLink from "terminal-link";
13
- import { withProtocol } from "ufo";
14
- import { AIGNE_HUB_CREDITS_NOT_ENOUGH_ERROR_TYPE } from "../constants.js";
15
- import { terminalInput } from "../ui/utils/terminal-input.js";
16
- import checkbox from "../utils/inquirer/checkbox.js";
17
- import { AIGNEListr, AIGNEListrRenderer } from "../utils/listr.js";
18
- import { highlightUrl } from "../utils/string-utils.js";
19
- import { parseDuration } from "../utils/time.js";
20
- const CREDITS_ERROR_PROCESSED_FLAG = "$credits_error_processed";
21
- export class TerminalTracer {
22
- context;
23
- options;
24
- constructor(context, options = {}) {
25
- this.context = context;
26
- this.options = options;
27
- }
28
- tasks = {};
29
- async run(agent, input, options) {
30
- await this.context.observer?.serve();
31
- const context = this.context.newContext({ reset: true });
32
- const listr = new AIGNEListr({
33
- formatRequest: (options) => this.formatRequest(agent, context, input, options),
34
- formatResult: (result, options) => this.formatResult(agent, context, result, options),
35
- }, [], { concurrent: true, exitOnError: false, registerSignalListeners: false });
36
- this.listr = listr;
37
- const collapsedMap = new Map();
38
- const hideContextIds = new Set();
39
- const onStart = async ({ context, agent, ...event }) => {
40
- const result = { options: { prompts: this.proxiedPrompts } };
41
- if (agent instanceof UserAgent)
42
- return result;
43
- if (agent.taskRenderMode === "hide") {
44
- hideContextIds.add(context.id);
45
- return result;
46
- }
47
- if (agent.taskRenderMode === "collapse") {
48
- collapsedMap.set(context.id, {
49
- ancestor: { contextId: context.id },
50
- usage: newEmptyContextUsage(),
51
- models: new Set(),
52
- });
53
- }
54
- if (context.parentId) {
55
- if (hideContextIds.has(context.parentId)) {
56
- hideContextIds.add(context.id);
57
- return result;
58
- }
59
- const collapsed = collapsedMap.get(context.parentId);
60
- if (collapsed) {
61
- collapsedMap.set(context.id, collapsed);
62
- return result;
63
- }
64
- }
65
- const contextId = context.id;
66
- const parentContextId = context.parentId;
67
- const task = {
68
- ...promiseWithResolvers(),
69
- agent,
70
- input: event.input,
71
- listr: promiseWithResolvers(),
72
- startTime: Date.now(),
73
- };
74
- this.tasks[contextId] = task;
75
- const listrTask = {
76
- title: await this.formatTaskTitle(agent, { ...event }),
77
- task: (ctx, taskWrapper) => {
78
- const subtask = taskWrapper.newListr([{ task: () => task.promise }]);
79
- task.listr.resolve({ subtask, taskWrapper, ctx });
80
- return subtask;
81
- },
82
- rendererOptions: {
83
- persistentOutput: true,
84
- outputBar: Number.POSITIVE_INFINITY,
85
- bottomBar: Number.POSITIVE_INFINITY,
86
- },
87
- };
88
- const parentTask = parentContextId ? this.tasks[parentContextId] : undefined;
89
- if (parentTask) {
90
- parentTask.listr.promise.then(({ subtask }) => {
91
- subtask.add(listrTask);
92
- });
93
- }
94
- else {
95
- listr.add(listrTask);
96
- }
97
- return result;
98
- };
99
- const onSuccess = async ({ context, agent, output, ...event }) => {
100
- const contextId = context.id;
101
- const parentContextId = context.parentId;
102
- const collapsed = collapsedMap.get(contextId);
103
- if (collapsed) {
104
- if (agent instanceof ChatModel) {
105
- const { usage, model } = output;
106
- if (usage)
107
- mergeContextUsage(collapsed.usage, usage);
108
- if (model)
109
- collapsed.models.add(model);
110
- }
111
- const task = this.tasks[collapsed.ancestor.contextId];
112
- if (task) {
113
- task.usage = collapsed.usage;
114
- task.extraTitleMetadata ??= {};
115
- if (collapsed.models.size)
116
- task.extraTitleMetadata.model = [...collapsed.models].join(",");
117
- const { taskWrapper } = await task.listr.promise;
118
- taskWrapper.title = await this.formatTaskTitle(task.agent, {
119
- input: task.input,
120
- task,
121
- usage: Boolean(task.usage.inputTokens ||
122
- task.usage.outputTokens ||
123
- task.usage.aigneHubCredits ||
124
- task.usage.cacheCreationInputTokens ||
125
- task.usage.cacheReadInputTokens),
126
- time: context.id === collapsed.ancestor.contextId,
127
- });
128
- if (context.id === collapsed.ancestor.contextId) {
129
- task?.resolve();
130
- }
131
- return;
132
- }
133
- }
134
- const task = this.tasks[contextId];
135
- if (!task)
136
- return;
137
- task.endTime = Date.now();
138
- const { taskWrapper, ctx } = await task.listr.promise;
139
- if (agent instanceof ChatModel) {
140
- const { usage, model } = output;
141
- task.usage = usage;
142
- task.extraTitleMetadata ??= {};
143
- if (model)
144
- task.extraTitleMetadata.model = model;
145
- }
146
- taskWrapper.title = await this.formatTaskTitle(agent, {
147
- ...event,
148
- task,
149
- usage: true,
150
- time: true,
151
- });
152
- if (!parentContextId || !this.tasks[parentContextId]) {
153
- Object.assign(ctx, output);
154
- }
155
- task.resolve();
156
- };
157
- let retryPromptPromise;
158
- const onError = async ({ context, agent, error, ...event }) => {
159
- if ("type" in error && error.type === AIGNE_HUB_CREDITS_NOT_ENOUGH_ERROR_TYPE) {
160
- if (!Object.hasOwn(error, CREDITS_ERROR_PROCESSED_FLAG)) {
161
- Object.defineProperty(error, CREDITS_ERROR_PROCESSED_FLAG, {
162
- value: true,
163
- enumerable: false,
164
- });
165
- const retry = await this.promptBuyCredits(error);
166
- console.log("");
167
- if (retry === "retry") {
168
- return { retry: true };
169
- }
170
- }
171
- }
172
- if (agent instanceof ChatModel) {
173
- retryPromptPromise ??= this.proxiedPrompts
174
- .select({
175
- message: chalk.red(`Error: ${error.message}`),
176
- choices: [
177
- { value: "retry", name: "Retry" },
178
- { value: "exit", name: "Exit" },
179
- ],
180
- })
181
- .then((result) => ({ retry: result === "retry" }))
182
- .finally(() => {
183
- retryPromptPromise = undefined;
184
- });
185
- const { retry } = await retryPromptPromise;
186
- if (retry)
187
- return { retry: true };
188
- }
189
- const contextId = context.id;
190
- const task = this.tasks[contextId];
191
- if (!task)
192
- return;
193
- task.endTime = Date.now();
194
- const { taskWrapper } = await task.listr.promise;
195
- taskWrapper.title = await this.formatTaskTitle(agent, {
196
- ...event,
197
- task,
198
- usage: true,
199
- time: true,
200
- });
201
- task.reject(error);
202
- };
203
- const result = await listr.run(() => context.invoke(agent, input, {
204
- ...options,
205
- hooks: flat({
206
- priority: "high",
207
- onStart,
208
- onSuccess,
209
- onError,
210
- }, options?.hooks),
211
- streaming: true,
212
- newContext: false,
213
- }));
214
- return { result, context };
215
- }
216
- listr;
217
- proxiedPrompts = new Proxy({}, {
218
- get: (_target, prop) => {
219
- const method = prop === "checkbox"
220
- ? checkbox
221
- : prop === "input"
222
- ? terminalInput
223
- : // biome-ignore lint/performance/noDynamicNamespaceImportAccess: we need to access prompts dynamically
224
- prompts[prop];
225
- if (typeof method !== "function")
226
- throw new Error(`Unsupported prompt method ${String(prop)}`);
227
- return async (config) => {
228
- const renderer = this.listr?.["renderer"] instanceof AIGNEListrRenderer
229
- ? this.listr["renderer"]
230
- : undefined;
231
- await renderer?.pause();
232
- try {
233
- return await method({ ...config });
234
- }
235
- finally {
236
- await renderer?.resume();
237
- }
238
- };
239
- },
240
- });
241
- buyCreditsPromptPromise;
242
- async promptBuyCredits(error) {
243
- // Avoid multiple agents asking for credits, we will only show the prompt once
244
- this.buyCreditsPromptPromise ??= (async () => {
245
- const retry = await this.proxiedPrompts.select({
246
- message: highlightUrl(error.message),
247
- choices: [
248
- {
249
- name: "I have bought some credits, try again",
250
- value: "retry",
251
- },
252
- {
253
- name: "Exit",
254
- value: "exit",
255
- },
256
- ],
257
- });
258
- return retry;
259
- })();
260
- return this.buyCreditsPromptPromise
261
- .catch(() => "exit")
262
- .finally(() => {
263
- // Clear the promise so that we can show the prompt again if needed
264
- this.buyCreditsPromptPromise = undefined;
265
- });
266
- }
267
- formatAigneHubCredits(credits, creditPrefix) {
268
- const hasDecimal = credits % 1 !== 0;
269
- const formattedCredits = hasDecimal
270
- ? parseFloat(credits.toFixed(6)).toString()
271
- : credits.toFixed();
272
- if (creditPrefix) {
273
- return [chalk.grey("cost:"), chalk.blue(`${creditPrefix}${formattedCredits}`)];
274
- }
275
- return [chalk.blue(formattedCredits), chalk.grey("AIGNE Hub credits")];
276
- }
277
- formatTokenUsage(usage, extra) {
278
- const items = [
279
- [chalk.yellow(usage.inputTokens), chalk.grey("input tokens")],
280
- usage.cacheReadInputTokens
281
- ? [chalk.green(usage.cacheReadInputTokens), chalk.grey("cached")]
282
- : undefined,
283
- usage.cacheCreationInputTokens
284
- ? [chalk.yellow(usage.cacheCreationInputTokens), chalk.grey("cache write")]
285
- : undefined,
286
- [chalk.cyan(usage.outputTokens), chalk.grey("output tokens")],
287
- usage.aigneHubCredits
288
- ? this.formatAigneHubCredits(usage.aigneHubCredits, usage.creditPrefix)
289
- : undefined,
290
- usage.agentCalls ? [chalk.magenta(usage.agentCalls), chalk.grey("agent calls")] : undefined,
291
- ];
292
- const content = items.filter((i) => !!i).map((i) => i.join(" "));
293
- if (extra) {
294
- content.unshift(...Object.entries(extra)
295
- .filter(([k, v]) => k && v)
296
- .map(([k, v]) => `${chalk.grey(k)}: ${v}`));
297
- }
298
- return `${chalk.grey("(")}${content.join(chalk.green(", "))}${chalk.grey(")")}`;
299
- }
300
- formatTimeUsage(startTime, endTime) {
301
- const duration = endTime - startTime;
302
- return chalk.grey(`[${parseDuration(duration)}]`);
303
- }
304
- async formatTaskTitle(agent, { task, usage, time, input }) {
305
- let title = agent.name;
306
- if (agent.taskTitle) {
307
- title += ` ${chalk.cyan(await agent.renderTaskTitle(input))}`;
308
- }
309
- if (usage && task?.usage)
310
- title += ` ${this.formatTokenUsage(task.usage, task.extraTitleMetadata)}`;
311
- if (time && task?.startTime && task.endTime)
312
- title += ` ${this.formatTimeUsage(task.startTime, task.endTime)}`;
313
- return title;
314
- }
315
- marked = new Marked().use({
316
- // marked-terminal does not support code block meta, so we need to strip it
317
- walkTokens: (token) => {
318
- if (token.type === "code") {
319
- if (typeof token.lang === "string") {
320
- token.lang = token.lang.trim().split(/\s+/)[0];
321
- }
322
- }
323
- },
324
- }, markedTerminal({ forceHyperLink: false }, {
325
- theme: {
326
- string: chalk.green,
327
- },
328
- }));
329
- get outputKey() {
330
- return this.options.outputKey || DEFAULT_OUTPUT_KEY;
331
- }
332
- get outputFileKey() {
333
- return this.options.outputFileKey || DEFAULT_OUTPUT_FILE_KEY;
334
- }
335
- formatRequest(agent, _context, m = {}, { running = false } = {}) {
336
- const prefix = `${chalk.grey(figures.pointer)} 💬 `;
337
- const inputKey = agent instanceof AIAgent ? agent.inputKey : undefined;
338
- const msg = inputKey ? m[inputKey] : undefined;
339
- const message = inputKey ? omit(m, inputKey) : m;
340
- const text = msg && typeof msg === "string" ? this.marked.parse(msg, { async: false }).trim() : undefined;
341
- const json = Object.keys(message).length > 0
342
- ? inspect(message, { colors: true, ...(running ? this.runningInspectOptions : undefined) })
343
- : undefined;
344
- const r = [text, json].filter(Boolean).join(EOL).trim();
345
- if (!r)
346
- return undefined;
347
- return `${prefix}${r}`;
348
- }
349
- formatResult(agent, context, m = {}, { running = false, renderImage = false } = {}) {
350
- const { isTTY } = process.stdout;
351
- const outputKey = this.outputKey || (agent instanceof AIAgent ? agent.outputKey : undefined);
352
- const prefix = `${chalk.grey(figures.tick)} 🤖 ${this.formatTokenUsage(context.usage)}`;
353
- const msg = outputKey ? m[outputKey] : undefined;
354
- const message = outputKey ? omit(m, outputKey, this.outputFileKey) : m;
355
- const text = msg && typeof msg === "string"
356
- ? isTTY
357
- ? this.marked.parse(msg, { async: false }).trim()
358
- : msg
359
- : undefined;
360
- const json = Object.keys(message).length > 0
361
- ? inspect(message, { colors: isTTY, ...(running ? this.runningInspectOptions : undefined) })
362
- : undefined;
363
- if (renderImage) {
364
- return this.formatResultData(m).then((images) => {
365
- return [prefix, text, images, json].filter(Boolean).join(EOL.repeat(2));
366
- });
367
- }
368
- return [prefix, text, json].filter(Boolean).join(EOL.repeat(2));
369
- }
370
- async formatResultData(output) {
371
- const files = output[this.outputFileKey];
372
- if (!Array.isArray(files))
373
- return;
374
- const options = {
375
- height: 30,
376
- };
377
- return (await Promise.all(files.map(async (item) => {
378
- const image = item.type === "local"
379
- ? await terminalImage.file(item.path, options)
380
- : item.type === "file"
381
- ? await terminalImage.buffer(Buffer.from(item.data, "base64"), options)
382
- : undefined;
383
- const link = item.type === "local"
384
- ? withProtocol(item.path, "file://")
385
- : item.type === "url"
386
- ? item.url
387
- : undefined;
388
- const text = [
389
- link ? chalk.cyan(terminalLink(link, link)) : undefined,
390
- item.filename,
391
- item.mimeType ? chalk.gray(item.mimeType) : undefined,
392
- ]
393
- .filter(Boolean)
394
- .join(" ");
395
- return [image, text].filter(Boolean).join(EOL);
396
- })))
397
- .filter(Boolean)
398
- .join(EOL);
399
- }
400
- runningInspectOptions = {
401
- maxArrayLength: 3,
402
- maxStringLength: 200,
403
- };
404
- }
package/dist/type.d.ts DELETED
@@ -1,5 +0,0 @@
1
- import type { AgentInvokeOptions as _AgentInvokeOptions, UserContext } from "@aigne/core";
2
- import type * as prompts from "@inquirer/prompts";
3
- export interface AgentInvokeOptions<U extends UserContext = UserContext> extends _AgentInvokeOptions<U> {
4
- prompts: typeof prompts;
5
- }
package/dist/type.js DELETED
@@ -1 +0,0 @@
1
- export {};
@@ -1,19 +0,0 @@
1
- import { render } from "ink";
2
- export declare function terminalInput({ render: r, ...options }?: {
3
- message?: string;
4
- default?: string;
5
- inline?: boolean;
6
- required?: boolean;
7
- validate?: (input: string) => string | boolean | Promise<string | boolean>;
8
- render?: typeof render;
9
- clear?: boolean;
10
- }): Promise<string>;
11
- export declare function TerminalInput(props: {
12
- message?: string;
13
- default?: string;
14
- inline?: boolean;
15
- required?: boolean;
16
- validate?: (input: string) => string | boolean | Promise<string | boolean>;
17
- onSubmit: (input: string) => void;
18
- onError: (error: Error) => void;
19
- }): import("react/jsx-runtime").JSX.Element;