mu-agent 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/LICENSE +21 -0
- package/README.md +62 -0
- package/dist/bundle/chunks/anthropic-messages-MYU5ZMRF.js +6 -0
- package/dist/bundle/chunks/anthropic.js +75 -0
- package/dist/bundle/chunks/azure-openai-responses-HUSQ3GP2.js +2 -0
- package/dist/bundle/chunks/bedrock-converse-stream.js +83 -0
- package/dist/bundle/chunks/chunk-4L3WN2XY.js +2 -0
- package/dist/bundle/chunks/chunk-6CYCI3EJ.js +12 -0
- package/dist/bundle/chunks/chunk-6R7UI4IY.js +2 -0
- package/dist/bundle/chunks/chunk-7ZC4UXSL.js +2 -0
- package/dist/bundle/chunks/chunk-A3JYRWB6.js +2 -0
- package/dist/bundle/chunks/chunk-DRQDKNXA.js +2 -0
- package/dist/bundle/chunks/chunk-DTD7JQ7Y.js +42 -0
- package/dist/bundle/chunks/chunk-FUXEF6JQ.js +44 -0
- package/dist/bundle/chunks/chunk-L2ZPNLYD.js +2 -0
- package/dist/bundle/chunks/chunk-NUHFSC37.js +25 -0
- package/dist/bundle/chunks/chunk-PGXDEOVV.js +2 -0
- package/dist/bundle/chunks/chunk-PJACZCIR.js +2 -0
- package/dist/bundle/chunks/chunk-PRRNXB7S.js +2 -0
- package/dist/bundle/chunks/chunk-QB4HYZZE.js +1561 -0
- package/dist/bundle/chunks/chunk-RCZIEVGO.js +11 -0
- package/dist/bundle/chunks/chunk-S7SZN6Z3.js +2 -0
- package/dist/bundle/chunks/chunk-TEPMHNKQ.js +2 -0
- package/dist/bundle/chunks/chunk-TRDNDS6A.js +4 -0
- package/dist/bundle/chunks/chunk-USJZMAIR.js +2 -0
- package/dist/bundle/chunks/chunk-WIUZI2CJ.js +11 -0
- package/dist/bundle/chunks/chunk-XDUWOHPL.js +6 -0
- package/dist/bundle/chunks/chunk-XNGRGP62.js +2 -0
- package/dist/bundle/chunks/chunk-Z2DUOAN4.js +2 -0
- package/dist/bundle/chunks/github-copilot.js +2 -0
- package/dist/bundle/chunks/google-generative-ai-IMS5EK2Y.js +2 -0
- package/dist/bundle/chunks/google-vertex-O4YJEQUW.js +2 -0
- package/dist/bundle/chunks/https-proxy-agent-2VXB7436.js +13 -0
- package/dist/bundle/chunks/image-resize-worker.js +2 -0
- package/dist/bundle/chunks/jiti-loader-C3NU2SDH.js +21 -0
- package/dist/bundle/chunks/jiti-static-loader-E6ANQD5T.js +2 -0
- package/dist/bundle/chunks/kimi-coding.js +2 -0
- package/dist/bundle/chunks/lib-HGQMNYVT.js +9 -0
- package/dist/bundle/chunks/mistral-conversations-NOSQHBEY.js +5 -0
- package/dist/bundle/chunks/multipart-parser-SQ6GDJL7.js +3 -0
- package/dist/bundle/chunks/node-O3RIBJRH.js +16 -0
- package/dist/bundle/chunks/node-TWVVAGPO.js +2 -0
- package/dist/bundle/chunks/openai-codex-responses-QDSOTBBO.js +10 -0
- package/dist/bundle/chunks/openai-codex.js +75 -0
- package/dist/bundle/chunks/openai-completions-KQPOPEVM.js +7 -0
- package/dist/bundle/chunks/openai-responses-HWEUZ6WZ.js +2 -0
- package/dist/bundle/chunks/openrouter-images-N4XVVFSD.js +2 -0
- package/dist/bundle/chunks/openrouter.js +75 -0
- package/dist/bundle/chunks/pi-messages-GFKBWJHZ.js +8 -0
- package/dist/bundle/chunks/radius.js +75 -0
- package/dist/bundle/chunks/src-UK77SYZE.js +4 -0
- package/dist/bundle/chunks/virtual-modules-ROULVYS3.js +2 -0
- package/dist/bundle/chunks/xai.js +2 -0
- package/dist/bundle/cli.js +3 -0
- package/dist/bundle/index.js +2 -0
- package/dist/bundle/native/darwin/prebuilds/darwin-arm64/darwin-platform.node +0 -0
- package/dist/bundle/native/darwin/prebuilds/darwin-x64/darwin-platform.node +0 -0
- package/dist/bundle/native/linux/prebuilds/linux-arm64/linux-platform-x11.node +0 -0
- package/dist/bundle/native/linux/prebuilds/linux-x64/linux-platform-x11.node +0 -0
- package/dist/bundle/native/win32/prebuilds/win32-arm64/win32-platform.node +0 -0
- package/dist/bundle/native/win32/prebuilds/win32-x64/win32-platform.node +0 -0
- package/dist/bundle/rpc-entry.js +3 -0
- package/dist/core/export-html/template.css +1066 -0
- package/dist/core/export-html/template.html +55 -0
- package/dist/core/export-html/template.js +1864 -0
- package/dist/core/export-html/vendor/highlight.min.js +1213 -0
- package/dist/core/export-html/vendor/marked.min.js +78 -0
- package/dist/modes/interactive/assets/clankolas.png +0 -0
- package/dist/modes/interactive/theme/dark.json +91 -0
- package/dist/modes/interactive/theme/light.json +90 -0
- package/dist/modes/interactive/theme/theme-controller.d.ts +41 -0
- package/dist/modes/interactive/theme/theme-controller.d.ts.map +1 -0
- package/dist/modes/interactive/theme/theme-controller.js +130 -0
- package/dist/modes/interactive/theme/theme-controller.js.map +1 -0
- package/dist/modes/interactive/theme/theme-json.d.ts +84 -0
- package/dist/modes/interactive/theme/theme-json.d.ts.map +1 -0
- package/dist/modes/interactive/theme/theme-json.js +130 -0
- package/dist/modes/interactive/theme/theme-json.js.map +1 -0
- package/dist/modes/interactive/theme/theme-schema.json +356 -0
- package/dist/modes/interactive/theme/theme.d.ts +131 -0
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -0
- package/dist/modes/interactive/theme/theme.js +991 -0
- package/dist/modes/interactive/theme/theme.js.map +1 -0
- package/dist/native/darwin/prebuilds/darwin-arm64/darwin-platform.node +0 -0
- package/dist/native/darwin/prebuilds/darwin-x64/darwin-platform.node +0 -0
- package/dist/native/linux/prebuilds/linux-arm64/linux-platform-x11.node +0 -0
- package/dist/native/linux/prebuilds/linux-x64/linux-platform-x11.node +0 -0
- package/dist/native/win32/prebuilds/win32-arm64/win32-platform.node +0 -0
- package/dist/native/win32/prebuilds/win32-x64/win32-platform.node +0 -0
- package/docs/compaction.md +444 -0
- package/docs/containerization.md +156 -0
- package/docs/custom-provider.md +786 -0
- package/docs/development.md +90 -0
- package/docs/docs.json +160 -0
- package/docs/environment-variables.md +100 -0
- package/docs/extensions.md +3037 -0
- package/docs/images/doom-extension.png +0 -0
- package/docs/images/exy.png +0 -0
- package/docs/images/interactive-mode.png +0 -0
- package/docs/images/tree-view.png +0 -0
- package/docs/index.md +84 -0
- package/docs/json.md +98 -0
- package/docs/keybindings.md +239 -0
- package/docs/llama-cpp.md +101 -0
- package/docs/models.md +605 -0
- package/docs/packages.md +228 -0
- package/docs/prompt-templates.md +96 -0
- package/docs/providers.md +317 -0
- package/docs/quickstart.md +167 -0
- package/docs/rpc.md +1618 -0
- package/docs/sdk.md +1226 -0
- package/docs/security.md +59 -0
- package/docs/session-format.md +480 -0
- package/docs/sessions.md +172 -0
- package/docs/settings.md +428 -0
- package/docs/shell-aliases.md +13 -0
- package/docs/skills.md +232 -0
- package/docs/terminal-setup.md +192 -0
- package/docs/termux.md +126 -0
- package/docs/themes.md +322 -0
- package/docs/tmux.md +63 -0
- package/docs/tui.md +961 -0
- package/docs/usage.md +312 -0
- package/docs/windows.md +39 -0
- package/examples/README.md +28 -0
- package/examples/extensions/README.md +212 -0
- package/examples/extensions/auto-commit-on-exit.ts +49 -0
- package/examples/extensions/bash-spawn-hook.ts +30 -0
- package/examples/extensions/bookmark.ts +50 -0
- package/examples/extensions/border-status-editor.ts +150 -0
- package/examples/extensions/built-in-tool-renderer.ts +249 -0
- package/examples/extensions/claude-rules.ts +86 -0
- package/examples/extensions/commands.ts +72 -0
- package/examples/extensions/confirm-destructive.ts +59 -0
- package/examples/extensions/custom-compaction.ts +117 -0
- package/examples/extensions/custom-footer.ts +64 -0
- package/examples/extensions/custom-header.ts +73 -0
- package/examples/extensions/custom-provider-anthropic/index.ts +617 -0
- package/examples/extensions/custom-provider-anthropic/package-lock.json +24 -0
- package/examples/extensions/custom-provider-anthropic/package.json +19 -0
- package/examples/extensions/custom-provider-gitlab-duo/index.ts +405 -0
- package/examples/extensions/custom-provider-gitlab-duo/package.json +16 -0
- package/examples/extensions/custom-provider-gitlab-duo/test.ts +82 -0
- package/examples/extensions/dirty-repo-guard.ts +56 -0
- package/examples/extensions/doom-overlay/README.md +46 -0
- package/examples/extensions/doom-overlay/doom/build/doom.js +21 -0
- package/examples/extensions/doom-overlay/doom/build/doom.wasm +0 -0
- package/examples/extensions/doom-overlay/doom/build.sh +152 -0
- package/examples/extensions/doom-overlay/doom/doomgeneric_pi.c +72 -0
- package/examples/extensions/doom-overlay/doom-component.ts +132 -0
- package/examples/extensions/doom-overlay/doom-engine.ts +173 -0
- package/examples/extensions/doom-overlay/doom-keys.ts +104 -0
- package/examples/extensions/doom-overlay/index.ts +74 -0
- package/examples/extensions/doom-overlay/wad-finder.ts +55 -0
- package/examples/extensions/dynamic-resources/SKILL.md +8 -0
- package/examples/extensions/dynamic-resources/dynamic.json +81 -0
- package/examples/extensions/dynamic-resources/dynamic.md +5 -0
- package/examples/extensions/dynamic-resources/index.ts +15 -0
- package/examples/extensions/dynamic-tools.ts +74 -0
- package/examples/extensions/entry-renderer.ts +41 -0
- package/examples/extensions/event-bus.ts +43 -0
- package/examples/extensions/file-trigger.ts +41 -0
- package/examples/extensions/git-checkpoint.ts +53 -0
- package/examples/extensions/git-merge-and-resolve.ts +115 -0
- package/examples/extensions/github-issue-autocomplete.ts +185 -0
- package/examples/extensions/gondolin/index.ts +531 -0
- package/examples/extensions/gondolin/package-lock.json +185 -0
- package/examples/extensions/gondolin/package.json +19 -0
- package/examples/extensions/handoff.ts +190 -0
- package/examples/extensions/hello.ts +26 -0
- package/examples/extensions/hidden-thinking-label.ts +53 -0
- package/examples/extensions/inline-bash.ts +94 -0
- package/examples/extensions/input-transform-streaming.ts +39 -0
- package/examples/extensions/input-transform.ts +43 -0
- package/examples/extensions/interactive-shell.ts +196 -0
- package/examples/extensions/mac-system-theme.ts +47 -0
- package/examples/extensions/message-renderer.ts +59 -0
- package/examples/extensions/minimal-mode.ts +426 -0
- package/examples/extensions/modal-editor.ts +85 -0
- package/examples/extensions/model-status.ts +31 -0
- package/examples/extensions/notify.ts +57 -0
- package/examples/extensions/overlay-qa-tests.ts +1450 -0
- package/examples/extensions/overlay-test.ts +153 -0
- package/examples/extensions/permission-gate.ts +34 -0
- package/examples/extensions/pirate.ts +47 -0
- package/examples/extensions/plan-mode/README.md +66 -0
- package/examples/extensions/plan-mode/index.ts +390 -0
- package/examples/extensions/plan-mode/utils.ts +168 -0
- package/examples/extensions/preset.ts +436 -0
- package/examples/extensions/project-trust.ts +64 -0
- package/examples/extensions/prompt-customizer.ts +49 -0
- package/examples/extensions/protected-paths.ts +30 -0
- package/examples/extensions/provider-payload.ts +18 -0
- package/examples/extensions/qna.ts +118 -0
- package/examples/extensions/question.ts +286 -0
- package/examples/extensions/questionnaire.ts +448 -0
- package/examples/extensions/rainbow-editor.ts +88 -0
- package/examples/extensions/reload-runtime.ts +37 -0
- package/examples/extensions/rpc-demo.ts +118 -0
- package/examples/extensions/sandbox/index.ts +321 -0
- package/examples/extensions/sandbox/package-lock.json +92 -0
- package/examples/extensions/sandbox/package.json +19 -0
- package/examples/extensions/send-user-message.ts +97 -0
- package/examples/extensions/session-name.ts +27 -0
- package/examples/extensions/shutdown-command.ts +63 -0
- package/examples/extensions/snake.ts +343 -0
- package/examples/extensions/space-invaders.ts +560 -0
- package/examples/extensions/ssh.ts +220 -0
- package/examples/extensions/status-line.ts +32 -0
- package/examples/extensions/structured-output.ts +65 -0
- package/examples/extensions/subagent/README.md +177 -0
- package/examples/extensions/subagent/agents/planner.md +37 -0
- package/examples/extensions/subagent/agents/reviewer.md +35 -0
- package/examples/extensions/subagent/agents/scout.md +50 -0
- package/examples/extensions/subagent/agents/worker.md +24 -0
- package/examples/extensions/subagent/agents.ts +157 -0
- package/examples/extensions/subagent/index.ts +1038 -0
- package/examples/extensions/subagent/prompts/implement-and-review.md +10 -0
- package/examples/extensions/subagent/prompts/implement.md +10 -0
- package/examples/extensions/subagent/prompts/scout-and-plan.md +9 -0
- package/examples/extensions/summarize.ts +199 -0
- package/examples/extensions/system-prompt-header.ts +17 -0
- package/examples/extensions/tic-tac-toe.ts +1008 -0
- package/examples/extensions/timed-confirm.ts +70 -0
- package/examples/extensions/titlebar-spinner.ts +58 -0
- package/examples/extensions/todo.ts +297 -0
- package/examples/extensions/tool-override.ts +144 -0
- package/examples/extensions/tools.ts +146 -0
- package/examples/extensions/trigger-compact.ts +50 -0
- package/examples/extensions/truncated-tool.ts +195 -0
- package/examples/extensions/widget-placement.ts +9 -0
- package/examples/extensions/with-deps/index.ts +32 -0
- package/examples/extensions/with-deps/package-lock.json +31 -0
- package/examples/extensions/with-deps/package.json +22 -0
- package/examples/extensions/working-indicator.ts +123 -0
- package/examples/extensions/working-message-test.ts +25 -0
- package/examples/plugins/pi-example-plugin/README.md +38 -0
- package/examples/plugins/pi-example-plugin/package.json +10 -0
- package/examples/plugins/pi-example-plugin/src/contract.ts +13 -0
- package/examples/plugins/pi-example-plugin/src/session.ts +23 -0
- package/examples/plugins/pi-example-plugin/src/tui.ts +31 -0
- package/examples/rpc-extension-ui.ts +641 -0
- package/examples/sdk/01-minimal.ts +26 -0
- package/examples/sdk/02-custom-model.ts +49 -0
- package/examples/sdk/03-custom-prompt.ts +75 -0
- package/examples/sdk/04-skills.ts +55 -0
- package/examples/sdk/05-tools.ts +48 -0
- package/examples/sdk/06-extensions.ts +99 -0
- package/examples/sdk/07-context-files.ts +47 -0
- package/examples/sdk/08-prompt-templates.ts +51 -0
- package/examples/sdk/09-api-keys-and-oauth.ts +34 -0
- package/examples/sdk/10-settings.ts +53 -0
- package/examples/sdk/11-sessions.ts +52 -0
- package/examples/sdk/12-full-control.ts +74 -0
- package/examples/sdk/13-session-runtime.ts +67 -0
- package/examples/sdk/README.md +140 -0
- package/judge/THIRD_PARTY_NOTICES.md +35 -0
- package/judge/agents/browser.md +17 -0
- package/judge/agents/investigator.md +16 -0
- package/judge/agents/planner.md +15 -0
- package/judge/agents/reviewer.md +17 -0
- package/judge/agents/scout.md +19 -0
- package/judge/agents/worker.md +15 -0
- package/judge/dist/chrome.js +326 -0
- package/judge/dist/kyrn-judge.js +52542 -0
- package/judge/package.json +6 -0
- package/judge/prompts/implement-and-review.md +14 -0
- package/judge/prompts/implement.md +15 -0
- package/judge/prompts/init.md +18 -0
- package/judge/prompts/scout-and-plan.md +12 -0
- package/judge/skills/mu-browser/SKILL.md +30 -0
- package/judge/skills/mu-github/SKILL.md +90 -0
- package/kyrn/bin/kyrn-doctor +202 -0
- package/kyrn/bin/kyrn-judge-local +131 -0
- package/kyrn/bin/kyrn-ledger +90 -0
- package/kyrn/bin/mu.mjs +1120 -0
- package/kyrn/local-judge/requirements.lock.txt +26 -0
- package/kyrn/local-judge/server.py +332 -0
- package/package.json +45 -0
package/docs/themes.md
ADDED
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
> pi can create themes. Ask it to build one for your setup.
|
|
2
|
+
|
|
3
|
+
# Themes
|
|
4
|
+
|
|
5
|
+
Themes are JSON files that define colors for the TUI.
|
|
6
|
+
|
|
7
|
+
## Table of Contents
|
|
8
|
+
|
|
9
|
+
- [Locations](#locations)
|
|
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)
|
|
16
|
+
|
|
17
|
+
## Locations
|
|
18
|
+
|
|
19
|
+
Pi loads themes from:
|
|
20
|
+
|
|
21
|
+
- Built-in: `dark`, `light`
|
|
22
|
+
- Global: `~/.pi/agent/themes/*.json`
|
|
23
|
+
- Project: `.pi/themes/*.json` (only after the project is trusted)
|
|
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
|
|
31
|
+
|
|
32
|
+
Select a theme via `/settings` or in `settings.json`:
|
|
33
|
+
|
|
34
|
+
```json
|
|
35
|
+
{
|
|
36
|
+
"theme": "my-theme"
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
On first run, pi detects your terminal background and defaults to `dark` or `light`.
|
|
41
|
+
|
|
42
|
+
### Initial Theme
|
|
43
|
+
|
|
44
|
+
Start an interactive run with a theme without changing the saved setting:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
pi --use-theme light
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
To follow terminal appearance, use `lightTheme/darkTheme` syntax:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
pi --use-theme light/dark
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
The CLI value is the initial theme for that run. Choosing another theme later in `/settings` applies it immediately
|
|
57
|
+
and saves it normally.
|
|
58
|
+
|
|
59
|
+
## Creating a Custom Theme
|
|
60
|
+
|
|
61
|
+
1. Create a theme file:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
mkdir -p ~/.pi/agent/themes
|
|
65
|
+
vim ~/.pi/agent/themes/my-theme.json
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
2. Define the theme with all required colors (see [Color Tokens](#color-tokens)):
|
|
69
|
+
|
|
70
|
+
```json
|
|
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`.
|
|
268
|
+
|
|
269
|
+
```json
|
|
270
|
+
{
|
|
271
|
+
"export": {
|
|
272
|
+
"pageBg": "#18181e",
|
|
273
|
+
"cardBg": "#1e1e24",
|
|
274
|
+
"infoBg": "#3c3728"
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
## Color Values
|
|
280
|
+
|
|
281
|
+
Four formats are supported:
|
|
282
|
+
|
|
283
|
+
| Format | Example | Description |
|
|
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 |
|
|
289
|
+
|
|
290
|
+
### 256-Color Palette
|
|
291
|
+
|
|
292
|
+
- `0-15`: Basic ANSI colors (terminal-dependent)
|
|
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
|
|
295
|
+
|
|
296
|
+
### Terminal Compatibility
|
|
297
|
+
|
|
298
|
+
Pi uses 24-bit RGB colors. Most modern terminals support this (iTerm2, Kitty, WezTerm, Windows Terminal, VS Code). For older terminals with only 256-color support, pi falls back to the nearest approximation.
|
|
299
|
+
|
|
300
|
+
Check truecolor support:
|
|
301
|
+
|
|
302
|
+
```bash
|
|
303
|
+
echo $COLORTERM # Should output "truecolor" or "24bit"
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
## Tips
|
|
307
|
+
|
|
308
|
+
**Dark terminals:** Use bright, saturated colors with higher contrast.
|
|
309
|
+
|
|
310
|
+
**Light terminals:** Use darker, muted colors with lower contrast.
|
|
311
|
+
|
|
312
|
+
**Color harmony:** Start with a base palette (Nord, Gruvbox, Tokyo Night), define it in `vars`, and reference consistently.
|
|
313
|
+
|
|
314
|
+
**Testing:** Check your theme with different message types, tool states, markdown content, and long wrapped text.
|
|
315
|
+
|
|
316
|
+
**VS Code:** Set `terminal.integrated.minimumContrastRatio` to `1` for accurate colors.
|
|
317
|
+
|
|
318
|
+
## Examples
|
|
319
|
+
|
|
320
|
+
See the built-in themes:
|
|
321
|
+
- [dark.json](../src/modes/interactive/theme/dark.json)
|
|
322
|
+
- [light.json](../src/modes/interactive/theme/light.json)
|
package/docs/tmux.md
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# tmux Setup
|
|
2
|
+
|
|
3
|
+
Pi works inside tmux, but tmux strips modifier information from certain keys by default. Without configuration, `Shift+Enter` and `Ctrl+Enter` are usually indistinguishable from plain `Enter`.
|
|
4
|
+
|
|
5
|
+
## Recommended Configuration
|
|
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:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
tmux kill-server
|
|
18
|
+
tmux
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Pi requests extended key reporting automatically when Kitty keyboard protocol is not available. With `extended-keys-format csi-u`, tmux forwards modified keys in CSI-u format, which is the most reliable configuration. The `extended-keys-format` option requires tmux 3.5 or later.
|
|
22
|
+
|
|
23
|
+
## Why `csi-u` Is Recommended
|
|
24
|
+
|
|
25
|
+
With only:
|
|
26
|
+
|
|
27
|
+
```tmux
|
|
28
|
+
set -g extended-keys on
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
tmux defaults to `extended-keys-format xterm`. When an application requests extended key reporting, modified keys are forwarded in xterm `modifyOtherKeys` format such as:
|
|
32
|
+
|
|
33
|
+
- `Ctrl+C` → `\x1b[27;5;99~`
|
|
34
|
+
- `Ctrl+D` → `\x1b[27;5;100~`
|
|
35
|
+
- `Ctrl+Enter` → `\x1b[27;5;13~`
|
|
36
|
+
|
|
37
|
+
With `extended-keys-format csi-u`, the same keys are forwarded as:
|
|
38
|
+
|
|
39
|
+
- `Ctrl+C` → `\x1b[99;5u`
|
|
40
|
+
- `Ctrl+D` → `\x1b[100;5u`
|
|
41
|
+
- `Ctrl+Enter` → `\x1b[13;5u`
|
|
42
|
+
|
|
43
|
+
Pi supports both formats, but `csi-u` is the recommended tmux setup.
|
|
44
|
+
|
|
45
|
+
## What This Fixes
|
|
46
|
+
|
|
47
|
+
Without tmux extended keys, modified Enter keys collapse to legacy sequences:
|
|
48
|
+
|
|
49
|
+
| Key | Without extkeys | With `csi-u` |
|
|
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` |
|
|
55
|
+
|
|
56
|
+
This affects the default keybindings (`Enter` to submit, `Shift+Enter` for newline) and any custom keybindings using modified Enter.
|
|
57
|
+
|
|
58
|
+
## Requirements
|
|
59
|
+
|
|
60
|
+
- tmux 3.5 or later for `extended-keys-format csi-u` (run `tmux -V` to check)
|
|
61
|
+
- A terminal emulator that supports extended keys (Ghostty, Kitty, iTerm2, WezTerm, Windows Terminal)
|
|
62
|
+
|
|
63
|
+
With tmux 3.2 through 3.4, omit `extended-keys-format csi-u`; Pi still supports tmux's default xterm `modifyOtherKeys` format.
|