@fnndsc/brasa 0.56.2 → 0.56.4

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 (333) hide show
  1. package/dist/buildinfo.json +1 -1
  2. package/dist/builtins/berth/berth.d.ts +11 -0
  3. package/dist/builtins/berth/berth.js +53 -22
  4. package/dist/builtins/berth/berth.js.map +1 -1
  5. package/dist/builtins/berth/berthCube.d.ts +17 -2
  6. package/dist/builtins/berth/berthCube.js +22 -10
  7. package/dist/builtins/berth/berthCube.js.map +1 -1
  8. package/dist/builtins/debug.d.ts +24 -3
  9. package/dist/builtins/debug.js +66 -13
  10. package/dist/builtins/debug.js.map +1 -1
  11. package/dist/builtins/fs/acl.args.d.ts +5 -38
  12. package/dist/builtins/fs/acl.args.js +6 -72
  13. package/dist/builtins/fs/acl.args.js.map +1 -1
  14. package/dist/builtins/fs/acl.d.ts +100 -10
  15. package/dist/builtins/fs/acl.js +222 -68
  16. package/dist/builtins/fs/acl.js.map +1 -1
  17. package/dist/builtins/fs/cat.args.d.ts +14 -15
  18. package/dist/builtins/fs/cat.args.js +13 -40
  19. package/dist/builtins/fs/cat.args.js.map +1 -1
  20. package/dist/builtins/fs/cat.d.ts +40 -3
  21. package/dist/builtins/fs/cat.js +89 -10
  22. package/dist/builtins/fs/cat.js.map +1 -1
  23. package/dist/builtins/fs/cd.d.ts +24 -6
  24. package/dist/builtins/fs/cd.js +71 -18
  25. package/dist/builtins/fs/cd.js.map +1 -1
  26. package/dist/builtins/fs/configWrite.d.ts +24 -8
  27. package/dist/builtins/fs/configWrite.js +77 -36
  28. package/dist/builtins/fs/configWrite.js.map +1 -1
  29. package/dist/builtins/fs/cp.d.ts +39 -4
  30. package/dist/builtins/fs/cp.js +120 -55
  31. package/dist/builtins/fs/cp.js.map +1 -1
  32. package/dist/builtins/fs/download.d.ts +12 -1
  33. package/dist/builtins/fs/download.js +24 -4
  34. package/dist/builtins/fs/download.js.map +1 -1
  35. package/dist/builtins/fs/du.d.ts +59 -33
  36. package/dist/builtins/fs/du.js +111 -79
  37. package/dist/builtins/fs/du.js.map +1 -1
  38. package/dist/builtins/fs/edit.d.ts +19 -4
  39. package/dist/builtins/fs/edit.js +77 -16
  40. package/dist/builtins/fs/edit.js.map +1 -1
  41. package/dist/builtins/fs/find.d.ts +25 -0
  42. package/dist/builtins/fs/find.js +76 -5
  43. package/dist/builtins/fs/find.js.map +1 -1
  44. package/dist/builtins/fs/mkdir.d.ts +28 -18
  45. package/dist/builtins/fs/mkdir.js +95 -66
  46. package/dist/builtins/fs/mkdir.js.map +1 -1
  47. package/dist/builtins/fs/mv.d.ts +34 -4
  48. package/dist/builtins/fs/mv.js +129 -64
  49. package/dist/builtins/fs/mv.js.map +1 -1
  50. package/dist/builtins/fs/pull.args.d.ts +56 -17
  51. package/dist/builtins/fs/pull.args.js +16 -66
  52. package/dist/builtins/fs/pull.args.js.map +1 -1
  53. package/dist/builtins/fs/pull.d.ts +62 -0
  54. package/dist/builtins/fs/pull.js +86 -22
  55. package/dist/builtins/fs/pull.js.map +1 -1
  56. package/dist/builtins/fs/pwd.d.ts +19 -5
  57. package/dist/builtins/fs/pwd.js +62 -8
  58. package/dist/builtins/fs/pwd.js.map +1 -1
  59. package/dist/builtins/fs/rm.d.ts +58 -21
  60. package/dist/builtins/fs/rm.js +99 -82
  61. package/dist/builtins/fs/rm.js.map +1 -1
  62. package/dist/builtins/fs/rmdir.d.ts +29 -11
  63. package/dist/builtins/fs/rmdir.js +87 -36
  64. package/dist/builtins/fs/rmdir.js.map +1 -1
  65. package/dist/builtins/fs/touch.d.ts +44 -9
  66. package/dist/builtins/fs/touch.js +91 -27
  67. package/dist/builtins/fs/touch.js.map +1 -1
  68. package/dist/builtins/fs/transferJobs.d.ts +64 -0
  69. package/dist/builtins/fs/transferJobs.js +98 -0
  70. package/dist/builtins/fs/transferJobs.js.map +1 -0
  71. package/dist/builtins/fs/tree.d.ts +36 -9
  72. package/dist/builtins/fs/tree.js +126 -36
  73. package/dist/builtins/fs/tree.js.map +1 -1
  74. package/dist/builtins/fs/upload.d.ts +35 -3
  75. package/dist/builtins/fs/upload.js +99 -14
  76. package/dist/builtins/fs/upload.js.map +1 -1
  77. package/dist/builtins/fs/xattr.args.d.ts +12 -33
  78. package/dist/builtins/fs/xattr.args.js +17 -95
  79. package/dist/builtins/fs/xattr.args.js.map +1 -1
  80. package/dist/builtins/fs/xattr.d.ts +98 -8
  81. package/dist/builtins/fs/xattr.js +163 -24
  82. package/dist/builtins/fs/xattr.js.map +1 -1
  83. package/dist/builtins/games/bytes.d.ts +201 -5
  84. package/dist/builtins/games/bytes.js +255 -54
  85. package/dist/builtins/games/bytes.js.map +1 -1
  86. package/dist/builtins/games/chimes.d.ts +180 -3
  87. package/dist/builtins/games/chimes.js +203 -26
  88. package/dist/builtins/games/chimes.js.map +1 -1
  89. package/dist/builtins/games/chrislab.d.ts +101 -3
  90. package/dist/builtins/games/chrislab.js +117 -17
  91. package/dist/builtins/games/chrislab.js.map +1 -1
  92. package/dist/builtins/games/cowsay.d.ts +93 -2
  93. package/dist/builtins/games/cowsay.js +90 -31
  94. package/dist/builtins/games/cowsay.js.map +1 -1
  95. package/dist/builtins/games/figlet.d.ts +70 -2
  96. package/dist/builtins/games/figlet.js +83 -6
  97. package/dist/builtins/games/figlet.js.map +1 -1
  98. package/dist/builtins/games/lab.d.ts +104 -5
  99. package/dist/builtins/games/lab.js +144 -6
  100. package/dist/builtins/games/lab.js.map +1 -1
  101. package/dist/builtins/games/lolcat.d.ts +61 -1
  102. package/dist/builtins/games/lolcat.js +59 -24
  103. package/dist/builtins/games/lolcat.js.map +1 -1
  104. package/dist/builtins/games/morse.d.ts +36 -1
  105. package/dist/builtins/games/morse.js +50 -2
  106. package/dist/builtins/games/morse.js.map +1 -1
  107. package/dist/builtins/games/numbers.d.ts +241 -5
  108. package/dist/builtins/games/numbers.js +298 -23
  109. package/dist/builtins/games/numbers.js.map +1 -1
  110. package/dist/builtins/games/play.d.ts +96 -6
  111. package/dist/builtins/games/play.js +137 -6
  112. package/dist/builtins/games/play.js.map +1 -1
  113. package/dist/builtins/games/qr.d.ts +40 -1
  114. package/dist/builtins/games/qr.js +51 -2
  115. package/dist/builtins/games/qr.js.map +1 -1
  116. package/dist/builtins/games/show.d.ts +131 -6
  117. package/dist/builtins/games/show.js +208 -20
  118. package/dist/builtins/games/show.js.map +1 -1
  119. package/dist/builtins/games/sky.d.ts +178 -4
  120. package/dist/builtins/games/sky.js +228 -12
  121. package/dist/builtins/games/sky.js.map +1 -1
  122. package/dist/builtins/games/text.d.ts +258 -7
  123. package/dist/builtins/games/text.js +310 -29
  124. package/dist/builtins/games/text.js.map +1 -1
  125. package/dist/builtins/games/trek.d.ts +67 -3
  126. package/dist/builtins/games/trek.js +63 -10
  127. package/dist/builtins/games/trek.js.map +1 -1
  128. package/dist/builtins/games/wtf.d.ts +58 -1
  129. package/dist/builtins/games/wtf.js +67 -6
  130. package/dist/builtins/games/wtf.js.map +1 -1
  131. package/dist/builtins/help.d.ts +38 -2
  132. package/dist/builtins/help.js +76 -769
  133. package/dist/builtins/help.js.map +1 -1
  134. package/dist/builtins/helpSections.js +4 -1
  135. package/dist/builtins/helpSections.js.map +1 -1
  136. package/dist/builtins/net/connect.d.ts +36 -3
  137. package/dist/builtins/net/connect.js +84 -26
  138. package/dist/builtins/net/connect.js.map +1 -1
  139. package/dist/builtins/net/cubepath.d.ts +49 -5
  140. package/dist/builtins/net/cubepath.js +69 -27
  141. package/dist/builtins/net/cubepath.js.map +1 -1
  142. package/dist/builtins/net/logout.d.ts +13 -4
  143. package/dist/builtins/net/logout.js +49 -3
  144. package/dist/builtins/net/logout.js.map +1 -1
  145. package/dist/builtins/net/netstat.d.ts +29 -4
  146. package/dist/builtins/net/netstat.js +64 -23
  147. package/dist/builtins/net/netstat.js.map +1 -1
  148. package/dist/builtins/net/pacs.d.ts +169 -15
  149. package/dist/builtins/net/pacs.js +92 -33
  150. package/dist/builtins/net/pacs.js.map +1 -1
  151. package/dist/builtins/net/query.args.d.ts +95 -0
  152. package/dist/builtins/net/query.args.js +26 -0
  153. package/dist/builtins/net/query.args.js.map +1 -0
  154. package/dist/builtins/net/query.d.ts +98 -5
  155. package/dist/builtins/net/query.js +89 -83
  156. package/dist/builtins/net/query.js.map +1 -1
  157. package/dist/builtins/net/status.d.ts +5 -3
  158. package/dist/builtins/net/status.js +5 -12
  159. package/dist/builtins/net/status.js.map +1 -1
  160. package/dist/builtins/parametersofplugin.d.ts +82 -3
  161. package/dist/builtins/parametersofplugin.js +79 -23
  162. package/dist/builtins/parametersofplugin.js.map +1 -1
  163. package/dist/builtins/proc.d.ts +210 -3
  164. package/dist/builtins/proc.js +210 -119
  165. package/dist/builtins/proc.js.map +1 -1
  166. package/dist/builtins/res/compute.d.ts +67 -3
  167. package/dist/builtins/res/compute.js +121 -35
  168. package/dist/builtins/res/compute.js.map +1 -1
  169. package/dist/builtins/res/dicom.d.ts +52 -3
  170. package/dist/builtins/res/dicom.js +82 -34
  171. package/dist/builtins/res/dicom.js.map +1 -1
  172. package/dist/builtins/res/expect.d.ts +52 -3
  173. package/dist/builtins/res/expect.js +92 -29
  174. package/dist/builtins/res/expect.js.map +1 -1
  175. package/dist/builtins/res/feed.d.ts +475 -3
  176. package/dist/builtins/res/feed.js +253 -158
  177. package/dist/builtins/res/feed.js.map +1 -1
  178. package/dist/builtins/res/files.d.ts +517 -3
  179. package/dist/builtins/res/files.js +124 -44
  180. package/dist/builtins/res/files.js.map +1 -1
  181. package/dist/builtins/res/gather.d.ts +113 -3
  182. package/dist/builtins/res/gather.js +153 -44
  183. package/dist/builtins/res/gather.js.map +1 -1
  184. package/dist/builtins/res/gather.process.d.ts +27 -19
  185. package/dist/builtins/res/gather.process.js +29 -59
  186. package/dist/builtins/res/gather.process.js.map +1 -1
  187. package/dist/builtins/res/group.d.ts +284 -3
  188. package/dist/builtins/res/group.js +147 -76
  189. package/dist/builtins/res/group.js.map +1 -1
  190. package/dist/builtins/res/image.d.ts +30 -2
  191. package/dist/builtins/res/image.js +62 -10
  192. package/dist/builtins/res/image.js.map +1 -1
  193. package/dist/builtins/res/play.d.ts +71 -9
  194. package/dist/builtins/res/play.js +124 -82
  195. package/dist/builtins/res/play.js.map +1 -1
  196. package/dist/builtins/res/plugininstance.d.ts +307 -2
  197. package/dist/builtins/res/plugininstance.js +122 -50
  198. package/dist/builtins/res/plugininstance.js.map +1 -1
  199. package/dist/builtins/res/pluginmeta.d.ts +244 -2
  200. package/dist/builtins/res/pluginmeta.js +98 -40
  201. package/dist/builtins/res/pluginmeta.js.map +1 -1
  202. package/dist/builtins/res/record.d.ts +37 -3
  203. package/dist/builtins/res/record.js +127 -57
  204. package/dist/builtins/res/record.js.map +1 -1
  205. package/dist/builtins/res/resourceList.d.ts +136 -0
  206. package/dist/builtins/res/resourceList.js +51 -0
  207. package/dist/builtins/res/resourceList.js.map +1 -0
  208. package/dist/builtins/res/tag.d.ts +244 -3
  209. package/dist/builtins/res/tag.js +97 -41
  210. package/dist/builtins/res/tag.js.map +1 -1
  211. package/dist/builtins/res/user.d.ts +122 -3
  212. package/dist/builtins/res/user.js +83 -21
  213. package/dist/builtins/res/user.js.map +1 -1
  214. package/dist/builtins/res/workflow.d.ts +244 -2
  215. package/dist/builtins/res/workflow.js +97 -40
  216. package/dist/builtins/res/workflow.js.map +1 -1
  217. package/dist/builtins/store.d.ts +85 -3
  218. package/dist/builtins/store.js +135 -68
  219. package/dist/builtins/store.js.map +1 -1
  220. package/dist/builtins/sys/apropos.d.ts +80 -5
  221. package/dist/builtins/sys/apropos.js +121 -15
  222. package/dist/builtins/sys/apropos.js.map +1 -1
  223. package/dist/builtins/sys/cal.d.ts +44 -5
  224. package/dist/builtins/sys/cal.js +57 -10
  225. package/dist/builtins/sys/cal.js.map +1 -1
  226. package/dist/builtins/sys/command.d.ts +20 -0
  227. package/dist/builtins/sys/command.js +31 -0
  228. package/dist/builtins/sys/command.js.map +1 -1
  229. package/dist/builtins/sys/context.d.ts +13 -3
  230. package/dist/builtins/sys/context.js +51 -4
  231. package/dist/builtins/sys/context.js.map +1 -1
  232. package/dist/builtins/sys/date.d.ts +56 -5
  233. package/dist/builtins/sys/date.js +63 -9
  234. package/dist/builtins/sys/date.js.map +1 -1
  235. package/dist/builtins/sys/echo.d.ts +63 -2
  236. package/dist/builtins/sys/echo.js +87 -8
  237. package/dist/builtins/sys/echo.js.map +1 -1
  238. package/dist/builtins/sys/fortune.d.ts +27 -2
  239. package/dist/builtins/sys/fortune.js +44 -2
  240. package/dist/builtins/sys/fortune.js.map +1 -1
  241. package/dist/builtins/sys/grep.d.ts +245 -11
  242. package/dist/builtins/sys/grep.js +418 -131
  243. package/dist/builtins/sys/grep.js.map +1 -1
  244. package/dist/builtins/sys/joblets.d.ts +66 -7
  245. package/dist/builtins/sys/joblets.js +101 -14
  246. package/dist/builtins/sys/joblets.js.map +1 -1
  247. package/dist/builtins/sys/motd.d.ts +37 -3
  248. package/dist/builtins/sys/motd.js +49 -8
  249. package/dist/builtins/sys/motd.js.map +1 -1
  250. package/dist/builtins/sys/notes.d.ts +75 -3
  251. package/dist/builtins/sys/notes.js +90 -29
  252. package/dist/builtins/sys/notes.js.map +1 -1
  253. package/dist/builtins/sys/physicalmode.d.ts +24 -3
  254. package/dist/builtins/sys/physicalmode.js +68 -14
  255. package/dist/builtins/sys/physicalmode.js.map +1 -1
  256. package/dist/builtins/sys/tasks.d.ts +74 -5
  257. package/dist/builtins/sys/tasks.js +102 -14
  258. package/dist/builtins/sys/tasks.js.map +1 -1
  259. package/dist/builtins/sys/textFilters.d.ts +673 -41
  260. package/dist/builtins/sys/textFilters.js +718 -263
  261. package/dist/builtins/sys/textFilters.js.map +1 -1
  262. package/dist/builtins/sys/timing.d.ts +24 -3
  263. package/dist/builtins/sys/timing.js +67 -14
  264. package/dist/builtins/sys/timing.js.map +1 -1
  265. package/dist/builtins/sys/variables.d.ts +70 -4
  266. package/dist/builtins/sys/variables.js +103 -31
  267. package/dist/builtins/sys/variables.js.map +1 -1
  268. package/dist/builtins/sys/version.d.ts +27 -2
  269. package/dist/builtins/sys/version.js +48 -3
  270. package/dist/builtins/sys/version.js.map +1 -1
  271. package/dist/builtins/sys/weather.d.ts +92 -15
  272. package/dist/builtins/sys/weather.js +71 -45
  273. package/dist/builtins/sys/weather.js.map +1 -1
  274. package/dist/builtins/sys/whoami.d.ts +38 -18
  275. package/dist/builtins/sys/whoami.js +112 -8
  276. package/dist/builtins/sys/whoami.js.map +1 -1
  277. package/dist/builtins/utils.d.ts +0 -37
  278. package/dist/builtins/utils.js +0 -86
  279. package/dist/builtins/utils.js.map +1 -1
  280. package/dist/chris/chrisCommands.js +58 -152
  281. package/dist/chris/chrisCommands.js.map +1 -1
  282. package/dist/chris/commandFallback.d.ts +12 -0
  283. package/dist/chris/commandFallback.js +47 -0
  284. package/dist/chris/commandFallback.js.map +1 -1
  285. package/dist/chris/filesystem.js +7 -5
  286. package/dist/chris/filesystem.js.map +1 -1
  287. package/dist/chris/help.js +0 -1018
  288. package/dist/chris/help.js.map +1 -1
  289. package/dist/chris/kinds.d.ts +21 -0
  290. package/dist/chris/kinds.js +114 -2
  291. package/dist/chris/kinds.js.map +1 -1
  292. package/dist/chris/mounts.d.ts +4 -4
  293. package/dist/chris/mounts.js +9 -16
  294. package/dist/chris/mounts.js.map +1 -1
  295. package/dist/chris/navigation.d.ts +2 -3
  296. package/dist/chris/navigation.js +6 -20
  297. package/dist/chris/navigation.js.map +1 -1
  298. package/dist/chris/pacsResources.d.ts +259 -0
  299. package/dist/chris/pacsResources.js +168 -0
  300. package/dist/chris/pacsResources.js.map +1 -0
  301. package/dist/core/commandDeclaration.d.ts +97 -7
  302. package/dist/core/commandDeclaration.js +21 -0
  303. package/dist/core/commandDeclaration.js.map +1 -1
  304. package/dist/core/commandParse.js +65 -17
  305. package/dist/core/commandParse.js.map +1 -1
  306. package/dist/core/commandRegistry.d.ts +4 -3
  307. package/dist/core/commandRegistry.js +36 -8
  308. package/dist/core/commandRegistry.js.map +1 -1
  309. package/dist/core/commandSchema.js +5 -2
  310. package/dist/core/commandSchema.js.map +1 -1
  311. package/dist/core/commandUsage.d.ts +15 -0
  312. package/dist/core/commandUsage.js +59 -7
  313. package/dist/core/commandUsage.js.map +1 -1
  314. package/dist/core/coreCommands.js +63 -212
  315. package/dist/core/coreCommands.js.map +1 -1
  316. package/dist/core/paths.d.ts +29 -1
  317. package/dist/core/paths.js +15 -2
  318. package/dist/core/paths.js.map +1 -1
  319. package/dist/core/preprocess.d.ts +3 -4
  320. package/dist/core/preprocess.js +4 -5
  321. package/dist/core/preprocess.js.map +1 -1
  322. package/dist/lib/completer/declared.js +7 -4
  323. package/dist/lib/completer/declared.js.map +1 -1
  324. package/dist/lib/completer/index.js +2 -7
  325. package/dist/lib/completer/index.js.map +1 -1
  326. package/dist/lib/parser.d.ts +0 -8
  327. package/dist/lib/parser.js +0 -11
  328. package/dist/lib/parser.js.map +1 -1
  329. package/dist/lib/vfs/vfs.d.ts +2 -1
  330. package/dist/lib/vfs/vfs.js +5 -4
  331. package/dist/lib/vfs/vfs.js.map +1 -1
  332. package/dist/notes.json +1 -1
  333. package/package.json +5 -5
@@ -1,4 +1,5 @@
1
1
  import { CommandEnvelope } from '@fnndsc/menu';
2
+ import { type CommandDeclaration } from '../../core/commandDeclaration.js';
2
3
  /** The programs a GAMES pane can run. */
3
4
  export type ShowProgram = 'sl' | 'cmatrix' | 'rain' | 'aquarium' | 'tetris' | 'snake';
4
5
  /**
@@ -13,15 +14,139 @@ export declare const STARSHIP: ReadonlyArray<string>;
13
14
  export declare const MATRIX_GLYPHS: string;
14
15
  /** A still of a show, for a console with no canvas. */
15
16
  export declare function still_render(program: ShowProgram, random?: () => number): string[];
16
- /** `sl`: a starship crosses the screen. */
17
+ /** What a showpiece's line may hold: the one switch that sends it to ARGUS's GAMES pane. */
18
+ declare const SHOW_GRAMMAR: {
19
+ readonly options: {
20
+ readonly pane: {
21
+ readonly long: "pane";
22
+ readonly summary: "Draw it in ARGUS's GAMES pane instead of the terminal";
23
+ };
24
+ };
25
+ };
26
+ /**
27
+ * `sl [--pane]`: the declaration.
28
+ *
29
+ * @example
30
+ * ```ts
31
+ * commands_register({ declarations: [slCommand] });
32
+ * ```
33
+ */
34
+ export declare const slCommand: CommandDeclaration<typeof SHOW_GRAMMAR>;
35
+ /**
36
+ * `sl` over words already split: the declaration's parse and handler.
37
+ *
38
+ * @param args - The words after `sl`.
39
+ * @returns The show, or the refusal of a bad line.
40
+ *
41
+ * @example
42
+ * ```ts
43
+ * await builtin_sl(['--pane']);
44
+ * ```
45
+ */
17
46
  export declare function builtin_sl(args: string[]): Promise<CommandEnvelope>;
18
- /** `cmatrix`: the glyph rain. */
47
+ /**
48
+ * `cmatrix [--pane]`: the declaration.
49
+ *
50
+ * @example
51
+ * ```ts
52
+ * commands_register({ declarations: [cmatrixCommand] });
53
+ * ```
54
+ */
55
+ export declare const cmatrixCommand: CommandDeclaration<typeof SHOW_GRAMMAR>;
56
+ /**
57
+ * `cmatrix` over words already split: the declaration's parse and handler.
58
+ *
59
+ * @param args - The words after `cmatrix`.
60
+ * @returns The show, or the refusal of a bad line.
61
+ *
62
+ * @example
63
+ * ```ts
64
+ * await builtin_cmatrix(['--pane']);
65
+ * ```
66
+ */
19
67
  export declare function builtin_cmatrix(args: string[]): Promise<CommandEnvelope>;
20
- /** `rain`: rain. */
68
+ /**
69
+ * `rain [--pane]`: the declaration.
70
+ *
71
+ * @example
72
+ * ```ts
73
+ * commands_register({ declarations: [rainCommand] });
74
+ * ```
75
+ */
76
+ export declare const rainCommand: CommandDeclaration<typeof SHOW_GRAMMAR>;
77
+ /**
78
+ * `rain` over words already split: the declaration's parse and handler.
79
+ *
80
+ * @param args - The words after `rain`.
81
+ * @returns The show, or the refusal of a bad line.
82
+ *
83
+ * @example
84
+ * ```ts
85
+ * await builtin_rain(['--pane']);
86
+ * ```
87
+ */
21
88
  export declare function builtin_rain(args: string[]): Promise<CommandEnvelope>;
22
- /** `asciiquarium`: fish. */
89
+ /**
90
+ * `asciiquarium [--pane]`: the declaration.
91
+ *
92
+ * @example
93
+ * ```ts
94
+ * commands_register({ declarations: [asciiquariumCommand] });
95
+ * ```
96
+ */
97
+ export declare const asciiquariumCommand: CommandDeclaration<typeof SHOW_GRAMMAR>;
98
+ /**
99
+ * `asciiquarium` over words already split: the declaration's parse and handler.
100
+ *
101
+ * @param args - The words after `asciiquarium`.
102
+ * @returns The show, or the refusal of a bad line.
103
+ *
104
+ * @example
105
+ * ```ts
106
+ * await builtin_asciiquarium(['--pane']);
107
+ * ```
108
+ */
23
109
  export declare function builtin_asciiquarium(args: string[]): Promise<CommandEnvelope>;
24
- /** `tetris`: falling blocks. */
110
+ /**
111
+ * `tetris [--pane]`: the declaration.
112
+ *
113
+ * @example
114
+ * ```ts
115
+ * commands_register({ declarations: [tetrisCommand] });
116
+ * ```
117
+ */
118
+ export declare const tetrisCommand: CommandDeclaration<typeof SHOW_GRAMMAR>;
119
+ /**
120
+ * `tetris` over words already split: the declaration's parse and handler.
121
+ *
122
+ * @param args - The words after `tetris`.
123
+ * @returns The show, or the refusal of a bad line.
124
+ *
125
+ * @example
126
+ * ```ts
127
+ * await builtin_tetris(['--pane']);
128
+ * ```
129
+ */
25
130
  export declare function builtin_tetris(args: string[]): Promise<CommandEnvelope>;
26
- /** `snake`: the snake. */
131
+ /**
132
+ * `snake [--pane]`: the declaration.
133
+ *
134
+ * @example
135
+ * ```ts
136
+ * commands_register({ declarations: [snakeCommand] });
137
+ * ```
138
+ */
139
+ export declare const snakeCommand: CommandDeclaration<typeof SHOW_GRAMMAR>;
140
+ /**
141
+ * `snake` over words already split: the declaration's parse and handler.
142
+ *
143
+ * @param args - The words after `snake`.
144
+ * @returns The show, or the refusal of a bad line.
145
+ *
146
+ * @example
147
+ * ```ts
148
+ * await builtin_snake(['--pane']);
149
+ * ```
150
+ */
27
151
  export declare function builtin_snake(args: string[]): Promise<CommandEnvelope>;
152
+ export {};
@@ -11,7 +11,9 @@
11
11
  * @module
12
12
  */
13
13
  import chalk from 'chalk';
14
- import { envelope_ok, envelope_error } from '@fnndsc/menu';
14
+ import { envelope_ok } from '@fnndsc/menu';
15
+ import { command_declare } from '../../core/commandDeclaration.js';
16
+ import { declaredCommand_run } from '../../core/commandParse.js';
15
17
  /**
16
18
  * The starship `sl` sends across the screen (a typo's punishment, as the
17
19
  * train was): the Constitution-class refit, side view, from the Star Trek
@@ -57,25 +59,211 @@ function note_render(program, arcade, pane) {
57
59
  return chalk.gray(`${program}: ARGUS draws it in its GAMES pane${arcade ? ' with the keys live (arrows; Esc gives the keyboard back)' : ''}.`);
58
60
  return chalk.gray(`${program}: a terminal plays it in place${arcade ? ' (arrows steer)' : ''}; q, Esc or Ctrl-C leaves. --pane draws it in ARGUS's GAMES pane.`);
59
61
  }
60
- function show_run(program, args, arcade) {
61
- const unknown = args.find((arg) => arg.startsWith('-') && arg !== '--pane');
62
- if (unknown !== undefined)
63
- return envelope_error(`${program}: unknown option '${unknown}' (--pane)\n`);
64
- const pane = args.includes('--pane');
65
- const rest = args.filter((arg) => arg !== '--pane');
62
+ /** What a showpiece's line may hold: the one switch that sends it to ARGUS's GAMES pane. */
63
+ const SHOW_GRAMMAR = {
64
+ options: {
65
+ pane: { long: 'pane', summary: "Draw it in ARGUS's GAMES pane instead of the terminal" },
66
+ },
67
+ };
68
+ /**
69
+ * Declares a showpiece: one program on the cell grid, with the one `--pane` switch.
70
+ *
71
+ * @param name - The word that runs it.
72
+ * @param program - The program a GAMES pane runs.
73
+ * @param arcade - Whether the keys play it (an arcade game) or it only shows.
74
+ * @param prose - Its summary, description and examples.
75
+ * @returns The declaration.
76
+ *
77
+ * @example
78
+ * ```ts
79
+ * export const slCommand = showCommand_make('sl', 'sl', false, { summary: 'A starship crosses the screen', description: '…', examples: ['sl'] });
80
+ * ```
81
+ */
82
+ function showCommand_make(name, program, arcade, prose) {
83
+ return command_declare({
84
+ name,
85
+ grammar: SHOW_GRAMMAR,
86
+ help: prose,
87
+ handler: async (args) => show_run(program, arcade, args.options.pane),
88
+ });
89
+ }
90
+ /**
91
+ * Runs a showpiece: a still of it, and how the moving one is played.
92
+ *
93
+ * @param program - The program.
94
+ * @param arcade - Whether the keys play it.
95
+ * @param pane - Whether ARGUS's GAMES pane draws it.
96
+ * @returns The still and the note, on the `games.show` model.
97
+ *
98
+ * @example
99
+ * ```ts
100
+ * show_run('sl', false, true);
101
+ * ```
102
+ */
103
+ function show_run(program, arcade, pane) {
66
104
  const still = still_render(program);
67
- return envelope_ok(`${still.join('\n')}\n${note_render(program, arcade, pane)}\n`, { kind: 'games.show', data: { program, args: rest, arcade, pane } });
105
+ return envelope_ok(`${still.join('\n')}\n${note_render(program, arcade, pane)}\n`, { kind: 'games.show', data: { program, args: [], arcade, pane } });
106
+ }
107
+ /**
108
+ * `sl [--pane]`: the declaration.
109
+ *
110
+ * @example
111
+ * ```ts
112
+ * commands_register({ declarations: [slCommand] });
113
+ * ```
114
+ */
115
+ export const slCommand = showCommand_make('sl', 'sl', false, {
116
+ summary: 'A starship crosses the screen (the punishment for mistyping ls)',
117
+ description: "The train of old, refitted: a starship glides across the terminal. q, Esc or Ctrl-C gives the screen back. --pane draws it in ARGUS's GAMES pane instead (the transcript console always does).",
118
+ examples: ['sl', 'sl --pane'],
119
+ });
120
+ /**
121
+ * `sl` over words already split: the declaration's parse and handler.
122
+ *
123
+ * @param args - The words after `sl`.
124
+ * @returns The show, or the refusal of a bad line.
125
+ *
126
+ * @example
127
+ * ```ts
128
+ * await builtin_sl(['--pane']);
129
+ * ```
130
+ */
131
+ export async function builtin_sl(args) {
132
+ return declaredCommand_run(slCommand, args);
133
+ }
134
+ /**
135
+ * `cmatrix [--pane]`: the declaration.
136
+ *
137
+ * @example
138
+ * ```ts
139
+ * commands_register({ declarations: [cmatrixCommand] });
140
+ * ```
141
+ */
142
+ export const cmatrixCommand = showCommand_make('cmatrix', 'cmatrix', false, {
143
+ summary: 'The glyph rain',
144
+ description: "Columns of glyphs falling down the terminal. q, Esc or Ctrl-C gives the screen back. --pane draws it in ARGUS's GAMES pane instead (the transcript console always does).",
145
+ examples: ['cmatrix', 'cmatrix --pane'],
146
+ });
147
+ /**
148
+ * `cmatrix` over words already split: the declaration's parse and handler.
149
+ *
150
+ * @param args - The words after `cmatrix`.
151
+ * @returns The show, or the refusal of a bad line.
152
+ *
153
+ * @example
154
+ * ```ts
155
+ * await builtin_cmatrix(['--pane']);
156
+ * ```
157
+ */
158
+ export async function builtin_cmatrix(args) {
159
+ return declaredCommand_run(cmatrixCommand, args);
160
+ }
161
+ /**
162
+ * `rain [--pane]`: the declaration.
163
+ *
164
+ * @example
165
+ * ```ts
166
+ * commands_register({ declarations: [rainCommand] });
167
+ * ```
168
+ */
169
+ export const rainCommand = showCommand_make('rain', 'rain', false, {
170
+ summary: 'Rain',
171
+ description: "Drops falling and ringing out on the floor of the terminal. q, Esc or Ctrl-C gives the screen back. --pane draws it in ARGUS's GAMES pane instead (the transcript console always does).",
172
+ examples: ['rain'],
173
+ });
174
+ /**
175
+ * `rain` over words already split: the declaration's parse and handler.
176
+ *
177
+ * @param args - The words after `rain`.
178
+ * @returns The show, or the refusal of a bad line.
179
+ *
180
+ * @example
181
+ * ```ts
182
+ * await builtin_rain(['--pane']);
183
+ * ```
184
+ */
185
+ export async function builtin_rain(args) {
186
+ return declaredCommand_run(rainCommand, args);
187
+ }
188
+ /**
189
+ * `asciiquarium [--pane]`: the declaration.
190
+ *
191
+ * @example
192
+ * ```ts
193
+ * commands_register({ declarations: [asciiquariumCommand] });
194
+ * ```
195
+ */
196
+ export const asciiquariumCommand = showCommand_make('asciiquarium', 'aquarium', false, {
197
+ summary: 'An aquarium: fish, weed, bubbles',
198
+ description: "Fish swimming both ways, weed swaying, bubbles rising, in the terminal. q, Esc or Ctrl-C gives the screen back. --pane draws it in ARGUS's GAMES pane instead (the transcript console always does).",
199
+ examples: ['asciiquarium'],
200
+ });
201
+ /**
202
+ * `asciiquarium` over words already split: the declaration's parse and handler.
203
+ *
204
+ * @param args - The words after `asciiquarium`.
205
+ * @returns The show, or the refusal of a bad line.
206
+ *
207
+ * @example
208
+ * ```ts
209
+ * await builtin_asciiquarium(['--pane']);
210
+ * ```
211
+ */
212
+ export async function builtin_asciiquarium(args) {
213
+ return declaredCommand_run(asciiquariumCommand, args);
214
+ }
215
+ /**
216
+ * `tetris [--pane]`: the declaration.
217
+ *
218
+ * @example
219
+ * ```ts
220
+ * commands_register({ declarations: [tetrisCommand] });
221
+ * ```
222
+ */
223
+ export const tetrisCommand = showCommand_make('tetris', 'tetris', true, {
224
+ summary: 'Falling blocks',
225
+ description: "Played in the terminal: left/right move, up rotates, down drops. q, Esc or Ctrl-C gives the screen back. --pane draws it in ARGUS's GAMES pane instead (the transcript console always does).",
226
+ examples: ['tetris', 'tetris --pane'],
227
+ });
228
+ /**
229
+ * `tetris` over words already split: the declaration's parse and handler.
230
+ *
231
+ * @param args - The words after `tetris`.
232
+ * @returns The show, or the refusal of a bad line.
233
+ *
234
+ * @example
235
+ * ```ts
236
+ * await builtin_tetris(['--pane']);
237
+ * ```
238
+ */
239
+ export async function builtin_tetris(args) {
240
+ return declaredCommand_run(tetrisCommand, args);
241
+ }
242
+ /**
243
+ * `snake [--pane]`: the declaration.
244
+ *
245
+ * @example
246
+ * ```ts
247
+ * commands_register({ declarations: [snakeCommand] });
248
+ * ```
249
+ */
250
+ export const snakeCommand = showCommand_make('snake', 'snake', true, {
251
+ summary: 'The snake',
252
+ description: "Played in the terminal: arrows (or hjkl, wasd) steer; eat the food, do not eat yourself. q, Esc or Ctrl-C gives the screen back. --pane draws it in ARGUS's GAMES pane instead (the transcript console always does).",
253
+ examples: ['snake'],
254
+ });
255
+ /**
256
+ * `snake` over words already split: the declaration's parse and handler.
257
+ *
258
+ * @param args - The words after `snake`.
259
+ * @returns The show, or the refusal of a bad line.
260
+ *
261
+ * @example
262
+ * ```ts
263
+ * await builtin_snake(['--pane']);
264
+ * ```
265
+ */
266
+ export async function builtin_snake(args) {
267
+ return declaredCommand_run(snakeCommand, args);
68
268
  }
69
- /** `sl`: a starship crosses the screen. */
70
- export async function builtin_sl(args) { return show_run('sl', args, false); }
71
- /** `cmatrix`: the glyph rain. */
72
- export async function builtin_cmatrix(args) { return show_run('cmatrix', args, false); }
73
- /** `rain`: rain. */
74
- export async function builtin_rain(args) { return show_run('rain', args, false); }
75
- /** `asciiquarium`: fish. */
76
- export async function builtin_asciiquarium(args) { return show_run('aquarium', args, false); }
77
- /** `tetris`: falling blocks. */
78
- export async function builtin_tetris(args) { return show_run('tetris', args, true); }
79
- /** `snake`: the snake. */
80
- export async function builtin_snake(args) { return show_run('snake', args, true); }
81
269
  //# sourceMappingURL=show.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"show.js","sourceRoot":"","sources":["../../../src/builtins/games/show.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAmB,WAAW,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAK5E;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,QAAQ,GAA0B;IAC7C,2CAA2C;IAC3C,6CAA6C;IAC7C,8CAA8C;IAC9C,8CAA8C;IAC9C,6CAA6C;IAC7C,2CAA2C;IAC3C,4CAA4C;CAC7C,CAAC;AAEF,kCAAkC;AAClC,MAAM,CAAC,MAAM,aAAa,GAAW,wDAAwD,CAAC;AAE9F,uDAAuD;AACvD,MAAM,UAAU,YAAY,CAAC,OAAoB,EAAE,SAAuB,IAAI,CAAC,MAAM;IACnF,MAAM,IAAI,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC,CAAW,CAAC;IACjF,QAAQ,OAAO,EAAE,CAAC;QAChB,KAAK,IAAI,CAAC,CAAC,OAAO,CAAC,GAAG,QAAQ,CAAC,CAAC;QAChC,KAAK,SA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mB,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;AACjD,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { type WeatherFetch, type WeatherPlace } from '../sys/weather.js';
2
2
  import { CommandEnvelope } from '@fnndsc/menu';
3
+ import { type CommandDeclaration } from '../../core/commandDeclaration.js';
3
4
  /** A date as a Julian day. */
4
5
  export declare function julianDay_compute(date: Date): number;
5
6
  /** The moon's state on a date. */
@@ -18,15 +19,93 @@ export interface MoonPhase {
18
19
  export declare function moon_phase(date: Date): MoonPhase;
19
20
  /** A small moon, lit from the side the phase lights. */
20
21
  export declare function moon_draw(phase: MoonPhase): string[];
21
- /** `pom [YYYY-MM-DD]` */
22
+ /**
23
+ * `pom [date]`: the declaration.
24
+ *
25
+ * @example
26
+ * ```ts
27
+ * commands_register({ declarations: [pomCommand] });
28
+ * ```
29
+ */
30
+ export declare const pomCommand: CommandDeclaration<{
31
+ readonly operands: readonly [{
32
+ readonly name: "date";
33
+ readonly kind: "word";
34
+ readonly optional: true;
35
+ readonly repeat: true;
36
+ readonly summary: "The date to look at (default: today)";
37
+ }];
38
+ }>;
39
+ /**
40
+ * `pom` over words already split: the declaration's parse and handler.
41
+ *
42
+ * @param args - The words after `pom`.
43
+ * @returns The answer, or the refusal of a bad line.
44
+ *
45
+ * @example
46
+ * ```ts
47
+ * await builtin_pom(['2026-12-25']);
48
+ * ```
49
+ */
22
50
  export declare function builtin_pom(args: string[]): Promise<CommandEnvelope>;
51
+ /**
52
+ * Runs `pom` on a date.
53
+ *
54
+ * @param words - The date's words, none for today.
55
+ * @returns The answer, or a refusal for words that are not a date.
56
+ *
57
+ * @example
58
+ * ```ts
59
+ * await pom_run(['2026-12-25']);
60
+ * ```
61
+ */
62
+ export declare function pom_run(words: readonly string[]): Promise<CommandEnvelope>;
23
63
  /** The stardate two ways: the Kelvin films' `YYYY.DDD`, and TNG's thousand-per-year from 2323. */
24
64
  export declare function stardate_derive(date: Date): {
25
65
  kelvin: string;
26
66
  tng: string;
27
67
  };
28
- /** `stardate` */
68
+ /**
69
+ * `stardate [date]`: the declaration.
70
+ *
71
+ * @example
72
+ * ```ts
73
+ * commands_register({ declarations: [stardateCommand] });
74
+ * ```
75
+ */
76
+ export declare const stardateCommand: CommandDeclaration<{
77
+ readonly operands: readonly [{
78
+ readonly name: "date";
79
+ readonly kind: "word";
80
+ readonly optional: true;
81
+ readonly repeat: true;
82
+ readonly summary: "The date to reckon (default: today)";
83
+ }];
84
+ }>;
85
+ /**
86
+ * `stardate` over words already split: the declaration's parse and handler.
87
+ *
88
+ * @param args - The words after `stardate`.
89
+ * @returns The answer, or the refusal of a bad line.
90
+ *
91
+ * @example
92
+ * ```ts
93
+ * await builtin_stardate(['2366-01-01']);
94
+ * ```
95
+ */
29
96
  export declare function builtin_stardate(args: string[]): Promise<CommandEnvelope>;
97
+ /**
98
+ * Runs `stardate` on a date.
99
+ *
100
+ * @param words - The date's words, none for today.
101
+ * @returns The answer, or a refusal for words that are not a date.
102
+ *
103
+ * @example
104
+ * ```ts
105
+ * await stardate_run(['2366-01-01']);
106
+ * ```
107
+ */
108
+ export declare function stardate_run(words: readonly string[]): Promise<CommandEnvelope>;
30
109
  /** The Discordian date of a Gregorian one. */
31
110
  export interface DiscordianDate {
32
111
  yold: number;
@@ -39,8 +118,47 @@ export interface DiscordianDate {
39
118
  export declare function ddate_derive(date: Date): DiscordianDate;
40
119
  /** 1st, 2nd, 3rd, 4th … 11th, 12th, 13th … 21st. */
41
120
  export declare function ordinal_format(n: number): string;
42
- /** `ddate [YYYY-MM-DD]` */
121
+ /**
122
+ * `ddate [date]`: the declaration.
123
+ *
124
+ * @example
125
+ * ```ts
126
+ * commands_register({ declarations: [ddateCommand] });
127
+ * ```
128
+ */
129
+ export declare const ddateCommand: CommandDeclaration<{
130
+ readonly operands: readonly [{
131
+ readonly name: "date";
132
+ readonly kind: "word";
133
+ readonly optional: true;
134
+ readonly repeat: true;
135
+ readonly summary: "The date to convert (default: today)";
136
+ }];
137
+ }>;
138
+ /**
139
+ * `ddate` over words already split: the declaration's parse and handler.
140
+ *
141
+ * @param args - The words after `ddate`.
142
+ * @returns The answer, or the refusal of a bad line.
143
+ *
144
+ * @example
145
+ * ```ts
146
+ * await builtin_ddate(['2028-02-29']);
147
+ * ```
148
+ */
43
149
  export declare function builtin_ddate(args: string[]): Promise<CommandEnvelope>;
150
+ /**
151
+ * Runs `ddate` on a date.
152
+ *
153
+ * @param words - The date's words, none for today.
154
+ * @returns The answer, or a refusal for words that are not a date.
155
+ *
156
+ * @example
157
+ * ```ts
158
+ * await ddate_run(['2028-02-29']);
159
+ * ```
160
+ */
161
+ export declare function ddate_run(words: readonly string[]): Promise<CommandEnvelope>;
44
162
  /** What Open-Meteo says of one day's sun. */
45
163
  export interface SunDay {
46
164
  date: string;
@@ -55,5 +173,61 @@ export interface SunDay {
55
173
  * @param place - Where.
56
174
  */
57
175
  export declare function sun_fetch(fetchFn: WeatherFetch, place: WeatherPlace): Promise<SunDay[]>;
58
- /** `sunrise [place]` */
176
+ /** What `sunrise` takes: a place, in as many words as it is named. */
177
+ declare const SUNRISE_GRAMMAR: {
178
+ readonly operands: readonly [{
179
+ readonly name: "place";
180
+ readonly kind: "word";
181
+ readonly optional: true;
182
+ readonly repeat: true;
183
+ readonly summary: "The place (default: Boston)";
184
+ }];
185
+ };
186
+ /**
187
+ * Declares `sunrise` over a fetch (a test hands in its own).
188
+ *
189
+ * @param fetchFn - The fetch the command asks Open-Meteo with.
190
+ * @returns The declaration.
191
+ *
192
+ * @example
193
+ * ```ts
194
+ * const command = sunriseCommand_make(fakeFetch);
195
+ * ```
196
+ */
197
+ export declare function sunriseCommand_make(fetchFn: WeatherFetch): CommandDeclaration<typeof SUNRISE_GRAMMAR>;
198
+ /**
199
+ * `sunrise [place]`: the declaration.
200
+ *
201
+ * @example
202
+ * ```ts
203
+ * commands_register({ declarations: [sunriseCommand] });
204
+ * ```
205
+ */
206
+ export declare const sunriseCommand: CommandDeclaration<typeof SUNRISE_GRAMMAR>;
207
+ /**
208
+ * `sunrise` over words already split: the declaration's parse and handler.
209
+ *
210
+ * @param args - The words after `sunrise`.
211
+ * @param fetchFn - The fetch to use.
212
+ * @returns The sun's days, or the refusal of a bad line.
213
+ *
214
+ * @example
215
+ * ```ts
216
+ * await builtin_sunrise(['Cape', 'Town']);
217
+ * ```
218
+ */
59
219
  export declare function builtin_sunrise(args: string[], fetchFn?: WeatherFetch): Promise<CommandEnvelope>;
220
+ /**
221
+ * When the sun rises and sets at a place, today and tomorrow.
222
+ *
223
+ * @param words - The place's words, none for the default place.
224
+ * @param fetchFn - The fetch to use.
225
+ * @returns The sun's days, or a refusal.
226
+ *
227
+ * @example
228
+ * ```ts
229
+ * await sunrise_run(['Tromsø'], fetch);
230
+ * ```
231
+ */
232
+ export declare function sunrise_run(words: readonly string[], fetchFn: WeatherFetch): Promise<CommandEnvelope>;
233
+ export {};