pi-one-ui 0.3.1 → 0.5.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/CHANGELOG.md +45 -1
- package/README.en.md +33 -28
- package/README.md +11 -5
- package/extensions/app/commands/settings-previews.ts +23 -56
- package/extensions/app/config/shell.ts +26 -187
- package/extensions/app/panel.ts +42 -24
- package/extensions/app/presets.ts +2 -2
- package/extensions/app/runtime/tui-runtime.ts +1 -26
- package/extensions/layouts/context/renderer/index.ts +15 -0
- package/extensions/layouts/context/renderer/tool/toggle-render-cache.ts +333 -0
- package/extensions/layouts/editor/controller.ts +16 -62
- package/extensions/layouts/editor/factory.ts +2 -20
- package/extensions/layouts/editor/index.ts +0 -6
- package/extensions/layouts/editor/minimalist-editor.ts +11 -57
- package/extensions/layouts/editor/ui.ts +60 -605
- package/extensions/layouts/footer/footer.ts +7 -3
- package/extensions/layouts/working-line/interaction-summary.ts +47 -7
- package/extensions/layouts/working-line/working-line.ts +24 -3
- package/extensions/shared/icons.ts +0 -4
- package/extensions/shared/style.ts +48 -0
- package/extensions/tools/patch-keys.ts +5 -0
- package/package.json +2 -3
- package/themes/cc-dark.json +4 -1
- package/themes/cc-light.json +4 -1
- package/extensions/layouts/editor/accent-rail-editor.ts +0 -112
- package/extensions/layouts/editor/accent-rail-layout-patch.ts +0 -530
- package/extensions/layouts/editor/completion-menu.ts +0 -183
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,48 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.5.0] - 2026-09-05
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
- Reduced the Editor to the single `minimalist` style with an `on`/`off` switch: `off` restores Pi's native editor, and the retired `opencode` style is removed (`enabled` merges into `style`, legacy values migrate automatically).
|
|
14
|
+
- Added `/oneui` panel settings for the Editor component: style (`on`/`off`), color source (`theme`/`terminal`), and border color mode (`static`/`adaptive`), each with an inline description.
|
|
15
|
+
- In `off` mode, an explicitly configured `colors.editorBorder` is applied to the native editor border through `colorSource` (theme tokens or fixed terminal colors); without it the native effort/theme coloring is preserved.
|
|
16
|
+
|
|
17
|
+
### Performance
|
|
18
|
+
|
|
19
|
+
- Cached `ToolExecutionComponent` render widgets across expand/collapse toggles: repeated Ctrl+O toggles and identical result updates now skip the full native rebuild, cutting batch expansion of many tools (e.g. 30 × 1000-line outputs) from ~130ms to under 0.2ms while keeping expanded and collapsed render slots independent.
|
|
20
|
+
|
|
21
|
+
### Removed
|
|
22
|
+
|
|
23
|
+
- Removed the `opencode` Editor style along with its polished renderer, completion-menu module, and `styles.opencode` configuration; the `enabled` field is gone.
|
|
24
|
+
|
|
25
|
+
### Migration
|
|
26
|
+
|
|
27
|
+
- `components.editor.enabled: false` becomes `components.editor.style: "off"`; `style: "opencode"`/`"minimalist"` become `"on"`. The `styles.opencode` block and `opencode-copy-friendly`/`accent-rail` selections are ignored.
|
|
28
|
+
|
|
29
|
+
### Fixed
|
|
30
|
+
|
|
31
|
+
- Toggling the Editor style between `on`/`off` no longer replaces the editor factory: the existing instance (and Pi's overlay focus target) stays valid, so the `/oneui` panel restores keyboard focus to the input editor after closing.
|
|
32
|
+
- Unconfigured `cwd`, model-label, and static border colors now prefer the theme's `cwd`/`editorModel`/`editorBorder` tokens (which may reference `vars` variables or hex), falling back to Pi's native defaults when the theme does not define them.
|
|
33
|
+
|
|
34
|
+
## [0.4.0] - 2026-09-03
|
|
35
|
+
|
|
36
|
+
### Changed
|
|
37
|
+
|
|
38
|
+
- Simplified Editor styling to the `opencode` and `minimalist` options; removed Minimalist context-usage metadata in favor of Footer's more complete context configuration.
|
|
39
|
+
- Added response-local live output throughput to the WorkingLine token segment after a bounded sampling window.
|
|
40
|
+
|
|
41
|
+
### Removed
|
|
42
|
+
|
|
43
|
+
- Removed the `opencode-copy-friendly` and `accent-rail` Editor styles, including Accent Rail layout patching and style-specific settings.
|
|
44
|
+
- Removed the inherited upstream image from pi-one-ui's package-gallery metadata.
|
|
45
|
+
|
|
46
|
+
### Migration
|
|
47
|
+
|
|
48
|
+
- Existing `opencode-copy-friendly` or `accent-rail` selections fall back to `opencode`; remove obsolete nested settings for those styles when convenient.
|
|
49
|
+
- Configure context percentage, token totals, thresholds, and gauges through Footer instead of Minimalist Editor settings.
|
|
50
|
+
|
|
9
51
|
## [0.3.1] - 2026-08-31
|
|
10
52
|
|
|
11
53
|
### Changed
|
|
@@ -45,7 +87,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
|
45
87
|
|
|
46
88
|
- Reduced rendering lag when expanding settled tool groups by reusing cached child output.
|
|
47
89
|
|
|
48
|
-
[Unreleased]: https://github.com/kerolt/pi-one-ui/compare/v0.
|
|
90
|
+
[Unreleased]: https://github.com/kerolt/pi-one-ui/compare/v0.5.0...HEAD
|
|
91
|
+
[0.5.0]: https://github.com/kerolt/pi-one-ui/compare/v0.4.0...v0.5.0
|
|
92
|
+
[0.4.0]: https://github.com/kerolt/pi-one-ui/compare/v0.3.1...v0.4.0
|
|
49
93
|
[0.3.1]: https://github.com/kerolt/pi-one-ui/compare/v0.3.0...v0.3.1
|
|
50
94
|
[0.3.0]: https://github.com/kerolt/pi-one-ui/compare/v0.2.2...v0.3.0
|
|
51
95
|
[0.2.2]: https://github.com/kerolt/pi-one-ui/compare/v0.2.1...v0.2.2
|
package/README.en.md
CHANGED
|
@@ -25,24 +25,24 @@ Header → Context → WorkingLine → Editor → Footer
|
|
|
25
25
|
|
|
26
26
|
- **Header**: startup information, logo, and shortcut hints.
|
|
27
27
|
- **Context**: the conversation area, including user messages, assistant messages, thinking, tools, diffs, Markdown, and summaries.
|
|
28
|
-
- **WorkingLine**: working state, spinner, token/thought/elapsed information, and turn summaries.
|
|
29
|
-
- **Editor**: input editor, completion, metadata,
|
|
28
|
+
- **WorkingLine**: working state, spinner, token/thought/elapsed information, live output rate, and turn summaries.
|
|
29
|
+
- **Editor**: input editor, completion, metadata, and the Minimalist style (Pi native is one toggle away).
|
|
30
30
|
- **Footer**: current directory, Git, runtime, token, cost, and extension status information.
|
|
31
31
|
- **Overlay**: temporary interfaces such as the settings panel and Context Inspector, managed by a shared OverlayManager.
|
|
32
32
|
|
|
33
33
|
### Built-in functionality
|
|
34
34
|
|
|
35
|
-
| Feature
|
|
36
|
-
|
|
|
37
|
-
| Unified settings panel | Organizes settings by Header, Context, WorkingLine, Editor, Footer, and Features
|
|
38
|
-
| Context Inspector
|
|
39
|
-
| Session reference
|
|
40
|
-
| Subagent autocomplete
|
|
41
|
-
| Tool / Diff renderer
|
|
42
|
-
| Subagent live renderer | Preserves pi-subagents' dedicated progress cards and keeps them out of generic tool groups
|
|
43
|
-
| Markdown enhancement
|
|
44
|
-
| Built-in themes
|
|
45
|
-
| Compatibility aliases
|
|
35
|
+
| Feature | Description | Entry point |
|
|
36
|
+
| ---------------------- | ------------------------------------------------------------------------------------------- | ----------------- |
|
|
37
|
+
| Unified settings panel | Organizes settings by Header, Context, WorkingLine, Editor, Footer, and Features | `/oneui` |
|
|
38
|
+
| Context Inspector | Shows context usage and previews the system prompt, memory, skills, tools, and messages | `/context` |
|
|
39
|
+
| Session reference | Searches previous Pi sessions or SubAgents and injects their useful context | `@` completion |
|
|
40
|
+
| Subagent autocomplete | Completes SubAgent names and delegation hints | `@` completion |
|
|
41
|
+
| Tool / Diff renderer | Provides unified rendering for tool calls, results, collapsed content, and Edit/Write diffs | Automatic |
|
|
42
|
+
| Subagent live renderer | Preserves pi-subagents' dedicated progress cards and keeps them out of generic tool groups | Automatic |
|
|
43
|
+
| Markdown enhancement | Adds Mermaid, admonitions, URL linking, and related rendering improvements | Automatic |
|
|
44
|
+
| Built-in themes | Provides CC Dark and CC Light themes | `/theme` |
|
|
45
|
+
| Compatibility aliases | Optionally provides common command aliases | `/clear`, `/exit` |
|
|
46
46
|
|
|
47
47
|
## Quick start
|
|
48
48
|
|
|
@@ -90,8 +90,9 @@ Using the `/oneui` settings panel is recommended. The panel uses a top-centered
|
|
|
90
90
|
"version": 1,
|
|
91
91
|
"components": {
|
|
92
92
|
"editor": {
|
|
93
|
-
"
|
|
94
|
-
"
|
|
93
|
+
"style": "on",
|
|
94
|
+
"colorSource": "theme",
|
|
95
|
+
"borderColorMode": "static"
|
|
95
96
|
},
|
|
96
97
|
"userMessages": {
|
|
97
98
|
"enabled": true,
|
|
@@ -111,6 +112,10 @@ Using the `/oneui` settings panel is recommended. The panel uses a top-centered
|
|
|
111
112
|
}
|
|
112
113
|
```
|
|
113
114
|
|
|
115
|
+
The Editor keeps a single `minimalist` decoration style controlled by `style`: `on` enables the Minimalist decoration, `off` restores Pi's native editor (the border follows the theme and effort coloring by default; when `colors.editorBorder` is explicitly configured, the off mode applies that color through `colorSource`, overriding the native effort coloring). Legacy configurations migrate automatically: `enabled: false` becomes `style: "off"`, and `opencode`/`minimalist` become `style: "on"`; the `styles.opencode` block and the retired `opencode-copy-friendly`/`accent-rail` styles are ignored. `borderColorMode` supports `static` (fixed `colors.editorBorder`) and `adaptive` (border shifts with the effort level); `colorSource` supports `theme` (colors resolved through the active Pi theme tokens) and `terminal` (fixed terminal colors). When `cwd`, the model label, or the static border are not explicitly configured, the theme's `cwd`/`editorModel`/`editorBorder` tokens are used first (they may point to `vars` variables or hex values), falling back to Pi's native defaults when the theme does not define them; the terminal source falls back to Pi's native colors as well when unconfigured (only an explicit terminal color name or hex is rendered fixed). Context-usage information is presented by Footer.
|
|
116
|
+
|
|
117
|
+
The WorkingLine token segment appends live output throughput, such as `⚡12 tok/s`, after a model response has run for at least 500ms. Throughput is calculated independently for the current response and resets on the next `turn_start`; disabling the token segment hides it as well.
|
|
118
|
+
|
|
114
119
|
Available layout and renderer options may change between versions, so prefer configuring them through `/oneui`.
|
|
115
120
|
|
|
116
121
|
### Canonical configuration policy
|
|
@@ -127,9 +132,9 @@ It does not automatically read, merge, or migrate historical configuration files
|
|
|
127
132
|
|
|
128
133
|
`pi-one-ui` originally combined source from the following open-source projects. Many thanks to their maintainers and contributors for providing the initial foundation.
|
|
129
134
|
|
|
130
|
-
| Upstream project
|
|
131
|
-
|
|
|
132
|
-
| [pi-zentui](https://github.com/lmilojevicc/pi-zentui)
|
|
135
|
+
| Upstream project | Capabilities incorporated into `pi-one-ui` | Reference baseline |
|
|
136
|
+
| --------------------------------------------------------------- | ------------------------------------------------------------------------------------------ | ------------------------- |
|
|
137
|
+
| [pi-zentui](https://github.com/lmilojevicc/pi-zentui) | Starship-style Footer, Opencode-style Editor, layouts, and shell capabilities | v0.21.0, commit `5341b38` |
|
|
133
138
|
| [pi-cc-extensions](https://github.com/minuque/pi-cc-extensions) | Claude Code-style Context renderer, Tool/Diff rendering, Context Inspector, and references | v0.8.67, commit `dba37e5` |
|
|
134
139
|
|
|
135
140
|
Production code lives in `extensions/`. The project has since unified its entry point, configuration storage, lifecycle, layout ownership, overlays, and input routing. The current implementation is no longer equivalent to either upstream project and does not automatically track upstream changes.
|
|
@@ -178,16 +183,16 @@ After changing the source, run the following command in Pi:
|
|
|
178
183
|
|
|
179
184
|
### Development commands
|
|
180
185
|
|
|
181
|
-
| Command
|
|
182
|
-
|
|
|
183
|
-
| `npm install`
|
|
184
|
-
| `npm run format`
|
|
185
|
-
| `npm run check`
|
|
186
|
-
| `npm run fix`
|
|
187
|
-
| `npm run typecheck`
|
|
188
|
-
| `npm test`
|
|
189
|
-
| `npm run pack:check` | Preview the npm package contents
|
|
190
|
-
| `npm run verify`
|
|
186
|
+
| Command | Purpose |
|
|
187
|
+
| -------------------- | ---------------------------------------------- |
|
|
188
|
+
| `npm install` | Install dependencies |
|
|
189
|
+
| `npm run format` | Format source, tests, and configuration files |
|
|
190
|
+
| `npm run check` | Check formatting and import organization |
|
|
191
|
+
| `npm run fix` | Fix formatting and organize imports |
|
|
192
|
+
| `npm run typecheck` | Run TypeScript type checking |
|
|
193
|
+
| `npm test` | Run all tests with Vitest |
|
|
194
|
+
| `npm run pack:check` | Preview the npm package contents |
|
|
195
|
+
| `npm run verify` | Run Biome checks, type checking, and all tests |
|
|
191
196
|
|
|
192
197
|
Before submitting changes, run at least:
|
|
193
198
|
|
package/README.md
CHANGED
|
@@ -25,8 +25,8 @@ Header → Context → WorkingLine → Editor → Footer
|
|
|
25
25
|
|
|
26
26
|
- **Header**:启动信息、Logo 和快捷键提示。
|
|
27
27
|
- **Context**:对话内容区,包含用户消息、Assistant 消息、Thinking、Tool、Diff、Markdown 和 Summary。
|
|
28
|
-
- **WorkingLine**:工作状态、spinner、token/thought/elapsed
|
|
29
|
-
- **Editor**:输入编辑器、completion、metadata
|
|
28
|
+
- **WorkingLine**:工作状态、spinner、token/thought/elapsed、实时输出速率和回合摘要。
|
|
29
|
+
- **Editor**:输入编辑器、completion、metadata,以及 Minimalist 样式(可切换 Pi 原生)。
|
|
30
30
|
- **Footer**:目录、Git、runtime、token、cost 和扩展状态等信息。
|
|
31
31
|
- **Overlay**:设置面板、Context Inspector 等临时浮层由统一的 OverlayManager 管理。
|
|
32
32
|
|
|
@@ -83,15 +83,17 @@ pi install git:github.com/kerolt/pi-one-ui
|
|
|
83
83
|
~/.pi/agent/pi-one-ui.json
|
|
84
84
|
```
|
|
85
85
|
|
|
86
|
-
|
|
86
|
+
|
|
87
|
+
推荐通过 `/oneui` 设置面板修改配置。面板采用更靠近顶部的居中布局;切换 Editor 开关、颜色源或边框模式时会保持打开并在 Editor 替换后恢复焦点,持久化失败时则恢复列表中的有效旧值。当前配置仍使用 v1 结构,例如:
|
|
87
88
|
|
|
88
89
|
```json
|
|
89
90
|
{
|
|
90
91
|
"version": 1,
|
|
91
92
|
"components": {
|
|
92
93
|
"editor": {
|
|
93
|
-
"
|
|
94
|
-
"
|
|
94
|
+
"style": "on",
|
|
95
|
+
"colorSource": "theme",
|
|
96
|
+
"borderColorMode": "static"
|
|
95
97
|
},
|
|
96
98
|
"userMessages": {
|
|
97
99
|
"enabled": true,
|
|
@@ -111,6 +113,10 @@ pi install git:github.com/kerolt/pi-one-ui
|
|
|
111
113
|
}
|
|
112
114
|
```
|
|
113
115
|
|
|
116
|
+
Editor 只保留 `minimalist` 一种装饰样式,通过 `style` 开关控制:`on` 启用 Minimalist 装饰,`off` 恢复 Pi 原生编辑器(边框默认跟随主题与 effort 变色;若显式配置了 `colors.editorBorder`,off 模式下也会按 `colorSource` 应用该颜色,覆盖原生 effort 变色)。旧配置的 `enabled: false` 会迁移为 `style: "off"`,`opencode`/`minimalist` 会迁移为 `style: "on"`,`styles.opencode` 嵌套配置与 `opencode-copy-friendly`、`accent-rail` 一并失效。`borderColorMode` 支持 `static`(固定 `colors.editorBorder`)与 `adaptive`(边框随 effort 档位变化);`colorSource` 支持 `theme`(颜色取当前主题 token)与 `terminal`(固定终端色)。cwd、模型名与边框(static)未显式配置时优先使用主题的 `cwd`/`editorModel`/`editorBorder` token(可指向 vars 变量或 hex),主题未定义则回落 Pi 原生默认;terminal 源未配置时同样回落 Pi 原生颜色(配置了终端色名/hex 才固定渲染)。上下文占用相关信息由 Footer 统一展示。
|
|
117
|
+
|
|
118
|
+
WorkingLine 的 token segment 会在一次模型响应持续至少 500ms 后追加实时输出速率,例如 `⚡12 tok/s`。速率按当前响应独立计算,在下一次 `turn_start` 时重置;关闭 token segment 时也会一并隐藏。
|
|
119
|
+
|
|
114
120
|
不同布局和渲染器的可用选项会随版本变化,建议优先使用 `/oneui` 面板进行配置。
|
|
115
121
|
|
|
116
122
|
### Canonical 配置约定
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import type { Theme } from "@earendil-works/pi-coding-agent";
|
|
2
2
|
import { truncateToWidth, visibleWidth } from "@earendil-works/pi-tui";
|
|
3
3
|
import { renderUserMessageStyle } from "../../layouts/context/message/user-message-styles.ts";
|
|
4
|
-
import { renderAccentRailEditorFrame } from "../../layouts/editor/accent-rail-editor.ts";
|
|
5
4
|
import { sanitizeEditorMetadataText } from "../../layouts/editor/editor-metadata-format.ts";
|
|
6
5
|
import { renderMinimalistFrame } from "../../layouts/editor/minimalist-editor.ts";
|
|
7
|
-
import { renderPolishedEditorFrame } from "../../layouts/editor/ui.ts";
|
|
8
6
|
import { safeThemeFg } from "../../shared/style.ts";
|
|
9
7
|
import type { PolishedTuiConfig } from "../config/shell.ts";
|
|
10
8
|
|
|
@@ -60,61 +58,30 @@ export function renderEditorSettingsPreview(
|
|
|
60
58
|
const viewport = editor.viewportIndicators
|
|
61
59
|
? { above: "2", below: "3" }
|
|
62
60
|
: undefined;
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
inputText: EDITOR_PREVIEW_INPUT,
|
|
79
|
-
metadata: {
|
|
80
|
-
cwd: "/workspace/zentui/src",
|
|
81
|
-
projectRoot: "/workspace/zentui",
|
|
82
|
-
branch: "feat/settings-previews",
|
|
83
|
-
dirty: true,
|
|
84
|
-
ahead: 2,
|
|
85
|
-
behind: 1,
|
|
86
|
-
costLabel: "$.12",
|
|
87
|
-
modelLabel,
|
|
88
|
-
thinkingLevel: "high",
|
|
89
|
-
contextPercent: 75,
|
|
90
|
-
contextWindow: 372_000,
|
|
91
|
-
sessionName: "Preview",
|
|
92
|
-
agentDurationMs: 12_000,
|
|
93
|
-
agentActive: true,
|
|
94
|
-
},
|
|
95
|
-
uiTheme: theme,
|
|
96
|
-
config: safeConfig,
|
|
97
|
-
borderColor,
|
|
98
|
-
});
|
|
99
|
-
} else {
|
|
100
|
-
frame = renderPolishedEditorFrame({
|
|
101
|
-
width: previewWidth,
|
|
102
|
-
editorLines,
|
|
103
|
-
autocompleteLines,
|
|
104
|
-
viewport,
|
|
105
|
-
uiTheme: theme,
|
|
106
|
-
config: safeConfig,
|
|
107
|
-
modelMeta: {
|
|
108
|
-
modelLabel,
|
|
109
|
-
modelId: "sonnet-4",
|
|
110
|
-
modelName: "Sonnet 4",
|
|
111
|
-
providerLabel: "Anthropic",
|
|
112
|
-
sessionName: "Preview",
|
|
113
|
-
},
|
|
61
|
+
const frame = renderMinimalistFrame({
|
|
62
|
+
width: previewWidth,
|
|
63
|
+
editorLines,
|
|
64
|
+
autocompleteLines,
|
|
65
|
+
viewport,
|
|
66
|
+
inputText: EDITOR_PREVIEW_INPUT,
|
|
67
|
+
metadata: {
|
|
68
|
+
cwd: "/workspace/zentui/src",
|
|
69
|
+
projectRoot: "/workspace/zentui",
|
|
70
|
+
branch: "feat/settings-previews",
|
|
71
|
+
dirty: true,
|
|
72
|
+
ahead: 2,
|
|
73
|
+
behind: 1,
|
|
74
|
+
costLabel: "$.12",
|
|
75
|
+
modelLabel,
|
|
114
76
|
thinkingLevel: "high",
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
77
|
+
sessionName: "Preview",
|
|
78
|
+
agentDurationMs: 12_000,
|
|
79
|
+
agentActive: true,
|
|
80
|
+
},
|
|
81
|
+
uiTheme: theme,
|
|
82
|
+
config: safeConfig,
|
|
83
|
+
borderColor,
|
|
84
|
+
});
|
|
118
85
|
return boundedRows(frame, previewWidth);
|
|
119
86
|
}
|
|
120
87
|
|