@orkestrel/terminal 0.0.13 → 0.0.15
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 +11 -16
- package/dist/src/core/index.cjs +458 -281
- package/dist/src/core/index.cjs.map +1 -1
- package/dist/src/core/index.d.cts +728 -369
- package/dist/src/core/index.d.ts +728 -369
- package/dist/src/core/index.js +443 -264
- package/dist/src/core/index.js.map +1 -1
- package/dist/src/server/index.cjs +268 -258
- package/dist/src/server/index.cjs.map +1 -1
- package/dist/src/server/index.d.cts +217 -201
- package/dist/src/server/index.d.ts +217 -201
- package/dist/src/server/index.js +257 -242
- package/dist/src/server/index.js.map +1 -1
- package/package.json +18 -20
package/README.md
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
# @orkestrel/terminal
|
|
2
2
|
|
|
3
|
-
The terminal side of a form,
|
|
4
|
-
the
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
elsewhere to this machine's keyboard over SSE. Built beside
|
|
3
|
+
> The terminal side of a form: a key decoder, a presentation theme, the pure per-field reducers,
|
|
4
|
+
> the headless broker that parks a live form until somebody elsewhere answers it, the SSE bridge
|
|
5
|
+
> that carries a parked form to a machine with a keyboard, and the manager that routes parked
|
|
6
|
+
> forms between named endpoints.
|
|
7
|
+
|
|
8
|
+
`@orkestrel/form` owns the document — the schema, the controls, the rules,
|
|
9
|
+
the values, and the settle-once `answer` promise — and this package declares
|
|
10
|
+
none of it a second time. Part of the `@orkestrel` line, built beside
|
|
12
11
|
`@orkestrel/console` (the shared style engine), `@orkestrel/contract`,
|
|
13
12
|
`@orkestrel/emitter`, `@orkestrel/database`, and `@orkestrel/sse`.
|
|
14
13
|
|
|
@@ -18,10 +17,6 @@ elsewhere to this machine's keyboard over SSE. Built beside
|
|
|
18
17
|
npm install @orkestrel/terminal
|
|
19
18
|
```
|
|
20
19
|
|
|
21
|
-
`@orkestrel/form` is pinned to a committed tarball until it is published, so
|
|
22
|
-
this package is not publishable yet. The pin, its standing conditions, and the
|
|
23
|
-
re-pin recipe are recorded in [guides/terminal.md](./guides/terminal.md).
|
|
24
|
-
|
|
25
20
|
## Requirements
|
|
26
21
|
|
|
27
22
|
- Node.js >= 22
|
|
@@ -46,7 +41,7 @@ const values = await terminal.ask(
|
|
|
46
41
|
)
|
|
47
42
|
```
|
|
48
43
|
|
|
49
|
-
A bare return binds
|
|
44
|
+
A bare return binds absence, not the empty string, so `required` refuses it and
|
|
50
45
|
the walk asks again.
|
|
51
46
|
|
|
52
47
|
Park a live form and answer it from anywhere else:
|
|
@@ -60,7 +55,7 @@ prompt.emitter.on('pending', (form) => send(form)) // the wire-safe record
|
|
|
60
55
|
|
|
61
56
|
const form = createForm({ fields: [{ control: 'text', name: 'name' }] })
|
|
62
57
|
const id = prompt.park(form) // the id; you await the form's own `answer`
|
|
63
|
-
prompt.answer(id, { name: 'Ada' }) // fills and submits the
|
|
58
|
+
prompt.answer(id, { name: 'Ada' }) // fills and submits the authoritative form
|
|
64
59
|
const values = await form.answer // { name: 'Ada' }
|
|
65
60
|
```
|
|
66
61
|
|
|
@@ -85,7 +80,7 @@ the multi-endpoint manager, the stores, and the TTY driver.
|
|
|
85
80
|
|
|
86
81
|
## Package
|
|
87
82
|
|
|
88
|
-
|
|
83
|
+
The entry points, per the `exports` field in `package.json`, are `.` (the
|
|
89
84
|
host-independent core — the reducers, the broker, the bridge, the manager, and
|
|
90
85
|
the stores) and `./server` (the Node-only `Terminal` driver). Both entry points
|
|
91
86
|
ship dual ESM+CJS builds.
|