@fnndsc/menu 0.3.1 → 0.5.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/dag.d.ts +58 -0
- package/dist/dag.js +24 -0
- package/dist/dag.js.map +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/messages.d.ts +360 -42
- package/dist/messages.js +66 -0
- package/dist/messages.js.map +1 -1
- package/dist/pacs.d.ts +381 -12
- package/dist/pacs.js +135 -0
- package/dist/pacs.js.map +1 -1
- package/dist/plugin.d.ts +142 -0
- package/dist/plugin.js +67 -0
- package/dist/plugin.js.map +1 -0
- package/dist/proc.d.ts +7 -1
- package/dist/proc.js.map +1 -1
- package/package.json +1 -1
package/dist/pacs.js
CHANGED
|
@@ -26,6 +26,14 @@ export const pacsSeriesSchema = z.object({
|
|
|
26
26
|
/** One found study and its series. */
|
|
27
27
|
export const pacsStudySchema = z.object({
|
|
28
28
|
studyUID: z.string().optional(),
|
|
29
|
+
/**
|
|
30
|
+
* The PACS that answered for this study, as its canonical identifier.
|
|
31
|
+
*
|
|
32
|
+
* Present when the answer could have come from more than one server —
|
|
33
|
+
* which is when it matters, because two servers may hold the same study
|
|
34
|
+
* and a row that cannot say which one it came from cannot be acted on.
|
|
35
|
+
*/
|
|
36
|
+
server: z.string().optional(),
|
|
29
37
|
/** The study's VFS path under the query — a study-level pull's argument. */
|
|
30
38
|
vfsPath: z.string().optional(),
|
|
31
39
|
description: z.string(),
|
|
@@ -36,6 +44,91 @@ export const pacsStudySchema = z.object({
|
|
|
36
44
|
accession: z.string(),
|
|
37
45
|
series: z.array(pacsSeriesSchema),
|
|
38
46
|
});
|
|
47
|
+
/**
|
|
48
|
+
* Where an answer came from: the PACS just now, or a query already stored.
|
|
49
|
+
*
|
|
50
|
+
* CUBE keeps every query it has run, so a question asked before can be
|
|
51
|
+
* answered without troubling the PACS. Which of the two happened is a fact
|
|
52
|
+
* about the answer, and it belongs on the model rather than in each
|
|
53
|
+
* surface's rendering: chell says it in a sentence, argus in a pill, and
|
|
54
|
+
* anything later in whatever voice it has — but all of them from one
|
|
55
|
+
* timestamp, said once by the kernel that knows it.
|
|
56
|
+
*/
|
|
57
|
+
export const pacsProvenanceSchema = z.object({
|
|
58
|
+
/** True when this answer came from a stored query rather than the PACS. */
|
|
59
|
+
replayed: z.boolean(),
|
|
60
|
+
/**
|
|
61
|
+
* When the PACS actually answered, as an ISO timestamp.
|
|
62
|
+
*
|
|
63
|
+
* The age is stated and never acted on. A query naming an accession is a
|
|
64
|
+
* fact about a study that exists; one naming an MRN can gain a match
|
|
65
|
+
* tomorrow. No heuristic separates those reliably, so the surface says
|
|
66
|
+
* how old an answer is and leaves the judgement with the operator.
|
|
67
|
+
*/
|
|
68
|
+
answeredAt: z.string(),
|
|
69
|
+
});
|
|
70
|
+
/**
|
|
71
|
+
* What became of one patient in a query.
|
|
72
|
+
*
|
|
73
|
+
* Three states, not two. A query that could not be asked is not a query
|
|
74
|
+
* that found nothing: rendering a timeout as `0` is exactly the confident
|
|
75
|
+
* stale answer the replay work exists to refuse. The MRNs that come back
|
|
76
|
+
* are by definition the ones WITH imaging, which makes the answer an
|
|
77
|
+
* operator usually wants — the ones without — the invisible half unless
|
|
78
|
+
* absence is a state the model can say.
|
|
79
|
+
*/
|
|
80
|
+
export const PACS_PATIENT_STATUSES = ['found', 'none', 'unasked'];
|
|
81
|
+
/**
|
|
82
|
+
* Open-world, degrading to `unasked`.
|
|
83
|
+
*
|
|
84
|
+
* A status this contract does not know is one this surface cannot claim an
|
|
85
|
+
* answer for, and `unasked` is the only degrade that never reads as a
|
|
86
|
+
* confident zero.
|
|
87
|
+
*/
|
|
88
|
+
export const pacsPatientStatusSchema = z.enum(PACS_PATIENT_STATUSES).catch('unasked');
|
|
89
|
+
/**
|
|
90
|
+
* One patient the query asked about — found, empty-handed, or unreachable.
|
|
91
|
+
*
|
|
92
|
+
* The studies themselves stay where they are, on the model, each carrying
|
|
93
|
+
* its own `patientId`. This level is not a container for them; it is the
|
|
94
|
+
* record of what was ASKED, which is why it exists at all: a miss owns no
|
|
95
|
+
* study, so a level derived from the studies could never mention it.
|
|
96
|
+
*/
|
|
97
|
+
export const pacsPatientSchema = z.object({
|
|
98
|
+
/** The identifier as the operator asked it, never normalized. */
|
|
99
|
+
patientId: z.string(),
|
|
100
|
+
/**
|
|
101
|
+
* The PACS this row asked. One patient asked of two servers is two rows,
|
|
102
|
+
* because the answers are two facts and one of them may be a miss.
|
|
103
|
+
*/
|
|
104
|
+
server: z.string().optional(),
|
|
105
|
+
/** The name the PACS answered with, when it answered at all. */
|
|
106
|
+
patientName: z.string().optional(),
|
|
107
|
+
status: pacsPatientStatusSchema,
|
|
108
|
+
/** How many studies this patient owns in the answer; 0 for a miss. */
|
|
109
|
+
studyCount: z.number(),
|
|
110
|
+
/** How many series across those studies; 0 for a miss. */
|
|
111
|
+
seriesCount: z.number(),
|
|
112
|
+
/**
|
|
113
|
+
* The CUBE query that answered for this patient. A cohort is N queries,
|
|
114
|
+
* so the id belongs per row rather than on the model.
|
|
115
|
+
*/
|
|
116
|
+
queryId: z.number().optional(),
|
|
117
|
+
/**
|
|
118
|
+
* Where this row's answer came from. A fan-out replays some rows and
|
|
119
|
+
* troubles the PACS for others, so provenance is per patient as well as
|
|
120
|
+
* per answer.
|
|
121
|
+
*/
|
|
122
|
+
provenance: pacsProvenanceSchema.optional(),
|
|
123
|
+
/**
|
|
124
|
+
* Why a patient went unasked, when something said why.
|
|
125
|
+
*
|
|
126
|
+
* Carried so a surface can name the failure rather than showing an
|
|
127
|
+
* unexplained dash; never set for `found` or `none`, where there is
|
|
128
|
+
* nothing to explain.
|
|
129
|
+
*/
|
|
130
|
+
error: z.string().optional(),
|
|
131
|
+
});
|
|
39
132
|
/**
|
|
40
133
|
* The `pacs.query` model: one query's decoded result. `vfsPath` is where the
|
|
41
134
|
* query lives under `/net/pacs/queries` — a query is a persistent CUBE
|
|
@@ -47,7 +140,49 @@ export const pacsQueryModelSchema = z.object({
|
|
|
47
140
|
pacsName: z.string(),
|
|
48
141
|
expression: z.string(),
|
|
49
142
|
studies: z.array(pacsStudySchema),
|
|
143
|
+
/**
|
|
144
|
+
* Optional so an envelope from a daemon that predates replay still
|
|
145
|
+
* parses: a surface reads its absence as "freshly queried, age unknown",
|
|
146
|
+
* which is what such a daemon could only ever have meant.
|
|
147
|
+
*/
|
|
148
|
+
provenance: pacsProvenanceSchema.optional(),
|
|
149
|
+
/**
|
|
150
|
+
* Every patient the query asked about, hits and misses alike.
|
|
151
|
+
*
|
|
152
|
+
* Optional, like `provenance`: an envelope from a daemon that predates
|
|
153
|
+
* the fan-out still parses, and a surface reads its absence as the
|
|
154
|
+
* single-question case it could only have been.
|
|
155
|
+
*/
|
|
156
|
+
patients: z.array(pacsPatientSchema).optional(),
|
|
157
|
+
});
|
|
158
|
+
/**
|
|
159
|
+
* One registered PACS server, as a surface needs it.
|
|
160
|
+
*
|
|
161
|
+
* The identifier is what CUBE files a query under and what `--pacsserver`
|
|
162
|
+
* names, so it is the value a control lowers to; the numeric id is what
|
|
163
|
+
* `pacs connect` has always accepted and is kept for that. Liveness is NOT
|
|
164
|
+
* carried: CUBE registers servers, it does not test them, and a field that
|
|
165
|
+
* looked like health would be a claim nobody checked.
|
|
166
|
+
*/
|
|
167
|
+
export const pacsServerSchema = z.object({
|
|
168
|
+
id: z.number(),
|
|
169
|
+
identifier: z.string(),
|
|
170
|
+
/** True for the server this session is currently connected to. */
|
|
171
|
+
active: z.boolean(),
|
|
172
|
+
});
|
|
173
|
+
/**
|
|
174
|
+
* The `pacs.servers` model: every PACS registered on this CUBE.
|
|
175
|
+
*
|
|
176
|
+
* A surface offering a choice of servers has to know what there is to
|
|
177
|
+
* choose from, and asking CUBE directly would reach around the session
|
|
178
|
+
* that owns the connection. `pacs list` already asks; it now says so in
|
|
179
|
+
* data as well as in text.
|
|
180
|
+
*/
|
|
181
|
+
export const pacsServersModelSchema = z.object({
|
|
182
|
+
servers: z.array(pacsServerSchema),
|
|
50
183
|
});
|
|
184
|
+
/** The servers model's envelope kind. */
|
|
185
|
+
export const PACS_SERVERS_MODEL_KIND = 'pacs.servers';
|
|
51
186
|
/** The model's envelope kind. */
|
|
52
187
|
export const PACS_QUERY_MODEL_KIND = 'pacs.query';
|
|
53
188
|
//# sourceMappingURL=pacs.js.map
|
package/dist/pacs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pacs.js","sourceRoot":"","sources":["../src/pacs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,uCAAuC;AACvC,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,sEAAsE;IACtE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,4EAA4E;IAC5E,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC9B,6CAA6C;IAC7C,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACnC,CAAC,CAAC;AAEH,sCAAsC;AACtC,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,4EAA4E;IAC5E,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,WAAW,EAAE,CAA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;;;;GAOG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC;CACnC,CAAC,CAAC;AAKH,yCAAyC;AACzC,MAAM,CAAC,MAAM,uBAAuB,GAAG,cAAuB,CAAC;AAE/D,iCAAiC;AACjC,MAAM,CAAC,MAAM,qBAAqB,GAAG,YAAqB,CAAC"}
|
package/dist/plugin.d.ts
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file The plugin vocabulary: a registered plugin as a typed envelope payload.
|
|
3
|
+
*
|
|
4
|
+
* A plugin is the one-node case of the compute graph — everything a pipeline
|
|
5
|
+
* node is, without the pipeline around it. Its substance reached surfaces as
|
|
6
|
+
* a rendered manual for as long as `cat /bin/<plugin>` was the only way to
|
|
7
|
+
* ask, which meant nothing downstream could do anything with it: not a card,
|
|
8
|
+
* not a parameter list, not a form, not an export. This model is that same
|
|
9
|
+
* substance as data; the manual becomes one projection of it.
|
|
10
|
+
*
|
|
11
|
+
* Parameters are the payload that matters. They arrive complete or the model
|
|
12
|
+
* is wrong: a parameter list that quietly stops at a page boundary is worse
|
|
13
|
+
* than the paragraph it replaces, because a paragraph does not look
|
|
14
|
+
* authoritative.
|
|
15
|
+
*
|
|
16
|
+
* @module
|
|
17
|
+
*/
|
|
18
|
+
import { z } from 'zod';
|
|
19
|
+
/**
|
|
20
|
+
* One declared parameter of a plugin.
|
|
21
|
+
*
|
|
22
|
+
* `default` is `unknown` because CUBE serves whatever the plugin declared —
|
|
23
|
+
* a string, a number, a boolean, or null for "no default" — and a surface
|
|
24
|
+
* renders it rather than computing on it.
|
|
25
|
+
*/
|
|
26
|
+
export declare const pluginParameterSchema: z.ZodObject<{
|
|
27
|
+
name: z.ZodString;
|
|
28
|
+
type: z.ZodString;
|
|
29
|
+
optional: z.ZodBoolean;
|
|
30
|
+
default: z.ZodOptional<z.ZodUnknown>;
|
|
31
|
+
help: z.ZodOptional<z.ZodString>;
|
|
32
|
+
/** The flag as it is typed: `--name`, or the bare name for a positional. */
|
|
33
|
+
flag: z.ZodString;
|
|
34
|
+
}, "strip", z.ZodTypeAny, {
|
|
35
|
+
type: string;
|
|
36
|
+
name: string;
|
|
37
|
+
optional: boolean;
|
|
38
|
+
flag: string;
|
|
39
|
+
default?: unknown;
|
|
40
|
+
help?: string | undefined;
|
|
41
|
+
}, {
|
|
42
|
+
type: string;
|
|
43
|
+
name: string;
|
|
44
|
+
optional: boolean;
|
|
45
|
+
flag: string;
|
|
46
|
+
default?: unknown;
|
|
47
|
+
help?: string | undefined;
|
|
48
|
+
}>;
|
|
49
|
+
/**
|
|
50
|
+
* The `plugin.info` model: one registered plugin, whole.
|
|
51
|
+
*
|
|
52
|
+
* Identity, the authoring facts, and every declared parameter. What a
|
|
53
|
+
* surface draws from it — a one-node graph, a parameter table, an argument
|
|
54
|
+
* form — is the surface's business; the model carries no layout and no
|
|
55
|
+
* rendering.
|
|
56
|
+
*/
|
|
57
|
+
export declare const pluginInfoModelSchema: z.ZodObject<{
|
|
58
|
+
id: z.ZodOptional<z.ZodNumber>;
|
|
59
|
+
name: z.ZodString;
|
|
60
|
+
version: z.ZodString;
|
|
61
|
+
/** `ds`, `fs`, or `ts` — what the node consumes and produces. */
|
|
62
|
+
type: z.ZodString;
|
|
63
|
+
title: z.ZodOptional<z.ZodString>;
|
|
64
|
+
description: z.ZodOptional<z.ZodString>;
|
|
65
|
+
authors: z.ZodOptional<z.ZodString>;
|
|
66
|
+
/** Where the plugin's source or docs live, when it declared them. */
|
|
67
|
+
documentation: z.ZodOptional<z.ZodString>;
|
|
68
|
+
category: z.ZodOptional<z.ZodString>;
|
|
69
|
+
/**
|
|
70
|
+
* Every declared parameter, in the order CUBE serves them.
|
|
71
|
+
*
|
|
72
|
+
* Complete, always: the builder drains the collection rather than asking
|
|
73
|
+
* for a page and calling it the answer.
|
|
74
|
+
*/
|
|
75
|
+
parameters: z.ZodArray<z.ZodObject<{
|
|
76
|
+
name: z.ZodString;
|
|
77
|
+
type: z.ZodString;
|
|
78
|
+
optional: z.ZodBoolean;
|
|
79
|
+
default: z.ZodOptional<z.ZodUnknown>;
|
|
80
|
+
help: z.ZodOptional<z.ZodString>;
|
|
81
|
+
/** The flag as it is typed: `--name`, or the bare name for a positional. */
|
|
82
|
+
flag: z.ZodString;
|
|
83
|
+
}, "strip", z.ZodTypeAny, {
|
|
84
|
+
type: string;
|
|
85
|
+
name: string;
|
|
86
|
+
optional: boolean;
|
|
87
|
+
flag: string;
|
|
88
|
+
default?: unknown;
|
|
89
|
+
help?: string | undefined;
|
|
90
|
+
}, {
|
|
91
|
+
type: string;
|
|
92
|
+
name: string;
|
|
93
|
+
optional: boolean;
|
|
94
|
+
flag: string;
|
|
95
|
+
default?: unknown;
|
|
96
|
+
help?: string | undefined;
|
|
97
|
+
}>, "many">;
|
|
98
|
+
/** The `/bin` entry that runs it, so a surface can lower a click to a command. */
|
|
99
|
+
command: z.ZodOptional<z.ZodString>;
|
|
100
|
+
}, "strip", z.ZodTypeAny, {
|
|
101
|
+
type: string;
|
|
102
|
+
name: string;
|
|
103
|
+
version: string;
|
|
104
|
+
parameters: {
|
|
105
|
+
type: string;
|
|
106
|
+
name: string;
|
|
107
|
+
optional: boolean;
|
|
108
|
+
flag: string;
|
|
109
|
+
default?: unknown;
|
|
110
|
+
help?: string | undefined;
|
|
111
|
+
}[];
|
|
112
|
+
id?: number | undefined;
|
|
113
|
+
title?: string | undefined;
|
|
114
|
+
command?: string | undefined;
|
|
115
|
+
description?: string | undefined;
|
|
116
|
+
authors?: string | undefined;
|
|
117
|
+
documentation?: string | undefined;
|
|
118
|
+
category?: string | undefined;
|
|
119
|
+
}, {
|
|
120
|
+
type: string;
|
|
121
|
+
name: string;
|
|
122
|
+
version: string;
|
|
123
|
+
parameters: {
|
|
124
|
+
type: string;
|
|
125
|
+
name: string;
|
|
126
|
+
optional: boolean;
|
|
127
|
+
flag: string;
|
|
128
|
+
default?: unknown;
|
|
129
|
+
help?: string | undefined;
|
|
130
|
+
}[];
|
|
131
|
+
id?: number | undefined;
|
|
132
|
+
title?: string | undefined;
|
|
133
|
+
command?: string | undefined;
|
|
134
|
+
description?: string | undefined;
|
|
135
|
+
authors?: string | undefined;
|
|
136
|
+
documentation?: string | undefined;
|
|
137
|
+
category?: string | undefined;
|
|
138
|
+
}>;
|
|
139
|
+
export type PluginParameter = z.infer<typeof pluginParameterSchema>;
|
|
140
|
+
export type PluginInfoModel = z.infer<typeof pluginInfoModelSchema>;
|
|
141
|
+
/** The model's envelope kind. */
|
|
142
|
+
export declare const PLUGIN_INFO_MODEL_KIND: "plugin.info";
|
package/dist/plugin.js
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file The plugin vocabulary: a registered plugin as a typed envelope payload.
|
|
3
|
+
*
|
|
4
|
+
* A plugin is the one-node case of the compute graph — everything a pipeline
|
|
5
|
+
* node is, without the pipeline around it. Its substance reached surfaces as
|
|
6
|
+
* a rendered manual for as long as `cat /bin/<plugin>` was the only way to
|
|
7
|
+
* ask, which meant nothing downstream could do anything with it: not a card,
|
|
8
|
+
* not a parameter list, not a form, not an export. This model is that same
|
|
9
|
+
* substance as data; the manual becomes one projection of it.
|
|
10
|
+
*
|
|
11
|
+
* Parameters are the payload that matters. They arrive complete or the model
|
|
12
|
+
* is wrong: a parameter list that quietly stops at a page boundary is worse
|
|
13
|
+
* than the paragraph it replaces, because a paragraph does not look
|
|
14
|
+
* authoritative.
|
|
15
|
+
*
|
|
16
|
+
* @module
|
|
17
|
+
*/
|
|
18
|
+
import { z } from 'zod';
|
|
19
|
+
/**
|
|
20
|
+
* One declared parameter of a plugin.
|
|
21
|
+
*
|
|
22
|
+
* `default` is `unknown` because CUBE serves whatever the plugin declared —
|
|
23
|
+
* a string, a number, a boolean, or null for "no default" — and a surface
|
|
24
|
+
* renders it rather than computing on it.
|
|
25
|
+
*/
|
|
26
|
+
export const pluginParameterSchema = z.object({
|
|
27
|
+
name: z.string(),
|
|
28
|
+
type: z.string(),
|
|
29
|
+
optional: z.boolean(),
|
|
30
|
+
default: z.unknown().optional(),
|
|
31
|
+
help: z.string().optional(),
|
|
32
|
+
/** The flag as it is typed: `--name`, or the bare name for a positional. */
|
|
33
|
+
flag: z.string(),
|
|
34
|
+
});
|
|
35
|
+
/**
|
|
36
|
+
* The `plugin.info` model: one registered plugin, whole.
|
|
37
|
+
*
|
|
38
|
+
* Identity, the authoring facts, and every declared parameter. What a
|
|
39
|
+
* surface draws from it — a one-node graph, a parameter table, an argument
|
|
40
|
+
* form — is the surface's business; the model carries no layout and no
|
|
41
|
+
* rendering.
|
|
42
|
+
*/
|
|
43
|
+
export const pluginInfoModelSchema = z.object({
|
|
44
|
+
id: z.number().optional(),
|
|
45
|
+
name: z.string(),
|
|
46
|
+
version: z.string(),
|
|
47
|
+
/** `ds`, `fs`, or `ts` — what the node consumes and produces. */
|
|
48
|
+
type: z.string(),
|
|
49
|
+
title: z.string().optional(),
|
|
50
|
+
description: z.string().optional(),
|
|
51
|
+
authors: z.string().optional(),
|
|
52
|
+
/** Where the plugin's source or docs live, when it declared them. */
|
|
53
|
+
documentation: z.string().optional(),
|
|
54
|
+
category: z.string().optional(),
|
|
55
|
+
/**
|
|
56
|
+
* Every declared parameter, in the order CUBE serves them.
|
|
57
|
+
*
|
|
58
|
+
* Complete, always: the builder drains the collection rather than asking
|
|
59
|
+
* for a page and calling it the answer.
|
|
60
|
+
*/
|
|
61
|
+
parameters: z.array(pluginParameterSchema),
|
|
62
|
+
/** The `/bin` entry that runs it, so a surface can lower a click to a command. */
|
|
63
|
+
command: z.string().optional(),
|
|
64
|
+
});
|
|
65
|
+
/** The model's envelope kind. */
|
|
66
|
+
export const PLUGIN_INFO_MODEL_KIND = 'plugin.info';
|
|
67
|
+
//# sourceMappingURL=plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"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F;IAClF,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC/B,CAAC,CAAC;AAKH,iCAAiC;AACjC,MAAM,CAAC,MAAM,sBAAsB,GAAG,aAAsB,CAAC"}
|
package/dist/proc.d.ts
CHANGED
|
@@ -26,8 +26,12 @@ export interface ProcPromptProgress {
|
|
|
26
26
|
state?: ProcPromptState;
|
|
27
27
|
/** Whether the global index sweep is what `loaded`/`total` describe; absent means yes (older daemons). */
|
|
28
28
|
sweeping?: boolean;
|
|
29
|
-
/**
|
|
29
|
+
/** The earliest feed topology load in flight, when there is one (older readers; the first of `feeds`). */
|
|
30
30
|
feed?: ProcFeedPromptProgress;
|
|
31
|
+
/** Every feed topology load in flight or lately failed, earliest first. */
|
|
32
|
+
feeds?: ProcFeedPromptProgress[];
|
|
33
|
+
/** The roster's own walk in flight: the delta, or the ten-minute full walk. */
|
|
34
|
+
roster?: 'delta' | 'full';
|
|
31
35
|
/** Feeds the roster gained (created or shared) in the last half minute. */
|
|
32
36
|
arrived?: number[];
|
|
33
37
|
}
|
|
@@ -52,6 +56,8 @@ export interface ProcFeedPromptProgress {
|
|
|
52
56
|
id: number;
|
|
53
57
|
loaded: number;
|
|
54
58
|
total: number;
|
|
59
|
+
/** What the walk said when it failed; absent while it runs. */
|
|
60
|
+
failed?: string;
|
|
55
61
|
}
|
|
56
62
|
/**
|
|
57
63
|
* Resolves the prompt state, including compatibility with contexts that only
|
package/dist/proc.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proc.js","sourceRoot":"","sources":["../src/proc.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,qEAAqE;AACrE,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"proc.js","sourceRoot":"","sources":["../src/proc.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,qEAAqE;AACrE,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAU,CAAC;AAwDxE;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CAAC,QAA4B;IAC9D,OAAO,QAAQ,CAAC,KAAK,IAAI,CAAC,QAAQ,CAAC,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;AAC5E,CAAC"}
|
package/package.json
CHANGED