@fnndsc/brasa 0.2.0 → 0.4.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/builtins/fs/cat.js +3 -63
- package/dist/builtins/fs/cat.js.map +1 -1
- package/dist/builtins/fs/download.d.ts +3 -1
- package/dist/builtins/fs/download.js +10 -7
- package/dist/builtins/fs/download.js.map +1 -1
- package/dist/builtins/fs/edit.d.ts +3 -1
- package/dist/builtins/fs/edit.js +17 -23
- package/dist/builtins/fs/edit.js.map +1 -1
- package/dist/builtins/fs/pull.d.ts +2 -1
- package/dist/builtins/fs/pull.js +31 -27
- package/dist/builtins/fs/pull.js.map +1 -1
- package/dist/builtins/fs/upload.d.ts +3 -1
- package/dist/builtins/fs/upload.js +10 -8
- package/dist/builtins/fs/upload.js.map +1 -1
- package/dist/builtins/help.d.ts +3 -12
- package/dist/builtins/help.js +3 -21
- package/dist/builtins/help.js.map +1 -1
- package/dist/builtins/net/connect.d.ts +3 -2
- package/dist/builtins/net/connect.js +6 -8
- package/dist/builtins/net/connect.js.map +1 -1
- package/dist/builtins/net/pacs.d.ts +4 -1
- package/dist/builtins/net/pacs.js +38 -39
- package/dist/builtins/net/pacs.js.map +1 -1
- package/dist/builtins/res/pipeline.d.ts +2 -1
- package/dist/builtins/res/pipeline.js +53 -53
- package/dist/builtins/res/pipeline.js.map +1 -1
- package/dist/builtins/store.d.ts +3 -1
- package/dist/builtins/store.js +19 -35
- package/dist/builtins/store.js.map +1 -1
- package/dist/builtins/sys/version.d.ts +6 -4
- package/dist/builtins/sys/version.js +6 -4
- package/dist/builtins/sys/version.js.map +1 -1
- package/dist/core/chiliDelegate.d.ts +28 -7
- package/dist/core/chiliDelegate.js +47 -11
- package/dist/core/chiliDelegate.js.map +1 -1
- package/dist/core/dispatch.js +85 -107
- package/dist/core/dispatch.js.map +1 -1
- package/dist/core/sink.d.ts +57 -0
- package/dist/core/sink.js +77 -0
- package/dist/core/sink.js.map +1 -1
- package/dist/core/version.d.ts +34 -5
- package/dist/core/version.js +109 -40
- package/dist/core/version.js.map +1 -1
- package/package.json +2 -2
|
@@ -13,11 +13,12 @@
|
|
|
13
13
|
* @module
|
|
14
14
|
*/
|
|
15
15
|
import chalk from 'chalk';
|
|
16
|
-
import { chrisContext, errorStack, pipeline_resolve, } from '@fnndsc/cumin';
|
|
16
|
+
import { chrisContext, errorStack, pipeline_resolve, envelope_ok, envelope_error, } from '@fnndsc/cumin';
|
|
17
17
|
import { pipelines_list, pipeline_run, pipeline_sourceGet, } from '@fnndsc/salsa';
|
|
18
18
|
import { pipelineFields_fetch } from '@fnndsc/chili/commands/pipeline/fields.js';
|
|
19
|
-
import {
|
|
20
|
-
import { args_checkHasHelpFlag,
|
|
19
|
+
import { table_render } from '@fnndsc/chili/screen/screen.js';
|
|
20
|
+
import { args_checkHasHelpFlag, help_render } from '../help.js';
|
|
21
|
+
import { sink_get, sink_dataLine, sink_errLine } from '../../core/sink.js';
|
|
21
22
|
import { pipelineRunArgs_parse } from './pipeline.args.js';
|
|
22
23
|
import { session } from '../../session/index.js';
|
|
23
24
|
/**
|
|
@@ -28,33 +29,33 @@ import { session } from '../../session/index.js';
|
|
|
28
29
|
async function pipelineNodes_print(pipelineId) {
|
|
29
30
|
const client = await session.connection.client_get();
|
|
30
31
|
if (!client) {
|
|
31
|
-
|
|
32
|
+
sink_errLine(chalk.red('pipeline info: not connected to ChRIS'));
|
|
32
33
|
return;
|
|
33
34
|
}
|
|
34
35
|
try {
|
|
35
36
|
const pipelineObj = await client.getPipeline(pipelineId);
|
|
36
37
|
if (!pipelineObj) {
|
|
37
|
-
|
|
38
|
+
sink_errLine(chalk.red(`pipeline info: pipeline ${pipelineId} not found`));
|
|
38
39
|
return;
|
|
39
40
|
}
|
|
40
41
|
const pipingsResponse = await pipelineObj.getPluginPipings({ limit: 1000 });
|
|
41
42
|
const pipings = pipingsResponse.getItems();
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
sink_dataLine(chalk.bold.blue('\nNodes:\n'));
|
|
44
|
+
sink_dataLine(` ${chalk.bold('ID'.padEnd(6))}${chalk.bold('Title'.padEnd(30))}${chalk.bold('Plugin')}`);
|
|
45
|
+
sink_dataLine(` ${chalk.gray('─'.repeat(70))}`);
|
|
45
46
|
for (const piping of pipings) {
|
|
46
47
|
const d = piping.data;
|
|
47
48
|
const id = String(d.id ?? '').padEnd(6);
|
|
48
49
|
const title = String(d.title ?? '(untitled)').padEnd(30);
|
|
49
50
|
const plugin = String(d.plugin_name ?? '') + ' v' + String(d.plugin_version ?? '');
|
|
50
51
|
const previous = d.previous_id ? chalk.gray(` ← node ${d.previous_id}`) : chalk.gray(' (root)');
|
|
51
|
-
|
|
52
|
+
sink_dataLine(` ${chalk.cyan(id)}${chalk.white(title)}${chalk.yellow(plugin)}${previous}`);
|
|
52
53
|
}
|
|
53
|
-
|
|
54
|
+
sink_dataLine('');
|
|
54
55
|
}
|
|
55
56
|
catch (error) {
|
|
56
57
|
const msg = error instanceof Error ? error.message : String(error);
|
|
57
|
-
|
|
58
|
+
sink_errLine(chalk.red(`pipeline info: ${msg}`));
|
|
58
59
|
}
|
|
59
60
|
}
|
|
60
61
|
/**
|
|
@@ -66,20 +67,20 @@ async function pipelineList_handle(args) {
|
|
|
66
67
|
const search = args[1];
|
|
67
68
|
const data = await pipelines_list(search);
|
|
68
69
|
if (!data || data.tableData.length === 0) {
|
|
69
|
-
|
|
70
|
+
sink_dataLine(chalk.yellow('No pipelines registered.'));
|
|
70
71
|
return;
|
|
71
72
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
sink_dataLine('');
|
|
74
|
+
sink_dataLine(` ${chalk.bold('ID'.padEnd(6))}${chalk.bold('Name'.padEnd(40))}${chalk.bold('Category'.padEnd(16))}${chalk.bold('Authors')}`);
|
|
75
|
+
sink_dataLine(` ${chalk.gray('─'.repeat(80))}`);
|
|
75
76
|
for (const row of data.tableData) {
|
|
76
77
|
const id = String(row.id ?? '').padEnd(6);
|
|
77
78
|
const name = String(row.name ?? '').padEnd(40);
|
|
78
79
|
const cat = String(row.category ?? '').padEnd(16);
|
|
79
80
|
const authors = String(row.authors ?? '');
|
|
80
|
-
|
|
81
|
+
sink_dataLine(` ${chalk.cyan(id)}${chalk.magenta(name)}${chalk.gray(cat)}${chalk.gray(authors)}`);
|
|
81
82
|
}
|
|
82
|
-
|
|
83
|
+
sink_dataLine('');
|
|
83
84
|
}
|
|
84
85
|
/**
|
|
85
86
|
* Handles `pipeline info <name|id>`.
|
|
@@ -89,27 +90,27 @@ async function pipelineList_handle(args) {
|
|
|
89
90
|
async function pipelineInfo_handle(args) {
|
|
90
91
|
const nameOrId = args[1];
|
|
91
92
|
if (!nameOrId) {
|
|
92
|
-
|
|
93
|
+
sink_errLine(chalk.red('Usage: pipeline info <name|id>'));
|
|
93
94
|
process.exitCode = 1;
|
|
94
95
|
return;
|
|
95
96
|
}
|
|
96
97
|
const result = await pipeline_resolve(nameOrId);
|
|
97
98
|
if (!result.ok) {
|
|
98
99
|
const err = errorStack.stack_pop();
|
|
99
|
-
|
|
100
|
+
sink_errLine(chalk.red(`pipeline info: ${err?.message ?? 'not found'}`));
|
|
100
101
|
process.exitCode = 1;
|
|
101
102
|
return;
|
|
102
103
|
}
|
|
103
104
|
const p = result.value;
|
|
104
|
-
|
|
105
|
-
|
|
105
|
+
sink_dataLine('');
|
|
106
|
+
sink_dataLine(`${chalk.bold.magenta(p.name)} ${chalk.gray(`[id: ${p.id}]`)}`);
|
|
106
107
|
if (p.description)
|
|
107
|
-
|
|
108
|
+
sink_dataLine(chalk.white(` ${p.description}`));
|
|
108
109
|
if (p.authors)
|
|
109
|
-
|
|
110
|
+
sink_dataLine(chalk.gray(` Authors: ${p.authors}`));
|
|
110
111
|
if (p.category)
|
|
111
|
-
|
|
112
|
-
|
|
112
|
+
sink_dataLine(chalk.gray(` Category: ${p.category}`));
|
|
113
|
+
sink_dataLine(chalk.gray(` Locked: ${p.locked ? 'yes' : 'no'}`));
|
|
113
114
|
await pipelineNodes_print(p.id);
|
|
114
115
|
}
|
|
115
116
|
/**
|
|
@@ -124,14 +125,14 @@ async function pipelineRun_previousInstId(previousOverride) {
|
|
|
124
125
|
return previousOverride;
|
|
125
126
|
const contextStr = await chrisContext.ChRISplugin_get();
|
|
126
127
|
if (!contextStr) {
|
|
127
|
-
|
|
128
|
-
|
|
128
|
+
sink_errLine(chalk.red('pipeline run: no plugin instance in context.'));
|
|
129
|
+
sink_errLine(chalk.gray(' Navigate to a feed node first, or use --previous <id>'));
|
|
129
130
|
process.exitCode = 1;
|
|
130
131
|
return null;
|
|
131
132
|
}
|
|
132
133
|
const previousInstId = parseInt(contextStr, 10);
|
|
133
134
|
if (isNaN(previousInstId)) {
|
|
134
|
-
|
|
135
|
+
sink_errLine(chalk.red(`pipeline run: invalid context instance '${contextStr}'`));
|
|
135
136
|
process.exitCode = 1;
|
|
136
137
|
return null;
|
|
137
138
|
}
|
|
@@ -145,7 +146,7 @@ async function pipelineRun_previousInstId(previousOverride) {
|
|
|
145
146
|
async function pipelineRun_handle(args) {
|
|
146
147
|
const nameOrId = args[1];
|
|
147
148
|
if (!nameOrId) {
|
|
148
|
-
|
|
149
|
+
sink_errLine(chalk.red('Usage: pipeline run <name|id> [--compute <resource>] [--previous <inst_id>]'));
|
|
149
150
|
process.exitCode = 1;
|
|
150
151
|
return;
|
|
151
152
|
}
|
|
@@ -156,21 +157,21 @@ async function pipelineRun_handle(args) {
|
|
|
156
157
|
const pipelineResult = await pipeline_resolve(nameOrId);
|
|
157
158
|
if (!pipelineResult.ok) {
|
|
158
159
|
const err = errorStack.stack_pop();
|
|
159
|
-
|
|
160
|
+
sink_errLine(chalk.red(`pipeline run: ${err?.message ?? 'pipeline not found'}`));
|
|
160
161
|
process.exitCode = 1;
|
|
161
162
|
return;
|
|
162
163
|
}
|
|
163
|
-
|
|
164
|
+
sink_dataLine(chalk.gray(`Running pipeline '${pipelineResult.value.name}' on instance ${previousInstId}...`));
|
|
164
165
|
const runResult = await pipeline_run(nameOrId, previousInstId, computeOverride);
|
|
165
166
|
if (!runResult.ok) {
|
|
166
167
|
const err = errorStack.stack_pop();
|
|
167
|
-
|
|
168
|
+
sink_errLine(chalk.red(`pipeline run: ${err?.message ?? 'workflow creation failed'}`));
|
|
168
169
|
process.exitCode = 1;
|
|
169
170
|
return;
|
|
170
171
|
}
|
|
171
172
|
const { workflowId, pluginInstanceIds } = runResult.value;
|
|
172
|
-
|
|
173
|
-
|
|
173
|
+
sink_dataLine(chalk.green(`✓ Workflow ${workflowId} created — ${pluginInstanceIds.length} node(s) queued`));
|
|
174
|
+
sink_dataLine(chalk.gray(` Instance IDs: ${pluginInstanceIds.join(', ')}`));
|
|
174
175
|
}
|
|
175
176
|
/**
|
|
176
177
|
* Handles `pipeline source <name|id>`.
|
|
@@ -180,18 +181,18 @@ async function pipelineRun_handle(args) {
|
|
|
180
181
|
async function pipelineSource_handle(args) {
|
|
181
182
|
const nameOrId = args[1];
|
|
182
183
|
if (!nameOrId) {
|
|
183
|
-
|
|
184
|
+
sink_errLine(chalk.red('Usage: pipeline source <name|id>'));
|
|
184
185
|
process.exitCode = 1;
|
|
185
186
|
return;
|
|
186
187
|
}
|
|
187
188
|
const sourceResult = await pipeline_sourceGet(nameOrId);
|
|
188
189
|
if (!sourceResult.ok) {
|
|
189
190
|
const err = errorStack.stack_pop();
|
|
190
|
-
|
|
191
|
+
sink_errLine(chalk.red(`pipeline source: ${err?.message ?? 'source not found'}`));
|
|
191
192
|
process.exitCode = 1;
|
|
192
193
|
return;
|
|
193
194
|
}
|
|
194
|
-
|
|
195
|
+
sink_dataLine(sourceResult.value);
|
|
195
196
|
}
|
|
196
197
|
/**
|
|
197
198
|
* Handles `pipeline inspect`: lists available pipeline fields.
|
|
@@ -199,10 +200,10 @@ async function pipelineSource_handle(args) {
|
|
|
199
200
|
async function pipelineInspect_handle() {
|
|
200
201
|
const fields = await pipelineFields_fetch();
|
|
201
202
|
if (fields && fields.length > 0) {
|
|
202
|
-
|
|
203
|
+
sink_get().data_write(table_render(fields.map((f) => ({ field: f })), ['field'], { title: { title: 'Pipeline fields', justification: 'center' } }));
|
|
203
204
|
}
|
|
204
205
|
else {
|
|
205
|
-
|
|
206
|
+
sink_dataLine(chalk.gray('No fields found.'));
|
|
206
207
|
}
|
|
207
208
|
}
|
|
208
209
|
/**
|
|
@@ -212,41 +213,40 @@ async function pipelineInspect_handle() {
|
|
|
212
213
|
*/
|
|
213
214
|
export async function builtin_pipeline(args) {
|
|
214
215
|
if (args_checkHasHelpFlag(args, 'pipeline')) {
|
|
215
|
-
|
|
216
|
-
return;
|
|
216
|
+
return envelope_ok(help_render('pipeline'));
|
|
217
217
|
}
|
|
218
218
|
const subcommand = args[0];
|
|
219
219
|
if (!subcommand) {
|
|
220
220
|
const current = await chrisContext.ChRISplugin_get();
|
|
221
|
-
|
|
221
|
+
sink_dataLine(chalk.gray('Usage: pipeline <list|info|run|source> [args]'));
|
|
222
222
|
if (current) {
|
|
223
|
-
|
|
223
|
+
sink_dataLine(chalk.gray(` Current context node: instance ${current}`));
|
|
224
224
|
}
|
|
225
|
-
return;
|
|
225
|
+
return envelope_ok('');
|
|
226
226
|
}
|
|
227
227
|
switch (subcommand) {
|
|
228
228
|
case 'list':
|
|
229
229
|
await pipelineList_handle(args);
|
|
230
|
-
return;
|
|
230
|
+
return envelope_ok('');
|
|
231
231
|
case 'info':
|
|
232
232
|
await pipelineInfo_handle(args);
|
|
233
|
-
return;
|
|
233
|
+
return envelope_ok('');
|
|
234
234
|
case 'run':
|
|
235
235
|
await pipelineRun_handle(args);
|
|
236
|
-
return;
|
|
236
|
+
return envelope_ok('');
|
|
237
237
|
case 'source':
|
|
238
238
|
await pipelineSource_handle(args);
|
|
239
|
-
return;
|
|
239
|
+
return envelope_ok('');
|
|
240
240
|
case 'inspect':
|
|
241
241
|
await pipelineInspect_handle();
|
|
242
|
-
return;
|
|
242
|
+
return envelope_ok('');
|
|
243
243
|
case 'search':
|
|
244
|
-
|
|
245
|
-
return;
|
|
244
|
+
return builtin_pipeline(['list', args[1] ?? '']);
|
|
246
245
|
default:
|
|
247
|
-
|
|
248
|
-
|
|
246
|
+
sink_errLine(chalk.red(`pipeline: unknown subcommand '${subcommand}'`));
|
|
247
|
+
sink_dataLine(chalk.gray(' Subcommands: list, search, inspect, info, run, source'));
|
|
249
248
|
process.exitCode = 1;
|
|
249
|
+
return envelope_error('');
|
|
250
250
|
}
|
|
251
251
|
}
|
|
252
252
|
//# sourceMappingURL=pipeline.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline.js","sourceRoot":"","sources":["../../../src/builtins/res/pipeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,YAAY,EACZ,UAAU,EACV,gBAAgB,
|
|
1
|
+
{"version":3,"file":"pipeline.js","sourceRoot":"","sources":["../../../src/builtins/res/pipeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,YAAY,EACZ,UAAU,EACV,gBAAgB,EAEhB,WAAW,EACX,cAAc,GACf,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,cAAc,EACd,YAAY,EACZ,kBAAkB,GACnB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC3E,OAAO,EAAE,qBAAqB,EAA6B,MAAM,oBAAoB,CAAC;AACtF,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,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E,CAAC,CAAC;QACzB,KAAK,QAAQ;YACX,OAAO,gBAAgB,CAAC,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QACnD;YACE,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,iCAAiC,UAAU,GAAG,CAAC,CAAC,CAAC;YACxE,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,yDAAyD,CAAC,CAAC,CAAC;YACrF,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;YACrB,OAAO,cAAc,CAAC,EAAE,CAAC,CAAC;IAC9B,CAAC;AACH,CAAC"}
|
package/dist/builtins/store.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { type CommandEnvelope } from '@fnndsc/cumin';
|
|
1
2
|
/**
|
|
2
3
|
* Handles store commands.
|
|
3
4
|
*
|
|
4
5
|
* @param args - command arguments.
|
|
6
|
+
* @returns An envelope carrying the rendered store output.
|
|
5
7
|
*/
|
|
6
|
-
export declare function builtin_store(args: string[]): Promise<
|
|
8
|
+
export declare function builtin_store(args: string[]): Promise<CommandEnvelope>;
|
package/dist/builtins/store.js
CHANGED
|
@@ -8,18 +8,19 @@ import { store_listPlugins, store_searchPlugins } from '@fnndsc/chili/commands/s
|
|
|
8
8
|
import { grid_render, long_render } from '@fnndsc/chili/views/ls.js';
|
|
9
9
|
import { spinner } from '../lib/spinner.js';
|
|
10
10
|
import { plugin_addInteractive } from './res/plugin.js';
|
|
11
|
+
import { envelope_ok, envelope_error } from '@fnndsc/cumin';
|
|
11
12
|
import { DEFAULT_STORE_URL, storeUrl_get, storeUrl_isDefault, storeUrl_set, storeUrl_clear, storeConfig_persist, } from '../config/storeConfig.js';
|
|
12
13
|
/**
|
|
13
14
|
* Handles store commands.
|
|
14
15
|
*
|
|
15
16
|
* @param args - command arguments.
|
|
17
|
+
* @returns An envelope carrying the rendered store output.
|
|
16
18
|
*/
|
|
17
19
|
export async function builtin_store(args) {
|
|
18
20
|
const parsed = commandArgs_process(args);
|
|
19
21
|
const subcommand = parsed._[0];
|
|
20
22
|
if (!subcommand) {
|
|
21
|
-
|
|
22
|
-
return;
|
|
23
|
+
return envelope_ok(`${chalk.red("Usage: store <list|search|install> ...")}\n`);
|
|
23
24
|
}
|
|
24
25
|
const storeOptions = {
|
|
25
26
|
store: parsed.store
|
|
@@ -30,78 +31,61 @@ export async function builtin_store(args) {
|
|
|
30
31
|
const items = await store_listPlugins(storeOptions);
|
|
31
32
|
spinner.stop();
|
|
32
33
|
if (items.length === 0) {
|
|
33
|
-
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
// Use grid render by default, or long render if -l flag (handled by view options in future,
|
|
37
|
-
// but currently ls view helpers accept options).
|
|
38
|
-
// chell's ls uses args to parse flags. Here we have parsed args.
|
|
39
|
-
// parsed.l is boolean.
|
|
40
|
-
if (parsed.l) {
|
|
41
|
-
console.log(long_render(items, { human: !!parsed.h }));
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
console.log(grid_render(items));
|
|
34
|
+
return envelope_ok('No plugins found in store.\n');
|
|
45
35
|
}
|
|
36
|
+
// Use grid render by default, or long render if -l flag.
|
|
37
|
+
return envelope_ok(parsed.l ? `${long_render(items, { human: !!parsed.h })}\n` : `${grid_render(items)}\n`);
|
|
46
38
|
}
|
|
47
39
|
else if (subcommand === 'search') {
|
|
48
40
|
const query = parsed._[1];
|
|
49
41
|
if (!query) {
|
|
50
42
|
spinner.stop();
|
|
51
|
-
|
|
52
|
-
return;
|
|
43
|
+
return envelope_ok(`${chalk.red("Usage: store search <query>")}\n`);
|
|
53
44
|
}
|
|
54
45
|
const items = await store_searchPlugins(query, storeOptions);
|
|
55
46
|
spinner.stop();
|
|
56
47
|
if (items.length === 0) {
|
|
57
|
-
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
if (parsed.l) {
|
|
61
|
-
console.log(long_render(items, { human: !!parsed.h }));
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
64
|
-
console.log(grid_render(items));
|
|
48
|
+
return envelope_ok(`No plugins found matching '${query}'.\n`);
|
|
65
49
|
}
|
|
50
|
+
return envelope_ok(parsed.l ? `${long_render(items, { human: !!parsed.h })}\n` : `${grid_render(items)}\n`);
|
|
66
51
|
}
|
|
67
52
|
else if (subcommand === 'install') {
|
|
68
53
|
spinner.stop();
|
|
69
54
|
const installParsed = { ...parsed, _: [parsed._[0], parsed._[1]] };
|
|
70
|
-
await plugin_addInteractive(installParsed);
|
|
55
|
+
return await plugin_addInteractive(installParsed);
|
|
71
56
|
}
|
|
72
57
|
else if (subcommand === 'inspect') {
|
|
73
58
|
spinner.stop();
|
|
74
59
|
const current = storeUrl_get();
|
|
75
60
|
const isDefault = storeUrl_isDefault();
|
|
76
|
-
|
|
61
|
+
return envelope_ok(`${chalk.bold('Peer store URL:')} ${chalk.blue(current)}${isDefault ? chalk.gray(' (default)') : chalk.yellow(' (custom)')}\n`);
|
|
77
62
|
}
|
|
78
63
|
else if (subcommand === 'set') {
|
|
79
64
|
spinner.stop();
|
|
80
65
|
const url = parsed._[1];
|
|
81
66
|
if (!url) {
|
|
82
|
-
console.log(chalk.red('Usage: store set <url>'));
|
|
83
67
|
process.exitCode = 1;
|
|
84
|
-
return;
|
|
68
|
+
return envelope_error('', undefined, `${chalk.red('Usage: store set <url>')}\n`);
|
|
85
69
|
}
|
|
86
70
|
storeUrl_set(url);
|
|
87
71
|
await storeConfig_persist();
|
|
88
|
-
|
|
72
|
+
return envelope_ok(`${chalk.green(`Store URL set to: ${chalk.blue(url)}`)}\n`);
|
|
89
73
|
}
|
|
90
74
|
else if (subcommand === 'reset') {
|
|
91
75
|
spinner.stop();
|
|
92
76
|
storeUrl_clear();
|
|
93
77
|
await storeConfig_persist();
|
|
94
|
-
|
|
95
|
-
}
|
|
96
|
-
else {
|
|
97
|
-
spinner.stop();
|
|
98
|
-
console.log(chalk.red(`Unknown subcommand: ${subcommand}. Usage: store <list|search|install|inspect|set|reset>`));
|
|
78
|
+
return envelope_ok(`${chalk.green(`Store URL reset to default: ${chalk.blue(DEFAULT_STORE_URL)}`)}\n`);
|
|
99
79
|
}
|
|
80
|
+
spinner.stop();
|
|
81
|
+
process.exitCode = 1;
|
|
82
|
+
return envelope_error('', undefined, `${chalk.red(`Unknown subcommand: ${subcommand}. Usage: store <list|search|install|inspect|set|reset>`)}\n`);
|
|
100
83
|
}
|
|
101
84
|
catch (e) {
|
|
102
85
|
spinner.stop();
|
|
103
86
|
const msg = e instanceof Error ? e.message : String(e);
|
|
104
|
-
|
|
87
|
+
process.exitCode = 1;
|
|
88
|
+
return envelope_error('', undefined, `${chalk.red(`Store error: ${msg}`)}\n`);
|
|
105
89
|
}
|
|
106
90
|
}
|
|
107
91
|
//# sourceMappingURL=store.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../src/builtins/store.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,mBAAmB,EAAc,MAAM,YAAY,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC9F,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,cAAc,EACd,mBAAmB,GACpB,MAAM,0BAA0B,CAAC;AAElC
|
|
1
|
+
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../src/builtins/store.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,mBAAmB,EAAc,MAAM,YAAY,CAAC;A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D,OAAO,CAAC,IAAI,EAAE,CAAC;QACf,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QACrB,OAAO,cAAc,CAAC,EAAE,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC,GAAG,CAAC,uBAAuB,UAAU,wDAAwD,CAAC,IAAI,CAAC,CAAC;IACpJ,CAAC;IAAC,OAAO,CAAU,EAAE,CAAC;QACpB,OAAO,CAAC,IAAI,EAAE,CAAC;QACf,MAAM,GAAG,GAAW,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QAC/D,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QACrB,OAAO,cAAc,CAAC,EAAE,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC,GAAG,CAAC,gBAAgB,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;IAChF,CAAC;AACH,CAAC"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file Builtin version.
|
|
3
|
-
* Reports the
|
|
4
|
-
*
|
|
3
|
+
* Reports the mise stack versions (the chell surface, the brasa engine, its
|
|
4
|
+
* chili/salsa/cumin layers, and the calypso sibling surface) as a command
|
|
5
|
+
* envelope — the in-shell counterpart of `chell --version`.
|
|
5
6
|
*/
|
|
6
7
|
import { CommandEnvelope } from '@fnndsc/cumin';
|
|
7
8
|
/**
|
|
8
|
-
* Reports the version of chell and the
|
|
9
|
-
* report as `chell --version`,
|
|
9
|
+
* Reports the version of chell and the brasa engine, its layers, and the
|
|
10
|
+
* calypso sibling surface it runs with — the same report as `chell --version`,
|
|
11
|
+
* available from inside the shell.
|
|
10
12
|
*
|
|
11
13
|
* @param _args - Unused.
|
|
12
14
|
* @returns An envelope carrying the multi-line version report and a typed model
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file Builtin version.
|
|
3
|
-
* Reports the
|
|
4
|
-
*
|
|
3
|
+
* Reports the mise stack versions (the chell surface, the brasa engine, its
|
|
4
|
+
* chili/salsa/cumin layers, and the calypso sibling surface) as a command
|
|
5
|
+
* envelope — the in-shell counterpart of `chell --version`.
|
|
5
6
|
*/
|
|
6
7
|
import { envelope_ok } from '@fnndsc/cumin';
|
|
7
8
|
import { versionReport_build, versions_get } from '../../core/version.js';
|
|
8
9
|
/**
|
|
9
|
-
* Reports the version of chell and the
|
|
10
|
-
* report as `chell --version`,
|
|
10
|
+
* Reports the version of chell and the brasa engine, its layers, and the
|
|
11
|
+
* calypso sibling surface it runs with — the same report as `chell --version`,
|
|
12
|
+
* available from inside the shell.
|
|
11
13
|
*
|
|
12
14
|
* @param _args - Unused.
|
|
13
15
|
* @returns An envelope carrying the multi-line version report and a typed model
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../../src/builtins/sys/version.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../../src/builtins/sys/version.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAmB,WAAW,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAsB,MAAM,uBAAuB,CAAC;AAE9F;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,KAAe;IACnD,MAAM,QAAQ,GAAkB,YAAY,EAAE,CAAC;IAC/C,OAAO,WAAW,CAAC,GAAG,mBAAmB,EAAE,IAAI,EAAE;QAC/C,IAAI,EAAE,aAAa;QACnB,IAAI,EAAE,QAAQ;KACf,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,21 +1,42 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file Delegation to the chili command layer.
|
|
3
3
|
*
|
|
4
|
-
* Unknown commands and
|
|
5
|
-
*
|
|
4
|
+
* Unknown commands and the pacs passthroughs hand off to chili. This lives in
|
|
5
|
+
* its own leaf module so both the dispatcher and any builtins can call it
|
|
6
6
|
* without importing each other — dispatch imports the builtins, so routing the
|
|
7
7
|
* delegation through dispatch would close a cycle.
|
|
8
8
|
*
|
|
9
9
|
* @module
|
|
10
10
|
*/
|
|
11
|
+
import { type CommandEnvelope } from '@fnndsc/cumin';
|
|
11
12
|
/**
|
|
12
|
-
*
|
|
13
|
+
* Whether chili has a top-level command by this name. Used to decide whether an
|
|
14
|
+
* unknown chell command is worth delegating: a name chili does not know (a typo,
|
|
15
|
+
* a shell program like `fortune`) is reported as not-found rather than paying the
|
|
16
|
+
* cost of a chili run that can only fail. The command set is resolved once — a
|
|
17
|
+
* cheap, network-free registration pass — and cached.
|
|
18
|
+
*
|
|
19
|
+
* @param command - The command name to test.
|
|
20
|
+
* @returns True if chili exposes a top-level command with this name.
|
|
21
|
+
*/
|
|
22
|
+
export declare function chiliCommand_exists(command: string): Promise<boolean>;
|
|
23
|
+
/**
|
|
24
|
+
* The notice shown when an unknown chell command is handed off to chili.
|
|
25
|
+
*
|
|
26
|
+
* @param command - The command being delegated.
|
|
27
|
+
* @returns The formatted notice line.
|
|
28
|
+
*/
|
|
29
|
+
export declare function chiliDelegationNotice_build(command: string): string;
|
|
30
|
+
/**
|
|
31
|
+
* Runs a chili command in-process and returns its output as an envelope.
|
|
13
32
|
*
|
|
14
33
|
* chili shares this process's cumin connection and context, so there is no node
|
|
15
|
-
* subprocess to spawn and no per-command startup cost.
|
|
34
|
+
* subprocess to spawn and no per-command startup cost. Its output is captured
|
|
35
|
+
* through chili's own output seam ({@link run_capture}) rather than a console
|
|
36
|
+
* monkeypatch, so the rendered text and error stream travel in the envelope.
|
|
16
37
|
*
|
|
17
|
-
* @param command - The command to run (e.g., "
|
|
38
|
+
* @param command - The command to run (e.g., "pacsservers").
|
|
18
39
|
* @param args - The arguments to pass to the command.
|
|
19
|
-
* @returns
|
|
40
|
+
* @returns An envelope carrying chili's captured output.
|
|
20
41
|
*/
|
|
21
|
-
export declare function chiliCommand_run(command: string, args: string[]): Promise<
|
|
42
|
+
export declare function chiliCommand_run(command: string, args: string[]): Promise<CommandEnvelope>;
|