@rhizogrip/spore-cli 1.17.0 → 1.19.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rhizogrip/spore-cli",
3
- "version": "1.17.0",
3
+ "version": "1.19.0",
4
4
  "author": {
5
5
  "name": "Christophe Le Bars",
6
6
  "email": "clb@toort.net"
@@ -50,7 +50,7 @@
50
50
  "tui": "node bin/spore.js tui"
51
51
  },
52
52
  "dependencies": {
53
- "@rhizogrip/spore": "1.17.0",
53
+ "@rhizogrip/spore": "1.19.0",
54
54
  "chalk": "^6.0.1",
55
55
  "minimist": "^1.2.8"
56
56
  },
package/src/dispatch.js CHANGED
@@ -303,7 +303,7 @@ const cut = (text) => (text.length > 60 ? text.slice(0, 57) + '…' : text)
303
303
  const quoted = (entries) => entries.map(entry => `${saidBy(entry) ? `${saidBy(entry)}: ` : ''}${JSON.stringify(cut(saidText(entry)))}`).join(' ')
304
304
 
305
305
  function renderLog (result) {
306
- if (!result.turns.length && !result.waiting.length && !result.held.length) {
306
+ if (!result.turns.length && !result.waiting.length && !result.setAside.length && !result.held.length) {
307
307
  console.log('nothing has been said here yet')
308
308
  return
309
309
  }
@@ -319,6 +319,9 @@ function renderLog (result) {
319
319
  }
320
320
  // The time column is when a turn ended, and a waiting message has not been answered by
321
321
  // one. Blank says that; when it was said is in the record for anyone who needs it.
322
+ for (const entry of result.setAside) {
323
+ console.log(` ${' '.repeat(19)} ${'set aside'.padEnd(12)} ${' '.repeat(19)} ${quoted([entry])}`)
324
+ }
322
325
  for (const entry of result.waiting) {
323
326
  console.log(` ${' '.repeat(19)} ${'waiting'.padEnd(12)} ${' '.repeat(19)} ${quoted([entry])}`)
324
327
  }
@@ -33,7 +33,7 @@ const said = (entry) => ({ kind: 'said', inboxNo: entry.inboxNo, origin: originO
33
33
  export function history ({ turns, inbox }) {
34
34
  const items = []
35
35
  for (const turn of turns) {
36
- for (const entry of inbox.filter(e => e.inboxNo > turn.inboxFrom && e.inboxNo <= turn.inboxTo)) items.push(said(entry))
36
+ for (const entry of inbox.filter(e => e.inboxNo > turn.inboxFrom && e.inboxNo <= turn.inboxTo && !e.setAside)) items.push(said(entry))
37
37
  if (turn.output) items.push({ kind: 'answer', text: printable(turn.output) })
38
38
  items.push({
39
39
  kind: 'end',
@@ -46,7 +46,7 @@ export function history ({ turns, inbox }) {
46
46
  durationMs: turn.startedAt && turn.endedAt ? Date.parse(turn.endedAt) - Date.parse(turn.startedAt) : null
47
47
  })
48
48
  }
49
- for (const entry of inbox.filter(e => !e.consumed)) items.push({ ...said(entry), waiting: true })
49
+ for (const entry of inbox.filter(e => !e.consumed && !e.setAside)) items.push({ ...said(entry), waiting: true })
50
50
  return items
51
51
  }
52
52