@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.
@@ -1,36 +1,38 @@
1
- // The names that cross this package's boundary as STRINGS, published as data.
2
- //
3
- // Two surfaces of this library are addressed by name rather than by type, so no
4
- // compiler on either side of the boundary checks them:
5
- //
6
- // - `theme` is `Readonly<Record<string, string>>`. The kernel copies every key
7
- // onto the terminal root verbatim, so a consumer that names a token this
8
- // library renamed or retired gets a live declaration nothing reads: no
9
- // error, no warning, just the library's own defaults where the consumer's
10
- // brand was meant to be.
11
- // - The loading overlay is the CONSUMER's element (it must paint before this
12
- // module loads), styled by `css/page.css` purely because the markup opts in
13
- // by class. Those classes are usually hardcoded in a static HTML file no
14
- // compiler reads at all.
15
- //
16
- // Both were previously prose — a doc comment on the option, a sentence in the
17
- // README — which a consumer could only agree with by remembering. Published as
18
- // data they can be ASSERTED against instead: web-terminal-kiro's app.test.ts
19
- // checks its theme keys and its overlay markup against these exports the same
20
- // way it already checks its bootstrap watchdog's wording against
21
- // STARTUP_FAILURE_COPY. Same reason, same shape: this file imports nothing and
22
- // touches no DOM, so a test or a Node build script can read it without loading
23
- // the kernel.
24
- //
25
- // These lists are HAND-WRITTEN on purpose. They are the public contract — a
26
- // decision about what this library promises to support — not a fact derived
27
- // from the stylesheets. What IS derived from the stylesheets is the
28
- // verification that the promise holds: `src/css-contract.node.test.ts` generates the
29
- // declared/referenced token inventory from the CSS itself and fails if any
30
- // token named here is not both DECLARED and READ by a rule. A token that is
31
- // declared but never read is the silent-no-op case above, reached from the
32
- // library's side instead of the consumer's, and no hand-maintained list can
33
- // catch it.
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
- // presetAgentTabbed: the tabbed composition tuned for an agent shell.
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 (web-terminal-kiro). Same features as
7
- * presetTabbed, tuned for sessions that ARE agents:
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
- * Two agent-vs-generic distinctions live SERVER-side rather than here: the
15
- * status classifier that maps OSC 9 notifications to done/needs-input, and the
16
- * input-derived session name (terminal.WithInputTitle), which the agent host
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
  }
@@ -1,8 +1,12 @@
1
- // presetSingle: the single-pane desktop composition. Its own entry module so a
2
- // consumer importing "@cplieger/web-terminal-ui/presets/single" pulls in ONLY
3
- // this feature graph — none of the toolbar/tabs modules (the ./presets barrel
4
- // statically reaches everything; these per-preset entries are the
5
- // graph-minimal imports).
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";
@@ -1,7 +1,11 @@
1
- // presetTabbed (and the shared tabbed composition builder): the full
2
- // multi-session UI. Requires a server that speaks the session API
3
- // (`/api/sessions`, `/ws?session=`, and the status SSE `/api/sessions/events`),
4
- // such as `web-terminal-server` or `web-terminal-kiro`.
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 and .kiro/scripts/gen-attention-icons.py, which writes them. */
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 no longer a preset concern. The ENGINE resolves a session's name —
37
- * its pinned name, an input-derived name when the host asked for one
38
- * (terminal.WithInputTitle), the program's OSC window title, or its own
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(
@@ -1,7 +1,11 @@
1
- // presetTouch: the touch-first composition (single + the on-screen key
2
- // toolbar). Its own entry module so a touch consumer's delivered import graph
3
- // excludes the tabs/activity/animations modules entirely (vibekit's embedded
4
- // panel imports exactly this).
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
- // Feature presets: the barrel. Presets are plain feature-array factories, so
2
- // they are spreadable and editable: a consumer can drop or add a feature with a
3
- // filter/spread. This barrel statically imports EVERY preset (and therefore
4
- // every feature); a consumer that wants the minimal delivered import graph for
5
- // its composition imports the per-preset entry module instead —
6
- // "@cplieger/web-terminal-ui/presets/single" | "/presets/touch" |
7
- // "/presets/tabbed" | "/presets/agent-tabbed" — or hand-picks individual
8
- // features from "@cplieger/web-terminal-ui/features/<name>".
9
- //
10
- // The tabbed presets (presetTabbed / presetAgentTabbed) share the same feature
11
- // set (both include the activity monitor, whose per-tab dot reveals itself only
12
- // on OSC 9;4 progress, so a plain shell never shows one). They differ in the
13
- // title source: presetAgentTabbed sets preferInputTitle (the agent's program
14
- // emits a useless OSC title, so the label follows the latest submitted line),
15
- // while presetTabbed is OSC-first. The generic-vs-agent STATUS distinction stays
16
- // server-side — an agent server sets a classifier mapping OSC 9 notifications to
17
- // done/needs-input.
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";