@rhizogrip/spore-cli 1.5.1 → 1.6.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/bin/spore.js +3 -0
- package/package.json +2 -2
- package/src/dispatch.js +3 -3
- package/tui/status.js +1 -0
package/bin/spore.js
CHANGED
|
@@ -435,6 +435,9 @@ try {
|
|
|
435
435
|
// the record.
|
|
436
436
|
const settled = sent.repeated && !sent.started && stateOf(ws).state !== RUNNING
|
|
437
437
|
|
|
438
|
+
const dreaming = !sent.started && !settled && stateOf(ws).dreaming
|
|
439
|
+
if (dreaming) console.error('spore: it is dreaming — your message waits for it to wake, and the turn after the dream reads it')
|
|
440
|
+
|
|
438
441
|
if (argv.unsafe && !sent.started && !settled) {
|
|
439
442
|
console.error('spore: --unsafe took no effect — the message went to the turn already running, which keeps the confinement it was started with')
|
|
440
443
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rhizogrip/spore-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.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.
|
|
53
|
+
"@rhizogrip/spore": "1.6.0",
|
|
54
54
|
"chalk": "^6.0.1",
|
|
55
55
|
"minimist": "^1.2.8"
|
|
56
56
|
},
|
package/src/dispatch.js
CHANGED
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
addTo, allowPlugin, billingFor, changeText, define, defaultModel, disallowPlugin, durationText,
|
|
18
18
|
edit, extend, getKey, jobs, list, listPlugins, log, pause, precursors, remake, remove,
|
|
19
19
|
removeFrom, removeSchedule, runningLines, saidOf, schedules, setDefaultModel, setKey, setSchedule, settings,
|
|
20
|
-
show, showPlugin, sql, stopJob, switchModel, tick, tickReport, unmetered, unpause, upgrade, usage, wrap, CONFIG_FILE, DEFAULT_SPORANGIUM
|
|
20
|
+
show, showPlugin, sql, stateWord, stopJob, switchModel, tick, tickReport, unmetered, unpause, upgrade, usage, wrap, CONFIG_FILE, DEFAULT_SPORANGIUM
|
|
21
21
|
} from '@rhizogrip/spore'
|
|
22
22
|
import { diagnose, renderDoctor } from './doctor.js'
|
|
23
23
|
import { hook } from './hooks.js'
|
|
@@ -42,7 +42,7 @@ const line = (row, under) => {
|
|
|
42
42
|
const where = under && row.ws.startsWith(under) ? row.ws.slice(under.length + 1) || '.' : row.ws
|
|
43
43
|
const spend = row.treeUsd ? `$${row.treeUsd.toFixed(4)}` : ''
|
|
44
44
|
const works = row.definitionError ? ' (its spore.cmk does not parse)' : row.writes.map(path => ` → ${tilde(path)}`).join('')
|
|
45
|
-
return ` ${row.
|
|
45
|
+
return ` ${stateWord(row).padEnd(STATE_WIDTH)} ${String(row.lastTurnNo).padStart(4)} turns ${spend.padStart(9)} ${size(row.bytes).padStart(8)} ${where}${works}`
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
const block = (title, rows, under) => {
|
|
@@ -137,7 +137,7 @@ export function renderHeader (ws, grant) {
|
|
|
137
137
|
function renderShow (result) {
|
|
138
138
|
const line = (label, value) => console.log(` ${label.padEnd(10)} ${value}`)
|
|
139
139
|
console.log(result.ws)
|
|
140
|
-
line('state', `${result
|
|
140
|
+
line('state', `${stateWord(result)}${result.pid ? ` pid ${result.pid} since ${result.startedAt}` : ''}`)
|
|
141
141
|
line('name', result.name)
|
|
142
142
|
if (result.description) line('description', result.description)
|
|
143
143
|
line('sporangium', result.sporangium)
|
package/tui/status.js
CHANGED
|
@@ -11,6 +11,7 @@ const unmetered = (shown) => shown.billing && shown.billing.kind !== 'metered'
|
|
|
11
11
|
export function stateText (shown, { paused, now }) {
|
|
12
12
|
if (paused) return 'paused'
|
|
13
13
|
if (shown.state !== RUNNING) return shown.state
|
|
14
|
+
if (shown.dreaming) return `dreaming ${durationText(now - Date.parse(shown.startedAt))}`
|
|
14
15
|
if (shown.draining) return 'finishing'
|
|
15
16
|
if (shown.turnLimits?.limits.wall) return 'running'
|
|
16
17
|
return `running ${durationText(now - Date.parse(shown.startedAt))}`
|