@visulima/cerebro 3.0.0-alpha.12 → 3.0.0-alpha.14

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/CHANGELOG.md CHANGED
@@ -1,3 +1,21 @@
1
+ ## @visulima/cerebro [3.0.0-alpha.14](https://github.com/visulima/visulima/compare/@visulima/cerebro@3.0.0-alpha.13...@visulima/cerebro@3.0.0-alpha.14) (2026-05-04)
2
+
3
+
4
+ ### Dependencies
5
+
6
+ * **@visulima/error:** upgraded to 6.0.0-alpha.15
7
+
8
+ ## @visulima/cerebro [3.0.0-alpha.13](https://github.com/visulima/visulima/compare/@visulima/cerebro@3.0.0-alpha.12...@visulima/cerebro@3.0.0-alpha.13) (2026-04-30)
9
+
10
+ ### Features
11
+
12
+ * **cerebro:** longest-prefix parser with option-stop and parent help ([ef1d244](https://github.com/visulima/visulima/commit/ef1d24446462cd5b34598f70715d4987c31b4eff))
13
+
14
+
15
+ ### Dependencies
16
+
17
+ * **@visulima/error:** upgraded to 6.0.0-alpha.14
18
+
1
19
  ## @visulima/cerebro [3.0.0-alpha.12](https://github.com/visulima/visulima/compare/@visulima/cerebro@3.0.0-alpha.11...@visulima/cerebro@3.0.0-alpha.12) (2026-04-28)
2
20
 
3
21
  ### Features
package/LICENSE.md CHANGED
@@ -133,44 +133,20 @@ Repository: git+https://github.com/visulima/visulima.git
133
133
  > > > The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
134
134
  > > >
135
135
  > > > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
136
- > >
137
- > >
138
- > >
139
- > >
140
- > >
141
- > > # Licenses of bundled types
142
- > > The published @visulima/error artifact additionally contains code with the following licenses:
143
- > > Apache-2.0
144
- > >
145
- > > # Bundled types:
146
- > > ## ai
147
- > > License: Apache-2.0
148
- > > Repository: git+https://github.com/vercel/ai.git
149
- > >
150
- > > > Copyright 2023 Vercel, Inc.
151
- > > >
152
- > > > Licensed under the Apache License, Version 2.0 (the "License");
153
- > > > you may not use this file except in compliance with the License.
154
- > > > You may obtain a copy of the License at
155
- > > >
156
- > > > http://www.apache.org/licenses/LICENSE-2.0
157
- > > >
158
- > > > Unless required by applicable law or agreed to in writing, software
159
- > > > distributed under the License is distributed on an "AS IS" BASIS,
160
- > > > WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
161
- > > > See the License for the specific language governing permissions and
162
- > > > limitations under the License.
163
136
  >
164
137
  >
165
138
  >
166
139
  >
167
140
  >
168
141
  > # Licenses of bundled types
142
+ >
169
143
  > The published @visulima/command-line-args artifact additionally contains code with the following licenses:
170
144
  > MIT
171
145
  >
172
146
  > # Bundled types:
147
+ >
173
148
  > ## @visulima/error
149
+ >
174
150
  > License: MIT
175
151
  > By: Daniel Bannert
176
152
  > Repository: git+https://github.com/visulima/visulima.git
@@ -198,6 +174,40 @@ Repository: git+https://github.com/visulima/visulima.git
198
174
  > > SOFTWARE.
199
175
  > >
200
176
  > >
177
+ >
178
+ > # Licenses of bundled dependencies
179
+ > The published @visulima/command-line-args artifact additionally contains code with the following licenses:
180
+ > MIT
181
+ >
182
+ > # Bundled dependencies:
183
+ > ## @visulima/error
184
+ > License: MIT
185
+ > By: Daniel Bannert
186
+ > Repository: git+https://github.com/visulima/visulima.git
187
+ >
188
+ > > MIT License
189
+ > >
190
+ > > Copyright (c) 2026 visulima
191
+ > >
192
+ > > Permission is hereby granted, free of charge, to any person obtaining a copy
193
+ > > of this software and associated documentation files (the "Software"), to deal
194
+ > > in the Software without restriction, including without limitation the rights
195
+ > > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
196
+ > > copies of the Software, and to permit persons to whom the Software is
197
+ > > furnished to do so, subject to the following conditions:
198
+ > >
199
+ > > The above copyright notice and this permission notice shall be included in all
200
+ > > copies or substantial portions of the Software.
201
+ > >
202
+ > > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
203
+ > > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
204
+ > > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
205
+ > > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
206
+ > > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
207
+ > > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
208
+ > > SOFTWARE.
209
+ > >
210
+ > >
201
211
  > >
202
212
  > > # Licenses of bundled dependencies
203
213
  > > The published @visulima/error artifact additionally contains code with the following licenses:
@@ -218,17 +228,18 @@ Repository: git+https://github.com/visulima/visulima.git
218
228
  > > > The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
219
229
  > > >
220
230
  > > > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
221
- > >
222
- > >
223
- > >
224
- > >
231
+ >
232
+ >
225
233
  > >
226
234
  > > # Licenses of bundled types
235
+ > >
227
236
  > > The published @visulima/error artifact additionally contains code with the following licenses:
228
237
  > > Apache-2.0
229
238
  > >
230
239
  > > # Bundled types:
240
+ > >
231
241
  > > ## ai
242
+ > >
232
243
  > > License: Apache-2.0
233
244
  > > Repository: git+https://github.com/vercel/ai.git
234
245
  > >
@@ -308,7 +319,7 @@ Repository: git+https://github.com/visulima/visulima.git
308
319
  > # Bundled types:
309
320
  > ## ai
310
321
  > License: Apache-2.0
311
- > Repository: git+https://github.com/vercel/ai.git
322
+ > Repository: https://github.com/vercel/ai
312
323
  >
313
324
  > > Copyright 2023 Vercel, Inc.
314
325
  > >
@@ -1231,44 +1242,20 @@ Repository: git+https://github.com/visulima/visulima.git
1231
1242
  > > > The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
1232
1243
  > > >
1233
1244
  > > > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1234
- > >
1235
- > >
1236
- > >
1237
- > >
1238
- > >
1239
- > > # Licenses of bundled types
1240
- > > The published @visulima/error artifact additionally contains code with the following licenses:
1241
- > > Apache-2.0
1242
- > >
1243
- > > # Bundled types:
1244
- > > ## ai
1245
- > > License: Apache-2.0
1246
- > > Repository: git+https://github.com/vercel/ai.git
1247
- > >
1248
- > > > Copyright 2023 Vercel, Inc.
1249
- > > >
1250
- > > > Licensed under the Apache License, Version 2.0 (the "License");
1251
- > > > you may not use this file except in compliance with the License.
1252
- > > > You may obtain a copy of the License at
1253
- > > >
1254
- > > > http://www.apache.org/licenses/LICENSE-2.0
1255
- > > >
1256
- > > > Unless required by applicable law or agreed to in writing, software
1257
- > > > distributed under the License is distributed on an "AS IS" BASIS,
1258
- > > > WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1259
- > > > See the License for the specific language governing permissions and
1260
- > > > limitations under the License.
1261
1245
  >
1262
1246
  > <!-- /DEPENDENCIES -->
1263
1247
  >
1264
1248
  >
1265
1249
  >
1266
1250
  > # Licenses of bundled types
1251
+ >
1267
1252
  > The published @visulima/command-line-args artifact additionally contains code with the following licenses:
1268
1253
  > MIT
1269
1254
  >
1270
1255
  > # Bundled types:
1256
+ >
1271
1257
  > ## @visulima/error
1258
+ >
1272
1259
  > License: MIT
1273
1260
  > By: Daniel Bannert
1274
1261
  > Repository: git+https://github.com/visulima/visulima.git
@@ -1296,6 +1283,40 @@ Repository: git+https://github.com/visulima/visulima.git
1296
1283
  > > SOFTWARE.
1297
1284
  > >
1298
1285
  > > <!-- DEPENDENCIES -->
1286
+ >
1287
+ > # Licenses of bundled dependencies
1288
+ > The published @visulima/command-line-args artifact additionally contains code with the following licenses:
1289
+ > MIT
1290
+ >
1291
+ > # Bundled dependencies:
1292
+ > ## @visulima/error
1293
+ > License: MIT
1294
+ > By: Daniel Bannert
1295
+ > Repository: git+https://github.com/visulima/visulima.git
1296
+ >
1297
+ > > MIT License
1298
+ > >
1299
+ > > Copyright (c) 2026 visulima
1300
+ > >
1301
+ > > Permission is hereby granted, free of charge, to any person obtaining a copy
1302
+ > > of this software and associated documentation files (the "Software"), to deal
1303
+ > > in the Software without restriction, including without limitation the rights
1304
+ > > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1305
+ > > copies of the Software, and to permit persons to whom the Software is
1306
+ > > furnished to do so, subject to the following conditions:
1307
+ > >
1308
+ > > The above copyright notice and this permission notice shall be included in all
1309
+ > > copies or substantial portions of the Software.
1310
+ > >
1311
+ > > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1312
+ > > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1313
+ > > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1314
+ > > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1315
+ > > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1316
+ > > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1317
+ > > SOFTWARE.
1318
+ > >
1319
+ > >
1299
1320
  > >
1300
1321
  > > # Licenses of bundled dependencies
1301
1322
  > > The published @visulima/error artifact additionally contains code with the following licenses:
@@ -1316,17 +1337,18 @@ Repository: git+https://github.com/visulima/visulima.git
1316
1337
  > > > The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
1317
1338
  > > >
1318
1339
  > > > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1319
- > >
1320
- > > <!-- /DEPENDENCIES -->
1321
- > >
1322
- > >
1340
+ >
1341
+ > <!-- /DEPENDENCIES -->
1323
1342
  > >
1324
1343
  > > # Licenses of bundled types
1344
+ > >
1325
1345
  > > The published @visulima/error artifact additionally contains code with the following licenses:
1326
1346
  > > Apache-2.0
1327
1347
  > >
1328
1348
  > > # Bundled types:
1349
+ > >
1329
1350
  > > ## ai
1351
+ > >
1330
1352
  > > License: Apache-2.0
1331
1353
  > > Repository: git+https://github.com/vercel/ai.git
1332
1354
  > >
@@ -1406,7 +1428,7 @@ Repository: git+https://github.com/visulima/visulima.git
1406
1428
  > # Bundled types:
1407
1429
  > ## ai
1408
1430
  > License: Apache-2.0
1409
- > Repository: git+https://github.com/vercel/ai.git
1431
+ > Repository: https://github.com/vercel/ai
1410
1432
  >
1411
1433
  > > Copyright 2023 Vercel, Inc.
1412
1434
  > >
@@ -1506,33 +1528,6 @@ Repository: git+https://github.com/visulima/visulima.git
1506
1528
  > > > The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
1507
1529
  > > >
1508
1530
  > > > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1509
- > >
1510
- > >
1511
- > >
1512
- > >
1513
- > >
1514
- > > # Licenses of bundled types
1515
- > > The published @visulima/error artifact additionally contains code with the following licenses:
1516
- > > Apache-2.0
1517
- > >
1518
- > > # Bundled types:
1519
- > > ## ai
1520
- > > License: Apache-2.0
1521
- > > Repository: git+https://github.com/vercel/ai.git
1522
- > >
1523
- > > > Copyright 2023 Vercel, Inc.
1524
- > > >
1525
- > > > Licensed under the Apache License, Version 2.0 (the "License");
1526
- > > > you may not use this file except in compliance with the License.
1527
- > > > You may obtain a copy of the License at
1528
- > > >
1529
- > > > http://www.apache.org/licenses/LICENSE-2.0
1530
- > > >
1531
- > > > Unless required by applicable law or agreed to in writing, software
1532
- > > > distributed under the License is distributed on an "AS IS" BASIS,
1533
- > > > WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1534
- > > > See the License for the specific language governing permissions and
1535
- > > > limitations under the License.
1536
1531
  >
1537
1532
  > ---------------------------------------
1538
1533
  >
@@ -1,4 +1,4 @@
1
- import { C as Command } from "../packem_shared/plugin-manager.d-Du-YXFui.js";
1
+ import { C as Command } from "../packem_shared/plugin-manager.d-Dz-wu1tI.js";
2
2
  import '@visulima/tabular';
3
3
  /**
4
4
  * Generates shell completion scripts for the CLI application.
@@ -1,4 +1,4 @@
1
- import { O as OptionDefinition, C as Command, T as Toolbox } from "../packem_shared/plugin-manager.d-Du-YXFui.js";
1
+ import { O as OptionDefinition, C as Command, T as Toolbox } from "../packem_shared/plugin-manager.d-Dz-wu1tI.js";
2
2
  import '@visulima/tabular';
3
3
  declare class HelpCommand<TLogger extends Console = Console> implements Command<OptionDefinition<string>, TLogger> {
4
4
  name: string;
@@ -98,6 +98,51 @@ const printGeneralHelp = (logger, runtime, commands, groupOption) => {
98
98
  )
99
99
  );
100
100
  };
101
+ const findChildren = (commands, parentPath) => {
102
+ const matches = [];
103
+ for (const cmd of commands.values()) {
104
+ if (cmd.hidden) {
105
+ continue;
106
+ }
107
+ const commandPath = cmd.commandPath ?? [];
108
+ if (commandPath.length !== parentPath.length) {
109
+ continue;
110
+ }
111
+ let isMatch = true;
112
+ for (let index = 0; index < parentPath.length; index += 1) {
113
+ if (commandPath[index] !== parentPath[index]) {
114
+ isMatch = false;
115
+ break;
116
+ }
117
+ }
118
+ if (isMatch) {
119
+ matches.push(cmd);
120
+ }
121
+ }
122
+ return matches;
123
+ };
124
+ const printParentHelp = (logger, runtime, parentPath, children) => {
125
+ const parentDisplay = parentPath.join(" ");
126
+ const usageGroups = [
127
+ {
128
+ content: `${cyan(runtime.getCliName())} ${green(parentDisplay)} ${green("<subcommand>")} [positional arguments] ${yellow("[options]")}`,
129
+ header: inverse.cyan(" Usage ")
130
+ },
131
+ {
132
+ content: children.map((child) => {
133
+ const fullPath = [...child.commandPath ?? [], child.name].join(" ");
134
+ return [green(fullPath), child.description ?? ""];
135
+ }),
136
+ header: inverse.green(" Subcommands ")
137
+ },
138
+ { header: inverse.yellow(" Global Options "), optionList: runtime.getGlobalOptions() },
139
+ {
140
+ content: `Run "${cyan(runtime.getCliName())} ${green(`${parentDisplay} <subcommand>`)} ${yellow("--help")}" for help with a specific subcommand.`,
141
+ raw: true
142
+ }
143
+ ];
144
+ (logger.raw ?? logger.log)(commandLineUsage(usageGroups));
145
+ };
101
146
  const printCommandHelp = (logger, runtime, commands, name) => {
102
147
  let command = commands.get(name);
103
148
  if (!command) {
@@ -110,6 +155,12 @@ const printCommandHelp = (logger, runtime, commands, name) => {
110
155
  }
111
156
  }
112
157
  if (!command) {
158
+ const parentPath = name.split(" ").filter(Boolean);
159
+ const children = parentPath.length > 0 ? findChildren(commands, parentPath) : [];
160
+ if (children.length > 0) {
161
+ printParentHelp(logger, runtime, parentPath, children);
162
+ return;
163
+ }
113
164
  logger.error(`Command "${name}" not found`);
114
165
  return;
115
166
  }
@@ -159,6 +210,17 @@ const printCommandHelp = (logger, runtime, commands, name) => {
159
210
  header: "Examples"
160
211
  });
161
212
  }
213
+ const ownPath = [...command.commandPath ?? [], command.name];
214
+ const ownChildren = findChildren(commands, ownPath);
215
+ if (ownChildren.length > 0) {
216
+ usageGroups.push({
217
+ content: ownChildren.map((child) => {
218
+ const fullPath = [...child.commandPath ?? [], child.name].join(" ");
219
+ return [green(fullPath), child.description ?? ""];
220
+ }),
221
+ header: inverse.green(" Subcommands ")
222
+ });
223
+ }
162
224
  (logger.raw ?? logger.log)(commandLineUsage(usageGroups));
163
225
  };
164
226
  class HelpCommand {
@@ -1,4 +1,4 @@
1
- import { C as Command } from "../packem_shared/plugin-manager.d-Du-YXFui.js";
1
+ import { C as Command } from "../packem_shared/plugin-manager.d-Dz-wu1tI.js";
2
2
  import '@visulima/tabular';
3
3
  /**
4
4
  * Generates README documentation for cerebro CLI commands.
@@ -1,4 +1,4 @@
1
- import { C as Command } from "../packem_shared/plugin-manager.d-Du-YXFui.js";
1
+ import { C as Command } from "../packem_shared/plugin-manager.d-Dz-wu1tI.js";
2
2
  import '@visulima/tabular';
3
3
  declare const _default: Command;
4
4
  export { _default as default };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { a as CommandSection, O as OptionDefinition, C as Command, P as Plugin, b as PluginManager, c as CliRunOptions, R as RunCommandOptions, d as Cli$1, L as LazyCommandModule } from "./packem_shared/plugin-manager.d-Du-YXFui.js";
2
- export { type A as ArgumentDefinition, type e as CommandExecute, type E as EnvDefinition, type f as OutputType, type g as PluginContext, type T as Toolbox, type V as VERBOSITY_LEVEL } from "./packem_shared/plugin-manager.d-Du-YXFui.js";
1
+ import { a as CommandSection, O as OptionDefinition, C as Command, P as Plugin, b as PluginManager, c as CliRunOptions, R as RunCommandOptions, d as Cli$1, L as LazyCommandModule } from "./packem_shared/plugin-manager.d-Dz-wu1tI.js";
2
+ export { type A as ArgumentDefinition, type e as CommandExecute, type E as EnvDefinition, type f as OutputType, type g as PluginContext, type T as Toolbox, type V as VERBOSITY_LEVEL } from "./packem_shared/plugin-manager.d-Dz-wu1tI.js";
3
3
  export { V as VisulimaError } from "./packem_shared/index.d-Br8HpP0A.js";
4
4
  import '@visulima/tabular';
5
5
  type CliOptions<T extends Console = Console> = {
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Cli } from './packem_shared/Cerebro-f9jDcQQy.js';
1
+ import { Cli } from './packem_shared/Cerebro-C1h3DXwy.js';
2
2
  export { VERBOSITY_DEBUG, VERBOSITY_NORMAL, VERBOSITY_QUIET, VERBOSITY_VERBOSE } from './packem_shared/VERBOSITY_QUIET-Dp46zlLW.js';
3
3
  export { lazyNamed } from './packem_shared/lazyNamed-B278Tf9_.js';
4
4
  export { VisulimaError } from './packem_shared/VisulimaError-DA7QsCxH.js';
@@ -1531,18 +1531,21 @@ const parseNestedCommand = (availableCommands, argv) => {
1531
1531
  return { argv: [], commandPath: void 0 };
1532
1532
  }
1533
1533
  const pathKeyParts = [];
1534
+ let bestMatch;
1534
1535
  for (let depth = 1; depth <= argv.length; depth += 1) {
1535
1536
  const argument = argv[depth - 1];
1536
- if (argument === void 0) {
1537
+ if (argument === void 0 || argument.startsWith("-")) {
1537
1538
  break;
1538
1539
  }
1539
1540
  pathKeyParts.push(argument);
1540
1541
  const pathKey = pathKeyParts.join(" ");
1541
1542
  if (availableCommands.has(pathKey)) {
1542
- const remainingArgv = argv.slice(depth);
1543
- return { argv: remainingArgv, commandPath: [...pathKeyParts] };
1543
+ bestMatch = { commandPath: [...pathKeyParts], depth };
1544
1544
  }
1545
1545
  }
1546
+ if (bestMatch) {
1547
+ return { argv: argv.slice(bestMatch.depth), commandPath: bestMatch.commandPath };
1548
+ }
1546
1549
  return { argv, commandPath: void 0 };
1547
1550
  };
1548
1551
  const getCommandPathKey = (commandPath) => commandPath.join(" ");
@@ -38,6 +38,9 @@ interface OptionDefinition$1 {
38
38
  */
39
39
  type?: (input: string) => any;
40
40
  }
41
+ /**
42
+ * Error thrown when an option is already set (duplicate assignment).
43
+ */
41
44
  /** A Content section comprises a header and one or more lines of content. */
42
45
  interface Content {
43
46
  /**
@@ -1,5 +1,5 @@
1
1
  import { O as Options$1 } from "../packem_shared/index.d-Br8HpP0A.js";
2
- import { P as Plugin } from "../packem_shared/plugin-manager.d-Du-YXFui.js";
2
+ import { P as Plugin } from "../packem_shared/plugin-manager.d-Dz-wu1tI.js";
3
3
  import '@visulima/tabular';
4
4
  type ErrorHandlerOptions = {
5
5
  /** Show detailed error information including stack traces and code frames (default: false) */
@@ -1,4 +1,4 @@
1
- import { P as Plugin } from "../packem_shared/plugin-manager.d-Du-YXFui.js";
1
+ import { P as Plugin } from "../packem_shared/plugin-manager.d-Dz-wu1tI.js";
2
2
  import '@visulima/tabular';
3
3
  type RuntimeType = "bun" | "deno" | "node";
4
4
  type RuntimeVersionRequirement = {
@@ -1,4 +1,4 @@
1
- import { P as Plugin } from "../../packem_shared/plugin-manager.d-Du-YXFui.js";
1
+ import { P as Plugin } from "../../packem_shared/plugin-manager.d-Dz-wu1tI.js";
2
2
  import '@visulima/tabular';
3
3
  type UpdateNotifierOptions = {
4
4
  alwaysRun?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visulima/cerebro",
3
- "version": "3.0.0-alpha.12",
3
+ "version": "3.0.0-alpha.14",
4
4
  "description": "A delightful toolkit for building cross-runtime CLIs for Node.js, Deno, and Bun.",
5
5
  "keywords": [
6
6
  "ansi",
@@ -116,7 +116,7 @@
116
116
  "fastest-levenshtein": "^1.0.16"
117
117
  },
118
118
  "peerDependencies": {
119
- "@bomb.sh/tab": "0.0.14",
119
+ "@bomb.sh/tab": "0.0.15",
120
120
  "@visulima/boxen": "3.0.0-alpha.10",
121
121
  "@visulima/find-cache-dir": "3.0.0-alpha.9",
122
122
  "@visulima/pail": "4.0.0-alpha.12",