@hanamorilabs/tab 0.1.10 → 0.1.11

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/dist/cli.js CHANGED
@@ -64,7 +64,7 @@ function usage() {
64
64
  cmd("agent kind <agent> api|subscription", "change it"),
65
65
  cmd("accounts", "accounts your subscription Agents were seen on: plan, price, quota used"),
66
66
  cmd("pool", "several logins of one vendor; tab claude runs as the one with most room"),
67
- cmd("pool add claude|codex <name>", "sign another login in (its own folder; --dir <path> to use one you have)"),
67
+ cmd("pool add claude|codex <name>", "sign another login in through the browser (--email to prefill, --dir <path> to use a folder you have)"),
68
68
  cmd("pool at <percent>", "move to another login once this much of a window is used (default 80)"),
69
69
  cmd("alias setup <name>...", "make plain `codex` run `tab codex` (shims in ~/.flocktab/bin)"),
70
70
  cmd("alias remove <name>...", "undo that; `tab alias list` shows them"),
@@ -734,16 +734,24 @@ async function poolCommand(argv) {
734
734
  await mkdir(path.join(member.dir, "codex"), { recursive: true, mode: 0o700 });
735
735
  if (!(await loginOf())?.email) {
736
736
  const harness = vendor === "anthropic" ? "claude" : "codex";
737
- say(dim(vendor === "anthropic" ? `Opening Claude Code in ${member.dir}. Sign in as the account for ${memberName} (/login), then /exit.` : `Signing Codex in for ${memberName}.`));
737
+ // `claude auth login` does the browser sign-in and exits: no session to open, no /login, no /exit.
738
+ const email = flags.opts.email ?? (memberName.includes("@") ? memberName : undefined);
739
+ say(dim(`Signing ${vendor === "anthropic" ? "Claude Code" : "Codex"} in for ${memberName}. Your browser opens; pick the account for this login.`));
738
740
  // Plain launch: no proxy, no tab key. This only creates the login, in the harness's own store.
739
741
  const loginEnv = { ...process.env, ...memberEnv(vendor, member), PATH: pathWithoutShims() };
740
742
  for (const k of ["ANTHROPIC_BASE_URL", "ANTHROPIC_API_KEY", "ANTHROPIC_AUTH_TOKEN", "OPENAI_BASE_URL", "OPENAI_API_KEY"])
741
743
  delete loginEnv[k];
742
- const code = await new Promise((resolve) => {
743
- const child = spawn(harness, vendor === "anthropic" ? [] : ["login"], { stdio: "inherit", env: loginEnv });
744
+ const run = (argv) => new Promise((resolve) => {
745
+ const child = spawn(harness, argv, { stdio: "inherit", env: loginEnv });
744
746
  child.on("error", () => resolve(127));
745
747
  child.on("close", (c) => resolve(c ?? 1));
746
748
  });
749
+ let code = await run(vendor === "anthropic" ? ["auth", "login", "--claudeai", ...(email ? ["--email", email] : [])] : ["login"]);
750
+ if (vendor === "anthropic" && code !== 0 && code !== 127 && !(await loginOf())?.email) {
751
+ // A Claude Code too old for `auth login`: sign in from inside it.
752
+ say(dim("That did not sign in. Opening Claude Code instead: /login as this account, then /exit."));
753
+ code = await run([]);
754
+ }
747
755
  if (code === 127) {
748
756
  fail(`${harness} is not installed.`);
749
757
  return 127;
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /** Written by scripts/write-version.mjs from package.json at build; `tab version` prints it. */
2
- export const TAB_VERSION = "0.1.10";
2
+ export const TAB_VERSION = "0.1.11";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanamorilabs/tab",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "description": "Run any AI agent on a FlockTab tab: tab claude, tab codex, tab <command>.",
5
5
  "license": "MIT",
6
6
  "type": "module",