mu-agent 0.1.3 → 0.1.6
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 +66 -0
- package/README.md +7 -3
- package/dist/bundle/chunks/anthropic-messages-VMESUHQ7.js +6 -0
- package/dist/bundle/chunks/azure-openai-responses-K232MQFF.js +2 -0
- package/dist/bundle/chunks/bedrock-converse-stream.js +2 -2
- package/dist/bundle/chunks/chunk-2X3AO33C.js +2 -0
- package/dist/bundle/chunks/{chunk-FUXEF6JQ.js → chunk-4O2SCVYF.js} +1 -1
- package/dist/bundle/chunks/chunk-E3TC4YNV.js +2 -0
- package/dist/bundle/chunks/chunk-FU4XQUSL.js +11 -0
- package/dist/bundle/chunks/{chunk-S7SZN6Z3.js → chunk-GNYZK6XN.js} +1 -1
- package/dist/bundle/chunks/chunk-MVPXOVOJ.js +2 -0
- package/dist/bundle/chunks/{chunk-AIR4ZKSM.js → chunk-TUBB3BLE.js} +71 -64
- package/dist/bundle/chunks/chunk-UTB4DTYQ.js +2 -0
- package/dist/bundle/chunks/{chunk-WIUZI2CJ.js → chunk-V7IXECST.js} +2 -2
- package/dist/bundle/chunks/cloudflare-workers-ai-system-one-NR2TDCXU.js +2 -0
- package/dist/bundle/chunks/github-copilot.js +1 -1
- package/dist/bundle/chunks/google-generative-ai-C44KRRZ4.js +2 -0
- package/dist/bundle/chunks/google-vertex-25DUXPTJ.js +2 -0
- package/dist/bundle/chunks/meta.js +2 -0
- package/dist/bundle/chunks/mistral-conversations-6IHQOR4R.js +5 -0
- package/dist/bundle/chunks/{openai-codex-responses-QDSOTBBO.js → openai-codex-responses-3UAYOSSR.js} +2 -2
- package/dist/bundle/chunks/{openai-completions-KQPOPEVM.js → openai-completions-FIEQGWAH.js} +3 -3
- package/dist/bundle/chunks/openai-responses-OZJXLHFC.js +2 -0
- package/dist/bundle/chunks/{openrouter-images-N4XVVFSD.js → openrouter-images-JVEJN44Q.js} +1 -1
- package/dist/bundle/chunks/{pi-messages-GFKBWJHZ.js → pi-messages-TM5SOOIW.js} +2 -2
- package/dist/bundle/chunks/typesafe-system-one-VKYX4OGY.js +2 -0
- package/dist/bundle/chunks/{virtual-modules-I4HUN7PP.js → virtual-modules-IOLJJ5KK.js} +1 -1
- package/dist/bundle/cli-runtime.js +3 -0
- package/dist/bundle/cli.js +4 -2
- package/dist/bundle/index.js +1 -1
- package/dist/bundle/rpc-entry.js +1 -1
- package/dist/core/export-html/template.css +10 -0
- package/dist/core/export-html/template.js +56 -18
- package/dist/modes/interactive/theme/theme-controller.d.ts +6 -0
- package/dist/modes/interactive/theme/theme-controller.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme-controller.js +41 -3
- package/dist/modes/interactive/theme/theme-controller.js.map +1 -1
- package/dist/modes/interactive/theme/theme-json.d.ts +1 -0
- package/dist/modes/interactive/theme/theme-json.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme-json.js +3 -1
- package/dist/modes/interactive/theme/theme-json.js.map +1 -1
- package/dist/modes/interactive/theme/theme-schema.json +7 -2
- package/dist/modes/interactive/theme/theme.d.ts +40 -7
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +122 -214
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/docs/cli-integration.md +106 -0
- package/docs/cli.md +268 -0
- package/docs/compaction.md +45 -26
- package/docs/configuration.md +45 -0
- package/docs/containerization.md +109 -82
- package/docs/custom-provider.md +109 -722
- package/docs/docs.json +139 -99
- package/docs/environment-variables.md +3 -5
- package/docs/extensions.md +137 -2953
- package/docs/how-pi-works.md +49 -0
- package/docs/images/interactive-mode.png +0 -0
- package/docs/index.md +24 -69
- package/docs/json.md +193 -65
- package/docs/keybindings.md +57 -102
- package/docs/llama-cpp.md +3 -3
- package/docs/message-types.md +261 -0
- package/docs/models.md +64 -546
- package/docs/packages.md +67 -166
- package/docs/prompt-templates.md +31 -68
- package/docs/providers.md +102 -232
- package/docs/quickstart.md +61 -106
- package/docs/rpc-commands.md +854 -0
- package/docs/rpc-extension-ui.md +200 -0
- package/docs/rpc.md +129 -1556
- package/docs/sdk.md +76 -1160
- package/docs/security.md +70 -32
- package/docs/session-format.md +25 -216
- package/docs/sessions.md +35 -141
- package/docs/settings.md +109 -387
- package/docs/shell-aliases.md +85 -5
- package/docs/skills.md +51 -190
- package/docs/slash-commands.md +60 -0
- package/docs/terminal-setup.md +105 -78
- package/docs/termux.md +74 -83
- package/docs/themes.md +71 -279
- package/docs/tmux.md +31 -39
- package/docs/tui.md +74 -910
- package/docs/usage.md +54 -272
- package/docs/windows.md +43 -17
- package/examples/README.md +13 -2
- package/examples/extensions/README.md +1 -0
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/debug-provider.ts +90 -0
- package/examples/extensions/gondolin/package-lock.json +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/examples/plugins/pi-example-plugin/src/session.ts +3 -2
- package/examples/rpc-client.ts +35 -0
- package/examples/rpc-extension-ui.ts +25 -5
- package/examples/sdk/README.md +1 -1
- package/judge/dist/auth.js +166 -28
- package/judge/dist/chrome.js +12 -1
- package/judge/dist/kyrn-judge.js +2144 -968
- package/judge/dist/setup.js +2051 -0
- package/judge/manifest.json +117 -13
- package/judge/skills/mu-browser/SKILL.md +1 -0
- package/kyrn/bin/kyrn-doctor +107 -18
- package/kyrn/bin/mu.mjs +296 -19
- package/package.json +4 -4
- package/dist/bundle/chunks/anthropic-messages-MYU5ZMRF.js +0 -6
- package/dist/bundle/chunks/azure-openai-responses-HUSQ3GP2.js +0 -2
- package/dist/bundle/chunks/chunk-6R7UI4IY.js +0 -2
- package/dist/bundle/chunks/chunk-RCZIEVGO.js +0 -11
- package/dist/bundle/chunks/chunk-WSSPR443.js +0 -2
- package/dist/bundle/chunks/google-generative-ai-IMS5EK2Y.js +0 -2
- package/dist/bundle/chunks/google-vertex-O4YJEQUW.js +0 -2
- package/dist/bundle/chunks/mistral-conversations-NOSQHBEY.js +0 -5
- package/dist/bundle/chunks/openai-responses-HWEUZ6WZ.js +0 -2
- package/docs/development.md +0 -90
package/docs/themes.md
CHANGED
|
@@ -1,322 +1,114 @@
|
|
|
1
|
-
|
|
1
|
+
# Customize Pi with themes
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Themes control the colors Pi uses in interactive mode and HTML exports. Pi includes `dark` and `light` themes. You can select one theme, follow your terminal's light or dark appearance, or create your own palette.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
<a id="selecting-a-theme"></a>
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Choose a theme
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
- [Selecting a Theme](#selecting-a-theme)
|
|
11
|
-
- [Creating a Custom Theme](#creating-a-custom-theme)
|
|
12
|
-
- [Theme Format](#theme-format)
|
|
13
|
-
- [Color Tokens](#color-tokens)
|
|
14
|
-
- [Color Values](#color-values)
|
|
15
|
-
- [Tips](#tips)
|
|
9
|
+
Open `/settings` and select **Theme**. You can use one theme for every terminal appearance or choose separate themes for light and dark terminals.
|
|
16
10
|
|
|
17
|
-
|
|
11
|
+
The selection is saved as the `theme` [setting](settings.md#terminal-and-display):
|
|
18
12
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
- Packages: `themes/` directories or `pi.themes` entries in `package.json`
|
|
25
|
-
- Settings: `themes` array with files or directories
|
|
26
|
-
- CLI: `--theme <path>` (repeatable)
|
|
27
|
-
|
|
28
|
-
Disable discovery with `--no-themes`.
|
|
29
|
-
|
|
30
|
-
## Selecting a Theme
|
|
13
|
+
```json
|
|
14
|
+
{
|
|
15
|
+
"theme": "dark"
|
|
16
|
+
}
|
|
17
|
+
```
|
|
31
18
|
|
|
32
|
-
|
|
19
|
+
Automatic mode stores the light theme first and the dark theme second:
|
|
33
20
|
|
|
34
21
|
```json
|
|
35
22
|
{
|
|
36
|
-
"theme": "
|
|
23
|
+
"theme": "light/dark"
|
|
37
24
|
}
|
|
38
25
|
```
|
|
39
26
|
|
|
40
|
-
|
|
27
|
+
When automatic mode is active, Pi changes themes when the terminal reports an appearance change. Theme names cannot contain `/` because Pi reserves it for this setting format.
|
|
41
28
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
Start an interactive run with a theme without changing the saved setting:
|
|
29
|
+
Use `--use-theme` to choose the initial theme for one invocation without changing the saved setting:
|
|
45
30
|
|
|
46
31
|
```bash
|
|
47
32
|
pi --use-theme light
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
To follow terminal appearance, use `lightTheme/darkTheme` syntax:
|
|
51
|
-
|
|
52
|
-
```bash
|
|
53
33
|
pi --use-theme light/dark
|
|
54
34
|
```
|
|
55
35
|
|
|
56
|
-
|
|
57
|
-
and saves it normally.
|
|
36
|
+
See [CLI resources](cli.md#resources) for the command-line option.
|
|
58
37
|
|
|
59
|
-
##
|
|
38
|
+
## Create a custom theme
|
|
60
39
|
|
|
61
|
-
|
|
40
|
+
Copy one of the [built-in themes](https://github.com/earendil-works/pi/tree/main/packages/coding-agent/src/modes/interactive/theme) or create a new JSON file conforming to the [schema](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json).
|
|
62
41
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
42
|
+
1. Save the file as `<agent-dir>/themes/my-theme.json`. The agent directory defaults to `~/.pi/agent`.
|
|
43
|
+
2. Set its `name` to `my-theme`.
|
|
44
|
+
3. Change values in `vars` and `colors`.
|
|
45
|
+
4. Select `my-theme` through `/settings`.
|
|
67
46
|
|
|
68
|
-
|
|
47
|
+
Use the theme name as the filename. Pi hot-reloads the active user theme only from `<agent-dir>/themes/<name>.json`. Run `/reload` after adding or changing a theme from any other source.
|
|
69
48
|
|
|
70
|
-
|
|
71
|
-
{
|
|
72
|
-
"$schema": "https://raw.githubusercontent.com/earendil-works/pi/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json",
|
|
73
|
-
"name": "my-theme",
|
|
74
|
-
"vars": {
|
|
75
|
-
"primary": "#00aaff",
|
|
76
|
-
"secondary": 242
|
|
77
|
-
},
|
|
78
|
-
"colors": {
|
|
79
|
-
"accent": "primary",
|
|
80
|
-
"border": "primary",
|
|
81
|
-
"borderAccent": "#00ffff",
|
|
82
|
-
"borderMuted": "secondary",
|
|
83
|
-
"success": "#00ff00",
|
|
84
|
-
"error": "#ff0000",
|
|
85
|
-
"warning": "#ffff00",
|
|
86
|
-
"muted": "secondary",
|
|
87
|
-
"dim": 240,
|
|
88
|
-
"text": "",
|
|
89
|
-
"thinkingText": "secondary",
|
|
90
|
-
"selectedBg": "#2d2d30",
|
|
91
|
-
"scrollbarTrack": "secondary",
|
|
92
|
-
"scrollbarThumb": "",
|
|
93
|
-
"searchMatchBg": "#2d2d30",
|
|
94
|
-
"searchMatchText": "",
|
|
95
|
-
"userMessageBg": "#2d2d30",
|
|
96
|
-
"userMessageText": "",
|
|
97
|
-
"customMessageBg": "#2d2d30",
|
|
98
|
-
"customMessageText": "",
|
|
99
|
-
"customMessageLabel": "primary",
|
|
100
|
-
"toolPendingBg": "#1e1e2e",
|
|
101
|
-
"toolSuccessBg": "#1e2e1e",
|
|
102
|
-
"toolErrorBg": "#2e1e1e",
|
|
103
|
-
"toolTitle": "primary",
|
|
104
|
-
"toolOutput": "",
|
|
105
|
-
"mdHeading": "#ffaa00",
|
|
106
|
-
"mdLink": "primary",
|
|
107
|
-
"mdLinkUrl": "secondary",
|
|
108
|
-
"mdCode": "#00ffff",
|
|
109
|
-
"mdCodeBlock": "",
|
|
110
|
-
"mdCodeBlockBorder": "secondary",
|
|
111
|
-
"mdQuote": "secondary",
|
|
112
|
-
"mdQuoteBorder": "secondary",
|
|
113
|
-
"mdHr": "secondary",
|
|
114
|
-
"mdListBullet": "#00ffff",
|
|
115
|
-
"toolDiffAdded": "#00ff00",
|
|
116
|
-
"toolDiffRemoved": "#ff0000",
|
|
117
|
-
"toolDiffContext": "secondary",
|
|
118
|
-
"syntaxComment": "secondary",
|
|
119
|
-
"syntaxKeyword": "primary",
|
|
120
|
-
"syntaxFunction": "#00aaff",
|
|
121
|
-
"syntaxVariable": "#ffaa00",
|
|
122
|
-
"syntaxString": "#00ff00",
|
|
123
|
-
"syntaxNumber": "#ff00ff",
|
|
124
|
-
"syntaxType": "#00aaff",
|
|
125
|
-
"syntaxOperator": "primary",
|
|
126
|
-
"syntaxPunctuation": "secondary",
|
|
127
|
-
"thinkingOff": "secondary",
|
|
128
|
-
"thinkingMinimal": "primary",
|
|
129
|
-
"thinkingLow": "#00aaff",
|
|
130
|
-
"thinkingMedium": "#00ffff",
|
|
131
|
-
"thinkingHigh": "#ff00ff",
|
|
132
|
-
"thinkingXhigh": "#ff0000",
|
|
133
|
-
"thinkingMax": "#ff0088",
|
|
134
|
-
"bashMode": "#ffaa00"
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
3. Select the theme via `/settings`.
|
|
140
|
-
|
|
141
|
-
**Hot reload:** When you edit the currently active custom theme file, pi reloads it automatically for immediate visual feedback.
|
|
142
|
-
|
|
143
|
-
## Theme Format
|
|
144
|
-
|
|
145
|
-
```json
|
|
146
|
-
{
|
|
147
|
-
"$schema": "https://raw.githubusercontent.com/earendil-works/pi/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json",
|
|
148
|
-
"name": "my-theme",
|
|
149
|
-
"vars": {
|
|
150
|
-
"blue": "#0066cc",
|
|
151
|
-
"gray": 242
|
|
152
|
-
},
|
|
153
|
-
"colors": {
|
|
154
|
-
"accent": "blue",
|
|
155
|
-
"muted": "gray",
|
|
156
|
-
"text": "",
|
|
157
|
-
...
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
- `name` is required, must be unique, and must not contain `/`.
|
|
163
|
-
- `vars` is optional. Define reusable colors here, then reference them in `colors`.
|
|
164
|
-
- `colors` must define all 53 required tokens. `thinkingMax` and the two search highlight tokens are optional and use the fallbacks listed below.
|
|
165
|
-
|
|
166
|
-
The `$schema` field enables editor auto-completion and validation.
|
|
167
|
-
|
|
168
|
-
## Color Tokens
|
|
169
|
-
|
|
170
|
-
Every theme must define all 53 required color tokens. The optional tokens preserve compatibility with existing themes: `thinkingMax` falls back to `thinkingXhigh`, `searchMatchBg` falls back to `selectedBg`, and `searchMatchText` falls back to `text`. Other search matches use `searchMatchText` on `searchMatchBg` with an underline; the current match reverses that foreground/background pair and uses bold text.
|
|
171
|
-
|
|
172
|
-
### Core UI (13 colors)
|
|
173
|
-
|
|
174
|
-
| Token | Purpose |
|
|
175
|
-
|-------|---------|
|
|
176
|
-
| `accent` | Primary accent (logo, selected items, cursor) |
|
|
177
|
-
| `border` | Normal borders |
|
|
178
|
-
| `borderAccent` | Highlighted borders |
|
|
179
|
-
| `borderMuted` | Subtle borders (editor) |
|
|
180
|
-
| `success` | Success states |
|
|
181
|
-
| `error` | Error states |
|
|
182
|
-
| `warning` | Warning states |
|
|
183
|
-
| `muted` | Secondary text |
|
|
184
|
-
| `dim` | Tertiary text |
|
|
185
|
-
| `text` | Default text (usually `""`) |
|
|
186
|
-
| `thinkingText` | Thinking block text |
|
|
187
|
-
| `scrollbarTrack` | Fullscreen scrollbar track foreground |
|
|
188
|
-
| `scrollbarThumb` | Fullscreen scrollbar thumb foreground, shared by normal and expanded states |
|
|
189
|
-
|
|
190
|
-
### Backgrounds & Content (11 required, 2 optional)
|
|
191
|
-
|
|
192
|
-
| Token | Purpose |
|
|
193
|
-
|-------|---------|
|
|
194
|
-
| `selectedBg` | Selected line background |
|
|
195
|
-
| `searchMatchBg` | Transcript search match background and current-match text; optional, falls back to `selectedBg` |
|
|
196
|
-
| `searchMatchText` | Transcript search match text and current-match background; optional, falls back to `text` |
|
|
197
|
-
| `userMessageBg` | User message background |
|
|
198
|
-
| `userMessageText` | User message text |
|
|
199
|
-
| `customMessageBg` | Extension message background |
|
|
200
|
-
| `customMessageText` | Extension message text |
|
|
201
|
-
| `customMessageLabel` | Extension message label |
|
|
202
|
-
| `toolPendingBg` | Tool box (pending) |
|
|
203
|
-
| `toolSuccessBg` | Tool box (success) |
|
|
204
|
-
| `toolErrorBg` | Tool box (error) |
|
|
205
|
-
| `toolTitle` | Tool title |
|
|
206
|
-
| `toolOutput` | Tool output text |
|
|
207
|
-
|
|
208
|
-
### Markdown (10 colors)
|
|
209
|
-
|
|
210
|
-
| Token | Purpose |
|
|
211
|
-
|-------|---------|
|
|
212
|
-
| `mdHeading` | Headings |
|
|
213
|
-
| `mdLink` | Link text |
|
|
214
|
-
| `mdLinkUrl` | Link URL |
|
|
215
|
-
| `mdCode` | Inline code |
|
|
216
|
-
| `mdCodeBlock` | Code block content |
|
|
217
|
-
| `mdCodeBlockBorder` | Code block fences |
|
|
218
|
-
| `mdQuote` | Blockquote text |
|
|
219
|
-
| `mdQuoteBorder` | Blockquote border |
|
|
220
|
-
| `mdHr` | Horizontal rule |
|
|
221
|
-
| `mdListBullet` | List bullets |
|
|
222
|
-
|
|
223
|
-
### Tool Diffs (3 colors)
|
|
224
|
-
|
|
225
|
-
| Token | Purpose |
|
|
226
|
-
|-------|---------|
|
|
227
|
-
| `toolDiffAdded` | Added lines |
|
|
228
|
-
| `toolDiffRemoved` | Removed lines |
|
|
229
|
-
| `toolDiffContext` | Context lines |
|
|
230
|
-
|
|
231
|
-
### Syntax Highlighting (9 colors)
|
|
232
|
-
|
|
233
|
-
| Token | Purpose |
|
|
234
|
-
|-------|---------|
|
|
235
|
-
| `syntaxComment` | Comments |
|
|
236
|
-
| `syntaxKeyword` | Keywords |
|
|
237
|
-
| `syntaxFunction` | Function names |
|
|
238
|
-
| `syntaxVariable` | Variables |
|
|
239
|
-
| `syntaxString` | Strings |
|
|
240
|
-
| `syntaxNumber` | Numbers |
|
|
241
|
-
| `syntaxType` | Types |
|
|
242
|
-
| `syntaxOperator` | Operators |
|
|
243
|
-
| `syntaxPunctuation` | Punctuation |
|
|
244
|
-
|
|
245
|
-
### Thinking Level Borders (6 required, 1 optional)
|
|
246
|
-
|
|
247
|
-
Editor border colors indicating thinking level (visual hierarchy from subtle to prominent):
|
|
248
|
-
|
|
249
|
-
| Token | Purpose |
|
|
250
|
-
|-------|---------|
|
|
251
|
-
| `thinkingOff` | Thinking off |
|
|
252
|
-
| `thinkingMinimal` | Minimal thinking |
|
|
253
|
-
| `thinkingLow` | Low thinking |
|
|
254
|
-
| `thinkingMedium` | Medium thinking |
|
|
255
|
-
| `thinkingHigh` | High thinking |
|
|
256
|
-
| `thinkingXhigh` | Extra high thinking |
|
|
257
|
-
| `thinkingMax` | Maximum thinking; optional, falls back to `thinkingXhigh` |
|
|
258
|
-
|
|
259
|
-
### Bash Mode (1 color)
|
|
260
|
-
|
|
261
|
-
| Token | Purpose |
|
|
262
|
-
|-------|---------|
|
|
263
|
-
| `bashMode` | Editor border in bash mode (`!` prefix) |
|
|
264
|
-
|
|
265
|
-
### HTML Export (optional)
|
|
266
|
-
|
|
267
|
-
The `export` section controls colors for `/export` HTML output. If omitted, colors are derived from `userMessageBg`.
|
|
49
|
+
## Understand the theme file
|
|
268
50
|
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
```
|
|
51
|
+
| Property | Required | Responsibility |
|
|
52
|
+
|---|---|---|
|
|
53
|
+
| `$schema` | No | Enables editor validation and completion against Pi's published schema. |
|
|
54
|
+
| `name` | Yes | Identifies the theme in selectors and settings. It must be unique and cannot contain `/`. |
|
|
55
|
+
| `appearance` | No | `"dark"` or `"light"`: the background the theme is designed for. Pi detects it from the theme colors when omitted. |
|
|
56
|
+
| `vars` | No | Defines reusable color values. Variables can reference other variables. |
|
|
57
|
+
| `colors` | Yes | Assigns colors to terminal UI roles. The schema identifies required and optional roles. |
|
|
58
|
+
| `export` | No | Overrides page and panel backgrounds in HTML exports. |
|
|
278
59
|
|
|
279
|
-
|
|
60
|
+
A color can be written in five forms:
|
|
280
61
|
|
|
281
|
-
|
|
62
|
+
| Form | Example | Meaning |
|
|
63
|
+
|---|---|---|
|
|
64
|
+
| RGB hexadecimal | `"#0af"` or `"#00aaff"` | A three- or six-digit sRGB color. |
|
|
65
|
+
| OKLCH | `"oklch(62% 0.1 200)"` | Perceptual lightness, chroma, and hue. |
|
|
66
|
+
| 256-color index | `39` | An ANSI palette index from `0` through `255`. |
|
|
67
|
+
| Variable reference | `"primary"` | The value of an entry in `vars`. |
|
|
68
|
+
| Terminal default | `""` | The terminal's default foreground or background color. |
|
|
282
69
|
|
|
283
|
-
|
|
284
|
-
|--------|---------|-------------|
|
|
285
|
-
| Hex | `"#ff0000"` | 6-digit hex RGB |
|
|
286
|
-
| 256-color | `39` | xterm 256-color palette index (0-255) |
|
|
287
|
-
| Variable | `"primary"` | Reference to a `vars` entry |
|
|
288
|
-
| Default | `""` | Terminal's default color |
|
|
70
|
+
Terminal default colors render as the terminal's own colors. Where Pi needs a concrete value, such as HTML export or extension color math, it uses the default colors the terminal reports, or a black or white guess based on the theme's appearance.
|
|
289
71
|
|
|
290
|
-
|
|
72
|
+
Pi resolves chained variable references. A missing variable or circular reference makes the theme invalid. Pi uses truecolor when available, gamut-maps OKLCH to sRGB, and approximates colors for 256-color terminals. If colors differ from their source values, check your terminal's truecolor detection and contrast settings. See [Configure Your Terminal](terminal-setup.md#override-detected-capabilities).
|
|
291
73
|
|
|
292
|
-
|
|
293
|
-
- `16-231`: 6×6×6 RGB cube (`16 + 36×R + 6×G + B` where R,G,B are 0-5)
|
|
294
|
-
- `232-255`: Grayscale ramp
|
|
74
|
+
Use the [theme JSON schema](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json) for the exact properties, required colors, and accepted value types.
|
|
295
75
|
|
|
296
|
-
|
|
76
|
+
Pi reports invalid theme files during startup and `/reload`.
|
|
297
77
|
|
|
298
|
-
|
|
78
|
+
## Find the color to change
|
|
299
79
|
|
|
300
|
-
|
|
80
|
+
Theme colors describe interface roles rather than individual components. Use these groups to find the relevant part of the schema:
|
|
301
81
|
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
82
|
+
| Area | Color names |
|
|
83
|
+
|---|---|
|
|
84
|
+
| General interface | `accent`, `border*`, `text`, `muted`, `dim`, `success`, `error`, `warning` |
|
|
85
|
+
| Selection and fullscreen | `selectedBg`, `searchMatch*`, `scrollbar*` |
|
|
86
|
+
| Messages | `userMessage*`, `customMessage*`, `thinkingText` |
|
|
87
|
+
| Tool execution | `toolPendingBg`, `toolSuccessBg`, `toolErrorBg`, `toolTitle`, `toolOutput` |
|
|
88
|
+
| Markdown | `md*` |
|
|
89
|
+
| Tool diffs | `toolDiff*` |
|
|
90
|
+
| Syntax highlighting | `syntax*` |
|
|
91
|
+
| Editor modes | `thinking*`, `bashMode` |
|
|
92
|
+
| HTML export | `export.pageBg`, `export.cardBg`, `export.infoBg` |
|
|
305
93
|
|
|
306
|
-
|
|
94
|
+
The schema is the format reference. The built-in themes provide complete values that you can copy and adjust.
|
|
307
95
|
|
|
308
|
-
|
|
96
|
+
Five colors are optional and inherit another color when omitted:
|
|
309
97
|
|
|
310
|
-
|
|
98
|
+
| Optional color | Fallback |
|
|
99
|
+
|---|---|
|
|
100
|
+
| `scrollbarTrack` | `muted` |
|
|
101
|
+
| `scrollbarThumb` | `text` |
|
|
102
|
+
| `searchMatchBg` | `selectedBg` |
|
|
103
|
+
| `searchMatchText` | `text` |
|
|
104
|
+
| `thinkingMax` | `thinkingXhigh` |
|
|
311
105
|
|
|
312
|
-
|
|
106
|
+
If `export` colors are omitted, Pi derives HTML page and panel backgrounds from `userMessageBg`.
|
|
313
107
|
|
|
314
|
-
|
|
108
|
+
## Load a theme from a project or package
|
|
315
109
|
|
|
316
|
-
|
|
110
|
+
Place a project theme in `.pi/themes/`. Project themes load only after [project trust](security.md#understand-project-trust) is granted.
|
|
317
111
|
|
|
318
|
-
|
|
112
|
+
You can also load theme files and directories through the `themes` setting or distribute them in a Pi package. See [Configuration](configuration.md), [Settings](settings.md#resources), and [Pi Packages](packages.md).
|
|
319
113
|
|
|
320
|
-
|
|
321
|
-
- [dark.json](../src/modes/interactive/theme/dark.json)
|
|
322
|
-
- [light.json](../src/modes/interactive/theme/light.json)
|
|
114
|
+
Each loaded theme must have a unique name. Pi reports duplicate names as resource collisions.
|
package/docs/tmux.md
CHANGED
|
@@ -1,63 +1,55 @@
|
|
|
1
|
-
# tmux
|
|
1
|
+
# Run Pi in tmux
|
|
2
2
|
|
|
3
|
-
Pi works inside tmux, but tmux
|
|
3
|
+
Pi works inside tmux, but tmux can report `Shift+Enter`, `Ctrl+Enter`, and plain `Enter` as the same key. Enable extended keys so Pi can distinguish them.
|
|
4
4
|
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
Add to `~/.tmux.conf`:
|
|
8
|
-
|
|
9
|
-
```tmux
|
|
10
|
-
set -g extended-keys on
|
|
11
|
-
set -g extended-keys-format csi-u
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
Then restart tmux fully:
|
|
5
|
+
## Check your tmux version
|
|
15
6
|
|
|
16
7
|
```bash
|
|
17
|
-
tmux
|
|
18
|
-
tmux
|
|
8
|
+
tmux -V
|
|
19
9
|
```
|
|
20
10
|
|
|
21
|
-
|
|
11
|
+
For tmux 3.5 or newer, use the recommended CSI-u configuration below. For tmux 3.2 through 3.4, use the older-version configuration.
|
|
22
12
|
|
|
23
|
-
##
|
|
13
|
+
## Enable extended keys in tmux 3.5 or newer
|
|
24
14
|
|
|
25
|
-
|
|
15
|
+
Add these lines to `~/.tmux.conf`:
|
|
26
16
|
|
|
27
17
|
```tmux
|
|
28
18
|
set -g extended-keys on
|
|
19
|
+
set -g extended-keys-format csi-u
|
|
29
20
|
```
|
|
30
21
|
|
|
31
|
-
|
|
22
|
+
Pi requests extended-key reporting when the terminal does not provide the Kitty keyboard protocol directly. CSI-u is the most reliable format for forwarding modified keys through tmux.
|
|
32
23
|
|
|
33
|
-
|
|
34
|
-
- `Ctrl+D` → `\x1b[27;5;100~`
|
|
35
|
-
- `Ctrl+Enter` → `\x1b[27;5;13~`
|
|
24
|
+
## Restart tmux
|
|
36
25
|
|
|
37
|
-
|
|
26
|
+
The configuration applies to the tmux server. To guarantee that it is active, close your tmux sessions and start a new server.
|
|
38
27
|
|
|
39
|
-
|
|
40
|
-
- `Ctrl+D` → `\x1b[100;5u`
|
|
41
|
-
- `Ctrl+Enter` → `\x1b[13;5u`
|
|
28
|
+
If you choose to stop the server from the command line, save your work first. This command terminates every session managed by that server:
|
|
42
29
|
|
|
43
|
-
|
|
30
|
+
```bash
|
|
31
|
+
tmux kill-server
|
|
32
|
+
tmux
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Verify modified keys
|
|
44
36
|
|
|
45
|
-
|
|
37
|
+
Start Pi inside the new tmux session and check that:
|
|
46
38
|
|
|
47
|
-
|
|
39
|
+
1. `Shift+Enter` inserts a new line in the editor.
|
|
40
|
+
2. `Enter` submits the prompt.
|
|
41
|
+
3. `Alt+Enter` queues a follow-up on macOS and Linux. Windows and WSL use `Ctrl+Q` by default.
|
|
48
42
|
|
|
49
|
-
|
|
50
|
-
|-----|-----------------|--------------|
|
|
51
|
-
| Enter | `\r` | `\r` |
|
|
52
|
-
| Shift+Enter | `\r` | `\x1b[13;2u` |
|
|
53
|
-
| Ctrl+Enter | `\r` | `\x1b[13;5u` |
|
|
54
|
-
| Alt/Option+Enter | `\x1b\r` | `\x1b[13;3u` |
|
|
43
|
+
If these keys still behave like plain `Enter`, verify that the terminal outside tmux can report modified keys. See [Configure your terminal](terminal-setup.md).
|
|
55
44
|
|
|
56
|
-
|
|
45
|
+
## Use tmux 3.2 through 3.4
|
|
57
46
|
|
|
58
|
-
|
|
47
|
+
These versions support extended keys but not `extended-keys-format csi-u`. Add only:
|
|
48
|
+
|
|
49
|
+
```tmux
|
|
50
|
+
set -g extended-keys on
|
|
51
|
+
```
|
|
59
52
|
|
|
60
|
-
|
|
61
|
-
- A terminal emulator that supports extended keys (Ghostty, Kitty, iTerm2, WezTerm, Windows Terminal)
|
|
53
|
+
Pi supports the xterm `modifyOtherKeys` format used by these versions. Restart tmux and repeat the verification steps.
|
|
62
54
|
|
|
63
|
-
|
|
55
|
+
For older versions, upgrade tmux or use Pi outside tmux rather than relying on modified Enter shortcuts.
|