@hanamorilabs/tab 0.1.16 → 0.1.18

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
@@ -340,9 +340,12 @@ async function resolveAgent(config, opts = {}) {
340
340
  return agents.env;
341
341
  const cwd = process.cwd();
342
342
  const project = opts.pick ? undefined : await readProject(cwd, harness);
343
- if (project && agents[project.agent])
344
- return agents[project.agent];
343
+ // The key this machine holds for the folder's Agent. It is not proof the Agent still exists: the
344
+ // console may have archived it since, so the console is asked before anything launches on it.
345
+ const cached = project ? agents[project.agent] : undefined;
345
346
  if (!config.token || !config.consoleUrl) {
347
+ if (cached)
348
+ return cached;
346
349
  fail(`This machine is not logged in. Run ${bold("tab login")}.`);
347
350
  return undefined;
348
351
  }
@@ -351,6 +354,9 @@ async function resolveAgent(config, opts = {}) {
351
354
  listed = await listAgents(config.consoleUrl, config.token);
352
355
  }
353
356
  catch (err) {
357
+ // The console cannot answer; the key on hand still runs, and the proxy refuses on its own if the Agent is gone.
358
+ if (cached)
359
+ return cached;
354
360
  fail(err instanceof ConsoleApiError && err.status === 401 ? `Session expired. Run ${bold("tab login")}.` : String(err instanceof Error ? err.message : err));
355
361
  return undefined;
356
362
  }
@@ -359,8 +365,18 @@ async function resolveAgent(config, opts = {}) {
359
365
  let created;
360
366
  if (project) {
361
367
  chosen = byName.get(project.agent);
362
- if (!chosen) {
363
- warn(`${project.file} names Agent ${bold(project.agent)}, which ${listed.flock.name} no longer has.`);
368
+ if (chosen && harness !== "any" && (chosen.harness ?? "any") !== "any" && chosen.harness !== harness) {
369
+ // An older one-Agent-per-folder file (or a hand edit) points this harness at an Agent tied to
370
+ // another one. The proxies would refuse every call (wrong_harness), so pick the right Agent now;
371
+ // the answer is written for this harness only and the file's other harnesses keep theirs.
372
+ warn(`${project.file} names Agent ${bold(chosen.name)} for ${harness}, but it is a ${chosen.harness} Agent. Pick the Agent this folder runs ${harness} as.`);
373
+ chosen = undefined;
374
+ }
375
+ else if (chosen && cached) {
376
+ return cached;
377
+ }
378
+ else if (!chosen) {
379
+ warn(`${project.file} names Agent ${bold(project.agent)}, which ${listed.flock.name} no longer has (archived or deleted). Pick the Agent this folder runs as now.`);
364
380
  }
365
381
  }
366
382
  if (!chosen) {
package/dist/tab-docs.js CHANGED
@@ -211,7 +211,10 @@ export const TAB_COMMANDS = [
211
211
  group: "agents",
212
212
  usage: ["archive [agent]"],
213
213
  summary: "Close an Agent for good and take it off the bill. Its history stays.",
214
- details: ["The tab closes for good, the Agent leaves the lists and stops counting towards the plan's Agents. Its ledger rows stay."],
214
+ details: [
215
+ "The tab closes for good, the Agent leaves the lists and stops counting towards the plan's Agents. Its ledger rows stay.",
216
+ "Its keys stop working everywhere (the proxies answer key_revoked). A folder still bound to it asks for an Agent again on the next launch.",
217
+ ],
215
218
  options: [{ flag: "--yes", what: "do not ask" }],
216
219
  },
217
220
  {
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.16";
2
+ export const TAB_VERSION = "0.1.18";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanamorilabs/tab",
3
- "version": "0.1.16",
3
+ "version": "0.1.18",
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",