@quandev104/pi-style 0.1.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.
Files changed (69) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/LICENSE +21 -0
  3. package/README.md +193 -0
  4. package/dist/extensions/pi-style.js +7897 -0
  5. package/dist/extensions/pi-style.js.map +1 -0
  6. package/extension-src/pi-style/app/command-service.ts +244 -0
  7. package/extension-src/pi-style/app/commands.ts +12 -0
  8. package/extension-src/pi-style/app/config-storage.ts +98 -0
  9. package/extension-src/pi-style/app/doctor.ts +53 -0
  10. package/extension-src/pi-style/app/index.ts +322 -0
  11. package/extension-src/pi-style/app/providers.ts +268 -0
  12. package/extension-src/pi-style/app/render-scheduler.ts +48 -0
  13. package/extension-src/pi-style/app/runtime.ts +404 -0
  14. package/extension-src/pi-style/app/snapshot.ts +15 -0
  15. package/extension-src/pi-style/domain/capabilities.ts +34 -0
  16. package/extension-src/pi-style/domain/config-authorization.ts +20 -0
  17. package/extension-src/pi-style/domain/config-diagnostics.ts +20 -0
  18. package/extension-src/pi-style/domain/config-diff.ts +30 -0
  19. package/extension-src/pi-style/domain/config-migrations.ts +52 -0
  20. package/extension-src/pi-style/domain/config-normalization.ts +567 -0
  21. package/extension-src/pi-style/domain/config-presets.ts +51 -0
  22. package/extension-src/pi-style/domain/config-types.ts +115 -0
  23. package/extension-src/pi-style/domain/providers.ts +37 -0
  24. package/extension-src/pi-style/domain/status-presets.ts +60 -0
  25. package/extension-src/pi-style/domain/status-renderer.ts +142 -0
  26. package/extension-src/pi-style/domain/status.ts +430 -0
  27. package/extension-src/pi-style/domain/theme.ts +232 -0
  28. package/extension-src/pi-style/features/.gitkeep +0 -0
  29. package/extension-src/pi-style/features/editor/index.ts +304 -0
  30. package/extension-src/pi-style/features/messages/boxed-block.ts +74 -0
  31. package/extension-src/pi-style/features/messages/index.ts +145 -0
  32. package/extension-src/pi-style/features/messages/special-blocks.ts +281 -0
  33. package/extension-src/pi-style/features/startup/index.ts +564 -0
  34. package/extension-src/pi-style/features/startup/logo.ts +151 -0
  35. package/extension-src/pi-style/features/status-line/index.ts +319 -0
  36. package/extension-src/pi-style/features/tools/boxed/bash.ts +347 -0
  37. package/extension-src/pi-style/features/tools/boxed/edit.ts +113 -0
  38. package/extension-src/pi-style/features/tools/boxed/fallback.ts +67 -0
  39. package/extension-src/pi-style/features/tools/boxed/find.ts +65 -0
  40. package/extension-src/pi-style/features/tools/boxed/grep.ts +108 -0
  41. package/extension-src/pi-style/features/tools/boxed/index.ts +64 -0
  42. package/extension-src/pi-style/features/tools/boxed/ls.ts +65 -0
  43. package/extension-src/pi-style/features/tools/boxed/quick-edit.ts +190 -0
  44. package/extension-src/pi-style/features/tools/boxed/read.ts +204 -0
  45. package/extension-src/pi-style/features/tools/boxed/session-config.ts +45 -0
  46. package/extension-src/pi-style/features/tools/boxed/shared.ts +157 -0
  47. package/extension-src/pi-style/features/tools/boxed/write.ts +89 -0
  48. package/extension-src/pi-style/features/tools/index.ts +480 -0
  49. package/extension-src/pi-style/pi/commands.ts +17 -0
  50. package/extension-src/pi-style/pi/compatibility-coordinator.ts +195 -0
  51. package/extension-src/pi-style/pi/compatibility-probe.ts +645 -0
  52. package/extension-src/pi-style/pi/compatibility-registry.ts +329 -0
  53. package/extension-src/pi-style/pi/config-host.ts +52 -0
  54. package/extension-src/pi-style/pi/config-session.ts +105 -0
  55. package/extension-src/pi-style/pi/index.ts +77 -0
  56. package/extension-src/pi-style/pi/operational-state.ts +29 -0
  57. package/extension-src/pi-style/pi/session-coordinator.ts +187 -0
  58. package/extension-src/pi-style/pi/session-usage.ts +62 -0
  59. package/extension-src/pi-style/pi/startup-resources.ts +70 -0
  60. package/extension-src/pi-style/shared/.gitkeep +0 -0
  61. package/extension-src/pi-style/shared/ansi.ts +386 -0
  62. package/extension-src/pi-style/shared/box.ts +805 -0
  63. package/extension-src/pi-style/shared/disposable-store.ts +28 -0
  64. package/extension-src/pi-style/shared/elapsed.ts +88 -0
  65. package/extension-src/pi-style/shared/render-budget.ts +367 -0
  66. package/extension-src/pi-style/shared/split-diff.ts +692 -0
  67. package/extension-src/pi-style/shared/theme-extras.ts +292 -0
  68. package/package.json +68 -0
  69. package/themes/.gitkeep +0 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,35 @@
1
+ # Changelog
2
+
3
+ ## [0.1.1] - 2026-08-03
4
+
5
+ ### Documentation
6
+
7
+ - Add demo screenshot to README
8
+
9
+ ### Features
10
+
11
+ - Implement phase 1A foundation
12
+ - Implement phase 2 status line foundation
13
+ - Complete phase 2 status line
14
+ - Complete phase 3 styled editor
15
+ - Complete phase 4 startup presentation
16
+ - Complete phase 5 messages and tools
17
+ - Complete phase 6 configuration and composition
18
+ - Boxed tool/message presentation ported from pi-droid-styling
19
+
20
+ ### Miscellaneous Tasks
21
+
22
+ - Complete phase 0 foundation
23
+ - Add CI and release workflows with git-cliff changelog
24
+ - Point changelog repo links at quanpersie2001/pi-style
25
+ - Use npm ci for deterministic installs
26
+ - Use npm install like pi-rules to tolerate cross-platform lockfile gaps
27
+
28
+ ### Styling
29
+
30
+ - More breathing room inside boxed surfaces
31
+
32
+ ### Testing
33
+
34
+ - Close phase 2 status line gaps
35
+
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 quandev104
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,193 @@
1
+ # @quandev104/pi-style
2
+
3
+ [![npm](https://img.shields.io/npm/v/@quandev104/pi-style)](https://www.npmjs.com/package/@quandev104/pi-style)
4
+ [![license](https://img.shields.io/npm/l/@quandev104/pi-style)](LICENSE)
5
+
6
+ > Pi extension for a cohesive, native-layout visual system across the startup view, status line, editor, messages, and tool presentation. Pi keeps ownership of the feed, scrolling, selection, and terminal layout; pi-style installs components into supported surfaces.
7
+
8
+ ---
9
+
10
+ ![pi-style demo](assets/demo.jpeg)
11
+
12
+ ---
13
+
14
+ ## Features
15
+
16
+ - **Status line** — responsive segment layout (model, thinking, path, Git, context, usage, cost, time, extension statuses) through native widgets above or below the editor.
17
+ - **Editor** — compact/boxed/dock `CustomEditor` treatments with prompt glyph, metadata rows, and thinking-level border, preserving Pi keybindings and autocomplete.
18
+ - **Startup** — compact gradient logo header and optional overlay with System & Context / Available Tools panels, rendered from snapshot data collected before mount.
19
+ - **Messages** — user/assistant prefixes, boxed compaction/skill/branch/MCP special blocks, and certified tool call/result selectors with pending/running/error markers.
20
+ - **One visual system** — shared semantic theme, glyph sets (Nerd/Unicode/ASCII), and ANSI-safe rendering across every surface.
21
+
22
+ All certified surfaces are **on by default**. The single OFF switch is:
23
+
24
+ ```json
25
+ { "compatibility": { "allowCorePatches": false } }
26
+ ```
27
+
28
+ ---
29
+
30
+ ## Install
31
+
32
+ ```bash
33
+ pi install npm:@quandev104/pi-style
34
+ ```
35
+
36
+ Run a real TUI session with the extension source (development):
37
+
38
+ ```bash
39
+ pi -e ./extension-src/pi-style/pi/index.ts
40
+ ```
41
+
42
+ ---
43
+
44
+ ## Quick start
45
+
46
+ No configuration is required. The `default` preset enables:
47
+
48
+ - primary status row **below the editor** (`placement: "below"`), secondary row when it has content;
49
+ - `compact` editor with metadata ownership resolved so the status line and editor do not duplicate text;
50
+ - `compact` startup header (gradient logo block only; resource chips are opt-in);
51
+ - certified message prefixes and boxed tool presentation when compatible with the exact Pi version.
52
+
53
+ Override any documented leaf through global/project `piStyle` settings, environment, or session commands. Precedence:
54
+
55
+ ```text
56
+ defaults < global < project < env < session override
57
+ ```
58
+
59
+ Example settings file (`.pi/pi-style` or global config):
60
+
61
+ ```json
62
+ {
63
+ "piStyle": {
64
+ "preset": "full",
65
+ "placement": "above",
66
+ "editor": { "style": "boxed", "frame": "line" },
67
+ "startup": { "mode": "overlay", "showResources": true }
68
+ }
69
+ }
70
+ ```
71
+
72
+ Invalid values never break startup: they fall back safely and appear in `/pi-style doctor` diagnostics.
73
+
74
+ ---
75
+
76
+ ## Presets
77
+
78
+ | Preset | Behavior |
79
+ |---|---|
80
+ | `default` | Balanced status line, compact editor, compact startup, restrained message/tool styling. |
81
+ | `minimal` | Path/Git/context essentials, native-like editor, no startup overlay, low decoration. |
82
+ | `compact` | High information density for medium terminals. |
83
+ | `full` | Broad status data and all compatible visual surfaces. |
84
+ | `ascii` | No Nerd Font assumptions and conservative separators. |
85
+ | `native` | Active Pi theme plus only low-risk status enhancements. |
86
+
87
+ ---
88
+
89
+ ## Configuration
90
+
91
+ The full schema, precedence, persistence, and migration policy live in [`docs/CONFIGURATION.md`](docs/CONFIGURATION.md). Summary:
92
+
93
+ ### Environment variables
94
+
95
+ | Variable | Description |
96
+ |---|---|
97
+ | `PI_STYLE_DISABLED=1` | Disable all surfaces for emergency recovery. |
98
+ | `PI_STYLE_NERD_FONTS=1\|0` | Force glyph mode. |
99
+ | `PI_STYLE_EDITOR=native\|compact\|boxed\|dock` | Temporary editor override. |
100
+ | `PI_STYLE_STATUS=above\|below\|off` | Temporary status placement/state. |
101
+ | `PI_STYLE_OSC11=1\|0` | Force terminal background sync policy. |
102
+ | `PI_STYLE_DEBUG=1` | Enable bounded diagnostics. |
103
+
104
+ ### CLI flags
105
+
106
+ Tier C surfaces are immutable session authorizations, not persisted config:
107
+
108
+ ```bash
109
+ --pi-style-core-patches
110
+ --pi-style-message-user
111
+ --pi-style-message-assistant
112
+ --pi-style-message-special-blocks
113
+ --pi-style-tools
114
+ --pi-style-ascii
115
+ ```
116
+
117
+ ---
118
+
119
+ ## Commands
120
+
121
+ | Command | Description |
122
+ |---|---|
123
+ | `/pi-style` | Show active preset, surfaces, placement, glyph mode, and compatibility summary. |
124
+ | `/pi-style on\|off` | Toggle the package for the current session or selected persistence scope. |
125
+ | `/pi-style preset <name>` | Apply a named preset. |
126
+ | `/pi-style placement above\|below` | Move the primary status row. |
127
+ | `/pi-style editor <style> [frame]` | Select compact, boxed, dock, or native editor. |
128
+ | `/pi-style startup <off\|compact\|overlay>` | Select startup mode. |
129
+ | `/pi-style surface <name> on\|off` | Toggle startup/status/editor/messages/tools. |
130
+ | `/pi-style set <path> <JSON>` | Set one documented leaf after validation, e.g. `set statusLine.layout.left ["model","git"]`. |
131
+ | `/pi-style persist global\|project set <path> <JSON>` | Persist the same validated mutation to the selected durable scope. |
132
+ | `/pi-style reload` | Re-read configuration and reinstall affected surfaces. |
133
+ | `/pi-style doctor` | Show capability/conflict/fallback diagnostics. |
134
+
135
+ Ordinary mutations are session-only; persistence requires an explicit `global` or `project` scope, and project writes require trust.
136
+
137
+ ---
138
+
139
+ ## Compatibility
140
+
141
+ - Public Pi APIs (widgets, editor, header, footer bridge) are preferred and enabled by default.
142
+ - Tier C core patches (message prefixes, special blocks, tool selectors) are certified for exact Pi `0.83.0` within `>=0.83.0 <0.84.0`, isolated, reversible, and version/capability gated; native fallback otherwise.
143
+ - No render-time I/O: filesystem, Git, settings, and session data flow through cached providers into immutable snapshots.
144
+ - Terminal-global background synchronization is unsupported/off for technical v1; explicit cell backgrounds and Pi theme APIs remain supported.
145
+
146
+ ---
147
+
148
+ ## Architecture
149
+
150
+ ```text
151
+ shared → domain → features → app → pi
152
+ ```
153
+
154
+ ```text
155
+ extension-src/pi-style/
156
+ ├── shared/ ANSI/width, box, elapsed, split-diff, render-budget, theme extras
157
+ ├── domain/ config, theme, status presets/renderer, authorization
158
+ ├── features/ status-line, editor, startup, messages, tools
159
+ ├── app/ runtime, snapshot, scheduler, providers, commands, doctor
160
+ └── pi/ Pi event handlers, session coordinator, compatibility probe
161
+ ```
162
+
163
+ Layer boundaries are enforced by dependency-cruiser.
164
+
165
+ ---
166
+
167
+ ## Documentation
168
+
169
+ Start with [`docs/README.md`](docs/README.md), then the product, architecture, and testing contracts. UI surface contracts live under [`docs/ui/`](docs/ui/README.md), and accepted decisions under [`docs/decisions/`](docs/decisions/README.md). The phase-by-phase plan is in [`ROADMAP.md`](ROADMAP.md).
170
+
171
+ ---
172
+
173
+ ## Development
174
+
175
+ ```bash
176
+ npm ci
177
+ npm run typecheck
178
+ npm run lint
179
+ npm run depcruise
180
+ npm test
181
+ npm run build
182
+ npm run check
183
+ ```
184
+
185
+ `npm run check` runs all required automated gates in order.
186
+
187
+ Current test suite: 195 tests across 18 files.
188
+
189
+ ---
190
+
191
+ ## License
192
+
193
+ [MIT](LICENSE)