@router-for-me/pi-cliproxyapi-provider 1.4.11 → 1.4.13
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/extensions/fast-footer.ts +12 -1
- package/extensions/tps.ts +7 -13
- package/package.json +1 -1
|
@@ -5,6 +5,10 @@ import { type PauseController, pauseController } from "./pause.ts";
|
|
|
5
5
|
|
|
6
6
|
const FAST_FOOTER_PATCH = Symbol.for("@router-for-me/pi-cliproxyapi-provider/fast-footer-patch");
|
|
7
7
|
const FAST_REFRESH_STATUS_KEY = "cliproxyapi-fast-refresh";
|
|
8
|
+
// Orange labels: truecolor #ffa500, xterm 214
|
|
9
|
+
const ORANGE_TRUECOLOR = "\x1b[38;2;255;165;0m";
|
|
10
|
+
const ORANGE_256 = "\x1b[38;5;214m";
|
|
11
|
+
const FG_RESET = "\x1b[39m";
|
|
8
12
|
|
|
9
13
|
interface MutableModel {
|
|
10
14
|
id: string;
|
|
@@ -57,6 +61,13 @@ export function formatFastModelStatus(
|
|
|
57
61
|
return status;
|
|
58
62
|
}
|
|
59
63
|
|
|
64
|
+
/** Colorize status labels in orange (distinct from yellow warning/fast). */
|
|
65
|
+
export function formatOrangeLabel(theme: { getColorMode?: () => string } | undefined, text: string): string {
|
|
66
|
+
if (!theme) return text;
|
|
67
|
+
const ansi = theme.getColorMode?.() === "truecolor" ? ORANGE_TRUECOLOR : ORANGE_256;
|
|
68
|
+
return `${ansi}${text}${FG_RESET}`;
|
|
69
|
+
}
|
|
70
|
+
|
|
60
71
|
function installFooterPatch(controller: FastFooterController): void {
|
|
61
72
|
const prototype = FooterComponent.prototype as PatchableFooterPrototype;
|
|
62
73
|
let patchState = prototype[FAST_FOOTER_PATCH];
|
|
@@ -158,7 +169,7 @@ export class FastFooterController {
|
|
|
158
169
|
formatModelStatus(modelName: string, supportsReasoning: boolean, thinkingLevel: string, fastEnabled = true): string {
|
|
159
170
|
const theme = this.activeContext?.ui.theme;
|
|
160
171
|
const fastLabel = theme?.fg("warning", "fast") ?? "fast";
|
|
161
|
-
const pausedLabel = theme
|
|
172
|
+
const pausedLabel = formatOrangeLabel(theme, "paused");
|
|
162
173
|
return formatFastModelStatus(
|
|
163
174
|
modelName,
|
|
164
175
|
supportsReasoning,
|
package/extensions/tps.ts
CHANGED
|
@@ -126,9 +126,9 @@ export default function (pi: ExtensionAPI) {
|
|
|
126
126
|
});
|
|
127
127
|
|
|
128
128
|
pi.on("agent_end", (event, ctx) => {
|
|
129
|
+
if (requestStartMs === null) return;
|
|
129
130
|
// Ignore usage from subagent / non-TUI sessions.
|
|
130
131
|
if (!isPrimaryUiSession(ctx)) return;
|
|
131
|
-
if (requestStartMs === null) return;
|
|
132
132
|
|
|
133
133
|
for (const message of event.messages) {
|
|
134
134
|
if (!isAssistantMessage(message)) continue;
|
|
@@ -141,9 +141,9 @@ export default function (pi: ExtensionAPI) {
|
|
|
141
141
|
});
|
|
142
142
|
|
|
143
143
|
pi.on("agent_settled", (_event, ctx) => {
|
|
144
|
+
if (requestStartMs === null) return;
|
|
144
145
|
// Subagents must never clear the parent elapsed status or notify TPS.
|
|
145
146
|
if (!isPrimaryUiSession(ctx)) return;
|
|
146
|
-
if (requestStartMs === null) return;
|
|
147
147
|
|
|
148
148
|
const elapsedMs = getElapsedMs();
|
|
149
149
|
const elapsedSecondsExact = elapsedMs / 1000;
|
|
@@ -164,17 +164,11 @@ export default function (pi: ExtensionAPI) {
|
|
|
164
164
|
});
|
|
165
165
|
|
|
166
166
|
pi.on("session_shutdown", (_event, ctx) => {
|
|
167
|
-
if (statusCtx !== ctx && !isPrimaryUiSession(ctx)) return;
|
|
168
|
-
|
|
169
167
|
clearRefreshTimer();
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
pausedDurationAtStartMs = 0;
|
|
176
|
-
pauseWasEnabledAtStart = false;
|
|
177
|
-
statusCtx = null;
|
|
178
|
-
}
|
|
168
|
+
clearStatus(ctx);
|
|
169
|
+
requestStartMs = null;
|
|
170
|
+
pausedDurationAtStartMs = 0;
|
|
171
|
+
pauseWasEnabledAtStart = false;
|
|
172
|
+
statusCtx = null;
|
|
179
173
|
});
|
|
180
174
|
}
|
package/package.json
CHANGED