@miadi/chronicle-tui 0.3.0 → 0.4.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/README.md CHANGED
@@ -27,7 +27,8 @@ On Termux, install with `--ignore-scripts`. Node 22 or later.
27
27
  | `o` | the doors of the reference, file or episode in focus: room (local, tailnet, public), wheel, vessel. Enter opens one |
28
28
  | `r` | the phone door as a QR code (`i` inverts it for a light terminal) |
29
29
  | `p` | the five-stage proof (git and the wheel, on demand) |
30
- | `a` | the episode's attention items. With the writer token, Enter on an open one answers it |
30
+ | `a` | the episode's attention items, Open and History (Tab), each with what it cites. Enter reads one; Enter again answers an open one |
31
+ | `!` | the chronicle's attention board: every open item, newest asked first, filtered by `/`. `e` on an item opens its episode |
31
32
  | `v` | hold a Miadi review in the episode (writer token) |
32
33
  | `?` | all keys · `q` quits |
33
34
 
@@ -53,26 +54,45 @@ miadi-chronicle --env ~/.env.miadi-writer # a file holding MIADI_API_TOKE
53
54
  miadi-chronicle --url https://miadi.tail3b11eb.ts.net
54
55
  ```
55
56
 
56
- - **The token** is `MIADI_API_TOKEN_WRITER`, sent as `Authorization: Bearer`.
57
- `--env <file>` loads `KEY=value` lines first (`export`, quotes and `#`
58
- comments are understood, nothing is expanded), so the file can also set
59
- `MIADI_CHRONICLE_ROOT`.
60
- - **The app** is `--url`, else the first of `MIADI_WEB_URL` (or
61
- `127.0.0.1:3335`), `MIADI_URL_BASE_INTERNAL`, `MIADI_URL_BASE` whose
62
- `/api/health` answers.
63
- - **The header** names who the app says is reading (`GET /api/identity/me`),
64
- or says `read-only`.
65
- - **A ceremony or circle reference** opens as a card for a reader the app lets
66
- in (`GET /api/ceremony/{id}`, `GET /api/circles/{id}`): its kind, direction,
67
- intention, episode or facilitator, and what your seat may do. Never its
68
- turns. Anyone else, or a refusal, gets its doors.
69
- - **Attention** (`a`) lists the episode's items through the app, or from the
70
- vessel on disk when no app answers. Answering posts to
71
- `POST /api/chronicle/attention`.
72
- - **A review** (`v`) posts to `POST /api/chronicle/episodes/{ref}/reviews`.
73
-
74
- Write actions declare `effect: "write"` and are offered only when the app
75
- accepted the token.
57
+ - **Two tokens, each for what it is.** `MIADI_PERSON_TOKEN` is you: it is the
58
+ bearer of every read, so the header names you and a ceremony or circle shows
59
+ what your seat allows. `MIADI_API_TOKEN_WRITER` passes the write gate: it is
60
+ the bearer of writes, with you named beside it in `x-miadi-person-token`, as
61
+ the app expects an agent acting for a person. Either alone does what it can.
62
+ - **`--env <file>`** loads only these keys from a `KEY=value` file (`export`,
63
+ quotes and `#` comments are understood, nothing is expanded, `PATH` is never
64
+ touched): the two tokens, `MIADI_CHRONICLE_ROOT`, `MIADI_WEB_URL`,
65
+ `MIADI_URL_BASE_INTERNAL`, `MIADI_URL_BASE`, `MIADI_CHRONICLE_MW_URL`.
66
+ - **The app** is `--url`, else the local app (`MIADI_WEB_URL` or
67
+ `127.0.0.1:3335`), then the tailnet one (`MIADI_URL_BASE_INTERNAL`). The
68
+ public front is used only when named with `--url`. A token travels over
69
+ https, or plain http to this machine only.
70
+ - **What you see is what the web room would show you** (jgwill/Miadi#712). A
71
+ visitor sees no `community` episode and nothing under `captures/` or
72
+ `ceremonies/`. A reader the app names sees community episodes (◇); a reader
73
+ the app lets write sees the room's private folders too.
74
+ - **A ceremony or circle reference** opens as a card for a person the app
75
+ seats (`GET /api/ceremony/{id}`, `GET /api/circles/{id}`): its kind,
76
+ direction, intention, episode or facilitator, and what your seat may do.
77
+ Never its turns. Otherwise it shows its pages, and never the wheel's record.
78
+ - **Attention** works as in the web room, through `@miadi/attention-core`: the
79
+ board (`!`) and each episode's panel (`a`) read the vessels exactly as the
80
+ room does; an answer is checked the same way and posted to
81
+ `POST /api/chronicle/attention`, and the wheel is reported, never assumed.
82
+ - **A review** (`v`) posts to `POST /api/chronicle/episodes/{ref}/reviews`;
83
+ with your person token its talking circle opens in your name.
84
+
85
+ Write actions declare `effect: "write"` and are offered only when the app said
86
+ it would record them.
87
+
88
+ ## Safe to point at any chronicle
89
+
90
+ Chronicle files are written by many agents and people. Every string the
91
+ browser prints goes through one sanitizer: terminal escape sequences, control
92
+ characters and bidi overrides are removed, tabs are expanded, and only
93
+ http(s) and `file:` URLs without controls become links. A door opens through
94
+ the system opener only when it is a web page, or a folder or a text, document
95
+ or media file inside the chronicle; the opener and `rg` never inherit a token.
76
96
 
77
97
  ## Where each read comes from
78
98
 
package/dist/App.d.ts CHANGED
@@ -1,9 +1,14 @@
1
1
  /**
2
2
  * The terminal browser's screen. It draws the panes and routes keys; every
3
- * read goes through `data.ts`, every operation through the action registry.
3
+ * read goes through `data.ts` and `attention.ts`, every operation through the
4
+ * action registry, every printed string through `text.ts`.
4
5
  *
5
- * Keys are plain letters, arrows, Tab, Enter and Esc. No Ctrl chord is taken,
6
- * so tmux (C-b) and herdr (prefix+…) keep all of theirs.
6
+ * State lives in one ref and is read from there, so keys that arrive together
7
+ * (fast typing, a paste, ssh) each act on the state the previous one left, not
8
+ * on the last render (jgwill/Miadi#706 UI review, F5 and F13).
9
+ *
10
+ * Keys are plain letters, arrows, Tab, Enter and Esc. No Ctrl or Meta chord is
11
+ * taken, so tmux (C-b) and herdr (prefix+…) keep all of theirs.
7
12
  */
8
13
  import React from "react";
9
14
  import { type ChronicleAction } from "./actions.js";
@@ -15,10 +20,14 @@ export interface AppProps {
15
20
  search?: string;
16
21
  /** Start on this episode (number, epNNN or folder name). */
17
22
  episode?: string;
23
+ /** Start on the chronicle's attention board. */
24
+ attention?: boolean;
18
25
  /** Operations beyond the built-in ones. */
19
26
  actions?: readonly ChronicleAction[];
20
- /** The Miadi app to act through. Default: the first of the known bases that answers. */
27
+ /** The Miadi app to act through. Default: the local app, then the tailnet one. */
21
28
  url?: string;
29
+ /** Environment keys `--env` loaded: an opener never inherits them. */
30
+ withheld?: readonly string[];
22
31
  }
23
- export declare function App({ root, query: initialQuery, search: initialSearch, episode, actions: extra, url }: AppProps): React.JSX.Element;
32
+ export declare function App(props: AppProps): React.JSX.Element;
24
33
  //# sourceMappingURL=App.d.ts.map
package/dist/App.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../src/App.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAA+C,MAAM,OAAO,CAAA;AAInE,OAAO,EAAoE,KAAK,eAAe,EAA2B,MAAM,cAAc,CAAA;AAgB9I,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAA;IACZ,oCAAoC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,+CAA+C;IAC/C,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,4DAA4D;IAC5D,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,2CAA2C;IAC3C,OAAO,CAAC,EAAE,SAAS,eAAe,EAAE,CAAA;IACpC,wFAAwF;IACxF,GAAG,CAAC,EAAE,MAAM,CAAA;CACb;AA+CD,wBAAgB,GAAG,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,YAAiB,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,EAAE,KAAU,EAAE,GAAG,EAAE,EAAE,QAAQ,qBAmqBzH"}
1
+ {"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../src/App.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAiD,MAAM,OAAO,CAAA;AAGrE,OAAO,EAIL,KAAK,eAAe,EAGrB,MAAM,cAAc,CAAA;AA0CrB,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAA;IACZ,oCAAoC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,+CAA+C;IAC/C,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,4DAA4D;IAC5D,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,gDAAgD;IAChD,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,2CAA2C;IAC3C,OAAO,CAAC,EAAE,SAAS,eAAe,EAAE,CAAA;IACpC,kFAAkF;IAClF,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,sEAAsE;IACtE,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAC7B;AAoHD,wBAAgB,GAAG,CAAC,KAAK,EAAE,QAAQ,qBA+9BlC"}