@fnndsc/brasa 0.23.2 → 0.25.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/fs/pull.args.d.ts +1 -1
- package/dist/builtins/fs/pull.args.js +5 -3
- package/dist/builtins/fs/pull.args.js.map +1 -1
- package/dist/builtins/fs/pull.js +2 -2
- package/dist/builtins/fs/touch.js +1 -1
- package/dist/builtins/fs/touch.js.map +1 -1
- package/dist/builtins/help.js +134 -10
- package/dist/builtins/help.js.map +1 -1
- package/dist/builtins/index.d.ts +6 -0
- package/dist/builtins/index.js +6 -0
- package/dist/builtins/index.js.map +1 -1
- package/dist/builtins/net/query.csv.js +14 -0
- package/dist/builtins/net/query.csv.js.map +1 -1
- package/dist/builtins/net/query.js +3 -0
- package/dist/builtins/net/query.js.map +1 -1
- package/dist/builtins/pluginExecute.js +28 -3
- package/dist/builtins/pluginExecute.js.map +1 -1
- package/dist/builtins/proc.js +32 -2
- package/dist/builtins/proc.js.map +1 -1
- package/dist/builtins/res/dicom.d.ts +35 -1
- package/dist/builtins/res/dicom.js +15 -2
- package/dist/builtins/res/dicom.js.map +1 -1
- package/dist/builtins/res/expect.d.ts +40 -0
- package/dist/builtins/res/expect.js +447 -0
- package/dist/builtins/res/expect.js.map +1 -0
- package/dist/builtins/res/gather.d.ts +10 -0
- package/dist/builtins/res/gather.js +224 -0
- package/dist/builtins/res/gather.js.map +1 -0
- package/dist/builtins/res/gather.store.d.ts +131 -0
- package/dist/builtins/res/gather.store.js +225 -0
- package/dist/builtins/res/gather.store.js.map +1 -0
- package/dist/builtins/res/pipeline.args.d.ts +5 -2
- package/dist/builtins/res/pipeline.args.js +8 -3
- package/dist/builtins/res/pipeline.args.js.map +1 -1
- package/dist/builtins/res/pipeline.js +23 -0
- package/dist/builtins/res/pipeline.js.map +1 -1
- package/dist/builtins/res/play.d.ts +70 -0
- package/dist/builtins/res/play.js +334 -0
- package/dist/builtins/res/play.js.map +1 -0
- package/dist/builtins/res/plugin.js +21 -6
- package/dist/builtins/res/plugin.js.map +1 -1
- package/dist/builtins/res/record.d.ts +49 -0
- package/dist/builtins/res/record.js +150 -0
- package/dist/builtins/res/record.js.map +1 -0
- package/dist/builtins/res/runWait.d.ts +49 -0
- package/dist/builtins/res/runWait.js +193 -0
- package/dist/builtins/res/runWait.js.map +1 -0
- package/dist/builtins/sys/motd.d.ts +41 -0
- package/dist/builtins/sys/motd.js +139 -0
- package/dist/builtins/sys/motd.js.map +1 -0
- package/dist/builtins/sys/weather.d.ts +132 -0
- package/dist/builtins/sys/weather.js +297 -0
- package/dist/builtins/sys/weather.js.map +1 -0
- package/dist/command-keys.js +4 -0
- package/dist/command-keys.js.map +1 -1
- package/dist/core/connect.d.ts +31 -1
- package/dist/core/connect.js +32 -1
- package/dist/core/connect.js.map +1 -1
- package/dist/core/dispatch.d.ts +0 -14
- package/dist/core/dispatch.js +85 -27
- package/dist/core/dispatch.js.map +1 -1
- package/dist/core/engine.d.ts +10 -0
- package/dist/core/engine.js +9 -0
- package/dist/core/engine.js.map +1 -1
- package/dist/core/expansion.d.ts +70 -0
- package/dist/core/expansion.js +289 -0
- package/dist/core/expansion.js.map +1 -0
- package/dist/core/promptContext.js +5 -1
- package/dist/core/promptContext.js.map +1 -1
- package/dist/lib/duration.d.ts +17 -0
- package/dist/lib/duration.js +25 -0
- package/dist/lib/duration.js.map +1 -0
- package/dist/lib/parser.d.ts +50 -0
- package/dist/lib/parser.js +119 -0
- package/dist/lib/parser.js.map +1 -1
- package/dist/logo/brain.d.ts +6 -27
- package/dist/logo/brain.js +5 -250
- package/dist/logo/brain.js.map +1 -1
- package/dist/session/answer.d.ts +141 -0
- package/dist/session/answer.js +163 -0
- package/dist/session/answer.js.map +1 -0
- package/dist/session/answerAdapters.d.ts +4 -0
- package/dist/session/answerAdapters.js +106 -0
- package/dist/session/answerAdapters.js.map +1 -0
- package/dist/session/recent.d.ts +68 -0
- package/dist/session/recent.js +99 -0
- package/dist/session/recent.js.map +1 -0
- package/dist/session/recorder.d.ts +61 -0
- package/dist/session/recorder.js +95 -0
- package/dist/session/recorder.js.map +1 -0
- package/package.json +5 -5
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file What a `${reference}` refers to, for every line the session runs.
|
|
3
|
+
*
|
|
4
|
+
* There was more than one answer to this. The dispatcher substituted the
|
|
5
|
+
* environment after tokenizing (so a single-quoted `$HOME` expanded anyway),
|
|
6
|
+
* and `play` substituted parameters and session pronouns before tokenizing
|
|
7
|
+
* (so a gathered path with a space had to be quoted by hand). Two expanders
|
|
8
|
+
* over one syntax is two sources of truth, and they composed by accident
|
|
9
|
+
* rather than by design.
|
|
10
|
+
*
|
|
11
|
+
* One resolver now answers for all of them, in a fixed order:
|
|
12
|
+
*
|
|
13
|
+
* . *Session pronouns*, a closed RESERVED set — the cohort, the feed, the
|
|
14
|
+
* run, the query, the place the session stands.
|
|
15
|
+
* . *Parameters* of the manifest being played, if one is.
|
|
16
|
+
* . *The environment*.
|
|
17
|
+
*
|
|
18
|
+
* A name nothing answers refuses the LINE rather than expanding to nothing
|
|
19
|
+
* or standing as text: `rm -rf ${DIR}/scratch` with `DIR` unset is how a
|
|
20
|
+
* script deletes the wrong thing, and this stack does not do silent
|
|
21
|
+
* workarounds.
|
|
22
|
+
*
|
|
23
|
+
* @module
|
|
24
|
+
*/
|
|
25
|
+
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
26
|
+
import { session } from '../session/index.js';
|
|
27
|
+
import { recentFeed_get, recentQuery_get, recentRunPlace_get, recentRuns_get } from '../session/recent.js';
|
|
28
|
+
import { ANSWER_KINDS, answer_get, answerKind_count, answerRow_get } from '../session/answer.js';
|
|
29
|
+
/** The names the session answers for; a manifest may not take them. */
|
|
30
|
+
export const RESERVED_REFERENCES = new Set([
|
|
31
|
+
'gather', 'feed', 'run', 'query', 'cwd',
|
|
32
|
+
]);
|
|
33
|
+
/** Whether an unanswerable reference may stand as written: what a dry run does. */
|
|
34
|
+
const standsScope = new AsyncLocalStorage();
|
|
35
|
+
/** Parameters of the manifest being played, if one is. */
|
|
36
|
+
const paramScope = new AsyncLocalStorage();
|
|
37
|
+
/**
|
|
38
|
+
* Runs work with a manifest's parameters in scope.
|
|
39
|
+
*
|
|
40
|
+
* @param params - The parameters, already checked for completeness.
|
|
41
|
+
* @param operation - The work to run.
|
|
42
|
+
* @returns The operation's result.
|
|
43
|
+
*/
|
|
44
|
+
export async function paramScope_run(params, operation) {
|
|
45
|
+
return await paramScope.run(params, operation);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Runs work in which an unanswerable reference stands as written.
|
|
49
|
+
*
|
|
50
|
+
* A dry run has run nothing, so a reference to what an earlier line WOULD
|
|
51
|
+
* have produced cannot be answered — and refusing there would make a dry run
|
|
52
|
+
* useless for exactly the manifests that chain, which is most of them.
|
|
53
|
+
*
|
|
54
|
+
* @param operation - The work to run.
|
|
55
|
+
* @returns The operation's result.
|
|
56
|
+
*/
|
|
57
|
+
export async function unresolvedStands_run(operation) {
|
|
58
|
+
return await standsScope.run(true, operation);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Whether the work on this async path lets a reference stand unanswered.
|
|
62
|
+
*
|
|
63
|
+
* @returns True inside a dry run.
|
|
64
|
+
*/
|
|
65
|
+
export function unresolvedStands_get() {
|
|
66
|
+
return standsScope.getStore() === true;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Whether a name is one the session answers for.
|
|
70
|
+
*
|
|
71
|
+
* @param name - The reference's name, dots and all.
|
|
72
|
+
* @returns True when the session owns it.
|
|
73
|
+
*/
|
|
74
|
+
export function reference_isReserved(name) {
|
|
75
|
+
return RESERVED_REFERENCES.has(name.split('.')[0]);
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* What the cohort answers, for the pronoun that names part of it.
|
|
79
|
+
*
|
|
80
|
+
* @param name - The reference, such as `gather`, `gather.first.place`.
|
|
81
|
+
* @returns The values, or null when the cohort cannot answer.
|
|
82
|
+
*/
|
|
83
|
+
async function cohort_reference(name) {
|
|
84
|
+
// Loaded on demand: the resolver sits under dispatch, and the cohort sits
|
|
85
|
+
// above it in a builtin.
|
|
86
|
+
const { cohort_read } = await import('../builtins/res/gather.store.js');
|
|
87
|
+
const state = await cohort_read();
|
|
88
|
+
const members = state.series;
|
|
89
|
+
// A member has two addresses and the difference is load-bearing: where it
|
|
90
|
+
// was gathered FROM, which `pull` takes, and where it LANDED, which a
|
|
91
|
+
// viewer and a run take.
|
|
92
|
+
const wantsPlace = name.endsWith('.place');
|
|
93
|
+
const stem = wantsPlace ? name.slice(0, -'.place'.length) : name;
|
|
94
|
+
const addressOf = (member) => {
|
|
95
|
+
if (!wantsPlace)
|
|
96
|
+
return member.vfsPath;
|
|
97
|
+
const landed = member.folderPath;
|
|
98
|
+
if (typeof landed === 'string' && landed.length > 0)
|
|
99
|
+
return landed;
|
|
100
|
+
return member.kind === 'series' ? null : member.vfsPath;
|
|
101
|
+
};
|
|
102
|
+
if (stem === 'gather') {
|
|
103
|
+
const addresses = members.map(addressOf);
|
|
104
|
+
if (addresses.some((address) => address === null))
|
|
105
|
+
return null;
|
|
106
|
+
return { values: addresses };
|
|
107
|
+
}
|
|
108
|
+
const which = stem.slice('gather.'.length);
|
|
109
|
+
if (which === 'size')
|
|
110
|
+
return { values: [`${members.length}`] };
|
|
111
|
+
if (which === 'name')
|
|
112
|
+
return { values: [state.name ?? ''] };
|
|
113
|
+
const pick = (member) => {
|
|
114
|
+
if (member === undefined)
|
|
115
|
+
return null;
|
|
116
|
+
const address = addressOf(member);
|
|
117
|
+
return address === null ? null : { values: [address] };
|
|
118
|
+
};
|
|
119
|
+
if (which === 'first')
|
|
120
|
+
return pick(members[0]);
|
|
121
|
+
if (which === 'last')
|
|
122
|
+
return pick(members[members.length - 1]);
|
|
123
|
+
const nth = Number(which);
|
|
124
|
+
if (Number.isInteger(nth) && nth >= 1 && nth <= members.length)
|
|
125
|
+
return pick(members[nth - 1]);
|
|
126
|
+
return null;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Reads what an index names: `@SER3`, `@STD001`, `@FIL2,3,7`, `@DIR2-4`.
|
|
130
|
+
*
|
|
131
|
+
* The kind is written once and the ordinals follow; zero padding is how
|
|
132
|
+
* the pill draws it, not something the operator must type. A range written
|
|
133
|
+
* backwards is still a range: the operator meant those rows.
|
|
134
|
+
*
|
|
135
|
+
* @param spec - The index without its sigil.
|
|
136
|
+
* @returns The handles, in the order written, or null when the spec is not
|
|
137
|
+
* an index.
|
|
138
|
+
*/
|
|
139
|
+
export function indices_parse(spec) {
|
|
140
|
+
const match = spec.match(/^([A-Z]{3})(\d+(?:-\d+)?(?:,\d+(?:-\d+)?)*)$/);
|
|
141
|
+
if (match === null)
|
|
142
|
+
return null;
|
|
143
|
+
const kind = match[1];
|
|
144
|
+
if (!ANSWER_KINDS.includes(kind))
|
|
145
|
+
return null;
|
|
146
|
+
const handles = [];
|
|
147
|
+
for (const part of match[2].split(',')) {
|
|
148
|
+
const range = part.match(/^(\d+)-(\d+)$/);
|
|
149
|
+
if (range === null) {
|
|
150
|
+
handles.push({ kind: kind, ordinal: Number(part) });
|
|
151
|
+
continue;
|
|
152
|
+
}
|
|
153
|
+
const from = Number(range[1]);
|
|
154
|
+
const to = Number(range[2]);
|
|
155
|
+
const step = from <= to ? 1 : -1;
|
|
156
|
+
for (let at = from; step > 0 ? at <= to : at >= to; at += step) {
|
|
157
|
+
handles.push({ kind: kind, ordinal: at });
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
return handles;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* What each verb can be handed, by kind.
|
|
164
|
+
*
|
|
165
|
+
* A verb that is given the wrong kind refuses BY NAME at expansion —
|
|
166
|
+
* "IMAGE takes a series or a folder; STD001 is a study" — rather than
|
|
167
|
+
* resolving to a path and failing three steps later for a reason that
|
|
168
|
+
* names nothing the operator typed. A verb not listed takes any kind.
|
|
169
|
+
*/
|
|
170
|
+
const VERB_TAKES = new Map([
|
|
171
|
+
['image', ['SER', 'DIR', 'FIL']],
|
|
172
|
+
['dcm', ['SER', 'DIR', 'FIL']],
|
|
173
|
+
['pull', ['SER', 'STD', 'PAT']],
|
|
174
|
+
['cat', ['FIL']],
|
|
175
|
+
['cd', ['DIR', 'SER', 'STD']],
|
|
176
|
+
['download', ['FIL']],
|
|
177
|
+
]);
|
|
178
|
+
/** The kind a refusal names, in words. */
|
|
179
|
+
const KIND_WORDS = {
|
|
180
|
+
PAT: 'a patient', STD: 'a study', SER: 'a series', FIL: 'a file', DIR: 'a folder',
|
|
181
|
+
};
|
|
182
|
+
/** The verb the line began with, set by the dispatcher before expansion. */
|
|
183
|
+
let verbInHand = null;
|
|
184
|
+
/**
|
|
185
|
+
* Tells the resolver which verb the line is for, so an index can be
|
|
186
|
+
* refused by kind.
|
|
187
|
+
*
|
|
188
|
+
* @param verb - The command word, or null between lines.
|
|
189
|
+
*/
|
|
190
|
+
export function verbInHand_set(verb) {
|
|
191
|
+
verbInHand = verb;
|
|
192
|
+
}
|
|
193
|
+
/** Why the last index was refused, when it was refused by kind. */
|
|
194
|
+
let kindRefusal = null;
|
|
195
|
+
/**
|
|
196
|
+
* What the rows an index names are worth, as operands.
|
|
197
|
+
*
|
|
198
|
+
* @param name - The index, sigil included.
|
|
199
|
+
* @returns The rows' values, or null when nothing is numbered, a number is
|
|
200
|
+
* past the end of its kind, or the verb in hand does not take the kind.
|
|
201
|
+
*/
|
|
202
|
+
function index_resolve(name) {
|
|
203
|
+
kindRefusal = null;
|
|
204
|
+
const handles = indices_parse(name.slice(1));
|
|
205
|
+
if (handles === null || handles.length === 0)
|
|
206
|
+
return null;
|
|
207
|
+
const takes = verbInHand === null ? undefined : VERB_TAKES.get(verbInHand);
|
|
208
|
+
const values = [];
|
|
209
|
+
for (const handle of handles) {
|
|
210
|
+
if (takes !== undefined && !takes.includes(handle.kind)) {
|
|
211
|
+
kindRefusal = `${verbInHand} takes ${takes.map((kind) => KIND_WORDS[kind]).join(' or ')}; `
|
|
212
|
+
+ `${handle.kind}${`${handle.ordinal}`.padStart(3, '0')} is ${KIND_WORDS[handle.kind]}.`;
|
|
213
|
+
return null;
|
|
214
|
+
}
|
|
215
|
+
const row = answerRow_get(handle);
|
|
216
|
+
if (row === null)
|
|
217
|
+
return null;
|
|
218
|
+
values.push(...row.values);
|
|
219
|
+
}
|
|
220
|
+
return { values };
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Answers a reference: an index, then the session, then the manifest, then
|
|
224
|
+
* the environment.
|
|
225
|
+
*
|
|
226
|
+
* @param name - The reference's name.
|
|
227
|
+
* @returns What it refers to, or null when nothing does.
|
|
228
|
+
*/
|
|
229
|
+
export async function reference_resolve(name) {
|
|
230
|
+
if (name.startsWith('@'))
|
|
231
|
+
return index_resolve(name);
|
|
232
|
+
if (name === 'cwd')
|
|
233
|
+
return { values: [await session.getCWD()] };
|
|
234
|
+
if (name === 'feed') {
|
|
235
|
+
const feed = recentFeed_get();
|
|
236
|
+
return feed === null ? null : { values: [`${feed}`] };
|
|
237
|
+
}
|
|
238
|
+
if (name === 'run') {
|
|
239
|
+
const runs = recentRuns_get();
|
|
240
|
+
return runs.length === 0 ? null : { values: [`${runs[runs.length - 1]}`] };
|
|
241
|
+
}
|
|
242
|
+
if (name === 'run.place') {
|
|
243
|
+
const place = recentRunPlace_get();
|
|
244
|
+
return place === null ? null : { values: [place] };
|
|
245
|
+
}
|
|
246
|
+
if (name === 'query') {
|
|
247
|
+
const query = recentQuery_get();
|
|
248
|
+
return query === null ? null : { values: [query] };
|
|
249
|
+
}
|
|
250
|
+
if (name === 'gather' || name.startsWith('gather.'))
|
|
251
|
+
return await cohort_reference(name);
|
|
252
|
+
const params = paramScope.getStore();
|
|
253
|
+
const given = params?.get(name);
|
|
254
|
+
if (given !== undefined)
|
|
255
|
+
return { values: [given] };
|
|
256
|
+
const environment = process.env[name];
|
|
257
|
+
return environment === undefined ? null : { values: [environment] };
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Says where a reference was looked for, for a refusal an operator can act on.
|
|
261
|
+
*
|
|
262
|
+
* @param name - The reference nothing answered.
|
|
263
|
+
* @returns The refusal's text.
|
|
264
|
+
*/
|
|
265
|
+
export function reference_refusal(name) {
|
|
266
|
+
const scoped = paramScope.getStore() !== undefined;
|
|
267
|
+
const places = scoped ? "the session, this manifest's parameters, the environment" : 'the session, the environment';
|
|
268
|
+
if (name.startsWith('@')) {
|
|
269
|
+
if (kindRefusal !== null)
|
|
270
|
+
return `${name}: ${kindRefusal}`;
|
|
271
|
+
const numbered = answer_get();
|
|
272
|
+
if (numbered === null)
|
|
273
|
+
return `${name}: nothing is numbered yet — list something first.`;
|
|
274
|
+
const handles = indices_parse(name.slice(1));
|
|
275
|
+
if (handles === null) {
|
|
276
|
+
return `${name}: an index says what it counts — @SER3, @STD1, @FIL2, @DIR4 — and may list or range them (@SER2,3 or @SER2-5).`;
|
|
277
|
+
}
|
|
278
|
+
const kind = handles[0].kind;
|
|
279
|
+
const count = answerKind_count(kind);
|
|
280
|
+
return count === 0
|
|
281
|
+
? `${name}: the last answer (${numbered.source}) holds no ${KIND_WORDS[kind]} rows.`
|
|
282
|
+
: `${name}: the last answer (${numbered.source}) holds ${count} ${kind} row${count === 1 ? '' : 's'}.`;
|
|
283
|
+
}
|
|
284
|
+
const hint = reference_isReserved(name)
|
|
285
|
+
? ` — nothing in this session has one yet`
|
|
286
|
+
: '';
|
|
287
|
+
return `\${${name}}: nothing to put there${hint}. Looked in ${places}.`;
|
|
288
|
+
}
|
|
289
|
+
//# sourceMappingURL=expansion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expansion.js","sourceRoot":"","sources":["../../src/core/expansion.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,O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AW,MAAM,CAAC,CAAC,CAAC,0DAA0D,CAAC,CAAC,CAAC,8BAA8B,CAAC;IAC5H,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QACzB,IAAI,WAAW,KAAK,IAAI;YAAE,OAAO,GAAG,IAAI,KAAK,WAAW,EAAE,CAAC;QAC3D,MAAM,QAAQ,GAAG,UAAU,EAAE,CAAC;QAC9B,IAAI,QAAQ,KAAK,IAAI;YAAE,OAAO,GAAG,IAAI,mDAAmD,CAAC;QACzF,MAAM,OAAO,GAA0B,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QACpE,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;YACrB,OAAO,GAAG,IAAI,gHAAgH,CAAC;QACjI,CAAC;QACD,MAAM,IAAI,GAAe,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QACzC,MAAM,KAAK,GAAW,gBAAgB,CAAC,IAAI,CAAC,CAAC;QAC7C,OAAO,KAAK,KAAK,CAAC;YAChB,CAAC,CAAC,GAAG,IAAI,sBAAsB,QAAQ,CAAC,MAAM,cAAc,UAAU,CAAC,IAAI,CAAC,QAAQ;YACpF,CAAC,CAAC,GAAG,IAAI,sBAAsB,QAAQ,CAAC,MAAM,WAAW,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;IAC3G,CAAC;IACD,MAAM,IAAI,GAAW,oBAAoB,CAAC,IAAI,CAAC;QAC7C,CAAC,CAAC,wCAAwC;QAC1C,CAAC,CAAC,EAAE,CAAC;IACP,OAAO,MAAM,IAAI,0BAA0B,IAAI,eAAe,MAAM,GAAG,CAAC;AAC1E,CAAC"}
|
|
@@ -56,10 +56,13 @@ export async function sessionPromptContext_build(options = {}) {
|
|
|
56
56
|
id: load.feedID, loaded: load.loaded, total: load.total, ...(load.failed !== undefined ? { failed: load.failed } : {}),
|
|
57
57
|
}));
|
|
58
58
|
const arrived = procCache_get().arrivals_recent();
|
|
59
|
+
// Feeds whose topology just landed, each with its shape: the space of
|
|
60
|
+
// everything run here, materialising on a surface as the index reads it.
|
|
61
|
+
const landed = procCache_get().topologyLanded_recent();
|
|
59
62
|
const roster = procCache_get().rosterSync_get();
|
|
60
63
|
const sweeping = warmupRaw.active || lifecycle.state === 'reconciling' || lifecycle.state === 'failed';
|
|
61
64
|
const warmupFailures = warmupFailures_list();
|
|
62
|
-
const procWarmup = sweeping || feedLoad !== null || arrived.length > 0 || roster !== null
|
|
65
|
+
const procWarmup = sweeping || feedLoad !== null || arrived.length > 0 || landed.length > 0 || roster !== null
|
|
63
66
|
? {
|
|
64
67
|
loaded: warmupRaw.loaded,
|
|
65
68
|
total: warmupRaw.total,
|
|
@@ -68,6 +71,7 @@ export async function sessionPromptContext_build(options = {}) {
|
|
|
68
71
|
sweeping,
|
|
69
72
|
...(feedLoad !== null ? { feed: feeds[0], feeds } : {}),
|
|
70
73
|
...(arrived.length > 0 ? { arrived } : {}),
|
|
74
|
+
...(landed.length > 0 ? { landed } : {}),
|
|
71
75
|
...(roster !== null ? { roster } : {}),
|
|
72
76
|
}
|
|
73
77
|
: undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"promptContext.js","sourceRoot":"","sources":["../../src/core/promptContext.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,gBAAgB,EAAkB,MAAM,gBAAgB,CAAC;AAElE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAsB,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAiB,QAAQ,EAE9B,aAAa,
|
|
1
|
+
{"version":3,"file":"promptContext.js","sourceRoot":"","sources":["../../src/core/promptContext.ts"],"names":[],"mappings":"AAA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SAAS,CAAM,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,IAAK,SAAS,CAAC;QAC/E,GAAG,EAAoB,SAAS,CAAC,CAAC,CAAC,GAAG,CAAY,CAAC,CAAC,GAAG;QACvD,UAAU,EAAa,OAAO,CAAC,UAAU,IAAI,IAAI;QACjD,YAAY,EAAW,OAAO,CAAC,gBAAgB,EAAE;QACjD,YAAY,EAAW,OAAO,CAAC,YAAY,IAAI,CAAC;QAChD,qBAAqB,EAAE,OAAO,CAAC,qBAAqB,IAAI,CAAC;QACzD,UAAU;QACV,GAAG,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACxD,SAAS;KACV,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file How the language reads a duration.
|
|
3
|
+
*
|
|
4
|
+
* `expect --within` and `play --pace` are the same notion of time, so they
|
|
5
|
+
* read it with the same function: a second parser beside this one is a
|
|
6
|
+
* second set of durations that mean something slightly else, and a manifest
|
|
7
|
+
* that says `20m` in two places must mean twenty minutes in both.
|
|
8
|
+
*
|
|
9
|
+
* @module
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Reads a duration the way an operator writes one.
|
|
13
|
+
*
|
|
14
|
+
* @param text - A duration such as `30s`, `20m`, `2h`, `250ms`, or bare seconds.
|
|
15
|
+
* @returns Milliseconds, or null when the text is not a duration.
|
|
16
|
+
*/
|
|
17
|
+
export declare function duration_parse(text: string): number | null;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file How the language reads a duration.
|
|
3
|
+
*
|
|
4
|
+
* `expect --within` and `play --pace` are the same notion of time, so they
|
|
5
|
+
* read it with the same function: a second parser beside this one is a
|
|
6
|
+
* second set of durations that mean something slightly else, and a manifest
|
|
7
|
+
* that says `20m` in two places must mean twenty minutes in both.
|
|
8
|
+
*
|
|
9
|
+
* @module
|
|
10
|
+
*/
|
|
11
|
+
/** How long each unit lasts, in milliseconds. */
|
|
12
|
+
const UNIT_MS = { ms: 1, s: 1000, m: 60000, h: 3600000 };
|
|
13
|
+
/**
|
|
14
|
+
* Reads a duration the way an operator writes one.
|
|
15
|
+
*
|
|
16
|
+
* @param text - A duration such as `30s`, `20m`, `2h`, `250ms`, or bare seconds.
|
|
17
|
+
* @returns Milliseconds, or null when the text is not a duration.
|
|
18
|
+
*/
|
|
19
|
+
export function duration_parse(text) {
|
|
20
|
+
const match = text.trim().match(/^(\d+(?:\.\d+)?)(ms|s|m|h)?$/);
|
|
21
|
+
if (match === null)
|
|
22
|
+
return null;
|
|
23
|
+
return Number(match[1]) * UNIT_MS[match[2] ?? 's'];
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=duration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"duration.js","sourceRoot":"","sources":["../../src/lib/duration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,iDAAiD;AACjD,MAAM,OAAO,GAA2B,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC;AAEjF;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,IAAY;IACzC,MAAM,KAAK,GAA4B,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,8BAA8B,CAAC,CAAC;IACzF,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAChC,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC;AACrD,CAAC"}
|
package/dist/lib/parser.d.ts
CHANGED
|
@@ -5,12 +5,32 @@
|
|
|
5
5
|
* backslash escapes. Quotes are stripped from rendered values, but their
|
|
6
6
|
* pathname-expansion meaning is retained.
|
|
7
7
|
*/
|
|
8
|
+
/**
|
|
9
|
+
* One piece of a word: literal text, or a reference the line asked for.
|
|
10
|
+
*
|
|
11
|
+
* The tokenizer records references rather than resolving them, because
|
|
12
|
+
* resolving is asynchronous (a pronoun asks the session) and tokenizing is
|
|
13
|
+
* not. What it must record is the QUOTING, since that is known only here:
|
|
14
|
+
* inside single quotes a `$` is text, inside double quotes a reference is
|
|
15
|
+
* one operand however many values it carries, and bare it may become
|
|
16
|
+
* several — the shell's rule, which the stack claims to wear.
|
|
17
|
+
*/
|
|
18
|
+
export interface ShellSegment {
|
|
19
|
+
/** Literal text, when this piece is text. */
|
|
20
|
+
text: string;
|
|
21
|
+
/** The reference's name, when this piece is one. */
|
|
22
|
+
ref: string | null;
|
|
23
|
+
/** Whether the reference stood inside double quotes. */
|
|
24
|
+
quoted: boolean;
|
|
25
|
+
}
|
|
8
26
|
/** A rendered shell word and the glob pattern it may contribute. */
|
|
9
27
|
export interface ShellWord {
|
|
10
28
|
value: string;
|
|
11
29
|
globPattern: string;
|
|
12
30
|
pathnameExpansion: boolean;
|
|
13
31
|
pathnameExpanded: boolean;
|
|
32
|
+
/** The word's pieces, when it holds a reference; absent when it is plain text. */
|
|
33
|
+
segments?: ShellSegment[];
|
|
14
34
|
}
|
|
15
35
|
/** String arguments with per-operand pathname-expansion provenance. */
|
|
16
36
|
export type ShellArguments = string[] & {
|
|
@@ -84,3 +104,33 @@ export declare function shellWords_tokenize(line: string): ShellWord[];
|
|
|
84
104
|
* @returns Array of tokens with quotes removed.
|
|
85
105
|
*/
|
|
86
106
|
export declare function args_tokenize(line: string): string[];
|
|
107
|
+
/** What a reference turned out to be. */
|
|
108
|
+
export type ReferenceValue = {
|
|
109
|
+
values: string[];
|
|
110
|
+
} | null;
|
|
111
|
+
/** Answers what a reference refers to, or null when nothing does. */
|
|
112
|
+
export type ReferenceResolver = (name: string) => Promise<ReferenceValue>;
|
|
113
|
+
/** How reference expansion went. */
|
|
114
|
+
export type ReferenceExpansion = {
|
|
115
|
+
ok: true;
|
|
116
|
+
words: ShellWord[];
|
|
117
|
+
} | {
|
|
118
|
+
ok: false;
|
|
119
|
+
missing: string;
|
|
120
|
+
};
|
|
121
|
+
/**
|
|
122
|
+
* Resolves the references in a line's words, respecting how they were quoted.
|
|
123
|
+
*
|
|
124
|
+
* The shell's rule, kept: a bare reference carrying several values becomes
|
|
125
|
+
* several operands, a double-quoted one stays a single operand however many
|
|
126
|
+
* values it holds, and a single-quoted `$` never got here at all. An
|
|
127
|
+
* expanded value never globs afterwards — a filename with a bracket in it is
|
|
128
|
+
* a filename, not a pattern.
|
|
129
|
+
*
|
|
130
|
+
* @param words - The tokenized words.
|
|
131
|
+
* @param resolve - Answers what a reference refers to.
|
|
132
|
+
* @param unresolvedStands - Leave an unanswerable reference as written
|
|
133
|
+
* instead of refusing: what a dry run does, having run nothing.
|
|
134
|
+
* @returns The expanded words, or the reference nothing could answer.
|
|
135
|
+
*/
|
|
136
|
+
export declare function shellWords_referencesExpand(words: readonly ShellWord[], resolve: ReferenceResolver, unresolvedStands?: boolean): Promise<ReferenceExpansion>;
|
package/dist/lib/parser.js
CHANGED
|
@@ -5,6 +5,23 @@
|
|
|
5
5
|
* backslash escapes. Quotes are stripped from rendered values, but their
|
|
6
6
|
* pathname-expansion meaning is retained.
|
|
7
7
|
*/
|
|
8
|
+
/**
|
|
9
|
+
* What a reference looks like: `${name}` or a bare `$NAME`.
|
|
10
|
+
*
|
|
11
|
+
* A braced name may carry dots, which is how a session pronoun names part
|
|
12
|
+
* of what it refers to (`${gather.first.place}`); a bare one may not, so
|
|
13
|
+
* `$HOME.txt` keeps its extension.
|
|
14
|
+
*/
|
|
15
|
+
const REFERENCE_PATTERN = /^\$(?:\{([A-Za-z_][A-Za-z0-9_.]*)\}|([A-Za-z_][A-Za-z0-9_]*))/;
|
|
16
|
+
/**
|
|
17
|
+
* What an index looks like: `@SER3`, `@STD001`, `@FIL2,3,7`, `@DIR2-4`.
|
|
18
|
+
*
|
|
19
|
+
* A row of the session's last answer, named by the handle the listing shows
|
|
20
|
+
* beside it — the KIND it counts, then its place in that kind's sequence.
|
|
21
|
+
* The sigil keeps it unambiguous: a directory called `SER3` is a path, and
|
|
22
|
+
* `@SER3` never is.
|
|
23
|
+
*/
|
|
24
|
+
const INDEX_PATTERN = /^@([A-Z]{3}\d+(?:-\d+)?(?:,\d+(?:-\d+)?)*)/;
|
|
8
25
|
/** Escapes wildcard metacharacters for literal minimatch use. */
|
|
9
26
|
function globLiteral_escape(value) {
|
|
10
27
|
return value.replace(/[\\*?\[\]]/g, '\\$&');
|
|
@@ -132,25 +149,49 @@ export function shellWords_tokenize(line) {
|
|
|
132
149
|
let inSingle = false;
|
|
133
150
|
let inDouble = false;
|
|
134
151
|
let escapeNext = false;
|
|
152
|
+
let segments = [];
|
|
153
|
+
let pendingText = '';
|
|
154
|
+
const text_flush = () => {
|
|
155
|
+
if (pendingText.length === 0)
|
|
156
|
+
return;
|
|
157
|
+
segments.push({ text: pendingText, ref: null, quoted: false });
|
|
158
|
+
pendingText = '';
|
|
159
|
+
};
|
|
135
160
|
const character_append = (char, literal) => {
|
|
136
161
|
currentValue += char;
|
|
137
162
|
currentPattern += literal ? globLiteral_escape(char) : char;
|
|
138
163
|
pathnameExpansion ||= !literal && /[*?[\]]/.test(char);
|
|
164
|
+
pendingText += char;
|
|
165
|
+
wordStarted = true;
|
|
166
|
+
};
|
|
167
|
+
const reference_append = (name, raw, quoted) => {
|
|
168
|
+
text_flush();
|
|
169
|
+
segments.push({ text: '', ref: name, quoted });
|
|
170
|
+
// The value keeps the reference as written: every reader that does not
|
|
171
|
+
// resolve references (completion, help, the tests) sees the line as the
|
|
172
|
+
// operator typed it.
|
|
173
|
+
currentValue += raw;
|
|
174
|
+
currentPattern += globLiteral_escape(raw);
|
|
139
175
|
wordStarted = true;
|
|
140
176
|
};
|
|
141
177
|
const word_pushCurrent = () => {
|
|
142
178
|
if (!wordStarted)
|
|
143
179
|
return;
|
|
180
|
+
text_flush();
|
|
181
|
+
const held = segments;
|
|
144
182
|
tokens.push({
|
|
145
183
|
value: currentValue,
|
|
146
184
|
globPattern: currentPattern,
|
|
147
185
|
pathnameExpansion,
|
|
148
186
|
pathnameExpanded: false,
|
|
187
|
+
...(held.some((segment) => segment.ref !== null) ? { segments: held } : {}),
|
|
149
188
|
});
|
|
150
189
|
currentValue = '';
|
|
151
190
|
currentPattern = '';
|
|
152
191
|
pathnameExpansion = false;
|
|
153
192
|
wordStarted = false;
|
|
193
|
+
segments = [];
|
|
194
|
+
pendingText = '';
|
|
154
195
|
};
|
|
155
196
|
for (let i = 0; i < line.length; i++) {
|
|
156
197
|
const char = line[i];
|
|
@@ -178,6 +219,29 @@ export function shellWords_tokenize(line) {
|
|
|
178
219
|
word_pushCurrent();
|
|
179
220
|
continue;
|
|
180
221
|
}
|
|
222
|
+
// An index into the session's last answer, unless it stands in quotes.
|
|
223
|
+
// Only at the START of a word: `user@host` is not an index, and neither
|
|
224
|
+
// is an email address in a tag value.
|
|
225
|
+
if (char === '@' && !inSingle && !inDouble && !wordStarted) {
|
|
226
|
+
const rest = line.slice(i);
|
|
227
|
+
const match = rest.match(INDEX_PATTERN);
|
|
228
|
+
if (match !== null) {
|
|
229
|
+
reference_append(`@${match[1]}`, match[0], false);
|
|
230
|
+
i += match[0].length - 1;
|
|
231
|
+
continue;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
// A reference, unless it stands in single quotes, where a `$` is text —
|
|
235
|
+
// which is what makes a quoted DICOM value or a literal price safe.
|
|
236
|
+
if (char === '$' && !inSingle) {
|
|
237
|
+
const rest = line.slice(i);
|
|
238
|
+
const match = rest.match(REFERENCE_PATTERN);
|
|
239
|
+
if (match !== null) {
|
|
240
|
+
reference_append(match[1] ?? match[2], match[0], inDouble);
|
|
241
|
+
i += match[0].length - 1;
|
|
242
|
+
continue;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
181
245
|
character_append(char, inSingle || inDouble);
|
|
182
246
|
}
|
|
183
247
|
word_pushCurrent();
|
|
@@ -192,4 +256,59 @@ export function shellWords_tokenize(line) {
|
|
|
192
256
|
export function args_tokenize(line) {
|
|
193
257
|
return shellWords_tokenize(line).map((word) => word.value);
|
|
194
258
|
}
|
|
259
|
+
/**
|
|
260
|
+
* Resolves the references in a line's words, respecting how they were quoted.
|
|
261
|
+
*
|
|
262
|
+
* The shell's rule, kept: a bare reference carrying several values becomes
|
|
263
|
+
* several operands, a double-quoted one stays a single operand however many
|
|
264
|
+
* values it holds, and a single-quoted `$` never got here at all. An
|
|
265
|
+
* expanded value never globs afterwards — a filename with a bracket in it is
|
|
266
|
+
* a filename, not a pattern.
|
|
267
|
+
*
|
|
268
|
+
* @param words - The tokenized words.
|
|
269
|
+
* @param resolve - Answers what a reference refers to.
|
|
270
|
+
* @param unresolvedStands - Leave an unanswerable reference as written
|
|
271
|
+
* instead of refusing: what a dry run does, having run nothing.
|
|
272
|
+
* @returns The expanded words, or the reference nothing could answer.
|
|
273
|
+
*/
|
|
274
|
+
export async function shellWords_referencesExpand(words, resolve, unresolvedStands = false) {
|
|
275
|
+
const expanded = [];
|
|
276
|
+
for (const word of words) {
|
|
277
|
+
const segments = word.segments;
|
|
278
|
+
if (segments === undefined) {
|
|
279
|
+
expanded.push(word);
|
|
280
|
+
continue;
|
|
281
|
+
}
|
|
282
|
+
// A word that is nothing but one bare reference is the list case: it may
|
|
283
|
+
// leave as several operands. Anything else joins into one word.
|
|
284
|
+
const lone = segments.length === 1 && segments[0].ref !== null && !segments[0].quoted;
|
|
285
|
+
let rendered = '';
|
|
286
|
+
let split = null;
|
|
287
|
+
for (const segment of segments) {
|
|
288
|
+
if (segment.ref === null) {
|
|
289
|
+
rendered += segment.text;
|
|
290
|
+
continue;
|
|
291
|
+
}
|
|
292
|
+
const held = await resolve(segment.ref);
|
|
293
|
+
if (held === null) {
|
|
294
|
+
if (!unresolvedStands)
|
|
295
|
+
return { ok: false, missing: segment.ref };
|
|
296
|
+
rendered += `\${${segment.ref}}`;
|
|
297
|
+
continue;
|
|
298
|
+
}
|
|
299
|
+
if (lone && held.values.length !== 1) {
|
|
300
|
+
split = held.values;
|
|
301
|
+
continue;
|
|
302
|
+
}
|
|
303
|
+
rendered += held.values.join(' ');
|
|
304
|
+
}
|
|
305
|
+
if (split !== null) {
|
|
306
|
+
for (const value of split)
|
|
307
|
+
expanded.push(shellWord_literal(value));
|
|
308
|
+
continue;
|
|
309
|
+
}
|
|
310
|
+
expanded.push(shellWord_literal(rendered));
|
|
311
|
+
}
|
|
312
|
+
return { ok: true, words: expanded };
|
|
313
|
+
}
|
|
195
314
|
//# sourceMappingURL=parser.js.map
|
package/dist/lib/parser.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parser.js","sourceRoot":"","sources":["../../src/lib/parser.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"parser.js","sourceRoot":"","sources":["../../src/lib/parser.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAqCH;;;;;;GAMG;AACH,MAAM,iBAAiB,GAAW,+DAA+D,CAAC;AAElG;;;;;;;GAOG;AACH,MAAM,aAAa,GAAW,4CAA4C,CAAC;AAE3E,iEAAiE;AACjE,SAAS,kBAAkB,CAAC,KAAa;IACvC,OAAO,KAAK,CAAC,OAAO,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;AAC9C,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAa;IAC7C,OAAO;QACL,KAAK;QACL,WAAW,EAAE,kBAAkB,CAAC,KAAK,CAAC;QACtC,iBAAiB,EAAE,KAAK;QACxB,gBAAgB,EAAE,KAAK;KACxB,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAa;IAC9C,OAAO;QACL,KAAK;QACL,WAAW,EAAE,KAAK;QAClB,iBAAiB,EAAE,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