@nonbot/cli 0.9.7 → 0.9.9

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.
@@ -1,6 +1,18 @@
1
1
  const RADAR_BROADCAST_LIMIT = 20;
2
2
  const BROADCAST_CAP = 200;
3
3
  const TERMINAL_STATUSES = new Set(['complete', 'failed', 'stopped']);
4
+ function toPublicPane(p) {
5
+ return {
6
+ paneId: p.paneId,
7
+ name: p.name,
8
+ branch: p.branch,
9
+ status: p.status,
10
+ mergeReady: p.mergeReady,
11
+ dirtyFiles: p.dirtyFiles,
12
+ commitsAhead: p.commitsAhead,
13
+ createdAt: p.createdAt,
14
+ };
15
+ }
4
16
  export function applyAction(state, action) {
5
17
  switch (action.type) {
6
18
  case 'session-init':
@@ -131,11 +143,11 @@ export function applyAction(state, action) {
131
143
  }
132
144
  }
133
145
  export function selectRadar(state) {
134
- const panes = Object.values(state.panes).filter((p) => !TERMINAL_STATUSES.has(p.status));
135
- const active = new Set(panes.map((p) => p.paneId));
146
+ const activePanes = Object.values(state.panes).filter((p) => !TERMINAL_STATUSES.has(p.status));
147
+ const active = new Set(activePanes.map((p) => p.paneId));
136
148
  return {
137
149
  sessionId: state.sessionId,
138
- panes,
150
+ panes: activePanes.map(toPublicPane),
139
151
  claims: state.claims.filter((c) => active.has(c.paneId)),
140
152
  broadcasts: state.broadcasts.slice(-RADAR_BROADCAST_LIMIT),
141
153
  collisions: state.collisions,
@@ -42,6 +42,9 @@ export function shellQuoteSingle(s) {
42
42
  const escaped = String(s).replace(/'/g, `'\\''`);
43
43
  return `'${escaped}'`;
44
44
  }
45
+ export function bannerSafeText(s) {
46
+ return String(s).replace(/[\\"$`]/g, (ch) => (ch === '\\' ? '\\\\\\\\' : '\\' + ch));
47
+ }
45
48
  function bannerHeader(title) {
46
49
  const inner = BANNER_WIDTH - 2;
47
50
  const top = BOX_TL + BOX_H.repeat(inner) + BOX_TR;
@@ -264,7 +267,7 @@ export function buildRealCommand(params) {
264
267
  '',
265
268
  bannerHeader('Run'),
266
269
  '',
267
- kvRow('Story', titleLabel),
270
+ kvRow('Story', bannerSafeText(titleLabel)),
268
271
  kvRow('Activation', params.activationId || '(unknown)'),
269
272
  kvRow('Provider', providerLabel),
270
273
  kvRow('Repo', repoLabel),
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.9.7';
1
+ export const VERSION = '0.9.9';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nonbot/cli",
3
- "version": "0.9.7",
3
+ "version": "0.9.9",
4
4
  "type": "module",
5
5
  "description": "The local host for non.bot ▶ Run — opens a terminal on your machine and starts the work in your linked repo.",
6
6
  "license": "UNLICENSED",