gentle-shell-bridge 0.3.0 → 0.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/LICENSE +202 -0
- package/docs/contract.md +1 -1
- package/package.json +13 -1
- package/src/api.ts +1 -1
- package/.codegraph/.gitignore +0 -5
- package/PRD.md +0 -144
- package/examples/bash-card.ts +0 -1694
- package/gentle-shell-bridge-0.3.0.tgz +0 -0
- package/odd/tasks/palette-sections.md +0 -30
- package/odd/tasks/plugin-keymap.md +0 -32
- package/odd/tasks/plugin-surface-contract.md +0 -55
- package/test/api.test.ts +0 -395
- package/test/apply-on-move.test.ts +0 -477
- package/test/arm.test.ts +0 -220
- package/test/bridge-ready.test.ts +0 -309
- package/test/bus.test.ts +0 -165
- package/test/button-rows.test.ts +0 -409
- package/test/capture.test.ts +0 -356
- package/test/card-style-rows.test.ts +0 -510
- package/test/card-style-transform.test.ts +0 -379
- package/test/card-style-wiring.test.ts +0 -258
- package/test/card-styles-e2e.test.ts +0 -491
- package/test/card-styles.test.ts +0 -324
- package/test/card-transcript-path.test.ts +0 -178
- package/test/config.test.ts +0 -93
- package/test/e2e.test.ts +0 -443
- package/test/example-bash-identity.test.ts +0 -372
- package/test/example-bash-matrix.test.ts +0 -856
- package/test/example-designs.test.ts +0 -734
- package/test/example-neon-transform.test.ts +0 -283
- package/test/example-plain-style.test.ts +0 -1268
- package/test/extension.test.ts +0 -160
- package/test/fake-events.ts +0 -58
- package/test/fake-host.ts +0 -211
- package/test/fake-sidebar.ts +0 -516
- package/test/fake-transcript.ts +0 -486
- package/test/frame-telemetry.test.ts +0 -417
- package/test/hook.test.ts +0 -196
- package/test/manifest.test.ts +0 -105
- package/test/new-category.test.ts +0 -979
- package/test/notices.test.ts +0 -328
- package/test/plugin-integration-lines.test.ts +0 -979
- package/test/plugin-surface.test.ts +0 -152
- package/test/presence.test.ts +0 -459
- package/test/rail-surfaces.test.ts +0 -457
- package/test/rail-width.test.ts +0 -423
- package/test/regression.test.ts +0 -483
- package/test/repaint-api.test.ts +0 -200
- package/test/reserved-categories.test.ts +0 -361
- package/test/row-labels.test.ts +0 -284
- package/test/row-names.test.ts +0 -473
- package/test/row-origin.test.ts +0 -395
- package/test/section-interaction.test.ts +0 -364
- package/test/section-panel.test.ts +0 -403
- package/test/sections-rows.test.ts +0 -291
- package/test/sidebar-backend.test.ts +0 -471
- package/test/sidebar-e2e.test.ts +0 -331
- package/test/sidebar-hover.test.ts +0 -276
- package/test/sidebar-independent.test.ts +0 -349
- package/test/sidebar-render.test.ts +0 -281
- package/test/sidebar-sections.test.ts +0 -245
- package/test/status-card-styles.test.ts +0 -201
- package/test/status-section-frame.test.ts +0 -181
- package/test/status-sections.test.ts +0 -243
- package/test/status.test.ts +0 -209
- package/test/store.test.ts +0 -192
- package/test/surface-repaint-cost.test.ts +0 -520
- package/test/tool-design-chain.test.ts +0 -483
- package/test/tool-design-cost.test.ts +0 -473
- package/test/tool-design-rows.test.ts +0 -359
- package/test/tool-designs.test.ts +0 -745
- package/test/transform-pipeline.test.ts +0 -465
- package/test/transforms-bus.test.ts +0 -233
- package/test/verifier-width-regressions.test.ts +0 -164
- package/tsconfig.json +0 -18
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/docs/contract.md
CHANGED
|
@@ -304,7 +304,7 @@ told once, on Pi's cross-extension bus.
|
|
|
304
304
|
Object.freeze({
|
|
305
305
|
schema: "gentle-shell-bridge/api", // identity, so a foreign payload is never mistaken for ours
|
|
306
306
|
version: 1, // the major; a breaking change is a NEW symbol key
|
|
307
|
-
VERSION: "0.3.
|
|
307
|
+
VERSION: "0.3.1", // the publishing release; informational only
|
|
308
308
|
registerRows,
|
|
309
309
|
registerSection,
|
|
310
310
|
registerCardStyle, // since 0.2.0; optional on an older published object
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gentle-shell-bridge",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Shared provider bus for gentle-shell's /gentle:customize settings rows: plugins register rows, the bridge owns the single interception layer.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -10,6 +10,18 @@
|
|
|
10
10
|
"gentle-ai",
|
|
11
11
|
"extension"
|
|
12
12
|
],
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git+https://github.com/jonasotoaguilar/gentle-shell-bridge.git"
|
|
16
|
+
},
|
|
17
|
+
"license": "Apache-2.0",
|
|
18
|
+
"files": [
|
|
19
|
+
"src",
|
|
20
|
+
"docs/contract.md",
|
|
21
|
+
"docs/state.md",
|
|
22
|
+
"docs/architecture.md",
|
|
23
|
+
"README.md"
|
|
24
|
+
],
|
|
13
25
|
"pi": {
|
|
14
26
|
"extensions": [
|
|
15
27
|
"./src/extension.ts"
|
package/src/api.ts
CHANGED
|
@@ -67,7 +67,7 @@ import { createStore } from "./store.ts";
|
|
|
67
67
|
import { registerToolDesign } from "./tool-designs.ts";
|
|
68
68
|
|
|
69
69
|
/** The release that published the object; informational, never the compatibility check. */
|
|
70
|
-
export const VERSION = "0.3.
|
|
70
|
+
export const VERSION = "0.3.1";
|
|
71
71
|
|
|
72
72
|
/** Identity of the object, so a foreign payload at the symbol is never mistaken for ours. */
|
|
73
73
|
export const API_SCHEMA = "gentle-shell-bridge/api";
|
package/.codegraph/.gitignore
DELETED
package/PRD.md
DELETED
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
# PRD — gentle-shell-bridge
|
|
2
|
-
|
|
3
|
-
## Problem
|
|
4
|
-
|
|
5
|
-
gentle-shell renders `/gentle:customize` from an array it builds itself and never exposes:
|
|
6
|
-
the `ctx.ui.custom` factory constructs a `VisualCustomizeView` and returns a six-method
|
|
7
|
-
adapter, so the rows exist only inside closures
|
|
8
|
-
(`extensions/gentle-shell.ts:3550`, `:3554-3561`). Any plugin that wants a settings line
|
|
9
|
-
therefore reaches for the only reachable moment — the factory call — and patches the host
|
|
10
|
-
to get at the rows.
|
|
11
|
-
|
|
12
|
-
That works once. It does not compose. Two independent wrappers each swap
|
|
13
|
-
`Array.prototype.map` around the same factory: the inner wrapper installs its patch last
|
|
14
|
-
and wins the capture, the outer wrapper captures nothing and degrades to a warning. With
|
|
15
|
-
the naive approach only one plugin's rows ever appear, and neither plugin can tell the
|
|
16
|
-
difference until someone looks at the menu. This is the collision the bridge exists to
|
|
17
|
-
remove, and it is observed behaviour, not a hypothesis: the first prototype using
|
|
18
|
-
duck-typing on the returned component silently injected nothing because the view is sealed
|
|
19
|
-
behind the adapter.
|
|
20
|
-
|
|
21
|
-
## Users
|
|
22
|
-
|
|
23
|
-
- **Plugin authors** (loon, and any future gentle-shell plugin) who want a settings row
|
|
24
|
-
without owning an interception layer, a rebind lifecycle, or a conflict policy.
|
|
25
|
-
- **gentle-shell users** who want every installed plugin's settings in the one menu they
|
|
26
|
-
already open, with no plugin silently missing.
|
|
27
|
-
|
|
28
|
-
## Goals
|
|
29
|
-
|
|
30
|
-
1. One interception layer per process, shared by every plugin.
|
|
31
|
-
2. A small, typed contract: publish a provider, get rows; dispose to remove them.
|
|
32
|
-
3. Rows that reflect live state, so the `●` marker never lies.
|
|
33
|
-
4. No silent failure: every absent row has a reportable reason.
|
|
34
|
-
5. One place to repair when gentle-shell's internals change.
|
|
35
|
-
|
|
36
|
-
## Non-goals
|
|
37
|
-
|
|
38
|
-
- Not a theme pack, banner engine or card renderer; it adds rows to existing categories.
|
|
39
|
-
- Not a UI framework: no widgets, layout engine, or rendering of its own.
|
|
40
|
-
- Not a configuration service for gentle-shell; gentle-shell keeps its own files.
|
|
41
|
-
- Not an upstream replacement: if Pi or gentle-shell ships a row-provider hook, the bridge
|
|
42
|
-
should shrink to a thin adapter over it rather than compete.
|
|
43
|
-
|
|
44
|
-
## Requirements
|
|
45
|
-
|
|
46
|
-
| ID | Requirement | Contract | Status |
|
|
47
|
-
| --- | --- | --- | --- |
|
|
48
|
-
| R1 | `registerRows(provider)` accepts providers and returns a disposer that removes exactly that provider's rows. | `registerRows`, provider shape | Implemented; unit tests plus the end-to-end suite |
|
|
49
|
-
| R2 | Providers are evaluated lazily when the menu is built, in subscription order, with a context carrying at least the active theme and the resolved config home. | Provider `rows(ctx)`, ordering | Implemented; `ctx` carries the factory's theme and the resolved config home, tested |
|
|
50
|
-
| R3 | The bridge supports every row kind gentle-shell's renderer understands: `category`, `label`, `choice`, `preview`, `visible`, `keyhint`, `action`. | Row kinds | Implemented as typed pass-through fields; exercised against the fake host, not the real renderer |
|
|
51
|
-
| R4 | A toggle is expressed as consecutive rows sharing `choice.setting`, and works with the renderer's own `●`/`○` and arrow/Enter handling. | Toggle recipe | Implemented; the end-to-end suite shows the `●` moving after `action()` on a fake host |
|
|
52
|
-
| R5 | Arm-time state is idempotent: repeated `session_start`, rebinds and double loads never double-wrap or double-inject. | Idempotency | Implemented; tested across two `session_start` events and a double entry load |
|
|
53
|
-
| R6 | A throwing provider loses its rows, is reported, and never breaks the menu or other providers. | Failure isolation | Implemented; tested per provider, with the failure reported by `/bridge-status` |
|
|
54
|
-
| R7 | A diagnostics command reports providers, active backend, last capture outcome and last failures. | `/bridge-status` | Implemented as `/bridge-status`; formatter and entry tested, including store problems and duplicate settings from the last menu build |
|
|
55
|
-
| R8 | Composition is stateless; persistence is the plugin's, with an optional namespaced store helper. | `createStore`, [docs/state.md](docs/state.md) | Implemented; `createStore` tested against temporary directories. One documented exception: a sidebar section's visibility is bridge-owned (see R12) |
|
|
56
|
-
| R9 | `registerSection(section)` adds a card to gentle-shell's sidebar and returns a disposer that removes it, with no extra step from the plugin. | `registerSection`, section shape | Implemented; end-to-end over the public API against the fake rail, never in a real TUI |
|
|
57
|
-
| R10 | Each registered section automatically contributes two consecutive rows to `Sections` (a readable label derived from its title or an explicit `rowLabel`, plus `shown`/`hidden`), reading and persisting the same value the rail renders; the id stays internal and never appears in a row. | Automatic toggle rows | Implemented; the menu, the persistence file and the next rail frame are asserted together — against the fake host and fake rail — including the label derivation and the collision rule |
|
|
58
|
-
| R11 | A hidden section is neither rendered nor built (`lines()`/`meta()` not called); a throwing section loses only its own body and is reported. | S7 failure isolation | Implemented; pinned with call counters and `/bridge-status` section failures, against the fake host |
|
|
59
|
-
| R12 | Section visibility persists in the bridge's own store, not the host's `visual-customization.json`, which rejects unknown keys. | `bridge-sections.json`, [docs/state.md](docs/state.md) | Implemented; the document shape is asserted byte-for-byte, and the reason for the separate file is recorded |
|
|
60
|
-
| R13 | `registerCardStyle(style)` accepts `{ id, label, frame: { top, line, bottom }, preview?, order? }`, validates id/label/frame before storing, replaces in place on the same id, and returns a disposer that removes exactly that style. | `registerCardStyle`, frame contract | Implemented; validation, ordering, replacement and disposal are unit-tested, and the published-API path is exercised end to end |
|
|
61
|
-
| R14 | A registered style joins the host's own `Card style` line (spliced in place, one coalesced line, the host's values untouched), with a `Bridge → card style` fallback line only when the host's line is not reachable; the selection is bridge-owned state, pressing a host value returns to native rendering, and a disposed style degrades to `native`/`missing`. | `bridge-card-style.json`, [docs/contract.md](docs/contract.md) §12 | Implemented; one bullet at a time, the way back, the fallback line and the missing-selection degrade are pinned against the fake host and reported by `/bridge-status` |
|
|
62
|
-
| R15 | When a registered style is selected, the bridge repaints the conversation frames the host already drew — detection, title/hint extraction, one style at a time, width clipping, and a pass-through for `native`, for a missing selection and for any throw — and reports the frame outcome. | [docs/architecture.md](docs/architecture.md) §14 | Implemented; proven against a fake conversation built from real `shell-card.ts` output, plus the end-to-end suite through the public API. A downstream post-processor can override the frame, which `/bridge-status` states |
|
|
63
|
-
| R16 | `registerTransform(transform)` accepts `{ id, order?, transform(lines, ctx) }`, validates the id and the function before storing, replaces in place on the same id and returns a disposer that removes exactly that transform; the conversation wrapper runs the card-style repaint first and then every transform in order, each receiving the previous output, clipping the result to the host width, isolating a throw or a non-lines return to that transform, and returning the host's own array when nothing changed; `/bridge-status` lists the pipeline in order with the last frame's outcome per transform. | `registerTransform`, [docs/contract.md](docs/contract.md) §13 | Implemented; ordering, replacement, disposal, identity, clipping, throw isolation and the status block are unit-tested, and the worked example's toggle is proven to restyle cards already on screen, with past and new cards byte-identical |
|
|
64
|
-
|
|
65
|
-
Sixteen requirements are implemented and covered by the 367-test `node --test` suite, 26 of them
|
|
66
|
-
end to end through the public API and the real extension entry. What is proven and what is not:
|
|
67
|
-
|
|
68
|
-
- **Proven against a fake host.** The row side drives a fake menu host that models
|
|
69
|
-
`gentle-shell.ts:3550-3562`: injection, ordering, toggles, failure isolation and the
|
|
70
|
-
diagnostics lines.
|
|
71
|
-
- **Proven against a fake conversation.** The card-style side drives a fake transcript built from
|
|
72
|
-
real `gentle-shell/lib/shell-card.ts` output at a fixed width, plus a fake `tui` that models Pi's
|
|
73
|
-
documented tree: detection, repaint, clipping, the pass-through paths, the disposal degrade, the
|
|
74
|
-
host line splice, the fallback line and the generation guard. The transform pipeline drives the
|
|
75
|
-
same conversation through the real wrapper: ordering, identity, clipping, per-transform throw
|
|
76
|
-
isolation and the `/bridge-status` block — plus the worked example's `Bash rendering` toggle, end
|
|
77
|
-
to end, where a card drawn before the switch and one drawn after it come out byte-identical.
|
|
78
|
-
- **Proven against a fake rail.** The sidebar side drives a fake terminal that models
|
|
79
|
-
`lib/shell-sidebar.ts`'s state symbol and `parts` map plus the layout's card frame
|
|
80
|
-
(`lib/shell-sidebar-layout.ts:35-44,392-410`): section cards, ordering, the `Sections` rows,
|
|
81
|
-
the store file, hiding and failure isolation.
|
|
82
|
-
- **Not proven in a running TUI.** Neither surface has been re-run inside a real Pi +
|
|
83
|
-
gentle-shell session through the package. In particular the sidebar's `tui` is acquired
|
|
84
|
-
through `ctx.ui.setWidget`, and whether a widget whose component renders no rows leaves the
|
|
85
|
-
editor area visually untouched is **unconfirmed**. R7's hook branch has never met a host
|
|
86
|
-
that exposes the registry it looks for.
|
|
87
|
-
- The capture technique itself is proven in the real TUI by the reference probe, not by these
|
|
88
|
-
tests.
|
|
89
|
-
- **The card-style repaint has not been seen in a live TUI.** It depends on the host's `float`
|
|
90
|
-
grammar and on Pi's component tree; both are cited, neither is observed at runtime here, and a
|
|
91
|
-
downstream post-processor can erase the frame — reported, not prevented.
|
|
92
|
-
|
|
93
|
-
## Success criteria
|
|
94
|
-
|
|
95
|
-
- Two independent providers coexist in one menu, each with its own rows and no lost
|
|
96
|
-
capture.
|
|
97
|
-
- A toggle persists through `action()`, the menu re-renders, and the `●` moves to the
|
|
98
|
-
applied value.
|
|
99
|
-
- No silent failure: an uncaptured menu, a broken provider or a duplicate `setting` is
|
|
100
|
-
visible in `/bridge-status`.
|
|
101
|
-
- When gentle-shell changes its menu construction, exactly one module needs repair.
|
|
102
|
-
- A plugin can add a card style with one call: the value appears on the host's own `Card style`
|
|
103
|
-
line, selecting it repaints every card the host drew, and selecting a host value or losing the
|
|
104
|
-
plugin returns the conversation to the host's rendering.
|
|
105
|
-
- A plugin can apply a rendering choice to the WHOLE conversation with one call: the choice reaches
|
|
106
|
-
cards drawn before the switch, not only the next one, and the worked example proves that a bash
|
|
107
|
-
card drawn before and one drawn after are byte-identical.
|
|
108
|
-
- The reference probe's observed result reproduces through the package against the fake host
|
|
109
|
-
that models the real call chain: a `Cards` category showing the injected line
|
|
110
|
-
`Card bash ● activity ○ output`. It has not yet been re-run in the real TUI through the
|
|
111
|
-
package.
|
|
112
|
-
|
|
113
|
-
## Risks and open questions
|
|
114
|
-
|
|
115
|
-
- **Upstream hook availability.** If Pi or gentle-shell adds a supported row-provider
|
|
116
|
-
registry, the capture backend becomes dead weight; the contract should stay stable
|
|
117
|
-
across that switch. A hook backend now exists (`src/hook.ts`) and prefers a recognized
|
|
118
|
-
registry over patching, but no host has been observed emitting
|
|
119
|
-
`Symbol.for("gentle-pi.customize-row-providers")` — that branch is implemented and
|
|
120
|
-
unverified.
|
|
121
|
-
- **Namespace policy.** Requiring namespaced `setting` names (`"Loon → Banner source"`)
|
|
122
|
-
avoids accidental merges but depends on authors complying; the bridge can warn on
|
|
123
|
-
duplicates but cannot rename rows without breaking identity.
|
|
124
|
-
- **Whether the store belongs in the package at all.** It is the only piece that writes to
|
|
125
|
-
disk and the only piece a plugin could implement itself. Shipping it is a convenience
|
|
126
|
-
bet, recorded with its alternatives in [docs/state.md](docs/state.md).
|
|
127
|
-
- **Diagnostics spelling.** Settled in code: the command is `/bridge-status`. Pi has no
|
|
128
|
-
built-in `/status`, and gentle-shell's commands live under the `gentle:` prefix, so a bare
|
|
129
|
-
`bridge-status` collides with neither. It has not yet been typed into a real host.
|
|
130
|
-
- **Compatibility drift.** The capture depends on one constructor line and one adapter
|
|
131
|
-
shape; every gentle-shell upgrade is a potential silent break until an upstream hook
|
|
132
|
-
exists. The sidebar surface depends on the same class of internals: the state symbol, the
|
|
133
|
-
`parts` map and the hard-coded rail key order.
|
|
134
|
-
- **The sidebar widget's visual footprint is unconfirmed.** Pi exposes no `tui` getter, so the
|
|
135
|
-
bridge acquires one through `ctx.ui.setWidget` and returns a component that paints nothing.
|
|
136
|
-
Whether that component leaves the editor area untouched has not been observed; if it does
|
|
137
|
-
not, the fix is the widget's rendering, not the contract.
|
|
138
|
-
- **Sections cannot be interleaved with the native cards.** The host builds its status
|
|
139
|
-
sections inside a closure, so "after every native section" is the honest contract; a user
|
|
140
|
-
request to slot a section between `CHANGES` and `STATS` cannot be met without an upstream
|
|
141
|
-
change.
|
|
142
|
-
- **Bridge-owned visibility is new state.** It is one namespaced file the bridge writes; a
|
|
143
|
-
future host that opens `VISUAL_SECTION_KEYS` would make it redundant and it should then be
|
|
144
|
-
migrated rather than duplicated.
|