@basou/cli 0.50.0 → 0.51.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/index.js CHANGED
@@ -866,6 +866,7 @@ import {
866
866
  basouPaths as basouPaths4,
867
867
  classifyFilesBySourceRoot,
868
868
  createAdHocSessionWithEvent,
869
+ displayPath,
869
870
  EVENT_SCHEMA_VERSION as EVENT_SCHEMA_VERSION2,
870
871
  findErrorCode as findErrorCode2,
871
872
  isValidPrefixedId,
@@ -1305,7 +1306,7 @@ async function warnLinkedFilesOutsideRoots(input) {
1305
1306
  });
1306
1307
  if (scope.outOfRoot.length === 0) return;
1307
1308
  const PATH_SAMPLE = 5;
1308
- const sample = scope.outOfRoot.slice(0, PATH_SAMPLE).join(", ");
1309
+ const sample = scope.outOfRoot.slice(0, PATH_SAMPLE).map(displayPath).join(", ");
1309
1310
  const more = scope.outOfRoot.length > PATH_SAMPLE ? ` (... +${scope.outOfRoot.length - PATH_SAMPLE} more)` : "";
1310
1311
  console.error(
1311
1312
  `basou: ${scope.outOfRoot.length} linked file(s) resolve outside this project's source_roots: ${sample}${more} \u2014 this decision may belong to another project.`
@@ -2918,6 +2919,7 @@ import {
2918
2919
  classifyFilesBySourceRoot as classifyFilesBySourceRoot2,
2919
2920
  claudeTranscriptToImportPayload,
2920
2921
  codexRolloutToImportPayload,
2922
+ displayPath as displayPath2,
2921
2923
  enumerateSessionDirs,
2922
2924
  findErrorCode as findErrorCode5,
2923
2925
  importSessionFromJson,
@@ -3188,7 +3190,7 @@ async function importDerivedSessions(paths, manifest, options, sourceKind, candi
3188
3190
  if (crossProject.length > 0) {
3189
3191
  const PATH_SAMPLE = 5;
3190
3192
  for (const { externalId, outOfRoot } of crossProject) {
3191
- const sample = outOfRoot.slice(0, PATH_SAMPLE).join(", ");
3193
+ const sample = outOfRoot.slice(0, PATH_SAMPLE).map(displayPath2).join(", ");
3192
3194
  const more = outOfRoot.length > PATH_SAMPLE ? ` (... +${outOfRoot.length - PATH_SAMPLE} more)` : "";
3193
3195
  console.error(
3194
3196
  `basou: session ${externalId} edited ${outOfRoot.length} file(s) outside this project's source_roots: ${sample}${more} \u2014 they may belong to another project.`
@@ -9920,6 +9922,7 @@ import {
9920
9922
  appendEventToExistingSession as appendEventToExistingSession3,
9921
9923
  assertBasouRootSafe as assertBasouRootSafe13,
9922
9924
  basouPaths as basouPaths18,
9925
+ displayPath as displayPath3,
9923
9926
  EVENT_SCHEMA_VERSION as EVENT_SCHEMA_VERSION6,
9924
9927
  enumerateSessionDirs as enumerateSessionDirs2,
9925
9928
  findErrorCode as findErrorCode12,
@@ -10188,7 +10191,7 @@ function formatWorkingDir(workingDir, repositoryRoot, options) {
10188
10191
  }
10189
10192
  function formatRelatedFiles(files) {
10190
10193
  if (files.length === 0) return "0 paths";
10191
- const head = files.slice(0, 3).join(", ");
10194
+ const head = files.slice(0, 3).map(displayPath3).join(", ");
10192
10195
  const remaining = files.length - 3;
10193
10196
  if (remaining <= 0) return `${files.length} paths (${head})`;
10194
10197
  return `${files.length} paths (${head}, ... +${remaining} more)`;
@@ -10216,7 +10219,7 @@ function eventVariantSummary(ev) {
10216
10219
  case "git_snapshot":
10217
10220
  return `branch=${ev.branch} dirty=${ev.dirty}`;
10218
10221
  case "file_changed":
10219
- return `${ev.change_type} ${ev.path}`;
10222
+ return `${ev.change_type} ${displayPath3(ev.path)}`;
10220
10223
  case "session_status_changed":
10221
10224
  return `${ev.from} -> ${ev.to}`;
10222
10225
  case "session_started":
@@ -13168,6 +13171,25 @@ var VIEW_HTML = `<!doctype html>
13168
13171
  detail.appendChild(tl);
13169
13172
  }).catch(fail);
13170
13173
  }
13174
+ // The page cannot import @basou/core, so this mirrors its displayPath: a
13175
+ // recorded name is shown with its control characters as visible escapes, so a
13176
+ // newline in it does not read as a space and an invisible one stays visible.
13177
+ // A test lifts this function and checks it agrees with displayPath.
13178
+ function showPath(p) {
13179
+ var out = '';
13180
+ for (var i = 0; i < p.length; i++) {
13181
+ var c = p.charCodeAt(i);
13182
+ var acting = c <= 0x1f || (c >= 0x7f && c <= 0x9f) || c === 0x2028 || c === 0x2029 ||
13183
+ (c >= 0x202a && c <= 0x202e) || (c >= 0x2066 && c <= 0x2069);
13184
+ if (!acting) { out += p.charAt(i); continue; }
13185
+ if (c === 10) out += '\\\\n';
13186
+ else if (c === 13) out += '\\\\r';
13187
+ else if (c === 9) out += '\\\\t';
13188
+ else if (c <= 0xff) out += '\\\\x' + ('0' + c.toString(16)).slice(-2);
13189
+ else out += '\\\\u' + ('000' + c.toString(16)).slice(-4);
13190
+ }
13191
+ return out;
13192
+ }
13171
13193
  function eventSummary(ev) {
13172
13194
  if (ev.type === 'command_executed') {
13173
13195
  var cmd = (ev.args && ev.args.length) ? ev.args.join(' ') : ev.command;
@@ -13175,7 +13197,7 @@ var VIEW_HTML = `<!doctype html>
13175
13197
  var ex = (ev.exit_code === null || ev.exit_code === undefined) ? '' : ' (exit ' + ev.exit_code + ')';
13176
13198
  return cmd + ex;
13177
13199
  }
13178
- if (ev.type === 'file_changed') return ev.path + ' [' + ev.change_type + ']';
13200
+ if (ev.type === 'file_changed') return showPath(ev.path) + ' [' + ev.change_type + ']';
13179
13201
  if (ev.type === 'decision_recorded') return ev.title || '';
13180
13202
  if (ev.type === 'decision_voided') {
13181
13203
  var vs = ev.superseded_by ? ' superseded by ' + ev.superseded_by : '';
@@ -13993,7 +14015,7 @@ async function assertWorkspaceInitialized15(basouRoot) {
13993
14015
  function readBuildStamp() {
13994
14016
  if (false) return void 0;
13995
14017
  try {
13996
- return JSON.parse('{"version":"0.50.0","commit":"5b4c5dc","committedAt":"2026-09-23T19:12:06+09:00"}');
14018
+ return JSON.parse('{"version":"0.51.0","commit":"22ef44f","committedAt":"2026-09-23T22:27:59+09:00"}');
13997
14019
  } catch {
13998
14020
  return void 0;
13999
14021
  }