c8ctl-plugin-nano 1.44.0 → 1.44.2

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/c8ctl-plugin.js CHANGED
@@ -188,6 +188,28 @@ function getLogger() {
188
188
  };
189
189
  }
190
190
 
191
+ /**
192
+ * True when c8ctl's effective output mode is JSON.
193
+ *
194
+ * The plugin used to declare its own `--json` flag, but it collided with
195
+ * c8ctl's new global `--json` and was dropped (see #122). As a result the
196
+ * global `--json` (and persisted `output json` / `C8CTL_OUTPUT_MODE`) is no
197
+ * longer delivered to the plugin as `flags.json`. Read the host's effective
198
+ * output mode directly — the same signal c8ctl's own bundled plugins use — so
199
+ * `workforce list/status` still emit machine-readable JSON on stdout.
200
+ */
201
+ function hostOutputIsJson() {
202
+ const c = globalThis.c8ctl;
203
+ if (!c) return false;
204
+ try {
205
+ if (c.outputMode === 'json') return true;
206
+ const l = typeof c.getLogger === 'function' ? c.getLogger() : null;
207
+ return !!l && l.mode === 'json';
208
+ } catch {
209
+ return false;
210
+ }
211
+ }
212
+
191
213
  /** Expand a leading `~` to the user's home directory. */
192
214
  function expandHome(p) {
193
215
  if (!p) return p;
@@ -8893,7 +8915,7 @@ async function workforceRemoveCmd(req, flags, manifestName) {
8893
8915
 
8894
8916
  async function workforceListCmd(req, flags, manifestName) {
8895
8917
  const logger = getLogger();
8896
- const json = coerceBool(flags?.json, false);
8918
+ const json = flags?.json === false ? false : (coerceBool(flags?.json, false) || hostOutputIsJson());
8897
8919
  const explicitManifest = lastManifestValue(flags) !== '';
8898
8920
  const manifest = readWorkforceManifestStrict(manifestName);
8899
8921
  const others = explicitManifest ? null : listWorkforceManifestNames();
@@ -9007,7 +9029,7 @@ async function workforceStartCmd(req, flags, manifestName) {
9007
9029
 
9008
9030
  async function workforceStatusCmd(req, flags, manifestName) {
9009
9031
  const logger = getLogger();
9010
- const json = coerceBool(flags?.json, false);
9032
+ const json = flags?.json === false ? false : (coerceBool(flags?.json, false) || hostOutputIsJson());
9011
9033
  const manifest = readWorkforceManifestStrict(manifestName);
9012
9034
  const { running, reachable, workers: live } = await fetchSupervisorWorkers();
9013
9035
  // When the daemon is up but its status socket can't be reached, `live` is
@@ -10958,6 +10980,7 @@ export {
10958
10980
  formatWorkforceStatus,
10959
10981
  workforceManifestName,
10960
10982
  lastManifestValue,
10983
+ hostOutputIsJson,
10961
10984
  };
10962
10985
 
10963
10986
  export const metadata = {
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.0.17",
3
- "commit": "4305497",
4
- "updated": "2026-08-31T08:18:28Z"
2
+ "version": "0.0.18",
3
+ "commit": "a5a1662",
4
+ "updated": "2026-08-31T10:34:02Z"
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c8ctl-plugin-nano",
3
- "version": "1.44.0",
3
+ "version": "1.44.2",
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",
@@ -57,12 +57,12 @@
57
57
  },
58
58
  "optionalDependencies": {
59
59
  "node-pty": "^1.0.0",
60
- "@nanobpm/c8ctl-plugin-nano-darwin-arm64": "1.44.0",
61
- "@nanobpm/c8ctl-plugin-nano-darwin-x64": "1.44.0",
62
- "@nanobpm/c8ctl-plugin-nano-linux-x64": "1.44.0",
63
- "@nanobpm/c8ctl-plugin-nano-linux-arm64": "1.44.0",
64
- "@nanobpm/c8ctl-plugin-nano-linux-armv7": "1.44.0",
65
- "@nanobpm/c8ctl-plugin-nano-linux-armv6": "1.44.0",
66
- "@nanobpm/c8ctl-plugin-nano-win32-x64": "1.44.0"
60
+ "@nanobpm/c8ctl-plugin-nano-darwin-arm64": "1.44.2",
61
+ "@nanobpm/c8ctl-plugin-nano-darwin-x64": "1.44.2",
62
+ "@nanobpm/c8ctl-plugin-nano-linux-x64": "1.44.2",
63
+ "@nanobpm/c8ctl-plugin-nano-linux-arm64": "1.44.2",
64
+ "@nanobpm/c8ctl-plugin-nano-linux-armv7": "1.44.2",
65
+ "@nanobpm/c8ctl-plugin-nano-linux-armv6": "1.44.2",
66
+ "@nanobpm/c8ctl-plugin-nano-win32-x64": "1.44.2"
67
67
  }
68
68
  }