@fnndsc/salsa 3.5.0 → 3.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 +6 -6
- package/dist/connect/index.d.ts +11 -0
- package/dist/connect/index.js +11 -0
- package/dist/connect/index.js.map +1 -1
- package/dist/dag/feedJoins.js +4 -1
- package/dist/dag/feedJoins.js.map +1 -1
- package/dist/feeds/index.d.ts +15 -2
- package/dist/feeds/index.js.map +1 -1
- package/dist/files/index.d.ts +7 -0
- package/dist/files/index.js +12 -11
- package/dist/files/index.js.map +1 -1
- package/dist/files/regular_content.js +11 -3
- package/dist/files/regular_content.js.map +1 -1
- package/dist/groups/index.d.ts +59 -0
- package/dist/groups/index.js +89 -0
- package/dist/groups/index.js.map +1 -1
- package/dist/groups/membershipRevision.d.ts +19 -0
- package/dist/groups/membershipRevision.js +29 -0
- package/dist/groups/membershipRevision.js.map +1 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/dist/jobs/jobOps.js +45 -2
- package/dist/jobs/jobOps.js.map +1 -1
- package/dist/pipelines/index.d.ts +28 -5
- package/dist/pipelines/index.js +110 -48
- package/dist/pipelines/index.js.map +1 -1
- package/dist/pipelines/invocation.d.ts +80 -0
- package/dist/pipelines/invocation.js +290 -0
- package/dist/pipelines/invocation.js.map +1 -0
- package/dist/pipelines/manifest.d.ts +102 -0
- package/dist/pipelines/manifest.js +204 -0
- package/dist/pipelines/manifest.js.map +1 -0
- package/dist/plugins/index.d.ts +29 -0
- package/dist/plugins/index.js +51 -10
- package/dist/plugins/index.js.map +1 -1
- package/dist/plugins/internal/plugin_executeNewFeed.d.ts +0 -14
- package/dist/plugins/internal/plugin_executeNewFeed.js +3 -3
- package/dist/plugins/internal/plugin_executeNewFeed.js.map +1 -1
- package/dist/plugins/plugin_register.js +5 -5
- package/dist/plugins/plugin_register.js.map +1 -1
- package/dist/plugins/store_import.js +1 -1
- package/dist/plugins/store_import.js.map +1 -1
- package/dist/retrieve/watch.d.ts +114 -0
- package/dist/retrieve/watch.js +360 -0
- package/dist/retrieve/watch.js.map +1 -0
- package/dist/store/index.d.ts +17 -4
- package/dist/store/index.js +9 -4
- package/dist/store/index.js.map +1 -1
- package/dist/users/index.d.ts +36 -0
- package/dist/users/index.js +50 -0
- package/dist/users/index.js.map +1 -0
- package/dist/vfs/dispatcher.d.ts +11 -0
- package/dist/vfs/dispatcher.js +37 -6
- package/dist/vfs/dispatcher.js.map +1 -1
- package/dist/vfs/index.d.ts +1 -0
- package/dist/vfs/index.js +3 -0
- package/dist/vfs/index.js.map +1 -1
- package/dist/vfs/provider.d.ts +13 -0
- package/dist/vfs/providers/etc.d.ts +2 -0
- package/dist/vfs/providers/etc.js +41 -2
- package/dist/vfs/providers/etc.js.map +1 -1
- package/dist/vfs/providers/native.js +41 -7
- package/dist/vfs/providers/native.js.map +1 -1
- package/dist/vfs/providers/pacs.d.ts +13 -1
- package/dist/vfs/providers/pacs.js +86 -107
- package/dist/vfs/providers/pacs.js.map +1 -1
- package/dist/vfs/providers/pacsHelpers.js +9 -5
- package/dist/vfs/providers/pacsHelpers.js.map +1 -1
- package/dist/vfs/providers/proc.d.ts +61 -6
- package/dist/vfs/providers/proc.js +445 -100
- package/dist/vfs/providers/proc.js.map +1 -1
- package/package.json +11 -8
package/dist/plugins/index.d.ts
CHANGED
|
@@ -40,6 +40,18 @@ export interface PluginSearchOptions {
|
|
|
40
40
|
id?: string;
|
|
41
41
|
[key: string]: unknown;
|
|
42
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* README content together with source metadata needed by presentation layers.
|
|
45
|
+
*
|
|
46
|
+
* @property content - Original README text.
|
|
47
|
+
* @property format - Markup format inferred from the source filename.
|
|
48
|
+
* @property sourceUrl - Exact URL from which the README was fetched.
|
|
49
|
+
*/
|
|
50
|
+
export interface PluginReadmeDocument {
|
|
51
|
+
content: string;
|
|
52
|
+
format: 'markdown' | 'rst';
|
|
53
|
+
sourceUrl: string;
|
|
54
|
+
}
|
|
43
55
|
/**
|
|
44
56
|
* Converts a Dictionary to CLI-style parameter string.
|
|
45
57
|
*
|
|
@@ -74,6 +86,23 @@ export declare function plugins_searchableToIDs(searchable: string | Searchable)
|
|
|
74
86
|
* @returns A Promise resolving to the README content as a string, or null if no README is found or accessible.
|
|
75
87
|
*/
|
|
76
88
|
export declare function pluginMeta_readmeContentFetch(repoUrl: string): Promise<string | null>;
|
|
89
|
+
/**
|
|
90
|
+
* Fetch a README while retaining its source URL and markup format.
|
|
91
|
+
*
|
|
92
|
+
* @param repoUrl - The base URL of the plugin's Git repository.
|
|
93
|
+
* @returns README content and format metadata, or null when none is reachable.
|
|
94
|
+
*/
|
|
95
|
+
export declare function pluginReadme_fetchFromRepository(repoUrl: string): Promise<PluginReadmeDocument | null>;
|
|
96
|
+
/**
|
|
97
|
+
* Fetch the README for an installed plugin using its repository metadata.
|
|
98
|
+
*
|
|
99
|
+
* `public_repo` is the canonical source. `documentation` remains a fallback
|
|
100
|
+
* for older CUBE records which stored the repository URL in that field.
|
|
101
|
+
*
|
|
102
|
+
* @param pluginId - The installed plugin ID.
|
|
103
|
+
* @returns README content and format metadata, or null.
|
|
104
|
+
*/
|
|
105
|
+
export declare function pluginReadmeDocument_fetch(pluginId: string): Promise<PluginReadmeDocument | null>;
|
|
77
106
|
/**
|
|
78
107
|
* Retrieve the documentation URL for a specific plugin ID.
|
|
79
108
|
*
|
package/dist/plugins/index.js
CHANGED
|
@@ -29,6 +29,8 @@ exports.dictionary_toCLI = dictionary_toCLI;
|
|
|
29
29
|
exports.plugin_run = plugin_run;
|
|
30
30
|
exports.plugins_searchableToIDs = plugins_searchableToIDs;
|
|
31
31
|
exports.pluginMeta_readmeContentFetch = pluginMeta_readmeContentFetch;
|
|
32
|
+
exports.pluginReadme_fetchFromRepository = pluginReadme_fetchFromRepository;
|
|
33
|
+
exports.pluginReadmeDocument_fetch = pluginReadmeDocument_fetch;
|
|
32
34
|
exports.pluginMeta_documentationUrlGet = pluginMeta_documentationUrlGet;
|
|
33
35
|
exports.pluginMeta_pluginIDFromSearch = pluginMeta_pluginIDFromSearch;
|
|
34
36
|
exports.plugin_delete = plugin_delete;
|
|
@@ -114,9 +116,7 @@ function dictionary_toCLI(params) {
|
|
|
114
116
|
*/
|
|
115
117
|
async function plugin_run(searchable, parameters) {
|
|
116
118
|
const chrisPlugin = new cumin_1.ChRISPlugin();
|
|
117
|
-
|
|
118
|
-
const paramsString = dictionary_toCLI(parameters);
|
|
119
|
-
return await chrisPlugin.plugin_run(searchable, paramsString);
|
|
119
|
+
return await chrisPlugin.plugin_run(searchable, parameters);
|
|
120
120
|
}
|
|
121
121
|
/**
|
|
122
122
|
* Resolve a searchable plugin string to a list of plugin IDs.
|
|
@@ -142,6 +142,16 @@ async function plugins_searchableToIDs(searchable) {
|
|
|
142
142
|
* @returns A Promise resolving to the README content as a string, or null if no README is found or accessible.
|
|
143
143
|
*/
|
|
144
144
|
async function pluginMeta_readmeContentFetch(repoUrl) {
|
|
145
|
+
const document = await pluginReadme_fetchFromRepository(repoUrl);
|
|
146
|
+
return document?.content ?? null;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Fetch a README while retaining its source URL and markup format.
|
|
150
|
+
*
|
|
151
|
+
* @param repoUrl - The base URL of the plugin's Git repository.
|
|
152
|
+
* @returns README content and format metadata, or null when none is reachable.
|
|
153
|
+
*/
|
|
154
|
+
async function pluginReadme_fetchFromRepository(repoUrl) {
|
|
145
155
|
const readmeUrls = [
|
|
146
156
|
`${repoUrl}/raw/master/README.md`,
|
|
147
157
|
`${repoUrl}/raw/master/README.rst`,
|
|
@@ -152,11 +162,45 @@ async function pluginMeta_readmeContentFetch(repoUrl) {
|
|
|
152
162
|
try {
|
|
153
163
|
const response = await axios_1.default.get(url);
|
|
154
164
|
if (response.status === 200) {
|
|
155
|
-
return
|
|
165
|
+
return {
|
|
166
|
+
content: String(response.data),
|
|
167
|
+
format: url.endsWith('.rst') ? 'rst' : 'markdown',
|
|
168
|
+
sourceUrl: url,
|
|
169
|
+
};
|
|
156
170
|
}
|
|
157
171
|
}
|
|
158
172
|
catch (error) {
|
|
159
|
-
//
|
|
173
|
+
// Deliberate absorption, adjudicated 2026-08: candidate README URLs are
|
|
174
|
+
// expected to 404 (main vs master, .md vs .rst); each miss falls through
|
|
175
|
+
// to the next candidate and an all-miss returns null, which callers
|
|
176
|
+
// render as "no README".
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
return null;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Fetch the README for an installed plugin using its repository metadata.
|
|
183
|
+
*
|
|
184
|
+
* `public_repo` is the canonical source. `documentation` remains a fallback
|
|
185
|
+
* for older CUBE records which stored the repository URL in that field.
|
|
186
|
+
*
|
|
187
|
+
* @param pluginId - The installed plugin ID.
|
|
188
|
+
* @returns README content and format metadata, or null.
|
|
189
|
+
*/
|
|
190
|
+
async function pluginReadmeDocument_fetch(pluginId) {
|
|
191
|
+
const chrisPlugin = new cumin_1.ChRISPlugin();
|
|
192
|
+
const query = await chrisPlugin.pluginData_getFromSearch({ search: `id: ${pluginId}` }, ['public_repo', 'documentation']);
|
|
193
|
+
if (!query || !query.hits.length) {
|
|
194
|
+
return null;
|
|
195
|
+
}
|
|
196
|
+
const metadata = query.hits[0];
|
|
197
|
+
const repositoryUrls = [metadata.public_repo, metadata.documentation]
|
|
198
|
+
.filter((url) => typeof url === 'string' && url.trim().length > 0)
|
|
199
|
+
.filter((url, index, urls) => urls.indexOf(url) === index);
|
|
200
|
+
for (const repositoryUrl of repositoryUrls) {
|
|
201
|
+
const document = await pluginReadme_fetchFromRepository(repositoryUrl.replace(/\/$/, ''));
|
|
202
|
+
if (document) {
|
|
203
|
+
return document;
|
|
160
204
|
}
|
|
161
205
|
}
|
|
162
206
|
return null;
|
|
@@ -233,11 +277,8 @@ async function plugins_overview() {
|
|
|
233
277
|
* @returns A Promise resolving to the README content or null.
|
|
234
278
|
*/
|
|
235
279
|
async function plugin_readme(pluginId) {
|
|
236
|
-
const
|
|
237
|
-
|
|
238
|
-
return null;
|
|
239
|
-
}
|
|
240
|
-
return await pluginMeta_readmeContentFetch(docUrl);
|
|
280
|
+
const document = await pluginReadmeDocument_fetch(pluginId);
|
|
281
|
+
return document?.content ?? null;
|
|
241
282
|
}
|
|
242
283
|
// Re-export other utility functions or classes if needed, following the RPN style.
|
|
243
284
|
__exportStar(require("./plugin_register.js"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/plugins/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;AAyBH,oCAQC;AAQD,0CAIC;AAOD,4CASC;AAQD,oDAQC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/plugins/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;AAyBH,oCAQC;AAQD,0CAIC;AAOD,4CASC;AAQD,oDAQC;AAiCD,4CAQC;AAWD,gCAGC;AAQD,0DAOC;AAWD,sEAGC;AAQD,4EA0BC;AAWD,gEAsBC;AAQD,wEAUC;AAWD,sEAiBC;AAQD,sCAQC;AAQD,4CAEC;AAQD,sCAGC;AArTD,yCAYuB;AACvB,kDAA0B;AAE1B,8BAA8B;AAE9B;;;;;GAKG;AACI,KAAK,UAAU,YAAY,CAAC,OAAoB;IACrD,MAAM,WAAW,GAAqB,IAAI,wBAAgB,EAAE,CAAC;IAE7D,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,MAAM,WAAW,CAAC,KAAK,CAAC,gCAAgC,CAAC,OAAO,CAAC,CAAC;AAC3E,CAAC;AAED;;;;;GAKG;AACI,KAAK,UAAU,eAAe,CAAC,UAAuB,EAAE;IAC7D,MAAM,WAAW,GAAqB,IAAI,wBAAgB,EAAE,CAAC;IAC7D,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EAAE,CAAC;QAC9C,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACd,kBAAU,CAAC,UAAU,CAAC,SAAS,EAAE,sCAAsC,OAAO,CAAC,MAAM,cAAc,KAAK,4BAA4B,CAAC,CAAC;QACtI,OAAO,IAAI,CAAC,CAAC,2CAA2C;IAC1D,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;GAKG;AACI,KAAK,UAAU,aAAa,CAAC,EAAU;IAC5C,MAAM,WAAW,GAAqB,IAAI,wBAAgB,EAAE,CAAC;IAE7D,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,MAAM,WAAW,CAAC,KAAK,CAAC,mBAAmB,CAAC,EAAE,CAAC,CAAC;AACzD,CAAC;AAED;;;;;GAKG;AACI,KAAK,UAAU,gBAAgB;IACpC,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;AAC3B,CAAC;AAED;;;;;GAKG;AACI,KAAK,UAAU,aAAa,CAAC,QAAgB;IAClD,MAAM,QAAQ,GAAgC,MAAM,0BAA0B,CAAC,QAAQ,CAAC,CAAC;IACzF,OAAO,QAAQ,EAAE,OAAO,IAAI,IAAI,CAAC;AACnC,CAAC;AAED,mFAAmF;AACnF,uDAAqC;AACrC,mDAAiC;AACjC,oDAAkC;AAClC,6DAA2C"}
|
|
@@ -4,20 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { Dictionary } from '@fnndsc/cumin';
|
|
6
6
|
import { PluginExecutionResult } from '../plugin_executeInPlace.js';
|
|
7
|
-
/**
|
|
8
|
-
* Result of creating a new feed by executing a plugin.
|
|
9
|
-
*/
|
|
10
|
-
export interface FeedCreationResult {
|
|
11
|
-
id: number;
|
|
12
|
-
name: string;
|
|
13
|
-
owner_username: string;
|
|
14
|
-
pluginInstance: {
|
|
15
|
-
data: {
|
|
16
|
-
id: number;
|
|
17
|
-
[key: string]: unknown;
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
7
|
/**
|
|
22
8
|
* Handles the "new feed" execution path.
|
|
23
9
|
* Creates a feed, runs dircopy, then runs the target plugin.
|
|
@@ -60,9 +60,9 @@ async function plugin_executeNewFeed(pluginName, pluginParams, contextParams, cw
|
|
|
60
60
|
cumin_1.errorStack.stack_push('error', 'pl-dircopy not found. Cannot create feeds.');
|
|
61
61
|
return null;
|
|
62
62
|
}
|
|
63
|
-
const feedResult =
|
|
64
|
-
|
|
65
|
-
})
|
|
63
|
+
const feedResult = await (0, index_js_1.feed_create)([cwd], {
|
|
64
|
+
title: feedTitle,
|
|
65
|
+
});
|
|
66
66
|
if (!feedResult) {
|
|
67
67
|
cumin_1.errorStack.stack_push('error', 'Failed to create feed');
|
|
68
68
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin_executeNewFeed.js","sourceRoot":"","sources":["../../../src/plugins/internal/plugin_executeNewFeed.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"plugin_executeNewFeed.js","sourceRoot":"","sources":["../../../src/plugins/internal/plugin_executeNewFeed.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,sDAwDC;AAjFD;;;GAGG;AACH,yCAIuB;AACvB,mDAA4E;AAC5E,0CAAyC;AACzC,2CAA6B;AAG7B;;;;;;;;;;GAUG;AACI,KAAK,UAAU,qBAAqB,CACzC,UAAkB,EAClB,YAAwB,EACxB,aAAyB,EACzB,GAAW,EACX,UAAoB;IAEpB,MAAM,SAAS,GAAY,aAAa,CAAC,UAAqB,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;IACrF,MAAM,aAAa,GAAkB,IAAA,8BAAsB,EAAC,UAAU,CAAC,CAAC;IAExE,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,kBAAU,CAAC,UAA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,UAAU;QACV,QAAQ,EAAE,iBAAiB;KAC5B,CAAC;AACJ,CAAC"}
|
|
@@ -42,7 +42,7 @@ async function plugin_registerWithAdmin(pluginData, computeResources = ['host'],
|
|
|
42
42
|
}
|
|
43
43
|
const result = await chrisPlugin.plugin_registerWithAdmin(pluginData, computeResources, adminToken);
|
|
44
44
|
if (result) {
|
|
45
|
-
|
|
45
|
+
(0, cumin_1.runtimeOutput_data)(`Plugin '${result.name}' registered successfully.\n`);
|
|
46
46
|
return result;
|
|
47
47
|
}
|
|
48
48
|
return null;
|
|
@@ -62,7 +62,7 @@ async function plugin_registerWithAdmin(pluginData, computeResources = ['host'],
|
|
|
62
62
|
async function plugin_register(pluginData, computeResources) {
|
|
63
63
|
const result = await (0, cumin_1.plugin_registerDirect)(pluginData, computeResources);
|
|
64
64
|
if (result.ok) {
|
|
65
|
-
|
|
65
|
+
(0, cumin_1.runtimeOutput_data)(`Plugin '${result.value.name}' registered successfully.\n`);
|
|
66
66
|
return result.value;
|
|
67
67
|
}
|
|
68
68
|
// Error already pushed to errorStack by cumin
|
|
@@ -98,7 +98,7 @@ async function plugin_assignToComputeResources(pluginId, computeResources) {
|
|
|
98
98
|
// Determine new resources to add (avoid duplicates)
|
|
99
99
|
const newResources = computeResources.filter((name) => !currentResources.includes(name));
|
|
100
100
|
if (newResources.length === 0) {
|
|
101
|
-
|
|
101
|
+
(0, cumin_1.runtimeOutput_data)(`Plugin already assigned to: ${computeResources.join(', ')}\n`);
|
|
102
102
|
return true;
|
|
103
103
|
}
|
|
104
104
|
// Combine all resources (cumulative)
|
|
@@ -106,8 +106,8 @@ async function plugin_assignToComputeResources(pluginId, computeResources) {
|
|
|
106
106
|
// Note: @fnndsc/chrisapi doesn't directly expose compute resource modification
|
|
107
107
|
// We would need to use admin API to modify plugin compute resources
|
|
108
108
|
// For now, this is a placeholder that logs the action
|
|
109
|
-
|
|
110
|
-
|
|
109
|
+
(0, cumin_1.runtimeOutput_data)(`Adding plugin to compute resources: ${newResources.join(', ')}\n`);
|
|
110
|
+
(0, cumin_1.runtimeOutput_data)(`Full resource list: ${allResources.join(', ')}\n`);
|
|
111
111
|
// TODO: Implement actual compute resource assignment via admin API
|
|
112
112
|
cumin_1.errorStack.stack_push('warning', 'Compute resource assignment not fully implemented. Plugin may need manual assignment.');
|
|
113
113
|
return true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin_register.js","sourceRoot":"","sources":["../../src/plugins/plugin_register.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAkCH,4DAwCC;AAcD,0CAgBC;AAQD,gDAWC;AAWD,0EAwCC;AA5KD,
|
|
1
|
+
{"version":3,"file":"plugin_register.js","sourceRoot":"","sources":["../../src/plugins/plugin_register.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAkCH,4DAwCC;AAcD,0CAgBC;AAQD,gDAWC;AAWD,0EAwCC;AA5KD,yCAAmH;AAqBnH;;;;;;;;;;GAUG;AACI,KAAK,UAAU,wBAAwB,CAC5C,UAAkC,EAClC,mBAA6B,CAAC,MAAM,CAAC,EACrC,UAA6B;IAE7B,MAAM,WAAW,GAAgB,IAAI,mBAAW,EAAE,CAAC;IACnD,IAAI,UAA8B,CAAC;IAEnC,IAAI,UAAU,IAAI,UAAU,CAAC,QAAQ,IAAI,UAAU,CAAC,QAAQ,EAAE,CAAC;QAC7D,MAAM,MAAM,GAAkB,MAAM,WAAW,CAAC,UAAU,EAAE,CAAC;QAC7D,IAAI,MAAM,EAAE,CAAC;YACX,MAAM,OAAO,GAAW,MAAM,CAAC,GAAG,GAAG,aAAa,CAAC;YACnD,IAAI,CAAC;gBACH,MAAM,KAAK,GAAW,MAAM,cAAM,CAAC,YAAY,CAC7C,OAAO,EACP,UAAU,CAAC,QAAQ,EACnB,UAAU,CAAC,QAAQ,CACpB,CAAC;gBACF,IAAI,KAAK,EAAE,CAAC;oBACV,UAAU,GAAG,KAAK,CAAC;gBACrB,CAAC;YACH,CAAC;YAAC,OAAO,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66,7 +66,7 @@ async function plugin_importFromStore(storeUrl, pluginData, computeResources = [
|
|
|
66
66
|
pluginData.parameters = paramsResult.value;
|
|
67
67
|
}
|
|
68
68
|
else if (!paramsResult.ok) {
|
|
69
|
-
|
|
69
|
+
(0, cumin_1.runtimeOutput_err)(`Warning: Failed to fetch parameters from ${paramsLink.href}\n`);
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store_import.js","sourceRoot":"","sources":["../../src/plugins/store_import.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;AAwEH,wDAwFC;AA8GD,0DAEC;AA9QD,
|
|
1
|
+
{"version":3,"file":"store_import.js","sourceRoot":"","sources":["../../src/plugins/store_import.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;AAwEH,wDAwFC;AA8GD,0DAEC;AA9QD,yCAAoG;AA2BpG;;;GAGG;AACH,MAAM,sBAAsB,GAAa;IACvC,MAAM,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS;IAC9C,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM;IACtE,WAAW,EAAE,UAAU,EAAE,UAAU;IACnC,uBAAuB,EAAE,uBAAuB;IAChD,eAAe,EAAE,eAAe;IAChC,kBAAkB,EAAE,kBAAkB;IACtC,eAAe,EAAE,eAAe;IAChC,MAAM,EAAE,SAAS,EAAE,YAAY;CAChC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACI,KAAK,UAAU,sBAAsB,CAC1C,QAAgB,EAChB,UAAmC,EACnC,mBAA6B,CAAC,MAAM,CAAC,EACrC,UAA6B;IAE7B,MAAM,WAAW,GAAgB,IAAI,mBAAW,EAAE,CAAC;IAEnD,IAAI,CAAC,UAAU,CAAC,UAAU,IAAI,UAAU,CAAC,KAAK,EAAE,CAAC;QAC/C,MAAM,KAAK,GAAqB,UAAU,CAAC,KAA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AC;YACtB,OAAO,QAAQ,CAAC,QAAQ,CAAC,CAAC;YAE1B,IAAI,QAAQ,CAAC,MAAM,CAAC,IAAI,OAAO,QAAQ,CAAC,MAAM,CAAC,KAAK,QAAQ,EAAE,CAAC;gBAC7D,MAAM,OAAO,GAAW,QAAQ,CAAC,MAAM,CAAW,CAAC;gBACnD,IAAI,YAAY,CAAC,OAAO,CAAC,EAAE,CAAC;oBAC1B,QAAQ,CAAC,MAAM,CAAC,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;gBAC3C,CAAC;YACH,CAAC;YAED,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACxB,CAAC,CAAC,CAAC;IACL,CAAC;IAED,OAAO,IAAA,UAAE,EAAC,MAAM,CAAC,CAAC;AACpB,CAAC;AAED;;GAEG;AACH,SAAS,iBAAiB,CAAC,IAAa;IACtC,OAAO,CACL,OAAO,IAAI,KAAK,QAAQ;QACxB,IAAI,KAAK,IAAI;QACb,YAAY,IAAI,IAAI;QACpB,OAAQ,IAAuB,CAAC,UAAU,KAAK,QAAQ,CACxD,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACI,KAAK,UAAU,uBAAuB;IAC3C,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { type Client } from '@fnndsc/cumin';
|
|
2
|
+
/** Lifecycle states of one series retrieve. */
|
|
3
|
+
export type RetrieveStatus = 'pending' | 'pulling' | 'pulled' | 'stalled' | 'timeout' | 'error' | 'unfired';
|
|
4
|
+
/** Progress classification reported to event consumers. */
|
|
5
|
+
export type RetrieveProgressStatus = 'running' | 'done' | 'unconfirmed' | 'error' | 'stalled' | 'timeout';
|
|
6
|
+
/**
|
|
7
|
+
* Runtime state for a single series being retrieved.
|
|
8
|
+
*
|
|
9
|
+
* @property label - Display label for progress and summaries.
|
|
10
|
+
* @property seriesUID - DICOM SeriesInstanceUID.
|
|
11
|
+
* @property studyUID - DICOM StudyInstanceUID.
|
|
12
|
+
* @property pacsName - PACS identifier (`pacs_name` for LONK subscriptions).
|
|
13
|
+
* @property expectedFiles - File count from the originating query decode.
|
|
14
|
+
* @property syntheticQueryId - ID of the per-series synthetic PACSQuery.
|
|
15
|
+
* @property retrieveId - ID of the PACSRetrieve created for it.
|
|
16
|
+
* @property status - Current lifecycle status.
|
|
17
|
+
* @property actualFiles - Most recent file count from LONK progress updates.
|
|
18
|
+
* @property lastProgressFiles - `actualFiles` at the last progress tick (stall detection).
|
|
19
|
+
* @property lastProgressTime - Timestamp of the last progress tick.
|
|
20
|
+
* @property startTime - Timestamp when the retrieve was fired.
|
|
21
|
+
* @property lonkConfirmed - True only after an explicit LONK `done` or a storage confirmation.
|
|
22
|
+
* @property cubePathDir - CUBE folder the series landed in (resolved post-pull).
|
|
23
|
+
*/
|
|
24
|
+
export interface RetrieveTask {
|
|
25
|
+
label: string;
|
|
26
|
+
seriesUID: string;
|
|
27
|
+
studyUID: string;
|
|
28
|
+
pacsName: string;
|
|
29
|
+
expectedFiles: number;
|
|
30
|
+
syntheticQueryId: number | null;
|
|
31
|
+
retrieveId: number | null;
|
|
32
|
+
status: RetrieveStatus;
|
|
33
|
+
actualFiles: number;
|
|
34
|
+
lastProgressFiles: number;
|
|
35
|
+
lastProgressTime: number;
|
|
36
|
+
startTime: number;
|
|
37
|
+
lonkConfirmed: boolean;
|
|
38
|
+
cubePathDir: string | null;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Consumer callbacks for engine progress.
|
|
42
|
+
*
|
|
43
|
+
* @property task - One series changed state or progressed.
|
|
44
|
+
* @property retryRound - A refire round for unconfirmed series is starting.
|
|
45
|
+
*/
|
|
46
|
+
export interface RetrieveWatchEvents {
|
|
47
|
+
task?: (task: RetrieveTask, status: RetrieveProgressStatus, phase: 'watching' | 'retrying') => void;
|
|
48
|
+
retryRound?: (attempt: number, retryMax: number, count: number) => void;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Builds a fresh retrieve task from series identity facts.
|
|
52
|
+
*
|
|
53
|
+
* @param info - Label, UIDs, PACS name, and expected file count.
|
|
54
|
+
* @returns A pending task ready for {@link retrieve_fireAndWatch}.
|
|
55
|
+
*/
|
|
56
|
+
export declare function retrieveTask_make(info: {
|
|
57
|
+
label: string;
|
|
58
|
+
seriesUID: string;
|
|
59
|
+
studyUID: string;
|
|
60
|
+
pacsName: string;
|
|
61
|
+
expectedFiles: number;
|
|
62
|
+
}): RetrieveTask;
|
|
63
|
+
/**
|
|
64
|
+
* Classifies a task's state for progress reporting.
|
|
65
|
+
*
|
|
66
|
+
* @param task - The task to classify.
|
|
67
|
+
* @returns The progress status consumers render.
|
|
68
|
+
*/
|
|
69
|
+
export declare function retrieveProgress_classify(task: RetrieveTask): RetrieveProgressStatus;
|
|
70
|
+
/**
|
|
71
|
+
* Marks tasks whose series are already fully registered in CUBE as pulled,
|
|
72
|
+
* so firing skips them. This is what makes a retrieve idempotent: re-running
|
|
73
|
+
* the same request after a partial failure fetches only the missing series.
|
|
74
|
+
*
|
|
75
|
+
* @param tasks - All tasks; complete ones are mutated to pulled.
|
|
76
|
+
* @returns How many tasks were marked complete and skipped.
|
|
77
|
+
*/
|
|
78
|
+
export declare function retrieveTasks_skipComplete(tasks: RetrieveTask[]): Promise<number>;
|
|
79
|
+
/**
|
|
80
|
+
* Fires retrieves for tasks (bounded, retried) without watching: the
|
|
81
|
+
* fire-and-exit path (`pull --nowait`). Tasks that could not fire are left
|
|
82
|
+
* in the `unfired` state.
|
|
83
|
+
*
|
|
84
|
+
* @param tasks - Tasks to fire.
|
|
85
|
+
* @param pacsserver - Resolved PACS server identifier.
|
|
86
|
+
*/
|
|
87
|
+
export declare function retrieveTasks_fire(tasks: RetrieveTask[], pacsserver: string): Promise<void>;
|
|
88
|
+
/**
|
|
89
|
+
* Opens a LONK WebSocket, fires retrieves for the tasks, and blocks until
|
|
90
|
+
* every task reaches a terminal state. Mutates each task's status,
|
|
91
|
+
* actualFiles, and lonkConfirmed; reports progress through the events.
|
|
92
|
+
*
|
|
93
|
+
* @param tasks - Tasks to subscribe, fire, and watch.
|
|
94
|
+
* @param pacsserver - Resolved PACS server identifier.
|
|
95
|
+
* @param client - Authenticated ChRIS API client (for the LONK token).
|
|
96
|
+
* @param events - Progress callbacks.
|
|
97
|
+
* @param phase - Phase tag passed through to task events.
|
|
98
|
+
* @returns Number of tasks whose retrieve could not be fired.
|
|
99
|
+
*/
|
|
100
|
+
export declare function retrieve_fireAndWatch(tasks: RetrieveTask[], pacsserver: string, client: Client, events?: RetrieveWatchEvents, phase?: 'watching' | 'retrying'): Promise<number>;
|
|
101
|
+
/**
|
|
102
|
+
* Confirms unconfirmed series against CUBE storage and refires the rest, up
|
|
103
|
+
* to `retryMax` rounds; series still unconfirmed afterwards are marked
|
|
104
|
+
* errored. This closes the gap between a lost LONK confirmation (cosmetic)
|
|
105
|
+
* and a retrieve that genuinely never delivered (real loss).
|
|
106
|
+
*
|
|
107
|
+
* @param allTasks - All tasks from the initial watch.
|
|
108
|
+
* @param retryMax - Maximum refire rounds.
|
|
109
|
+
* @param pacsserver - The PACS server identifier.
|
|
110
|
+
* @param client - The connected ChRIS client.
|
|
111
|
+
* @param events - Progress callbacks.
|
|
112
|
+
* @returns The number of additional firing errors incurred.
|
|
113
|
+
*/
|
|
114
|
+
export declare function retrieve_confirmLoop(allTasks: RetrieveTask[], retryMax: number, pacsserver: string, client: Client, events?: RetrieveWatchEvents): Promise<number>;
|