@aigne/afs-cli 1.11.0-beta.1 → 1.11.0-beta.10

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 (348) hide show
  1. package/README.md +262 -15
  2. package/dist/_virtual/rolldown_runtime.cjs +29 -0
  3. package/dist/_virtual/rolldown_runtime.mjs +7 -0
  4. package/dist/cli.cjs +40 -0
  5. package/dist/cli.d.cts +2 -0
  6. package/dist/cli.d.mts +2 -1
  7. package/dist/cli.mjs +36 -24
  8. package/dist/cli.mjs.map +1 -0
  9. package/dist/config/afs-loader.cjs +578 -0
  10. package/dist/config/afs-loader.d.cts +19 -0
  11. package/dist/config/afs-loader.d.cts.map +1 -0
  12. package/dist/config/afs-loader.d.mts +19 -0
  13. package/dist/config/afs-loader.d.mts.map +1 -0
  14. package/dist/config/afs-loader.mjs +576 -0
  15. package/dist/config/afs-loader.mjs.map +1 -0
  16. package/dist/config/env.cjs +46 -0
  17. package/dist/config/env.mjs +46 -0
  18. package/dist/config/env.mjs.map +1 -0
  19. package/dist/config/loader.cjs +219 -0
  20. package/dist/config/loader.mjs +217 -0
  21. package/dist/config/loader.mjs.map +1 -0
  22. package/dist/config/mount-commands.cjs +226 -0
  23. package/dist/config/mount-commands.d.cts +14 -0
  24. package/dist/config/mount-commands.d.cts.map +1 -0
  25. package/dist/config/mount-commands.d.mts +14 -0
  26. package/dist/config/mount-commands.d.mts.map +1 -0
  27. package/dist/config/mount-commands.mjs +220 -0
  28. package/dist/config/mount-commands.mjs.map +1 -0
  29. package/dist/config/schema.cjs +99 -0
  30. package/dist/config/schema.mjs +98 -0
  31. package/dist/config/schema.mjs.map +1 -0
  32. package/dist/core/commands/delete.cjs +41 -0
  33. package/dist/core/commands/delete.d.cts +18 -0
  34. package/dist/core/commands/delete.d.cts.map +1 -0
  35. package/dist/core/commands/delete.d.mts +18 -0
  36. package/dist/core/commands/delete.d.mts.map +1 -0
  37. package/dist/core/commands/delete.mjs +42 -0
  38. package/dist/core/commands/delete.mjs.map +1 -0
  39. package/dist/core/commands/exec.cjs +98 -0
  40. package/dist/core/commands/exec.d.cts +26 -0
  41. package/dist/core/commands/exec.d.cts.map +1 -0
  42. package/dist/core/commands/exec.d.mts +26 -0
  43. package/dist/core/commands/exec.d.mts.map +1 -0
  44. package/dist/core/commands/exec.mjs +99 -0
  45. package/dist/core/commands/exec.mjs.map +1 -0
  46. package/dist/core/commands/explain.cjs +278 -0
  47. package/dist/core/commands/explain.d.cts +25 -0
  48. package/dist/core/commands/explain.d.cts.map +1 -0
  49. package/dist/core/commands/explain.d.mts +25 -0
  50. package/dist/core/commands/explain.d.mts.map +1 -0
  51. package/dist/core/commands/explain.mjs +279 -0
  52. package/dist/core/commands/explain.mjs.map +1 -0
  53. package/dist/core/commands/explore.cjs +30 -0
  54. package/dist/core/commands/explore.d.mts +2 -0
  55. package/dist/core/commands/explore.mjs +31 -0
  56. package/dist/core/commands/explore.mjs.map +1 -0
  57. package/dist/core/commands/index.cjs +36 -0
  58. package/dist/core/commands/index.d.cts +21 -0
  59. package/dist/core/commands/index.d.cts.map +1 -0
  60. package/dist/core/commands/index.d.mts +24 -0
  61. package/dist/core/commands/index.d.mts.map +1 -0
  62. package/dist/core/commands/index.mjs +37 -0
  63. package/dist/core/commands/index.mjs.map +1 -0
  64. package/dist/core/commands/ls.cjs +57 -0
  65. package/dist/core/commands/ls.d.cts +21 -0
  66. package/dist/core/commands/ls.d.cts.map +1 -0
  67. package/dist/core/commands/ls.d.mts +21 -0
  68. package/dist/core/commands/ls.d.mts.map +1 -0
  69. package/dist/core/commands/ls.mjs +58 -0
  70. package/dist/core/commands/ls.mjs.map +1 -0
  71. package/dist/core/commands/mount.cjs +222 -0
  72. package/dist/core/commands/mount.d.cts +35 -0
  73. package/dist/core/commands/mount.d.cts.map +1 -0
  74. package/dist/core/commands/mount.d.mts +35 -0
  75. package/dist/core/commands/mount.d.mts.map +1 -0
  76. package/dist/core/commands/mount.mjs +223 -0
  77. package/dist/core/commands/mount.mjs.map +1 -0
  78. package/dist/core/commands/read.cjs +48 -0
  79. package/dist/core/commands/read.d.cts +17 -0
  80. package/dist/core/commands/read.d.cts.map +1 -0
  81. package/dist/core/commands/read.d.mts +17 -0
  82. package/dist/core/commands/read.d.mts.map +1 -0
  83. package/dist/core/commands/read.mjs +49 -0
  84. package/dist/core/commands/read.mjs.map +1 -0
  85. package/dist/core/commands/search.cjs +40 -0
  86. package/dist/core/commands/search.d.mts +2 -0
  87. package/dist/core/commands/search.mjs +41 -0
  88. package/dist/core/commands/search.mjs.map +1 -0
  89. package/dist/core/commands/serve.cjs +267 -0
  90. package/dist/core/commands/serve.d.mts +2 -0
  91. package/dist/core/commands/serve.mjs +267 -0
  92. package/dist/core/commands/serve.mjs.map +1 -0
  93. package/dist/core/commands/stat.cjs +53 -0
  94. package/dist/core/commands/stat.d.cts +17 -0
  95. package/dist/core/commands/stat.d.cts.map +1 -0
  96. package/dist/core/commands/stat.d.mts +17 -0
  97. package/dist/core/commands/stat.d.mts.map +1 -0
  98. package/dist/core/commands/stat.mjs +54 -0
  99. package/dist/core/commands/stat.mjs.map +1 -0
  100. package/dist/core/commands/types.cjs +18 -0
  101. package/dist/core/commands/types.d.cts +54 -0
  102. package/dist/core/commands/types.d.cts.map +1 -0
  103. package/dist/core/commands/types.d.mts +54 -0
  104. package/dist/core/commands/types.d.mts.map +1 -0
  105. package/dist/core/commands/types.mjs +19 -0
  106. package/dist/core/commands/types.mjs.map +1 -0
  107. package/dist/core/commands/write.cjs +70 -0
  108. package/dist/core/commands/write.d.cts +20 -0
  109. package/dist/core/commands/write.d.cts.map +1 -0
  110. package/dist/core/commands/write.d.mts +20 -0
  111. package/dist/core/commands/write.d.mts.map +1 -0
  112. package/dist/core/commands/write.mjs +71 -0
  113. package/dist/core/commands/write.mjs.map +1 -0
  114. package/dist/core/executor/index.cjs +196 -0
  115. package/dist/core/executor/index.d.cts +77 -0
  116. package/dist/core/executor/index.d.cts.map +1 -0
  117. package/dist/core/executor/index.d.mts +77 -0
  118. package/dist/core/executor/index.d.mts.map +1 -0
  119. package/dist/core/executor/index.mjs +195 -0
  120. package/dist/core/executor/index.mjs.map +1 -0
  121. package/dist/core/formatters/delete.cjs +37 -0
  122. package/dist/core/formatters/delete.d.cts +18 -0
  123. package/dist/core/formatters/delete.d.cts.map +1 -0
  124. package/dist/core/formatters/delete.d.mts +18 -0
  125. package/dist/core/formatters/delete.d.mts.map +1 -0
  126. package/dist/core/formatters/delete.mjs +37 -0
  127. package/dist/core/formatters/delete.mjs.map +1 -0
  128. package/dist/core/formatters/exec.cjs +60 -0
  129. package/dist/core/formatters/exec.d.cts +18 -0
  130. package/dist/core/formatters/exec.d.cts.map +1 -0
  131. package/dist/core/formatters/exec.d.mts +18 -0
  132. package/dist/core/formatters/exec.d.mts.map +1 -0
  133. package/dist/core/formatters/exec.mjs +60 -0
  134. package/dist/core/formatters/exec.mjs.map +1 -0
  135. package/dist/core/formatters/explain.cjs +99 -0
  136. package/dist/core/formatters/explain.d.cts +11 -0
  137. package/dist/core/formatters/explain.d.cts.map +1 -0
  138. package/dist/core/formatters/explain.d.mts +11 -0
  139. package/dist/core/formatters/explain.d.mts.map +1 -0
  140. package/dist/core/formatters/explain.mjs +98 -0
  141. package/dist/core/formatters/explain.mjs.map +1 -0
  142. package/dist/core/formatters/index.d.mts +9 -0
  143. package/dist/core/formatters/ls.cjs +179 -0
  144. package/dist/core/formatters/ls.d.cts +20 -0
  145. package/dist/core/formatters/ls.d.cts.map +1 -0
  146. package/dist/core/formatters/ls.d.mts +20 -0
  147. package/dist/core/formatters/ls.d.mts.map +1 -0
  148. package/dist/core/formatters/ls.mjs +179 -0
  149. package/dist/core/formatters/ls.mjs.map +1 -0
  150. package/dist/core/formatters/mount.cjs +55 -0
  151. package/dist/core/formatters/mount.d.cts +15 -0
  152. package/dist/core/formatters/mount.d.cts.map +1 -0
  153. package/dist/core/formatters/mount.d.mts +15 -0
  154. package/dist/core/formatters/mount.d.mts.map +1 -0
  155. package/dist/core/formatters/mount.mjs +55 -0
  156. package/dist/core/formatters/mount.mjs.map +1 -0
  157. package/dist/core/formatters/read.cjs +100 -0
  158. package/dist/core/formatters/read.d.cts +22 -0
  159. package/dist/core/formatters/read.d.cts.map +1 -0
  160. package/dist/core/formatters/read.d.mts +22 -0
  161. package/dist/core/formatters/read.d.mts.map +1 -0
  162. package/dist/core/formatters/read.mjs +100 -0
  163. package/dist/core/formatters/read.mjs.map +1 -0
  164. package/dist/core/formatters/search.cjs +44 -0
  165. package/dist/core/formatters/search.d.mts +1 -0
  166. package/dist/core/formatters/search.mjs +44 -0
  167. package/dist/core/formatters/search.mjs.map +1 -0
  168. package/dist/core/formatters/stat.cjs +155 -0
  169. package/dist/core/formatters/stat.d.cts +15 -0
  170. package/dist/core/formatters/stat.d.cts.map +1 -0
  171. package/dist/core/formatters/stat.d.mts +15 -0
  172. package/dist/core/formatters/stat.d.mts.map +1 -0
  173. package/dist/core/formatters/stat.mjs +155 -0
  174. package/dist/core/formatters/stat.mjs.map +1 -0
  175. package/dist/core/formatters/write.cjs +51 -0
  176. package/dist/core/formatters/write.d.cts +22 -0
  177. package/dist/core/formatters/write.d.cts.map +1 -0
  178. package/dist/core/formatters/write.d.mts +22 -0
  179. package/dist/core/formatters/write.d.mts.map +1 -0
  180. package/dist/core/formatters/write.mjs +51 -0
  181. package/dist/core/formatters/write.mjs.map +1 -0
  182. package/dist/core/helpers/exec-args.cjs +142 -0
  183. package/dist/core/helpers/exec-args.d.cts +46 -0
  184. package/dist/core/helpers/exec-args.d.cts.map +1 -0
  185. package/dist/core/helpers/exec-args.d.mts +46 -0
  186. package/dist/core/helpers/exec-args.d.mts.map +1 -0
  187. package/dist/core/helpers/exec-args.mjs +139 -0
  188. package/dist/core/helpers/exec-args.mjs.map +1 -0
  189. package/dist/core/helpers/stdin.cjs +41 -0
  190. package/dist/core/helpers/stdin.d.cts +15 -0
  191. package/dist/core/helpers/stdin.d.cts.map +1 -0
  192. package/dist/core/helpers/stdin.d.mts +15 -0
  193. package/dist/core/helpers/stdin.d.mts.map +1 -0
  194. package/dist/core/helpers/stdin.mjs +41 -0
  195. package/dist/core/helpers/stdin.mjs.map +1 -0
  196. package/dist/core/index.cjs +49 -0
  197. package/dist/core/index.d.cts +24 -0
  198. package/dist/core/index.d.mts +25 -0
  199. package/dist/core/index.mjs +24 -0
  200. package/dist/core/path-utils.cjs +1 -0
  201. package/dist/core/path-utils.mjs +3 -0
  202. package/dist/core/types.d.cts +24 -0
  203. package/dist/core/types.d.cts.map +1 -0
  204. package/dist/core/types.d.mts +24 -0
  205. package/dist/core/types.d.mts.map +1 -0
  206. package/dist/credential/auth-server.cjs +247 -0
  207. package/dist/credential/auth-server.mjs +247 -0
  208. package/dist/credential/auth-server.mjs.map +1 -0
  209. package/dist/credential/cli-auth-context.cjs +86 -0
  210. package/dist/credential/cli-auth-context.d.mts +1 -0
  211. package/dist/credential/cli-auth-context.mjs +86 -0
  212. package/dist/credential/cli-auth-context.mjs.map +1 -0
  213. package/dist/credential/index.cjs +5 -0
  214. package/dist/credential/index.d.mts +4 -0
  215. package/dist/credential/index.mjs +7 -0
  216. package/dist/credential/mcp-auth-context.cjs +186 -0
  217. package/dist/credential/mcp-auth-context.d.mts +1 -0
  218. package/dist/credential/mcp-auth-context.mjs +186 -0
  219. package/dist/credential/mcp-auth-context.mjs.map +1 -0
  220. package/dist/credential/resolver.cjs +127 -0
  221. package/dist/credential/resolver.d.mts +1 -0
  222. package/dist/credential/resolver.mjs +127 -0
  223. package/dist/credential/resolver.mjs.map +1 -0
  224. package/dist/credential/store.cjs +106 -0
  225. package/dist/credential/store.d.cts +30 -0
  226. package/dist/credential/store.d.cts.map +1 -0
  227. package/dist/credential/store.d.mts +30 -0
  228. package/dist/credential/store.d.mts.map +1 -0
  229. package/dist/credential/store.mjs +106 -0
  230. package/dist/credential/store.mjs.map +1 -0
  231. package/dist/errors.cjs +18 -0
  232. package/dist/errors.mjs +18 -0
  233. package/dist/errors.mjs.map +1 -0
  234. package/dist/explorer/actions.cjs +311 -0
  235. package/dist/explorer/actions.mjs +305 -0
  236. package/dist/explorer/actions.mjs.map +1 -0
  237. package/dist/explorer/components/dialog.cjs +508 -0
  238. package/dist/explorer/components/dialog.mjs +509 -0
  239. package/dist/explorer/components/dialog.mjs.map +1 -0
  240. package/dist/explorer/components/file-list.cjs +107 -0
  241. package/dist/explorer/components/file-list.mjs +107 -0
  242. package/dist/explorer/components/file-list.mjs.map +1 -0
  243. package/dist/explorer/components/function-bar.cjs +55 -0
  244. package/dist/explorer/components/function-bar.mjs +55 -0
  245. package/dist/explorer/components/function-bar.mjs.map +1 -0
  246. package/dist/explorer/components/index.cjs +5 -0
  247. package/dist/explorer/components/index.mjs +7 -0
  248. package/dist/explorer/components/metadata-panel.cjs +219 -0
  249. package/dist/explorer/components/metadata-panel.mjs +219 -0
  250. package/dist/explorer/components/metadata-panel.mjs.map +1 -0
  251. package/dist/explorer/components/status-bar.cjs +53 -0
  252. package/dist/explorer/components/status-bar.mjs +54 -0
  253. package/dist/explorer/components/status-bar.mjs.map +1 -0
  254. package/dist/explorer/keybindings.cjs +214 -0
  255. package/dist/explorer/keybindings.mjs +213 -0
  256. package/dist/explorer/keybindings.mjs.map +1 -0
  257. package/dist/explorer/screen.cjs +251 -0
  258. package/dist/explorer/screen.d.cts +23 -0
  259. package/dist/explorer/screen.d.cts.map +1 -0
  260. package/dist/explorer/screen.d.mts +23 -0
  261. package/dist/explorer/screen.d.mts.map +1 -0
  262. package/dist/explorer/screen.mjs +250 -0
  263. package/dist/explorer/screen.mjs.map +1 -0
  264. package/dist/explorer/state.cjs +53 -0
  265. package/dist/explorer/state.mjs +53 -0
  266. package/dist/explorer/state.mjs.map +1 -0
  267. package/dist/explorer/theme.cjs +160 -0
  268. package/dist/explorer/theme.mjs +157 -0
  269. package/dist/explorer/theme.mjs.map +1 -0
  270. package/dist/index.cjs +12 -0
  271. package/dist/index.d.cts +6 -0
  272. package/dist/index.d.mts +7 -4
  273. package/dist/index.mjs +7 -2
  274. package/dist/mcp/http-transport.cjs +87 -0
  275. package/dist/mcp/http-transport.mjs +87 -0
  276. package/dist/mcp/http-transport.mjs.map +1 -0
  277. package/dist/mcp/prompts.cjs +48 -0
  278. package/dist/mcp/prompts.mjs +48 -0
  279. package/dist/mcp/prompts.mjs.map +1 -0
  280. package/dist/mcp/resources.cjs +25 -0
  281. package/dist/mcp/resources.mjs +25 -0
  282. package/dist/mcp/resources.mjs.map +1 -0
  283. package/dist/mcp/server.cjs +74 -0
  284. package/dist/mcp/server.mjs +73 -0
  285. package/dist/mcp/server.mjs.map +1 -0
  286. package/dist/mcp/tools.cjs +152 -0
  287. package/dist/mcp/tools.mjs +152 -0
  288. package/dist/mcp/tools.mjs.map +1 -0
  289. package/dist/node_modules/.pnpm/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/dist/index.d.cts +10 -0
  290. package/dist/node_modules/.pnpm/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/dist/index.d.cts.map +1 -0
  291. package/dist/node_modules/.pnpm/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/dist/index.d.mts +10 -0
  292. package/dist/node_modules/.pnpm/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/dist/index.d.mts.map +1 -0
  293. package/dist/node_modules/.pnpm/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/dist/types.d.cts +46 -0
  294. package/dist/node_modules/.pnpm/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/dist/types.d.cts.map +1 -0
  295. package/dist/node_modules/.pnpm/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/dist/types.d.mts +46 -0
  296. package/dist/node_modules/.pnpm/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/dist/types.d.mts.map +1 -0
  297. package/dist/node_modules/.pnpm/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/dist/urlpattern.cjs +902 -0
  298. package/dist/node_modules/.pnpm/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/dist/urlpattern.mjs +902 -0
  299. package/dist/node_modules/.pnpm/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/dist/urlpattern.mjs.map +1 -0
  300. package/dist/node_modules/.pnpm/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/index.cjs +6 -0
  301. package/dist/node_modules/.pnpm/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/index.mjs +8 -0
  302. package/dist/node_modules/.pnpm/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/index.mjs.map +1 -0
  303. package/dist/path-utils.cjs +105 -0
  304. package/dist/path-utils.d.cts +50 -0
  305. package/dist/path-utils.d.cts.map +1 -0
  306. package/dist/path-utils.d.mts +50 -0
  307. package/dist/path-utils.d.mts.map +1 -0
  308. package/dist/path-utils.mjs +104 -0
  309. package/dist/path-utils.mjs.map +1 -0
  310. package/dist/repl.cjs +491 -0
  311. package/dist/repl.d.cts +15 -0
  312. package/dist/repl.d.cts.map +1 -0
  313. package/dist/repl.d.mts +16 -0
  314. package/dist/repl.d.mts.map +1 -0
  315. package/dist/repl.mjs +491 -0
  316. package/dist/repl.mjs.map +1 -0
  317. package/dist/serve.cjs +146 -0
  318. package/dist/serve.d.cts +41 -0
  319. package/dist/serve.d.cts.map +1 -0
  320. package/dist/serve.d.mts +41 -0
  321. package/dist/serve.d.mts.map +1 -0
  322. package/dist/serve.mjs +146 -0
  323. package/dist/serve.mjs.map +1 -0
  324. package/dist/ui/header.cjs +12 -0
  325. package/dist/ui/header.mjs +13 -0
  326. package/dist/ui/header.mjs.map +1 -0
  327. package/dist/ui/index.cjs +8 -0
  328. package/dist/ui/index.mjs +9 -0
  329. package/dist/ui/index.mjs.map +1 -0
  330. package/dist/ui/terminal.cjs +88 -0
  331. package/dist/ui/terminal.mjs +88 -0
  332. package/dist/ui/terminal.mjs.map +1 -0
  333. package/dist/version.cjs +9 -0
  334. package/dist/version.d.cts +5 -0
  335. package/dist/version.d.cts.map +1 -0
  336. package/dist/version.d.mts +5 -0
  337. package/dist/version.d.mts.map +1 -0
  338. package/dist/version.mjs +9 -0
  339. package/dist/version.mjs.map +1 -0
  340. package/package.json +77 -11
  341. package/.turbo/turbo-build.log +0 -18
  342. package/.turbo/turbo-check-types.log +0 -4
  343. package/dist/version--p6A8sKX.mjs +0 -5
  344. package/src/cli.test.ts +0 -8
  345. package/src/cli.ts +0 -29
  346. package/src/index.ts +0 -7
  347. package/src/version.ts +0 -1
  348. package/tsconfig.json +0 -16
package/dist/serve.cjs ADDED
@@ -0,0 +1,146 @@
1
+ const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
2
+ const require_index = require('./ui/index.cjs');
3
+ const require_afs_loader = require('./config/afs-loader.cjs');
4
+ let node_http = require("node:http");
5
+ let _aigne_afs_http = require("@aigne/afs-http");
6
+
7
+ //#region src/serve.ts
8
+ /**
9
+ * Create an AFSModule wrapper around AFS instance
10
+ */
11
+ function createAFSModule(afs, readonly) {
12
+ return {
13
+ name: "afs-server",
14
+ accessMode: readonly ? "readonly" : "readwrite",
15
+ async list(path, options) {
16
+ return afs.list(path, options);
17
+ },
18
+ async read(path, options) {
19
+ return afs.read(path, options);
20
+ },
21
+ async write(path, content, options) {
22
+ if (readonly) throw new Error("Server is in readonly mode");
23
+ return afs.write(path, content, options);
24
+ },
25
+ async delete(path, options) {
26
+ if (readonly) throw new Error("Server is in readonly mode");
27
+ return afs.delete(path, options);
28
+ },
29
+ async search(path, query, options) {
30
+ return afs.search(path, query, options);
31
+ },
32
+ async stat(path, options) {
33
+ return afs.stat(path, options);
34
+ },
35
+ async explain(path, options) {
36
+ return afs.explain(path, options);
37
+ },
38
+ async exec(path, args, options) {
39
+ if (readonly) throw new Error("Server is in readonly mode");
40
+ return afs.exec(path, args, options);
41
+ },
42
+ async rename(oldPath, newPath, options) {
43
+ if (readonly) throw new Error("Server is in readonly mode");
44
+ return afs.rename(oldPath, newPath, options);
45
+ }
46
+ };
47
+ }
48
+ /**
49
+ * Start an AFS HTTP server
50
+ *
51
+ * Loads AFS from config in cwd, wraps it as an AFSModule, and starts
52
+ * an HTTP server. Blocks until the server is shut down (Ctrl+C / SIGTERM).
53
+ */
54
+ async function startServe(options) {
55
+ const { cwd, host = "localhost", port = 3e3, path: basePath = "/afs", readonly = false, cors = false, token, maxBodySize = 10 * 1024 * 1024, onExit, onProgress, extraProviders } = options;
56
+ const { afs, failures } = await require_afs_loader.createAFS(cwd, { onProgress });
57
+ if (extraProviders) for (const { provider, mountPath } of extraProviders) try {
58
+ await afs.mount(provider, mountPath);
59
+ } catch (e) {
60
+ const msg = e instanceof Error ? e.message : String(e);
61
+ console.warn(` ${require_index.colors.yellow("⚠")} extra provider ${mountPath}: ${msg}`);
62
+ }
63
+ if (failures.length > 0) {
64
+ console.warn(`${failures.length} provider(s) failed to mount:`);
65
+ for (const f of failures) console.warn(` ${require_index.colors.yellow("⚠")} ${f.path}: ${f.reason}`);
66
+ }
67
+ const mounts = afs.getMounts();
68
+ const handler = (0, _aigne_afs_http.createAFSHttpHandler)({
69
+ module: createAFSModule(afs, readonly),
70
+ maxBodySize,
71
+ token
72
+ });
73
+ const server = (0, node_http.createServer)(async (req, res) => {
74
+ const url = new URL(req.url || "/", `http://${req.headers.host}`);
75
+ const timestamp = (/* @__PURE__ */ new Date()).toISOString();
76
+ console.error(`${timestamp} ${req.method} ${url.pathname}`);
77
+ if (cors) {
78
+ res.setHeader("Access-Control-Allow-Origin", "*");
79
+ res.setHeader("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS");
80
+ res.setHeader("Access-Control-Allow-Headers", "Content-Type, Authorization");
81
+ if (req.method === "OPTIONS") {
82
+ res.writeHead(204);
83
+ res.end();
84
+ return;
85
+ }
86
+ }
87
+ if (!url.pathname.startsWith(basePath)) {
88
+ res.writeHead(404, { "Content-Type": "application/json" });
89
+ res.end(JSON.stringify({
90
+ code: 1,
91
+ error: "Not found"
92
+ }));
93
+ return;
94
+ }
95
+ const headers = new Headers();
96
+ for (const [key, value] of Object.entries(req.headers)) if (value) headers.append(key, Array.isArray(value) ? value.join(", ") : value);
97
+ const chunks = [];
98
+ for await (const chunk of req) chunks.push(chunk);
99
+ const body = Buffer.concat(chunks);
100
+ const request = new Request(`http://${req.headers.host}${req.url}`, {
101
+ method: req.method,
102
+ headers,
103
+ body: body.length > 0 ? body : void 0
104
+ });
105
+ try {
106
+ const response = await handler(request);
107
+ res.writeHead(response.status, { "Content-Type": response.headers.get("Content-Type") || "application/json" });
108
+ const responseBody = await response.text();
109
+ res.end(responseBody);
110
+ } catch (error) {
111
+ console.error("Error handling request:", error);
112
+ res.writeHead(500, { "Content-Type": "application/json" });
113
+ res.end(JSON.stringify({
114
+ code: 5,
115
+ error: "Internal server error"
116
+ }));
117
+ }
118
+ });
119
+ await new Promise((resolve, reject) => {
120
+ server.listen(port, host, () => resolve());
121
+ server.on("error", reject);
122
+ });
123
+ const serverUrl = `http://${host}:${port}${basePath}`;
124
+ console.log(require_index.colors.green("AFS HTTP Server started"));
125
+ console.log(require_index.colors.bold("Mounted providers:"));
126
+ for (const m of mounts) console.log(` ${require_index.colors.cyan(m.path.padEnd(20))} ${require_index.colors.dim(m.module.name)}`);
127
+ console.log("");
128
+ console.log(`${require_index.colors.dim("Listening on:")} ${require_index.colors.brightCyan(serverUrl)}`);
129
+ console.log(require_index.colors.dim("Press Ctrl+C to stop"));
130
+ let shuttingDown = false;
131
+ const shutdown = async () => {
132
+ if (shuttingDown) return;
133
+ shuttingDown = true;
134
+ console.error("\nShutting down server...");
135
+ server.close();
136
+ if (onExit) await onExit();
137
+ };
138
+ process.on("SIGINT", shutdown);
139
+ process.on("SIGTERM", shutdown);
140
+ await new Promise((resolve) => {
141
+ server.on("close", resolve);
142
+ });
143
+ }
144
+
145
+ //#endregion
146
+ exports.startServe = startServe;
@@ -0,0 +1,41 @@
1
+ import { CreateAFSOptions } from "./config/afs-loader.cjs";
2
+ import { AFSModule } from "@aigne/afs";
3
+
4
+ //#region src/serve.d.ts
5
+ interface StartServeOptions {
6
+ /** Working directory containing .afs-config/config.toml */
7
+ cwd: string;
8
+ /** Host to bind (default: "localhost") */
9
+ host?: string;
10
+ /** Port to listen on (default: 3000) */
11
+ port?: number;
12
+ /** API base path (default: "/afs") */
13
+ path?: string;
14
+ /** Read-only mode (default: false) */
15
+ readonly?: boolean;
16
+ /** Enable CORS (default: false) */
17
+ cors?: boolean;
18
+ /** Authorization token */
19
+ token?: string;
20
+ /** Maximum request body size in bytes (default: 10MB) */
21
+ maxBodySize?: number;
22
+ /** Callback when server is shutting down */
23
+ onExit?: () => Promise<void>;
24
+ /** AFS loading progress callback */
25
+ onProgress?: CreateAFSOptions["onProgress"];
26
+ /** Pre-created providers to mount directly (e.g. mock-based providers that can't be recreated from URI) */
27
+ extraProviders?: Array<{
28
+ provider: AFSModule;
29
+ mountPath: string;
30
+ }>;
31
+ }
32
+ /**
33
+ * Start an AFS HTTP server
34
+ *
35
+ * Loads AFS from config in cwd, wraps it as an AFSModule, and starts
36
+ * an HTTP server. Blocks until the server is shut down (Ctrl+C / SIGTERM).
37
+ */
38
+ declare function startServe(options: StartServeOptions): Promise<void>;
39
+ //#endregion
40
+ export { StartServeOptions, startServe };
41
+ //# sourceMappingURL=serve.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serve.d.cts","names":[],"sources":["../src/serve.ts"],"mappings":";;;;UAciB,iBAAA;EAsBoB;EApBnC,GAAA;EAoBsB;EAlBtB,IAAA;EAFA;EAIA,IAAA;EAAA;EAEA,IAAA;EAEA;EAAA,QAAA;EAIA;EAFA,IAAA;EAMA;EAJA,KAAA;EAMA;EAJA,WAAA;EAMA;EAJA,MAAA,SAAe,OAAA;EAIU;EAFzB,UAAA,GAAa,gBAAA;EAEiC;EAA9C,cAAA,GAAiB,KAAA;IAAQ,QAAA,EAAU,SAAA;IAAW,SAAA;EAAA;AAAA;;;;;;;iBA0D1B,UAAA,CAAW,OAAA,EAAS,iBAAA,GAAoB,OAAA"}
@@ -0,0 +1,41 @@
1
+ import { CreateAFSOptions } from "./config/afs-loader.mjs";
2
+ import { AFSModule } from "@aigne/afs";
3
+
4
+ //#region src/serve.d.ts
5
+ interface StartServeOptions {
6
+ /** Working directory containing .afs-config/config.toml */
7
+ cwd: string;
8
+ /** Host to bind (default: "localhost") */
9
+ host?: string;
10
+ /** Port to listen on (default: 3000) */
11
+ port?: number;
12
+ /** API base path (default: "/afs") */
13
+ path?: string;
14
+ /** Read-only mode (default: false) */
15
+ readonly?: boolean;
16
+ /** Enable CORS (default: false) */
17
+ cors?: boolean;
18
+ /** Authorization token */
19
+ token?: string;
20
+ /** Maximum request body size in bytes (default: 10MB) */
21
+ maxBodySize?: number;
22
+ /** Callback when server is shutting down */
23
+ onExit?: () => Promise<void>;
24
+ /** AFS loading progress callback */
25
+ onProgress?: CreateAFSOptions["onProgress"];
26
+ /** Pre-created providers to mount directly (e.g. mock-based providers that can't be recreated from URI) */
27
+ extraProviders?: Array<{
28
+ provider: AFSModule;
29
+ mountPath: string;
30
+ }>;
31
+ }
32
+ /**
33
+ * Start an AFS HTTP server
34
+ *
35
+ * Loads AFS from config in cwd, wraps it as an AFSModule, and starts
36
+ * an HTTP server. Blocks until the server is shut down (Ctrl+C / SIGTERM).
37
+ */
38
+ declare function startServe(options: StartServeOptions): Promise<void>;
39
+ //#endregion
40
+ export { StartServeOptions, startServe };
41
+ //# sourceMappingURL=serve.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serve.d.mts","names":[],"sources":["../src/serve.ts"],"mappings":";;;;UAciB,iBAAA;EAsBoB;EApBnC,GAAA;EAoBsB;EAlBtB,IAAA;EAFA;EAIA,IAAA;EAAA;EAEA,IAAA;EAEA;EAAA,QAAA;EAIA;EAFA,IAAA;EAMA;EAJA,KAAA;EAMA;EAJA,WAAA;EAMA;EAJA,MAAA,SAAe,OAAA;EAIU;EAFzB,UAAA,GAAa,gBAAA;EAEiC;EAA9C,cAAA,GAAiB,KAAA;IAAQ,QAAA,EAAU,SAAA;IAAW,SAAA;EAAA;AAAA;;;;;;;iBA0D1B,UAAA,CAAW,OAAA,EAAS,iBAAA,GAAoB,OAAA"}
package/dist/serve.mjs ADDED
@@ -0,0 +1,146 @@
1
+ import { colors } from "./ui/index.mjs";
2
+ import { createAFS } from "./config/afs-loader.mjs";
3
+ import { createServer } from "node:http";
4
+ import { createAFSHttpHandler } from "@aigne/afs-http";
5
+
6
+ //#region src/serve.ts
7
+ /**
8
+ * Create an AFSModule wrapper around AFS instance
9
+ */
10
+ function createAFSModule(afs, readonly) {
11
+ return {
12
+ name: "afs-server",
13
+ accessMode: readonly ? "readonly" : "readwrite",
14
+ async list(path, options) {
15
+ return afs.list(path, options);
16
+ },
17
+ async read(path, options) {
18
+ return afs.read(path, options);
19
+ },
20
+ async write(path, content, options) {
21
+ if (readonly) throw new Error("Server is in readonly mode");
22
+ return afs.write(path, content, options);
23
+ },
24
+ async delete(path, options) {
25
+ if (readonly) throw new Error("Server is in readonly mode");
26
+ return afs.delete(path, options);
27
+ },
28
+ async search(path, query, options) {
29
+ return afs.search(path, query, options);
30
+ },
31
+ async stat(path, options) {
32
+ return afs.stat(path, options);
33
+ },
34
+ async explain(path, options) {
35
+ return afs.explain(path, options);
36
+ },
37
+ async exec(path, args, options) {
38
+ if (readonly) throw new Error("Server is in readonly mode");
39
+ return afs.exec(path, args, options);
40
+ },
41
+ async rename(oldPath, newPath, options) {
42
+ if (readonly) throw new Error("Server is in readonly mode");
43
+ return afs.rename(oldPath, newPath, options);
44
+ }
45
+ };
46
+ }
47
+ /**
48
+ * Start an AFS HTTP server
49
+ *
50
+ * Loads AFS from config in cwd, wraps it as an AFSModule, and starts
51
+ * an HTTP server. Blocks until the server is shut down (Ctrl+C / SIGTERM).
52
+ */
53
+ async function startServe(options) {
54
+ const { cwd, host = "localhost", port = 3e3, path: basePath = "/afs", readonly = false, cors = false, token, maxBodySize = 10 * 1024 * 1024, onExit, onProgress, extraProviders } = options;
55
+ const { afs, failures } = await createAFS(cwd, { onProgress });
56
+ if (extraProviders) for (const { provider, mountPath } of extraProviders) try {
57
+ await afs.mount(provider, mountPath);
58
+ } catch (e) {
59
+ const msg = e instanceof Error ? e.message : String(e);
60
+ console.warn(` ${colors.yellow("⚠")} extra provider ${mountPath}: ${msg}`);
61
+ }
62
+ if (failures.length > 0) {
63
+ console.warn(`${failures.length} provider(s) failed to mount:`);
64
+ for (const f of failures) console.warn(` ${colors.yellow("⚠")} ${f.path}: ${f.reason}`);
65
+ }
66
+ const mounts = afs.getMounts();
67
+ const handler = createAFSHttpHandler({
68
+ module: createAFSModule(afs, readonly),
69
+ maxBodySize,
70
+ token
71
+ });
72
+ const server = createServer(async (req, res) => {
73
+ const url = new URL(req.url || "/", `http://${req.headers.host}`);
74
+ const timestamp = (/* @__PURE__ */ new Date()).toISOString();
75
+ console.error(`${timestamp} ${req.method} ${url.pathname}`);
76
+ if (cors) {
77
+ res.setHeader("Access-Control-Allow-Origin", "*");
78
+ res.setHeader("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS");
79
+ res.setHeader("Access-Control-Allow-Headers", "Content-Type, Authorization");
80
+ if (req.method === "OPTIONS") {
81
+ res.writeHead(204);
82
+ res.end();
83
+ return;
84
+ }
85
+ }
86
+ if (!url.pathname.startsWith(basePath)) {
87
+ res.writeHead(404, { "Content-Type": "application/json" });
88
+ res.end(JSON.stringify({
89
+ code: 1,
90
+ error: "Not found"
91
+ }));
92
+ return;
93
+ }
94
+ const headers = new Headers();
95
+ for (const [key, value] of Object.entries(req.headers)) if (value) headers.append(key, Array.isArray(value) ? value.join(", ") : value);
96
+ const chunks = [];
97
+ for await (const chunk of req) chunks.push(chunk);
98
+ const body = Buffer.concat(chunks);
99
+ const request = new Request(`http://${req.headers.host}${req.url}`, {
100
+ method: req.method,
101
+ headers,
102
+ body: body.length > 0 ? body : void 0
103
+ });
104
+ try {
105
+ const response = await handler(request);
106
+ res.writeHead(response.status, { "Content-Type": response.headers.get("Content-Type") || "application/json" });
107
+ const responseBody = await response.text();
108
+ res.end(responseBody);
109
+ } catch (error) {
110
+ console.error("Error handling request:", error);
111
+ res.writeHead(500, { "Content-Type": "application/json" });
112
+ res.end(JSON.stringify({
113
+ code: 5,
114
+ error: "Internal server error"
115
+ }));
116
+ }
117
+ });
118
+ await new Promise((resolve, reject) => {
119
+ server.listen(port, host, () => resolve());
120
+ server.on("error", reject);
121
+ });
122
+ const serverUrl = `http://${host}:${port}${basePath}`;
123
+ console.log(colors.green("AFS HTTP Server started"));
124
+ console.log(colors.bold("Mounted providers:"));
125
+ for (const m of mounts) console.log(` ${colors.cyan(m.path.padEnd(20))} ${colors.dim(m.module.name)}`);
126
+ console.log("");
127
+ console.log(`${colors.dim("Listening on:")} ${colors.brightCyan(serverUrl)}`);
128
+ console.log(colors.dim("Press Ctrl+C to stop"));
129
+ let shuttingDown = false;
130
+ const shutdown = async () => {
131
+ if (shuttingDown) return;
132
+ shuttingDown = true;
133
+ console.error("\nShutting down server...");
134
+ server.close();
135
+ if (onExit) await onExit();
136
+ };
137
+ process.on("SIGINT", shutdown);
138
+ process.on("SIGTERM", shutdown);
139
+ await new Promise((resolve) => {
140
+ server.on("close", resolve);
141
+ });
142
+ }
143
+
144
+ //#endregion
145
+ export { startServe };
146
+ //# sourceMappingURL=serve.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serve.mjs","names":[],"sources":["../src/serve.ts"],"sourcesContent":["/**\n * AFS Serve - Standalone serve function\n *\n * Starts an HTTP server exposing AFS providers over HTTP transport.\n * Can be called programmatically (e.g., from playground) without yargs.\n */\n\nimport type { IncomingMessage, ServerResponse } from \"node:http\";\nimport { createServer } from \"node:http\";\nimport type { AFS, AFSModule } from \"@aigne/afs\";\nimport { createAFSHttpHandler } from \"@aigne/afs-http\";\nimport { type CreateAFSOptions, createAFS } from \"./config/afs-loader.js\";\nimport { colors } from \"./ui/index.js\";\n\nexport interface StartServeOptions {\n /** Working directory containing .afs-config/config.toml */\n cwd: string;\n /** Host to bind (default: \"localhost\") */\n host?: string;\n /** Port to listen on (default: 3000) */\n port?: number;\n /** API base path (default: \"/afs\") */\n path?: string;\n /** Read-only mode (default: false) */\n readonly?: boolean;\n /** Enable CORS (default: false) */\n cors?: boolean;\n /** Authorization token */\n token?: string;\n /** Maximum request body size in bytes (default: 10MB) */\n maxBodySize?: number;\n /** Callback when server is shutting down */\n onExit?: () => Promise<void>;\n /** AFS loading progress callback */\n onProgress?: CreateAFSOptions[\"onProgress\"];\n /** Pre-created providers to mount directly (e.g. mock-based providers that can't be recreated from URI) */\n extraProviders?: Array<{ provider: AFSModule; mountPath: string }>;\n}\n\n/**\n * Create an AFSModule wrapper around AFS instance\n */\nfunction createAFSModule(afs: AFS, readonly: boolean): AFSModule {\n return {\n name: \"afs-server\",\n accessMode: readonly ? \"readonly\" : \"readwrite\",\n async list(path, options) {\n return afs.list(path, options);\n },\n async read(path, options) {\n return afs.read(path, options);\n },\n async write(path, content, options) {\n if (readonly) {\n throw new Error(\"Server is in readonly mode\");\n }\n return afs.write(path, content, options);\n },\n async delete(path, options) {\n if (readonly) {\n throw new Error(\"Server is in readonly mode\");\n }\n return afs.delete(path, options);\n },\n async search(path, query, options) {\n return afs.search(path, query, options);\n },\n async stat(path, options) {\n return afs.stat(path, options);\n },\n async explain(path, options) {\n return afs.explain(path, options);\n },\n async exec(path, args, options) {\n if (readonly) {\n throw new Error(\"Server is in readonly mode\");\n }\n return afs.exec(path, args, options);\n },\n async rename(oldPath, newPath, options) {\n if (readonly) {\n throw new Error(\"Server is in readonly mode\");\n }\n return afs.rename(oldPath, newPath, options);\n },\n };\n}\n\n/**\n * Start an AFS HTTP server\n *\n * Loads AFS from config in cwd, wraps it as an AFSModule, and starts\n * an HTTP server. Blocks until the server is shut down (Ctrl+C / SIGTERM).\n */\nexport async function startServe(options: StartServeOptions): Promise<void> {\n const {\n cwd,\n host = \"localhost\",\n port = 3000,\n path: basePath = \"/afs\",\n readonly = false,\n cors = false,\n token,\n maxBodySize = 10 * 1024 * 1024,\n onExit,\n onProgress,\n extraProviders,\n } = options;\n\n // Load AFS from config\n const { afs, failures } = await createAFS(cwd, { onProgress });\n\n // Mount extra providers (mock-based, not in config.toml)\n if (extraProviders) {\n for (const { provider, mountPath } of extraProviders) {\n try {\n await afs.mount(provider, mountPath);\n } catch (e) {\n const msg = e instanceof Error ? e.message : String(e);\n console.warn(` ${colors.yellow(\"⚠\")} extra provider ${mountPath}: ${msg}`);\n }\n }\n }\n\n if (failures.length > 0) {\n console.warn(`${failures.length} provider(s) failed to mount:`);\n for (const f of failures) {\n console.warn(` ${colors.yellow(\"⚠\")} ${f.path}: ${f.reason}`);\n }\n }\n\n const mounts = afs.getMounts();\n\n // Create module wrapper and HTTP handler\n const module = createAFSModule(afs, readonly);\n const handler = createAFSHttpHandler({ module, maxBodySize, token });\n\n // Create HTTP server\n const server = createServer(async (req: IncomingMessage, res: ServerResponse) => {\n const url = new URL(req.url || \"/\", `http://${req.headers.host}`);\n const timestamp = new Date().toISOString();\n console.error(`${timestamp} ${req.method} ${url.pathname}`);\n\n // CORS support\n if (cors) {\n res.setHeader(\"Access-Control-Allow-Origin\", \"*\");\n res.setHeader(\"Access-Control-Allow-Methods\", \"GET, POST, PUT, DELETE, OPTIONS\");\n res.setHeader(\"Access-Control-Allow-Headers\", \"Content-Type, Authorization\");\n\n if (req.method === \"OPTIONS\") {\n res.writeHead(204);\n res.end();\n return;\n }\n }\n\n // Check base path\n if (!url.pathname.startsWith(basePath)) {\n res.writeHead(404, { \"Content-Type\": \"application/json\" });\n res.end(JSON.stringify({ code: 1, error: \"Not found\" }));\n return;\n }\n\n // Convert to Web Standard Request\n const headers = new Headers();\n for (const [key, value] of Object.entries(req.headers)) {\n if (value) {\n headers.append(key, Array.isArray(value) ? value.join(\", \") : value);\n }\n }\n\n const chunks: Buffer[] = [];\n for await (const chunk of req) {\n chunks.push(chunk);\n }\n const body = Buffer.concat(chunks);\n\n const request = new Request(`http://${req.headers.host}${req.url}`, {\n method: req.method,\n headers,\n body: body.length > 0 ? body : undefined,\n });\n\n try {\n const response = await handler(request);\n res.writeHead(response.status, {\n \"Content-Type\": response.headers.get(\"Content-Type\") || \"application/json\",\n });\n const responseBody = await response.text();\n res.end(responseBody);\n } catch (error) {\n console.error(\"Error handling request:\", error);\n res.writeHead(500, { \"Content-Type\": \"application/json\" });\n res.end(JSON.stringify({ code: 5, error: \"Internal server error\" }));\n }\n });\n\n // Start listening\n await new Promise<void>((resolve, reject) => {\n server.listen(port, host, () => resolve());\n server.on(\"error\", reject);\n });\n\n const serverUrl = `http://${host}:${port}${basePath}`;\n\n // Print server info\n console.log(colors.green(\"AFS HTTP Server started\"));\n console.log(colors.bold(\"Mounted providers:\"));\n for (const m of mounts) {\n console.log(` ${colors.cyan(m.path.padEnd(20))} ${colors.dim(m.module.name)}`);\n }\n console.log(\"\");\n console.log(`${colors.dim(\"Listening on:\")} ${colors.brightCyan(serverUrl)}`);\n console.log(colors.dim(\"Press Ctrl+C to stop\"));\n\n // Graceful shutdown\n let shuttingDown = false;\n const shutdown = async () => {\n if (shuttingDown) return;\n shuttingDown = true;\n console.error(\"\\nShutting down server...\");\n server.close();\n if (onExit) {\n await onExit();\n }\n };\n\n process.on(\"SIGINT\", shutdown);\n process.on(\"SIGTERM\", shutdown);\n\n // Block until server closes\n await new Promise<void>((resolve) => {\n server.on(\"close\", resolve);\n });\n}\n"],"mappings":";;;;;;;;;AA0CA,SAAS,gBAAgB,KAAU,UAA8B;AAC/D,QAAO;EACL,MAAM;EACN,YAAY,WAAW,aAAa;EACpC,MAAM,KAAK,MAAM,SAAS;AACxB,UAAO,IAAI,KAAK,MAAM,QAAQ;;EAEhC,MAAM,KAAK,MAAM,SAAS;AACxB,UAAO,IAAI,KAAK,MAAM,QAAQ;;EAEhC,MAAM,MAAM,MAAM,SAAS,SAAS;AAClC,OAAI,SACF,OAAM,IAAI,MAAM,6BAA6B;AAE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0 +1,12 @@
1
+
2
+ //#region src/ui/header.ts
3
+ /**
4
+ * ASCII art logo for AFS
5
+ * Clean, compact design using Unicode block characters
6
+ */
7
+ const LOGO = `
8
+ ▄▀█ █▀▀ █▀
9
+ █▀█ █▀░ ▄█
10
+ `.trimStart();
11
+
12
+ //#endregion
@@ -0,0 +1,13 @@
1
+ //#region src/ui/header.ts
2
+ /**
3
+ * ASCII art logo for AFS
4
+ * Clean, compact design using Unicode block characters
5
+ */
6
+ const LOGO = `
7
+ ▄▀█ █▀▀ █▀
8
+ █▀█ █▀░ ▄█
9
+ `.trimStart();
10
+
11
+ //#endregion
12
+ export { };
13
+ //# sourceMappingURL=header.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"header.mjs","names":[],"sources":["../../src/ui/header.ts"],"sourcesContent":["/**\n * CLI Header and Branding\n *\n * Displays the AFS logo, version, and status information\n * in interactive (human) mode.\n */\n\nimport { colors, isHeaderDisabled, isTTY } from \"./terminal.js\";\n\n/**\n * ASCII art logo for AFS\n * Clean, compact design using Unicode block characters\n */\nconst LOGO = `\n▄▀█ █▀▀ █▀\n█▀█ █▀░ ▄█\n`.trimStart();\n\n/**\n * Tagline displayed below the logo\n */\nconst TAGLINE = \"Agentic File System\";\n\n/**\n * Options for header display\n */\nexport interface HeaderOptions {\n version: string;\n mountCount: number;\n}\n\n/**\n * Check if header should be displayed\n * Header is shown when:\n * - stdout is a TTY\n * - AFS_NO_HEADER is not set\n */\nexport function shouldShowHeader(): boolean {\n return isTTY() && !isHeaderDisabled();\n}\n\n/**\n * Format the CLI header with logo, version, and status\n */\nexport function formatHeader(options: HeaderOptions): string {\n const { version, mountCount } = options;\n\n // Colorize the logo\n const coloredLogo = colors.brightCyan(LOGO);\n\n // Colorize the tagline\n const coloredTagline = colors.dim(TAGLINE);\n\n // Format status line\n const versionPart = colors.green(`v${version}`);\n const mountPart = colors.yellow(`${mountCount} ${mountCount === 1 ? \"mount\" : \"mounts\"}`);\n const statusLine = `${versionPart} ${colors.dim(\"•\")} ${mountPart}`;\n\n return `${coloredLogo}${coloredTagline}\\n\\n${statusLine}\\n`;\n}\n\n/**\n * Print the header to stdout if conditions are met\n */\nexport function printHeader(options: HeaderOptions): void {\n if (shouldShowHeader()) {\n console.log(formatHeader(options));\n }\n}\n\n/**\n * Print just the logo with tagline (for exit messages etc.)\n */\nexport function printLogo(): void {\n const coloredLogo = colors.brightCyan(LOGO);\n const coloredTagline = colors.dim(TAGLINE);\n console.log(`${coloredLogo}${coloredTagline}`);\n}\n"],"mappings":";;;;;AAaA,MAAM,OAAO;;;EAGX,WAAW"}
@@ -0,0 +1,8 @@
1
+ const require_terminal = require('./terminal.cjs');
2
+ require('./header.cjs');
3
+
4
+ //#region src/ui/index.ts
5
+ const colors = require_terminal.colors;
6
+
7
+ //#endregion
8
+ exports.colors = colors;
@@ -0,0 +1,9 @@
1
+ import { colors as colors$1 } from "./terminal.mjs";
2
+ import "./header.mjs";
3
+
4
+ //#region src/ui/index.ts
5
+ const colors = colors$1;
6
+
7
+ //#endregion
8
+ export { colors };
9
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":["_colors"],"sources":["../../src/ui/index.ts"],"sourcesContent":["/**\n * UI utilities for CLI output\n */\n\n// Import and re-export header utilities\nimport {\n formatHeader as _formatHeader,\n printHeader as _printHeader,\n printLogo as _printLogo,\n shouldShowHeader as _shouldShowHeader,\n type HeaderOptions,\n} from \"./header.js\";\n// Import and re-export terminal utilities\nimport {\n colors as _colors,\n isColorDisabled as _isColorDisabled,\n isHeaderDisabled as _isHeaderDisabled,\n isTTY as _isTTY,\n shouldUseColors as _shouldUseColors,\n} from \"./terminal.js\";\n\nexport const colors = _colors;\nexport const isColorDisabled = _isColorDisabled;\nexport const isHeaderDisabled = _isHeaderDisabled;\nexport const isTTY = _isTTY;\nexport const shouldUseColors = _shouldUseColors;\nexport const formatHeader = _formatHeader;\nexport const printHeader = _printHeader;\nexport const printLogo = _printLogo;\nexport const shouldShowHeader = _shouldShowHeader;\nexport type { HeaderOptions };\n"],"mappings":";;;;AAqBA,MAAa,SAASA"}
@@ -0,0 +1,88 @@
1
+
2
+ //#region src/ui/terminal.ts
3
+ /**
4
+ * Terminal utilities for CLI output
5
+ *
6
+ * Handles:
7
+ * - ANSI color codes
8
+ * - TTY detection
9
+ * - Environment variable checks (NO_COLOR, AFS_NO_HEADER)
10
+ */
11
+ /**
12
+ * ANSI color codes
13
+ */
14
+ const ANSI = {
15
+ reset: "\x1B[0m",
16
+ bold: "\x1B[1m",
17
+ dim: "\x1B[2m",
18
+ black: "\x1B[30m",
19
+ red: "\x1B[31m",
20
+ green: "\x1B[32m",
21
+ yellow: "\x1B[33m",
22
+ blue: "\x1B[34m",
23
+ magenta: "\x1B[35m",
24
+ cyan: "\x1B[36m",
25
+ white: "\x1B[37m",
26
+ brightBlack: "\x1B[90m",
27
+ brightRed: "\x1B[91m",
28
+ brightGreen: "\x1B[92m",
29
+ brightYellow: "\x1B[93m",
30
+ brightBlue: "\x1B[94m",
31
+ brightMagenta: "\x1B[95m",
32
+ brightCyan: "\x1B[96m",
33
+ brightWhite: "\x1B[97m"
34
+ };
35
+ /**
36
+ * Check if stdout is a TTY (interactive terminal)
37
+ */
38
+ function isTTY() {
39
+ return process.stdout.isTTY === true;
40
+ }
41
+ /**
42
+ * Check if colors should be disabled
43
+ * Respects NO_COLOR environment variable (https://no-color.org/)
44
+ */
45
+ function isColorDisabled() {
46
+ return process.env.NO_COLOR !== void 0;
47
+ }
48
+ /**
49
+ * Check if we should use colorized output
50
+ * Colors are enabled when:
51
+ * - stdout is a TTY
52
+ * - NO_COLOR is not set
53
+ */
54
+ function shouldUseColors() {
55
+ return isTTY() && !isColorDisabled();
56
+ }
57
+ /**
58
+ * Color helper functions
59
+ * Returns plain text if colors are disabled
60
+ */
61
+ const colors = {
62
+ _wrap: (code, text) => {
63
+ if (!shouldUseColors()) return text;
64
+ return `${code}${text}${ANSI.reset}`;
65
+ },
66
+ bold: (text) => colors._wrap(ANSI.bold, text),
67
+ dim: (text) => colors._wrap(ANSI.dim, text),
68
+ red: (text) => colors._wrap(ANSI.red, text),
69
+ green: (text) => colors._wrap(ANSI.green, text),
70
+ yellow: (text) => colors._wrap(ANSI.yellow, text),
71
+ blue: (text) => colors._wrap(ANSI.blue, text),
72
+ magenta: (text) => colors._wrap(ANSI.magenta, text),
73
+ cyan: (text) => colors._wrap(ANSI.cyan, text),
74
+ white: (text) => colors._wrap(ANSI.white, text),
75
+ brightCyan: (text) => colors._wrap(ANSI.brightCyan, text),
76
+ brightGreen: (text) => colors._wrap(ANSI.brightGreen, text),
77
+ brightYellow: (text) => colors._wrap(ANSI.brightYellow, text),
78
+ brightRed: (text) => colors._wrap(ANSI.brightRed, text),
79
+ error: (text) => colors._wrap(ANSI.red, text),
80
+ warning: (text) => colors._wrap(ANSI.yellow, text),
81
+ success: (text) => colors._wrap(ANSI.green, text),
82
+ info: (text) => colors._wrap(ANSI.cyan, text),
83
+ path: (text) => colors._wrap(ANSI.cyan, text),
84
+ muted: (text) => colors._wrap(ANSI.dim, text)
85
+ };
86
+
87
+ //#endregion
88
+ exports.colors = colors;
@@ -0,0 +1,88 @@
1
+ //#region src/ui/terminal.ts
2
+ /**
3
+ * Terminal utilities for CLI output
4
+ *
5
+ * Handles:
6
+ * - ANSI color codes
7
+ * - TTY detection
8
+ * - Environment variable checks (NO_COLOR, AFS_NO_HEADER)
9
+ */
10
+ /**
11
+ * ANSI color codes
12
+ */
13
+ const ANSI = {
14
+ reset: "\x1B[0m",
15
+ bold: "\x1B[1m",
16
+ dim: "\x1B[2m",
17
+ black: "\x1B[30m",
18
+ red: "\x1B[31m",
19
+ green: "\x1B[32m",
20
+ yellow: "\x1B[33m",
21
+ blue: "\x1B[34m",
22
+ magenta: "\x1B[35m",
23
+ cyan: "\x1B[36m",
24
+ white: "\x1B[37m",
25
+ brightBlack: "\x1B[90m",
26
+ brightRed: "\x1B[91m",
27
+ brightGreen: "\x1B[92m",
28
+ brightYellow: "\x1B[93m",
29
+ brightBlue: "\x1B[94m",
30
+ brightMagenta: "\x1B[95m",
31
+ brightCyan: "\x1B[96m",
32
+ brightWhite: "\x1B[97m"
33
+ };
34
+ /**
35
+ * Check if stdout is a TTY (interactive terminal)
36
+ */
37
+ function isTTY() {
38
+ return process.stdout.isTTY === true;
39
+ }
40
+ /**
41
+ * Check if colors should be disabled
42
+ * Respects NO_COLOR environment variable (https://no-color.org/)
43
+ */
44
+ function isColorDisabled() {
45
+ return process.env.NO_COLOR !== void 0;
46
+ }
47
+ /**
48
+ * Check if we should use colorized output
49
+ * Colors are enabled when:
50
+ * - stdout is a TTY
51
+ * - NO_COLOR is not set
52
+ */
53
+ function shouldUseColors() {
54
+ return isTTY() && !isColorDisabled();
55
+ }
56
+ /**
57
+ * Color helper functions
58
+ * Returns plain text if colors are disabled
59
+ */
60
+ const colors = {
61
+ _wrap: (code, text) => {
62
+ if (!shouldUseColors()) return text;
63
+ return `${code}${text}${ANSI.reset}`;
64
+ },
65
+ bold: (text) => colors._wrap(ANSI.bold, text),
66
+ dim: (text) => colors._wrap(ANSI.dim, text),
67
+ red: (text) => colors._wrap(ANSI.red, text),
68
+ green: (text) => colors._wrap(ANSI.green, text),
69
+ yellow: (text) => colors._wrap(ANSI.yellow, text),
70
+ blue: (text) => colors._wrap(ANSI.blue, text),
71
+ magenta: (text) => colors._wrap(ANSI.magenta, text),
72
+ cyan: (text) => colors._wrap(ANSI.cyan, text),
73
+ white: (text) => colors._wrap(ANSI.white, text),
74
+ brightCyan: (text) => colors._wrap(ANSI.brightCyan, text),
75
+ brightGreen: (text) => colors._wrap(ANSI.brightGreen, text),
76
+ brightYellow: (text) => colors._wrap(ANSI.brightYellow, text),
77
+ brightRed: (text) => colors._wrap(ANSI.brightRed, text),
78
+ error: (text) => colors._wrap(ANSI.red, text),
79
+ warning: (text) => colors._wrap(ANSI.yellow, text),
80
+ success: (text) => colors._wrap(ANSI.green, text),
81
+ info: (text) => colors._wrap(ANSI.cyan, text),
82
+ path: (text) => colors._wrap(ANSI.cyan, text),
83
+ muted: (text) => colors._wrap(ANSI.dim, text)
84
+ };
85
+
86
+ //#endregion
87
+ export { colors };
88
+ //# sourceMappingURL=terminal.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"terminal.mjs","names":[],"sources":["../../src/ui/terminal.ts"],"sourcesContent":["/**\n * Terminal utilities for CLI output\n *\n * Handles:\n * - ANSI color codes\n * - TTY detection\n * - Environment variable checks (NO_COLOR, AFS_NO_HEADER)\n */\n\n/**\n * ANSI color codes\n */\nconst ANSI = {\n reset: \"\\x1b[0m\",\n bold: \"\\x1b[1m\",\n dim: \"\\x1b[2m\",\n\n // Foreground colors\n black: \"\\x1b[30m\",\n red: \"\\x1b[31m\",\n green: \"\\x1b[32m\",\n yellow: \"\\x1b[33m\",\n blue: \"\\x1b[34m\",\n magenta: \"\\x1b[35m\",\n cyan: \"\\x1b[36m\",\n white: \"\\x1b[37m\",\n\n // Bright foreground colors\n brightBlack: \"\\x1b[90m\",\n brightRed: \"\\x1b[91m\",\n brightGreen: \"\\x1b[92m\",\n brightYellow: \"\\x1b[93m\",\n brightBlue: \"\\x1b[94m\",\n brightMagenta: \"\\x1b[95m\",\n brightCyan: \"\\x1b[96m\",\n brightWhite: \"\\x1b[97m\",\n} as const;\n\n/**\n * Check if stdout is a TTY (interactive terminal)\n */\nexport function isTTY(): boolean {\n return process.stdout.isTTY === true;\n}\n\n/**\n * Check if colors should be disabled\n * Respects NO_COLOR environment variable (https://no-color.org/)\n */\nexport function isColorDisabled(): boolean {\n return process.env.NO_COLOR !== undefined;\n}\n\n/**\n * Check if header should be displayed\n * Disabled by AFS_NO_HEADER environment variable\n */\nexport function isHeaderDisabled(): boolean {\n return process.env.AFS_NO_HEADER !== undefined;\n}\n\n/**\n * Check if we should use colorized output\n * Colors are enabled when:\n * - stdout is a TTY\n * - NO_COLOR is not set\n */\nexport function shouldUseColors(): boolean {\n return isTTY() && !isColorDisabled();\n}\n\n/**\n * Color helper functions\n * Returns plain text if colors are disabled\n */\nexport const colors = {\n // Create a colorizer function\n _wrap: (code: string, text: string): string => {\n if (!shouldUseColors()) return text;\n return `${code}${text}${ANSI.reset}`;\n },\n\n // Basic styles\n bold: (text: string) => colors._wrap(ANSI.bold, text),\n dim: (text: string) => colors._wrap(ANSI.dim, text),\n\n // Standard colors\n red: (text: string) => colors._wrap(ANSI.red, text),\n green: (text: string) => colors._wrap(ANSI.green, text),\n yellow: (text: string) => colors._wrap(ANSI.yellow, text),\n blue: (text: string) => colors._wrap(ANSI.blue, text),\n magenta: (text: string) => colors._wrap(ANSI.magenta, text),\n cyan: (text: string) => colors._wrap(ANSI.cyan, text),\n white: (text: string) => colors._wrap(ANSI.white, text),\n\n // Bright colors\n brightCyan: (text: string) => colors._wrap(ANSI.brightCyan, text),\n brightGreen: (text: string) => colors._wrap(ANSI.brightGreen, text),\n brightYellow: (text: string) => colors._wrap(ANSI.brightYellow, text),\n brightRed: (text: string) => colors._wrap(ANSI.brightRed, text),\n\n // Semantic colors (for consistency)\n error: (text: string) => colors._wrap(ANSI.red, text),\n warning: (text: string) => colors._wrap(ANSI.yellow, text),\n success: (text: string) => colors._wrap(ANSI.green, text),\n info: (text: string) => colors._wrap(ANSI.cyan, text),\n path: (text: string) => colors._wrap(ANSI.cyan, text),\n muted: (text: string) => colors._wrap(ANSI.dim, text),\n};\n"],"mappings":";;;;;;;;;;;;AAYA,MAAM,OAAO;CACX,OAAO;CACP,MAAM;CACN,KAAK;CAGL,OAAO;CACP,KAAK;CACL,OAAO;CACP,QAAQ;CACR,MAAM;CACN,SAAS;CACT,MAAM;CACN,OAAO;CAGP,aAAa;CACb,WAAW;CACX,aAAa;CACb,cAAc;CACd,YAAY;CACZ,eAAe;CACf,YAAY;CACZ,aAAa;CACd;;;;AAKD,SAAgB,QAAiB;AAC/B,QAAO,QAAQ,OAAO,UAAU;;;;;;AAOlC,SAAgB,kBAA2B;AACzC,QAAO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olldown_runtime.cjs');
2
+ let node_module = require("node:module");
3
+
4
+ //#region src/version.ts
5
+ const pkg = (0, node_module.createRequire)(require("url").pathToFileURL(__filename).href)("../package.json");
6
+ const VERSION = pkg.version;
7
+
8
+ //#endregion
9
+ exports.VERSION = VERSION;