@operad-io/tui 0.0.1 → 0.1.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.
Files changed (2) hide show
  1. package/README.md +7 -63
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -1,69 +1,13 @@
1
1
  # @operad-io/tui
2
2
 
3
- The terminal client for operad's `/v1` interface. It never opens the store and
4
- never loads a plugin. The manual's `operad tui` section is the reference for
5
- keys, flags and states.
3
+ **The terminal client.** `operad tui` shows what is pending and running, and opens an object beside the list. It talks to `operad serve` over the `/v1` interface and never opens the store itself.
6
4
 
7
- ## Themes
5
+ This package is part of [operad](https://github.com/operad-io/operad). Most people install only [`@operad-io/cli`](https://www.npmjs.com/package/@operad-io/cli).
8
6
 
9
- Colours are tokens of a `TuiPalette` (`src/theme.ts`, the only file that names a
10
- colour value): `text`, `weak`, `rule`, `accent`, `run`, `ok`, `error`,
11
- `cancelled`, `add`, `remove`, `tint`, `code`, `background`. The built-in themes are `auto` (the default; `light` or
12
- `dark` by the terminal's theme mode, live), `light`, `dark` (the operad app's
13
- tokens) and `terminal` (the terminal's own 16 ANSI colours).
7
+ ## Documentation
14
8
 
15
- Popular palettes (Catppuccin, Dracula, Nord, Solarized, Tokyo Night, One,
16
- Rosé Pine, GitHub, Kanagawa) ship as theme files in `themes/`; `themes/README.md`
17
- has their sources, licences and contrast adjustments, and `src/themes.ts` declares
18
- the families (`catppuccin`, `kanagawa`, ...) that follow the terminal's mode.
9
+ - User guide: [docs/user/tui.md](https://github.com/operad-io/operad/blob/main/docs/user/tui.md)
10
+ - Website: <https://operad.io>
11
+ - Developer reference: `REFERENCE.md` in this directory
19
12
 
20
- Choose one in `~/.operad/tui.json` (schema: `tui.schema.json`):
21
-
22
- ```json
23
- { "theme": "dark", "layout": "tree" }
24
- ```
25
- `layout` is `tree` (children nested under the first sibling in their `after`) or
26
- `list` (one flat list); `t` switches it on an object page and saves the choice.
27
-
28
- `operad tui --theme <name>` overrides the file for one session. An unknown name,
29
- or a `tui.json` that cannot be read, is an error and the TUI does not start.
30
-
31
- The `:` palette has a `theme` command. It lists the installed themes (the built-in and
32
- shipped ones, then the files in `~/.operad/themes`); moving the selection shows each
33
- one live, Enter keeps the one under the cursor and writes it to `tui.json` (other keys
34
- in the file stay), and Esc puts back the theme that was in use. A choice made there
35
- beats `--theme` for the rest of the session.
36
-
37
- ## Hand tests (the lead runs these after a merge)
38
-
39
- Use a scratch `OPERAD_HOME` with the `dev` plugin and some objects in it.
40
-
41
- 1. **Live row.** Run `operad tui`. In another terminal change an object (an
42
- action, or a new object). Its row updates within about a second; the list
43
- keeps its cursor.
44
- 2. **Live section.** Open an object with a live section (dot on its tab) and
45
- leave it at the bottom. Cause new output: the section grows and follows.
46
- Scroll up: it stops following.
47
- 3. **Pending and Running.** Start a flow that waits for you: it appears in
48
- Pending with no key press, and leaves it once answered.
49
- 4. **Server lost.** Stop the `serve` (`operad serve stop`). Within a few seconds
50
- the footer shows `no server at <url>: is `operad serve` running?`, the lists
51
- stay, dimmed. Start `operad serve` again: the footer clears and the lists
52
- come back without a key press.
53
- 5. **Rotated token.** Run `operad http token rotate` while the TUI is open. After
54
- the next change or `r` the footer says `the token was rotated: run the TUI
55
- again or pass --token`, and nothing is retried.
56
- 6. **Empty states.** With no waiting items Pending says `nothing waits for you`;
57
- an object type with no objects says `no <type> yet`.
58
- 7. **Failed section.** Open an object whose section fails (stop its source or
59
- use the `hang` fixture section). The section shows its message and `r
60
- retries`; `r` asks again.
61
- 8. **Leaving.** Quit with `q`, then with Ctrl-C, then `kill -TERM <tui pid>`
62
- (from another terminal), then `kill -INT <tui pid>`: each time the shell
63
- prompt is back with the normal screen, a visible cursor and working echo, and
64
- the exit code is 0.
65
- 9. **Live tail.** Open an object whose live section has a tail (the chat
66
- plugin's answer while it is written). The finished content stays put and the
67
- changing part is drawn under it in the dim colour. Leave it at the bottom:
68
- both grow and follow. Scroll up: the section stays where it is while the tail
69
- changes. When the tail goes away, no line of it stays on screen.
13
+ MIT licensed.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@operad-io/tui",
3
- "version": "0.0.1",
3
+ "version": "0.1.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./src/index.ts",
@@ -9,9 +9,9 @@
9
9
  },
10
10
  "dependencies": {
11
11
  "@opentui/core": "0.6.8",
12
- "@operad-io/engine": "0.0.1"
12
+ "@operad-io/engine": "0.1.0"
13
13
  },
14
- "description": "operad: the terminal client (in development)",
14
+ "description": "operad: the terminal client",
15
15
  "repository": {
16
16
  "type": "git",
17
17
  "url": "git+https://github.com/operad-io/operad.git",