@binaryandthread/cli 0.4.6 → 0.4.8

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 CHANGED
@@ -115,7 +115,7 @@ skips the interactive confirm so it never hangs in CI. Field shapes (stable, saf
115
115
  | `bt checkout` | `{ status: "placed"\|"timeout"\|"expired", order_id?, display_id?, total?, currency?, checkout_url? }` |
116
116
  | `bt region` | `{ region, currency, matched, home }` · `--list` → `{ regions: [{ currency, countries[] }] }` |
117
117
  | `bt whoami` | `{ authenticated, tier, commits, standing_pct, token_expires_at, token_expired }` |
118
- | `bt order <id>` | `{ display_id, status, fulfillment_status?, tracking? }` |
118
+ | `bt order <id>` | `{ display_id, stage: "committed"\|"shipped"\|"delivered"\|"reverted", total, currency }` (committed = placed, not shipped yet) |
119
119
 
120
120
  **Errors** (`--json`) come back as `{ "error": { "code", "type", "message" } }` and the process
121
121
  exits with a distinct code so CI/agents can branch:
package/dist/bin.js CHANGED
@@ -56,7 +56,7 @@ import {
56
56
  versionLine,
57
57
  warn,
58
58
  working
59
- } from "./chunk-5W5O6G6Y.js";
59
+ } from "./chunk-CE324N5B.js";
60
60
  import {
61
61
  __require
62
62
  } from "./chunk-7OCVIDC7.js";
@@ -105,7 +105,7 @@ function makeLogger(debug, write = (s) => process.stderr.write(s)) {
105
105
  }
106
106
 
107
107
  // src/version.ts
108
- var VERSION = "0.4.6";
108
+ var VERSION = "0.4.8";
109
109
 
110
110
  // src/eggs.ts
111
111
  function teapot() {
@@ -525,7 +525,7 @@ function registerBrowse(program, makeClient2, loadConfig2) {
525
525
  program.command("browse").alias("ls").description("list what's in stock on a branch.").option("--branch <branch>", "main (live) or next (terminal-only drops)").option("--pick", "opt into the arrow-key picker (default is the numbered table \u2014 use bt stage <n>)").option("--plain", "force the static table (the default; kept for back-compat)").action(async (opts) => {
526
526
  const { json, brand } = resolveOutput(program);
527
527
  if (opts.pick && !json && brand.color && process.stdout.isTTY && process.stdin.isTTY) {
528
- const { runInteractiveBrowse } = await import("./interactive-I6KDKLEO.js");
528
+ const { runInteractiveBrowse } = await import("./interactive-7GY3BVQ6.js");
529
529
  const handled = await runInteractiveBrowse(makeClient2(), loadConfig2(), { branch: opts.branch, brand });
530
530
  if (handled) return;
531
531
  }
@@ -1092,7 +1092,8 @@ function registerCheckout(program, makeClient2, loadConfig2) {
1092
1092
  }
1093
1093
 
1094
1094
  // src/commands/order.ts
1095
- var STAGES = ["staged", "committed", "printed", "shipped", "delivered"];
1095
+ var STAGES = ["staged", "committed", "shipped", "delivered"];
1096
+ var DELIVERED = STAGES.length - 1;
1096
1097
  function stageIndex(o) {
1097
1098
  const stage = orderStage(o);
1098
1099
  return stage === "reverted" ? -1 : STAGES.indexOf(stage);
@@ -1134,7 +1135,7 @@ async function runOrder(client, config, args) {
1134
1135
  lines.push(` this order was canceled or refunded. nothing ships.`);
1135
1136
  } else {
1136
1137
  lines.push(`${display} ${itemLabel} ${cyan(style, timelineGraph(idx))} ${stageWord}`);
1137
- lines.push(` ${STAGES.join(" \u2192 ")}${idx === 4 ? " \u{1F389}" : ""}`);
1138
+ lines.push(` ${STAGES.join(" \u2192 ")}${idx === DELIVERED ? " \u{1F389}" : ""}`);
1138
1139
  }
1139
1140
  lines.push(` total ${cyan(style, total)}${taxSuffix(orderTaxInclusive)}`);
1140
1141
  return {
@@ -1143,7 +1144,7 @@ async function runOrder(client, config, args) {
1143
1144
  };
1144
1145
  }
1145
1146
  function registerOrder(program, makeClient2, loadConfig2) {
1146
- program.command("order").argument("<id>", "the order number (display id)").description("track one order: staged \u2192 committed \u2192 printed \u2192 shipped \u2192 delivered.").action(async (id) => {
1147
+ program.command("order").argument("<id>", "the order number (display id)").description("track one order: staged \u2192 committed \u2192 shipped \u2192 delivered.").action(async (id) => {
1147
1148
  const { json, brand } = resolveOutput(program);
1148
1149
  const res = await runOrder(makeClient2(), loadConfig2(), { displayId: id, json, brand });
1149
1150
  printResult(res, json);