esim-cli 2026.1201.188 → 2026.1201.190

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.
Files changed (3) hide show
  1. package/dist/esim.js +100 -169
  2. package/dist/index.js +108 -177
  3. package/package.json +1 -1
package/dist/esim.js CHANGED
@@ -15359,7 +15359,7 @@ function conditions(command, args, data = {}) {
15359
15359
  if (command.sort) {
15360
15360
  const key = typeof args.sort === "string" ? args.sort : command.sort.default;
15361
15361
  if (key !== undefined)
15362
- parts.push(`${key} ${typeof args.order === "string" ? args.order : command.sort.keys[key] ?? ""}`.trim());
15362
+ parts.push(`${key} ${command.sort.keys[key] ?? ""}`.trim());
15363
15363
  }
15364
15364
  for (const arg of command.args) {
15365
15365
  if (notConditions.has(arg.name))
@@ -15449,7 +15449,12 @@ function headed(command) {
15449
15449
  return result;
15450
15450
  }
15451
15451
  var headerCountry = (line) => typeof line === "string" ? line.match(/(?:^| · )country (.+?) #\d+(?: · |$)/)?.[1] : undefined;
15452
- var orderQuery = (args) => typeof args.order === "string" ? { order: args.order } : {};
15452
+ function orderQuery(ctx, key = ctx.args.sort) {
15453
+ const sort = ctx.command.sort;
15454
+ const selected = typeof key === "string" ? key : sort?.default;
15455
+ const order = selected === undefined ? undefined : sort?.keys[selected];
15456
+ return order === undefined ? {} : { order };
15457
+ }
15453
15458
 
15454
15459
  // commands/model.ts
15455
15460
  var errorRow = (error) => ({ error: error instanceof CommandError ? error.error : "unexpected_error" });
@@ -17504,13 +17509,13 @@ var battle = [
17504
17509
  flag("region", undefined, { source: "Region name or ID" }),
17505
17510
  flag("subsidy", boolean2(), { source: "Only open battles with a positive subsidy rate" })
17506
17511
  ],
17507
- sort: { keys: { ...sortKeys }, default: "start", order: true },
17512
+ sort: { keys: { ...sortKeys }, default: "start" },
17508
17513
  examples: [
17509
17514
  "esim battle list",
17510
17515
  "esim battle list --kind war --status open",
17511
17516
  "esim battle list --subsidy --sort subsidy --limit 10",
17512
17517
  "esim battle list --kind war --country China --sort ends --limit 5",
17513
- "esim battle list --kind all --sort start --order asc --limit 10",
17518
+ "esim battle list --kind all --sort start --limit 10",
17514
17519
  "esim battle list --kind war --status open --sort damage --limit 5"
17515
17520
  ],
17516
17521
  empty: (data) => rows(row2(data).items).length ? undefined : `No battles match these filters (${String(row2(data).sorted).replace(/ · 0 (shown|of \d+)$/, "")}).`,
@@ -17528,11 +17533,10 @@ var battle = [
17528
17533
  else if (filter.kind === undefined && !args.subsidy)
17529
17534
  filter.kind = "practice";
17530
17535
  const sort = textArg(args, "sort") ?? "start";
17531
- const order = textArg(args, "order") ?? sortKeys[sort];
17536
+ const order = sortKeys[sort];
17532
17537
  if (sort !== "start")
17533
17538
  filter.sort = sort;
17534
- if (order !== sortKeys[sort])
17535
- filter.order = order;
17539
+ filter.order = order;
17536
17540
  if (args.subsidy)
17537
17541
  filter.filter = "subsidized";
17538
17542
  const region = land ? choose(world.lands, land, "region") : undefined;
@@ -18768,12 +18772,12 @@ var unit = [
18768
18772
  summary: "List military units and their recruitment messages.",
18769
18773
  args: [flag("search", string2().trim().min(1).max(100), { source: "Part of the military unit name, any case" }), flag("country", undefined, { source: "Unit country, or all (default: your citizenship)" })],
18770
18774
  paged: true,
18771
- sort: { keys: { id: "asc", members: "desc", "battle-points-today": "desc" }, default: "id", order: true },
18775
+ sort: { keys: { id: "asc", members: "desc", "battle-points-today": "desc" }, default: "id" },
18772
18776
  examples: [
18773
18777
  "esim unit list",
18774
18778
  "esim unit list --sort battle-points-today",
18775
18779
  "esim unit list --search home --sort members --limit 5",
18776
- "esim unit list --country Poland --sort members --order asc --limit 10"
18780
+ "esim unit list --country Poland --sort members --limit 10"
18777
18781
  ],
18778
18782
  operations: ["me", "get-geography", "list-units"],
18779
18783
  output: { items: "Military units", total: "Units matching the search and country", nextCursor: "Next directory page cursor" },
@@ -18798,7 +18802,7 @@ var unit = [
18798
18802
  limit: 20,
18799
18803
  ...typeof args.search === "string" ? { q: args.search } : {},
18800
18804
  ...unitSorts[string4(args.sort)] ? { sort: unitSorts[string4(args.sort)] } : {},
18801
- ...orderQuery(args)
18805
+ ...orderQuery(ctx)
18802
18806
  });
18803
18807
  const entries = view.items;
18804
18808
  total = view.total;
@@ -19817,8 +19821,8 @@ var party = [
19817
19821
  summary: "List a country's parties ranked by members, prestige, seats, presidents or laws.",
19818
19822
  args: [flag("search", string2().trim().min(1).max(100), { source: "Part of the party name, any case" }), flag("country", undefined, { source: "Party country (default: your citizenship)" })],
19819
19823
  paged: true,
19820
- sort: { keys: { members: "desc", prestige: "desc", congress: "desc", presidents: "desc", laws: "desc" }, default: "members", order: true },
19821
- examples: ["esim party list", "esim party list --search green --country Poland", "esim party list --country Poland --sort prestige --order desc --limit 5"],
19824
+ sort: { keys: { members: "desc", prestige: "desc", congress: "desc", presidents: "desc", laws: "desc" }, default: "members" },
19825
+ examples: ["esim party list", "esim party list --search green --country Poland", "esim party list --country Poland --sort prestige --limit 5"],
19822
19826
  operations: pager,
19823
19827
  output: { items: "Ranked parties", total: "Parties in the country", nextCursor: "Next page cursor" },
19824
19828
  async run(ctx, args) {
@@ -19833,7 +19837,7 @@ var party = [
19833
19837
  total: true,
19834
19838
  sort: query,
19835
19839
  ...typeof args.search === "string" ? { q: args.search } : {},
19836
- ...orderQuery(args)
19840
+ ...orderQuery(ctx)
19837
19841
  }, (entry) => ({
19838
19842
  party: organizationRef(entry),
19839
19843
  country: countryRef(world, entry.nation),
@@ -23045,7 +23049,7 @@ async function runJobList(ctx, args) {
23045
23049
  const citizen = country === undefined || authenticated(ctx) ? (await ctx.call("me")).citizen : null;
23046
23050
  const world = await geography(ctx);
23047
23051
  const sort = String(args.sort ?? "id");
23048
- const order = textArg(args, "order") ?? { id: "desc", wage: "desc", skill: "asc" }[sort];
23052
+ const order = ctx.command.sort?.keys[sort];
23049
23053
  if (order === undefined)
23050
23054
  return usage2("Choose a valid job sort key.");
23051
23055
  const filters = { sort, order };
@@ -23142,7 +23146,7 @@ var jobs = [
23142
23146
  flag("employer", _enum(["system", "players"]), { source: "system is the Game Bank" }),
23143
23147
  flag("eligible", boolean2(), { source: "Only offers whose minimum economy skill you meet (server filter); each row still says when an offer needs travel or you already have a job" })
23144
23148
  ],
23145
- sort: { keys: { id: "desc", wage: "desc", skill: "asc" }, default: "id", order: true },
23149
+ sort: { keys: { id: "desc", wage: "desc", skill: "asc" }, default: "id" },
23146
23150
  examples: [
23147
23151
  "esim job list",
23148
23152
  "esim job list --eligible --sort wage --limit 5",
@@ -23304,9 +23308,8 @@ function reject2(code, message, context, next) {
23304
23308
 
23305
23309
  // commands/market.ts
23306
23310
  var command5 = define("economy");
23307
- var countryFlag2 = flag("country", string2().trim().min(1), { source: "Country name, code or ID whose market to browse; any or all (the default) browses every market" });
23311
+ var countryFlag2 = flag("country", string2().trim().min(1), { source: "Country name, code or ID whose market to browse; all (the default) browses every market" });
23308
23312
  var buyCountry = flag("country", string2().trim().min(1), { source: "Country name, code or ID of the market; you can only buy where the country controls your region (the default)" });
23309
- var everyCountry = (name) => name !== undefined && ["any", "all"].includes(name.trim().toLowerCase());
23310
23313
  var quantity = { ...positional("quantity", true, exports_coerce.number().pipe(int().positive())), source: "Number of units" };
23311
23314
  var product = { ...positional("product"), source: productHelp };
23312
23315
  var dryRun2 = flag("dry-run", boolean2());
@@ -23597,7 +23600,7 @@ var market = [
23597
23600
  countryFlag2,
23598
23601
  flag("min-qty", exports_coerce.number().int().min(1), { placeholder: "units", source: "Only offers with at least this many units left" })
23599
23602
  ],
23600
- sort: { keys: { ...productSorts, ...offerSorts }, order: true },
23603
+ sort: { keys: { ...productSorts, ...offerSorts } },
23601
23604
  help: [
23602
23605
  `Product summary, default offers desc: ${sortChoices(productSorts)}.`,
23603
23606
  `Offers for a product, default price asc: ${sortChoices(offerSorts)}. Price compares Gold equivalents in both views.`
@@ -23607,9 +23610,8 @@ var market = [
23607
23610
  "esim market list --country China",
23608
23611
  "esim market list snack",
23609
23612
  "esim market list jinxed:q3 --sort quantity",
23610
- "esim market list snack --min-qty 10 --sort price --order asc --limit 5",
23611
- "esim market list snack --country China",
23612
- "esim market list grain --country Poland --order desc"
23613
+ "esim market list snack --min-qty 10 --sort price --limit 5",
23614
+ "esim market list snack --country China"
23613
23615
  ],
23614
23616
  output: { ...pageOutput3, next: "Open product offers, or preview a purchase and find currency" },
23615
23617
  paged: true,
@@ -23626,12 +23628,12 @@ var market = [
23626
23628
  }
23627
23629
  const world = await geography(ctx);
23628
23630
  const countryName = textArg(args, "country");
23629
- const country = countryName && !everyCountry(countryName) ? choose(world.countries, countryName, "country").id : undefined;
23631
+ const country = countryName && countryName !== "all" ? choose(world.countries, countryName, "country").id : undefined;
23630
23632
  const marketCountry = countryRef(world, country);
23631
23633
  const header = { command: ctx.command, args: { ...ctx.args, sort } };
23632
23634
  const filters = {
23633
23635
  ...country === undefined ? {} : { country },
23634
- ...orderQuery(args),
23636
+ ...orderQuery(ctx, sort),
23635
23637
  ...typeof args["min-qty"] === "number" ? { minQty: args["min-qty"] } : {}
23636
23638
  };
23637
23639
  if (!input || !item) {
@@ -23972,8 +23974,8 @@ var market = [
23972
23974
  session: true,
23973
23975
  summary: "Your active market offers, then the cheapest offer per product in your local market",
23974
23976
  args: [],
23975
- sort: { keys: { price: "asc" }, default: "price", order: true },
23976
- examples: ["esim market", "esim market --order desc", "esim market --sort price --order desc --limit 5"],
23977
+ sort: { keys: { price: "asc" }, default: "price" },
23978
+ examples: ["esim market", "esim market --sort price --limit 5", "esim market --all --max 50"],
23977
23979
  paged: true,
23978
23980
  output: {
23979
23981
  ...pageOutput3,
@@ -23982,11 +23984,11 @@ var market = [
23982
23984
  },
23983
23985
  operations: ["me", "get-geography", "region", "market-orders", "list-market-summary"],
23984
23986
  view: mineView,
23985
- async run(ctx, args) {
23987
+ async run(ctx) {
23986
23988
  const account = await ctx.call("me");
23987
23989
  const citizen = account.citizen;
23988
23990
  const world = await geography(ctx);
23989
- const page = await ctx.page("market-orders", { seller: string4(citizen.pid), ...orderQuery(args) }, (order) => listing(order, world, citizen.pid));
23991
+ const page = await ctx.page("market-orders", { seller: string4(citizen.pid), ...orderQuery(ctx) }, (order) => listing(order, world, citizen.pid));
23990
23992
  const overview = await observe(() => localMarket(ctx, citizen, world, page.items));
23991
23993
  return { ...page, overview, next: marketNext(page, overview, account, world) };
23992
23994
  }
@@ -24111,7 +24113,7 @@ var kindFlags = {
24111
24113
  special: ["special"],
24112
24114
  company: ["company-level", "company-product"]
24113
24115
  };
24114
- var commonFlags = ["status", "kind", "seller", "min-price", "max-price", "no-bids", "sort", "order", "limit"];
24116
+ var commonFlags = ["status", "kind", "seller", "min-price", "max-price", "no-bids", "sort", "limit"];
24115
24117
  var filters = [
24116
24118
  status,
24117
24119
  flag("kind", _enum(kinds2), { source: "Lot kind: equipment, special (special item) or company" }),
@@ -24126,7 +24128,7 @@ var filters = [
24126
24128
  flag("max-price", money, { source: "Highest public price in Gold, e.g. 2.50" }),
24127
24129
  flag("no-bids", boolean2(), { source: "Only auctions nobody has bid on" })
24128
24130
  ];
24129
- var sortKeys2 = { time: "asc", price: "desc", bids: "desc" };
24131
+ var sortKeys2 = { time: "asc", price: "desc", cheapest: "asc", bids: "desc" };
24130
24132
  var assetOps = ["me", "list-my-special-items", "list-my-equipment", "list-companies", "list-own-auctions", "list-factory-sales"];
24131
24133
  var confirmWith = ["esim auction"];
24132
24134
  var confirmUsing = (args) => [`esim auction show ${args.auction}`];
@@ -24227,12 +24229,12 @@ function filterQuery(args) {
24227
24229
  }
24228
24230
  const effective = kind ?? used[0]?.group;
24229
24231
  const sort = textArg(args, "sort") ?? "time";
24230
- const order = textArg(args, "order");
24232
+ const order = sortKeys2[sort];
24231
24233
  const minPrice = typeof args["min-price"] === "number" ? args["min-price"] : undefined;
24232
24234
  const maxPrice = typeof args["max-price"] === "number" ? args["max-price"] : undefined;
24233
24235
  const list = (value) => Array.isArray(value) ? value.join(",") : undefined;
24234
24236
  const applied = [
24235
- `${sort} ${order ?? sortKeys2[sort]}`,
24237
+ `${sort} ${order}`,
24236
24238
  ...args.status && args.status !== "open" ? [String(args.status)] : [],
24237
24239
  ...effective ? [effective] : [],
24238
24240
  ...special ? [special] : [],
@@ -24247,8 +24249,8 @@ function filterQuery(args) {
24247
24249
  ];
24248
24250
  return { applied, query: {
24249
24251
  ...args.status && args.status !== "all" ? { status: args.status } : {},
24250
- sort,
24251
- ...order ? { order } : {},
24252
+ sort: sort === "cheapest" ? "price" : sort,
24253
+ order,
24252
24254
  ...effective ? { kind: effective } : {},
24253
24255
  ...special ? { specialItem: special } : {},
24254
24256
  ...Array.isArray(quality) ? { quality: [...new Set(quality.map(Number))].sort((a, b) => a - b) } : {},
@@ -24499,13 +24501,13 @@ var auction = [
24499
24501
  },
24500
24502
  summary: "Browse auctions by status, kind, seller, price and bids, sorted on the server.",
24501
24503
  args: filters,
24502
- sort: { keys: { ...sortKeys2 }, default: "time", order: true },
24504
+ sort: { keys: { ...sortKeys2 }, default: "time" },
24503
24505
  view: (data) => directoryView(row2(data)),
24504
24506
  paged: true,
24505
24507
  examples: [
24506
24508
  "esim auction list",
24507
24509
  "esim auction list --kind special --special medkit --no-bids",
24508
- "esim auction list --kind equipment --quality 5 --slot helmet --sort price --order asc --limit 10",
24510
+ "esim auction list --kind equipment --quality 5 --slot helmet --sort cheapest --limit 10",
24509
24511
  "esim auction list --seller system --max-price 0.50",
24510
24512
  "esim auction list --kind company --company-level 0 --company-product minerals"
24511
24513
  ],
@@ -25734,18 +25736,18 @@ var article = [
25734
25736
  flag("paper", undefined, { source: "Newspaper ID or name" }),
25735
25737
  flag("category", category, { source: "Article category" })
25736
25738
  ],
25737
- sort: { keys: { recent: "desc", top: "desc" }, default: "recent", order: true },
25739
+ sort: { keys: { recent: "desc", top: "desc" }, default: "recent" },
25738
25740
  examples: [
25739
25741
  "esim article list --sort top",
25740
- "esim article list --search election --country China --order asc",
25741
- "esim article list --category military --country Poland --sort top --order desc --limit 5",
25742
+ "esim article list --search election --country China",
25743
+ "esim article list --category military --country Poland --sort top --limit 5",
25742
25744
  "esim article list --paper 3"
25743
25745
  ],
25744
25746
  output: pageFields,
25745
25747
  operations: ["get-geography", "list-articles", "me", ...paperOperations],
25746
25748
  view: listView2,
25747
25749
  async run(ctx, args) {
25748
- const params = { sort: string4(args.sort), ...orderQuery(args) };
25750
+ const params = { sort: string4(args.sort), ...orderQuery(ctx) };
25749
25751
  if (typeof args.search === "string")
25750
25752
  params.query = args.search;
25751
25753
  if (typeof args.category === "string")
@@ -28427,8 +28429,8 @@ var company = [
28427
28429
  flag("owner", undefined, { source: "Citizen who owns the factory (ID or name)" }),
28428
28430
  flag("unit", id, { source: "Military unit ID that owns the factory" })
28429
28431
  ],
28430
- sort: { keys: { id: "asc", workers: "desc" }, default: "id", order: true },
28431
- examples: ["esim company list --sort workers", "esim company list --search mill --owner 42", "esim company list --product grain --region 'East China' --sort workers --order desc --limit 10"],
28432
+ sort: { keys: { id: "asc", workers: "desc" }, default: "id" },
28433
+ examples: ["esim company list --sort workers", "esim company list --search mill --owner 42", "esim company list --product grain --region 'East China' --sort workers --limit 10"],
28432
28434
  output: pageOutput4,
28433
28435
  operations: ["get-geography", "list-companies", "me", "list-citizens"],
28434
28436
  async run(ctx, args) {
@@ -28444,7 +28446,7 @@ var company = [
28444
28446
  ...typeof args.unit === "number" ? { unitId: args.unit } : {},
28445
28447
  ...args.sort === "workers" ? { sort: "employees" } : {},
28446
28448
  ...typeof args.search === "string" ? { q: args.search } : {},
28447
- ...orderQuery(args)
28449
+ ...orderQuery(ctx)
28448
28450
  });
28449
28451
  return { ...page, items: page.items.map((entry) => companyInfo(entry, world, self)) };
28450
28452
  }
@@ -29109,12 +29111,12 @@ var company = [
29109
29111
  flag("max-price", money, { source: "Highest price in Gold, as displayed, e.g. 45.00" }),
29110
29112
  flag("seller", undefined, { source: "Citizen offering the factory (ID or name)" })
29111
29113
  ],
29112
- sort: { keys: { price: "asc", level: "desc" }, default: "price", order: true },
29114
+ sort: { keys: { price: "asc", level: "desc" }, default: "price" },
29113
29115
  examples: [
29114
29116
  "esim company sales",
29115
29117
  "esim company sales --product pistol --level 3 --sort level",
29116
- "esim company sales --product grain --min-level 2 --max-price 45.00 --sort price --order asc --limit 5",
29117
- "esim company sales --country Poland --max-level 3 --order desc --page 2"
29118
+ "esim company sales --product grain --min-level 2 --max-price 45.00 --sort price --limit 5",
29119
+ "esim company sales --country Poland --max-level 3 --page 2"
29118
29120
  ],
29119
29121
  output: { items: "Matching listings on this page", total: "Matching listings across all pages" },
29120
29122
  operations: ["get-geography", "list-factory-sales", "me", "list-citizens"],
@@ -29138,7 +29140,7 @@ var company = [
29138
29140
  ...typeof args["max-price"] === "number" ? { maxPrice: args["max-price"] } : {},
29139
29141
  ...seller ? { seller } : {},
29140
29142
  sort: string4(args.sort),
29141
- ...orderQuery(args)
29143
+ ...orderQuery(ctx)
29142
29144
  });
29143
29145
  return listHeader(ctx, { items: page.items.map((entry) => sale(entry, world, self)), total: page.total }, typeof args["max-price"] === "number" ? { "max-price": `${gold3(args["max-price"]).value} GOLD` } : {});
29144
29146
  }
@@ -29471,12 +29473,12 @@ var exchange = [
29471
29473
  flag("pay", undefined, { source: "Currency you pay with (default: GOLD; your country's currency when <currency> is GOLD)" }),
29472
29474
  flag("min-qty", money, { source: "Only offers with at least this much left, in the currency offered for sale (the <currency> argument), e.g. 10.50" })
29473
29475
  ],
29474
- sort: { keys: { rate: "asc", qty: "desc" }, default: "rate", order: true },
29476
+ sort: { keys: { rate: "asc", qty: "desc" }, default: "rate" },
29475
29477
  examples: [
29476
29478
  "esim exchange list",
29477
29479
  "esim exchange list GOLD",
29478
29480
  "esim exchange list PLN --pay GOLD --sort qty",
29479
- "esim exchange list PLN --pay GOLD --min-qty 100 --sort rate --order asc --limit 5"
29481
+ "esim exchange list PLN --pay GOLD --min-qty 100 --sort rate --limit 5"
29480
29482
  ],
29481
29483
  output: pageOutput4,
29482
29484
  operations: ["me", "get-geography", "list-fx-orders"],
@@ -29496,7 +29498,7 @@ var exchange = [
29496
29498
  sellAsset,
29497
29499
  buyAsset,
29498
29500
  sort: string4(args.sort),
29499
- ...orderQuery(args),
29501
+ ...orderQuery(ctx),
29500
29502
  ...typeof args["min-qty"] === "number" ? { minQty: args["min-qty"] } : {}
29501
29503
  });
29502
29504
  return listHeader(ctx, { ...page, items: page.items.map((entry) => listing3(entry, world, pid2(me))) }, {
@@ -30383,8 +30385,8 @@ var stockCommands = [
30383
30385
  summary: "Browse the stock company rankings",
30384
30386
  paged: true,
30385
30387
  args: [flag("country", undefined, { source: "Company country" }), flag("page", exports_coerce.number().int().min(1).max(1e5), { default: 1, source: "Ranking page to start from" })],
30386
- sort: { keys: { shares: "desc", turnover: "desc" }, default: "shares", order: true },
30387
- examples: ["esim stock list", "esim stock list --sort turnover", "esim stock list --country Poland --sort turnover --order asc --limit 5"],
30388
+ sort: { keys: { shares: "desc", turnover: "desc" }, default: "shares" },
30389
+ examples: ["esim stock list", "esim stock list --sort turnover", "esim stock list --country Poland --sort turnover --limit 5"],
30388
30390
  output: { ...pageOutput4, total: "Number of ranked companies", next: "Continue the ranking" },
30389
30391
  operations: ["get-geography", "list-stock-company-rankings"],
30390
30392
  async run(ctx, args) {
@@ -30403,7 +30405,7 @@ var stockCommands = [
30403
30405
  const items = [];
30404
30406
  while (items.length < count && rank <= lastRank) {
30405
30407
  const page = Math.ceil(rank / pageSize);
30406
- const result = await ctx.call("list-stock-company-rankings", { metric, page, ...nation === undefined ? {} : { nation }, ...orderQuery(args) });
30408
+ const result = await ctx.call("list-stock-company-rankings", { metric, page, ...nation === undefined ? {} : { nation }, ...orderQuery(ctx) });
30407
30409
  total = number4(result.total);
30408
30410
  const start = (rank - 1) % pageSize;
30409
30411
  const batch = result.items.slice(start, start + count - items.length);
@@ -30424,7 +30426,7 @@ var stockCommands = [
30424
30426
  items,
30425
30427
  nextCursor: truncated ? String(rank) : null,
30426
30428
  truncated,
30427
- next: truncated ? [{ run: `esim stock list --sort ${metric}${typeof args.order === "string" ? ` --order ${args.order}` : ""}${nation === undefined ? "" : ` --country ${nation}`} --cursor ${rank}` }] : []
30429
+ next: truncated ? [{ run: `esim stock list --sort ${metric}${nation === undefined ? "" : ` --country ${nation}`} --cursor ${rank}` }] : []
30428
30430
  };
30429
30431
  }
30430
30432
  }),
@@ -31176,7 +31178,7 @@ function gearNext(owned, recycleFree, recyclable) {
31176
31178
  }
31177
31179
 
31178
31180
  // commands/items.ts
31179
- var vendorAuctions = "esim auction list --kind equipment --seller system --sort price --order asc";
31181
+ var vendorAuctions = "esim auction list --kind equipment --seller system --sort cheapest";
31180
31182
  var practicalSources = [
31181
31183
  "Item vendor helmets: esim auction list --kind equipment --seller system",
31182
31184
  "travel: 4% a trip, 8% on a business ticket — esim travel --help",
@@ -31210,11 +31212,11 @@ var items3 = [
31210
31212
  session: true,
31211
31213
  args: [
31212
31214
  flag("kind", _enum(["stock", "equipment", "potions"]), { source: "Only this part of the inventory" }),
31213
- flag("product", undefined, { source: "Only stock of this product (its name, such as SNACK or iron) and potions of this kind" }),
31214
- flag("sort", _enum(["name", "quantity"]), { source: "Order of the stock rows: name (A-Z) or quantity (largest first); default as stored" })
31215
+ flag("product", undefined, { source: "Only stock of this product (its name, such as SNACK or iron) and potions of this kind" })
31215
31216
  ],
31217
+ sort: { keys: { name: "asc", quantity: "desc" } },
31216
31218
  examples: ["esim inventory", "esim inventory --kind stock --sort quantity", "esim inventory --product snack", "esim inventory --kind equipment --limit 50"],
31217
- help: ["Stock and potions are complete lists; equipment pages (--limit, --cursor). Browse equipment with esim gear list; equip, sell, upgrade and recycle it with esim gear."],
31219
+ help: ["Stock and potions are complete lists; equipment pages (--limit, --cursor). Browse equipment with esim gear list; use esim gear to equip, upgrade or recycle it. List equipment with esim auction sell equipment."],
31218
31220
  output: {
31219
31221
  stock: "Available items and quantities",
31220
31222
  equipment: "Owned equipment and its next cursor",
@@ -31253,12 +31255,12 @@ var items3 = [
31253
31255
  return typeof warehouse.house === "number" && warehouse.house > 0 ? `house: +${warehouse.house} food uses a day` : null;
31254
31256
  }) : undefined;
31255
31257
  const filters = [kind, wanted && `product ${wanted}`, sort && `sorted ${sort}`].filter(Boolean).join(" · ");
31256
- return { ...filters ? { showing: filters } : {}, stock, equipment, potions, housing, next: [{ run: "esim gear", note: "equipment: wear, equip, sell, upgrade, recycle" }, { run: "esim potion" }] };
31258
+ return { ...filters ? { showing: filters } : {}, stock, equipment, potions, housing, next: [{ run: "esim gear", note: "equipment: wear, equip, upgrade, recycle" }, { run: "esim potion" }] };
31257
31259
  }
31258
31260
  }),
31259
31261
  command15({
31260
31262
  path: ["gear"],
31261
- summary: "Your equipment: what you wear, spares, equip, sell, upgrade, recycle",
31263
+ summary: "Your equipment: what you wear, spares, equip, upgrade, recycle",
31262
31264
  args: [],
31263
31265
  session: true,
31264
31266
  examples: ["esim gear"],
@@ -31336,13 +31338,13 @@ var items3 = [
31336
31338
  flag("state", _enum(["worn", "spare"]), { source: "worn: equipped items only; spare: unworn items only" }),
31337
31339
  { ...flag("stat", _enum(gearStats), { source: "Only items that have every listed stat; repeat or comma-separate" }), repeatable: true }
31338
31340
  ],
31339
- sort: { keys: gearSortKeys, default: "id", order: true },
31341
+ sort: { keys: gearSortKeys, default: "id" },
31340
31342
  examples: [
31341
31343
  "esim gear list",
31342
31344
  "esim gear list --state spare --sort quality",
31343
- "esim gear list --slot helmet --quality 3 --sort id --order desc --limit 10",
31345
+ "esim gear list --slot helmet --quality 3 --sort quality --limit 10",
31344
31346
  "esim gear list --stat baseHit,strength --sort baseHit --limit 5",
31345
- "esim gear list --state spare --stat criticalChance --sort criticalChance --order asc --limit 10"
31347
+ "esim gear list --state spare --stat criticalChance --sort criticalChance --limit 10"
31346
31348
  ],
31347
31349
  help: ["Sorting by a stat sums repeated modifiers on one item and counts a missing stat as zero; the sorted stat is shown as its own column."],
31348
31350
  output: {
@@ -31357,14 +31359,14 @@ var items3 = [
31357
31359
  view: listView3,
31358
31360
  async run(ctx, args) {
31359
31361
  const sort = textArg(args, "sort") ?? "id";
31360
- const order = textArg(args, "order");
31362
+ const order = gearSortKeys[sort] ?? "asc";
31361
31363
  const state = textArg(args, "state");
31362
31364
  const quality = intArg(args, "quality");
31363
31365
  const slot = textArg(args, "slot");
31364
31366
  const stats = Array.isArray(args.stat) ? args.stat : [];
31365
31367
  const query = {
31366
31368
  sort,
31367
- ...order ? { order } : {},
31369
+ order,
31368
31370
  ...slot ? { slot: apiSlot(slot) } : {},
31369
31371
  ...quality ? { quality } : {},
31370
31372
  ...state ? { equipped: state === "worn" } : {},
@@ -31373,7 +31375,7 @@ var items3 = [
31373
31375
  const sortedStat = gearStats.includes(sort) ? sort : undefined;
31374
31376
  const page = await ctx.page("list-my-equipment", query, (item) => ({ ...listedFacts(item, sortedStat), next: itemNext(item) }));
31375
31377
  const applied = [
31376
- `${sort} ${order ?? gearSortKeys[sort] ?? "asc"}`,
31378
+ `${sort} ${order}`,
31377
31379
  ...slot ? [slot] : [],
31378
31380
  ...quality ? [`quality ${quality}`] : [],
31379
31381
  ...state ? [state] : [],
@@ -33725,8 +33727,8 @@ var paperCommands = [
33725
33727
  flag("country", undefined, { source: "Newspaper country" }),
33726
33728
  flag("page", exports_coerce.number().int().positive(), { source: "Ranking page to start from" })
33727
33729
  ],
33728
- sort: { keys: { subscribers: "desc" }, default: "subscribers", order: true },
33729
- examples: ["esim paper list", "esim paper list --search times", "esim paper list --country Poland --sort subscribers --order asc --limit 5"],
33730
+ sort: { keys: { subscribers: "desc" }, default: "subscribers" },
33731
+ examples: ["esim paper list", "esim paper list --search times", "esim paper list --country Poland --sort subscribers --limit 5"],
33730
33732
  output: { ...pageFields, total: "Total ranked newspapers", page: "Ranking page number" },
33731
33733
  operations: ["get-geography", "list-newspaper-rankings", "me"],
33732
33734
  async run(ctx, args) {
@@ -33751,7 +33753,7 @@ var paperCommands = [
33751
33753
  page,
33752
33754
  ...nation !== undefined ? { nation } : {},
33753
33755
  ...typeof args.search === "string" ? { q: args.search } : {},
33754
- ...orderQuery(args)
33756
+ ...orderQuery(ctx)
33755
33757
  });
33756
33758
  total = result.total;
33757
33759
  const batch = result.items.slice(index % 20, index % 20 + limit - items.length);
@@ -35237,13 +35239,13 @@ var ranking = boards.map(({ kind, operation, metrics }) => command31({
35237
35239
  "catalogCount counts achievements (esim achievement list)."
35238
35240
  ] } : {},
35239
35241
  args: kind === "countries" ? [] : [flag("country", undefined, { source: "Only entries from this country" })],
35240
- sort: { keys: Object.fromEntries(metrics.map((metric) => [metric, "desc"])), default: metrics[0], order: kind === "parties" },
35242
+ sort: { keys: Object.fromEntries(metrics.map((metric) => [metric, "desc"])), default: metrics[0] },
35241
35243
  paged: true,
35242
35244
  operations: ["get-geography", operation, ...kind === "citizens" ? ["me", ...Object.values(citizenBoards)] : kind === "new" ? ["me"] : []],
35243
35245
  examples: [
35244
35246
  `esim ranking ${kind}`,
35245
35247
  `esim ranking ${kind} --sort ${metrics[1]}`,
35246
- kind === "countries" ? `esim ranking countries --sort ${metrics[2]} --limit 10` : `esim ranking ${kind} --country Poland --sort ${metrics[1]}${kind === "parties" ? " --order asc" : ""} --limit 10`
35248
+ kind === "countries" ? `esim ranking countries --sort ${metrics[2]} --limit 10` : `esim ranking ${kind} --country Poland --sort ${metrics[1]} --limit 10`
35247
35249
  ],
35248
35250
  output: { metric: "Metric used to order the rankings", ...pageOutput, total: "Entries in this ranking" },
35249
35251
  async run(ctx, args) {
@@ -35275,7 +35277,7 @@ var ranking = boards.map(({ kind, operation, metrics }) => command31({
35275
35277
  };
35276
35278
  };
35277
35279
  if (kind === "parties") {
35278
- const entries = await ctx.call(operation, { ...nation === undefined ? {} : { nation }, statisticType: metric, ...orderQuery(args) });
35280
+ const entries = await ctx.call(operation, { ...nation === undefined ? {} : { nation }, statisticType: metric, ...orderQuery(ctx) });
35279
35281
  return { metric, ...localPoliticalPage(args, entries.map(transform)), total: entries.length };
35280
35282
  }
35281
35283
  let total;
@@ -36192,7 +36194,7 @@ var invite = [
36192
36194
  session: true,
36193
36195
  paged: true,
36194
36196
  args: [],
36195
- sort: { keys: { registered: "desc", name: "asc", xp: "desc", gold: "desc", country: "asc" }, default: "registered", order: false },
36197
+ sort: { keys: { registered: "desc", name: "asc", xp: "desc", gold: "desc", country: "asc" }, default: "registered" },
36196
36198
  examples: ["esim invite", "esim invite --sort gold", "esim invite --sort xp --limit 5"],
36197
36199
  help: [
36198
36200
  "New citizens who register through your link become your recruits. Rewards are paid by the server when recruits reach level 10;",
@@ -36334,47 +36336,8 @@ var dividend = [
36334
36336
  })
36335
36337
  ];
36336
36338
 
36337
- // commands/gear-sell.ts
36338
- var sell = auction.find((command) => command.path.join(" ") === "auction sell");
36339
- var command40 = define("items");
36340
- var gearSell = [
36341
- command40({
36342
- path: ["gear", "sell"],
36343
- summary: "Put one unworn piece of your equipment up for auction",
36344
- session: true,
36345
- args: [
36346
- positional("equipment", true, id),
36347
- flag("price", transactionMoney, { required: true, source: "Starting price in Gold, for example 2.50" }),
36348
- flag("hours", _enum(["6", "12", "24", "36", "48"]), { default: "24", source: "Auction length; web default 24 hours" }),
36349
- flag("dry-run", boolean2())
36350
- ],
36351
- examples: ["esim gear sell 7 --price 2.50 --dry-run", "esim gear sell 7 --price 10 --hours 48"],
36352
- help: [
36353
- "Same as esim auction sell equipment <id> --start <price>: listing costs 1% of the starting price, a sale 2%.",
36354
- "Equipment trades only by auction or contract. Your auctions: esim auction."
36355
- ],
36356
- retry: sell.retry,
36357
- confirmWith: sell.confirmWith,
36358
- output: sell.output,
36359
- operations: sell.operations,
36360
- ...sell.view ? { view: sell.view } : {},
36361
- async run(ctx, args) {
36362
- if (typeof args.price !== "number")
36363
- return usage2("Give --price.");
36364
- return sell.run(ctx, {
36365
- kind: "equipment",
36366
- asset: String(args.equipment),
36367
- qty: 1,
36368
- start: args.price,
36369
- hours: args.hours,
36370
- "dry-run": args["dry-run"]
36371
- });
36372
- }
36373
- })
36374
- ];
36375
-
36376
36339
  // commands/wallet.ts
36377
- var command41 = define("economy");
36340
+ var command40 = define("economy");
36378
36341
  var ledgerKinds = object({ enum: array(string2()).nonempty() }).parse(operations.get("list-my-ledger")?.parameters.find((parameter) => parameter.name === "kind")?.schema).enum;
36379
36342
  var descriptions = {
36380
36343
  wage: "Wage",
@@ -36467,7 +36430,7 @@ function historyRow(entry) {
36467
36430
  };
36468
36431
  }
36469
36432
  var wallet2 = [
36470
- command41({
36433
+ command40({
36471
36434
  path: ["wallet"],
36472
36435
  groupSummary: "Your Gold and currency balances, and the money ledger behind them",
36473
36436
  summary: "List your Gold and every currency you hold, largest first, with the country each currency belongs to",
@@ -36504,7 +36467,7 @@ var wallet2 = [
36504
36467
  };
36505
36468
  }
36506
36469
  }),
36507
- command41({
36470
+ command40({
36508
36471
  path: ["wallet", "history"],
36509
36472
  session: true,
36510
36473
  paged: true,
@@ -36520,11 +36483,11 @@ var wallet2 = [
36520
36483
  flag("since", timeInput, { source: "Earliest movement: a UTC date (2026-11-28), a duration back from now (7d, 12h) or an RFC 3339 time" }),
36521
36484
  flag("until", timeInput, { source: "Latest movement, inclusive; same forms as --since (a date includes the whole day)" })
36522
36485
  ],
36523
- sort: { keys: { time: "desc" }, default: "time", order: true },
36486
+ sort: { keys: { time: "desc" }, default: "time" },
36524
36487
  examples: [
36525
36488
  "esim wallet history",
36526
36489
  "esim wallet history --currency GOLD --since 7d",
36527
- "esim wallet history --currency CNY --kind wage --sort time --order asc --limit 5",
36490
+ "esim wallet history --currency CNY --kind wage --sort time --limit 5",
36528
36491
  "esim wallet history --since 2026-11-01 --until 2026-11-28 --all --max 200"
36529
36492
  ],
36530
36493
  operations: ["get-geography", "list-my-ledger", "me", "clock"],
@@ -36541,7 +36504,7 @@ var wallet2 = [
36541
36504
  return usage2(`--since (${from}) is after --until (${to}).`, "Swap the two values or widen the range.");
36542
36505
  const page = await ctx.page("list-my-ledger", {
36543
36506
  sort: "time",
36544
- ...orderQuery(args),
36507
+ ...orderQuery(ctx),
36545
36508
  ...currency.length ? { currency } : {},
36546
36509
  ...typeof args.kind === "string" ? { kind: args.kind } : {},
36547
36510
  ...from ? { from } : {},
@@ -36562,7 +36525,7 @@ var wallet2 = [
36562
36525
  ];
36563
36526
 
36564
36527
  // command.ts
36565
- var declarations = [...daily, home, ...battle, ...market, ...company, ...exchange, ...contract, ...stockCommands, ...travel, ...visualWorld, ...items3, ...jobs, ...social, ...urgency, ...profile, ...shout, ...article, ...paperCommands, ...friend, ...gift, ...tutorial, ...unit, ...party, ...war, ...tournament, ...duel, ...auction, ...item, ...building, ...ranking, ...events2, ...alliance, ...coalition, ...congress, ...country, ...election, ...referendum, ...game, ...achievement, ...potion, ...specialShop, ...promo, ...invite, ...npc, ...dividend, ...gearSell, ...wallet2, ...feedback].map(headed);
36528
+ var declarations = [...daily, home, ...battle, ...market, ...company, ...exchange, ...contract, ...stockCommands, ...travel, ...visualWorld, ...items3, ...jobs, ...social, ...urgency, ...profile, ...shout, ...article, ...paperCommands, ...friend, ...gift, ...tutorial, ...unit, ...party, ...war, ...tournament, ...duel, ...auction, ...item, ...building, ...ranking, ...events2, ...alliance, ...coalition, ...congress, ...country, ...election, ...referendum, ...game, ...achievement, ...potion, ...specialShop, ...promo, ...invite, ...npc, ...dividend, ...wallet2, ...feedback].map(headed);
36566
36529
  var commands2 = declarations.map(({ path, summary, write }) => ({ path, summary, write }));
36567
36530
  var groups2 = [
36568
36531
  { name: "me", commands: ["today", "home", "profile", "work", "train", "eat", "drink", "claim", "tutorial", "inventory", "wallet", "gear", "item", "potion", "game", "achievement", "promo", "feedback"] },
@@ -36594,14 +36557,8 @@ function sortFlags(command) {
36594
36557
  if (!sort)
36595
36558
  return [];
36596
36559
  const keys = Object.keys(sort.keys);
36597
- const directions = keys.map((key) => sort.keys[key]);
36598
- const common = directions.filter((direction) => direction === "desc").length * 2 > keys.length ? "desc" : "asc";
36599
- const exceptions = keys.filter((key) => sort.keys[key] !== common);
36600
- const defaults = keys.length > 6 ? [...exceptions.map((key) => `${key} ${sort.keys[key]}`), `others ${common}`].join(" · ") : keys.map((key) => `${key} ${sort.keys[key]}`).join(" · ");
36601
- return [
36602
- flag("sort", _enum(keys), { default: sort.default, source: "Sort key; sorting happens on the server, across all pages" }),
36603
- ...sort.order ? [flag("order", _enum(["asc", "desc"]), { source: `Sort direction; default per key: ${defaults}` })] : []
36604
- ];
36560
+ const directions = keys.map((key) => `${key} ${sort.keys[key]}`).join(" · ");
36561
+ return [flag("sort", _enum(keys), { default: sort.default, source: `Sort key and direction: ${directions}` })];
36605
36562
  }
36606
36563
  var argsFor = (command) => [...command.args, ...sortFlags(command), ...outputFlags, ...command.paged ? pageFlags : []];
36607
36564
  function schema(arg) {
@@ -36701,7 +36658,10 @@ function suggestions(input, known) {
36701
36658
  return [...new Set(known)].filter((name) => name !== input && (name.startsWith(input) || input.startsWith(name) || near(input, name))).map((name) => ({ name, rank: name.startsWith(input) ? 0 : 1, distance: editDistance(input, name) })).sort((a, b) => a.rank - b.rank || a.distance - b.distance || a.name.localeCompare(b.name, "en")).map(({ name }) => name);
36702
36659
  }
36703
36660
  function runnable(path) {
36704
- return actionHint(path.join(" ")) ?? `esim ${path.join(" ")}`;
36661
+ const name = path.join(" ");
36662
+ if (groupNames.has(name) && !topLevelCommands.has(name))
36663
+ return `esim help ${name}`;
36664
+ return actionHint(name) ?? `esim ${name}`;
36705
36665
  }
36706
36666
  var nounSynonyms = {
36707
36667
  equipment: "gear",
@@ -36749,13 +36709,6 @@ function unknownVerb(path, verb, children) {
36749
36709
  const best = names[0];
36750
36710
  return new CommandError(2, "unknown_command", `Unknown verb ${verb} for esim ${path.join(" ")}.${best ? ` Did you mean esim ${path.join(" ")} ${best}?` : ""}`, `Run esim ${path.join(" ")} --help.`, names.map((name) => ({ name: `${path.join(" ")} ${name}` })), { next: [{ run: best ? runnable([...path, best]) : `esim ${path.join(" ")} --help` }] });
36751
36711
  }
36752
- function withoutGroup(argv) {
36753
- const [group, word] = argv;
36754
- if (!group || !word || !groupNames.has(group) || word === "help" || !(topLevelCommands.has(word) || ["login", "logout"].includes(word)))
36755
- return argv;
36756
- const ownVerb = declarations.some((command) => command.path[0] === group && command.path[1] === word);
36757
- return ownVerb ? argv : argv.slice(1);
36758
- }
36759
36712
  function browseLines(command, indent) {
36760
36713
  if (!command.paged && !command.sort)
36761
36714
  return [];
@@ -36770,7 +36723,7 @@ function browseLines(command, indent) {
36770
36723
  const example = command.examples.find((entry) => entry.includes(" --")) ?? command.examples[0];
36771
36724
  return [
36772
36725
  ...filters.length ? [`${indent}filters: ${filters.join(" ")}`] : [],
36773
- ...sort ? [`${indent}sort: --sort ${sort}${command.sort?.order ? " --order asc|desc" : ""}`] : [],
36726
+ ...sort ? [`${indent}sort: --sort ${sort}`] : [],
36774
36727
  ...example ? [`${indent}e.g. ${example}`] : []
36775
36728
  ];
36776
36729
  }
@@ -36924,7 +36877,7 @@ function usageNotes(view) {
36924
36877
  return { ...view, next: view.next.map((entry) => {
36925
36878
  if (!isObject2(entry) || typeof entry.run !== "string" || !/^esim .+ --help$/.test(entry.run) || /['"\\]/.test(entry.run))
36926
36879
  return entry;
36927
- const argv = withoutGroup(entry.run.split(" ").slice(1, -1));
36880
+ const argv = entry.run.split(" ").slice(1, -1);
36928
36881
  const { children, command, path, args } = resolveCommand(argv);
36929
36882
  if (!command || children.length || path.length !== command.path.length)
36930
36883
  return entry;
@@ -36989,7 +36942,7 @@ function invocation(command, argv, verbs) {
36989
36942
  positionals.push(token);
36990
36943
  continue;
36991
36944
  }
36992
- const option = token === "-h" ? "help" : token.startsWith("--") ? token.slice(2) : "";
36945
+ const option = token.startsWith("--") ? token.slice(2) : "";
36993
36946
  const equals = option.indexOf("=");
36994
36947
  const name = equals < 0 ? option : option.slice(0, equals);
36995
36948
  const inline = equals < 0 ? undefined : option.slice(equals + 1);
@@ -37084,12 +37037,12 @@ async function normalizeResult(value, context) {
37084
37037
  return normalizeTimes(value, context.now, sampled ? context.now : NaN);
37085
37038
  }
37086
37039
  async function runCommand(input, options) {
37087
- const argv = !input.length && (options.credentials || options.authManaged || options.broker) ? ["today"] : withoutGroup(input);
37040
+ const argv = !input.length && (options.credentials || options.authManaged || options.broker) ? ["today"] : input;
37088
37041
  const [name, ...rest] = argv;
37089
37042
  const json = jsonRequested(argv);
37090
37043
  let context;
37091
37044
  try {
37092
- if ((!name || name === "--help" || name === "-h") && rest.length === 0) {
37045
+ if ((!name || name === "--help") && rest.length === 0) {
37093
37046
  options.stdout(rootHelp() + `
37094
37047
  `);
37095
37048
  return { exitCode: 0 };
@@ -37100,37 +37053,17 @@ async function runCommand(input, options) {
37100
37053
  return { exitCode: 0 };
37101
37054
  }
37102
37055
  if (name === "help") {
37103
- const helpArgs = rest.filter((argument) => argument !== "--json");
37056
+ const helpArgs = rest.filter((arg) => arg !== "--json");
37104
37057
  const [topic] = helpArgs;
37105
- if (topic === undefined) {
37106
- options.stdout(rootHelp() + `
37107
- `);
37108
- return { exitCode: 0 };
37109
- }
37110
- if (helpArgs.length === 1 && groupNames.has(topic)) {
37111
- options.stdout(groupHelp(topic) + `
37112
- `);
37113
- return { exitCode: 0 };
37114
- }
37115
- const target = withoutGroup(helpArgs);
37116
- const [targetName] = target;
37117
- if (targetName !== undefined && topLevelCommands.has(targetName) && target.every((word) => !word.startsWith("-"))) {
37118
- return runCommand([...target, "--help"], options);
37119
- }
37120
- if (helpArgs.length !== 1) {
37121
- throw new CommandError(2, "invalid_arguments", "Specify one command group or command.", "Usage: esim help <group> | esim help <command>");
37058
+ if (helpArgs.length !== 1 || topic === undefined) {
37059
+ throw new CommandError(2, "invalid_arguments", "Specify one command group.", "Usage: esim help <group>");
37122
37060
  }
37123
37061
  options.stdout(groupHelp(topic) + `
37124
- `);
37125
- return { exitCode: 0 };
37126
- }
37127
- if (name !== undefined && !rest.length && !topLevelCommands.has(name) && groups2.some((group) => group.name === name)) {
37128
- options.stdout(groupHelp(name) + `
37129
37062
  `);
37130
37063
  return { exitCode: 0 };
37131
37064
  }
37132
37065
  const { children, defaultView, command, path, args: commandArgs } = resolveCommand(argv);
37133
- if (children.length && (!defaultView && !commandArgs.length || commandArgs.length === 1 && (commandArgs[0] === "--help" || commandArgs[0] === "-h"))) {
37066
+ if (children.length && (!defaultView && !commandArgs.length || commandArgs.length === 1 && commandArgs[0] === "--help")) {
37134
37067
  options.stdout(verbHelp(path, children, defaultView) + `
37135
37068
  `);
37136
37069
  return { exitCode: 0 };
@@ -37244,7 +37177,7 @@ function saveCredentials(store, credentials) {
37244
37177
  }
37245
37178
 
37246
37179
  // version.ts
37247
- var version2 = "2026.1201.188";
37180
+ var version2 = "2026.1201.190";
37248
37181
  var installKind = version2 === "dev" ? "source" : typeof ESIM_CLI_EXECUTABLE === "boolean" && ESIM_CLI_EXECUTABLE ? "executable" : "npm";
37249
37182
  var npmLatestUrl = "https://registry.npmjs.org/esim-cli/latest";
37250
37183
  var releaseUrl = (release) => `https://github.com/CorrectRoadH/open-esim/releases/download/cli-v${release}`;
@@ -37471,9 +37404,7 @@ async function run(input, executable) {
37471
37404
  return exitCode;
37472
37405
  }
37473
37406
  async function runCommandLine(input, executable) {
37474
- const named = withoutGroup(input);
37475
- const asked = named[0] === "help" ? withoutGroup(named.slice(1).filter((arg) => arg !== "--json")) : [];
37476
- const argv = asked.length === 1 && (asked[0] === "login" || asked[0] === "logout" || asked[0] === "upgrade") ? [asked[0], "--help"] : named;
37407
+ const argv = input;
37477
37408
  const [name, ...args] = argv;
37478
37409
  const json = jsonRequested(argv);
37479
37410
  const apiUrl = executable.env.ESIM_API_URL ?? defaultApiUrl;
@@ -37498,7 +37429,7 @@ async function runCommandLine(input, executable) {
37498
37429
  }
37499
37430
  if (name === "login" || name === "logout" || name === "upgrade") {
37500
37431
  const localArgs = args.filter((arg) => arg !== "--json");
37501
- if (args.length === 1 && (args[0] === "--help" || args[0] === "-h")) {
37432
+ if (args.length === 1 && args[0] === "--help") {
37502
37433
  options.stdout(loginHelp[name].join(`
37503
37434
  `) + `
37504
37435
  `);
@@ -37522,7 +37453,7 @@ async function runCommandLine(input, executable) {
37522
37453
  }
37523
37454
  return 0;
37524
37455
  }
37525
- const rootHelp = (name === "--help" || name === "-h") && !args.length;
37456
+ const rootHelp = name === "--help" && !args.length;
37526
37457
  const credentials = rootHelp ? undefined : await resolveCredentials(executable.env, apiUrl, executable.credentials);
37527
37458
  if (rootHelp || !name && !credentials) {
37528
37459
  const { exitCode } = await runCommand(argv, options);