c8ctl-plugin-nano 1.25.1 → 1.26.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 +15 -5
- package/c8ctl-plugin.js +68 -3
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -106,6 +106,10 @@ c8ctl nano clean
|
|
|
106
106
|
c8ctl nano set bin ~/workspace/nanobpmn/server/target/release/nanobpm-gateway-rest-server
|
|
107
107
|
c8ctl nano set model-dir ~/bpmn-workspace
|
|
108
108
|
|
|
109
|
+
# Clear a custom setting (back to the managed/release binary, or default workspace)
|
|
110
|
+
c8ctl nano unset bin
|
|
111
|
+
c8ctl nano unset model-dir
|
|
112
|
+
|
|
109
113
|
# Show current configuration and on-disk locations
|
|
110
114
|
c8ctl nano config
|
|
111
115
|
```
|
|
@@ -575,17 +579,23 @@ c8ctl nano start --console off # headless: no console router at all
|
|
|
575
579
|
env var is honored when the flag is not passed. The plugin passes the choice
|
|
576
580
|
through as `NANOBPMN_CONSOLE` on every node.
|
|
577
581
|
|
|
578
|
-
## Configuration (`set` / `config`)
|
|
582
|
+
## Configuration (`set` / `unset` / `config`)
|
|
579
583
|
|
|
580
584
|
Persistent settings are stored in `<state home>/config.json`:
|
|
581
585
|
|
|
582
|
-
| Setting | Env mapping | Set with |
|
|
583
|
-
|
|
584
|
-
| Binary path | (used to launch nodes) | `c8ctl nano set bin <path>` |
|
|
585
|
-
| Workspace directory | `NANOBPMN_WORKSPACE_DIR` | `c8ctl nano set model-dir <path>` |
|
|
586
|
+
| Setting | Env mapping | Set with | Clear with |
|
|
587
|
+
|---------------------|--------------------------|-----------------------------------|-------------------------------|
|
|
588
|
+
| Binary path | (used to launch nodes) | `c8ctl nano set bin <path>` | `c8ctl nano unset bin` |
|
|
589
|
+
| Workspace directory | `NANOBPMN_WORKSPACE_DIR` | `c8ctl nano set model-dir <path>` | `c8ctl nano unset model-dir` |
|
|
586
590
|
|
|
587
591
|
Show the effective configuration and all on-disk locations with `c8ctl nano config`.
|
|
588
592
|
|
|
593
|
+
`unset bin` clears a custom binary path so node launches fall back to the
|
|
594
|
+
managed platform binary — i.e. back on the release train that `c8ctl nano
|
|
595
|
+
update` tracks. (Note: a `NANOBPMN_BINARY` environment variable still overrides
|
|
596
|
+
even after `unset`.) `unset model-dir` returns the workspace to its default
|
|
597
|
+
(`<state home>/workspace`).
|
|
598
|
+
|
|
589
599
|
## Updating to a new release (`update`)
|
|
590
600
|
|
|
591
601
|
The plugin and the bundled server binary (delivered via the matching platform
|
package/c8ctl-plugin.js
CHANGED
|
@@ -450,7 +450,7 @@ function launcherEnvMarkers(resolved) {
|
|
|
450
450
|
// Argument parsing
|
|
451
451
|
// ---------------------------------------------------------------------------
|
|
452
452
|
|
|
453
|
-
const VALID_SUBCOMMANDS = ['start', 'stop', 'status', 'logs', 'log', 'restart', 'pause', 'resume', 'clean', 'set', 'config', 'update', 'hire', 'assign', 'work', 'supervisor'];
|
|
453
|
+
const VALID_SUBCOMMANDS = ['start', 'stop', 'status', 'logs', 'log', 'restart', 'pause', 'resume', 'clean', 'set', 'unset', 'config', 'update', 'hire', 'assign', 'work', 'supervisor'];
|
|
454
454
|
|
|
455
455
|
/**
|
|
456
456
|
* Parse positional args + flags into a normalized request.
|
|
@@ -1387,7 +1387,7 @@ function setConfig(req) {
|
|
|
1387
1387
|
const key = req.positional[0];
|
|
1388
1388
|
const value = req.positional[1];
|
|
1389
1389
|
|
|
1390
|
-
if (!key || !(key
|
|
1390
|
+
if (!key || !Object.hasOwn(SETTING_ALIASES, key)) {
|
|
1391
1391
|
logger.error('Usage: c8ctl nano set <bin|model-dir> <path>');
|
|
1392
1392
|
logger.info('Settings:');
|
|
1393
1393
|
logger.info(' bin <path> Path to the nanobpmn server binary');
|
|
@@ -1423,12 +1423,69 @@ function setConfig(req) {
|
|
|
1423
1423
|
}
|
|
1424
1424
|
}
|
|
1425
1425
|
|
|
1426
|
+
/**
|
|
1427
|
+
* Clear a configured setting so resolution falls back to the default. The
|
|
1428
|
+
* headline use is `unset bin`: after `set bin <path>` pins a self-managed
|
|
1429
|
+
* binary (source 'configured', which disables self-update), clearing it lets
|
|
1430
|
+
* the plugin fall back to the managed npm platform package — i.e. back on the
|
|
1431
|
+
* release train. `unset model-dir` returns the workspace to its default.
|
|
1432
|
+
*/
|
|
1433
|
+
function unsetConfig(req) {
|
|
1434
|
+
const logger = getLogger();
|
|
1435
|
+
const key = req.positional[0];
|
|
1436
|
+
|
|
1437
|
+
if (!key || !Object.hasOwn(SETTING_ALIASES, key)) {
|
|
1438
|
+
logger.error('Usage: c8ctl nano unset <bin|model-dir>');
|
|
1439
|
+
logger.info('Settings:');
|
|
1440
|
+
logger.info(' bin Clear the custom server binary (back to the managed/release binary)');
|
|
1441
|
+
logger.info(' model-dir Clear the custom workspace dir (back to the default)');
|
|
1442
|
+
process.exit(1);
|
|
1443
|
+
}
|
|
1444
|
+
|
|
1445
|
+
const field = SETTING_ALIASES[key];
|
|
1446
|
+
const cfg = readConfig();
|
|
1447
|
+
const prev = cfg[field];
|
|
1448
|
+
const wasSet = prev !== undefined && prev !== null && prev !== '';
|
|
1449
|
+
const label = field === 'binary' ? 'custom binary override' : 'custom workspace override';
|
|
1450
|
+
|
|
1451
|
+
if (!wasSet) {
|
|
1452
|
+
logger.info(`No ${label} is configured — nothing to clear.`);
|
|
1453
|
+
} else {
|
|
1454
|
+
delete cfg[field];
|
|
1455
|
+
writeConfig(cfg);
|
|
1456
|
+
logger.info(`Cleared ${label} (was ${prev}).`);
|
|
1457
|
+
}
|
|
1458
|
+
|
|
1459
|
+
if (field === 'binary') {
|
|
1460
|
+
// Report what resolves now, so the operator can see they are back on the
|
|
1461
|
+
// managed release train (or what still overrides it).
|
|
1462
|
+
try {
|
|
1463
|
+
const r = resolveBinary({});
|
|
1464
|
+
logger.info(`Now using: ${r.path} (${r.from}).`);
|
|
1465
|
+
if (r.source === 'managed-npm') {
|
|
1466
|
+
logger.info('Back on the managed release train — "c8ctl nano update" now tracks the published release.');
|
|
1467
|
+
} else if (r.source === 'configured') {
|
|
1468
|
+
logger.warn('Still pinned by NANOBPMN_BINARY in your environment; unset that to use the managed binary.');
|
|
1469
|
+
}
|
|
1470
|
+
} catch (err) {
|
|
1471
|
+
logger.warn(`No binary resolves now: ${err instanceof Error ? err.message : err}`);
|
|
1472
|
+
logger.info('Reinstall the plugin to fetch the managed platform binary, or set one again with "c8ctl nano set bin <path>".');
|
|
1473
|
+
}
|
|
1474
|
+
} else if (field === 'workspaceDir') {
|
|
1475
|
+
logger.info(`Workspace is now the default: ${getWorkspaceDir()}.`);
|
|
1476
|
+
const running = readState();
|
|
1477
|
+
if (running && liveNodeCount(running) > 0) {
|
|
1478
|
+
logger.warn('A cluster is running — restart it for the new workspace to take effect.');
|
|
1479
|
+
}
|
|
1480
|
+
}
|
|
1481
|
+
}
|
|
1482
|
+
|
|
1426
1483
|
function showConfig() {
|
|
1427
1484
|
const cfg = readConfig();
|
|
1428
1485
|
console.log('Nano plugin configuration:');
|
|
1429
1486
|
console.log('');
|
|
1430
1487
|
console.log(` state home ${getStateHome()}`);
|
|
1431
|
-
console.log(` binary ${cfg.binary || '(auto-detect: $NANOBPMN_BINARY or repo build)'}`);
|
|
1488
|
+
console.log(` binary ${cfg.binary || '(auto-detect: $NANOBPMN_BINARY, managed platform package, or repo build)'}`);
|
|
1432
1489
|
const bundled = readBundledBinaryInfo();
|
|
1433
1490
|
if (bundled) {
|
|
1434
1491
|
const at = bundled.commit && bundled.commit !== 'unknown' ? ` (${bundled.commit})` : '';
|
|
@@ -1441,6 +1498,7 @@ function showConfig() {
|
|
|
1441
1498
|
console.log(` config file ${getConfigFile()}`);
|
|
1442
1499
|
console.log('');
|
|
1443
1500
|
console.log(' Change with: c8ctl nano set bin <path> | c8ctl nano set model-dir <path>');
|
|
1501
|
+
console.log(' Clear with: c8ctl nano unset bin | c8ctl nano unset model-dir');
|
|
1444
1502
|
}
|
|
1445
1503
|
|
|
1446
1504
|
// ---------------------------------------------------------------------------
|
|
@@ -6121,6 +6179,7 @@ function parseProcessosRequest(args, flags) {
|
|
|
6121
6179
|
// Internal helpers exported for tests/tooling only. c8ctl consumes just
|
|
6122
6180
|
// `metadata` and `commands`; these named exports are inert to it.
|
|
6123
6181
|
export { resolveBinary, findBinary, launcherEnvMarkers };
|
|
6182
|
+
export { setConfig, unsetConfig, readConfig, writeConfig, getConfigFile, SETTING_ALIASES };
|
|
6124
6183
|
export { buildNpmInvocation };
|
|
6125
6184
|
export {
|
|
6126
6185
|
webConsoleUrl,
|
|
@@ -6231,6 +6290,7 @@ export const metadata = {
|
|
|
6231
6290
|
{ command: 'c8ctl nano restart --purge', description: 'Restart the cluster from a clean slate (delete engine data)' },
|
|
6232
6291
|
{ command: 'c8ctl nano clean', description: 'Wipe journal/data + logs on disk (keeps models/workers)' },
|
|
6233
6292
|
{ command: 'c8ctl nano set bin <path>', description: 'Set the nanobpmn server binary path' },
|
|
6293
|
+
{ command: 'c8ctl nano unset bin', description: 'Clear a custom binary path and return to the managed/release binary' },
|
|
6234
6294
|
{ command: 'c8ctl nano set model-dir <path>', description: 'Set the workspace dir (models + workers)' },
|
|
6235
6295
|
{ command: 'c8ctl nano config', description: 'Show current plugin configuration and paths' },
|
|
6236
6296
|
{ command: 'c8ctl nano update', description: 'Pull the latest published nano release (re-installs via npm)' },
|
|
@@ -6360,6 +6420,9 @@ export const commands = {
|
|
|
6360
6420
|
case 'set':
|
|
6361
6421
|
setConfig(req);
|
|
6362
6422
|
break;
|
|
6423
|
+
case 'unset':
|
|
6424
|
+
unsetConfig(req);
|
|
6425
|
+
break;
|
|
6363
6426
|
case 'config':
|
|
6364
6427
|
showConfig();
|
|
6365
6428
|
break;
|
|
@@ -6464,6 +6527,7 @@ function printUsage() {
|
|
|
6464
6527
|
console.log(' c8ctl nano restart [<nodes>] [--purge] ...');
|
|
6465
6528
|
console.log(' c8ctl nano clean [--workspace]');
|
|
6466
6529
|
console.log(' c8ctl nano set <bin|model-dir> <path>');
|
|
6530
|
+
console.log(' c8ctl nano unset <bin|model-dir>');
|
|
6467
6531
|
console.log(' c8ctl nano config');
|
|
6468
6532
|
console.log(' c8ctl nano update [--check]');
|
|
6469
6533
|
console.log(' c8ctl nano hire [--name <n>] [--rank <r>] [--command <c>] [--arg <switch> ...] [--model <m>] [--capabilities <a,b>] [--sandbox none|docker|podman] [--image <ref>] [--env NAME=VALUE ...] [--list]');
|
|
@@ -6481,6 +6545,7 @@ function printUsage() {
|
|
|
6481
6545
|
console.log(' restart Stop then start');
|
|
6482
6546
|
console.log(' clean Wipe journal/data + logs on disk (keeps models/workers)');
|
|
6483
6547
|
console.log(' set Persist a setting: "bin <path>" or "model-dir <path>"');
|
|
6548
|
+
console.log(' unset Clear a setting ("bin" or "model-dir") back to its default');
|
|
6484
6549
|
console.log(' config Show current configuration and on-disk locations');
|
|
6485
6550
|
console.log(' update Pull the latest published nano release (--check to only report)');
|
|
6486
6551
|
console.log(' hire Create a CLI agent worker profile (rank + capabilities → job-type matrix)');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "c8ctl-plugin-nano",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.26.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "c8ctl plugin to start, inspect, and stop a local Nano BPM (nanobpmn) cluster",
|
|
6
6
|
"main": "c8ctl-plugin.js",
|
|
@@ -47,12 +47,12 @@
|
|
|
47
47
|
"semantic-release": "^25.0.3"
|
|
48
48
|
},
|
|
49
49
|
"optionalDependencies": {
|
|
50
|
-
"@nanobpm/c8ctl-plugin-nano-darwin-arm64": "1.
|
|
51
|
-
"@nanobpm/c8ctl-plugin-nano-darwin-x64": "1.
|
|
52
|
-
"@nanobpm/c8ctl-plugin-nano-linux-x64": "1.
|
|
53
|
-
"@nanobpm/c8ctl-plugin-nano-linux-arm64": "1.
|
|
54
|
-
"@nanobpm/c8ctl-plugin-nano-linux-armv7": "1.
|
|
55
|
-
"@nanobpm/c8ctl-plugin-nano-linux-armv6": "1.
|
|
56
|
-
"@nanobpm/c8ctl-plugin-nano-win32-x64": "1.
|
|
50
|
+
"@nanobpm/c8ctl-plugin-nano-darwin-arm64": "1.26.0",
|
|
51
|
+
"@nanobpm/c8ctl-plugin-nano-darwin-x64": "1.26.0",
|
|
52
|
+
"@nanobpm/c8ctl-plugin-nano-linux-x64": "1.26.0",
|
|
53
|
+
"@nanobpm/c8ctl-plugin-nano-linux-arm64": "1.26.0",
|
|
54
|
+
"@nanobpm/c8ctl-plugin-nano-linux-armv7": "1.26.0",
|
|
55
|
+
"@nanobpm/c8ctl-plugin-nano-linux-armv6": "1.26.0",
|
|
56
|
+
"@nanobpm/c8ctl-plugin-nano-win32-x64": "1.26.0"
|
|
57
57
|
}
|
|
58
58
|
}
|