@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.
- package/dist/buildinfo.json +1 -1
- package/dist/builtins/berth/berth.d.ts +11 -0
- package/dist/builtins/berth/berth.js +53 -22
- package/dist/builtins/berth/berth.js.map +1 -1
- package/dist/builtins/berth/berthCube.d.ts +17 -2
- package/dist/builtins/berth/berthCube.js +22 -10
- package/dist/builtins/berth/berthCube.js.map +1 -1
- package/dist/builtins/debug.d.ts +24 -3
- package/dist/builtins/debug.js +66 -13
- package/dist/builtins/debug.js.map +1 -1
- package/dist/builtins/fs/acl.args.d.ts +5 -38
- package/dist/builtins/fs/acl.args.js +6 -72
- package/dist/builtins/fs/acl.args.js.map +1 -1
- package/dist/builtins/fs/acl.d.ts +100 -10
- package/dist/builtins/fs/acl.js +222 -68
- package/dist/builtins/fs/acl.js.map +1 -1
- package/dist/builtins/fs/cat.args.d.ts +14 -15
- package/dist/builtins/fs/cat.args.js +13 -40
- package/dist/builtins/fs/cat.args.js.map +1 -1
- package/dist/builtins/fs/cat.d.ts +40 -3
- package/dist/builtins/fs/cat.js +89 -10
- package/dist/builtins/fs/cat.js.map +1 -1
- package/dist/builtins/fs/cd.d.ts +24 -6
- package/dist/builtins/fs/cd.js +71 -18
- package/dist/builtins/fs/cd.js.map +1 -1
- package/dist/builtins/fs/configWrite.d.ts +24 -8
- package/dist/builtins/fs/configWrite.js +77 -36
- package/dist/builtins/fs/configWrite.js.map +1 -1
- package/dist/builtins/fs/cp.d.ts +39 -4
- package/dist/builtins/fs/cp.js +120 -55
- package/dist/builtins/fs/cp.js.map +1 -1
- package/dist/builtins/fs/download.d.ts +12 -1
- package/dist/builtins/fs/download.js +24 -4
- package/dist/builtins/fs/download.js.map +1 -1
- package/dist/builtins/fs/du.d.ts +59 -33
- package/dist/builtins/fs/du.js +111 -79
- package/dist/builtins/fs/du.js.map +1 -1
- package/dist/builtins/fs/edit.d.ts +19 -4
- package/dist/builtins/fs/edit.js +77 -16
- package/dist/builtins/fs/edit.js.map +1 -1
- package/dist/builtins/fs/find.d.ts +25 -0
- package/dist/builtins/fs/find.js +76 -5
- package/dist/builtins/fs/find.js.map +1 -1
- package/dist/builtins/fs/mkdir.d.ts +28 -18
- package/dist/builtins/fs/mkdir.js +95 -66
- package/dist/builtins/fs/mkdir.js.map +1 -1
- package/dist/builtins/fs/mv.d.ts +34 -4
- package/dist/builtins/fs/mv.js +129 -64
- package/dist/builtins/fs/mv.js.map +1 -1
- package/dist/builtins/fs/pull.args.d.ts +56 -17
- package/dist/builtins/fs/pull.args.js +16 -66
- package/dist/builtins/fs/pull.args.js.map +1 -1
- package/dist/builtins/fs/pull.d.ts +62 -0
- package/dist/builtins/fs/pull.js +86 -22
- package/dist/builtins/fs/pull.js.map +1 -1
- package/dist/builtins/fs/pwd.d.ts +19 -5
- package/dist/builtins/fs/pwd.js +62 -8
- package/dist/builtins/fs/pwd.js.map +1 -1
- package/dist/builtins/fs/rm.d.ts +58 -21
- package/dist/builtins/fs/rm.js +99 -82
- package/dist/builtins/fs/rm.js.map +1 -1
- package/dist/builtins/fs/rmdir.d.ts +29 -11
- package/dist/builtins/fs/rmdir.js +87 -36
- package/dist/builtins/fs/rmdir.js.map +1 -1
- package/dist/builtins/fs/touch.d.ts +44 -9
- package/dist/builtins/fs/touch.js +91 -27
- package/dist/builtins/fs/touch.js.map +1 -1
- package/dist/builtins/fs/transferJobs.d.ts +64 -0
- package/dist/builtins/fs/transferJobs.js +98 -0
- package/dist/builtins/fs/transferJobs.js.map +1 -0
- package/dist/builtins/fs/tree.d.ts +36 -9
- package/dist/builtins/fs/tree.js +126 -36
- package/dist/builtins/fs/tree.js.map +1 -1
- package/dist/builtins/fs/upload.d.ts +35 -3
- package/dist/builtins/fs/upload.js +99 -14
- package/dist/builtins/fs/upload.js.map +1 -1
- package/dist/builtins/fs/xattr.args.d.ts +12 -33
- package/dist/builtins/fs/xattr.args.js +17 -95
- package/dist/builtins/fs/xattr.args.js.map +1 -1
- package/dist/builtins/fs/xattr.d.ts +98 -8
- package/dist/builtins/fs/xattr.js +163 -24
- package/dist/builtins/fs/xattr.js.map +1 -1
- package/dist/builtins/games/bytes.d.ts +201 -5
- package/dist/builtins/games/bytes.js +255 -54
- package/dist/builtins/games/bytes.js.map +1 -1
- package/dist/builtins/games/chimes.d.ts +180 -3
- package/dist/builtins/games/chimes.js +203 -26
- package/dist/builtins/games/chimes.js.map +1 -1
- package/dist/builtins/games/chrislab.d.ts +101 -3
- package/dist/builtins/games/chrislab.js +117 -17
- package/dist/builtins/games/chrislab.js.map +1 -1
- package/dist/builtins/games/cowsay.d.ts +93 -2
- package/dist/builtins/games/cowsay.js +90 -31
- package/dist/builtins/games/cowsay.js.map +1 -1
- package/dist/builtins/games/figlet.d.ts +70 -2
- package/dist/builtins/games/figlet.js +83 -6
- package/dist/builtins/games/figlet.js.map +1 -1
- package/dist/builtins/games/lab.d.ts +104 -5
- package/dist/builtins/games/lab.js +144 -6
- package/dist/builtins/games/lab.js.map +1 -1
- package/dist/builtins/games/lolcat.d.ts +61 -1
- package/dist/builtins/games/lolcat.js +59 -24
- package/dist/builtins/games/lolcat.js.map +1 -1
- package/dist/builtins/games/morse.d.ts +36 -1
- package/dist/builtins/games/morse.js +50 -2
- package/dist/builtins/games/morse.js.map +1 -1
- package/dist/builtins/games/numbers.d.ts +241 -5
- package/dist/builtins/games/numbers.js +298 -23
- package/dist/builtins/games/numbers.js.map +1 -1
- package/dist/builtins/games/play.d.ts +96 -6
- package/dist/builtins/games/play.js +137 -6
- package/dist/builtins/games/play.js.map +1 -1
- package/dist/builtins/games/qr.d.ts +40 -1
- package/dist/builtins/games/qr.js +51 -2
- package/dist/builtins/games/qr.js.map +1 -1
- package/dist/builtins/games/show.d.ts +131 -6
- package/dist/builtins/games/show.js +208 -20
- package/dist/builtins/games/show.js.map +1 -1
- package/dist/builtins/games/sky.d.ts +178 -4
- package/dist/builtins/games/sky.js +228 -12
- package/dist/builtins/games/sky.js.map +1 -1
- package/dist/builtins/games/text.d.ts +258 -7
- package/dist/builtins/games/text.js +310 -29
- package/dist/builtins/games/text.js.map +1 -1
- package/dist/builtins/games/trek.d.ts +67 -3
- package/dist/builtins/games/trek.js +63 -10
- package/dist/builtins/games/trek.js.map +1 -1
- package/dist/builtins/games/wtf.d.ts +58 -1
- package/dist/builtins/games/wtf.js +67 -6
- package/dist/builtins/games/wtf.js.map +1 -1
- package/dist/builtins/help.d.ts +38 -2
- package/dist/builtins/help.js +76 -769
- package/dist/builtins/help.js.map +1 -1
- package/dist/builtins/helpSections.js +4 -1
- package/dist/builtins/helpSections.js.map +1 -1
- package/dist/builtins/net/connect.d.ts +36 -3
- package/dist/builtins/net/connect.js +84 -26
- package/dist/builtins/net/connect.js.map +1 -1
- package/dist/builtins/net/cubepath.d.ts +49 -5
- package/dist/builtins/net/cubepath.js +69 -27
- package/dist/builtins/net/cubepath.js.map +1 -1
- package/dist/builtins/net/logout.d.ts +13 -4
- package/dist/builtins/net/logout.js +49 -3
- package/dist/builtins/net/logout.js.map +1 -1
- package/dist/builtins/net/netstat.d.ts +29 -4
- package/dist/builtins/net/netstat.js +64 -23
- package/dist/builtins/net/netstat.js.map +1 -1
- package/dist/builtins/net/pacs.d.ts +169 -15
- package/dist/builtins/net/pacs.js +92 -33
- package/dist/builtins/net/pacs.js.map +1 -1
- package/dist/builtins/net/query.args.d.ts +95 -0
- package/dist/builtins/net/query.args.js +26 -0
- package/dist/builtins/net/query.args.js.map +1 -0
- package/dist/builtins/net/query.d.ts +98 -5
- package/dist/builtins/net/query.js +89 -83
- package/dist/builtins/net/query.js.map +1 -1
- package/dist/builtins/net/status.d.ts +5 -3
- package/dist/builtins/net/status.js +5 -12
- package/dist/builtins/net/status.js.map +1 -1
- package/dist/builtins/parametersofplugin.d.ts +82 -3
- package/dist/builtins/parametersofplugin.js +79 -23
- package/dist/builtins/parametersofplugin.js.map +1 -1
- package/dist/builtins/proc.d.ts +210 -3
- package/dist/builtins/proc.js +210 -119
- package/dist/builtins/proc.js.map +1 -1
- package/dist/builtins/res/compute.d.ts +67 -3
- package/dist/builtins/res/compute.js +121 -35
- package/dist/builtins/res/compute.js.map +1 -1
- package/dist/builtins/res/dicom.d.ts +52 -3
- package/dist/builtins/res/dicom.js +82 -34
- package/dist/builtins/res/dicom.js.map +1 -1
- package/dist/builtins/res/expect.d.ts +52 -3
- package/dist/builtins/res/expect.js +92 -29
- package/dist/builtins/res/expect.js.map +1 -1
- package/dist/builtins/res/feed.d.ts +475 -3
- package/dist/builtins/res/feed.js +253 -158
- package/dist/builtins/res/feed.js.map +1 -1
- package/dist/builtins/res/files.d.ts +517 -3
- package/dist/builtins/res/files.js +124 -44
- package/dist/builtins/res/files.js.map +1 -1
- package/dist/builtins/res/gather.d.ts +113 -3
- package/dist/builtins/res/gather.js +153 -44
- package/dist/builtins/res/gather.js.map +1 -1
- package/dist/builtins/res/gather.process.d.ts +27 -19
- package/dist/builtins/res/gather.process.js +29 -59
- package/dist/builtins/res/gather.process.js.map +1 -1
- package/dist/builtins/res/group.d.ts +284 -3
- package/dist/builtins/res/group.js +147 -76
- package/dist/builtins/res/group.js.map +1 -1
- package/dist/builtins/res/image.d.ts +30 -2
- package/dist/builtins/res/image.js +62 -10
- package/dist/builtins/res/image.js.map +1 -1
- package/dist/builtins/res/play.d.ts +71 -9
- package/dist/builtins/res/play.js +124 -82
- package/dist/builtins/res/play.js.map +1 -1
- package/dist/builtins/res/plugininstance.d.ts +307 -2
- package/dist/builtins/res/plugininstance.js +122 -50
- package/dist/builtins/res/plugininstance.js.map +1 -1
- package/dist/builtins/res/pluginmeta.d.ts +244 -2
- package/dist/builtins/res/pluginmeta.js +98 -40
- package/dist/builtins/res/pluginmeta.js.map +1 -1
- package/dist/builtins/res/record.d.ts +37 -3
- package/dist/builtins/res/record.js +127 -57
- package/dist/builtins/res/record.js.map +1 -1
- package/dist/builtins/res/resourceList.d.ts +136 -0
- package/dist/builtins/res/resourceList.js +51 -0
- package/dist/builtins/res/resourceList.js.map +1 -0
- package/dist/builtins/res/tag.d.ts +244 -3
- package/dist/builtins/res/tag.js +97 -41
- package/dist/builtins/res/tag.js.map +1 -1
- package/dist/builtins/res/user.d.ts +122 -3
- package/dist/builtins/res/user.js +83 -21
- package/dist/builtins/res/user.js.map +1 -1
- package/dist/builtins/res/workflow.d.ts +244 -2
- package/dist/builtins/res/workflow.js +97 -40
- package/dist/builtins/res/workflow.js.map +1 -1
- package/dist/builtins/store.d.ts +85 -3
- package/dist/builtins/store.js +135 -68
- package/dist/builtins/store.js.map +1 -1
- package/dist/builtins/sys/apropos.d.ts +80 -5
- package/dist/builtins/sys/apropos.js +121 -15
- package/dist/builtins/sys/apropos.js.map +1 -1
- package/dist/builtins/sys/cal.d.ts +44 -5
- package/dist/builtins/sys/cal.js +57 -10
- package/dist/builtins/sys/cal.js.map +1 -1
- package/dist/builtins/sys/command.d.ts +20 -0
- package/dist/builtins/sys/command.js +31 -0
- package/dist/builtins/sys/command.js.map +1 -1
- package/dist/builtins/sys/context.d.ts +13 -3
- package/dist/builtins/sys/context.js +51 -4
- package/dist/builtins/sys/context.js.map +1 -1
- package/dist/builtins/sys/date.d.ts +56 -5
- package/dist/builtins/sys/date.js +63 -9
- package/dist/builtins/sys/date.js.map +1 -1
- package/dist/builtins/sys/echo.d.ts +63 -2
- package/dist/builtins/sys/echo.js +87 -8
- package/dist/builtins/sys/echo.js.map +1 -1
- package/dist/builtins/sys/fortune.d.ts +27 -2
- package/dist/builtins/sys/fortune.js +44 -2
- package/dist/builtins/sys/fortune.js.map +1 -1
- package/dist/builtins/sys/grep.d.ts +245 -11
- package/dist/builtins/sys/grep.js +418 -131
- package/dist/builtins/sys/grep.js.map +1 -1
- package/dist/builtins/sys/joblets.d.ts +66 -7
- package/dist/builtins/sys/joblets.js +101 -14
- package/dist/builtins/sys/joblets.js.map +1 -1
- package/dist/builtins/sys/motd.d.ts +37 -3
- package/dist/builtins/sys/motd.js +49 -8
- package/dist/builtins/sys/motd.js.map +1 -1
- package/dist/builtins/sys/notes.d.ts +75 -3
- package/dist/builtins/sys/notes.js +90 -29
- package/dist/builtins/sys/notes.js.map +1 -1
- package/dist/builtins/sys/physicalmode.d.ts +24 -3
- package/dist/builtins/sys/physicalmode.js +68 -14
- package/dist/builtins/sys/physicalmode.js.map +1 -1
- package/dist/builtins/sys/tasks.d.ts +74 -5
- package/dist/builtins/sys/tasks.js +102 -14
- package/dist/builtins/sys/tasks.js.map +1 -1
- package/dist/builtins/sys/textFilters.d.ts +673 -41
- package/dist/builtins/sys/textFilters.js +718 -263
- package/dist/builtins/sys/textFilters.js.map +1 -1
- package/dist/builtins/sys/timing.d.ts +24 -3
- package/dist/builtins/sys/timing.js +67 -14
- package/dist/builtins/sys/timing.js.map +1 -1
- package/dist/builtins/sys/variables.d.ts +70 -4
- package/dist/builtins/sys/variables.js +103 -31
- package/dist/builtins/sys/variables.js.map +1 -1
- package/dist/builtins/sys/version.d.ts +27 -2
- package/dist/builtins/sys/version.js +48 -3
- package/dist/builtins/sys/version.js.map +1 -1
- package/dist/builtins/sys/weather.d.ts +92 -15
- package/dist/builtins/sys/weather.js +71 -45
- package/dist/builtins/sys/weather.js.map +1 -1
- package/dist/builtins/sys/whoami.d.ts +38 -18
- package/dist/builtins/sys/whoami.js +112 -8
- package/dist/builtins/sys/whoami.js.map +1 -1
- package/dist/builtins/utils.d.ts +0 -37
- package/dist/builtins/utils.js +0 -86
- package/dist/builtins/utils.js.map +1 -1
- package/dist/chris/chrisCommands.js +58 -152
- package/dist/chris/chrisCommands.js.map +1 -1
- package/dist/chris/commandFallback.d.ts +12 -0
- package/dist/chris/commandFallback.js +47 -0
- package/dist/chris/commandFallback.js.map +1 -1
- package/dist/chris/filesystem.js +7 -5
- package/dist/chris/filesystem.js.map +1 -1
- package/dist/chris/help.js +0 -1018
- package/dist/chris/help.js.map +1 -1
- package/dist/chris/kinds.d.ts +21 -0
- package/dist/chris/kinds.js +114 -2
- package/dist/chris/kinds.js.map +1 -1
- package/dist/chris/mounts.d.ts +4 -4
- package/dist/chris/mounts.js +9 -16
- package/dist/chris/mounts.js.map +1 -1
- package/dist/chris/navigation.d.ts +2 -3
- package/dist/chris/navigation.js +6 -20
- package/dist/chris/navigation.js.map +1 -1
- package/dist/chris/pacsResources.d.ts +259 -0
- package/dist/chris/pacsResources.js +168 -0
- package/dist/chris/pacsResources.js.map +1 -0
- package/dist/core/commandDeclaration.d.ts +97 -7
- package/dist/core/commandDeclaration.js +21 -0
- package/dist/core/commandDeclaration.js.map +1 -1
- package/dist/core/commandParse.js +65 -17
- package/dist/core/commandParse.js.map +1 -1
- package/dist/core/commandRegistry.d.ts +4 -3
- package/dist/core/commandRegistry.js +36 -8
- package/dist/core/commandRegistry.js.map +1 -1
- package/dist/core/commandSchema.js +5 -2
- package/dist/core/commandSchema.js.map +1 -1
- package/dist/core/commandUsage.d.ts +15 -0
- package/dist/core/commandUsage.js +59 -7
- package/dist/core/commandUsage.js.map +1 -1
- package/dist/core/coreCommands.js +63 -212
- package/dist/core/coreCommands.js.map +1 -1
- package/dist/core/paths.d.ts +29 -1
- package/dist/core/paths.js +15 -2
- package/dist/core/paths.js.map +1 -1
- package/dist/core/preprocess.d.ts +3 -4
- package/dist/core/preprocess.js +4 -5
- package/dist/core/preprocess.js.map +1 -1
- package/dist/lib/completer/declared.js +7 -4
- package/dist/lib/completer/declared.js.map +1 -1
- package/dist/lib/completer/index.js +2 -7
- package/dist/lib/completer/index.js.map +1 -1
- package/dist/lib/parser.d.ts +0 -8
- package/dist/lib/parser.js +0 -11
- package/dist/lib/parser.js.map +1 -1
- package/dist/lib/vfs/vfs.d.ts +2 -1
- package/dist/lib/vfs/vfs.js +5 -4
- package/dist/lib/vfs/vfs.js.map +1 -1
- package/dist/notes.json +1 -1
- package/package.json +5 -5
|
@@ -13,6 +13,8 @@ import chalk from 'chalk';
|
|
|
13
13
|
import { surface_get } from '../../core/surface.js';
|
|
14
14
|
import { text_input } from './stdin.js';
|
|
15
15
|
import { envelope_ok, envelope_error } from '@fnndsc/menu';
|
|
16
|
+
import { command_declare } from '../../core/commandDeclaration.js';
|
|
17
|
+
import { declaredCommand_run } from '../../core/commandParse.js';
|
|
16
18
|
/** A span of seconds in words: `2d 3h 04m`, `17m 05s`. */
|
|
17
19
|
export function uptime_words(seconds) {
|
|
18
20
|
const s = Math.floor(seconds);
|
|
@@ -26,8 +28,53 @@ export function uptime_words(seconds) {
|
|
|
26
28
|
return `${hours}h ${String(minutes).padStart(2, '0')}m`;
|
|
27
29
|
return `${minutes}m ${String(secs).padStart(2, '0')}s`;
|
|
28
30
|
}
|
|
29
|
-
/** `who
|
|
30
|
-
|
|
31
|
+
/** `who` takes nothing. */
|
|
32
|
+
const WHO_GRAMMAR = {};
|
|
33
|
+
/**
|
|
34
|
+
* `who`: the declaration.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```ts
|
|
38
|
+
* commands_register({ declarations: [whoCommand] });
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export const whoCommand = command_declare({
|
|
42
|
+
name: 'who',
|
|
43
|
+
grammar: WHO_GRAMMAR,
|
|
44
|
+
help: {
|
|
45
|
+
summary: 'Who is attached to this session',
|
|
46
|
+
description: "Lists the surfaces on this session — each terminal and browser, by the host's name for it — marking the one you are at. A local shell answers for itself alone.",
|
|
47
|
+
posix: { group: 'System', differs: 'the surfaces on this session (each terminal and browser), not logged-in users' },
|
|
48
|
+
examples: ['who'],
|
|
49
|
+
},
|
|
50
|
+
holds: [],
|
|
51
|
+
handler: async () => who_run(),
|
|
52
|
+
});
|
|
53
|
+
/**
|
|
54
|
+
* `who` over words already split: the declaration's parse and handler.
|
|
55
|
+
*
|
|
56
|
+
* @param args - The words after `who`: none.
|
|
57
|
+
* @returns The surfaces, or the refusal of a bad line.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```ts
|
|
61
|
+
* await builtin_who([]);
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
export async function builtin_who(args) {
|
|
65
|
+
return declaredCommand_run(whoCommand, args);
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Lists the surfaces attached to this session.
|
|
69
|
+
*
|
|
70
|
+
* @returns The surfaces.
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```ts
|
|
74
|
+
* await who_run();
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
export async function who_run() {
|
|
31
78
|
const peers = surface_get().peers?.() ?? null;
|
|
32
79
|
const user = (await backendInstalled_get()?.session.user_get()) ?? '?';
|
|
33
80
|
if (peers === null) {
|
|
@@ -38,8 +85,53 @@ export async function builtin_who(_args) {
|
|
|
38
85
|
const lines = peers.map((p) => `${user.padEnd(16)} ${p.kind.padEnd(8)} ${p.id}${p.you ? chalk.gray(' (you)') : ''}${p.asking !== undefined ? chalk.yellow(` ? ${p.asking.trim()}`) : ''}`);
|
|
39
86
|
return envelope_ok(`${lines.join('\n')}\n`, { kind: 'games.who', data: { user, peers } });
|
|
40
87
|
}
|
|
41
|
-
/** `uptime
|
|
42
|
-
|
|
88
|
+
/** `uptime` takes nothing. */
|
|
89
|
+
const UPTIME_GRAMMAR = {};
|
|
90
|
+
/**
|
|
91
|
+
* `uptime`: the declaration.
|
|
92
|
+
*
|
|
93
|
+
* @example
|
|
94
|
+
* ```ts
|
|
95
|
+
* commands_register({ declarations: [uptimeCommand] });
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
98
|
+
export const uptimeCommand = command_declare({
|
|
99
|
+
name: 'uptime',
|
|
100
|
+
grammar: UPTIME_GRAMMAR,
|
|
101
|
+
help: {
|
|
102
|
+
summary: "How long this session's process has been up",
|
|
103
|
+
description: 'The time, how long the process serving this session has run, how many surfaces are attached, since when, and its pid.',
|
|
104
|
+
posix: { group: 'System', differs: "how long this session's process has run, not this machine" },
|
|
105
|
+
examples: ['uptime'],
|
|
106
|
+
},
|
|
107
|
+
holds: [],
|
|
108
|
+
handler: async () => uptime_run(),
|
|
109
|
+
});
|
|
110
|
+
/**
|
|
111
|
+
* `uptime` over words already split: the declaration's parse and handler.
|
|
112
|
+
*
|
|
113
|
+
* @param args - The words after `uptime`: none.
|
|
114
|
+
* @returns The uptime, or the refusal of a bad line.
|
|
115
|
+
*
|
|
116
|
+
* @example
|
|
117
|
+
* ```ts
|
|
118
|
+
* await builtin_uptime([]);
|
|
119
|
+
* ```
|
|
120
|
+
*/
|
|
121
|
+
export async function builtin_uptime(args) {
|
|
122
|
+
return declaredCommand_run(uptimeCommand, args);
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Says how long this process has been up, and who is here.
|
|
126
|
+
*
|
|
127
|
+
* @returns The uptime.
|
|
128
|
+
*
|
|
129
|
+
* @example
|
|
130
|
+
* ```ts
|
|
131
|
+
* await uptime_run();
|
|
132
|
+
* ```
|
|
133
|
+
*/
|
|
134
|
+
export async function uptime_run() {
|
|
43
135
|
const seconds = process.uptime();
|
|
44
136
|
const peers = surface_get().peers?.() ?? null;
|
|
45
137
|
const since = new Date(Date.now() - seconds * 1000);
|
|
@@ -48,9 +140,55 @@ export async function builtin_uptime(_args) {
|
|
|
48
140
|
const line = ` ${now} up ${uptime_words(seconds)}${who} (since ${since.toISOString().replace('T', ' ').slice(0, 19)}Z, pid ${process.pid})`;
|
|
49
141
|
return envelope_ok(`${line}\n`, { kind: 'games.uptime', data: { seconds, since: since.toISOString(), pid: process.pid, surfaces: peers?.length ?? null } });
|
|
50
142
|
}
|
|
51
|
-
/** `say
|
|
143
|
+
/** What `say` takes: the words to speak, unless something is piped in. */
|
|
144
|
+
const SAY_GRAMMAR = {
|
|
145
|
+
operands: [{ name: 'text', kind: 'word', optional: true, repeat: true, summary: 'What to say (default: what is piped in)' }],
|
|
146
|
+
};
|
|
147
|
+
/**
|
|
148
|
+
* `say [text]`: the declaration.
|
|
149
|
+
*
|
|
150
|
+
* @example
|
|
151
|
+
* ```ts
|
|
152
|
+
* commands_register({ declarations: [sayCommand] });
|
|
153
|
+
* ```
|
|
154
|
+
*/
|
|
155
|
+
export const sayCommand = command_declare({
|
|
156
|
+
name: 'say',
|
|
157
|
+
grammar: SAY_GRAMMAR,
|
|
158
|
+
help: {
|
|
159
|
+
summary: 'A surface with a voice speaks it',
|
|
160
|
+
description: "Hands words to the surface: a browser speaks them (ARGUS, through the page's speech), a terminal prints them. Reads what is piped in, else the words given.",
|
|
161
|
+
examples: ['say analysis complete', 'fortune | say'],
|
|
162
|
+
},
|
|
163
|
+
handler: async (args) => say_run(args.operands.text),
|
|
164
|
+
});
|
|
165
|
+
/**
|
|
166
|
+
* `say` over words already split: the declaration's parse and handler.
|
|
167
|
+
*
|
|
168
|
+
* @param args - The words after `say`.
|
|
169
|
+
* @returns The words said, or the refusal of a bad line.
|
|
170
|
+
*
|
|
171
|
+
* @example
|
|
172
|
+
* ```ts
|
|
173
|
+
* await builtin_say(['hello', 'there']);
|
|
174
|
+
* ```
|
|
175
|
+
*/
|
|
52
176
|
export async function builtin_say(args) {
|
|
53
|
-
|
|
177
|
+
return declaredCommand_run(sayCommand, args);
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Says words: what was piped in, else the words given.
|
|
181
|
+
*
|
|
182
|
+
* @param words - The operand words.
|
|
183
|
+
* @returns The words as said, or a refusal when there are none.
|
|
184
|
+
*
|
|
185
|
+
* @example
|
|
186
|
+
* ```ts
|
|
187
|
+
* await say_run(['hello']);
|
|
188
|
+
* ```
|
|
189
|
+
*/
|
|
190
|
+
export async function say_run(words) {
|
|
191
|
+
const text = text_input(words);
|
|
54
192
|
if (text === null)
|
|
55
193
|
return envelope_error('', undefined, 'say: nothing to say (say hello, or fortune | say)\n');
|
|
56
194
|
const said = text.replace(/\n$/, '').replace(/\s+/g, ' ').trim();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lab.js","sourceRoot":"","sources":["../../../src/builtins/games/lab.ts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KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,IAAI,IAAI,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;AAClG,CAAC"}
|
|
@@ -12,5 +12,65 @@ export declare function rainbow_rgb(position: number, spread: number): [number,
|
|
|
12
12
|
* @returns The text with a colour per character; plain spaces stay plain.
|
|
13
13
|
*/
|
|
14
14
|
export declare function lolcat_paint(text: string, spread?: number, phase?: number): string;
|
|
15
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* `lolcat [-p SPREAD] [-S PHASE] [text]`: the declaration.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* commands_register({ declarations: [lolcatCommand] });
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export declare const lolcatCommand: import("../../core/commandDeclaration.js").CommandDeclaration<{
|
|
24
|
+
readonly operands: readonly [{
|
|
25
|
+
readonly name: "text";
|
|
26
|
+
readonly kind: "word";
|
|
27
|
+
readonly optional: true;
|
|
28
|
+
readonly repeat: true;
|
|
29
|
+
readonly summary: "The text to paint (default: what is piped in)";
|
|
30
|
+
}];
|
|
31
|
+
readonly options: {
|
|
32
|
+
readonly spread: {
|
|
33
|
+
readonly short: "p";
|
|
34
|
+
readonly summary: "Characters per rainbow cycle (1 or more)";
|
|
35
|
+
readonly value: {
|
|
36
|
+
readonly name: "SPREAD";
|
|
37
|
+
readonly kind: "number";
|
|
38
|
+
readonly min: 1;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
readonly phase: {
|
|
42
|
+
readonly short: "S";
|
|
43
|
+
readonly summary: "Where the rainbow starts";
|
|
44
|
+
readonly value: {
|
|
45
|
+
readonly name: "PHASE";
|
|
46
|
+
readonly kind: "number";
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
}>;
|
|
51
|
+
/**
|
|
52
|
+
* `lolcat` over words already split: the declaration's parse and handler.
|
|
53
|
+
*
|
|
54
|
+
* @param args - The words after `lolcat`.
|
|
55
|
+
* @returns The painted text, or the refusal of a bad line.
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```ts
|
|
59
|
+
* await builtin_lolcat(['-p', '12', 'hello']);
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
16
62
|
export declare function builtin_lolcat(args: string[]): Promise<CommandEnvelope>;
|
|
63
|
+
/**
|
|
64
|
+
* Paints the piped text, else the words, in a rainbow.
|
|
65
|
+
*
|
|
66
|
+
* @param words - The words given.
|
|
67
|
+
* @param spread - Characters per cycle, or undefined for the default.
|
|
68
|
+
* @param phase - Where the rainbow starts, or undefined for a random start.
|
|
69
|
+
* @returns The painted text, or a refusal when there is nothing to paint.
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* ```ts
|
|
73
|
+
* await lolcat_run(['hello'], 12, 0);
|
|
74
|
+
* ```
|
|
75
|
+
*/
|
|
76
|
+
export declare function lolcat_run(words: ReadonlyArray<string>, spread: number | undefined, phase: number | undefined): Promise<CommandEnvelope>;
|
|
@@ -11,6 +11,8 @@
|
|
|
11
11
|
import chalk from 'chalk';
|
|
12
12
|
import { text_input } from './stdin.js';
|
|
13
13
|
import { envelope_ok, envelope_error } from '@fnndsc/menu';
|
|
14
|
+
import { command_declare } from '../../core/commandDeclaration.js';
|
|
15
|
+
import { declaredCommand_run } from '../../core/commandParse.js';
|
|
14
16
|
/** 24-bit colour whatever the host thinks of its terminal: every surface here renders it. */
|
|
15
17
|
const paint = new chalk.Instance({ level: 3 });
|
|
16
18
|
/** Characters per rainbow cycle when none is asked. */
|
|
@@ -38,34 +40,67 @@ export function lolcat_paint(text, spread = LOLCAT_SPREAD, phase = 0) {
|
|
|
38
40
|
return paint.rgb(r, g, b)(c);
|
|
39
41
|
}).join('')).join('\n');
|
|
40
42
|
}
|
|
41
|
-
/** `lolcat
|
|
43
|
+
/** What a `lolcat` line may hold. */
|
|
44
|
+
const LOLCAT_GRAMMAR = {
|
|
45
|
+
operands: [{ name: 'text', kind: 'word', optional: true, repeat: true, summary: 'The text to paint (default: what is piped in)' }],
|
|
46
|
+
options: {
|
|
47
|
+
spread: { short: 'p', summary: 'Characters per rainbow cycle (1 or more)', value: { name: 'SPREAD', kind: 'number', min: 1 } },
|
|
48
|
+
phase: { short: 'S', summary: 'Where the rainbow starts', value: { name: 'PHASE', kind: 'number' } },
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* `lolcat [-p SPREAD] [-S PHASE] [text]`: the declaration.
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```ts
|
|
56
|
+
* commands_register({ declarations: [lolcatCommand] });
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
export const lolcatCommand = command_declare({
|
|
60
|
+
name: 'lolcat',
|
|
61
|
+
grammar: LOLCAT_GRAMMAR,
|
|
62
|
+
help: {
|
|
63
|
+
summary: 'Text in a rainbow',
|
|
64
|
+
description: 'Paints each character the next hue along a rainbow, drifting down the lines. -p sets how many characters one cycle spans (24), -S where it starts (random). Reads what is piped in, else the words given.',
|
|
65
|
+
examples: ['fortune | lolcat', 'figlet ARGUS | lolcat', 'motd | lolcat -p 12'],
|
|
66
|
+
},
|
|
67
|
+
holds: [],
|
|
68
|
+
handler: async (args) => lolcat_run(args.operands.text, args.options.spread, args.options.phase),
|
|
69
|
+
});
|
|
70
|
+
/**
|
|
71
|
+
* `lolcat` over words already split: the declaration's parse and handler.
|
|
72
|
+
*
|
|
73
|
+
* @param args - The words after `lolcat`.
|
|
74
|
+
* @returns The painted text, or the refusal of a bad line.
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```ts
|
|
78
|
+
* await builtin_lolcat(['-p', '12', 'hello']);
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
42
81
|
export async function builtin_lolcat(args) {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
else {
|
|
62
|
-
words.push(flag);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
82
|
+
return declaredCommand_run(lolcatCommand, args);
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Paints the piped text, else the words, in a rainbow.
|
|
86
|
+
*
|
|
87
|
+
* @param words - The words given.
|
|
88
|
+
* @param spread - Characters per cycle, or undefined for the default.
|
|
89
|
+
* @param phase - Where the rainbow starts, or undefined for a random start.
|
|
90
|
+
* @returns The painted text, or a refusal when there is nothing to paint.
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* ```ts
|
|
94
|
+
* await lolcat_run(['hello'], 12, 0);
|
|
95
|
+
* ```
|
|
96
|
+
*/
|
|
97
|
+
export async function lolcat_run(words, spread, phase) {
|
|
98
|
+
const cycle = spread ?? LOLCAT_SPREAD;
|
|
99
|
+
const start = phase ?? Math.floor(Math.random() * 256);
|
|
65
100
|
const text = text_input(words);
|
|
66
101
|
if (text === null)
|
|
67
102
|
return envelope_error('', undefined, 'lolcat: nothing to paint (pipe text in: fortune | lolcat)\n');
|
|
68
103
|
const said = text.replace(/\n$/, '');
|
|
69
|
-
return envelope_ok(`${lolcat_paint(said,
|
|
104
|
+
return envelope_ok(`${lolcat_paint(said, cycle, start)}\n`, { kind: 'games.lolcat', data: { text: said, spread: cycle, phase: start } });
|
|
70
105
|
}
|
|
71
106
|
//# sourceMappingURL=lolcat.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lolcat.js","sourceRoot":"","sources":["../../../src/builtins/games/lolcat.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,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AAK,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;AAC3I,CAAC"}
|
|
@@ -1,9 +1,44 @@
|
|
|
1
1
|
import { CommandEnvelope } from '@fnndsc/menu';
|
|
2
|
+
import type { ExpressionDeclaration } from '../../core/commandDeclaration.js';
|
|
2
3
|
/** The International code. */
|
|
3
4
|
export declare const MORSE: Readonly<Record<string, string>>;
|
|
4
5
|
/** Text to code: letters a space apart, words a slash apart; an unknown character is dropped. */
|
|
5
6
|
export declare function morse_encode(text: string): string;
|
|
6
7
|
/** Code to text: a group the code does not know becomes `?`. */
|
|
7
8
|
export declare function morse_decode(code: string): string;
|
|
8
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* `morse [-d] [text]`: the declaration. Its words are Morse code as often as
|
|
11
|
+
* text, and code is dashes (`morse -d ... --- ...`), so it takes its words
|
|
12
|
+
* as they come and reads `-d` or `--decode` at the front itself.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* commands_register({ declarations: [morseCommand] });
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export declare const morseCommand: ExpressionDeclaration;
|
|
20
|
+
/**
|
|
21
|
+
* `morse` over words already split.
|
|
22
|
+
*
|
|
23
|
+
* @param args - The words after `morse`: `-d` or `--decode` first to read code, then the text or the code.
|
|
24
|
+
* @returns The code or the text, or a refusal when there is nothing to carry.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* await builtin_morse(['-d', '...', '---', '...']); // sos
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
9
31
|
export declare function builtin_morse(args: string[]): Promise<CommandEnvelope>;
|
|
32
|
+
/**
|
|
33
|
+
* Taps out the piped text, else the words, or reads code back.
|
|
34
|
+
*
|
|
35
|
+
* @param words - The words of the text or the code.
|
|
36
|
+
* @param decode - Read code into text rather than text into code.
|
|
37
|
+
* @returns The result, or a refusal when there is nothing to carry.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```ts
|
|
41
|
+
* await morse_run(['sos'], false); // ... --- ...
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
export declare function morse_run(words: ReadonlyArray<string>, decode: boolean): Promise<CommandEnvelope>;
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* `morse hello` taps it out; `morse -d .... . .-.. .-.. ---` reads it. One
|
|
5
5
|
* space between letters, a slash between words, as operators write it. The
|
|
6
6
|
* typed model carries the code so a surface with a speaker can sound it.
|
|
7
|
+
* Declared in one record (`morseCommand`), its words taken as they come.
|
|
7
8
|
*
|
|
8
9
|
* @module
|
|
9
10
|
*/
|
|
@@ -27,10 +28,57 @@ export function morse_encode(text) {
|
|
|
27
28
|
export function morse_decode(code) {
|
|
28
29
|
return code.trim().split(/\s*\/\s*|\s{3,}/).map((word) => word.trim().split(/\s+/).filter((g) => g.length > 0).map((g) => MORSE_BACK[g] ?? '?').join('')).join(' ');
|
|
29
30
|
}
|
|
30
|
-
/**
|
|
31
|
+
/**
|
|
32
|
+
* `morse [-d] [text]`: the declaration. Its words are Morse code as often as
|
|
33
|
+
* text, and code is dashes (`morse -d ... --- ...`), so it takes its words
|
|
34
|
+
* as they come and reads `-d` or `--decode` at the front itself.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```ts
|
|
38
|
+
* commands_register({ declarations: [morseCommand] });
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export const morseCommand = {
|
|
42
|
+
name: 'morse',
|
|
43
|
+
grammar: 'expression',
|
|
44
|
+
help: {
|
|
45
|
+
usage: 'morse [-d] [text]',
|
|
46
|
+
summary: 'Text to Morse code and back',
|
|
47
|
+
description: 'Taps text out in International Morse — one space between letters, a slash between words — or, with -d (or --decode) as the first word, reads code back into text. Morse code is dashes, so its words are taken as they come, never as options. Reads what is piped in, else the words given.',
|
|
48
|
+
examples: ['morse sos', 'morse -d ... --- ...', 'fortune | morse'],
|
|
49
|
+
},
|
|
50
|
+
holds: [],
|
|
51
|
+
handler: (args) => builtin_morse(args),
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* `morse` over words already split.
|
|
55
|
+
*
|
|
56
|
+
* @param args - The words after `morse`: `-d` or `--decode` first to read code, then the text or the code.
|
|
57
|
+
* @returns The code or the text, or a refusal when there is nothing to carry.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```ts
|
|
61
|
+
* await builtin_morse(['-d', '...', '---', '...']); // sos
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
31
64
|
export async function builtin_morse(args) {
|
|
32
65
|
const decode = args[0] === '-d' || args[0] === '--decode';
|
|
33
|
-
|
|
66
|
+
return morse_run(decode ? args.slice(1) : args, decode);
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Taps out the piped text, else the words, or reads code back.
|
|
70
|
+
*
|
|
71
|
+
* @param words - The words of the text or the code.
|
|
72
|
+
* @param decode - Read code into text rather than text into code.
|
|
73
|
+
* @returns The result, or a refusal when there is nothing to carry.
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```ts
|
|
77
|
+
* await morse_run(['sos'], false); // ... --- ...
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
export async function morse_run(words, decode) {
|
|
81
|
+
const text = text_input(words);
|
|
34
82
|
if (text === null)
|
|
35
83
|
return envelope_error('', undefined, 'morse: usage: morse <text> | morse -d <code>\n');
|
|
36
84
|
const said = text.replace(/\n$/, '');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"morse.js","sourceRoot":"","sources":["../../../src/builtins/games/morse.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"morse.js","sourceRoot":"","s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