@flyingrobots/bijou 3.1.0 → 4.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.
- package/LICENSE +159 -21
- package/README.md +92 -13
- package/dist/adapters/test/io.d.ts +3 -1
- package/dist/adapters/test/io.d.ts.map +1 -1
- package/dist/adapters/test/io.js +27 -0
- package/dist/adapters/test/io.js.map +1 -1
- package/dist/core/bg-fill.d.ts.map +1 -1
- package/dist/core/bg-fill.js +24 -1
- package/dist/core/bg-fill.js.map +1 -1
- package/dist/core/components/box-v3.d.ts +0 -1
- package/dist/core/components/box-v3.d.ts.map +1 -1
- package/dist/core/components/box-v3.js +0 -1
- package/dist/core/components/box-v3.js.map +1 -1
- package/dist/core/components/explainability.d.ts +51 -0
- package/dist/core/components/explainability.d.ts.map +1 -0
- package/dist/core/components/explainability.js +134 -0
- package/dist/core/components/explainability.js.map +1 -0
- package/dist/core/components/index.d.ts +7 -1
- package/dist/core/components/index.d.ts.map +1 -1
- package/dist/core/components/index.js +4 -1
- package/dist/core/components/index.js.map +1 -1
- package/dist/core/components/inspector.d.ts +49 -0
- package/dist/core/components/inspector.d.ts.map +1 -0
- package/dist/core/components/inspector.js +107 -0
- package/dist/core/components/inspector.js.map +1 -0
- package/dist/core/components/preference-list.d.ts +61 -0
- package/dist/core/components/preference-list.d.ts.map +1 -0
- package/dist/core/components/preference-list.js +215 -0
- package/dist/core/components/preference-list.js.map +1 -0
- package/dist/core/components/progress.d.ts +9 -1
- package/dist/core/components/progress.d.ts.map +1 -1
- package/dist/core/components/progress.js +20 -6
- package/dist/core/components/progress.js.map +1 -1
- package/dist/core/forms/filter-interactive.d.ts.map +1 -1
- package/dist/core/forms/filter-interactive.js +16 -16
- package/dist/core/forms/filter-interactive.js.map +1 -1
- package/dist/core/forms/form-utils.d.ts +33 -2
- package/dist/core/forms/form-utils.d.ts.map +1 -1
- package/dist/core/forms/form-utils.js +53 -3
- package/dist/core/forms/form-utils.js.map +1 -1
- package/dist/core/forms/multiselect.d.ts.map +1 -1
- package/dist/core/forms/multiselect.js +5 -5
- package/dist/core/forms/multiselect.js.map +1 -1
- package/dist/core/forms/select.d.ts.map +1 -1
- package/dist/core/forms/select.js +4 -4
- package/dist/core/forms/select.js.map +1 -1
- package/dist/core/forms/textarea-editor.d.ts.map +1 -1
- package/dist/core/forms/textarea-editor.js +12 -12
- package/dist/core/forms/textarea-editor.js.map +1 -1
- package/dist/core/key-input.d.ts +17 -0
- package/dist/core/key-input.d.ts.map +1 -0
- package/dist/core/key-input.js +92 -0
- package/dist/core/key-input.js.map +1 -0
- package/dist/core/render/differ.d.ts +3 -3
- package/dist/core/render/differ.d.ts.map +1 -1
- package/dist/core/render/differ.js +121 -52
- package/dist/core/render/differ.js.map +1 -1
- package/dist/core/text/grapheme.d.ts +7 -0
- package/dist/core/text/grapheme.d.ts.map +1 -1
- package/dist/core/text/grapheme.js +11 -1
- package/dist/core/text/grapheme.js.map +1 -1
- package/dist/core/text/index.d.ts +3 -2
- package/dist/core/text/index.d.ts.map +1 -1
- package/dist/core/text/index.js +2 -2
- package/dist/core/text/index.js.map +1 -1
- package/dist/core/text/wrap.d.ts +18 -0
- package/dist/core/text/wrap.d.ts.map +1 -1
- package/dist/core/text/wrap.js +92 -23
- package/dist/core/text/wrap.js.map +1 -1
- package/dist/index.d.ts +7 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/ports/index.d.ts +1 -1
- package/dist/ports/index.d.ts.map +1 -1
- package/dist/ports/io.d.ts +30 -0
- package/dist/ports/io.d.ts.map +1 -1
- package/dist/ports/surface.d.ts.map +1 -1
- package/dist/ports/surface.js +40 -18
- package/dist/ports/surface.js.map +1 -1
- package/package.json +2 -2
package/LICENSE
CHANGED
|
@@ -1,21 +1,159 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction, and
|
|
10
|
+
distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by the copyright
|
|
13
|
+
owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all other entities
|
|
16
|
+
that control, are controlled by, or are under common control with that entity.
|
|
17
|
+
For the purposes of this definition, "control" means (i) the power, direct or
|
|
18
|
+
indirect, to cause the direction or management of such entity, whether by
|
|
19
|
+
contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
20
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
21
|
+
|
|
22
|
+
"You" (or "Your") shall mean an individual or Legal Entity exercising
|
|
23
|
+
permissions granted by this License.
|
|
24
|
+
|
|
25
|
+
"Source" form shall mean the preferred form for making modifications, including
|
|
26
|
+
but not limited to software source code, documentation source, and configuration
|
|
27
|
+
files.
|
|
28
|
+
|
|
29
|
+
"Object" form shall mean any form resulting from mechanical transformation or
|
|
30
|
+
translation of a Source form, including but not limited to compiled object code,
|
|
31
|
+
generated documentation, and conversions to other media types.
|
|
32
|
+
|
|
33
|
+
"Work" shall mean the work of authorship, whether in Source or Object form, made
|
|
34
|
+
available under the License, as indicated by a copyright notice that is included
|
|
35
|
+
in or attached to the work (an example is provided in the Appendix below).
|
|
36
|
+
|
|
37
|
+
"Derivative Works" shall mean any work, whether in Source or Object form, that
|
|
38
|
+
is based on (or derived from) the Work and for which the editorial revisions,
|
|
39
|
+
annotations, elaborations, or other modifications represent, as a whole, an
|
|
40
|
+
original work of authorship. For the purposes of this License, Derivative Works
|
|
41
|
+
shall not include works that remain separable from, or merely link (or bind by
|
|
42
|
+
name) to the interfaces of, the Work and Derivative Works thereof.
|
|
43
|
+
|
|
44
|
+
"Contribution" shall mean any work of authorship, including the original version
|
|
45
|
+
of the Work and any modifications or additions to that Work or Derivative Works
|
|
46
|
+
thereof, that is intentionally submitted to Licensor for inclusion in the Work
|
|
47
|
+
by the copyright owner or by an individual or Legal Entity authorized to submit
|
|
48
|
+
on behalf of the copyright owner. For the purposes of this definition,
|
|
49
|
+
"submitted" means any form of electronic, verbal, or written communication sent
|
|
50
|
+
to the Licensor or its representatives, including but not limited to
|
|
51
|
+
communication on electronic mailing lists, source code control systems, and
|
|
52
|
+
issue tracking systems that are managed by, or on behalf of, the Licensor for
|
|
53
|
+
the purpose of discussing and improving the Work, but excluding communication
|
|
54
|
+
that is conspicuously marked or otherwise designated in writing by the copyright
|
|
55
|
+
owner as "Not a Contribution."
|
|
56
|
+
|
|
57
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf
|
|
58
|
+
of whom a Contribution has been received by Licensor and subsequently
|
|
59
|
+
incorporated within the Work.
|
|
60
|
+
|
|
61
|
+
2. Grant of Copyright License. Subject to the terms and conditions of this
|
|
62
|
+
License, each Contributor hereby grants to You a perpetual, worldwide,
|
|
63
|
+
non-exclusive, no-charge, royalty-free, irrevocable copyright license to
|
|
64
|
+
reproduce, prepare Derivative Works of, publicly display, publicly perform,
|
|
65
|
+
sublicense, and distribute the Work and such Derivative Works in Source or
|
|
66
|
+
Object form.
|
|
67
|
+
|
|
68
|
+
3. Grant of Patent License. Subject to the terms and conditions of this License,
|
|
69
|
+
each Contributor hereby grants to You a perpetual, worldwide, non-exclusive,
|
|
70
|
+
no-charge, royalty-free, irrevocable (except as stated in this section) patent
|
|
71
|
+
license to make, have made, use, offer to sell, sell, import, and otherwise
|
|
72
|
+
transfer the Work, where such license applies only to those patent claims
|
|
73
|
+
licensable by such Contributor that are necessarily infringed by their
|
|
74
|
+
Contribution(s) alone or by combination of their Contribution(s) with the Work
|
|
75
|
+
to which such Contribution(s) was submitted. If You institute patent litigation
|
|
76
|
+
against any entity (including a cross-claim or counterclaim in a lawsuit)
|
|
77
|
+
alleging that the Work or a Contribution incorporated within the Work
|
|
78
|
+
constitutes direct or contributory patent infringement, then any patent licenses
|
|
79
|
+
granted to You under this License for that Work shall terminate as of the date
|
|
80
|
+
such litigation is filed.
|
|
81
|
+
|
|
82
|
+
4. Redistribution. You may reproduce and distribute copies of the Work or
|
|
83
|
+
Derivative Works thereof in any medium, with or without modifications, and in
|
|
84
|
+
Source or Object form, provided that You meet the following conditions:
|
|
85
|
+
|
|
86
|
+
(a) You must give any other recipients of the Work or Derivative Works a copy of
|
|
87
|
+
this License; and
|
|
88
|
+
|
|
89
|
+
(b) You must cause any modified files to carry prominent notices stating that You
|
|
90
|
+
changed the files; and
|
|
91
|
+
|
|
92
|
+
(c) You must retain, in the Source form of any Derivative Works that You
|
|
93
|
+
distribute, all copyright, patent, trademark, and attribution notices from the
|
|
94
|
+
Source form of the Work, excluding those notices that do not pertain to any part
|
|
95
|
+
of the Derivative Works; and
|
|
96
|
+
|
|
97
|
+
(d) If the Work includes a "NOTICE" text file as part of its distribution, then
|
|
98
|
+
any Derivative Works that You distribute must include a readable copy of the
|
|
99
|
+
attribution notices contained within such NOTICE file, excluding those notices
|
|
100
|
+
that do not pertain to any part of the Derivative Works, in at least one of the
|
|
101
|
+
following places: within a NOTICE text file distributed as part of the
|
|
102
|
+
Derivative Works; within the Source form or documentation, if provided along
|
|
103
|
+
with the Derivative Works; or, within a display generated by the Derivative
|
|
104
|
+
Works, if and wherever such third-party notices normally appear. The contents of
|
|
105
|
+
the NOTICE file are for informational purposes only and do not modify the
|
|
106
|
+
License. You may add Your own attribution notices within Derivative Works that
|
|
107
|
+
You distribute, alongside or as an addendum to the NOTICE text from the Work,
|
|
108
|
+
provided that such additional attribution notices cannot be construed as
|
|
109
|
+
modifying the License.
|
|
110
|
+
|
|
111
|
+
You may add Your own copyright statement to Your modifications and may provide
|
|
112
|
+
additional or different license terms and conditions for use, reproduction, or
|
|
113
|
+
distribution of Your modifications, or for any such Derivative Works as a whole,
|
|
114
|
+
provided Your use, reproduction, and distribution of the Work otherwise complies
|
|
115
|
+
with the conditions stated in this License.
|
|
116
|
+
|
|
117
|
+
5. Submission of Contributions. Unless You explicitly state otherwise, any
|
|
118
|
+
Contribution intentionally submitted for inclusion in the Work by You to the
|
|
119
|
+
Licensor shall be under the terms and conditions of this License, without any
|
|
120
|
+
additional terms or conditions. Notwithstanding the above, nothing herein shall
|
|
121
|
+
supersede or modify the terms of any separate license agreement you may have
|
|
122
|
+
executed with Licensor regarding such Contributions.
|
|
123
|
+
|
|
124
|
+
6. Trademarks. This License does not grant permission to use the trade names,
|
|
125
|
+
trademarks, service marks, or product names of the Licensor, except as required
|
|
126
|
+
for reasonable and customary use in describing the origin of the Work and
|
|
127
|
+
reproducing the content of the NOTICE file.
|
|
128
|
+
|
|
129
|
+
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in
|
|
130
|
+
writing, Licensor provides the Work (and each Contributor provides its
|
|
131
|
+
Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
132
|
+
KIND, either express or implied, including, without limitation, any warranties
|
|
133
|
+
or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
134
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
135
|
+
appropriateness of using or redistributing the Work and assume any risks
|
|
136
|
+
associated with Your exercise of permissions under this License.
|
|
137
|
+
|
|
138
|
+
8. Limitation of Liability. In no event and under no legal theory, whether in
|
|
139
|
+
tort (including negligence), contract, or otherwise, unless required by
|
|
140
|
+
applicable law (such as deliberate and grossly negligent acts) or agreed to in
|
|
141
|
+
writing, shall any Contributor be liable to You for damages, including any
|
|
142
|
+
direct, indirect, special, incidental, or consequential damages of any
|
|
143
|
+
character arising as a result of this License or out of the use or inability to
|
|
144
|
+
use the Work (including but not limited to damages for loss of goodwill, work
|
|
145
|
+
stoppage, computer failure or malfunction, or any and all other commercial
|
|
146
|
+
damages or losses), even if such Contributor has been advised of the
|
|
147
|
+
possibility of such damages.
|
|
148
|
+
|
|
149
|
+
9. Accepting Warranty or Additional Liability. While redistributing the Work or
|
|
150
|
+
Derivative Works thereof, You may choose to offer, and charge a fee for,
|
|
151
|
+
acceptance of support, warranty, indemnity, or other liability obligations
|
|
152
|
+
and/or rights consistent with this License. However, in accepting such
|
|
153
|
+
obligations, You may act only on Your own behalf and on Your sole
|
|
154
|
+
responsibility, not on behalf of any other Contributor, and only if You agree to
|
|
155
|
+
indemnify, defend, and hold each Contributor harmless for any liability incurred
|
|
156
|
+
by, or claims asserted against, such Contributor by reason of your accepting any
|
|
157
|
+
such warranty or additional liability.
|
|
158
|
+
|
|
159
|
+
END OF TERMS AND CONDITIONS
|
package/README.md
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
The pure, zero-dependency core of Bijou.
|
|
4
4
|
|
|
5
|
-
`@flyingrobots/bijou` is the degradation-first terminal toolkit in the Bijou stack. It contains components, prompts, themes, environment detection, test adapters, and the foundational `Surface` and `LayoutNode` primitives that the
|
|
5
|
+
`@flyingrobots/bijou` is the degradation-first terminal toolkit in the Bijou stack. It contains components, prompts, themes, environment detection, test adapters, and the foundational `Surface` and `LayoutNode` primitives that the interactive runtime builds on.
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Package Role in v4.0.0
|
|
8
8
|
|
|
9
|
-
- **
|
|
10
|
-
- **Surface primitives without abandoning strings** —
|
|
11
|
-
- **Surface-first companions for common
|
|
12
|
-
- **Explicit
|
|
9
|
+
- **Core/runtime split stays explicit** — the core package remains the right place for CLIs, prompts, logs, and portable terminal output, while `@flyingrobots/bijou-tui` owns the fullscreen runtime.
|
|
10
|
+
- **Surface primitives without abandoning strings** — the package is intentionally mixed-mode. String-oriented helpers remain first-class where they fit the toolkit identity, and runtime-friendly surface helpers exist where they actually help.
|
|
11
|
+
- **Surface-first companions for common runtime chrome** — `boxSurface`, `headerBoxSurface`, `separatorSurface`, `alertSurface`, and `tableSurface` let runtime apps stay on the `Surface` path for common layout and status primitives.
|
|
12
|
+
- **Explicit seam crossing** — when you move `Surface` output back into string-first APIs, you do it deliberately with `surfaceToString(surface, ctx.style)`.
|
|
13
13
|
- **Same hexagonal core** — ports, themes, output-mode detection, and test adapters remain pure and dependency-free.
|
|
14
14
|
|
|
15
15
|
## Install
|
|
@@ -36,7 +36,7 @@ const panel = boxSurface(
|
|
|
36
36
|
{ title: 'Runtime', padding: { top: 1, bottom: 1, left: 2, right: 2 }, ctx },
|
|
37
37
|
);
|
|
38
38
|
|
|
39
|
-
// Return `panel` from a
|
|
39
|
+
// Return `panel` from a runtime `view()` function or framed pane renderer.
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
## Features Breakdown
|
|
@@ -48,22 +48,101 @@ const panel = boxSurface(
|
|
|
48
48
|
- **Theme system**: preset themes + DTCG-compatible custom token loading via `BIJOU_THEME`.
|
|
49
49
|
- **Test adapters**: deterministic test context and assertion helpers for mock-free component testing.
|
|
50
50
|
|
|
51
|
+
## Design guidance
|
|
52
|
+
|
|
53
|
+
For the system-level guidance behind the component catalog, see:
|
|
54
|
+
|
|
55
|
+
- [`../../docs/design-system/README.md`](../../docs/design-system/README.md)
|
|
56
|
+
- [`../../docs/design-system/foundations.md`](../../docs/design-system/foundations.md)
|
|
57
|
+
- [`../../docs/design-system/patterns.md`](../../docs/design-system/patterns.md)
|
|
58
|
+
- [`../../docs/design-system/component-families.md`](../../docs/design-system/component-families.md)
|
|
59
|
+
|
|
60
|
+
Those docs answer the questions the API reference cannot:
|
|
61
|
+
|
|
62
|
+
- when to use a family
|
|
63
|
+
- when not to use it
|
|
64
|
+
- which variation is semantic versus render-path versus interaction-layer
|
|
65
|
+
- what belongs in core Bijou versus `@flyingrobots/bijou-tui`
|
|
66
|
+
|
|
67
|
+
## Choosing Component Families
|
|
68
|
+
|
|
69
|
+
### Status and feedback
|
|
70
|
+
|
|
71
|
+
- Use `badge()` when status is compact and belongs inline with another object.
|
|
72
|
+
- Use `note()` when the user needs explanation without urgency.
|
|
73
|
+
- Use `alert()` when the message should persist inside the page or document flow.
|
|
74
|
+
- Move to `@flyingrobots/bijou-tui` notifications when stacking, placement, actions, or history matter.
|
|
75
|
+
|
|
76
|
+
### Selection and prompts
|
|
77
|
+
|
|
78
|
+
- Use `select()` when the user is choosing one stored value from a short, stable set.
|
|
79
|
+
- Use `filter()` when the user is still choosing one stored value, but search and narrowing are the real job.
|
|
80
|
+
- Use `multiselect()` when the user is building a lasting set, not firing one-off commands.
|
|
81
|
+
- Use `confirm()` only when the decision is genuinely binary.
|
|
82
|
+
- Move to `commandPaletteSurface()` in `@flyingrobots/bijou-tui` when the outcome is an action or navigation command instead of stored form state.
|
|
83
|
+
|
|
84
|
+
### Tables and inspection
|
|
85
|
+
|
|
86
|
+
- Use `table()` when row/column comparison is the main job and string output is still the right endpoint.
|
|
87
|
+
- Use `tableSurface()` when the job is still passive comparison, but your runtime app is already composing `Surface` output.
|
|
88
|
+
- Use `navigableTable()` from `@flyingrobots/bijou-tui` when the user needs keyboard-owned row or cell inspection instead of passive reading.
|
|
89
|
+
|
|
90
|
+
### Hierarchy and chronology
|
|
91
|
+
|
|
92
|
+
- Use `tree()` when parent/child nesting is the main thing the reader needs to understand.
|
|
93
|
+
- Use `timeline()` when chronology is the actual reading path.
|
|
94
|
+
- Move to `dag()` when dependency or causal flow matters more than simple order or nesting.
|
|
95
|
+
- Use `dagSlice()` when a local neighborhood or ancestor/descendant chain is the honest scope.
|
|
96
|
+
- Use `dagStats()` when graph health or structural summary matters more than visual shape.
|
|
97
|
+
|
|
98
|
+
### Wayfinding and progress
|
|
99
|
+
|
|
100
|
+
- Use `breadcrumb()` when path context helps explain the current location.
|
|
101
|
+
- Use `paginator()` when compact position-in-sequence feedback is enough.
|
|
102
|
+
- Use `stepper()` when the user is progressing through ordered stages rather than switching among peers.
|
|
103
|
+
|
|
104
|
+
### Containment and formatted content
|
|
105
|
+
|
|
106
|
+
- Use `box()` when a region needs visible containment or comparison against sibling panels.
|
|
107
|
+
- Use `headerBox()` when that same region also needs a compact title and detail line.
|
|
108
|
+
- Use `markdown()` for bounded help, reference, and release-note prose that should lower honestly across rich, pipe, and accessible output.
|
|
109
|
+
- Avoid turning every subsection into a box or using markdown as a substitute layout engine for full application chrome.
|
|
110
|
+
|
|
111
|
+
### Loading, links, and expressive moments
|
|
112
|
+
|
|
113
|
+
- Use `skeleton()` for short-lived placeholders when the final content shape is known.
|
|
114
|
+
- Use `hyperlink()` when the destination itself should remain explicit and trustworthy in terminal output.
|
|
115
|
+
- Use `kbd()` for local inline shortcut cues; use shell help in `@flyingrobots/bijou-tui` when the user needs a broader keybinding reference.
|
|
116
|
+
- Use `gradientText()` and `loadRandomLogo()` sparingly for splash, docs, and celebratory moments rather than routine workspace chrome.
|
|
117
|
+
|
|
118
|
+
### Progress and custom primitives
|
|
119
|
+
|
|
120
|
+
- Use `progressBar()` when completion can be estimated honestly.
|
|
121
|
+
- Use `spinnerFrame()` or `createSpinner()` when the task is active but indeterminate.
|
|
122
|
+
- Use `renderByMode()` when you are authoring an app-specific primitive that must stay truthful across rich, pipe, and accessible output.
|
|
123
|
+
|
|
51
124
|
## Components
|
|
52
125
|
|
|
53
126
|
### Layout
|
|
54
|
-
`box()`, `headerBox()`, `separator()` plus `boxSurface()`, `headerBoxSurface()`, `separatorSurface()` —
|
|
127
|
+
`box()`, `headerBox()`, `separator()` plus `boxSurface()`, `headerBoxSurface()`, `separatorSurface()` — string-first helpers and surface-native companions for layout chrome.
|
|
55
128
|
|
|
56
129
|
### Elements
|
|
57
|
-
`badge()`, `alert()`, `alertSurface()`, `kbd()`, `skeleton()` — status
|
|
130
|
+
`badge()`, `alert()`, `alertSurface()`, `kbd()`, `skeleton()`, `hyperlink()` — inline status, in-flow status blocks, loading placeholders, trusted links, and UI primitives.
|
|
58
131
|
|
|
59
132
|
### Data
|
|
60
|
-
`table()`, `tableSurface()`, `tree()`, `accordion()`, `timeline()`, `dag()`, `dagSlice()`, `dagLayout()`, `dagStats()` — structured data display, DAG rendering with `DagSource` adapter, and graph statistics.
|
|
133
|
+
`table()`, `tableSurface()`, `tree()`, `accordion()`, `timeline()`, `dag()`, `dagSlice()`, `dagLayout()`, `dagStats()` — passive comparison and structured data display, DAG rendering with `DagSource` adapter, and graph statistics.
|
|
134
|
+
|
|
135
|
+
### Documents
|
|
136
|
+
`markdown()` — structured terminal prose for help, readmes, and reference content with mode-aware lowering.
|
|
61
137
|
|
|
62
138
|
### Navigation
|
|
63
139
|
`tabs()`, `breadcrumb()`, `stepper()`, `paginator()` — wayfinding components.
|
|
64
140
|
|
|
65
141
|
### Animation & Progress
|
|
66
|
-
`
|
|
142
|
+
`spinnerFrame()`, `createSpinner()`, `progressBar()`, `createProgressBar()`, `createAnimatedProgressBar()`, `gradientText()`, `loadRandomLogo()` — determinate and indeterminate progress, live-updating output, expressive gradients, and branded ASCII moments.
|
|
143
|
+
|
|
144
|
+
### Authoring helpers
|
|
145
|
+
`renderByMode()` — mode-aware helper for app-authored primitives that need honest rich/pipe/accessible lowering.
|
|
67
146
|
|
|
68
147
|
### Forms
|
|
69
148
|
`input()`, `select()`, `multiselect()`, `confirm()`, `group()`, `wizard()`, `textarea()`, `filter()` — interactive prompts with validation that degrade to numbered-list selection in pipe/CI modes.
|
|
@@ -106,7 +185,7 @@ const result = box('hello', { ctx });
|
|
|
106
185
|
```
|
|
107
186
|
|
|
108
187
|
See [GUIDE.md](./GUIDE.md) for more on testing, theming, and component usage.
|
|
109
|
-
For upgrading existing apps, see the monorepo migration guide at [`../../docs/
|
|
188
|
+
For upgrading existing apps, see the monorepo migration guide at [`../../docs/MIGRATING_TO_V4.md`](../../docs/MIGRATING_TO_V4.md).
|
|
110
189
|
|
|
111
190
|
## Related Packages
|
|
112
191
|
|
|
@@ -115,7 +194,7 @@ For upgrading existing apps, see the monorepo migration guide at [`../../docs/MI
|
|
|
115
194
|
|
|
116
195
|
## License
|
|
117
196
|
|
|
118
|
-
|
|
197
|
+
Apache-2.0
|
|
119
198
|
|
|
120
199
|
---
|
|
121
200
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ClockPort } from '../../ports/clock.js';
|
|
2
|
-
import type { IOPort } from '../../ports/io.js';
|
|
2
|
+
import type { IOPort, KeyInputMsg } from '../../ports/io.js';
|
|
3
3
|
/**
|
|
4
4
|
* Configuration for {@link mockIO}.
|
|
5
5
|
*/
|
|
@@ -8,6 +8,8 @@ export interface MockIOOptions {
|
|
|
8
8
|
answers?: string[];
|
|
9
9
|
/** Pre-loaded keypress strings delivered by {@link MockIO.rawInput} via microtasks. */
|
|
10
10
|
keys?: string[];
|
|
11
|
+
/** Pre-loaded semantic keys delivered by {@link MockIO.keyInput} via microtasks. */
|
|
12
|
+
keyMsgs?: KeyInputMsg[];
|
|
11
13
|
/** Clock override for deterministic timer and microtask scheduling in tests. */
|
|
12
14
|
clock?: ClockPort;
|
|
13
15
|
/** Virtual filesystem entries (path to content) for {@link MockIO.readFile}. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"io.d.ts","sourceRoot":"","sources":["../../../src/adapters/test/io.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,EAAE,MAAM,EAA+B,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"io.d.ts","sourceRoot":"","sources":["../../../src/adapters/test/io.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAA+B,MAAM,mBAAmB,CAAC;AAK1F;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,4EAA4E;IAC5E,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,uFAAuF;IACvF,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,oFAAoF;IACpF,OAAO,CAAC,EAAE,WAAW,EAAE,CAAC;IACxB,gFAAgF;IAChF,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,gFAAgF;IAChF,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,+EAA+E;IAC/E,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;CACjC;AAED;;;;;GAKG;AACH,MAAM,WAAW,MAAO,SAAQ,MAAM;IACpC,yFAAyF;IACzF,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,gDAAgD;IAChD,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,mEAAmE;IACnE,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,2DAA2D;IAC3D,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,iEAAiE;IACjE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;CAChC;AAED;;;;;;;;;GASG;AACH,wBAAgB,MAAM,CAAC,OAAO,GAAE,aAAkB,GAAG,MAAM,CA0I1D"}
|
package/dist/adapters/test/io.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { resolveClock } from '../../core/clock.js';
|
|
2
|
+
import { decodeRawKeySequence } from '../../core/key-input.js';
|
|
2
3
|
import { join } from 'path';
|
|
3
4
|
/**
|
|
4
5
|
* Create an in-memory {@link IOPort} for tests.
|
|
@@ -70,6 +71,32 @@ export function mockIO(options = {}) {
|
|
|
70
71
|
clock.queueMicrotask(deliver);
|
|
71
72
|
return { dispose() { disposed = true; } };
|
|
72
73
|
},
|
|
74
|
+
/**
|
|
75
|
+
* Deliver pre-loaded semantic keys to the callback via microtasks.
|
|
76
|
+
*
|
|
77
|
+
* Falls back to decoding `options.keys` so existing tests can keep
|
|
78
|
+
* expressing scripted input in raw terminal strings while semantic-input
|
|
79
|
+
* consumers still exercise the higher-level port.
|
|
80
|
+
*
|
|
81
|
+
* @param onKey - Callback invoked for each semantic keypress.
|
|
82
|
+
* @returns A handle whose `dispose()` stops further key delivery.
|
|
83
|
+
*/
|
|
84
|
+
keyInput(onKey) {
|
|
85
|
+
const keyQueue = options.keyMsgs !== undefined
|
|
86
|
+
? [...options.keyMsgs]
|
|
87
|
+
: (options.keys ?? []).flatMap((key) => decodeRawKeySequence(key));
|
|
88
|
+
let disposed = false;
|
|
89
|
+
function deliver() {
|
|
90
|
+
if (disposed || keyQueue.length === 0)
|
|
91
|
+
return;
|
|
92
|
+
const key = keyQueue.shift();
|
|
93
|
+
onKey(key);
|
|
94
|
+
if (keyQueue.length > 0)
|
|
95
|
+
clock.queueMicrotask(deliver);
|
|
96
|
+
}
|
|
97
|
+
clock.queueMicrotask(deliver);
|
|
98
|
+
return { dispose() { disposed = true; } };
|
|
99
|
+
},
|
|
73
100
|
/**
|
|
74
101
|
* Register a resize callback (no-op in tests).
|
|
75
102
|
* @param _callback - Ignored; resize events are not simulated.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"io.js","sourceRoot":"","sources":["../../../src/adapters/test/io.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"io.js","sourceRoot":"","sources":["../../../src/adapters/test/io.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,oBAAoB,E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AE,CAAC;QAC1B,CAAC;QAED;;;;;WAKG;QACH,WAAW,CAAC,QAAoB,EAAE,EAAU;YAC1C,OAAO,KAAK,CAAC,WAAW,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;QACzC,CAAC;QAED;;;;;WAKG;QACH,QAAQ,CAAC,IAAY;YACnB,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC;YAC5B,IAAI,OAAO,KAAK,SAAS;gBAAE,MAAM,IAAI,KAAK,CAAC,yBAAyB,IAAI,EAAE,CAAC,CAAC;YAC5E,OAAO,OAAO,CAAC;QACjB,CAAC;QAED;;;;WAIG;QACH,OAAO,CAAC,IAAY;YAClB,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;QAC1B,CAAC;QAED;;;;WAIG;QACH,QAAQ,CAAC,GAAG,QAAkB;YAC5B,OAAO,IAAI,CAAC,GAAG,QAAQ,CAAC,CAAC;QAC3B,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bg-fill.d.ts","sourceRoot":"","sources":["../../src/core/bg-fill.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"bg-fill.d.ts","sourceRoot":"","sources":["../../src/core/bg-fill.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAKpD;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,YAAY,GAAG,SAAS,GAAG,OAAO,CAKpE;AAED;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CACxB,KAAK,EAAE,UAAU,GAAG,SAAS,EAC7B,GAAG,EAAE,YAAY,GAAG,SAAS,GAC5B,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC,GAAG,SAAS,CAkBxC"}
|
package/dist/core/bg-fill.js
CHANGED
|
@@ -6,6 +6,9 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @module
|
|
8
8
|
*/
|
|
9
|
+
import { ANSI_SGR_RE } from './text/index.js';
|
|
10
|
+
const ANSI_SGR_GLOBAL_RE = new RegExp(ANSI_SGR_RE.source, 'g');
|
|
11
|
+
const MARKER = '\u0000';
|
|
9
12
|
/**
|
|
10
13
|
* Determine whether background color should be applied in the current context.
|
|
11
14
|
*
|
|
@@ -37,6 +40,26 @@ export function shouldApplyBg(ctx) {
|
|
|
37
40
|
export function makeBgFill(token, ctx) {
|
|
38
41
|
if (!token?.bg || !shouldApplyBg(ctx))
|
|
39
42
|
return undefined;
|
|
40
|
-
|
|
43
|
+
const wrappedMarker = ctx.style.bgHex(token.bg, MARKER);
|
|
44
|
+
const markerIndex = wrappedMarker.indexOf(MARKER);
|
|
45
|
+
if (markerIndex < 0 || wrappedMarker === MARKER) {
|
|
46
|
+
return (text) => ctx.style.bgHex(token.bg, text);
|
|
47
|
+
}
|
|
48
|
+
const prefix = wrappedMarker.slice(0, markerIndex);
|
|
49
|
+
const suffix = wrappedMarker.slice(markerIndex + MARKER.length);
|
|
50
|
+
if (prefix.length === 0 || suffix.length === 0) {
|
|
51
|
+
return (text) => ctx.style.bgHex(token.bg, text);
|
|
52
|
+
}
|
|
53
|
+
return (text) => wrapPreservingBackground(text, prefix, suffix);
|
|
54
|
+
}
|
|
55
|
+
function wrapPreservingBackground(text, prefix, suffix) {
|
|
56
|
+
const reapplied = text.replace(ANSI_SGR_GLOBAL_RE, (match) => {
|
|
57
|
+
const codes = match.slice(2, -1);
|
|
58
|
+
const parts = codes === '' ? ['0'] : codes.split(';');
|
|
59
|
+
return parts.includes('0') || parts.includes('49')
|
|
60
|
+
? match + prefix
|
|
61
|
+
: match;
|
|
62
|
+
});
|
|
63
|
+
return prefix + reapplied + suffix;
|
|
41
64
|
}
|
|
42
65
|
//# sourceMappingURL=bg-fill.js.map
|
package/dist/core/bg-fill.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bg-fill.js","sourceRoot":"","sources":["../../src/core/bg-fill.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"bg-fill.js","sourceRoot":"","sources":["../../src/core/bg-fill.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAG9C,MAAM,kBAAkB,GAAG,IAAI,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAC/D,MAAM,MAAM,GAAG,QAAQ,CAAC;AAExB;;;;;;;;GAQG;AACH,MAAM,UAAU,aAAa,CAAC,GAA6B;IACzD,IAAI,CAAC,GAAG;QAAE,OAAO,KAAK,CAAC;IACvB,IAAI,GAAG,CAAC,KAAK,CAAC,OAAO;QAAE,OAAO,KAAK,CAAC;IACpC,IAAI,GAAG,CAAC,IAAI,KAAK,MAAM,IAAI,GAAG,CAAC,IAAI,KAAK,YAAY;QAAE,OAAO,KAAK,CAAC;IACnE,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,UAAU,CACxB,KAA6B,EAC7B,GAA6B;IAE7B,IAAI,CAAC,KAAK,EAAE,EAAE,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC;QAAE,OAAO,SAAS,CAAC;IAExD,MAAM,aAAa,GAAG,GAAI,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,EAAG,EAAE,MAAM,CAAC,CAAC;IAC1D,MAAM,WAAW,GAAG,aAAa,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAElD,IAAI,WAAW,GAAG,CAAC,IAAI,aAAa,KAAK,MAAM,EAAE,CAAC;QAChD,OAAO,CAAC,IAAY,E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6,7 +6,6 @@ import { type BoxOptions, type HeaderBoxOptions } from './box.js';
|
|
|
6
6
|
* Returns a new Surface containing the box and the nested content.
|
|
7
7
|
*/
|
|
8
8
|
export declare function boxSurface(content: Surface | string, options?: BoxOptions): Surface;
|
|
9
|
-
export declare const boxV3: typeof boxSurface;
|
|
10
9
|
/**
|
|
11
10
|
* Render a header box as a Surface for V3-native composition.
|
|
12
11
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"box-v3.d.ts","sourceRoot":"","sources":["../../../src/core/components/box-v3.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,OAAO,EAAa,MAAM,wBAAwB,CAAC;AAIhF,OAAO,EAAmB,KAAK,UAAU,EAAE,KAAK,gBAAgB,EAAE,MAAM,UAAU,CAAC;AA4BnF;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,EAAE,OAAO,GAAE,UAAe,GAAG,OAAO,CAwGvF;
|
|
1
|
+
{"version":3,"file":"box-v3.d.ts","sourceRoot":"","sources":["../../../src/core/components/box-v3.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,OAAO,EAAa,MAAM,wBAAwB,CAAC;AAIhF,OAAO,EAAmB,KAAK,UAAU,EAAE,KAAK,gBAAgB,EAAE,MAAM,UAAU,CAAC;AA4BnF;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,EAAE,OAAO,GAAE,UAAe,GAAG,OAAO,CAwGvF;AACD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,GAAE,gBAAqB,GAAG,OAAO,CAmBvF"}
|
|
@@ -121,7 +121,6 @@ export function boxSurface(content, options = {}) {
|
|
|
121
121
|
surface.blit(withInheritedBackground(contentSurf, fillStyle.bg), effectiveLeft + 1, pt + 1, 0, 0, contentBoxWidth, contentSurf.height);
|
|
122
122
|
return surface;
|
|
123
123
|
}
|
|
124
|
-
export const boxV3 = boxSurface;
|
|
125
124
|
/**
|
|
126
125
|
* Render a header box as a Surface for V3-native composition.
|
|
127
126
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"box-v3.js","sourceRoot":"","sources":["../../../src/core/components/box-v3.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAA2B,MAAM,wBAAwB,CAAC;AAChF,OAAO,EAAE,cAAc,IAAI,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAA0C,MAAM,UAAU,CAAC;AACnF,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACtI,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAExD,MAAM,MAAM,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC;AAEtE,SAAS,mBAAmB,CAAC,KAAyB;IACpD,IAAI,KAAK,IAAI,IAAI;QAAE,OAAO,SAAS,CAAC;IACpC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IAC9C,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;AACxC,CAAC;AAED,SAAS,uBAAuB,CAAC,OAAgB,EAAE,UAA8B;IAC/E,IAAI,UAAU,IAAI,IAAI;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,OAAO,CAAC,CAAC;AAC7D,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { BijouContext } from '../../ports/context.js';
|
|
2
|
+
import type { TokenValue } from '../theme/tokens.js';
|
|
3
|
+
import type { BijouNodeOptions } from './types.js';
|
|
4
|
+
/** A single evidence item supporting an explainability recommendation. */
|
|
5
|
+
export interface ExplainabilityEvidenceItem {
|
|
6
|
+
/** Primary evidence statement. */
|
|
7
|
+
readonly label: string;
|
|
8
|
+
/** Optional supporting detail for the evidence item. */
|
|
9
|
+
readonly detail?: string;
|
|
10
|
+
}
|
|
11
|
+
/** Options for rendering a canonical explainability surface. */
|
|
12
|
+
export interface ExplainabilityOptions extends BijouNodeOptions {
|
|
13
|
+
/** Primary recommendation or explanation title. */
|
|
14
|
+
readonly title: string;
|
|
15
|
+
/** Visible provenance label. Defaults to `[AI]`. */
|
|
16
|
+
readonly label?: string;
|
|
17
|
+
/** Optional artifact kind, such as `Suggestion` or `Summary`. */
|
|
18
|
+
readonly artifactKind?: string;
|
|
19
|
+
/** Optional source or actor responsible for the recommendation. */
|
|
20
|
+
readonly source?: string;
|
|
21
|
+
/** Optional source mode, such as `advisory` or `draft`. */
|
|
22
|
+
readonly sourceMode?: string;
|
|
23
|
+
/** Optional rationale describing why the recommendation is present. */
|
|
24
|
+
readonly rationale?: string;
|
|
25
|
+
/** Optional evidence items supporting the recommendation. */
|
|
26
|
+
readonly evidence?: readonly ExplainabilityEvidenceItem[];
|
|
27
|
+
/** Optional clear next action for the user. */
|
|
28
|
+
readonly nextAction?: string;
|
|
29
|
+
/** Optional governance or review note. */
|
|
30
|
+
readonly governance?: string;
|
|
31
|
+
/** Optional confidence. Numbers are formatted as percentages. */
|
|
32
|
+
readonly confidence?: number | string;
|
|
33
|
+
/** Optional border token for the visual surface. */
|
|
34
|
+
readonly borderToken?: TokenValue;
|
|
35
|
+
/** Optional background token for the visual surface. */
|
|
36
|
+
readonly bgToken?: TokenValue;
|
|
37
|
+
/** Optional fixed width for the visual surface. */
|
|
38
|
+
readonly width?: number;
|
|
39
|
+
/** Bijou context for rendering mode and theme resolution. */
|
|
40
|
+
readonly ctx?: BijouContext;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Render a canonical explainability surface for AI-mediated recommendations.
|
|
44
|
+
*
|
|
45
|
+
* Output adapts by mode:
|
|
46
|
+
* - `interactive` / `static`: boxed, sectioned explainability surface with a visible `[AI]` label.
|
|
47
|
+
* - `pipe`: plain, newline-separated labeled sections.
|
|
48
|
+
* - `accessible`: explicit linearized explanation with the same meaning.
|
|
49
|
+
*/
|
|
50
|
+
export declare function explainability(options: ExplainabilityOptions): string;
|
|
51
|
+
//# sourceMappingURL=explainability.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"explainability.d.ts","sourceRoot":"","sources":["../../../src/core/components/explainability.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAKrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD,0EAA0E;AAC1E,MAAM,WAAW,0BAA0B;IACzC,kCAAkC;IAClC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,wDAAwD;IACxD,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,gEAAgE;AAChE,MAAM,WAAW,qBAAsB,SAAQ,gBAAgB;IAC7D,mDAAmD;IACnD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,oDAAoD;IACpD,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,iEAAiE;IACjE,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,mEAAmE;IACnE,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,2DAA2D;IA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