@dosu/cli 0.53.0-beta.10 → 0.53.0-beta.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.
Files changed (2) hide show
  1. package/bin/dosu.js +43 -23
  2. package/package.json +1 -1
package/bin/dosu.js CHANGED
@@ -5018,7 +5018,7 @@ function isNpxInvocation(channel = INSTALL_CHANNEL, env = process.env) {
5018
5018
  function getVersionString() {
5019
5019
  return `v${VERSION}`;
5020
5020
  }
5021
- var VERSION = "0.53.0-beta.10", INSTALL_CHANNEL = "npm";
5021
+ var VERSION = "0.53.0-beta.11", INSTALL_CHANNEL = "npm";
5022
5022
 
5023
5023
  // src/debug/logger.ts
5024
5024
  import {
@@ -73519,7 +73519,7 @@ var init_settings = __esm(() => {
73519
73519
  });
73520
73520
 
73521
73521
  // src/telemetry/debug-id.ts
73522
- var BUNDLE_DEBUG_ID_PLACEHOLDER = "6096b455-0361-b435-6475-6e2164756e21";
73522
+ var BUNDLE_DEBUG_ID_PLACEHOLDER = "fa7cf492-7aa5-180c-6475-6e2164756e21";
73523
73523
 
73524
73524
  // src/telemetry/telemetry.ts
73525
73525
  import { randomUUID as randomUUID4 } from "node:crypto";
@@ -75456,9 +75456,9 @@ function syncConfirmMode(status) {
75456
75456
  return "resume";
75457
75457
  return "start";
75458
75458
  }
75459
- function formatActivityLine(line, width) {
75459
+ function formatActivityLine(line, width, full = false) {
75460
75460
  const compact = stripAnsiCodes(line).replace(/^\[(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2})[^\]]*\]/, (_match, _date2, time3) => time3);
75461
- if (compact.length <= width)
75461
+ if (full || compact.length <= width)
75462
75462
  return compact;
75463
75463
  return `${compact.slice(0, Math.max(0, width - 1))}…`;
75464
75464
  }
@@ -75636,12 +75636,12 @@ function renderActivityFrame(status, activity, width, backlog = null, pane = DEF
75636
75636
  }
75637
75637
  const refusal = !status.running && status.state.last_refusal;
75638
75638
  const refusalLines = refusal ? wrapLine(`! Mining paused: ${refusal.message} (${localTime(refusal.at)})`, width).map((line) => import_picocolors30.default.yellow(line)) : [];
75639
- const fullRows = Boolean(pane.fullRows) && pane.tab !== "activity";
75639
+ const fullRows = Boolean(pane.fullRows);
75640
75640
  const minedRows = (status.state.mined_sessions ?? []).map((record2) => fullRows ? formatMinedRow(record2, true) : formatActivityLine(formatMinedRow(record2), width));
75641
75641
  const sessionRow = (session) => fullRows ? formatQueuedRow(session, true) : formatActivityLine(formatQueuedRow(session), width);
75642
75642
  const queuedRows = queued.map(sessionRow);
75643
75643
  const openRows = open5.map(sessionRow);
75644
- const source = pane.tab === "activity" ? activity.map((line) => formatActivityLine(line, width)) : pane.tab === "queued" ? queuedRows : pane.tab === "open" ? openRows : minedRows;
75644
+ const source = pane.tab === "activity" ? activity.map((line) => formatActivityLine(line, width, fullRows)) : pane.tab === "queued" ? queuedRows : pane.tab === "open" ? openRows : minedRows;
75645
75645
  const emptyMined = status.state.watermark ? "No sessions recorded yet. History starts with the next mining run." : "No mined sessions yet.";
75646
75646
  const empty = pane.tab === "activity" ? "No sync activity in the log yet." : pane.tab === "queued" ? "Queue empty. Finished agent sessions appear here." : pane.tab === "open" ? "No open sessions. Live agent sessions sit here until they go quiet." : emptyMined;
75647
75647
  const height = fullRows ? ACTIVITY_VIEW_FULL_LIST_ROWS : ACTIVITY_VIEW_LIST_LINES;
@@ -75653,9 +75653,6 @@ function renderActivityFrame(status, activity, width, backlog = null, pane = DEF
75653
75653
  scrollParts.push(`↑ ${above} earlier`);
75654
75654
  if (below > 0)
75655
75655
  scrollParts.push(`↓ ${below} newer`);
75656
- if (pane.tab !== "activity" && visible.length > 0) {
75657
- scrollParts.push(fullRows ? `f clip · copy: dosu knowledge sessions --${pane.tab}` : `f full rows · dosu knowledge sessions --${pane.tab}`);
75658
- }
75659
75656
  const lines = [
75660
75657
  breadcrumb(["Home", "Activity"], width),
75661
75658
  "",
@@ -75673,6 +75670,7 @@ function renderActivityFrame(status, activity, width, backlog = null, pane = DEF
75673
75670
  import_picocolors30.default.dim([
75674
75671
  "tab switch",
75675
75672
  "↑↓ scroll",
75673
+ fullRows ? "f clip" : "f full rows",
75676
75674
  status.running ? "s stop" : status.state.paused ? "s resume" : "s sync now",
75677
75675
  "esc back"
75678
75676
  ].join(" · "))
@@ -75726,7 +75724,7 @@ function runActivityView(io2 = {}) {
75726
75724
  return sessions.open.length;
75727
75725
  return (status.state.mined_sessions ?? []).length;
75728
75726
  };
75729
- const listHeight = () => fullRows && tab !== "activity" ? ACTIVITY_VIEW_FULL_LIST_ROWS : ACTIVITY_VIEW_LIST_LINES;
75727
+ const listHeight = () => fullRows ? ACTIVITY_VIEW_FULL_LIST_ROWS : ACTIVITY_VIEW_LIST_LINES;
75730
75728
  let lastFrame = null;
75731
75729
  let minedBeforeRun = null;
75732
75730
  const draw = () => {
@@ -75832,11 +75830,9 @@ ${CLEAR_BELOW}`);
75832
75830
  sessions = listBacklog();
75833
75831
  draw();
75834
75832
  } else if (action === "full") {
75835
- if (tab !== "activity") {
75836
- fullRows = !fullRows;
75837
- scroll = 0;
75838
- draw();
75839
- }
75833
+ fullRows = !fullRows;
75834
+ scroll = 0;
75835
+ draw();
75840
75836
  } else if (action === "up") {
75841
75837
  const maxScroll = Math.max(0, activeListLength() - listHeight());
75842
75838
  if (scroll < maxScroll) {
@@ -77759,7 +77755,7 @@ function checklistRows(ctx) {
77759
77755
  const rows = [["workspace", ctx.directory]];
77760
77756
  rows.push([
77761
77757
  "account",
77762
- ctx.signedIn ? `${on2} signed in` : `${off} ${import_picocolors33.default.dim("not signed in · run Setup")}`
77758
+ ctx.sessionExpired ? `${off} ${import_picocolors33.default.yellow("session expired")} ${import_picocolors33.default.dim(`${DOT3} run Log in`)}` : ctx.signedIn ? `${on2} signed in` : `${off} ${import_picocolors33.default.dim(`not signed in ${DOT3} run Setup`)}`
77763
77759
  ]);
77764
77760
  const missing = new Set(ctx.setupMissing ?? []);
77765
77761
  const warnRow = `${off} ${import_picocolors33.default.yellow("not configured")} ${import_picocolors33.default.dim(`${DOT3} run Setup`)}`;
@@ -78178,7 +78174,17 @@ __export(exports_tui, {
78178
78174
  });
78179
78175
  import { homedir as homedir10 } from "node:os";
78180
78176
  import { basename as basename4 } from "node:path";
78181
- function bannerContext(cfg) {
78177
+ async function probeSession(cfg) {
78178
+ if (!isAuthenticated(cfg) || !isTokenExpired(cfg))
78179
+ return { expired: false };
78180
+ try {
78181
+ await new Client(cfg).refreshToken();
78182
+ return { expired: false };
78183
+ } catch (err) {
78184
+ return { expired: err instanceof SessionExpiredError };
78185
+ }
78186
+ }
78187
+ function bannerContext(cfg, session) {
78182
78188
  let webAppHost = "app.dosu.dev";
78183
78189
  try {
78184
78190
  webAppHost = new URL(getWebAppURL()).host;
@@ -78196,9 +78202,10 @@ function bannerContext(cfg) {
78196
78202
  webAppHost,
78197
78203
  directory: basename4(process.cwd()),
78198
78204
  signedIn: isAuthenticated(cfg),
78205
+ sessionExpired: session.expired,
78199
78206
  deploymentName: cfg.active_account?.target?.deployment_name,
78200
78207
  libraryName: cfg.active_account?.target?.library_name,
78201
- setupMissing: isAuthenticated(cfg) ? missingSetupSteps(cfg) : [],
78208
+ setupMissing: isAuthenticated(cfg) && !session.expired ? missingSetupSteps(cfg) : [],
78202
78209
  ...inGitWorkTree() ? { repoAgentsMd: dosuAgentsSectionState() } : {},
78203
78210
  agents,
78204
78211
  mining: isMining(),
@@ -78275,17 +78282,18 @@ function isMining() {
78275
78282
  return false;
78276
78283
  }
78277
78284
  }
78278
- function drawHome(cfg) {
78285
+ function drawHome(cfg, session) {
78279
78286
  if (process.stdout.isTTY) {
78280
78287
  process.stdout.write(CLEAR_SCREEN);
78281
78288
  process.stdout.write(`
78282
78289
  `.repeat(frameTopMargin()));
78283
78290
  }
78284
- process.stdout.write(`${renderBanner(bannerContext(cfg))}
78291
+ process.stdout.write(`${renderBanner(bannerContext(cfg, session))}
78285
78292
  `);
78286
78293
  }
78287
78294
  async function runMainMenu() {
78288
78295
  const cfg = loadConfig();
78296
+ const session = await probeSession(cfg);
78289
78297
  const runSetupAndReload = async () => {
78290
78298
  await runSetup();
78291
78299
  const fresh = loadConfig();
@@ -78293,6 +78301,16 @@ async function runMainMenu() {
78293
78301
  cfg.active_account = fresh.active_account;
78294
78302
  };
78295
78303
  const buildOptions = () => {
78304
+ if (session.expired) {
78305
+ return [
78306
+ {
78307
+ label: "Log in again",
78308
+ hint: "(session expired · opens your browser)",
78309
+ value: "auth"
78310
+ },
78311
+ { label: "Exit", value: "exit" }
78312
+ ];
78313
+ }
78296
78314
  if (!isAuthenticated(cfg)) {
78297
78315
  return [
78298
78316
  { label: "Log in / Sign up", hint: "(opens your browser)", value: "auth" },
@@ -78318,9 +78336,9 @@ async function runMainMenu() {
78318
78336
  { label: "Exit", value: "exit" }
78319
78337
  ];
78320
78338
  };
78321
- const home = () => drawHome(cfg);
78339
+ const home = () => drawHome(cfg, session);
78322
78340
  home();
78323
- if (isAuthenticated(cfg) && !isSetUp(cfg)) {
78341
+ if (isAuthenticated(cfg) && !session.expired && !isSetUp(cfg)) {
78324
78342
  await runSetupAndReload();
78325
78343
  home();
78326
78344
  }
@@ -78354,6 +78372,7 @@ async function runMainMenu() {
78354
78372
  break;
78355
78373
  case "auth":
78356
78374
  await handleAuthenticate(cfg);
78375
+ session.expired = session.expired && isTokenExpired(cfg);
78357
78376
  home();
78358
78377
  if (isAuthenticated(cfg) && !isSetUp(cfg)) {
78359
78378
  await runSetupAndReload();
@@ -78502,6 +78521,7 @@ function handleLogout(cfg) {
78502
78521
  }
78503
78522
  var import_picocolors35, ESC10, CLEAR_SCREEN;
78504
78523
  var init_tui = __esm(() => {
78524
+ init_client();
78505
78525
  init_config();
78506
78526
  init_agents();
78507
78527
  init_providers();
@@ -84616,4 +84636,4 @@ execute().catch((err) => {
84616
84636
  process.exit(1);
84617
84637
  });
84618
84638
 
84619
- //# debugId=6096b455-0361-b435-6475-6e2164756e21
84639
+ //# debugId=fa7cf492-7aa5-180c-6475-6e2164756e21
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dosu/cli",
3
- "version": "0.53.0-beta.10",
3
+ "version": "0.53.0-beta.11",
4
4
  "type": "module",
5
5
  "description": "Dosu CLI - Manage MCP servers for AI tools",
6
6
  "license": "MIT",