@cplieger/web-terminal-ui 7.2.2 → 7.3.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/README.md +26 -13
- package/css/00-tokens.css +32 -1
- package/css/02-terminal.css +3 -1
- package/css/10-primitives.css +1 -0
- package/css/23-toolbar.css +1 -0
- package/css/30-tabs.css +61 -13
- package/css/page.css +59 -1
- package/package.json +1 -1
- package/src/features/activity-monitor.ts +37 -10
- package/src/features/animations.ts +23 -10
- package/src/features/clipboard.ts +26 -4
- package/src/features/connection-banner.ts +18 -5
- package/src/features/context-menu.ts +68 -48
- package/src/features/mobile-toolbar.ts +24 -7
- package/src/features/predictive-echo.ts +25 -6
- package/src/features/scroll-to-bottom.ts +19 -5
- package/src/features/tabs/attention.ts +4 -4
- package/src/features/tabs/index.ts +55 -16
- package/src/features/tabs/model.ts +7 -6
- package/src/kernel/kernel.ts +57 -5
- package/src/kernel/scrollback-storage.ts +12 -0
- package/src/kernel/startup-copy.ts +18 -16
- package/src/kernel/style-contract.ts +35 -33
- package/src/presets/agent-tabbed.ts +10 -7
- package/src/presets/single.ts +9 -5
- package/src/presets/tabbed.ts +12 -9
- package/src/presets/touch.ts +8 -4
- package/src/presets.ts +23 -17
|
@@ -1,36 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
1
|
+
/**
|
|
2
|
+
* The names that cross this package's boundary as STRINGS, published as data.
|
|
3
|
+
*
|
|
4
|
+
* Two surfaces of this library are addressed by name rather than by type, so no
|
|
5
|
+
* compiler on either side of the boundary checks them:
|
|
6
|
+
*
|
|
7
|
+
* - `theme` is `Readonly<Record<string, string>>`. The kernel copies every key
|
|
8
|
+
* onto the terminal root verbatim, so a consumer that names a token this
|
|
9
|
+
* library renamed or retired gets a live declaration nothing reads: no
|
|
10
|
+
* error, no warning, just the library's own defaults where the consumer's
|
|
11
|
+
* brand was meant to be.
|
|
12
|
+
* - The loading overlay is the CONSUMER's element (it must paint before this
|
|
13
|
+
* module loads), styled by `css/page.css` purely because the markup opts in
|
|
14
|
+
* by class. Those classes are usually hardcoded in a static HTML file no
|
|
15
|
+
* compiler reads at all.
|
|
16
|
+
*
|
|
17
|
+
* Both are published as data, so they can be ASSERTED against: a consumer can
|
|
18
|
+
* check its own theme keys and its own overlay markup against these exports in
|
|
19
|
+
* its own test, the same way it can check its bootstrap watchdog's wording
|
|
20
|
+
* against `STARTUP_FAILURE_COPY` on the `./startup-copy` entrypoint. This file
|
|
21
|
+
* imports nothing and touches no DOM, so a test or a Node build script can read
|
|
22
|
+
* it without loading the kernel.
|
|
23
|
+
*
|
|
24
|
+
* These lists are HAND-WRITTEN on purpose. They are the public contract — a
|
|
25
|
+
* decision about what this library promises to support — not a fact derived
|
|
26
|
+
* from the stylesheets. What IS derived from the stylesheets is the
|
|
27
|
+
* verification that the promise holds: an internal test generates the
|
|
28
|
+
* declared/referenced token inventory from the CSS itself and fails if any
|
|
29
|
+
* token named here is not both DECLARED and READ by a rule. A token that is
|
|
30
|
+
* declared but never read is the silent-no-op case above, reached from the
|
|
31
|
+
* library's side instead of the consumer's, and no hand-maintained list can
|
|
32
|
+
* catch it.
|
|
33
|
+
*
|
|
34
|
+
* @module
|
|
35
|
+
*/
|
|
34
36
|
|
|
35
37
|
/** CSS custom properties a consumer may set through `CreateTerminalOptions.theme`.
|
|
36
38
|
*
|
|
@@ -1,20 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* presetAgentTabbed: the tabbed composition tuned for an agent shell.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
2
6
|
|
|
3
7
|
import type { TerminalFeature } from "../kernel/types.js";
|
|
4
8
|
import { type TabbedPresetOptions, buildTabbed } from "./tabbed.js";
|
|
5
9
|
|
|
6
|
-
/** Tabbed UI for an agent shell
|
|
7
|
-
*
|
|
10
|
+
/** Tabbed UI for an agent shell. Same features as presetTabbed, tuned for
|
|
11
|
+
* sessions that ARE agents:
|
|
8
12
|
* - `presumeReports`: every session's program is an agent that WILL report
|
|
9
13
|
* OSC 9;4 progress, so the idle activity dot shows from tab creation
|
|
10
14
|
* instead of popping in seconds later when the agent has booted far enough
|
|
11
15
|
* to first report; the server's sticky reportsActivity flag then merely
|
|
12
16
|
* confirms. (presetTabbed keeps the evidence-driven reveal instead: a
|
|
13
17
|
* plain shell never grows a meaningless dot.)
|
|
14
|
-
*
|
|
15
|
-
* status classifier that maps OSC 9 notifications to done/needs-input
|
|
16
|
-
*
|
|
17
|
-
* enables because its program's own window title is not worth showing. */
|
|
18
|
+
* One agent-vs-generic distinction lives SERVER-side rather than here: the
|
|
19
|
+
* status classifier that maps OSC 9 notifications to done/needs-input. Tab
|
|
20
|
+
* names are server-side too but are not agent-specific — see buildTabbed. */
|
|
18
21
|
export function presetAgentTabbed(opts: TabbedPresetOptions = {}): TerminalFeature<unknown>[] {
|
|
19
22
|
return buildTabbed(true, opts);
|
|
20
23
|
}
|
package/src/presets/single.ts
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
/**
|
|
2
|
+
* presetSingle: the single-pane desktop composition. Its own entry module so a
|
|
3
|
+
* consumer importing "@cplieger/web-terminal-ui/presets/single" pulls in ONLY
|
|
4
|
+
* this feature graph — none of the toolbar/tabs modules (the ./presets barrel
|
|
5
|
+
* statically reaches everything; these per-preset entries are the
|
|
6
|
+
* graph-minimal imports).
|
|
7
|
+
*
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
6
10
|
|
|
7
11
|
import type { TerminalFeature } from "../kernel/types.js";
|
|
8
12
|
import { clipboard } from "../features/clipboard.js";
|
package/src/presets/tabbed.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
/**
|
|
2
|
+
* presetTabbed (and the shared tabbed composition builder): the full
|
|
3
|
+
* multi-session UI. Requires a server that speaks the session API
|
|
4
|
+
* (`/api/sessions`, `/ws?session=`, and the status SSE `/api/sessions/events`),
|
|
5
|
+
* such as `web-terminal-server` or `web-terminal-kiro`.
|
|
6
|
+
*
|
|
7
|
+
* @module
|
|
8
|
+
*/
|
|
5
9
|
|
|
6
10
|
import type { TerminalFeature } from "../kernel/types.js";
|
|
7
11
|
import { mobileToolbar } from "../features/mobile-toolbar.js";
|
|
@@ -18,7 +22,7 @@ export interface TabbedPresetOptions {
|
|
|
18
22
|
/** Swap the page's icon links to a status variant while a background session
|
|
19
23
|
* wants the user. Off by default, and enabling it is a promise that the
|
|
20
24
|
* variant assets are served — see TabsOptions.attentionIcons for the naming
|
|
21
|
-
* contract
|
|
25
|
+
* contract those files must satisfy. */
|
|
22
26
|
attentionIcons?: boolean;
|
|
23
27
|
}
|
|
24
28
|
|
|
@@ -33,10 +37,9 @@ export interface TabbedPresetOptions {
|
|
|
33
37
|
* via ctx.use. Shared by presetTabbed and presetAgentTabbed (agent-tabbed.ts),
|
|
34
38
|
* which now differ only in presumed activity reporting (presumeReports).
|
|
35
39
|
*
|
|
36
|
-
* Titles are
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
* foreground-process/cwd inference — and both presets render what it reports. A
|
|
40
|
+
* Titles are not a preset concern. The ENGINE resolves a session's name — its
|
|
41
|
+
* pinned name, a title its host pushed, the program's OSC window title, or its
|
|
42
|
+
* own foreground-process/cwd inference — and both presets render what it reports. A
|
|
40
43
|
* browser that re-derived any of that could only disagree with the server and
|
|
41
44
|
* with every other client attached to the same session. */
|
|
42
45
|
export function buildTabbed(
|
package/src/presets/touch.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
/**
|
|
2
|
+
* presetTouch: the touch-first composition (single + the on-screen key
|
|
3
|
+
* toolbar). Its own entry module so a touch consumer's delivered import graph
|
|
4
|
+
* excludes the tabs/activity/animations modules entirely (an embedded panel
|
|
5
|
+
* imports exactly this).
|
|
6
|
+
*
|
|
7
|
+
* @module
|
|
8
|
+
*/
|
|
5
9
|
|
|
6
10
|
import type { TerminalFeature } from "../kernel/types.js";
|
|
7
11
|
import { mobileToolbar } from "../features/mobile-toolbar.js";
|
package/src/presets.ts
CHANGED
|
@@ -1,20 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Feature presets: the barrel. Presets are plain feature-array factories, so
|
|
3
|
+
* they are spreadable and editable: a consumer can drop or add a feature with a
|
|
4
|
+
* filter/spread. This barrel statically imports EVERY preset (and therefore
|
|
5
|
+
* every feature); a consumer that wants the minimal delivered import graph for
|
|
6
|
+
* its composition imports the per-preset entry module instead —
|
|
7
|
+
* "@cplieger/web-terminal-ui/presets/single" | "/presets/touch" |
|
|
8
|
+
* "/presets/tabbed" | "/presets/agent-tabbed" — or hand-picks individual
|
|
9
|
+
* features from "@cplieger/web-terminal-ui/features/<name>".
|
|
10
|
+
*
|
|
11
|
+
* The tabbed presets (presetTabbed / presetAgentTabbed) share the same feature
|
|
12
|
+
* set (both include the activity monitor, which drives the per-tab activity
|
|
13
|
+
* dot). They differ in one flag, `presumeReports`: presetAgentTabbed presumes
|
|
14
|
+
* every session's program is an agent that WILL report OSC 9;4 progress, so the
|
|
15
|
+
* idle dot shows from tab creation instead of appearing seconds later on the
|
|
16
|
+
* first report, while presetTabbed keeps the evidence-driven reveal so a plain
|
|
17
|
+
* shell never grows a meaningless dot. Session NAMES are not a preset concern:
|
|
18
|
+
* the engine resolves them, including a title its host pushes.
|
|
19
|
+
* The generic-vs-agent STATUS distinction stays server-side — an agent server
|
|
20
|
+
* sets a classifier mapping OSC 9 notifications to done/needs-input.
|
|
21
|
+
*
|
|
22
|
+
* @module
|
|
23
|
+
*/
|
|
18
24
|
|
|
19
25
|
export { presetSingle } from "./presets/single.js";
|
|
20
26
|
export { presetTouch } from "./presets/touch.js";
|