@fnndsc/brasa 0.31.5 → 0.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/buildinfo.json +1 -1
- package/dist/builtins/games/bytes.d.ts +21 -0
- package/dist/builtins/games/bytes.js +224 -0
- package/dist/builtins/games/bytes.js.map +1 -0
- package/dist/builtins/games/chimes.d.ts +64 -0
- package/dist/builtins/games/chimes.js +223 -0
- package/dist/builtins/games/chimes.js.map +1 -0
- package/dist/builtins/games/cowsay.d.ts +36 -0
- package/dist/builtins/games/cowsay.js +127 -0
- package/dist/builtins/games/cowsay.js.map +1 -0
- package/dist/builtins/games/figlet.d.ts +25 -0
- package/dist/builtins/games/figlet.js +109 -0
- package/dist/builtins/games/figlet.js.map +1 -0
- package/dist/builtins/games/lab.d.ts +51 -0
- package/dist/builtins/games/lab.js +161 -0
- package/dist/builtins/games/lab.js.map +1 -0
- package/dist/builtins/games/lolcat.d.ts +26 -0
- package/dist/builtins/games/lolcat.js +71 -0
- package/dist/builtins/games/lolcat.js.map +1 -0
- package/dist/builtins/games/morse.d.ts +18 -0
- package/dist/builtins/games/morse.js +46 -0
- package/dist/builtins/games/morse.js.map +1 -0
- package/dist/builtins/games/numbers.d.ts +55 -0
- package/dist/builtins/games/numbers.js +270 -0
- package/dist/builtins/games/numbers.js.map +1 -0
- package/dist/builtins/games/play.d.ts +53 -0
- package/dist/builtins/games/play.js +228 -0
- package/dist/builtins/games/play.js.map +1 -0
- package/dist/builtins/games/qr.d.ts +40 -0
- package/dist/builtins/games/qr.js +336 -0
- package/dist/builtins/games/qr.js.map +1 -0
- package/dist/builtins/games/shelf.d.ts +27 -0
- package/dist/builtins/games/shelf.js +71 -0
- package/dist/builtins/games/shelf.js.map +1 -0
- package/dist/builtins/games/show.d.ts +32 -0
- package/dist/builtins/games/show.js +68 -0
- package/dist/builtins/games/show.js.map +1 -0
- package/dist/builtins/games/sky.d.ts +69 -0
- package/dist/builtins/games/sky.js +190 -0
- package/dist/builtins/games/sky.js.map +1 -0
- package/dist/builtins/games/stdin.d.ts +34 -0
- package/dist/builtins/games/stdin.js +48 -0
- package/dist/builtins/games/stdin.js.map +1 -0
- package/dist/builtins/games/text.d.ts +46 -0
- package/dist/builtins/games/text.js +133 -0
- package/dist/builtins/games/text.js.map +1 -0
- package/dist/builtins/games/wtf.d.ts +13 -0
- package/dist/builtins/games/wtf.data.d.ts +12 -0
- package/dist/builtins/games/wtf.data.js +70 -0
- package/dist/builtins/games/wtf.data.js.map +1 -0
- package/dist/builtins/games/wtf.js +45 -0
- package/dist/builtins/games/wtf.js.map +1 -0
- package/dist/builtins/help.d.ts +8 -0
- package/dist/builtins/help.js +296 -0
- package/dist/builtins/help.js.map +1 -1
- package/dist/core/dispatch.js +125 -9
- package/dist/core/dispatch.js.map +1 -1
- package/dist/core/engine.js +1 -0
- package/dist/core/engine.js.map +1 -1
- package/dist/core/surface.d.ts +14 -0
- package/dist/core/surface.js.map +1 -1
- package/dist/lib/vfs/providers/static.js +15 -1
- package/dist/lib/vfs/providers/static.js.map +1 -1
- package/dist/lib/vfs/providers/static_content.js +2 -2
- package/dist/lib/vfs/providers/static_content.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Text toys from the shelf: `rev`, `tac`, `yes`, `seq`, `shuf`, `rot13`.
|
|
3
|
+
*
|
|
4
|
+
* Each reads what was piped in, else its arguments, and answers in kind:
|
|
5
|
+
* `fortune | rev`, `rot13 hello`, `seq 1 2 9`. `yes` is bounded — a shell
|
|
6
|
+
* that never ends is not a toy — and says how many it printed.
|
|
7
|
+
*
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
import { envelope_ok, envelope_error } from '@fnndsc/cumin';
|
|
11
|
+
import chalk from 'chalk';
|
|
12
|
+
import { text_input } from './stdin.js';
|
|
13
|
+
/** Lines `yes` prints when not told how many. */
|
|
14
|
+
export const YES_DEFAULT = 10;
|
|
15
|
+
/** The most lines `yes` prints however it is asked. */
|
|
16
|
+
export const YES_MAX = 10_000;
|
|
17
|
+
/** The most numbers `seq` prints. */
|
|
18
|
+
export const SEQ_MAX = 100_000;
|
|
19
|
+
/** Reverses each line's characters, keeping the lines. */
|
|
20
|
+
export function text_rev(text) {
|
|
21
|
+
return text.split('\n').map((line) => [...line].reverse().join('')).join('\n');
|
|
22
|
+
}
|
|
23
|
+
/** Reverses the order of the lines. */
|
|
24
|
+
export function text_tac(text) {
|
|
25
|
+
const trailing = text.endsWith('\n');
|
|
26
|
+
const lines = (trailing ? text.slice(0, -1) : text).split('\n');
|
|
27
|
+
return lines.reverse().join('\n') + (trailing ? '\n' : '');
|
|
28
|
+
}
|
|
29
|
+
/** The ROT13 of a text; letters only, case kept. */
|
|
30
|
+
export function text_rot13(text) {
|
|
31
|
+
return text.replace(/[a-zA-Z]/g, (c) => {
|
|
32
|
+
const base = c <= 'Z' ? 65 : 97;
|
|
33
|
+
return String.fromCharCode(((c.charCodeAt(0) - base + 13) % 26) + base);
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* The numbers `seq` prints: `seq LAST`, `seq FIRST LAST`, `seq FIRST STEP LAST`.
|
|
38
|
+
*
|
|
39
|
+
* @returns The numbers, or a refusal.
|
|
40
|
+
*/
|
|
41
|
+
export function seq_numbers(args) {
|
|
42
|
+
const nums = args.map(Number);
|
|
43
|
+
if (nums.length === 0 || nums.length > 3 || nums.some((n) => !Number.isFinite(n))) {
|
|
44
|
+
return { refusal: 'seq: usage: seq [FIRST [STEP]] LAST' };
|
|
45
|
+
}
|
|
46
|
+
const [first, step, last] = nums.length === 1 ? [1, 1, nums[0]]
|
|
47
|
+
: nums.length === 2 ? [nums[0], 1, nums[1]]
|
|
48
|
+
: [nums[0], nums[1], nums[2]];
|
|
49
|
+
if (step === 0)
|
|
50
|
+
return { refusal: 'seq: STEP must not be zero' };
|
|
51
|
+
const numbers = [];
|
|
52
|
+
for (let n = first; step > 0 ? n <= last : n >= last; n += step) {
|
|
53
|
+
numbers.push(Number(n.toFixed(10)));
|
|
54
|
+
if (numbers.length >= SEQ_MAX)
|
|
55
|
+
break;
|
|
56
|
+
}
|
|
57
|
+
return { numbers };
|
|
58
|
+
}
|
|
59
|
+
/** Shuffles lines (Fisher–Yates), with an optional source of chance for tests. */
|
|
60
|
+
export function lines_shuffle(lines, random = Math.random) {
|
|
61
|
+
const out = [...lines];
|
|
62
|
+
for (let i = out.length - 1; i > 0; i--) {
|
|
63
|
+
const j = Math.floor(random() * (i + 1));
|
|
64
|
+
[out[i], out[j]] = [out[j], out[i]];
|
|
65
|
+
}
|
|
66
|
+
return out;
|
|
67
|
+
}
|
|
68
|
+
/** `rev [text]` */
|
|
69
|
+
export async function builtin_rev(args) {
|
|
70
|
+
const text = text_input(args);
|
|
71
|
+
if (text === null)
|
|
72
|
+
return envelope_error('', undefined, 'rev: nothing to reverse (pipe text in, or give it)\n');
|
|
73
|
+
const out = text_rev(text.replace(/\n$/, ''));
|
|
74
|
+
return envelope_ok(`${out}\n`, { kind: 'games.rev', data: { text: out } });
|
|
75
|
+
}
|
|
76
|
+
/** `tac [text]` */
|
|
77
|
+
export async function builtin_tac(args) {
|
|
78
|
+
const text = text_input(args);
|
|
79
|
+
if (text === null)
|
|
80
|
+
return envelope_error('', undefined, 'tac: nothing to turn over (pipe lines in)\n');
|
|
81
|
+
const out = text_tac(text.endsWith('\n') ? text : `${text}\n`);
|
|
82
|
+
return envelope_ok(out, { kind: 'games.tac', data: { text: out } });
|
|
83
|
+
}
|
|
84
|
+
/** `yes [word] [-n N]` */
|
|
85
|
+
export async function builtin_yes(args) {
|
|
86
|
+
let count = YES_DEFAULT;
|
|
87
|
+
const words = [];
|
|
88
|
+
for (let i = 0; i < args.length; i++) {
|
|
89
|
+
if (args[i] === '-n') {
|
|
90
|
+
const n = Number(args[i + 1]);
|
|
91
|
+
if (!Number.isInteger(n) || n < 1)
|
|
92
|
+
return envelope_error('', undefined, 'yes: -n wants a positive whole number\n');
|
|
93
|
+
count = Math.min(n, YES_MAX);
|
|
94
|
+
i++;
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
words.push(args[i]);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
const word = words.length > 0 ? words.join(' ') : 'y';
|
|
101
|
+
const lines = `${word}\n`.repeat(count);
|
|
102
|
+
// Bounded on purpose, and it says so: the real yes runs until killed.
|
|
103
|
+
const note = chalk.gray(`yes: ${count} of forever (-n N for more, up to ${YES_MAX})\n`);
|
|
104
|
+
return envelope_ok(lines + note, { kind: 'games.yes', data: { word, count } });
|
|
105
|
+
}
|
|
106
|
+
/** `seq [FIRST [STEP]] LAST` */
|
|
107
|
+
export async function builtin_seq(args) {
|
|
108
|
+
const answer = seq_numbers(args);
|
|
109
|
+
if ('refusal' in answer)
|
|
110
|
+
return envelope_error('', undefined, `${answer.refusal}\n`);
|
|
111
|
+
const note = answer.numbers.length >= SEQ_MAX ? chalk.gray(`seq: stopped at ${SEQ_MAX} numbers\n`) : '';
|
|
112
|
+
return envelope_ok(`${answer.numbers.join('\n')}\n${note}`, { kind: 'games.seq', data: { numbers: answer.numbers } });
|
|
113
|
+
}
|
|
114
|
+
/** `shuf [words...]`: lines piped in, or the words given, in a random order. */
|
|
115
|
+
export async function builtin_shuf(args) {
|
|
116
|
+
const piped = text_input([]);
|
|
117
|
+
const lines = piped !== null
|
|
118
|
+
? piped.replace(/\n$/, '').split('\n')
|
|
119
|
+
: args;
|
|
120
|
+
if (lines.length === 0)
|
|
121
|
+
return envelope_error('', undefined, 'shuf: nothing to shuffle (pipe lines in, or give words)\n');
|
|
122
|
+
const out = lines_shuffle(lines);
|
|
123
|
+
return envelope_ok(`${out.join('\n')}\n`, { kind: 'games.shuf', data: { lines: out } });
|
|
124
|
+
}
|
|
125
|
+
/** `rot13 [text]` */
|
|
126
|
+
export async function builtin_rot13(args) {
|
|
127
|
+
const text = text_input(args);
|
|
128
|
+
if (text === null)
|
|
129
|
+
return envelope_error('', undefined, 'rot13: nothing to turn (pipe text in, or give it)\n');
|
|
130
|
+
const out = text_rot13(text.replace(/\n$/, ''));
|
|
131
|
+
return envelope_ok(`${out}\n`, { kind: 'games.rot13', data: { text: out } });
|
|
132
|
+
}
|
|
133
|
+
//# sourceMappingURL=text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.js","sourceRoot":"","sources":["../../../src/builtins/games/text.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAmB,WAAW,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC7E,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,iDAAiD;AACjD,MAAM,CAAC,MAAM,WAAW,GAAW,EAAE,CAAC;AACtC,uDAAuD;AACvD,MAAM,CAAC,MAAM,OAAO,GAAW,MAAM,CAAC;AACtC,qCAAqC;AACrC,MAAM,CAAC,MAAM,OAAO,GAAW,OAAO,CAAC;AAEvC,0DAA0D;AAC1D,MAAM,UAAU,QAAQ,CAAC,IAAY;IACnC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,IAAY,EAAU,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACjG,CAAC;AAED,uCAAuC;AACvC,MAAM,UAAU,QAAQ,CAAC,IAAY;IACnC,MAAM,QAAQ,GAAY,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC9C,MAAM,KAAK,GAAa,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,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,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC;IACxD,OAAO,WAAW,CAAC,GAAG,GAAG,IAAI,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;AAC/E,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file `wtf`: what an acronym means, from the book in `wtf.data.ts`.
|
|
3
|
+
*
|
|
4
|
+
* `wtf is lonk`, `wtf lonk`, `wtf cube pfdcm`. A term the book lacks is
|
|
5
|
+
* said so; `wtf -l` lists every term it has.
|
|
6
|
+
*
|
|
7
|
+
* @module
|
|
8
|
+
*/
|
|
9
|
+
import { CommandEnvelope } from '@fnndsc/cumin';
|
|
10
|
+
/** The meanings of a term, or none. */
|
|
11
|
+
export declare function wtf_lookup(term: string): ReadonlyArray<string>;
|
|
12
|
+
/** `wtf [is] <term>... | wtf -l` */
|
|
13
|
+
export declare function builtin_wtf(args: string[]): Promise<CommandEnvelope>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file What the acronyms around here mean: the book `wtf` reads from.
|
|
3
|
+
*
|
|
4
|
+
* BSD's `wtf` read /usr/share/misc/acronyms. Ours reads this: the ChRIS and
|
|
5
|
+
* DICOM words a new user meets in their first hour, and the names of the
|
|
6
|
+
* mise packages. Keys are matched without regard to case; a key may have
|
|
7
|
+
* several meanings, each its own line.
|
|
8
|
+
*
|
|
9
|
+
* @module
|
|
10
|
+
*/
|
|
11
|
+
/** The book: a term to its meanings. */
|
|
12
|
+
export declare const ACRONYMS: Readonly<Record<string, ReadonlyArray<string>>>;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file What the acronyms around here mean: the book `wtf` reads from.
|
|
3
|
+
*
|
|
4
|
+
* BSD's `wtf` read /usr/share/misc/acronyms. Ours reads this: the ChRIS and
|
|
5
|
+
* DICOM words a new user meets in their first hour, and the names of the
|
|
6
|
+
* mise packages. Keys are matched without regard to case; a key may have
|
|
7
|
+
* several meanings, each its own line.
|
|
8
|
+
*
|
|
9
|
+
* @module
|
|
10
|
+
*/
|
|
11
|
+
/** The book: a term to its meanings. */
|
|
12
|
+
export const ACRONYMS = {
|
|
13
|
+
chris: ['ChRIS — the ChRIS Research Integration System: a platform that runs containerised analyses (plugins) on medical data, by the FNNDSC at Boston Children\'s Hospital'],
|
|
14
|
+
cube: ['CUBE — the ChRIS Ultron Back End: the REST API and database every ChRIS surface talks to (a Django app)'],
|
|
15
|
+
fnndsc: ['FNNDSC — the Fetal-Neonatal Neuroimaging and Developmental Science Center, Boston Children\'s Hospital; ChRIS\'s home'],
|
|
16
|
+
feed: ['feed — one analysis in ChRIS: a tree of plugin instances rooted on some data; what ARGUS lists under ANALYSES'],
|
|
17
|
+
plugin: ['plugin — a containerised program ChRIS can run; a step in a feed. Kinds: fs (makes data from nothing), ds (data in, data out), ts (joins several parents)'],
|
|
18
|
+
pipeline: ['pipeline — a saved shape of plugins to run in order, with their parameters; what `pipeline run` starts and `/bin` lists'],
|
|
19
|
+
instance: ['plugin instance — one run of a plugin inside a feed, with its own parameters, status and output folder; a job'],
|
|
20
|
+
job: ['job — a plugin instance, as `proc` and the dashboard count them'],
|
|
21
|
+
cfs: ['CFS — the ChRIS filesystem: the files CUBE holds, under /home/<user>, /SERVICES/PACS, /PIPELINES, /SHARED and /PUBLIC'],
|
|
22
|
+
swift: ['Swift — the object store CUBE kept files in originally; the paths in CFS still look like it'],
|
|
23
|
+
pfcon: ['pfcon — the process-and-file controller: the service CUBE hands a plugin run to, which stages the data and starts the container'],
|
|
24
|
+
pman: ['pman — the process manager behind pfcon: starts containers on a compute (Docker, Swarm, Kubernetes, Slurm)'],
|
|
25
|
+
pfdcm: ['pfdcm — the PACS front end: the service that asks a PACS (C-FIND) and tells it to send (C-MOVE); `pacs query` and `pull` go through it'],
|
|
26
|
+
oxidicom: ['oxidicom — the DICOM receiver (in Rust) that the PACS sends files to; it stores them and registers them in CUBE, and reports progress over LONK'],
|
|
27
|
+
lonk: ['LONK — Light Oxidicom NotifiKations: the small messages oxidicom publishes (over NATS) as a series arrives: a file count, done, or an error'],
|
|
28
|
+
nats: ['NATS — the message bus oxidicom publishes LONK on; CUBE relays it to a websocket a pull watches'],
|
|
29
|
+
pacs: ['PACS — Picture Archiving and Communication System: the hospital\'s image archive, spoken to in DICOM'],
|
|
30
|
+
dicom: ['DICOM — Digital Imaging and Communications in Medicine: the file format and the network protocol of medical imaging'],
|
|
31
|
+
'c-find': ['C-FIND — the DICOM query: ask a PACS what it holds (`pacs query`)'],
|
|
32
|
+
'c-move': ['C-MOVE — the DICOM retrieve: tell a PACS to send a study or series to a receiver (`pull`, with oxidicom receiving)'],
|
|
33
|
+
'c-store': ['C-STORE — the DICOM send: one image delivered to a receiver; what a C-MOVE sets off, many times'],
|
|
34
|
+
ae: ['AE title — Application Entity title: the name a DICOM node goes by on the network (the receiver here is an AE title the PACS knows)'],
|
|
35
|
+
aetitle: ['AE title — Application Entity title: the name a DICOM node goes by on the network'],
|
|
36
|
+
mrn: ['MRN — Medical Record Number: the hospital\'s patient identifier; PatientID in DICOM'],
|
|
37
|
+
accession: ['accession number — the identifier of one imaging order/study at the hospital; AccessionNumber in DICOM'],
|
|
38
|
+
study: ['study — one imaging visit in DICOM, holding series'],
|
|
39
|
+
series: ['series — one acquisition in a study: a stack of images of one kind (an axial T1, say); what `pull` fetches'],
|
|
40
|
+
sop: ['SOP — Service-Object Pair: DICOM\'s name for a kind of object (an MR image) and the services on it; a SOPInstanceUID names one image'],
|
|
41
|
+
uid: ['UID — a DICOM unique identifier (dotted numbers): StudyInstanceUID, SeriesInstanceUID, SOPInstanceUID'],
|
|
42
|
+
modality: ['modality — the kind of scanner: MR, CT, US, CR, DX, PT …'],
|
|
43
|
+
mpr: ['MPR — multiplanar reconstruction: a volume resliced into other planes'],
|
|
44
|
+
sr: ['SR — Structured Report: a DICOM document rather than an image (a radiology report); a PACS will often not send these'],
|
|
45
|
+
hu: ['HU — Hounsfield unit: CT intensity, water at 0, air at −1000'],
|
|
46
|
+
nifti: ['NIfTI — the neuroimaging volume format (.nii, .nii.gz) most analysis tools read; what DICOM gets converted to'],
|
|
47
|
+
bids: ['BIDS — the Brain Imaging Data Structure: a folder and naming convention for neuroimaging datasets'],
|
|
48
|
+
freesurfer: ['FreeSurfer — the brain MRI analysis suite (cortical surfaces, segmentations) many ChRIS plugins wrap'],
|
|
49
|
+
seagap: ['SeaGaP — Search, Gather, Process: the ChRIS workflow ARGUS is built around — find data, gather a cohort, run a pipeline on it'],
|
|
50
|
+
cohort: ['cohort — the set of series or files gathered to process together; GATHER in ARGUS; kept in ~/gather'],
|
|
51
|
+
mise: ['mise — this framework: an intent kernel (brasa) with surfaces (chell, ARGUS); the name is "mise en place"'],
|
|
52
|
+
brasa: ['brasa — the intent kernel: every command\'s meaning, returning typed envelopes; knows no surface'],
|
|
53
|
+
chell: ['chell — the terminal surface: a shell over brasa; also the program that starts a daemon'],
|
|
54
|
+
calypso: ['CALYPSO — the daemon: one session many surfaces attach to over a websocket; Accepts Language, Yielding Permitted Shell Operations'],
|
|
55
|
+
argus: ['ARGUS — the browser surface: panes over the same session, drawn in LCARS'],
|
|
56
|
+
porter: ['porter — the display manager: the door (login) that starts or finds a user\'s daemon and serves ARGUS behind it'],
|
|
57
|
+
menu: ['menu — the wire package: the message and model schemas every surface and the daemon agree on'],
|
|
58
|
+
cumin: ['cumin — the base library: the CUBE client, connection, caches and the error stack'],
|
|
59
|
+
salsa: ['salsa — the data layer: files, feeds, the virtual filesystem providers, the retrieve watch'],
|
|
60
|
+
chili: ['chili — the older command layer: the path mapper and the commands brasa still delegates to'],
|
|
61
|
+
orrery: ['orrery — the scene package: molecules, galaxies and the universe, drawn for ARGUS'],
|
|
62
|
+
envelope: ['envelope — what a command returns: rendered text, a status, and a typed model a surface may draw'],
|
|
63
|
+
lcars: ['LCARS — Library Computer Access/Retrieval System: the Star Trek interface ARGUS\'s look is after'],
|
|
64
|
+
aegis: ['AEGIS — ARGUS\'s interface standard: the laws every pane obeys, in apps/argus/docs/aegis.adoc'],
|
|
65
|
+
harbor: ['HARBOR — the project board the mise epics are tracked on'],
|
|
66
|
+
k8s: ['k8s — Kubernetes, which runs CUBE and its services here'],
|
|
67
|
+
oidc: ['OIDC — OpenID Connect; how the mise packages publish to npm without a token'],
|
|
68
|
+
wtf: ['wtf — this: BSD\'s acronym expander, with this book instead of /usr/share/misc/acronyms'],
|
|
69
|
+
};
|
|
70
|
+
//# sourceMappingURL=wtf.data.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wtf.data.js","sourceRoot":"","sources":["../../../src/builtins/games/wtf.data.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,wCAAwC;AACxC,MAAM,CAAC,MAAM,QAAQ,GAAoD;IACvE,KAAK,EAAE,CAAC,oKAAoK,CAAC;IAC7K,IAAI,EAAE,CAAC,yGAAyG,CAAC;IACjH,MAAM,EAAE,CAAC,uHAAuH,CAAC;IACjI,IAAI,EAAE,CAAC,+GAA+G,CAAC;IACvH,MAAM,EAAE,CAAC,2JAA2J,CAAC;IACrK,QAAQ,EAAE,CAAC,yHAAyH,CAAC;IACrI,QAAQ,EAAE,CAAC,+GAA+G,CAAC;IAC3H,GAAG,EAAE,CAAC,iEAAiE,CAAC;IACxE,GAAG,EAAE,CAAC,uHAAuH,CAAC;IAC9H,KAAK,EAAE,CAAC,6FAA6F,CAAC;IACtG,KAAK,EAAE,CAAC,iIAAiI,CAAC;IAC1I,IAAI,EAAE,CAAC,4GAA4G,CAAC;IACpH,KAAK,EAAE,CAAC,wIAAwI,CAAC;IACjJ,QAAQ,EAAE,CAAC,iJAAiJ,CAAC;IAC7J,IAAI,EAAE,CAAC,6IAA6I,CAAC;IACrJ,IAAI,EAAE,CAAC,iGAAiG,CAAC;IACzG,IAAI,EAAE,CAAC,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;IACrG,MAAM,EAAE,CAAC,mFAAmF,CAAC;IAC7F,QAAQ,EAAE,CAAC,kGAAkG,CAAC;IAC9G,KAAK,EAAE,CAAC,kGAAkG,CAAC;IAC3G,KAAK,EAAE,CAAC,+FAA+F,CAAC;IACxG,MAAM,EAAE,CAAC,0DAA0D,CAAC;IACpE,GAAG,EAAE,CAAC,yDAAyD,CAAC;IAChE,IAAI,EAAE,CAAC,6EAA6E,CAAC;IACrF,GAAG,EAAE,CAAC,yFAAyF,CAAC;CACjG,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file `wtf`: what an acronym means, from the book in `wtf.data.ts`.
|
|
3
|
+
*
|
|
4
|
+
* `wtf is lonk`, `wtf lonk`, `wtf cube pfdcm`. A term the book lacks is
|
|
5
|
+
* said so; `wtf -l` lists every term it has.
|
|
6
|
+
*
|
|
7
|
+
* @module
|
|
8
|
+
*/
|
|
9
|
+
import { envelope_ok, envelope_error } from '@fnndsc/cumin';
|
|
10
|
+
import chalk from 'chalk';
|
|
11
|
+
import { ACRONYMS } from './wtf.data.js';
|
|
12
|
+
import { text_input } from './stdin.js';
|
|
13
|
+
/** The meanings of a term, or none. */
|
|
14
|
+
export function wtf_lookup(term) {
|
|
15
|
+
const key = term.trim().toLowerCase().replace(/[?.!,]+$/, '');
|
|
16
|
+
return ACRONYMS[key] ?? ACRONYMS[key.replace(/-/g, '')] ?? [];
|
|
17
|
+
}
|
|
18
|
+
/** `wtf [is] <term>... | wtf -l` */
|
|
19
|
+
export async function builtin_wtf(args) {
|
|
20
|
+
if (args[0] === '-l' || args[0] === '--list') {
|
|
21
|
+
const terms = Object.keys(ACRONYMS).sort();
|
|
22
|
+
return envelope_ok(`${terms.join(' ')}\n`, { kind: 'games.wtf', data: { terms } });
|
|
23
|
+
}
|
|
24
|
+
const text = text_input(args);
|
|
25
|
+
const words = (text ?? '').trim().split(/\s+/).filter((w) => w.length > 0 && !/^(is|are|the|a|an)$/i.test(w));
|
|
26
|
+
if (words.length === 0)
|
|
27
|
+
return envelope_error('', undefined, 'wtf: usage: wtf [is] <term> (wtf -l lists the terms)\n');
|
|
28
|
+
const lines = [];
|
|
29
|
+
const found = {};
|
|
30
|
+
for (const word of words) {
|
|
31
|
+
const meanings = wtf_lookup(word);
|
|
32
|
+
if (meanings.length === 0) {
|
|
33
|
+
lines.push(`${chalk.cyan(word.toUpperCase())}: ${chalk.gray('nothing known. Gee... I don\'t know what that means (wtf -l lists what I do)')}`);
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
found[word.toLowerCase()] = meanings;
|
|
37
|
+
// A meaning names its term first; the term is lit rather than repeated.
|
|
38
|
+
for (const meaning of meanings) {
|
|
39
|
+
const dash = meaning.indexOf(' — ');
|
|
40
|
+
lines.push(dash > 0 ? `${chalk.cyan(meaning.slice(0, dash))} — ${meaning.slice(dash + 3)}` : `${chalk.cyan(word.toUpperCase())}: ${meaning}`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return envelope_ok(`${lines.join('\n')}\n`, { kind: 'games.wtf', data: { terms: words, found } });
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=wtf.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wtf.js","sourceRoot":"","sources":["../../../src/builtins/games/wtf.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAmB,WAAW,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC7E,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,uCAAuC;AACvC,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,MAAM,GAAG,GAAW,IAAI,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;IACt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,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,KAAK,KAAK,CAAC,IAAI,CAAC,8EAA8E,CAAC,EAAE,CAAC,CAAC;YAC/I,SAAS;QACX,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,GAAG,QAAQ,CAAC;QACrC,wEAAwE;QACxE,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;YAC/B,MAAM,IAAI,GAAW,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YAC5C,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,MAAM,OAAO,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,KAAK,OAAO,EAAE,CAAC,CAAC;QAChJ,CAAC;IACH,CAAC;IACD,OAAO,WAAW,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;AACpG,CAAC"}
|
package/dist/builtins/help.d.ts
CHANGED
|
@@ -87,6 +87,14 @@ export declare function builtin_help(args: string[]): Promise<CommandEnvelope>;
|
|
|
87
87
|
* @returns Array of builtin command names.
|
|
88
88
|
*/
|
|
89
89
|
export declare function builtinCommands_list(): string[];
|
|
90
|
+
/**
|
|
91
|
+
* A command's one-line summary (its `summary`, else its description), for
|
|
92
|
+
* a listing that names many commands at once.
|
|
93
|
+
*
|
|
94
|
+
* @param command - The command.
|
|
95
|
+
* @returns The line, or undefined for a command with no help entry.
|
|
96
|
+
*/
|
|
97
|
+
export declare function commandSummary_get(command: string): string | undefined;
|
|
90
98
|
/**
|
|
91
99
|
* Gets the description for a builtin command.
|
|
92
100
|
*
|