@oh-my-pi/pi-coding-agent 17.2.11 → 17.2.12
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 +13 -0
- package/dist/{CHANGELOG-d9xenpn9.md → CHANGELOG-k9ghy5sn.md} +13 -0
- package/dist/cli.js +10795 -10791
- package/dist/types/advisor/runtime.d.ts +1 -1
- package/dist/types/config/custom-models.d.ts +31 -0
- package/dist/types/config/model-config-values.d.ts +19 -0
- package/dist/types/config/model-patch.d.ts +93 -0
- package/dist/types/config/model-provider-discovery.d.ts +51 -0
- package/dist/types/config/model-registry.d.ts +5 -52
- package/dist/types/config/settings.d.ts +5 -3
- package/dist/types/debug/raw-sse-buffer.d.ts +9 -0
- package/dist/types/discovery/agent-plugin-format.d.ts +6 -13
- package/dist/types/discovery/contained-path.d.ts +2 -3
- package/dist/types/eval/executor-base.d.ts +8 -2
- package/dist/types/eval/kernel-session-registry.d.ts +60 -0
- package/dist/types/export/share.d.ts +1 -1
- package/dist/types/lsp/diagnostics.d.ts +96 -0
- package/dist/types/lsp/index.d.ts +7 -128
- package/dist/types/lsp/servers.d.ts +72 -0
- package/dist/types/lsp/tool.d.ts +42 -0
- package/dist/types/lsp/workspace-diagnostics.d.ts +12 -0
- package/dist/types/lsp/writethrough.d.ts +33 -0
- package/dist/types/mcp/transports/header-policy.d.ts +2 -1
- package/dist/types/modes/components/agent-hub-projection.d.ts +2 -7
- package/dist/types/modes/components/agent-hub-renderer.d.ts +0 -7
- package/dist/types/modes/theme/color.d.ts +19 -0
- package/dist/types/modes/theme/loader.d.ts +19 -0
- package/dist/types/modes/theme/schema.d.ts +175 -0
- package/dist/types/modes/theme/symbols.d.ts +28 -0
- package/dist/types/modes/theme/theme-class.d.ts +244 -0
- package/dist/types/modes/theme/theme.d.ts +9 -280
- package/dist/types/modes/theme/tui-adapters.d.ts +13 -0
- package/dist/types/registry/agent-registry.d.ts +1 -3
- package/dist/types/secrets/index.d.ts +3 -1
- package/dist/types/secrets/message-transform.d.ts +40 -0
- package/dist/types/secrets/obfuscator.d.ts +0 -108
- package/dist/types/secrets/placeholder-scan.d.ts +95 -0
- package/dist/types/secrets/placeholder.d.ts +94 -0
- package/dist/types/secrets/replacement.d.ts +82 -0
- package/dist/types/session/agent-session-types.d.ts +6 -0
- package/dist/types/session/agent-session.d.ts +1 -1
- package/dist/types/session/session-handoff.d.ts +3 -3
- package/dist/types/session/session-manager.d.ts +32 -0
- package/dist/types/session/session-provider-boundary.d.ts +1 -1
- package/dist/types/session/turn-recovery.d.ts +2 -2
- package/dist/types/slash-commands/builtin-collaboration.d.ts +2 -0
- package/dist/types/slash-commands/builtin-completions.d.ts +36 -0
- package/dist/types/slash-commands/builtin-control.d.ts +2 -0
- package/dist/types/slash-commands/builtin-lifecycle.d.ts +3 -0
- package/dist/types/slash-commands/builtin-marketplace.d.ts +11 -0
- package/dist/types/slash-commands/builtin-modes.d.ts +5 -0
- package/dist/types/slash-commands/builtin-registry.d.ts +1 -1
- package/dist/types/slash-commands/builtin-session.d.ts +2 -0
- package/dist/types/tools/gh-common.d.ts +69 -0
- package/dist/types/tools/gh-pr-checkout.d.ts +84 -0
- package/dist/types/tools/gh-pr-diff.d.ts +102 -0
- package/dist/types/tools/gh-run-watch.d.ts +78 -0
- package/dist/types/tools/gh-search.d.ts +61 -0
- package/dist/types/tools/gh-types.d.ts +340 -0
- package/dist/types/tools/gh-view.d.ts +88 -0
- package/dist/types/tools/gh.d.ts +4 -201
- package/dist/types/tools/read-archive.d.ts +16 -0
- package/dist/types/tools/read-format.d.ts +104 -0
- package/dist/types/tools/read-path-resolution.d.ts +19 -0
- package/dist/types/tools/read-pdf-images.d.ts +12 -0
- package/dist/types/tools/read-renderer.d.ts +24 -0
- package/dist/types/tools/read-selector.d.ts +27 -0
- package/dist/types/tools/read-sqlite.d.ts +16 -0
- package/dist/types/tools/read-summary.d.ts +19 -0
- package/dist/types/tools/read.d.ts +1 -23
- package/dist/types/tools/shell-tokenize.d.ts +2 -1
- package/dist/types/utils/changelog.d.ts +0 -5
- package/package.json +13 -13
- package/src/advisor/runtime.ts +12 -7
- package/src/config/custom-models.ts +188 -0
- package/src/config/model-config-values.ts +128 -0
- package/src/config/model-patch.ts +252 -0
- package/src/config/model-provider-discovery.ts +132 -0
- package/src/config/model-registry.ts +64 -704
- package/src/config/settings.ts +7 -3
- package/src/debug/raw-sse-buffer.ts +20 -0
- package/src/discovery/agent-plugin-format.ts +7 -7
- package/src/discovery/contained-path.ts +2 -5
- package/src/edit/hashline/diff.ts +5 -1
- package/src/eval/executor-base.ts +39 -6
- package/src/eval/jl/executor.ts +82 -371
- package/src/eval/kernel-session-registry.ts +398 -0
- package/src/eval/py/executor.ts +53 -261
- package/src/eval/rb/executor.ts +36 -279
- package/src/export/share.ts +2 -1
- package/src/lsp/diagnostics.ts +516 -0
- package/src/lsp/index.ts +20 -2819
- package/src/lsp/servers.ts +296 -0
- package/src/lsp/tool.ts +1352 -0
- package/src/lsp/workspace-diagnostics.ts +170 -0
- package/src/lsp/writethrough.ts +561 -0
- package/src/mcp/transports/header-policy.ts +1 -1
- package/src/modes/components/agent-hub-projection.ts +2 -2
- package/src/modes/components/agent-hub-renderer.ts +3 -7
- package/src/modes/controllers/command-controller.ts +4 -1
- package/src/modes/theme/color.ts +133 -0
- package/src/modes/theme/loader.ts +178 -0
- package/src/modes/theme/schema.ts +263 -0
- package/src/modes/theme/symbols.ts +1000 -0
- package/src/modes/theme/theme-class.ts +611 -0
- package/src/modes/theme/theme.ts +27 -2453
- package/src/modes/theme/tui-adapters.ts +279 -0
- package/src/registry/agent-registry.ts +2 -2
- package/src/secrets/index.ts +6 -12
- package/src/secrets/message-transform.ts +287 -0
- package/src/secrets/obfuscator.ts +39 -1303
- package/src/secrets/placeholder-scan.ts +506 -0
- package/src/secrets/placeholder.ts +309 -0
- package/src/secrets/replacement.ts +216 -0
- package/src/session/agent-session-types.ts +6 -0
- package/src/session/agent-session.ts +113 -7
- package/src/session/indexed-session-storage.ts +7 -2
- package/src/session/session-advisors.ts +32 -34
- package/src/session/session-handoff.ts +39 -20
- package/src/session/session-manager.ts +67 -3
- package/src/session/session-provider-boundary.ts +3 -6
- package/src/session/turn-recovery.ts +21 -12
- package/src/slash-commands/builtin-collaboration.ts +504 -0
- package/src/slash-commands/builtin-completions.ts +291 -0
- package/src/slash-commands/builtin-control.ts +78 -0
- package/src/slash-commands/builtin-lifecycle.ts +506 -0
- package/src/slash-commands/builtin-marketplace.ts +567 -0
- package/src/slash-commands/builtin-modes.ts +518 -0
- package/src/slash-commands/builtin-registry.ts +21 -3000
- package/src/slash-commands/builtin-session.ts +592 -0
- package/src/task/executor.ts +17 -14
- package/src/tools/gh-common.ts +288 -0
- package/src/tools/gh-pr-checkout.ts +679 -0
- package/src/tools/gh-pr-diff.ts +473 -0
- package/src/tools/gh-run-watch.ts +1015 -0
- package/src/tools/gh-search.ts +500 -0
- package/src/tools/gh-types.ts +379 -0
- package/src/tools/gh-view.ts +612 -0
- package/src/tools/gh.ts +109 -3821
- package/src/tools/read-archive.ts +209 -0
- package/src/tools/read-format.ts +593 -0
- package/src/tools/read-path-resolution.ts +36 -0
- package/src/tools/read-pdf-images.ts +250 -0
- package/src/tools/read-renderer.ts +289 -0
- package/src/tools/read-selector.ts +84 -0
- package/src/tools/read-sqlite.ts +215 -0
- package/src/tools/read-summary.ts +199 -0
- package/src/tools/read.ts +77 -1820
- package/src/tools/shell-tokenize.ts +1 -1
- package/src/utils/changelog.ts +1 -1
- package/src/utils/title-generator.ts +3 -1
- package/src/web/search/providers/zai.ts +12 -3
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
import type { ThinkingLevel } from "@oh-my-pi/pi-agent-core";
|
|
2
|
+
import type { Effort } from "@oh-my-pi/pi-ai";
|
|
3
|
+
import type { ColorMode, ThemeBg, ThemeColor } from "./schema.js";
|
|
4
|
+
import { type SpinnerType, type SymbolKey, type SymbolPreset } from "./symbols.js";
|
|
5
|
+
export declare class Theme {
|
|
6
|
+
#private;
|
|
7
|
+
private readonly mode;
|
|
8
|
+
private readonly symbolPreset;
|
|
9
|
+
/**
|
|
10
|
+
* Perceptual luma (0..1) of the status-line background — used to classify the
|
|
11
|
+
* theme light/dark. Undefined when it can't be resolved. Classified against the
|
|
12
|
+
* status line (the surface session accents render on) rather than the chat bubble
|
|
13
|
+
* (`userMessageBg`), which some themes (e.g. `porcelain`) style dark on an
|
|
14
|
+
* otherwise-light theme.
|
|
15
|
+
*/
|
|
16
|
+
readonly statusLineLuminance: number | undefined;
|
|
17
|
+
constructor(fgColors: Record<ThemeColor, string | number>, bgColors: Record<ThemeBg, string | number>, mode: ColorMode, symbolPreset: SymbolPreset, symbolOverrides: Partial<Record<SymbolKey, string>>, spinnerFramesOverrides?: Partial<Record<SpinnerType, string[]>>);
|
|
18
|
+
/** True when the active theme has a light status-line background. */
|
|
19
|
+
get isLight(): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Surface luminance to size session accents against on light themes; undefined on
|
|
22
|
+
* dark themes so accents stay vivid. Pass straight to `getSessionAccentHex`.
|
|
23
|
+
*/
|
|
24
|
+
get accentSurfaceLuminance(): number | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* Get the resolved CSS hex string for a foreground theme color.
|
|
27
|
+
*/
|
|
28
|
+
getColorHex(color: ThemeColor): string;
|
|
29
|
+
/**
|
|
30
|
+
* Get all foreground and background theme colors as CSS hex strings.
|
|
31
|
+
* Skips colors resolved to the default terminal color (unstyled).
|
|
32
|
+
*/
|
|
33
|
+
getAllThemeColorHexes(): string[];
|
|
34
|
+
/**
|
|
35
|
+
* Get the most visually dominant theme colors as CSS hex strings — accent,
|
|
36
|
+
* border, success, error, warning, heading, link, diff markers, etc.
|
|
37
|
+
* These are the colors the session accent could visually clash with.
|
|
38
|
+
* Skips colors resolved to the default terminal color (unstyled).
|
|
39
|
+
*/
|
|
40
|
+
getMajorThemeColorHexes(): string[];
|
|
41
|
+
/**
|
|
42
|
+
* Get the resolved CSS hex string for the theme's accent color.
|
|
43
|
+
*/
|
|
44
|
+
getAccentColorHex(): string;
|
|
45
|
+
fg(color: ThemeColor, text: string): string;
|
|
46
|
+
bg(color: ThemeBg, text: string): string;
|
|
47
|
+
bold(text: string): string;
|
|
48
|
+
italic(text: string): string;
|
|
49
|
+
underline(text: string): string;
|
|
50
|
+
strikethrough(text: string): string;
|
|
51
|
+
inverse(text: string): string;
|
|
52
|
+
getFgAnsi(color: ThemeColor): string;
|
|
53
|
+
getBgAnsi(color: ThemeBg): string;
|
|
54
|
+
/**
|
|
55
|
+
* Foreground ANSI for text drawn **on top of** `fillColor` used as a solid
|
|
56
|
+
* background (e.g. a powerline chip). Picks near-black or near-white by the
|
|
57
|
+
* fill's perceived luminance (Rec. 601 luma) so the label stays legible on
|
|
58
|
+
* both bright and dark fills, across light and dark themes.
|
|
59
|
+
*
|
|
60
|
+
* Reads the RGB out of the already-resolved truecolor escape; when the fill
|
|
61
|
+
* is encoded as a 256-palette index (limited terminals) the RGB is
|
|
62
|
+
* unavailable, so it falls back to the theme `text` color.
|
|
63
|
+
*/
|
|
64
|
+
getContrastFgAnsi(fillColor: ThemeColor): string;
|
|
65
|
+
getColorMode(): ColorMode;
|
|
66
|
+
getThinkingBorderColor(level: ThinkingLevel | Effort): (str: string) => string;
|
|
67
|
+
getBashModeBorderColor(): (str: string) => string;
|
|
68
|
+
getPythonModeBorderColor(): (str: string) => string;
|
|
69
|
+
/**
|
|
70
|
+
* Get a symbol by key.
|
|
71
|
+
*/
|
|
72
|
+
symbol(key: SymbolKey): string;
|
|
73
|
+
/**
|
|
74
|
+
* Get a symbol styled with a color.
|
|
75
|
+
*/
|
|
76
|
+
styledSymbol(key: SymbolKey, color: ThemeColor): string;
|
|
77
|
+
/**
|
|
78
|
+
* Get the current symbol preset.
|
|
79
|
+
*/
|
|
80
|
+
getSymbolPreset(): SymbolPreset;
|
|
81
|
+
get status(): {
|
|
82
|
+
success: string;
|
|
83
|
+
error: string;
|
|
84
|
+
warning: string;
|
|
85
|
+
info: string;
|
|
86
|
+
pending: string;
|
|
87
|
+
disabled: string;
|
|
88
|
+
enabled: string;
|
|
89
|
+
running: string;
|
|
90
|
+
shadowed: string;
|
|
91
|
+
aborted: string;
|
|
92
|
+
done: string;
|
|
93
|
+
};
|
|
94
|
+
get nav(): {
|
|
95
|
+
cursor: string;
|
|
96
|
+
selected: string;
|
|
97
|
+
expand: string;
|
|
98
|
+
collapse: string;
|
|
99
|
+
back: string;
|
|
100
|
+
};
|
|
101
|
+
get tree(): {
|
|
102
|
+
branch: string;
|
|
103
|
+
last: string;
|
|
104
|
+
vertical: string;
|
|
105
|
+
horizontal: string;
|
|
106
|
+
hook: string;
|
|
107
|
+
};
|
|
108
|
+
get boxRound(): {
|
|
109
|
+
topLeft: string;
|
|
110
|
+
topRight: string;
|
|
111
|
+
bottomLeft: string;
|
|
112
|
+
bottomRight: string;
|
|
113
|
+
horizontal: string;
|
|
114
|
+
vertical: string;
|
|
115
|
+
cross: string;
|
|
116
|
+
teeDown: string;
|
|
117
|
+
teeUp: string;
|
|
118
|
+
teeRight: string;
|
|
119
|
+
teeLeft: string;
|
|
120
|
+
};
|
|
121
|
+
get boxSharp(): {
|
|
122
|
+
topLeft: string;
|
|
123
|
+
topRight: string;
|
|
124
|
+
bottomLeft: string;
|
|
125
|
+
bottomRight: string;
|
|
126
|
+
horizontal: string;
|
|
127
|
+
vertical: string;
|
|
128
|
+
cross: string;
|
|
129
|
+
teeDown: string;
|
|
130
|
+
teeUp: string;
|
|
131
|
+
teeRight: string;
|
|
132
|
+
teeLeft: string;
|
|
133
|
+
};
|
|
134
|
+
get sep(): {
|
|
135
|
+
powerline: string;
|
|
136
|
+
powerlineThin: string;
|
|
137
|
+
powerlineLeft: string;
|
|
138
|
+
powerlineRight: string;
|
|
139
|
+
powerlineThinLeft: string;
|
|
140
|
+
powerlineThinRight: string;
|
|
141
|
+
block: string;
|
|
142
|
+
space: string;
|
|
143
|
+
asciiLeft: string;
|
|
144
|
+
asciiRight: string;
|
|
145
|
+
dot: string;
|
|
146
|
+
slash: string;
|
|
147
|
+
pipe: string;
|
|
148
|
+
};
|
|
149
|
+
get icon(): {
|
|
150
|
+
model: string;
|
|
151
|
+
plan: string;
|
|
152
|
+
prewalk: string;
|
|
153
|
+
goal: string;
|
|
154
|
+
pause: string;
|
|
155
|
+
loop: string;
|
|
156
|
+
folder: string;
|
|
157
|
+
worktree: string;
|
|
158
|
+
scratchFolder: string;
|
|
159
|
+
file: string;
|
|
160
|
+
git: string;
|
|
161
|
+
branch: string;
|
|
162
|
+
pr: string;
|
|
163
|
+
tokens: string;
|
|
164
|
+
context: string;
|
|
165
|
+
cost: string;
|
|
166
|
+
time: string;
|
|
167
|
+
pi: string;
|
|
168
|
+
ghost: string;
|
|
169
|
+
agents: string;
|
|
170
|
+
job: string;
|
|
171
|
+
cache: string;
|
|
172
|
+
cacheMiss: string;
|
|
173
|
+
input: string;
|
|
174
|
+
output: string;
|
|
175
|
+
throughput: string;
|
|
176
|
+
host: string;
|
|
177
|
+
session: string;
|
|
178
|
+
package: string;
|
|
179
|
+
warning: string;
|
|
180
|
+
rewind: string;
|
|
181
|
+
auto: string;
|
|
182
|
+
fast: string;
|
|
183
|
+
extensionSkill: string;
|
|
184
|
+
extensionTool: string;
|
|
185
|
+
extensionSlashCommand: string;
|
|
186
|
+
extensionMcp: string;
|
|
187
|
+
extensionRule: string;
|
|
188
|
+
extensionHook: string;
|
|
189
|
+
extensionPrompt: string;
|
|
190
|
+
extensionContextFile: string;
|
|
191
|
+
extensionInstruction: string;
|
|
192
|
+
mic: string;
|
|
193
|
+
camera: string;
|
|
194
|
+
};
|
|
195
|
+
get thinking(): {
|
|
196
|
+
minimal: string;
|
|
197
|
+
low: string;
|
|
198
|
+
medium: string;
|
|
199
|
+
high: string;
|
|
200
|
+
xhigh: string;
|
|
201
|
+
max: string;
|
|
202
|
+
autoPending: string;
|
|
203
|
+
};
|
|
204
|
+
get checkbox(): {
|
|
205
|
+
checked: string;
|
|
206
|
+
unchecked: string;
|
|
207
|
+
};
|
|
208
|
+
get radio(): {
|
|
209
|
+
selected: string;
|
|
210
|
+
unselected: string;
|
|
211
|
+
};
|
|
212
|
+
get format(): {
|
|
213
|
+
bullet: string;
|
|
214
|
+
dash: string;
|
|
215
|
+
bracketLeft: string;
|
|
216
|
+
bracketRight: string;
|
|
217
|
+
};
|
|
218
|
+
get md(): {
|
|
219
|
+
quoteBorder: string;
|
|
220
|
+
hrChar: string;
|
|
221
|
+
bullet: string;
|
|
222
|
+
colorSwatch: string;
|
|
223
|
+
};
|
|
224
|
+
/**
|
|
225
|
+
* Default spinner frames (status spinner).
|
|
226
|
+
*/
|
|
227
|
+
get spinnerFrames(): string[];
|
|
228
|
+
/**
|
|
229
|
+
* Get spinner frames by type.
|
|
230
|
+
*/
|
|
231
|
+
getSpinnerFrames(type?: SpinnerType): string[];
|
|
232
|
+
/**
|
|
233
|
+
* Get language icon for a language name.
|
|
234
|
+
* Maps common language names to their corresponding symbol keys.
|
|
235
|
+
*/
|
|
236
|
+
getLangIcon(lang: string | undefined): string;
|
|
237
|
+
/**
|
|
238
|
+
* Language icon tinted with the language's brand color (see
|
|
239
|
+
* {@link LANG_BRAND_COLORS}). Falls back to the muted theme color for
|
|
240
|
+
* languages without a brand entry, and returns the bare (possibly empty)
|
|
241
|
+
* icon when the active symbol preset has none.
|
|
242
|
+
*/
|
|
243
|
+
getLangIconStyled(lang: string | undefined): string;
|
|
244
|
+
}
|
|
@@ -1,265 +1,13 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
1
|
+
import type { Terminal } from "@oh-my-pi/pi-tui";
|
|
2
|
+
import type { ThemeColor } from "./schema.js";
|
|
3
|
+
import type { SymbolPreset } from "./symbols.js";
|
|
4
|
+
import type { Theme } from "./theme-class.js";
|
|
4
5
|
export { getLanguageFromPath, isMarkdownPath } from "../../utils/lang-from-path.js";
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export
|
|
10
|
-
export type SpinnerType = "status" | "activity";
|
|
11
|
-
export type ThemeColor = "accent" | "border" | "borderAccent" | "borderMuted" | "success" | "error" | "warning" | "muted" | "dim" | "text" | "thinkingText" | "userMessageText" | "customMessageText" | "customMessageLabel" | "toolTitle" | "toolOutput" | "mdHeading" | "mdLink" | "mdLinkUrl" | "mdCode" | "mdCodeBlock" | "mdCodeBlockBorder" | "mdQuote" | "mdQuoteBorder" | "mdHr" | "mdListBullet" | "toolDiffAdded" | "toolDiffRemoved" | "toolDiffContext" | "syntaxComment" | "syntaxKeyword" | "syntaxFunction" | "syntaxVariable" | "syntaxString" | "syntaxNumber" | "syntaxType" | "syntaxOperator" | "syntaxPunctuation" | "thinkingOff" | "thinkingMinimal" | "thinkingLow" | "thinkingMedium" | "thinkingHigh" | "thinkingXhigh" | "thinkingMax" | "bashMode" | "pythonMode" | "statusLineSep" | "statusLineModel" | "statusLinePath" | "statusLineGitClean" | "statusLineGitDirty" | "statusLineContext" | "statusLineSpend" | "statusLineStaged" | "statusLineDirty" | "statusLineUntracked" | "statusLineOutput" | "statusLineCost" | "statusLineSubagents";
|
|
12
|
-
/** Check if a string is a valid ThemeColor value */
|
|
13
|
-
export declare function isValidThemeColor(color: string): color is ThemeColor;
|
|
14
|
-
export type ThemeBg = "selectedBg" | "userMessageBg" | "customMessageBg" | "toolPendingBg" | "toolSuccessBg" | "toolErrorBg" | "statusLineBg";
|
|
15
|
-
type ColorMode = "truecolor" | "256color";
|
|
16
|
-
export declare class Theme {
|
|
17
|
-
#private;
|
|
18
|
-
private readonly mode;
|
|
19
|
-
private readonly symbolPreset;
|
|
20
|
-
/**
|
|
21
|
-
* Perceptual luma (0..1) of the status-line background — used to classify the
|
|
22
|
-
* theme light/dark. Undefined when it can't be resolved. Classified against the
|
|
23
|
-
* status line (the surface session accents render on) rather than the chat bubble
|
|
24
|
-
* (`userMessageBg`), which some themes (e.g. `porcelain`) style dark on an
|
|
25
|
-
* otherwise-light theme.
|
|
26
|
-
*/
|
|
27
|
-
readonly statusLineLuminance: number | undefined;
|
|
28
|
-
constructor(fgColors: Record<ThemeColor, string | number>, bgColors: Record<ThemeBg, string | number>, mode: ColorMode, symbolPreset: SymbolPreset, symbolOverrides: Partial<Record<SymbolKey, string>>, spinnerFramesOverrides?: Partial<Record<SpinnerType, string[]>>);
|
|
29
|
-
/** True when the active theme has a light status-line background. */
|
|
30
|
-
get isLight(): boolean;
|
|
31
|
-
/**
|
|
32
|
-
* Surface luminance to size session accents against on light themes; undefined on
|
|
33
|
-
* dark themes so accents stay vivid. Pass straight to `getSessionAccentHex`.
|
|
34
|
-
*/
|
|
35
|
-
get accentSurfaceLuminance(): number | undefined;
|
|
36
|
-
/**
|
|
37
|
-
* Get the resolved CSS hex string for a foreground theme color.
|
|
38
|
-
*/
|
|
39
|
-
getColorHex(color: ThemeColor): string;
|
|
40
|
-
/**
|
|
41
|
-
* Get all foreground and background theme colors as CSS hex strings.
|
|
42
|
-
* Skips colors resolved to the default terminal color (unstyled).
|
|
43
|
-
*/
|
|
44
|
-
getAllThemeColorHexes(): string[];
|
|
45
|
-
/**
|
|
46
|
-
* Get the most visually dominant theme colors as CSS hex strings — accent,
|
|
47
|
-
* border, success, error, warning, heading, link, diff markers, etc.
|
|
48
|
-
* These are the colors the session accent could visually clash with.
|
|
49
|
-
* Skips colors resolved to the default terminal color (unstyled).
|
|
50
|
-
*/
|
|
51
|
-
getMajorThemeColorHexes(): string[];
|
|
52
|
-
/**
|
|
53
|
-
* Get the resolved CSS hex string for the theme's accent color.
|
|
54
|
-
*/
|
|
55
|
-
getAccentColorHex(): string;
|
|
56
|
-
fg(color: ThemeColor, text: string): string;
|
|
57
|
-
bg(color: ThemeBg, text: string): string;
|
|
58
|
-
bold(text: string): string;
|
|
59
|
-
italic(text: string): string;
|
|
60
|
-
underline(text: string): string;
|
|
61
|
-
strikethrough(text: string): string;
|
|
62
|
-
inverse(text: string): string;
|
|
63
|
-
getFgAnsi(color: ThemeColor): string;
|
|
64
|
-
getBgAnsi(color: ThemeBg): string;
|
|
65
|
-
/**
|
|
66
|
-
* Foreground ANSI for text drawn **on top of** `fillColor` used as a solid
|
|
67
|
-
* background (e.g. a powerline chip). Picks near-black or near-white by the
|
|
68
|
-
* fill's perceived luminance (Rec. 601 luma) so the label stays legible on
|
|
69
|
-
* both bright and dark fills, across light and dark themes.
|
|
70
|
-
*
|
|
71
|
-
* Reads the RGB out of the already-resolved truecolor escape; when the fill
|
|
72
|
-
* is encoded as a 256-palette index (limited terminals) the RGB is
|
|
73
|
-
* unavailable, so it falls back to the theme `text` color.
|
|
74
|
-
*/
|
|
75
|
-
getContrastFgAnsi(fillColor: ThemeColor): string;
|
|
76
|
-
getColorMode(): ColorMode;
|
|
77
|
-
getThinkingBorderColor(level: ThinkingLevel | Effort): (str: string) => string;
|
|
78
|
-
getBashModeBorderColor(): (str: string) => string;
|
|
79
|
-
getPythonModeBorderColor(): (str: string) => string;
|
|
80
|
-
/**
|
|
81
|
-
* Get a symbol by key.
|
|
82
|
-
*/
|
|
83
|
-
symbol(key: SymbolKey): string;
|
|
84
|
-
/**
|
|
85
|
-
* Get a symbol styled with a color.
|
|
86
|
-
*/
|
|
87
|
-
styledSymbol(key: SymbolKey, color: ThemeColor): string;
|
|
88
|
-
/**
|
|
89
|
-
* Get the current symbol preset.
|
|
90
|
-
*/
|
|
91
|
-
getSymbolPreset(): SymbolPreset;
|
|
92
|
-
get status(): {
|
|
93
|
-
success: string;
|
|
94
|
-
error: string;
|
|
95
|
-
warning: string;
|
|
96
|
-
info: string;
|
|
97
|
-
pending: string;
|
|
98
|
-
disabled: string;
|
|
99
|
-
enabled: string;
|
|
100
|
-
running: string;
|
|
101
|
-
shadowed: string;
|
|
102
|
-
aborted: string;
|
|
103
|
-
done: string;
|
|
104
|
-
};
|
|
105
|
-
get nav(): {
|
|
106
|
-
cursor: string;
|
|
107
|
-
selected: string;
|
|
108
|
-
expand: string;
|
|
109
|
-
collapse: string;
|
|
110
|
-
back: string;
|
|
111
|
-
};
|
|
112
|
-
get tree(): {
|
|
113
|
-
branch: string;
|
|
114
|
-
last: string;
|
|
115
|
-
vertical: string;
|
|
116
|
-
horizontal: string;
|
|
117
|
-
hook: string;
|
|
118
|
-
};
|
|
119
|
-
get boxRound(): {
|
|
120
|
-
topLeft: string;
|
|
121
|
-
topRight: string;
|
|
122
|
-
bottomLeft: string;
|
|
123
|
-
bottomRight: string;
|
|
124
|
-
horizontal: string;
|
|
125
|
-
vertical: string;
|
|
126
|
-
cross: string;
|
|
127
|
-
teeDown: string;
|
|
128
|
-
teeUp: string;
|
|
129
|
-
teeRight: string;
|
|
130
|
-
teeLeft: string;
|
|
131
|
-
};
|
|
132
|
-
get boxSharp(): {
|
|
133
|
-
topLeft: string;
|
|
134
|
-
topRight: string;
|
|
135
|
-
bottomLeft: string;
|
|
136
|
-
bottomRight: string;
|
|
137
|
-
horizontal: string;
|
|
138
|
-
vertical: string;
|
|
139
|
-
cross: string;
|
|
140
|
-
teeDown: string;
|
|
141
|
-
teeUp: string;
|
|
142
|
-
teeRight: string;
|
|
143
|
-
teeLeft: string;
|
|
144
|
-
};
|
|
145
|
-
get sep(): {
|
|
146
|
-
powerline: string;
|
|
147
|
-
powerlineThin: string;
|
|
148
|
-
powerlineLeft: string;
|
|
149
|
-
powerlineRight: string;
|
|
150
|
-
powerlineThinLeft: string;
|
|
151
|
-
powerlineThinRight: string;
|
|
152
|
-
block: string;
|
|
153
|
-
space: string;
|
|
154
|
-
asciiLeft: string;
|
|
155
|
-
asciiRight: string;
|
|
156
|
-
dot: string;
|
|
157
|
-
slash: string;
|
|
158
|
-
pipe: string;
|
|
159
|
-
};
|
|
160
|
-
get icon(): {
|
|
161
|
-
model: string;
|
|
162
|
-
plan: string;
|
|
163
|
-
prewalk: string;
|
|
164
|
-
goal: string;
|
|
165
|
-
pause: string;
|
|
166
|
-
loop: string;
|
|
167
|
-
folder: string;
|
|
168
|
-
worktree: string;
|
|
169
|
-
scratchFolder: string;
|
|
170
|
-
file: string;
|
|
171
|
-
git: string;
|
|
172
|
-
branch: string;
|
|
173
|
-
pr: string;
|
|
174
|
-
tokens: string;
|
|
175
|
-
context: string;
|
|
176
|
-
cost: string;
|
|
177
|
-
time: string;
|
|
178
|
-
pi: string;
|
|
179
|
-
ghost: string;
|
|
180
|
-
agents: string;
|
|
181
|
-
job: string;
|
|
182
|
-
cache: string;
|
|
183
|
-
cacheMiss: string;
|
|
184
|
-
input: string;
|
|
185
|
-
output: string;
|
|
186
|
-
throughput: string;
|
|
187
|
-
host: string;
|
|
188
|
-
session: string;
|
|
189
|
-
package: string;
|
|
190
|
-
warning: string;
|
|
191
|
-
rewind: string;
|
|
192
|
-
auto: string;
|
|
193
|
-
fast: string;
|
|
194
|
-
extensionSkill: string;
|
|
195
|
-
extensionTool: string;
|
|
196
|
-
extensionSlashCommand: string;
|
|
197
|
-
extensionMcp: string;
|
|
198
|
-
extensionRule: string;
|
|
199
|
-
extensionHook: string;
|
|
200
|
-
extensionPrompt: string;
|
|
201
|
-
extensionContextFile: string;
|
|
202
|
-
extensionInstruction: string;
|
|
203
|
-
mic: string;
|
|
204
|
-
camera: string;
|
|
205
|
-
};
|
|
206
|
-
get thinking(): {
|
|
207
|
-
minimal: string;
|
|
208
|
-
low: string;
|
|
209
|
-
medium: string;
|
|
210
|
-
high: string;
|
|
211
|
-
xhigh: string;
|
|
212
|
-
max: string;
|
|
213
|
-
autoPending: string;
|
|
214
|
-
};
|
|
215
|
-
get checkbox(): {
|
|
216
|
-
checked: string;
|
|
217
|
-
unchecked: string;
|
|
218
|
-
};
|
|
219
|
-
get radio(): {
|
|
220
|
-
selected: string;
|
|
221
|
-
unselected: string;
|
|
222
|
-
};
|
|
223
|
-
get format(): {
|
|
224
|
-
bullet: string;
|
|
225
|
-
dash: string;
|
|
226
|
-
bracketLeft: string;
|
|
227
|
-
bracketRight: string;
|
|
228
|
-
};
|
|
229
|
-
get md(): {
|
|
230
|
-
quoteBorder: string;
|
|
231
|
-
hrChar: string;
|
|
232
|
-
bullet: string;
|
|
233
|
-
colorSwatch: string;
|
|
234
|
-
};
|
|
235
|
-
/**
|
|
236
|
-
* Default spinner frames (status spinner).
|
|
237
|
-
*/
|
|
238
|
-
get spinnerFrames(): string[];
|
|
239
|
-
/**
|
|
240
|
-
* Get spinner frames by type.
|
|
241
|
-
*/
|
|
242
|
-
getSpinnerFrames(type?: SpinnerType): string[];
|
|
243
|
-
/**
|
|
244
|
-
* Get language icon for a language name.
|
|
245
|
-
* Maps common language names to their corresponding symbol keys.
|
|
246
|
-
*/
|
|
247
|
-
getLangIcon(lang: string | undefined): string;
|
|
248
|
-
/**
|
|
249
|
-
* Language icon tinted with the language's brand color (see
|
|
250
|
-
* {@link LANG_BRAND_COLORS}). Falls back to the muted theme color for
|
|
251
|
-
* languages without a brand entry, and returns the bare (possibly empty)
|
|
252
|
-
* icon when the active symbol preset has none.
|
|
253
|
-
*/
|
|
254
|
-
getLangIconStyled(lang: string | undefined): string;
|
|
255
|
-
}
|
|
256
|
-
export declare function getAvailableThemes(): Promise<string[]>;
|
|
257
|
-
export interface ThemeInfo {
|
|
258
|
-
name: string;
|
|
259
|
-
path: string | undefined;
|
|
260
|
-
}
|
|
261
|
-
export declare function getAvailableThemesWithPaths(): Promise<ThemeInfo[]>;
|
|
262
|
-
export declare function getThemeByName(name: string): Promise<Theme | undefined>;
|
|
6
|
+
export { getAvailableThemes, getAvailableThemesWithPaths, getThemeByName, type ThemeInfo } from "./loader.js";
|
|
7
|
+
export { isValidThemeColor, type ThemeBg, type ThemeColor } from "./schema.js";
|
|
8
|
+
export { getAvailableSymbolPresets, isValidSymbolPreset, type SpinnerType, type SymbolKey, type SymbolPreset, } from "./symbols.js";
|
|
9
|
+
export { Theme } from "./theme-class.js";
|
|
10
|
+
export { getEditorTheme, getMarkdownTheme, getSelectListTheme, getSettingsListTheme, getSymbolTheme, highlightCode, setMarkdownMermaidRendering, } from "./tui-adapters.js";
|
|
263
11
|
export declare var theme: Theme;
|
|
264
12
|
/** Get the name of the currently active theme. */
|
|
265
13
|
export declare function getCurrentThemeName(): string | undefined;
|
|
@@ -320,14 +68,6 @@ export declare function onThemeChange(callback: (event: ThemeChangeEvent) => voi
|
|
|
320
68
|
* key cached renders on it so the next render re-shapes their output.
|
|
321
69
|
*/
|
|
322
70
|
export declare function getThemeEpoch(): number;
|
|
323
|
-
/**
|
|
324
|
-
* Get available symbol presets.
|
|
325
|
-
*/
|
|
326
|
-
export declare function getAvailableSymbolPresets(): SymbolPreset[];
|
|
327
|
-
/**
|
|
328
|
-
* Check if a string is a valid symbol preset.
|
|
329
|
-
*/
|
|
330
|
-
export declare function isValidSymbolPreset(preset: string): preset is SymbolPreset;
|
|
331
71
|
type MacOSAppearanceReprobeTerminal = Pick<Terminal, "appearance" | "onAppearanceChange" | "onAppearanceReport" | "onPrivateModeReport" | "refreshAppearance">;
|
|
332
72
|
/**
|
|
333
73
|
* Fall back to native macOS appearance notifications when the terminal
|
|
@@ -360,14 +100,3 @@ export declare function getThemeExportColors(themeName?: string): Promise<{
|
|
|
360
100
|
cardBg?: string;
|
|
361
101
|
infoBg?: string;
|
|
362
102
|
}>;
|
|
363
|
-
/**
|
|
364
|
-
* Highlight code with syntax coloring based on file extension or language.
|
|
365
|
-
* Returns array of highlighted lines.
|
|
366
|
-
*/
|
|
367
|
-
export declare function highlightCode(code: string, lang?: string, highlightTheme?: Theme): string[];
|
|
368
|
-
export declare function getSymbolTheme(): SymbolTheme;
|
|
369
|
-
export declare function setMarkdownMermaidRendering(enabled: boolean): void;
|
|
370
|
-
export declare function getMarkdownTheme(): MarkdownTheme;
|
|
371
|
-
export declare function getSelectListTheme(): SelectListTheme;
|
|
372
|
-
export declare function getEditorTheme(): EditorTheme;
|
|
373
|
-
export declare function getSettingsListTheme(): SettingsListTheme;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { EditorTheme, MarkdownTheme, SelectListTheme, SettingsListTheme, SymbolTheme } from "@oh-my-pi/pi-tui";
|
|
2
|
+
import type { Theme } from "./theme-class.js";
|
|
3
|
+
/**
|
|
4
|
+
* Highlight code with syntax coloring based on file extension or language.
|
|
5
|
+
* Returns array of highlighted lines.
|
|
6
|
+
*/
|
|
7
|
+
export declare function highlightCode(code: string, lang?: string, highlightTheme?: Theme): string[];
|
|
8
|
+
export declare function getSymbolTheme(): SymbolTheme;
|
|
9
|
+
export declare function setMarkdownMermaidRendering(enabled: boolean): void;
|
|
10
|
+
export declare function getMarkdownTheme(): MarkdownTheme;
|
|
11
|
+
export declare function getSelectListTheme(): SelectListTheme;
|
|
12
|
+
export declare function getEditorTheme(): EditorTheme;
|
|
13
|
+
export declare function getSettingsListTheme(): SettingsListTheme;
|
|
@@ -10,8 +10,6 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import type { AgentSession } from "../session/agent-session.js";
|
|
12
12
|
export declare const MAIN_AGENT_ID = "Main";
|
|
13
|
-
/** Sidecar marker retained beside a child transcript after an explicit kill. */
|
|
14
|
-
export declare const AGENT_TOMBSTONE_SUFFIX = ".tombstone";
|
|
15
13
|
export declare function getAgentTombstonePath(sessionFile: string): string;
|
|
16
14
|
/**
|
|
17
15
|
* - `running`: a turn is in flight.
|
|
@@ -22,7 +20,7 @@ export declare function getAgentTombstonePath(sessionFile: string): string;
|
|
|
22
20
|
*/
|
|
23
21
|
export type AgentStatus = "running" | "idle" | "parked" | "aborted";
|
|
24
22
|
/** Provenance of a displayed duration: active runtime, transcript span, or unavailable. */
|
|
25
|
-
|
|
23
|
+
type AgentDurationKind = "active" | "span" | "unknown";
|
|
26
24
|
/**
|
|
27
25
|
* - `main`/`sub`: the user-facing agent tree (driving agent + task subagents).
|
|
28
26
|
* - `advisor`: a passive review transcript persisted like a subagent for usage
|
|
@@ -18,7 +18,9 @@ export declare function getExistingSecretPlaceholderKey(keyDir?: string): Promis
|
|
|
18
18
|
* key (with a warning) instead of breaking the session.
|
|
19
19
|
*/
|
|
20
20
|
export declare function getSecretPlaceholderKeySync(keyDir?: string): string;
|
|
21
|
-
export { deobfuscateSessionContext, deobfuscateToolArguments, obfuscateMessages, obfuscateProviderContext,
|
|
21
|
+
export { deobfuscateSessionContext, deobfuscateToolArguments, obfuscateMessages, obfuscateProviderContext, } from "./message-transform.js";
|
|
22
|
+
export { type SecretEntry, SecretObfuscator } from "./obfuscator.js";
|
|
23
|
+
export { secretEntriesNeedPlaceholderKey, secretEntryNeedsPlaceholderKey } from "./placeholder.js";
|
|
22
24
|
/**
|
|
23
25
|
* Load secrets from project-local and global secrets.yml files.
|
|
24
26
|
* Project-local entries override global entries with matching content.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { AgentMessage } from "@oh-my-pi/pi-agent-core";
|
|
2
|
+
import type { AssistantMessage, Context, Message } from "@oh-my-pi/pi-ai";
|
|
3
|
+
import type { SessionContext } from "../session/session-context.js";
|
|
4
|
+
import type { SecretObfuscator } from "./obfuscator.js";
|
|
5
|
+
/**
|
|
6
|
+
* Restore secret placeholders for local display. Only message kinds the model
|
|
7
|
+
* itself authored from obfuscated context carry placeholders — assistant
|
|
8
|
+
* content and the LLM-written branch/compaction summaries. User, developer, and
|
|
9
|
+
* tool-result messages are persisted with their literal text, so operator-authored
|
|
10
|
+
* placeholder-shaped text must survive untouched; those roles are never walked.
|
|
11
|
+
*/
|
|
12
|
+
export declare function deobfuscateSessionContext(sessionContext: SessionContext, obfuscator: SecretObfuscator | undefined): SessionContext;
|
|
13
|
+
export declare function deobfuscateAgentMessages(obfuscator: SecretObfuscator, messages: AgentMessage[]): AgentMessage[];
|
|
14
|
+
/**
|
|
15
|
+
* Restore placeholders in assistant content: visible text and tool-call
|
|
16
|
+
* arguments/intent/rawBlock. Thinking and signatures are opaque
|
|
17
|
+
* provider-replay/hidden-reasoning data and pass through byte-identical.
|
|
18
|
+
*/
|
|
19
|
+
export declare function deobfuscateAssistantContent(obfuscator: SecretObfuscator, content: AssistantMessage["content"]): AssistantMessage["content"];
|
|
20
|
+
/**
|
|
21
|
+
* Restore placeholders inside a tool call's arguments. Arguments are arbitrary
|
|
22
|
+
* model-authored JSON, so tool-call arguments are the ONLY place a recursive
|
|
23
|
+
* JSON walk runs.
|
|
24
|
+
*/
|
|
25
|
+
export declare function deobfuscateToolArguments(obfuscator: SecretObfuscator, args: Record<string, unknown>): Record<string, unknown>;
|
|
26
|
+
/** Redact secrets inside a tool call's arguments (same JSON-walk exception as {@link deobfuscateToolArguments}). */
|
|
27
|
+
export declare function obfuscateToolArguments(obfuscator: SecretObfuscator, args: Record<string, unknown>, sharedRegexSecretValues?: ReadonlySet<string>): Record<string, unknown>;
|
|
28
|
+
/**
|
|
29
|
+
* Redact secrets from outbound messages. User messages, tool results, and
|
|
30
|
+
* user-authored developer messages (e.g. `@file` mentions) are obfuscated.
|
|
31
|
+
* Assistant replay content is re-obfuscated too, because session restoration
|
|
32
|
+
* expands keyed placeholders locally before the next provider request. Inline
|
|
33
|
+
* image bytes are never walked.
|
|
34
|
+
*/
|
|
35
|
+
export declare function obfuscateMessages(obfuscator: SecretObfuscator, messages: Message[]): Message[];
|
|
36
|
+
/**
|
|
37
|
+
* Redact outbound provider context. Only conversation messages are rewritten;
|
|
38
|
+
* the static system prompt and tool schemas pass through unchanged.
|
|
39
|
+
*/
|
|
40
|
+
export declare function obfuscateProviderContext(obfuscator: SecretObfuscator | undefined, context: Context): Context;
|