@awebai/oats 0.68.0 → 0.68.1
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/docs/desktop.md +39 -3
- package/docs/official-catalog.md +1 -1
- package/docs/release-notes/v0.68.1.md +102 -0
- package/docs/tui.md +38 -20
- package/docs/upgrading.md +9 -5
- package/package-catalog.json +1 -1
- package/package.json +1 -1
- package/packages/client/instance-display-name.mjs +18 -0
- package/packages/tui/README.md +1 -1
- package/packages/tui/lib/client.mjs +1 -0
- package/packages/tui/lib/model.mjs +12 -3
- package/packages/tui/lib/views/capabilities.mjs +6 -6
- package/packages/tui/lib/views/help.mjs +1 -1
- package/packages/tui/lib/views/instances.mjs +44 -28
- package/packages/tui/lib/views/souls.mjs +9 -8
package/docs/desktop.md
CHANGED
|
@@ -225,6 +225,17 @@ instance roster**) and `/` in the sidebar go to the roster's current row;
|
|
|
225
225
|
on an empty roster, to its one action, the foot's **Spawn instance**, where
|
|
226
226
|
F6 lands too (a failed read's **Retry** comes first).
|
|
227
227
|
|
|
228
|
+
The sidebar is 288px wide, and you can make it wider or narrower: drag its
|
|
229
|
+
right edge, between 240px and 480px (or 45% of the window, when that is
|
|
230
|
+
less, so the terminals keep the rest). With the keyboard, Tab to that edge
|
|
231
|
+
(after the settings cog) and use ← and → (8px a step, 32px with Shift), Home
|
|
232
|
+
and End for the narrowest and the widest. A double-click on the edge, Enter
|
|
233
|
+
on it, or the command palette's **Sidebar: reset width** put it back to 288px.
|
|
234
|
+
The width is remembered on this computer, and kept while the sidebar is
|
|
235
|
+
hidden; a window too narrow for it shows it narrower, and gives it back when
|
|
236
|
+
the window grows again. The terminals refit as it moves, and their programs
|
|
237
|
+
hear the new size once, when you let go.
|
|
238
|
+
|
|
228
239
|
The list of workspaces is always shown. Its heading holds **Add local
|
|
229
240
|
workspace…** (the **+**). The list has one row per workspace this window can show, whatever
|
|
230
241
|
machine it is on: every workspace the Desktop serves, those only on servers
|
|
@@ -260,7 +271,7 @@ computer.
|
|
|
260
271
|
and the list's description names it, by the same name as its row.
|
|
261
272
|
- **The needs-input mark.** A row has an exclamation mark (a small amber
|
|
262
273
|
disc with a "!") at its right end when an instance of that workspace needs
|
|
263
|
-
input, the same mark
|
|
274
|
+
input, the same mark a waiting instance's dot shows in the instance tree: the claim the instance roster shows
|
|
264
275
|
for that instance, from a running session (OATS with the `waiting-on-you`
|
|
265
276
|
feature), as the Desktop already reads it for the workspaces it serves.
|
|
266
277
|
Every row can have it, the current one included. The row's name then ends
|
|
@@ -818,14 +829,39 @@ right of its parent, and related instances are grouped together. Siblings are
|
|
|
818
829
|
joined by a dotted line through their dots. A parent's line to its children
|
|
819
830
|
runs just to the right of the dotted line, so the two never merge.
|
|
820
831
|
|
|
832
|
+
A row shows the instance's name as words: each `-` is a space, and the first
|
|
833
|
+
letter is a capital, so `oats-expert-maintainer-lanes` reads "Oats expert
|
|
834
|
+
maintainer lanes". Only the row's label changes. The hover card, the command
|
|
835
|
+
palette (which still finds the instance by its name), its terminal tab, a
|
|
836
|
+
screen reader and the `oats` CLI all use the instance's real name. The TUI's
|
|
837
|
+
sidebar shows the same words.
|
|
838
|
+
|
|
839
|
+
A row's dot says the instance's state: filled while it runs, a ring when it is
|
|
840
|
+
stopped, a grey ring with a small grey centre when its state is unknown (the
|
|
841
|
+
command palette, Quick Open and the overview show it the same way). An
|
|
842
|
+
instance that needs input (a running session's claim, from OATS with the
|
|
843
|
+
`waiting-on-you` feature) shows the needs-input mark in place of its dot: a
|
|
844
|
+
slightly larger amber disc with a "!" cut out of it, the mark its terminal tab
|
|
845
|
+
and the workspace list show. Amber means needs input and nothing else.
|
|
846
|
+
Elsewhere, a dot that flags a problem is red: a keyboard shortcut that clashes
|
|
847
|
+
with another (on the settings cog), Setup or Teams needing attention (on the
|
|
848
|
+
Workspace page's tabs), and an automation that doesn't run here or a
|
|
849
|
+
scheduler that is off.
|
|
850
|
+
The row keeps its soul and repository on its second line. A screen reader
|
|
851
|
+
hears "Needs input" after the name, and the hover card gives the reason and
|
|
852
|
+
how long it has waited. A collapsed parent shows "! N below" on its second
|
|
853
|
+
line for the rows it hides that need input, beside its own mark when it waits
|
|
854
|
+
too. Rows never move or grow, and nothing animates.
|
|
855
|
+
|
|
821
856
|
## An instance's colour
|
|
822
857
|
|
|
823
858
|
An instance can have a colour, one of the soul palette's six (Sand, Sage,
|
|
824
859
|
Slate, Mauve, Clay, Olive). Its dot shows it wherever the instance is listed:
|
|
825
860
|
the sidebar, its terminal tab, the command palette and the overview. A running
|
|
826
861
|
instance's dot is filled with the colour, a stopped one's is a ring in it. An
|
|
827
|
-
instance whose state is unknown keeps
|
|
828
|
-
|
|
862
|
+
instance whose state is unknown keeps its grey bullseye, one that needs input
|
|
863
|
+
shows the needs-input mark in the sidebar, never in its colour, and one without
|
|
864
|
+
a colour looks as before. The shape says the state, never the colour alone.
|
|
829
865
|
|
|
830
866
|
To set it, open **Instance: name and colour…** from the command palette, or
|
|
831
867
|
press Alt+R (⌥⌘R on macOS; Ctrl+Alt+R in the Ctrl+Alt family). It acts on the instance of the terminal you
|
package/docs/official-catalog.md
CHANGED
|
@@ -12,7 +12,7 @@ or workspace membership alone does not make a package official.
|
|
|
12
12
|
| `oats.framework` | `oats-framework/v1.14.1` (this repository) | `oats.core`, `oats.setup`, `oats.support`, `oats.knowledge-theory` | `knowledge-theory-expert` |
|
|
13
13
|
| `oats.okf` | `v5.3.0` | `oats.okf` (knowledge), `oats.okf-harvest`, `oats.okf-maintenance` | `knowledge-harvester`, `knowledge-maintainer` |
|
|
14
14
|
| `oats.aweb` | `v1.31.0` | `oats.aweb` (messaging), `oats.aweb-tasks` (tasks) | |
|
|
15
|
-
| `oats.engineering` | `v1.
|
|
15
|
+
| `oats.engineering` | `v1.13.0` | `oats.engineering-expert`, `oats.developer`, `oats.code-review`, `oats.maintainer` | `code-reviewer` |
|
|
16
16
|
| `oats.authoring` | `v1.0.3` | `oats.authoring` | |
|
|
17
17
|
| `oats.cloning` | `v1.0.1` | `oats.cloning` | `cloner` |
|
|
18
18
|
| `oats.jira` | `v1.0.1` | `oats.jira` (tasks) | |
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# OATS 0.68.1
|
|
2
|
+
|
|
3
|
+
Unreleased
|
|
4
|
+
|
|
5
|
+
## Upgrade
|
|
6
|
+
|
|
7
|
+
- **From 0.68.0:** [the steps](../upgrading.md#the-steps), the Desktop
|
|
8
|
+
first and the CLI second. The 0.68.1 Desktop accepts OATS CLIs
|
|
9
|
+
`>=0.26.0 <0.69.0`. The official catalog pins oats.engineering 1.13.0
|
|
10
|
+
(Provider updates, below) in place of 0.68.0's 1.11.0.
|
|
11
|
+
|
|
12
|
+
- **From 0.67 or earlier:** do [0.68.0's Upgrade steps](v0.68.0.md#upgrade)
|
|
13
|
+
first: a 0.67 Desktop refuses a 0.68 CLI. From 0.66 or earlier, do 0.67.0's
|
|
14
|
+
too, and the older ones [Upgrading](../upgrading.md#coming-from-an-older-version)
|
|
15
|
+
names.
|
|
16
|
+
|
|
17
|
+
## Added
|
|
18
|
+
|
|
19
|
+
- **Desktop: a resizable sidebar, a little wider by default.** The sidebar
|
|
20
|
+
is 288px wide (it was 264px), and its right edge is a handle: drag it
|
|
21
|
+
between 240px and 480px (at most 45% of the window, so the terminals keep
|
|
22
|
+
the rest), or Tab to it and use ← and → (Shift for bigger steps), Home and
|
|
23
|
+
End. A double-click on it, Enter, or the palette's **Sidebar: reset width**
|
|
24
|
+
put it back to 288px. The width is remembered on this computer and kept
|
|
25
|
+
while the sidebar is hidden. Terminals refit as it moves and tell their
|
|
26
|
+
programs the new size once, at the end.
|
|
27
|
+
([desktop.md](../desktop.md#workspaces),
|
|
28
|
+
[desktop-keyboard.md](../../packages/desktop/docs/desktop-keyboard.md#keyboard-audit))
|
|
29
|
+
|
|
30
|
+
## Changed
|
|
31
|
+
|
|
32
|
+
- **Desktop: the sidebar shows an instance's name as words.** Each `-` is a
|
|
33
|
+
space, and the first letter is a capital: `oats-expert-maintainer-lanes`
|
|
34
|
+
reads "Oats expert maintainer lanes", on nested rows and on a spawn's
|
|
35
|
+
pending row too. Only the row's label changes. The hover card, the command
|
|
36
|
+
palette's search, terminal tabs, a screen reader and the CLI keep the real
|
|
37
|
+
name ([OATS Desktop](../desktop.md#the-sidebars-instance-tree)).
|
|
38
|
+
|
|
39
|
+
- **Desktop: an instance that needs input shows it on its dot.** In the
|
|
40
|
+
sidebar's instance tree, the row's dot becomes the needs-input mark, the
|
|
41
|
+
amber disc with a "!" that the terminal tab and the workspace list already
|
|
42
|
+
show, and the row's "Needs input" label is gone: its second line keeps the
|
|
43
|
+
soul and the repository. A screen reader still hears "Needs input" after the
|
|
44
|
+
name, the hover card keeps the reason and how long it has waited, and a
|
|
45
|
+
collapsed parent still shows "! N below" for the rows it hides
|
|
46
|
+
([OATS Desktop](../desktop.md#the-sidebars-instance-tree)).
|
|
47
|
+
- **Desktop: yellow now means needs input only.** Unknown state has its own
|
|
48
|
+
look, a grey ring with a small grey centre, in the sidebar, the command
|
|
49
|
+
palette, Quick Open, the overview and a team's member list. The keyboard
|
|
50
|
+
shortcut clash dot, the Workspace page's Setup and Teams attention dot and
|
|
51
|
+
the Automations problem dots are red.
|
|
52
|
+
|
|
53
|
+
- **TUI: an instance's row shows its name as words**, as the Desktop's
|
|
54
|
+
sidebar does: each `-` a space and the first letter upper-case, so
|
|
55
|
+
`oats-expert-lead` reads `Oats expert lead`, nested rows included. Only
|
|
56
|
+
the row changes: the detail, the filter (`oats-expert` still finds the
|
|
57
|
+
row), the palette, the tabs, the confirmations and everything sent to
|
|
58
|
+
OATS keep the instance's name, and a row is cut as before. See
|
|
59
|
+
[What it shows](../tui.md#what-it-shows).
|
|
60
|
+
|
|
61
|
+
- **TUI: an instance that needs input shows it by its mark, not a tag in
|
|
62
|
+
words.** Its row draws `!` in place of its state mark, bold, in reverse
|
|
63
|
+
video in yellow (not reversed on the selected row, a gap in the
|
|
64
|
+
selection's bar), whatever its state and its colour; the row's
|
|
65
|
+
`Needs input` tag is gone, and its name is cut as before. Under
|
|
66
|
+
`NO_COLOR` the reverse video and the `!` carry it, and in ASCII it is the
|
|
67
|
+
same `!`. A folded row keeps its `N below` tag for the waiting instances
|
|
68
|
+
it folds away, whether or not it waits itself. The detail still says it
|
|
69
|
+
in words, with the reason and how long it has waited, and the help lists
|
|
70
|
+
the mark. Yellow now means needs input only: a state unknown (`?`) is
|
|
71
|
+
dim in the terminal's foreground, and the warnings of the Souls and
|
|
72
|
+
Capabilities views (a failed read, `Can't spawn here`, `· N on an older
|
|
73
|
+
version`) are bold red, and a `sand` instance or soul is in the
|
|
74
|
+
terminal's foreground colour.
|
|
75
|
+
([tui.md](../tui.md#what-it-shows))
|
|
76
|
+
|
|
77
|
+
## Provider updates
|
|
78
|
+
|
|
79
|
+
- **oats.engineering 1.13.0: one release lane, and one lane per project.**
|
|
80
|
+
The catalog and this workspace pin `oats.engineering: v1.13.0` (floor
|
|
81
|
+
unchanged). It carries 1.12.0 and 1.13.0 together, and supersedes 1.11.0's
|
|
82
|
+
"a maintainer the map doesn't name asks for a lane before it acts":
|
|
83
|
+
- **The release lane** does the final review and the merge of what the
|
|
84
|
+
other lanes hand it, owns and tags every release, and keeps the lane map.
|
|
85
|
+
- **Every other lane is a project lane.** A maintainer defines one, or
|
|
86
|
+
claims one with no active maintainer, when it holds none or its human
|
|
87
|
+
asks, and adds itself to the map; several maintainers may share a lane.
|
|
88
|
+
A project lane reviews its own work and hands each approved PR to the
|
|
89
|
+
release lane. The map may record another arrangement for a lane, agreed
|
|
90
|
+
with the release lane.
|
|
91
|
+
- **A human's high-level picture is the maintainer's intake.** The
|
|
92
|
+
maintainer writes the brief and launches the expert, which writes the
|
|
93
|
+
spec and plan. A lead launched for work in a lane the maintainer holds is
|
|
94
|
+
its child (`--parent`); work for another lane goes to that lane's
|
|
95
|
+
maintainer, or to a maintainer spawned for it, and the human is told who
|
|
96
|
+
has it.
|
|
97
|
+
- Also taught: splitting a lane, the owning lane's second read on a
|
|
98
|
+
cross-lane PR, confirming a relayed human decision directly, cleaning up
|
|
99
|
+
a cancelled effort, and a failed publication (re-run from the same tag).
|
|
100
|
+
- **Upgrade:** `oats sync` locks it; new spawns get it, or a stopped home
|
|
101
|
+
moved with `oats instance upgrade`. Peer maintainers record their lanes,
|
|
102
|
+
and any non-default arrangement, in their lane map.
|
package/docs/tui.md
CHANGED
|
@@ -98,10 +98,10 @@ runs.
|
|
|
98
98
|
acme-platform │ dev
|
|
99
99
|
│ soul dev
|
|
100
100
|
Instances 1 │ state running
|
|
101
|
-
> ●
|
|
101
|
+
> ● Dev │ harness claude, claude-opus-5-5 (so…
|
|
102
102
|
│ work worktree, agents/dev
|
|
103
|
-
|
|
104
|
-
○
|
|
103
|
+
! Reviewer │ team eng
|
|
104
|
+
○ Helper │ started 11:00
|
|
105
105
|
──────────────────────────────────────│ home …oy/agents/dev/instances/dev
|
|
106
106
|
Souls 2 │
|
|
107
107
|
Capabilities 3 │
|
|
@@ -183,21 +183,32 @@ while a terminal is open); under 80 columns it has the whole width.
|
|
|
183
183
|
indent alone says which instance is under which: no mark is drawn for
|
|
184
184
|
it. A row whose instances are folded away (`h`) says how many after its
|
|
185
185
|
name: `+1`.
|
|
186
|
-
- **Each row** is the mark of its state and the name
|
|
187
|
-
input
|
|
186
|
+
- **Each row** is the mark of its state and the name. A row that needs
|
|
187
|
+
input has the needs-input mark in place of its state mark: `!`, bold,
|
|
188
|
+
in reverse video in the waiting colour, a yellow cell with the `!` cut
|
|
189
|
+
out (the Desktop's mark in one cell), whatever the row's state and its
|
|
190
|
+
instance colour. On the selected row, which is in reverse video already,
|
|
191
|
+
it is the waiting colour not reversed, a gap in the selection's bar;
|
|
192
|
+
under `NO_COLOR` the reverse video and the `!` carry it, and in ASCII it
|
|
193
|
+
is the same `!`. The detail says it in words (its `needs` line, the
|
|
194
|
+
reason and how long it has waited), and so does the help. The row shows the name as words, as the Desktop's sidebar does: each `-`
|
|
195
|
+
a space and the first letter upper-case, so `oats-expert-lead` reads
|
|
196
|
+
`Oats expert lead`. Only the row does: the detail, the filter (`/` with
|
|
197
|
+
`oats-expert` still finds the row), the palette, the tabs, the
|
|
198
|
+
confirmations and everything sent to OATS keep the instance's name. A
|
|
188
199
|
folded row with waiting instances among those it folds away says how
|
|
189
|
-
many
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
video in the waiting colour, and on the
|
|
193
|
-
|
|
200
|
+
many in a tag at its right edge, in the Desktop's words: `3 below`, and
|
|
201
|
+
`99+ below` past 99, whether or not the row needs input itself: its mark
|
|
202
|
+
says its own claim, the tag the rest, and the detail's `below` line names
|
|
203
|
+
them. The tag is in reverse video in the waiting colour, and on the
|
|
204
|
+
selected row it is the waiting colour not reversed, a gap in the
|
|
194
205
|
selection's bar; under `NO_COLOR` the reverse video alone carries it. On
|
|
195
206
|
a narrow row the tag gives way first: it says its words only where the
|
|
196
207
|
whole name, its `+1` and the row's word in its column all fit beside them,
|
|
197
|
-
and else shrinks to
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
208
|
+
and else shrinks to the count alone (`3`, `99+`), still in reverse video,
|
|
209
|
+
in the cells every row keeps at its right edge. So the tag never cuts a
|
|
210
|
+
name, a word or a mark: those give way as on a row whose instances do
|
|
211
|
+
not wait. The harness and the state in words are in
|
|
201
212
|
the detail. A row has a word, dim, only where its mark cannot say it: the
|
|
202
213
|
state of a home a spawn or a retire holds (`Retire didn't finish`), or
|
|
203
214
|
the shared words for why an instance cannot be reached or opened:
|
|
@@ -291,20 +302,23 @@ in its workspace for the rest of the run, also while it is not reached.
|
|
|
291
302
|
| `?` | `?` | state unknown: the kernel or the terminal probe could not tell, or the instance's machine was not reached |
|
|
292
303
|
| `◆` | `#` | held by a spawn or a retire: under way (Retiring…), failed or not finished ([below](#held-rows)) |
|
|
293
304
|
| `+n` | `+n` | after a name: n instances folded away below it |
|
|
294
|
-
|
|
|
295
|
-
| `N below` | `N below` | N instances folded away below it need input, `N` where the whole name does not fit beside the words |
|
|
305
|
+
| `!` | `!` | needs input: in place of the state mark, in yellow and reverse video (not reversed on the selected row) |
|
|
306
|
+
| `N below` | `N below` | N instances folded away below it need input: a tag in reverse video at the row's right edge, `N` where the whole name does not fit beside the words |
|
|
296
307
|
| `>` | `>` | the selected row (also drawn in reverse video), and the pane the movement keys act on |
|
|
297
308
|
| `*` | `*` | in the switcher: the workspace that is open |
|
|
298
309
|
|
|
299
|
-
Every state has a mark of its own shape, so
|
|
310
|
+
Every state has a mark of its own shape, and so does needs input, so
|
|
311
|
+
nothing is told by colour alone.
|
|
300
312
|
|
|
301
313
|
**An instance's colour** (feature `instance-color`; set with
|
|
302
314
|
`oats instance color <instance> <colour>`, [desktop-cli-api.md](desktop-cli-api.md#an-instances-colour-oats-instance-color))
|
|
303
315
|
colours its mark, in the list and in a soul's detail: a running mark in it, a
|
|
304
316
|
stopped one and one with a shell left in it dim in it. `?` and `◆` keep their
|
|
305
317
|
own look whatever the colour, and an instance with no colour looks as above.
|
|
306
|
-
The six colours are the terminal's: `sand`
|
|
307
|
-
`mauve` magenta, `clay` red, `olive` cyan, the souls' own
|
|
318
|
+
The six colours are the terminal's: `sand` its own foreground colour, `sage`
|
|
319
|
+
green, `slate` blue, `mauve` magenta, `clay` red, `olive` cyan, the souls' own
|
|
320
|
+
map. `sand` is not yellow, which says needs input and nothing else, and in the
|
|
321
|
+
foreground colour it is seen on a light theme as on a dark one. Which colour a
|
|
308
322
|
row shows is the Desktop's rule (`instanceColor` in `packages/client`); an
|
|
309
323
|
older kernel reports none. Setting a colour from the TUI is not in this
|
|
310
324
|
version.
|
|
@@ -2546,7 +2560,11 @@ alone. The next run removes the directory that is left, with its `tmux`,
|
|
|
2546
2560
|
included) and attributes: those are the agent's. With `NO_COLOR` set and
|
|
2547
2561
|
not empty it uses no colour at all, the agent's included; the agent's
|
|
2548
2562
|
bold, underline, reverse and the like stay. Nothing is told by colour
|
|
2549
|
-
alone.
|
|
2563
|
+
alone. **Yellow says needs input, and only that:** the `!` in place of a
|
|
2564
|
+
row's state mark and the dot in the list of workspaces. A state unknown,
|
|
2565
|
+
`?`, is dim in your terminal's foreground, and a warning (a failed read,
|
|
2566
|
+
`Can't spawn here`, `· 1 on an older version`) is bold red, and a soul's
|
|
2567
|
+
`sand` is in your terminal's foreground ([What it shows](#what-it-shows)).
|
|
2550
2568
|
- It draws its rules and marks in UTF-8 when `LC_ALL`, else `LC_CTYPE`, else
|
|
2551
2569
|
`LANG` names UTF-8, and in ASCII otherwise or with `--ascii`. No icon font,
|
|
2552
2570
|
no emoji. When the locale is not UTF-8, a character outside ASCII in text
|
package/docs/upgrading.md
CHANGED
|
@@ -6,11 +6,11 @@ host that comes from it.
|
|
|
6
6
|
|
|
7
7
|
## Upgrading to the latest version
|
|
8
8
|
|
|
9
|
-
The latest version is **OATS 0.68.
|
|
10
|
-
The 0.68.
|
|
9
|
+
The latest version is **OATS 0.68.1** ([release notes](release-notes/v0.68.1.md)).
|
|
10
|
+
The 0.68.1 Desktop accepts OATS CLIs `>=0.26.0 <0.69.0`.
|
|
11
11
|
|
|
12
12
|
**First, read the `## Upgrade` section of every release after yours, up to
|
|
13
|
-
0.68.
|
|
13
|
+
0.68.1,** in the [release notes](release-notes/): it says what to do before
|
|
14
14
|
the CLI changes, and what else must change with it (the Desktop, another
|
|
15
15
|
tool, a package pin). [Coming from an older version](#coming-from-an-older-version)
|
|
16
16
|
names the releases that ask for more than the steps below. `oats version`
|
|
@@ -19,8 +19,8 @@ prints the version you have.
|
|
|
19
19
|
Then, on each host:
|
|
20
20
|
|
|
21
21
|
```sh
|
|
22
|
-
# 0. where the Desktop is installed: Desktop 0.68.
|
|
23
|
-
npm install -g @awebai/oats@0.68.
|
|
22
|
+
# 0. where the Desktop is installed: Desktop 0.68.1 first
|
|
23
|
+
npm install -g @awebai/oats@0.68.1 # 1. the CLI
|
|
24
24
|
oats update # 2. in each deployment: the plan, then it asks before it runs
|
|
25
25
|
oats doctor # 3. in the same deployment
|
|
26
26
|
```
|
|
@@ -166,6 +166,10 @@ of the Desktop and the CLI, and an optional package pin. A change a script
|
|
|
166
166
|
must follow is in its release's Upgrade section whether or not it is listed
|
|
167
167
|
here.
|
|
168
168
|
|
|
169
|
+
- **[0.68.0](release-notes/v0.68.0.md#upgrade):** the Desktop first, then the CLI: a 0.67 Desktop refuses a 0.68
|
|
170
|
+
CLI. The catalog pins new package versions; after `oats sync`, a stopped
|
|
171
|
+
home can move to them with `oats instance upgrade` instead of a respawn
|
|
172
|
+
([Moving existing homes](#moving-existing-homes-to-locked-package-versions)).
|
|
169
173
|
- **[0.67.0](release-notes/v0.67.0.md#upgrade), first published as
|
|
170
174
|
0.67.1:** the leader is Ctrl+X in OATS Desktop and in `oats tui`, on every
|
|
171
175
|
platform; a leader you rebound is kept. A `tui.json` that gives `ctrl+x` to an action and names no leader
|
package/package-catalog.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@awebai/oats",
|
|
3
|
-
"version": "0.68.
|
|
3
|
+
"version": "0.68.1",
|
|
4
4
|
"description": "OATS (Open Agent Team Specification) — durable souls, disposable instances, targetable capability packages, and the runtime-neutral oats CLI/kernel.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agents",
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** An instance name as words, for display only: the label of an instance row in the Desktop's and the TUI's sidebar
|
|
2
|
+
* (the product owner, 0.68.1: "like normal words with a space between them, with the first word with initial capital
|
|
3
|
+
* letter"). Every `-` is a space, a run of them one space, the ends trimmed, and only the first character upper-cased;
|
|
4
|
+
* every other character stays as it was.
|
|
5
|
+
* `oats-expert-maintainer-lanes` → "Oats expert maintainer lanes", `tui-leader-hint-developer-2` →
|
|
6
|
+
* "Tui leader hint developer 2", `x` → "X", `already Words` → "Already Words".
|
|
7
|
+
* The real name stays wherever it identifies the instance (a title, the hover card, a copy, a search, the accessible
|
|
8
|
+
* name, a tab, the CLI): this is the visible label alone. DOM-free and import-free, with no module state. */
|
|
9
|
+
|
|
10
|
+
/** `name` as words; '' for a non-string or a name with nothing but `-` and spaces. */
|
|
11
|
+
export function instanceDisplayName(name) {
|
|
12
|
+
if (typeof name !== 'string') return '';
|
|
13
|
+
const words = name.replace(/-+/g, ' ').trim();
|
|
14
|
+
if (!words) return '';
|
|
15
|
+
// The first character by code point, so a name that starts outside the BMP is not split.
|
|
16
|
+
const first = String.fromCodePoint(words.codePointAt(0));
|
|
17
|
+
return first.toUpperCase() + words.slice(first.length);
|
|
18
|
+
}
|
package/packages/tui/README.md
CHANGED
|
@@ -27,7 +27,7 @@ never does.
|
|
|
27
27
|
| `lib/panel.mjs` | the open terminals, as tabs: the run's private tmux server (one control client, one window per tab, up to `MAX_TERMINALS`, each at the size its caller gives), the kernel's `oats session attach` in a pane of each, captures of the displayed tabs only (up to `MAX_SHOWN`, one per group of a split) when tmux says their pane changed, a hidden tab's output marking it, keys typed into the shown tab, and the sweep of what a dead run left; the only module that runs tmux (THE TABS in its header) |
|
|
28
28
|
| `lib/read.mjs` | the effects of reading: the deployment, the kernel record, the observer of every deployment opened in the run, the roster of other machines (`oats server roster --json`), the refresh loop, the liveness collector, ending every read, the identity reads of this computer's listed deployments the run has not opened (`createIdentityReads`: one at a time, under a budget, never on a timer), the changes (a stop or retire apply, a start or restart: never ended, their output in files of the run's private directory), the one look at the file system the switcher needs (whether a picked row is a deployment), and `startExec`, the exec of the list's read before the terminal is taken |
|
|
29
29
|
| `lib/store.mjs` | the state and `reduce(state, event)`: pure. It holds the tabs' order, their groups, the shown one of each and the rule for the neighbour after a close (`TAB_LIMIT`, held to the panel's `MAX_TERMINALS` by a test), and each workspace's memory for the run (THE MEMORY OF A WORKSPACE: its place, its palette recency, and its tabs as it was left, opened again one at a time when it is opened again); the list of workspaces' focus and cursor, and the leader's moves between workspaces (the shared `workspaceStep`) |
|
|
30
|
-
| `lib/model.mjs` | from the state to the rows and the detail to draw, and to the switcher's rows (a workspace and a line per deployment of it, matched by the shared `listedViews` over the served deployments and the identities the reads learned), and from those the list of workspaces (`workspaceList`: one row per workspace the switcher offers, by name, and its dot from what this run observes; `listWindow`: five rows at most), by calling the shared readers: pure, no cell position |
|
|
30
|
+
| `lib/model.mjs` | from the state to the rows and the detail to draw (an instance row's name as words, the shared `instanceDisplayName`, which the row alone shows: the views import nothing of the shared home), and to the switcher's rows (a workspace and a line per deployment of it, matched by the shared `listedViews` over the served deployments and the identities the reads learned), and from those the list of workspaces (`workspaceList`: one row per workspace the switcher offers, by name, and its dot from what this run observes; `listWindow`: five rows at most), by calling the shared readers: pure, no cell position |
|
|
31
31
|
| `lib/term/keys.mjs` | bytes to key events: a pure parser with an injected clock; under the kitty keyboard protocol it reads a `CSI … u` key as its legacy bytes read, a chord as its own id |
|
|
32
32
|
| `lib/term/kitty.mjs` | the kitty keyboard protocol: the flags asked for, a `CSI … u` key read, and the bytes the same key sends without the protocol (`legacyBytes`), which is what an agent is typed; and the chords a terminal sends the same way without it (`legacyChordText`: Alt with a letter or a digit, the Alt and Alt+Shift arrows), which the TUI takes in every terminal |
|
|
33
33
|
| `lib/term/width.mjs` | the cells a grapheme takes |
|
|
@@ -25,6 +25,7 @@ export { shortPath, deploymentLabel, machineLabels } from "../../client/deployme
|
|
|
25
25
|
export { instanceId, instanceVisibleInTree, waitingRollup, collapseKey, filterInstanceTree, hasInstanceChildren, heldHome, instanceSiblings } from "../../client/instance-tree.mjs";
|
|
26
26
|
export { rosterSections, deploymentState, rowStale, primaryDeployment, isMultiDeployment } from "../../client/roster-sections.mjs";
|
|
27
27
|
export { runtimeState, runtimeCounts, originLead, siblingText, instanceColor } from "../../client/instance-presentation.mjs";
|
|
28
|
+
export { instanceDisplayName } from "../../client/instance-display-name.mjs";
|
|
28
29
|
export { waitingClaim, waitingLabel, waitedText, waitingClock, waitingBelowText } from "../../client/waiting-on-you.mjs";
|
|
29
30
|
export { instanceActs, openAct } from "../../client/instance-acts.mjs";
|
|
30
31
|
export { rowReason } from "../../client/remote-address.mjs";
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
// in. What it adds is the TUI's: the window, the clock times, and which fact stands on which line.
|
|
8
8
|
import {
|
|
9
9
|
TERMS, panelData, displayLine, DETAIL_WITHHELD, originLead, instanceId, instanceVisibleInTree, waitingRollup, collapseKey, filterInstanceTree,
|
|
10
|
-
hasInstanceChildren, heldHome, instanceSiblings, siblingText, rosterSections, deploymentState, rowStale, primaryDeployment, isMultiDeployment, runtimeState, runtimeCounts, instanceColor,
|
|
10
|
+
hasInstanceChildren, heldHome, instanceSiblings, siblingText, rosterSections, deploymentState, rowStale, primaryDeployment, isMultiDeployment, runtimeState, runtimeCounts, instanceColor, instanceDisplayName,
|
|
11
11
|
waitingClaim, waitingLabel, waitedText, waitingClock, waitingBelowText, instanceActs, rowReason,
|
|
12
12
|
identityMemory, viewModel, listedViews, workspaceChoices, workspaceChoiceRows, choiceMatches, UNMATCHED_SECTION, shortPath, machineLabels,
|
|
13
13
|
openAct, deployments as heldDeployments, attachExit, preflightFailure, kernelLines,
|
|
@@ -330,14 +330,23 @@ export function disclosure(state, r, item) {
|
|
|
330
330
|
return !r.filtering && state.collapsed.has(collapseKey(state.open, item.id)) ? "closed" : "open";
|
|
331
331
|
}
|
|
332
332
|
|
|
333
|
+
/** An instance's name as its row draws it: the shared `instanceDisplayName`, the Desktop's sidebar
|
|
334
|
+
* label (`oats-expert` is drawn "Oats expert"; a name of nothing but `-` as it is). The display
|
|
335
|
+
* filter is asked about the name first, as it came: a name it withholds is passed on unchanged, so
|
|
336
|
+
* shown() withholds it in the view, since the words could hide what made it unsafe (a `-` in a
|
|
337
|
+
* credential's URL becomes a space; a control character at an end is trimmed). */
|
|
338
|
+
const rowName = (name) => (displayLine(name) === DETAIL_WITHHELD ? name : instanceDisplayName(name) || name);
|
|
333
339
|
/** One row of the list: its mark, its name, the word its mark cannot say (or null), whether it
|
|
334
340
|
* waits, and on a folded row only, how many instances are folded away under it (`folded`) and how
|
|
335
341
|
* many of those wait (`below`). A row that is not folded says nothing of its children: they
|
|
336
|
-
* stand under it, indented. `selected` the selected row, `cursor` whether it carries `>`.
|
|
342
|
+
* stand under it, indented. `selected` the selected row, `cursor` whether it carries `>`.
|
|
343
|
+
* The name is drawn as words (rowName): it is what the row shows and nothing else. The filter, the
|
|
344
|
+
* palette, the detail, the tabs, a confirmation and every change sent to the kernel keep the
|
|
345
|
+
* instance's name. */
|
|
337
346
|
function listRow(state, r, item) {
|
|
338
347
|
const closed = disclosure(state, r, item) === "closed";
|
|
339
348
|
return {
|
|
340
|
-
id: item.id, name: item.row.instance, depth: item.depth, selected: item.id === state.selected,
|
|
349
|
+
id: item.id, name: rowName(item.row.instance), depth: item.depth, selected: item.id === state.selected,
|
|
341
350
|
// The selected row keeps its reverse video while the list of workspaces has the focus, but not the
|
|
342
351
|
// cursor: only the region with the focus draws `>`.
|
|
343
352
|
cursor: item.id === state.selected && state.focus !== "workspaces",
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
// marked soul carry `>` as well as reverse video, a soul's colour is drawn on a mark that is there
|
|
9
9
|
// without it, and the souls on an older version are said so in words before their warning style.
|
|
10
10
|
import { lit, shown, shownLines } from "../term/text.mjs";
|
|
11
|
-
import {
|
|
11
|
+
import { style } from "../term/style.mjs";
|
|
12
12
|
import { keyLabel } from "../actions.mjs";
|
|
13
|
-
import { cutNote, headingRow, marksOf, measured } from "./instances.mjs";
|
|
13
|
+
import { colourLook, cutNote, headingRow, marksOf, measured } from "./instances.mjs";
|
|
14
14
|
import { windowOf } from "./scroll.mjs";
|
|
15
15
|
import { COUNT_SIGN, SOUL_MARK, flowed, ownLines } from "./souls.mjs";
|
|
16
16
|
|
|
@@ -44,8 +44,9 @@ const PLAIN = style();
|
|
|
44
44
|
const BOLD = style({ bold: true });
|
|
45
45
|
const DIM = style({ dim: true });
|
|
46
46
|
const SELECTED = style({ reverse: true });
|
|
47
|
-
/** The warning style: what it marks says so in words too.
|
|
48
|
-
|
|
47
|
+
/** The warning style: what it marks says so in words too. Red, not yellow: yellow says needs input,
|
|
48
|
+
* and only that. */
|
|
49
|
+
const WARN = style({ bold: true, fg: "red" });
|
|
49
50
|
|
|
50
51
|
/** The mark between a group's name and its note, and before the instances on an older version. */
|
|
51
52
|
const dotOf = (ascii) => (ascii ? "-" : "·");
|
|
@@ -209,9 +210,8 @@ export function capabilityDetailRows(m, cols) {
|
|
|
209
210
|
const marked = i === m.capabilities.mark;
|
|
210
211
|
if (marked) mark = rows.length;
|
|
211
212
|
const look = (own) => (marked ? SELECTED : own);
|
|
212
|
-
const colour = typeof user.color === "string" && COLORS.includes(user.color) ? user.color : null;
|
|
213
213
|
const spans = marked ? [{ col: LEFT, width: Math.max(0, cols - LEFT), style: SELECTED }, { col: LEFT, text: lit(">"), style: SELECTED, width: 1 }] : [];
|
|
214
|
-
spans.push({ col: INNER, text: lit(soulMark), style: look(
|
|
214
|
+
spans.push({ col: INNER, text: lit(soulMark), style: look(colourLook(user.color) ?? PLAIN), width: 1 });
|
|
215
215
|
const counted = `${sign}${user.count}`;
|
|
216
216
|
const after = [{ text: lit(counted), width: counted.length, style: DIM }];
|
|
217
217
|
if (user.behind) { const behind = measured(user.behind); after.push({ text: lit(dotOf(ascii)), width: 1, style: DIM }, { text: behind.text, width: behind.width, style: WARN }); }
|
|
@@ -351,7 +351,7 @@ export function helpRows(actions, ascii, cols = 100, detachKey = null, chords =
|
|
|
351
351
|
[marks.unknown, "state unknown"],
|
|
352
352
|
[marks.held, ownEllipsis("held by a spawn or a retire: under way (Retiring\u2026), failed or not finished", ascii)],
|
|
353
353
|
["+N", "N instances folded away below it"],
|
|
354
|
-
[marks.waiting,
|
|
354
|
+
[marks.waiting, `${NEEDS_INPUT}: in place of the state mark, in yellow and reverse video`],
|
|
355
355
|
["N", `N instances folded away below it need input: ${belowText("N")} where the whole name fits`],
|
|
356
356
|
[marks.selected, "the selected row, and the pane the movement keys act on"],
|
|
357
357
|
[OPEN_MARK, "among the workspaces: the one that is open"],
|
|
@@ -3,19 +3,20 @@
|
|
|
3
3
|
// marks and the few words around them are the TUI's own. Nothing is told by colour alone: each
|
|
4
4
|
// state has a mark of its own shape, the selected row carries `>` as well as reverse video (the `>`
|
|
5
5
|
// only while the list has the focus, not the list of workspaces: the model's `cursor`), and a
|
|
6
|
-
// waiting row
|
|
6
|
+
// waiting row's state mark is the needs-input mark, `!` in reverse video. A row is quiet: its mark
|
|
7
7
|
// and its name, and a word only where the mark can't say it. Children stand under their parent by
|
|
8
8
|
// indentation alone; a folded row says how many it folds away, `+n`, and how many of those wait,
|
|
9
9
|
// `N below`. In a view of two or more deployments the list also holds a heading per deployment
|
|
10
10
|
// and the sentences the model sets under one: a heading says in words what it is of.
|
|
11
11
|
import { keyLabel } from "../actions.mjs";
|
|
12
12
|
import { lit, shown, shownEnd, textOf } from "../term/text.mjs";
|
|
13
|
-
import { style } from "../term/style.mjs";
|
|
13
|
+
import { COLORS, style } from "../term/style.mjs";
|
|
14
14
|
import { textWidth } from "../term/width.mjs";
|
|
15
15
|
|
|
16
16
|
/** The marks, in UTF-8 and in ASCII (docs/tui.md lists them; the help view draws them from here).
|
|
17
17
|
* The state marks are keyed by the word the shared home gives a row's state, with `shell` and
|
|
18
|
-
* `held` beside them (lib/model.mjs says when).
|
|
18
|
+
* `held` beside them (lib/model.mjs says when). `waiting` takes the state mark's cell on a row
|
|
19
|
+
* that needs input, whatever its state. A fold has no mark: a folded row shows `+n`. */
|
|
19
20
|
export const MARKS = Object.freeze({
|
|
20
21
|
utf8: Object.freeze({ running: "●", stopped: "○", shell: "◌", unknown: "?", held: "◆", selected: ">", waiting: "!" }),
|
|
21
22
|
ascii: Object.freeze({ running: "*", stopped: "-", shell: "~", unknown: "?", held: "#", selected: ">", waiting: "!" }),
|
|
@@ -25,8 +26,8 @@ export const marksOf = (ascii) => (ascii ? MARKS.ascii : MARKS.utf8);
|
|
|
25
26
|
/** Two cells of indent per level, and no deeper than this many levels: a deeper row sits at the last. */
|
|
26
27
|
const INDENT = 2, LEVELS = 6;
|
|
27
28
|
/** The cells every row keeps at its right edge, so the word column stands in one place whether a
|
|
28
|
-
* row
|
|
29
|
-
* padding is its gap. A tag in words takes more, and one cell of gap before it. */
|
|
29
|
+
* row folds waiting rows away or not: they hold the roll-up's tag in its short form, ` 1 ` to
|
|
30
|
+
* ` 99+ `, whose padding is its gap. A tag in words takes more, and one cell of gap before it. */
|
|
30
31
|
const EDGE = 5;
|
|
31
32
|
/** A row's cells before its name: the selection mark, a gap, the state mark, a gap. */
|
|
32
33
|
const LEAD = 4;
|
|
@@ -52,27 +53,41 @@ const PLAIN = style();
|
|
|
52
53
|
const BOLD = style({ bold: true });
|
|
53
54
|
const DIM = style({ dim: true });
|
|
54
55
|
const SELECTED = style({ reverse: true });
|
|
55
|
-
/** The look of each state mark: the Souls view draws an instance's mark in its detail as the list does.
|
|
56
|
-
|
|
56
|
+
/** The look of each state mark: the Souls view draws an instance's mark in its detail as the list does.
|
|
57
|
+
* No state is yellow: yellow says needs input, and only that. */
|
|
58
|
+
export const LOOK = Object.freeze({ running: style({ fg: "green" }), stopped: DIM, shell: DIM, unknown: DIM, held: style({ fg: "magenta" }) });
|
|
57
59
|
/** The marks an instance's colour (feature instance-color) draws: running in it, stopped and at its shell in
|
|
58
60
|
* it and dim. The shape still says the state; `unknown` and `held` keep their own look whatever the colour. */
|
|
59
61
|
const COLOURED = Object.freeze({ running: false, stopped: true, shell: true });
|
|
60
|
-
/**
|
|
62
|
+
/** The colour that is the terminal's own foreground, no `fg` at all: `sand`'s (views/souls.mjs
|
|
63
|
+
* SOUL_COLOURS), which can't be yellow and stays seen on a light theme as on a dark one. */
|
|
64
|
+
export const DEFAULT_FG = "default";
|
|
65
|
+
/** The look an instance's or a soul's colour draws, with `attributes` (`{ dim }`): `colour` a terminal
|
|
66
|
+
* colour name or DEFAULT_FG; null for any other value, which draws no colour. */
|
|
67
|
+
export function colourLook(colour, attributes = {}) {
|
|
68
|
+
if (colour === DEFAULT_FG) return style(attributes);
|
|
69
|
+
return typeof colour === "string" && COLORS.includes(colour) ? style({ fg: colour, ...attributes }) : null;
|
|
70
|
+
}
|
|
71
|
+
/** A state mark's look for a row of colour `colour` (a terminal colour name, DEFAULT_FG, or null for none). */
|
|
61
72
|
export function markLook(mark, colour) {
|
|
62
|
-
|
|
63
|
-
return LOOK[mark] ?? LOOK.unknown;
|
|
73
|
+
const coloured = Object.hasOwn(COLOURED, mark) ? colourLook(colour, { dim: COLOURED[mark] }) : null;
|
|
74
|
+
return coloured ?? LOOK[mark] ?? LOOK.unknown;
|
|
64
75
|
}
|
|
65
|
-
/** The needs-input
|
|
66
|
-
*
|
|
67
|
-
*
|
|
76
|
+
/** The needs-input look, of a waiting row's mark and of the roll-up's tag: bold, in reverse video in
|
|
77
|
+
* the waiting colour (the mark is then a yellow cell with the `!` cut out, the Desktop's disc in
|
|
78
|
+
* one cell), so the reverse video and the `!` carry it under NO_COLOR. On the selected row, which
|
|
79
|
+
* is in reverse already, it is the other way round: not reversed, a gap in the selection's bar.
|
|
80
|
+
* An instance's colour never draws it. */
|
|
68
81
|
const WAITS = style({ fg: "yellow", bold: true, reverse: true });
|
|
69
82
|
const WAITS_SELECTED = style({ fg: "yellow", bold: true });
|
|
70
83
|
|
|
71
|
-
/** The needs
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
* its own claim wins, and the detail's `below` line names the rest. */
|
|
84
|
+
/** The words for an instance that needs input: the shared home's for a claim that names no reason
|
|
85
|
+
* of its own (packages/client/waiting-on-you.mjs, waitingLabel, which the detail says; a test pins
|
|
86
|
+
* them equal), and the help's for the mark. A row says them by its mark, not in words. */
|
|
75
87
|
export const NEEDS_INPUT = "Needs input";
|
|
88
|
+
/** The roll-up tag's words, the Desktop's (packages/desktop/renderer/shell.mjs, needsInputMark; a
|
|
89
|
+
* test pins them equal): `N below` on a row that folds away N waiting rows, `99+ below` past 99,
|
|
90
|
+
* whether the row waits itself or not: its mark says its own claim, the tag the rest. */
|
|
76
91
|
/** A count of waiting rows as the tag says it, or the help's letter for one (`N`) as it is. */
|
|
77
92
|
const count = (n) => (typeof n === "number" && n > 99 ? "99+" : String(n));
|
|
78
93
|
export const belowText = (n) => `${count(n)} below`;
|
|
@@ -93,16 +108,15 @@ export function measured(value) {
|
|
|
93
108
|
return { text, width: textWidth(textOf(text)) };
|
|
94
109
|
}
|
|
95
110
|
|
|
96
|
-
/** A row's
|
|
97
|
-
*
|
|
98
|
-
function tagOf(row
|
|
99
|
-
if (row.waiting) return { full: NEEDS_INPUT, short: marks.waiting };
|
|
111
|
+
/** A row's roll-up tag, in words and in its short form (the count alone), or null when the row
|
|
112
|
+
* folds no waiting row away. Drawn with a cell of padding either side. */
|
|
113
|
+
function tagOf(row) {
|
|
100
114
|
return row.below > 0 ? { full: belowText(row.below), short: count(row.below) } : null;
|
|
101
115
|
}
|
|
102
116
|
|
|
103
|
-
/** One instance's row in a pane `cols` wide: the state mark
|
|
104
|
-
* folded row `+n` after the name, the row's word (when it
|
|
105
|
-
*
|
|
117
|
+
/** One instance's row in a pane `cols` wide: the state mark (the needs-input mark on a waiting
|
|
118
|
+
* row), the name cut to what is left, on a folded row `+n` after the name, the row's word (when it
|
|
119
|
+
* has one) in the word column, and the roll-up tag at the edge. A row with no word gives its name the word column's cells too. The
|
|
106
120
|
* name wins over the word: it keeps NAME_LEAST cells (all of it when it is shorter), and when the
|
|
107
121
|
* word column would leave it fewer, the word is cut to what the name leaves, after it, or given
|
|
108
122
|
* up under WORD_LEAST cells; the mark and the detail still say it. The name is cut before `+n`
|
|
@@ -121,7 +135,7 @@ function instanceRow(row, cols, wordWidth, marks) {
|
|
|
121
135
|
// The tag, and where the name and the word end: before the tag in words and a gap, or the EDGE.
|
|
122
136
|
const hasWord = wordWidth > 0 && row.word !== null && row.word !== undefined;
|
|
123
137
|
const whole = name.width + (fold ? fold.length + 1 : 0) + (hasWord ? 2 + wordWidth : 0);
|
|
124
|
-
const tag = tagOf(row
|
|
138
|
+
const tag = tagOf(row), wide = tag !== null && cols - tag.full.length - 3 - nameCol >= whole;
|
|
125
139
|
const waits = tag && (wide ? tag.full : tag.short), end = wide ? cols - tag.full.length - 3 : cols - EDGE, room = end - nameCol;
|
|
126
140
|
// The word's cells: its column's, or what the name's claim leaves of the row, or none.
|
|
127
141
|
const left = room - claim - 2;
|
|
@@ -131,7 +145,9 @@ function instanceRow(row, cols, wordWidth, marks) {
|
|
|
131
145
|
const spans = [];
|
|
132
146
|
if (row.selected) spans.push({ col: 0, width: cols, style: SELECTED });
|
|
133
147
|
if (row.selected && row.cursor !== false) spans.push({ col: 0, text: lit(marks.selected), style: SELECTED, width: 1 });
|
|
134
|
-
|
|
148
|
+
const waitLook = row.selected ? WAITS_SELECTED : WAITS;
|
|
149
|
+
if (row.waiting) spans.push({ col: MARK + at, text: lit(marks.waiting), style: waitLook, width: 1 });
|
|
150
|
+
else spans.push({ col: MARK + at, text: lit(marks[row.mark] ?? marks.unknown), style: look(markLook(row.mark, row.color)), width: 1 });
|
|
135
151
|
if (nameEnd > nameCol) {
|
|
136
152
|
// The count and the gap before it, when there is room for them and for a cell of the name.
|
|
137
153
|
const after = fold && nameEnd - nameCol > fold.length + 1 ? fold.length + 1 : 0;
|
|
@@ -141,9 +157,9 @@ function instanceRow(row, cols, wordWidth, marks) {
|
|
|
141
157
|
}
|
|
142
158
|
if (wordCells) spans.push({ col: wordCol, text: shown(row.word), style: look(DIM), width: wordCells });
|
|
143
159
|
// The tag: its padding a blank span in its style, the words over it.
|
|
144
|
-
const tagCol = waits ? cols - waits.length - 2 : 0
|
|
160
|
+
const tagCol = waits ? cols - waits.length - 2 : 0;
|
|
145
161
|
if (waits && tagCol > MARK + at) {
|
|
146
|
-
spans.push({ col: tagCol, width: waits.length + 2, style:
|
|
162
|
+
spans.push({ col: tagCol, width: waits.length + 2, style: waitLook }, { col: tagCol + 1, text: lit(waits), style: waitLook, width: waits.length });
|
|
147
163
|
}
|
|
148
164
|
return spans;
|
|
149
165
|
}
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
// the refusal in the detail says "Can't spawn here" in words before its warning style.
|
|
9
9
|
import { keyLabel } from "../actions.mjs";
|
|
10
10
|
import { lit, shown, shownLines } from "../term/text.mjs";
|
|
11
|
-
import {
|
|
12
|
-
import { cutNote, headingRow, markLook, marksOf, measured } from "./instances.mjs";
|
|
11
|
+
import { style } from "../term/style.mjs";
|
|
12
|
+
import { DEFAULT_FG, colourLook, cutNote, headingRow, markLook, marksOf, measured } from "./instances.mjs";
|
|
13
13
|
import { windowOf } from "./scroll.mjs";
|
|
14
14
|
|
|
15
15
|
/** The TUI's own lines in the Souls view. `retry` and `toInstances` stand after the key that does
|
|
@@ -25,8 +25,9 @@ export const SOULS_TEXT = Object.freeze({
|
|
|
25
25
|
});
|
|
26
26
|
|
|
27
27
|
/** A soul's colour (soul-colors.mjs's palette name) as one of the terminal's sixteen: the model
|
|
28
|
-
* maps a row's colour with it, and a name not here leaves the soul uncoloured.
|
|
29
|
-
|
|
28
|
+
* maps a row's colour with it, and a name not here leaves the soul uncoloured. `sand` is the
|
|
29
|
+
* terminal's own foreground (DEFAULT_FG), not yellow: yellow says needs input, and only that. */
|
|
30
|
+
export const SOUL_COLOURS = Object.freeze({ sand: DEFAULT_FG, sage: "green", slate: "blue", mauve: "magenta", clay: "red", olive: "cyan" });
|
|
30
31
|
|
|
31
32
|
/** A soul's mark, in UTF-8 and in ASCII, and the sign before a count of its instances. */
|
|
32
33
|
export const SOUL_MARK = Object.freeze({ utf8: "■", ascii: "#" });
|
|
@@ -56,8 +57,9 @@ const PLAIN = style();
|
|
|
56
57
|
const BOLD = style({ bold: true });
|
|
57
58
|
const DIM = style({ dim: true });
|
|
58
59
|
const SELECTED = style({ reverse: true });
|
|
59
|
-
/** The refusal's warning style: it says "Can't spawn here" too, so the colour is not alone.
|
|
60
|
-
|
|
60
|
+
/** The refusal's warning style: it says "Can't spawn here" too, so the colour is not alone. Red, not
|
|
61
|
+
* yellow: yellow says needs input, and only that. */
|
|
62
|
+
const WARN = style({ bold: true, fg: "red" });
|
|
61
63
|
|
|
62
64
|
const markOf = (ascii) => (ascii ? SOUL_MARK.ascii : SOUL_MARK.utf8);
|
|
63
65
|
const countText = (count, ascii) => `${ascii ? COUNT_SIGN.ascii : COUNT_SIGN.utf8}${count}`;
|
|
@@ -121,10 +123,9 @@ export function flowed(units, width, gap = 1) {
|
|
|
121
123
|
function soulRow(row, cols, ascii) {
|
|
122
124
|
const look = (own) => (row.selected ? SELECTED : own);
|
|
123
125
|
const quiet = row.refused ? DIM : PLAIN;
|
|
124
|
-
const colour = typeof row.color === "string" && COLORS.includes(row.color) ? row.color : null;
|
|
125
126
|
const spans = [];
|
|
126
127
|
if (row.selected) spans.push({ col: 0, width: cols, style: SELECTED }, { col: 0, text: lit(marksOf(ascii).selected), style: SELECTED, width: 1 });
|
|
127
|
-
spans.push({ col: MARK, text: lit(markOf(ascii)), style: look(
|
|
128
|
+
spans.push({ col: MARK, text: lit(markOf(ascii)), style: look(colourLook(row.color, { dim: row.refused === true }) ?? quiet), width: 1 });
|
|
128
129
|
const end = cols - 1;
|
|
129
130
|
if (end <= NAME) return spans;
|
|
130
131
|
const after = [...(row.refused ? [{ text: "!", style: quiet }] : []), ...(row.count > 0 ? [{ text: countText(row.count, ascii), style: DIM }] : [])];
|