@basou/cli 0.73.0 → 0.74.0

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/program.js CHANGED
@@ -13979,6 +13979,14 @@ var BOARD_HTML = `<!doctype html>
13979
13979
  table.matrix td.cell { font-size: 16px; padding: 4px 2px; }
13980
13980
  table.matrix th:first-child { max-width: 10em; overflow-wrap: anywhere; }
13981
13981
  .stage-meanings { display: block; }
13982
+ /* A table wider than the page scrolls; its notes wrap at the width of
13983
+ the scroll they are in (100vw where container units are not known,
13984
+ which counts a page scrollbar too) and stay at its left edge, so none
13985
+ is cut off. The cell keeps no right padding, which a sticky note could
13986
+ not cross. */
13987
+ .scroll { container-type: inline-size; }
13988
+ tr.notes td { padding-right: 0; }
13989
+ tr.notes ul.sub { position: sticky; left: 0; max-width: calc(100vw - 32px); max-width: 100cqw; }
13982
13990
  }
13983
13991
  .st::before { display: inline-block; width: 1.2em; }
13984
13992
  .st.done::before { content: "\\25CF"; color: var(--done); }
@@ -14037,6 +14045,18 @@ var BOARD_HTML = `<!doctype html>
14037
14045
  (function () {
14038
14046
  var S = null;
14039
14047
  var lang = 'en';
14048
+ // The workspace of a portfolio the page is opened for (?ws=<key>), set
14049
+ // before anything is fetched: its board is read from its scoped routes, and
14050
+ // the page's links keep it. Null in single mode.
14051
+ var WS = null;
14052
+ function apiPath(sub) {
14053
+ return (WS === null ? '/api/' : '/api/ws/' + encodeURIComponent(WS) + '/') + sub;
14054
+ }
14055
+ function boardHref(query) {
14056
+ var parts = WS === null ? [] : ['ws=' + encodeURIComponent(WS)];
14057
+ if (query) parts.push(query);
14058
+ return '/board' + (parts.length > 0 ? '?' + parts.join('&') : '');
14059
+ }
14040
14060
  function $(id) { return document.getElementById(id); }
14041
14061
  function clear(node) { while (node.firstChild) node.removeChild(node.firstChild); }
14042
14062
  function el(tag, attrs, children) {
@@ -14206,19 +14226,19 @@ var BOARD_HTML = `<!doctype html>
14206
14226
  var page = d.page;
14207
14227
  var list = page.records || [];
14208
14228
  if (list.length > 0) recordLinks(nav, page, list);
14209
- nav.appendChild(el('a', { href: '/board?live=1', text: S.live.measureNow }));
14229
+ nav.appendChild(el('a', { href: boardHref('live=1'), text: S.live.measureNow }));
14210
14230
  }
14211
14231
 
14212
14232
  function recordLinks(nav, page, list) {
14213
14233
  var link = function (id, label) {
14214
- return el('a', { href: '/board?record=' + encodeURIComponent(id), text: label });
14234
+ return el('a', { href: boardHref('record=' + encodeURIComponent(id)), text: label });
14215
14235
  };
14216
14236
  // Around the record asked for, whether or not it could be drawn.
14217
14237
  if (page.older) nav.appendChild(link(page.older, S.older));
14218
14238
  if (page.newer) nav.appendChild(link(page.newer, S.newer));
14219
- nav.appendChild(el('a', { href: '/board', text: S.latest }));
14239
+ nav.appendChild(el('a', { href: boardHref(''), text: S.latest }));
14220
14240
  var select = el('select', {
14221
- onchange: function () { location.href = '/board?record=' + encodeURIComponent(select.value); }
14241
+ onchange: function () { location.href = boardHref('record=' + encodeURIComponent(select.value)); }
14222
14242
  });
14223
14243
  var listed = list.some(function (r) { return r.id === page.id; });
14224
14244
  if (!listed) {
@@ -14573,8 +14593,17 @@ var BOARD_HTML = `<!doctype html>
14573
14593
  tile(S.effort.perDay, hm(perDay), perDaySub),
14574
14594
  tile(S.effort.outputTokens, num(e.output_tokens), tokens)
14575
14595
  ]);
14596
+ // A repo by its name, as the repos table draws it: a workspace that is
14597
+ // one repo is at the path '.'. The board measured on the spot holds its
14598
+ // repos as a list, a record as { list } or null.
14599
+ var names = Object.create(null);
14600
+ var repos = !b.repos ? [] : Array.isArray(b.repos) ? b.repos : b.repos.list;
14601
+ repos.forEach(function (r) {
14602
+ if (r.name !== null) names[r.path] = r.name;
14603
+ });
14576
14604
  var commits = e.commits === null ? S.effort.notMeasured : e.commits.map(function (c) {
14577
- return c.repo + ' ' + num(c.count);
14605
+ var name = Object.prototype.hasOwnProperty.call(names, c.repo) ? names[c.repo] : c.repo;
14606
+ return name + ' ' + num(c.count);
14578
14607
  }).join(' / ');
14579
14608
  var children = [tiles, el('p', { class: 'muted', text: fill(S.effort.commits, { list: commits }) })];
14580
14609
  var days = e.daily || [];
@@ -14968,9 +14997,9 @@ var BOARD_HTML = `<!doctype html>
14968
14997
  clear(nav);
14969
14998
  // Asked for with ?live=1: lead back to the records, when there are any.
14970
14999
  if (why === null) {
14971
- getJson('/api/board').then(function (b) {
15000
+ getJson(apiPath('board')).then(function (b) {
14972
15001
  var list = b && b.page && b.page.records ? b.page.records : [];
14973
- if (drawn === liveDrawn && list.length > 0) nav.appendChild(el('a', { href: '/board', text: S.live.toRecords }));
15002
+ if (drawn === liveDrawn && list.length > 0) nav.appendChild(el('a', { href: boardHref(''), text: S.live.toRecords }));
14974
15003
  }).catch(function () {});
14975
15004
  }
14976
15005
  var root = $('board');
@@ -14993,16 +15022,17 @@ var BOARD_HTML = `<!doctype html>
14993
15022
  // Measuring takes seconds, so the page says so until it is done.
14994
15023
  function loadLive(why) {
14995
15024
  setStatus(S ? S.live.measuring : '...', false);
14996
- getJson('/api/board/live').then(function (d) { drawLive(d, why); }).catch(failed);
15025
+ getJson(apiPath('board/live')).then(function (d) { drawLive(d, why); }).catch(failed);
14997
15026
  }
14998
15027
 
14999
15028
  var params = new URLSearchParams(location.search);
15029
+ WS = params.get('ws');
15000
15030
  var record = params.get('record');
15001
15031
  if (params.get('live') !== null) {
15002
15032
  loadLive(null);
15003
15033
  } else {
15004
15034
  setStatus('...', false);
15005
- getJson('/api/board' + (record ? '/' + encodeURIComponent(record) : '')).then(draw).catch(failed);
15035
+ getJson(apiPath('board' + (record ? '/' + encodeURIComponent(record) : ''))).then(draw).catch(failed);
15006
15036
  }
15007
15037
  })();
15008
15038
  </script>
@@ -15268,7 +15298,7 @@ var VIEW_HTML = `<!doctype html>
15268
15298
  state.canAct = true;
15269
15299
  document.body.classList.remove('landing');
15270
15300
  $('btn-back').style.display = 'none';
15271
- // The board page is served in single mode only.
15301
+ $('board-link').href = '/board';
15272
15302
  $('board-link').style.display = '';
15273
15303
  updateActionBar();
15274
15304
  buildTabs();
@@ -15282,6 +15312,8 @@ var VIEW_HTML = `<!doctype html>
15282
15312
  state.canAct = false;
15283
15313
  document.body.classList.add('landing');
15284
15314
  $('btn-back').style.display = 'none';
15315
+ // No workspace is open: there is no board to lead to.
15316
+ $('board-link').style.display = 'none';
15285
15317
  setStatus('', false);
15286
15318
  clear($('tabs'));
15287
15319
  updateActionBar();
@@ -15396,6 +15428,10 @@ var VIEW_HTML = `<!doctype html>
15396
15428
  state.canAct = true;
15397
15429
  document.body.classList.remove('landing');
15398
15430
  $('btn-back').style.display = '';
15431
+ // The board of the workspace open, read from its scoped routes. The cards
15432
+ // of the landing carry none of a board's figures.
15433
+ $('board-link').href = '/board?ws=' + encodeURIComponent(key);
15434
+ $('board-link').style.display = '';
15399
15435
  updateActionBar();
15400
15436
  setStatus('workspace: ' + label, false);
15401
15437
  buildTabs();
@@ -15803,7 +15839,7 @@ async function handleGet(res, pathname, deps) {
15803
15839
  sendHtml(res, VIEW_HTML);
15804
15840
  return;
15805
15841
  }
15806
- if (pathname === "/board" && deps.mode === "single") {
15842
+ if (pathname === "/board") {
15807
15843
  sendHtml(res, BOARD_HTML);
15808
15844
  return;
15809
15845
  }
@@ -15824,8 +15860,8 @@ async function handleGet(res, pathname, deps) {
15824
15860
  ws,
15825
15861
  deps.nowProvider,
15826
15862
  remoteUrlOf(deps),
15827
- boardOf(deps),
15828
- boardLiveOf(deps)
15863
+ ws.board,
15864
+ ws.boardLive
15829
15865
  )) {
15830
15866
  sendError(res, 404, "Not found");
15831
15867
  }
@@ -15839,8 +15875,8 @@ async function handleGet(res, pathname, deps) {
15839
15875
  primaryWorkspace(deps),
15840
15876
  deps.nowProvider,
15841
15877
  remoteUrlOf(deps),
15842
- boardOf(deps),
15843
- boardLiveOf(deps)
15878
+ flatBoardOf(deps),
15879
+ flatBoardLiveOf(deps)
15844
15880
  )) {
15845
15881
  sendError(res, 404, "Not found");
15846
15882
  }
@@ -15848,11 +15884,11 @@ async function handleGet(res, pathname, deps) {
15848
15884
  }
15849
15885
  sendError(res, 404, "Not found");
15850
15886
  }
15851
- function boardOf(deps) {
15852
- return deps.mode === "single" ? deps.board : void 0;
15887
+ function flatBoardOf(deps) {
15888
+ return deps.mode === "single" ? primaryWorkspace(deps).board : void 0;
15853
15889
  }
15854
- function boardLiveOf(deps) {
15855
- return deps.mode === "single" ? deps.boardLive : void 0;
15890
+ function flatBoardLiveOf(deps) {
15891
+ return deps.mode === "single" ? primaryWorkspace(deps).boardLive : void 0;
15856
15892
  }
15857
15893
  function remoteUrlOf(deps) {
15858
15894
  return deps.remoteUrlOf ?? tryRemoteUrl;
@@ -16371,14 +16407,13 @@ async function buildSingleDeps(ctx, cwd) {
16371
16407
  const repositoryRoot = await resolveBasouRootForCommand(cwd, "view");
16372
16408
  const paths = basouPaths25(repositoryRoot);
16373
16409
  await assertWorkspaceInitialized16(paths.root);
16374
- const entry = await buildWorkspaceEntry(repositoryRoot, ctx);
16410
+ const built = await buildWorkspaceEntry(repositoryRoot, ctx);
16411
+ const entry = built.board !== void 0 ? built : { ...built, board: { why: "no_board" }, boardLive: liveBoardOf(repositoryRoot, ctx) };
16375
16412
  return {
16376
16413
  workspaces: [entry],
16377
16414
  mode: "single",
16378
16415
  nowProvider: nowProviderOf(ctx),
16379
- ...ctx.remoteUrlOf !== void 0 ? { remoteUrlOf: ctx.remoteUrlOf } : {},
16380
- board: await viewBoardOf(repositoryRoot, paths),
16381
- boardLive: liveBoardOf(repositoryRoot, ctx)
16416
+ ...ctx.remoteUrlOf !== void 0 ? { remoteUrlOf: ctx.remoteUrlOf } : {}
16382
16417
  };
16383
16418
  }
16384
16419
  function liveBoardOf(root, ctx) {
@@ -16399,13 +16434,8 @@ function sharedWhileRunning(run) {
16399
16434
  return running;
16400
16435
  };
16401
16436
  }
16402
- async function viewBoardOf(root, paths) {
16403
- let own;
16404
- try {
16405
- own = (await readManifest19(paths)).repos?.find((repo) => repo.path === ".");
16406
- } catch {
16407
- own = void 0;
16408
- }
16437
+ function viewBoardOf(root, manifest) {
16438
+ const own = manifest.repos?.find((repo) => repo.path === ".");
16409
16439
  if (own?.visibility !== "private") return { why: "no_board" };
16410
16440
  return { recordsDir: join17(root, dirname9(DEFAULT_BOARD_PATH), "records") };
16411
16441
  }
@@ -16447,7 +16477,9 @@ async function buildWorkspaceEntry(repoRoot, ctx, labelOverride) {
16447
16477
  paths,
16448
16478
  repoRoot,
16449
16479
  importCtx,
16450
- initialized: true
16480
+ initialized: true,
16481
+ board: viewBoardOf(repoRoot, manifest),
16482
+ boardLive: liveBoardOf(repoRoot, ctx)
16451
16483
  };
16452
16484
  } catch (error) {
16453
16485
  const notFound = error instanceof Error && error.message === "YAML file not found";
@@ -16561,7 +16593,7 @@ function installExperimentalNotice(program, names = EXPERIMENTAL_COMMANDS, write
16561
16593
  function readBuildStamp() {
16562
16594
  if (false) return void 0;
16563
16595
  try {
16564
- return JSON.parse('{"version":"0.73.0","commit":"fdfa3a5","committedAt":"2026-10-20T20:30:59+09:00"}');
16596
+ return JSON.parse('{"version":"0.74.0","commit":"31f16be","committedAt":"2026-10-23T12:42:48+09:00"}');
16565
16597
  } catch {
16566
16598
  return void 0;
16567
16599
  }