@fnndsc/salsa 4.5.6 → 4.6.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/README.md +0 -2
- package/dist/compute/index.d.ts +0 -9
- package/dist/compute/index.js +0 -16
- package/dist/compute/index.js.map +1 -1
- package/dist/dag/feedData.js +166 -73
- package/dist/dag/feedData.js.map +1 -1
- package/dist/dag/feedLoad.d.ts +1 -1
- package/dist/dag/feedLoad.js +6 -4
- package/dist/dag/feedLoad.js.map +1 -1
- package/dist/dicom/pixels.js +95 -36
- package/dist/dicom/pixels.js.map +1 -1
- package/dist/dicom/series.d.ts +4 -1
- package/dist/dicom/series.js +80 -31
- package/dist/dicom/series.js.map +1 -1
- package/dist/dicom/tags.d.ts +28 -0
- package/dist/dicom/tags.js +30 -0
- package/dist/dicom/tags.js.map +1 -1
- package/dist/files/copy.d.ts +197 -0
- package/dist/files/copy.js +636 -0
- package/dist/files/copy.js.map +1 -0
- package/dist/files/copyFolder.d.ts +103 -0
- package/dist/files/copyFolder.js +199 -0
- package/dist/files/copyFolder.js.map +1 -0
- package/dist/files/create.d.ts +178 -0
- package/dist/files/create.js +444 -0
- package/dist/files/create.js.map +1 -0
- package/dist/files/download.d.ts +188 -0
- package/dist/files/download.js +541 -0
- package/dist/files/download.js.map +1 -0
- package/dist/files/index.d.ts +69 -141
- package/dist/files/index.js +184 -535
- package/dist/files/index.js.map +1 -1
- package/dist/files/listing.d.ts +132 -0
- package/dist/files/listing.js +179 -0
- package/dist/files/listing.js.map +1 -0
- package/dist/files/move.d.ts +125 -0
- package/dist/files/move.js +334 -0
- package/dist/files/move.js.map +1 -0
- package/dist/files/pathMapper.d.ts +24 -1
- package/dist/files/pathMapper.js +108 -47
- package/dist/files/pathMapper.js.map +1 -1
- package/dist/files/proof.d.ts +315 -0
- package/dist/files/proof.js +574 -0
- package/dist/files/proof.js.map +1 -0
- package/dist/files/removal.d.ts +223 -0
- package/dist/files/removal.js +318 -0
- package/dist/files/removal.js.map +1 -0
- package/dist/files/replace.d.ts +175 -0
- package/dist/files/replace.js +582 -0
- package/dist/files/replace.js.map +1 -0
- package/dist/files/upload.d.ts +205 -0
- package/dist/files/upload.js +478 -0
- package/dist/files/upload.js.map +1 -0
- package/dist/index.d.ts +14 -2
- package/dist/index.js +45 -32
- package/dist/index.js.map +1 -1
- package/dist/jobs/index.d.ts +1 -1
- package/dist/jobs/index.js +2 -2
- package/dist/jobs/index.js.map +1 -1
- package/dist/jobs/jobOps.d.ts +20 -13
- package/dist/jobs/jobOps.js +41 -37
- package/dist/jobs/jobOps.js.map +1 -1
- package/dist/pacs/anonymise.d.ts +17 -36
- package/dist/pacs/anonymise.js +29 -67
- package/dist/pacs/anonymise.js.map +1 -1
- package/dist/pipelines/index.d.ts +1 -13
- package/dist/pipelines/index.js +0 -38
- package/dist/pipelines/index.js.map +1 -1
- package/dist/pipelines/invocation.js +321 -167
- package/dist/pipelines/invocation.js.map +1 -1
- package/dist/pipelines/manifest.js.map +1 -1
- package/dist/pipelines/packages.d.ts +11 -8
- package/dist/pipelines/packages.js +253 -77
- package/dist/pipelines/packages.js.map +1 -1
- package/dist/plugins/adminToken.d.ts +67 -0
- package/dist/plugins/adminToken.js +77 -0
- package/dist/plugins/adminToken.js.map +1 -0
- package/dist/plugins/index.d.ts +0 -7
- package/dist/plugins/index.js +0 -16
- package/dist/plugins/index.js.map +1 -1
- package/dist/plugins/peer_search.d.ts +0 -15
- package/dist/plugins/peer_search.js +0 -25
- package/dist/plugins/peer_search.js.map +1 -1
- package/dist/plugins/plugin_add.d.ts +14 -2
- package/dist/plugins/plugin_add.js +42 -13
- package/dist/plugins/plugin_add.js.map +1 -1
- package/dist/plugins/plugin_docker.d.ts +25 -0
- package/dist/plugins/plugin_docker.js +33 -0
- package/dist/plugins/plugin_docker.js.map +1 -1
- package/dist/plugins/plugin_register.d.ts +0 -10
- package/dist/plugins/plugin_register.js +3 -54
- package/dist/plugins/plugin_register.js.map +1 -1
- package/dist/plugins/plugin_sync.js +45 -22
- package/dist/plugins/plugin_sync.js.map +1 -1
- package/dist/plugins/plugin_validate.js +47 -13
- package/dist/plugins/plugin_validate.js.map +1 -1
- package/dist/plugins/store_import.d.ts +0 -9
- package/dist/plugins/store_import.js +3 -29
- package/dist/plugins/store_import.js.map +1 -1
- package/dist/retrieve/task.d.ts +137 -0
- package/dist/retrieve/task.js +41 -0
- package/dist/retrieve/task.js.map +1 -0
- package/dist/retrieve/watch.d.ts +2 -118
- package/dist/retrieve/watch.js +452 -321
- package/dist/retrieve/watch.js.map +1 -1
- package/dist/vfs/providers/etc.d.ts +6 -4
- package/dist/vfs/providers/etc.js +12 -4
- package/dist/vfs/providers/etc.js.map +1 -1
- package/dist/vfs/providers/native.d.ts +116 -39
- package/dist/vfs/providers/native.js +291 -347
- package/dist/vfs/providers/native.js.map +1 -1
- package/dist/vfs/providers/pacs.d.ts +29 -3
- package/dist/vfs/providers/pacs.js +303 -73
- package/dist/vfs/providers/pacs.js.map +1 -1
- package/dist/vfs/providers/pacs_content.js +22 -6
- package/dist/vfs/providers/pacs_content.js.map +1 -1
- package/dist/vfs/providers/proc/backfill.d.ts +46 -0
- package/dist/vfs/providers/proc/backfill.js +147 -0
- package/dist/vfs/providers/proc/backfill.js.map +1 -0
- package/dist/vfs/providers/proc/book.d.ts +176 -0
- package/dist/vfs/providers/proc/book.js +73 -0
- package/dist/vfs/providers/proc/book.js.map +1 -0
- package/dist/vfs/providers/proc/catchup.d.ts +69 -0
- package/dist/vfs/providers/proc/catchup.js +125 -0
- package/dist/vfs/providers/proc/catchup.js.map +1 -0
- package/dist/vfs/providers/proc/feedIndex.d.ts +146 -0
- package/dist/vfs/providers/proc/feedIndex.js +354 -0
- package/dist/vfs/providers/proc/feedIndex.js.map +1 -0
- package/dist/vfs/providers/proc/feedTopology.d.ts +85 -0
- package/dist/vfs/providers/proc/feedTopology.js +192 -0
- package/dist/vfs/providers/proc/feedTopology.js.map +1 -0
- package/dist/vfs/providers/proc/locate.d.ts +60 -0
- package/dist/vfs/providers/proc/locate.js +103 -0
- package/dist/vfs/providers/proc/locate.js.map +1 -0
- package/dist/vfs/providers/proc/path.d.ts +50 -0
- package/dist/vfs/providers/proc/path.js +106 -0
- package/dist/vfs/providers/proc/path.js.map +1 -0
- package/dist/vfs/providers/proc/roster.d.ts +95 -0
- package/dist/vfs/providers/proc/roster.js +425 -0
- package/dist/vfs/providers/proc/roster.js.map +1 -0
- package/dist/vfs/providers/proc/rows.d.ts +120 -0
- package/dist/vfs/providers/proc/rows.js +181 -0
- package/dist/vfs/providers/proc/rows.js.map +1 -0
- package/dist/vfs/providers/proc/subtree.d.ts +73 -0
- package/dist/vfs/providers/proc/subtree.js +125 -0
- package/dist/vfs/providers/proc/subtree.js.map +1 -0
- package/dist/vfs/providers/proc/sweep.d.ts +89 -0
- package/dist/vfs/providers/proc/sweep.js +297 -0
- package/dist/vfs/providers/proc/sweep.js.map +1 -0
- package/dist/vfs/providers/proc.d.ts +47 -346
- package/dist/vfs/providers/proc.js +349 -1806
- package/dist/vfs/providers/proc.js.map +1 -1
- package/dist/vfs/providers/share.js +4 -1
- package/dist/vfs/providers/share.js.map +1 -1
- package/package.json +3 -3
- package/dist/pacs/resultDecode.d.ts +0 -13
- package/dist/pacs/resultDecode.js +0 -19
- package/dist/pacs/resultDecode.js.map +0 -1
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Surfaces ChRIS plugin instances as a navigable DAG under /proc/jobs/.
|
|
5
5
|
* Backed by ProcCache: an accumulating index whose terminal entries are
|
|
6
|
-
* immutable and whose freshness is visit-driven.
|
|
6
|
+
* immutable and whose freshness is visit-driven. The reading of the tree
|
|
7
|
+
* lives in `./proc/` (the feed index, feed topology, visits and roster,
|
|
8
|
+
* the topology sweep); this module is the VFS face over it.
|
|
7
9
|
*
|
|
8
10
|
* Freshness model (every visit is a cheap delta, never a re-crawl):
|
|
9
11
|
* - ls /proc/jobs → roster delta: each collection's newest page, read
|
|
@@ -12,100 +14,38 @@
|
|
|
12
14
|
* the last walk's — a total that moved (a share, an
|
|
13
15
|
* unshare, a deletion) promotes the visit to the
|
|
14
16
|
* full index walk, which also runs once the roster
|
|
15
|
-
* is older than
|
|
17
|
+
* is older than `ROSTER_FULL_WALK_MS`;
|
|
16
18
|
* - a feed the roster lacks, asked for by name or id, is asked of CUBE live
|
|
17
|
-
* and adopted (
|
|
19
|
+
* and adopted (`procFeed_probe`);
|
|
18
20
|
* - ls /proc/jobs/N → first visit loads the topology once; every later
|
|
19
21
|
* visit runs {@link feedVisit_sync}: one feed-row
|
|
20
22
|
* fetch (job counters), then, only when something
|
|
21
23
|
* moved, a `min_end_date` delta walk (nodes created
|
|
22
24
|
* or finished since the cursor) plus an `active=true`
|
|
23
25
|
* sweep for the nodes still running;
|
|
24
|
-
* - settled feeds → re-checked at most once per
|
|
26
|
+
* - settled feeds → re-checked at most once per `FEED_RECHECK_MS`,
|
|
25
27
|
* so work appended to a finished feed is still seen;
|
|
26
28
|
* - cat .../status → getPluginInstance(id), always live.
|
|
27
29
|
*
|
|
28
|
-
*
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
import { type ProcRosterSyncKind, ProcCache, ProcFeed, Result } from '@fnndsc/cumin';
|
|
32
|
-
import { VFSProvider, VFSItem, CpOptions } from '../provider.js';
|
|
33
|
-
/** Pages of one feed's topology walk fetched at once (PACS plural's precedent: four). */
|
|
34
|
-
export declare const FEED_WALK_IN_FLIGHT: number;
|
|
35
|
-
/** How long a settled feed's counters are trusted before a visit re-checks them. */
|
|
36
|
-
export declare const FEED_RECHECK_MS: number;
|
|
37
|
-
/** How old the roster may be before a visit walks the whole feed index again. */
|
|
38
|
-
export declare const ROSTER_FULL_WALK_MS: number;
|
|
39
|
-
/** Visits to one feed closer together than this share the first visit's result. */
|
|
40
|
-
export declare const FEED_VISIT_COALESCE_MS: number;
|
|
41
|
-
/**
|
|
42
|
-
* Rows of a collection's newest page a roster delta reads. CUBE orders feeds
|
|
43
|
-
* newest first, so the page holds every feed newer than the roster unless
|
|
44
|
-
* more than this many arrived between two visits; it is small because the
|
|
45
|
-
* surfaces re-ask the roster on a timer.
|
|
46
|
-
*/
|
|
47
|
-
export declare const ROSTER_DELTA_PAGE: number;
|
|
48
|
-
/**
|
|
49
|
-
* How long listing `/proc/jobs` waits for the roster's sync before answering
|
|
50
|
-
* from the cache: long enough for a quick CUBE to show a feed shared since
|
|
51
|
-
* the last look, short enough that a slow one is never felt.
|
|
52
|
-
*/
|
|
53
|
-
export declare const ROSTER_LIST_BUDGET_MS: number;
|
|
54
|
-
/** The least time between two unforced roster deltas. */
|
|
55
|
-
export declare const ROSTER_DELTA_MIN_MS: number;
|
|
56
|
-
/** Lifecycle states for the session's global topology sweep. */
|
|
57
|
-
export type ProcTopologyState = 'idle' | 'running' | 'complete' | 'failed';
|
|
58
|
-
/**
|
|
59
|
-
* Observable lifecycle of the session's global topology sweep.
|
|
30
|
+
* Key components:
|
|
31
|
+
* - ProcVfsProvider: the VFS verbs over `/proc/jobs`.
|
|
32
|
+
* - feedStatus_derive: a feed's aggregate status from its job counters.
|
|
60
33
|
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
state: ProcTopologyState;
|
|
66
|
-
failure?: string;
|
|
67
|
-
}
|
|
68
|
-
/** Whether a feed's topology is in the cache, or still on its way. */
|
|
69
|
-
export type FeedTopologyReadiness = 'ready' | 'pending';
|
|
70
|
-
/**
|
|
71
|
-
* Ensures a feed's topology walk is at least under way, without waiting for
|
|
72
|
-
* it. Index movement never holds the session's lane: a cold feed's walk is
|
|
73
|
-
* started here and runs detached, deduped by the in-flight map, annunciated
|
|
74
|
-
* by the load register, and committed to the cache when it lands (which
|
|
75
|
-
* emits the feed's change event, the signal a watch answers).
|
|
34
|
+
* Typical usage:
|
|
35
|
+
* ```typescript
|
|
36
|
+
* const items: Result<VFSItem[]> = await new ProcVfsProvider().list('/proc/jobs/feed_7');
|
|
37
|
+
* ```
|
|
76
38
|
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
*/
|
|
80
|
-
export declare function feedInstances_ensureStarted(feedID: number): FeedTopologyReadiness;
|
|
81
|
-
/**
|
|
82
|
-
* The operator's `proc refresh <feed>`: evicts the feed and STARTS its
|
|
83
|
-
* re-walk. The walk is index movement, finished off the lane; the caller
|
|
84
|
-
* answers `pending` and the prompt carries the count.
|
|
39
|
+
* Dependencies: `@fnndsc/cumin` (cache, CUBE contracts), `@fnndsc/fond` (VFS outcomes),
|
|
40
|
+
* `../../jobs` (job status, log, cancel), `./proc/*` (the reading of the tree).
|
|
85
41
|
*
|
|
86
|
-
* @
|
|
87
|
-
* @returns `pending` while the walk runs (always, right after an eviction).
|
|
88
|
-
*/
|
|
89
|
-
export declare function procFeed_refreshStart(feedID: number): Promise<FeedTopologyReadiness>;
|
|
90
|
-
/**
|
|
91
|
-
* Ensures topology for a feed is loaded.
|
|
92
|
-
* Per-feed loads proceed immediately even while the global sweep is running —
|
|
93
|
-
* instance_add is idempotent so concurrent additions are safe.
|
|
42
|
+
* @module
|
|
94
43
|
*/
|
|
95
|
-
|
|
44
|
+
import { ProcFeed, Result } from '@fnndsc/cumin';
|
|
45
|
+
import { type VfsOutcome, type VFSSubtree, type WriteOptions } from '@fnndsc/fond';
|
|
46
|
+
import { VFSProvider, VFSItem, CpOptions } from '../provider.js';
|
|
96
47
|
/** Derives aggregate feed status from stored job counters — no API call. */
|
|
97
48
|
export declare function feedStatus_derive(feed: ProcFeed): string;
|
|
98
|
-
export declare function procPath_parse(pathStr: string): {
|
|
99
|
-
feedID: number | null;
|
|
100
|
-
instanceID: number | null;
|
|
101
|
-
virtualFile: string | null;
|
|
102
|
-
/**
|
|
103
|
-
* Set when the path descends THROUGH an instance's `data` link: the
|
|
104
|
-
* portion after `data`, '' for the link itself. Everything under the
|
|
105
|
-
* link belongs to the link's CFS target, not to `/proc`.
|
|
106
|
-
*/
|
|
107
|
-
dataRemainder: string | null;
|
|
108
|
-
};
|
|
109
49
|
/**
|
|
110
50
|
* VFS provider exposing running jobs and feeds under the /proc namespace.
|
|
111
51
|
*/
|
|
@@ -141,6 +81,28 @@ export declare class ProcVfsProvider implements VFSProvider {
|
|
|
141
81
|
* @returns The subtree, or null when the cache is not in service.
|
|
142
82
|
*/
|
|
143
83
|
subtree(pathStr: string): Promise<VFSSubtree | null>;
|
|
84
|
+
/**
|
|
85
|
+
* Refuses a listing of a feed's or a job's own file (`note`, `status`,
|
|
86
|
+
* `log`): it is no folder, and a reader names it from its parent's row.
|
|
87
|
+
*
|
|
88
|
+
* @param clean - The path as asked, for the message.
|
|
89
|
+
* @param instanceID - The job's id, or null for a feed's own file.
|
|
90
|
+
* @param virtualFile - The file's name below the feed or job.
|
|
91
|
+
* @returns Err, with "Not a directory" for a file the folder lists and
|
|
92
|
+
* "No such file or directory" for any other name.
|
|
93
|
+
*/
|
|
94
|
+
private virtualFileListing_refuse;
|
|
95
|
+
/**
|
|
96
|
+
* Lists a `/proc/jobs` folder: the feeds, a feed's files and root jobs, a
|
|
97
|
+
* job's files and children; under a job's `data` link, the link target's
|
|
98
|
+
* listing.
|
|
99
|
+
*
|
|
100
|
+
* @param pathStr - Absolute `/proc/jobs/...` path.
|
|
101
|
+
* @param _options - Sort options, passed on to the link target's listing.
|
|
102
|
+
* @param _options.sort - The key the target's listing sorts by.
|
|
103
|
+
* @param _options.reverse - Whether it sorts in reverse.
|
|
104
|
+
* @returns The folder's rows, or Err when it is no folder.
|
|
105
|
+
*/
|
|
144
106
|
list(pathStr: string, _options?: {
|
|
145
107
|
sort?: 'name' | 'size' | 'date' | 'owner';
|
|
146
108
|
reverse?: boolean;
|
|
@@ -171,280 +133,19 @@ export declare class ProcVfsProvider implements VFSProvider {
|
|
|
171
133
|
touch(_pathStr: string): Promise<boolean>;
|
|
172
134
|
upload(_localPath: string, _remotePath: string): Promise<boolean>;
|
|
173
135
|
/** @inheritdoc */
|
|
174
|
-
write(pathStr: string, content: string): Promise<VfsOutcome>;
|
|
136
|
+
write(pathStr: string, content: string, options?: WriteOptions): Promise<VfsOutcome>;
|
|
175
137
|
/**
|
|
176
138
|
* Writes a projected file. One file under /proc takes writes: a feed's
|
|
177
139
|
* note (`/proc/jobs/feed_N/note`), whose content is replaced whole; its
|
|
178
|
-
* title stands. Anything else is refused by name.
|
|
140
|
+
* title stands. Anything else is refused by name. Given the identity it
|
|
141
|
+
* was read under, the write is made on that binding's client and asked of
|
|
142
|
+
* it after the lookups, immediately before CUBE is changed; an identity
|
|
143
|
+
* that is no binding of CUBE's (a read made with no connection) refuses it.
|
|
179
144
|
*
|
|
180
145
|
* @param pathStr - The projected path.
|
|
181
146
|
* @param content - The new content, whole.
|
|
147
|
+
* @param options - The identity it was read under, when given.
|
|
182
148
|
* @returns True when it was written.
|
|
183
149
|
*/
|
|
184
150
|
private file_write;
|
|
185
151
|
}
|
|
186
|
-
/**
|
|
187
|
-
* Ensures instance topology is loaded for a feed without clearing existing data.
|
|
188
|
-
* Use this from proc find — it respects already-loaded feeds and the in-flight map.
|
|
189
|
-
* Use procCache_refresh(feedID) only when a forced reload is desired.
|
|
190
|
-
*/
|
|
191
|
-
export declare function procFeed_ensureLoaded(feedID: number): Promise<void>;
|
|
192
|
-
/**
|
|
193
|
-
* Refreshes volatile job status for one feed via a single paginated LIST sweep.
|
|
194
|
-
*
|
|
195
|
-
* The plugin-instance list response carries `status`, so one feed-scoped list call
|
|
196
|
-
* updates every node — far cheaper than per-node detail fetches. Terminal statuses
|
|
197
|
-
* are frozen by {@link ProcCache.status_update} and never regress.
|
|
198
|
-
*
|
|
199
|
-
* @param feedID - Feed whose instance statuses should be refreshed.
|
|
200
|
-
*/
|
|
201
|
-
/**
|
|
202
|
-
* Ensures a feed's metadata (title + job counters, needed for aggregate status) is cached
|
|
203
|
-
* with real values. No-op when the feed is already present with real metadata; fetches one
|
|
204
|
-
* `getFeeds({id})` only when the feed is missing or a zero-counter placeholder. Does NOT
|
|
205
|
-
* touch instance topology — reuse of the warm cache is the whole point.
|
|
206
|
-
*
|
|
207
|
-
* @param feedID - Feed whose metadata to ensure.
|
|
208
|
-
*/
|
|
209
|
-
export declare function feedMeta_ensure(feedID: number): Promise<void>;
|
|
210
|
-
/**
|
|
211
|
-
* Asks CUBE for one feed, live, and adopts it into the roster: the way a
|
|
212
|
-
* feed shared to this identity, or made public, since the roster was
|
|
213
|
-
* walked is seen when it is asked for by name or id. A feed the roster
|
|
214
|
-
* already holds has its row refreshed. The yardsticks move with an
|
|
215
|
-
* adoption, so the next delta does not walk again for what this ask found.
|
|
216
|
-
*
|
|
217
|
-
* @param feedID - The feed to ask for.
|
|
218
|
-
* @returns The feed as the roster now holds it, or null when CUBE lists it
|
|
219
|
-
* in neither collection for this identity — not shared, or shared to a
|
|
220
|
-
* group the identity is not in.
|
|
221
|
-
* @throws {Error} When not connected.
|
|
222
|
-
*/
|
|
223
|
-
export declare function procFeed_probe(feedID: number): Promise<ProcFeed | null>;
|
|
224
|
-
export declare function feedStatus_refresh(feedID: number): Promise<void>;
|
|
225
|
-
/**
|
|
226
|
-
* Whether every cached instance of a feed carries a terminal status. A fully
|
|
227
|
-
* settled feed can only change by having work appended to it, which the
|
|
228
|
-
* feed-row counters reveal.
|
|
229
|
-
*
|
|
230
|
-
* @param cache - The process cache.
|
|
231
|
-
* @param feedID - The feed to inspect.
|
|
232
|
-
* @returns True when no cached instance could still change status.
|
|
233
|
-
*/
|
|
234
|
-
export declare function feedCached_isSettled(cache: ProcCache, feedID: number): boolean;
|
|
235
|
-
/**
|
|
236
|
-
* How far the backfill of jobs' pipeline runs has read, for `proc stat`.
|
|
237
|
-
*
|
|
238
|
-
* @returns Pages known so far, pages read, and whether it is reading now.
|
|
239
|
-
*/
|
|
240
|
-
export declare function procPipelineBackfill_status(): {
|
|
241
|
-
pages: number;
|
|
242
|
-
read: number;
|
|
243
|
-
running: boolean;
|
|
244
|
-
};
|
|
245
|
-
/**
|
|
246
|
-
* Reads every visible job's row once more so the cache learns which
|
|
247
|
-
* pipeline run made each (rows restored from an older checkpoint lack it),
|
|
248
|
-
* behind the prompt: started the first time a `find` needs it, and never
|
|
249
|
-
* again once every job knows. Off the lane; a failure leaves the jobs as
|
|
250
|
-
* they were.
|
|
251
|
-
*
|
|
252
|
-
* Page by page across all lanes, not feed by feed: the unknown jobs sit in
|
|
253
|
-
* a few feeds of tens of thousands of jobs each (on one account, three
|
|
254
|
-
* feeds held all 118k), and a feed read one page after another kept every
|
|
255
|
-
* other lane idle for hours (#1253). Each feed's first page says how long
|
|
256
|
-
* it is; every page after it goes in one queue the lanes share.
|
|
257
|
-
*
|
|
258
|
-
* @returns Nothing; the walk runs on.
|
|
259
|
-
*/
|
|
260
|
-
export declare function procPipeline_backfillStart(): void;
|
|
261
|
-
/**
|
|
262
|
-
* Brings one already-loaded feed up to date with CUBE at the cost the change
|
|
263
|
-
* warrants: a settled feed pays one feed-row fetch per {@link FEED_RECHECK_MS};
|
|
264
|
-
* a feed with running work pays that fetch on every visit; and only when the
|
|
265
|
-
* counters moved (or work is running) does the visit walk the delta —
|
|
266
|
-
* `min_end_date` from the cursor, which yields nodes created OR finished since
|
|
267
|
-
* (CUBE stamps end_date at creation and again at completion) — followed by an
|
|
268
|
-
* `active=true` sweep for the nodes still in flight.
|
|
269
|
-
*
|
|
270
|
-
* Concurrent visits share one in-flight sync, and visits within
|
|
271
|
-
* {@link FEED_VISIT_COALESCE_MS} of each other share the first one's result
|
|
272
|
-
* (a pane tick and an `ls` in the same second are one visit). Failures are
|
|
273
|
-
* surfaced as warnings and never fail the visit: the cache stays as it was.
|
|
274
|
-
*
|
|
275
|
-
* @param feedID - A feed whose topology is already loaded.
|
|
276
|
-
* @param force - Ignore the settled-feed throttle (an explicit refresh).
|
|
277
|
-
* @returns True when the cache reflects CUBE as of this visit (including a
|
|
278
|
-
* visit that needed no wire), false when the sync failed.
|
|
279
|
-
*/
|
|
280
|
-
export declare function feedVisit_sync(feedID: number, force?: boolean): Promise<boolean>;
|
|
281
|
-
/**
|
|
282
|
-
* Brings the feed roster up to date on a `/proc/jobs` visit. While the roster
|
|
283
|
-
* is younger than {@link ROSTER_FULL_WALK_MS} this is a delta: feeds whose id
|
|
284
|
-
* exceeds the highest known one, from both the owned/shared and the public
|
|
285
|
-
* collections (one call each when nothing is new). Once older, it is the full
|
|
286
|
-
* index walk, which is the only way a feed shared later, or one deleted, is
|
|
287
|
-
* seen. A roster still owned by warmup (not yet `current`) is left alone.
|
|
288
|
-
*
|
|
289
|
-
* @param force - Walk the whole index regardless of age.
|
|
290
|
-
* @returns Feed IDs the sync brought in or found changed: after a full
|
|
291
|
-
* walk, the reconciliation targets (new, changed, or active feeds); after
|
|
292
|
-
* a delta, the newly seen feeds. Empty when nothing moved or the roster
|
|
293
|
-
* was left alone.
|
|
294
|
-
*/
|
|
295
|
-
export declare function procRoster_sync(force?: boolean): Promise<number[]>;
|
|
296
|
-
/**
|
|
297
|
-
* Waits for the roster's sync at most `budgetMs`: a quick CUBE lands what it
|
|
298
|
-
* found in the answer (a share is seen on the next look), a slow one is left
|
|
299
|
-
* to land behind it, announced as arrivals, and the listing answers from the
|
|
300
|
-
* cache. A listing never waits on CUBE longer than the budget.
|
|
301
|
-
*
|
|
302
|
-
* @param budgetMs - How long the caller may wait.
|
|
303
|
-
*/
|
|
304
|
-
export declare function procRoster_syncWithin(budgetMs: number): Promise<void>;
|
|
305
|
-
/**
|
|
306
|
-
* Starts the roster's sync and returns at once. The roster is index
|
|
307
|
-
* movement: a command that lists it answers from the cache now, the walk
|
|
308
|
-
* runs off the session's lane (deduped with any sync in flight), the
|
|
309
|
-
* prompt names it while it runs, and arrivals land as they do today.
|
|
310
|
-
*
|
|
311
|
-
* @param force - Whether to run the full walk regardless of the timer.
|
|
312
|
-
* @returns The walk started or already in flight, or `none` when the cache is not in service.
|
|
313
|
-
*/
|
|
314
|
-
export declare function procRoster_syncStart(force?: boolean): ProcRosterSyncKind | 'none';
|
|
315
|
-
/**
|
|
316
|
-
* Brings a restored roster into service at boot without walking the whole
|
|
317
|
-
* feed index: feeds newer than the highest restored id are added (one call
|
|
318
|
-
* per collection when nothing is new), and the cache is marked built so
|
|
319
|
-
* visits can begin. Counters of restored feeds stay as checkpointed until a
|
|
320
|
-
* visit or the full walk the host runs in the background afterwards.
|
|
321
|
-
*
|
|
322
|
-
* @returns The feed IDs added.
|
|
323
|
-
* @throws {Error} When not connected or the roster is empty (nothing was
|
|
324
|
-
* restored) — the host then falls back to the full index build.
|
|
325
|
-
*/
|
|
326
|
-
export declare function procRoster_bootSync(): Promise<number[]>;
|
|
327
|
-
/**
|
|
328
|
-
* Queues roster feeds whose topology the cache lacks, and starts the walk
|
|
329
|
-
* when none is running. Nothing is queued while the global sweep is the
|
|
330
|
-
* one bringing topology in (it covers every feed), nor for a feed already
|
|
331
|
-
* loaded, loading or queued.
|
|
332
|
-
*
|
|
333
|
-
* @param feedIDs - Candidate feed IDs (a sync's arrivals, or the roster).
|
|
334
|
-
* @returns How many feeds this call queued.
|
|
335
|
-
*/
|
|
336
|
-
export declare function procTopologyCatchup_enqueue(feedIDs: number[]): number;
|
|
337
|
-
/**
|
|
338
|
-
* How many feeds still wait for their topology, and whether a walk runs.
|
|
339
|
-
*
|
|
340
|
-
* @returns The catch-up's state.
|
|
341
|
-
*/
|
|
342
|
-
export declare function procTopologyCatchup_status(): {
|
|
343
|
-
queued: number;
|
|
344
|
-
running: boolean;
|
|
345
|
-
};
|
|
346
|
-
/**
|
|
347
|
-
* Waits for the catch-up to drain (tests, and a readout that wants whole numbers).
|
|
348
|
-
*
|
|
349
|
-
* @returns Resolves when no walk is queued or running.
|
|
350
|
-
*/
|
|
351
|
-
export declare function procTopologyCatchup_await(): Promise<void>;
|
|
352
|
-
/**
|
|
353
|
-
* One place a jump can land: a feed, or a node within one.
|
|
354
|
-
*
|
|
355
|
-
* @property kind - A feed, or a node (plugin instance).
|
|
356
|
-
* @property feedId - The feed, or the node's feed.
|
|
357
|
-
* @property nodeId - The node, for a node.
|
|
358
|
-
* @property name - The `/proc` name: `feed_4389`, or `pl-dicom_repack_639204`.
|
|
359
|
-
* @property title - The feed's title.
|
|
360
|
-
*/
|
|
361
|
-
export interface ProcLocation {
|
|
362
|
-
kind: 'feed' | 'node';
|
|
363
|
-
feedId: number;
|
|
364
|
-
nodeId?: number;
|
|
365
|
-
name: string;
|
|
366
|
-
title: string;
|
|
367
|
-
}
|
|
368
|
-
/**
|
|
369
|
-
* What a jump target names: a feed only (`feed_4389`), a node only
|
|
370
|
-
* (`pl-dicom_repack_639204`, or `_639204`), or a bare number that may be
|
|
371
|
-
* either. Null for anything else.
|
|
372
|
-
*
|
|
373
|
-
* @param target - What the operator typed.
|
|
374
|
-
* @returns The id and which kinds it may name, or null.
|
|
375
|
-
*/
|
|
376
|
-
export declare function procTarget_parse(target: string): {
|
|
377
|
-
id: number;
|
|
378
|
-
feed: boolean;
|
|
379
|
-
node: boolean;
|
|
380
|
-
} | null;
|
|
381
|
-
/**
|
|
382
|
-
* Finds where a jump target lands, asking CUBE live for what the roster
|
|
383
|
-
* and the index lack: a feed shared since the roster was walked, or a node
|
|
384
|
-
* in one. A node's feed is adopted into the roster on the way, so the
|
|
385
|
-
* place the answer names can be entered at once. A bare number that is
|
|
386
|
-
* both a feed and a node answers both; the caller asks which.
|
|
387
|
-
*
|
|
388
|
-
* @param target - A feed id, a node id, or a `feed_N` / `<plugin>_N` name.
|
|
389
|
-
* @returns Every place it names that this identity can see; empty for none.
|
|
390
|
-
*/
|
|
391
|
-
export declare function procTarget_locate(target: string): Promise<ProcLocation[]>;
|
|
392
|
-
/**
|
|
393
|
-
* Forgets all visit bookkeeping (tests, and a cache cleared underneath us).
|
|
394
|
-
*/
|
|
395
|
-
export declare function procVisitState_reset(): void;
|
|
396
|
-
/**
|
|
397
|
-
* Reads the data facts of every feed that has none yet (see
|
|
398
|
-
* `dag/feedData.ts`): the index's tail after a sweep, and the one a daemon
|
|
399
|
-
* that restored its checkpoint starts itself, since no sweep runs then.
|
|
400
|
-
*
|
|
401
|
-
* @returns How many feeds were read; zero when a sweep is already under way.
|
|
402
|
-
*/
|
|
403
|
-
export declare function procDataFacts_start(): Promise<number>;
|
|
404
|
-
/**
|
|
405
|
-
* Starts or joins the session's global plugin-instance topology sweep.
|
|
406
|
-
*
|
|
407
|
-
* @returns The single in-flight sweep promise.
|
|
408
|
-
*/
|
|
409
|
-
export declare function procTopology_warmup(): Promise<void>;
|
|
410
|
-
/**
|
|
411
|
-
* Reconciles topology only for feed IDs selected by a restored-cache feed-index
|
|
412
|
-
* comparison. This preserves the checkpointed topology for unchanged terminal
|
|
413
|
-
* feeds while refreshing new, changed, and active feeds from CUBE.
|
|
414
|
-
*
|
|
415
|
-
* @param feedIDs - Canonical CUBE feed IDs whose topology must be reloaded.
|
|
416
|
-
* @returns A promise that resolves after all supplied feeds have been refreshed.
|
|
417
|
-
*/
|
|
418
|
-
export declare function procTopology_reconcileFeeds(feedIDs: number[]): Promise<void>;
|
|
419
|
-
/**
|
|
420
|
-
* Continues a failed topology reconciliation from its retained global page or
|
|
421
|
-
* scoped feed set.
|
|
422
|
-
*
|
|
423
|
-
* @returns The resumed sweep promise, or the active sweep when one is running.
|
|
424
|
-
* @throws {Error} When there is no failed sweep continuation to retry.
|
|
425
|
-
*/
|
|
426
|
-
export declare function procTopology_retry(): Promise<void>;
|
|
427
|
-
/**
|
|
428
|
-
* Reports the session topology sweep lifecycle.
|
|
429
|
-
*
|
|
430
|
-
* @returns A snapshot of the lifecycle state and any failure reason.
|
|
431
|
-
*/
|
|
432
|
-
export declare function procTopology_status(): ProcTopologyStatus;
|
|
433
|
-
/**
|
|
434
|
-
* Waits for the active topology sweep without starting another.
|
|
435
|
-
*
|
|
436
|
-
* @returns A promise that resolves when the active sweep finishes, or
|
|
437
|
-
* immediately when no sweep is running.
|
|
438
|
-
*/
|
|
439
|
-
export declare function procTopology_await(): Promise<void>;
|
|
440
|
-
/**
|
|
441
|
-
* Rebuilds the ProcCache, optionally scoped to one feed.
|
|
442
|
-
*
|
|
443
|
-
* A full refresh returns feeds whose topology merits reload after the feed-index
|
|
444
|
-
* comparison. Callers performing an explicit `proc refresh` can ignore that
|
|
445
|
-
* result and run a global topology sweep; restored startup uses it to stay scoped.
|
|
446
|
-
*
|
|
447
|
-
* @param feedID - One feed to force-refresh, or undefined for the full feed index.
|
|
448
|
-
* @returns IDs whose topology is new, changed, or currently active.
|
|
449
|
-
*/
|
|
450
|
-
export declare function procCache_refresh(feedID?: number): Promise<number[]>;
|