nearly-cli 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nearly-cli",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "description": "A pull request tells you what changed. Nearly tells you what nearly happened: the commands a human refused, the pushes policy blocked, the turns rolled back.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -73,8 +73,20 @@ if (!health) {
73
73
  let mine = root;
74
74
  try { mine = realpathSync(root); } catch { /* compare literally */ }
75
75
  const same = health.root === mine;
76
- say(same ? true : false, 'server', same ? `v${health.version}` : `a different install is answering: ${health.root || 'an older build'}`,
77
- 'run `nearly` here it closes an older server that is holding the port');
76
+ let ours = null;
77
+ try { ours = JSON.parse(readFileSync(join(root, 'package.json'), 'utf8')).version; } catch { /* unknown */ }
78
+ if (same) {
79
+ say(true, 'server', `v${health.version}`);
80
+ } else if (health.version && health.version === ours) {
81
+ // Running this through npx gives a throwaway directory every time, so the
82
+ // paths differ even when the build is identical. Saying "a different
83
+ // install" there is true and useless; the version is what anyone cares
84
+ // about, and a matching one is holding nothing back.
85
+ say(null, 'server', `v${health.version} from another copy of the same version — nothing stale about it`);
86
+ } else {
87
+ say(false, 'server', `an older build is answering${health.version ? ` (v${health.version})` : ''}: ${health.root || 'it does not say where it lives'}`,
88
+ 'run `nearly` here — it closes the older server holding the port');
89
+ }
78
90
  }
79
91
 
80
92
  // 4 — recordings for this branch, matched the way the record builder matches
@@ -49,7 +49,12 @@ lines.push(sb.runs > 1
49
49
  lines.push('');
50
50
  lines.push(urlBase
51
51
  ? `**[Watch the record (${mmss(sb.totalS)})](${urlBase}/${slug}.html)** · ${sb.runs > 1 ? `${sb.runs} agent sessions` : `agent \`${sb.name}\``} · ${sb.model} · ${sb.date}`
52
- : `Record: \`ui/records/${slug}.html\` in the Nearly checkout (${mmss(sb.totalS)}, not hosted yet) · ${sb.runs > 1 ? `${sb.runs} agent sessions` : `agent \`${sb.name}\``} · ${sb.model} · ${sb.date}`);
52
+ // No host configured. Everything a reviewer needs to act on is in this
53
+ // comment already — what was refused, and what the diff therefore cannot show
54
+ // them. Only the player is missing, so say where it is honestly rather than
55
+ // naming a path from the developer's own checkout that means nothing to
56
+ // anybody who installed this.
57
+ : `${sb.runs > 1 ? `${sb.runs} agent sessions` : `Agent \`${sb.name}\``} · ${sb.model} · ${sb.date} · ${mmss(sb.totalS)} recording, kept on the author's machine`);
53
58
  lines.push('');
54
59
  if (outcome?.notDone?.length) {
55
60
  lines.push(`> **${outcome.notDone.length} thing${outcome.notDone.length > 1 ? 's' : ''} the agent wanted to do did not happen.** The diff cannot show you this.`);
@@ -67,7 +72,7 @@ sb.scenes.forEach((s, i) => { lines.push(`${i + 1}. **${s.kind}** — ${s.narrat
67
72
  lines.push('');
68
73
  lines.push('</details>');
69
74
  lines.push('');
70
- lines.push(`<sub>Every number above was computed from the session recording. ${sb.polished ? 'Sentences were rewritten by a model; facts were not.' : 'No model wrote any of it.'}</sub>`);
75
+ lines.push(`<sub>Every number above was computed from the session recording. ${sb.polished ? 'Sentences were rewritten by a model; facts were not.' : 'No model wrote any of it.'}${urlBase ? '' : ' The narrated version is not published anywhere; `nearly publish` puts it on GitHub Pages.'}</sub>`);
71
76
  // A hidden marker so we can find our own comment again on the next push and
72
77
  // edit it, instead of stacking a new one on every push until nobody reads any.
73
78
  // Deliberately carries no product name. This string is how a comment is