@clubnet/seedclub 0.2.25 → 0.2.26
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.
|
@@ -83,6 +83,30 @@ function getDebugText(result: any, expanded: boolean): string | null {
|
|
|
83
83
|
return blocks.join("\n\n");
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
+
function getCachedDebugText(state: any, result: any, expanded: boolean): string | null {
|
|
87
|
+
const debugMode = isUiDebugEnabled() || expanded;
|
|
88
|
+
if (!debugMode) {
|
|
89
|
+
state.__debugText = null;
|
|
90
|
+
state.__debugMode = false;
|
|
91
|
+
state.__debugDetailsRef = undefined;
|
|
92
|
+
state.__debugContentRef = undefined;
|
|
93
|
+
return null;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const detailsRef = result?.details;
|
|
97
|
+
const contentRef = result?.content?.[0]?.text;
|
|
98
|
+
const modeChanged = state.__debugMode !== debugMode;
|
|
99
|
+
const changed =
|
|
100
|
+
modeChanged || state.__debugDetailsRef !== detailsRef || state.__debugContentRef !== contentRef;
|
|
101
|
+
if (changed) {
|
|
102
|
+
state.__debugText = getDebugText(result, expanded);
|
|
103
|
+
state.__debugMode = debugMode;
|
|
104
|
+
state.__debugDetailsRef = detailsRef;
|
|
105
|
+
state.__debugContentRef = contentRef;
|
|
106
|
+
}
|
|
107
|
+
return state.__debugText ?? null;
|
|
108
|
+
}
|
|
109
|
+
|
|
86
110
|
export function makeProgressCallRenderer(
|
|
87
111
|
label: string,
|
|
88
112
|
detail?: (args: any) => string | undefined,
|
|
@@ -146,14 +170,14 @@ export function makeProgressResultRenderer(
|
|
|
146
170
|
if (result?.isError) {
|
|
147
171
|
const line = firstTextLine(result?.content) ?? "Request failed";
|
|
148
172
|
let text = `${theme.fg("error", "✕")} ${theme.fg("error", line)}`;
|
|
149
|
-
const debugText =
|
|
173
|
+
const debugText = getCachedDebugText(state, result, options?.expanded === true);
|
|
150
174
|
if (debugText) text += `\n${theme.fg("dim", debugText)}`;
|
|
151
175
|
return new Text(text, 0, 0);
|
|
152
176
|
}
|
|
153
177
|
const detailText = summary?.(result?.details, context?.args) ?? summarizeDetails(result?.details);
|
|
154
178
|
let text = `${theme.fg("success", "✓")} ${theme.fg("muted", successLabel)}`;
|
|
155
179
|
if (detailText) text += theme.fg("dim", ` · ${detailText}`);
|
|
156
|
-
const debugText =
|
|
180
|
+
const debugText = getCachedDebugText(state, result, options?.expanded === true);
|
|
157
181
|
if (debugText) text += `\n${theme.fg("dim", debugText)}`;
|
|
158
182
|
return new Text(text, 0, 0);
|
|
159
183
|
};
|
|
@@ -92,14 +92,12 @@ let lastCtx: ExtensionContext | undefined;
|
|
|
92
92
|
state.contextDisplay = live.contextDisplay;
|
|
93
93
|
state.costLine = live.costLine;
|
|
94
94
|
}
|
|
95
|
-
|
|
96
|
-
const viewStatus = footerData.getExtensionStatuses().get("seed-view") ?? "";
|
|
97
|
-
state.userLine = [seedStatus, viewStatus].filter(Boolean).join(" • ");
|
|
95
|
+
state.userLine = footerData.getExtensionStatuses().get("seed") ?? "";
|
|
98
96
|
const topRight = theme.fg("dim", `${state.costLine} • ${state.contextDisplay}`);
|
|
99
97
|
const top = theme.fg("dim", truncateToWidth(state.modelLine, usableWidth));
|
|
100
98
|
const topAligned = joinLeftRight(top, topRight, usableWidth);
|
|
101
99
|
if (!state.userLine) return [`${INSET}${topAligned}`];
|
|
102
|
-
const bottomLeft = theme.fg("
|
|
100
|
+
const bottomLeft = theme.fg("dim", state.userLine);
|
|
103
101
|
const bottom = joinLeftRight(
|
|
104
102
|
bottomLeft,
|
|
105
103
|
"",
|
|
@@ -4,31 +4,6 @@ import { getToolCallLabel } from "../seedclub/ui-copy.js";
|
|
|
4
4
|
export default function toolProgressExtension(pi: ExtensionAPI) {
|
|
5
5
|
let activeTools = 0;
|
|
6
6
|
|
|
7
|
-
const applyViewStatus = (ctx: { hasUI: boolean; ui: { getToolsExpanded: () => boolean; setStatus: (key: string, text: string | undefined) => void } }) => {
|
|
8
|
-
if (!ctx.hasUI) return;
|
|
9
|
-
const mode = ctx.ui.getToolsExpanded() ? "advanced" : "standard";
|
|
10
|
-
ctx.ui.setStatus("seed-view", `view: ${mode}`);
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
pi.registerShortcut("alt+o", {
|
|
14
|
-
description: "Toggle advanced tool detail view",
|
|
15
|
-
handler: (ctx) => {
|
|
16
|
-
if (!ctx.hasUI) return;
|
|
17
|
-
const next = !ctx.ui.getToolsExpanded();
|
|
18
|
-
ctx.ui.setToolsExpanded(next);
|
|
19
|
-
applyViewStatus(ctx);
|
|
20
|
-
ctx.ui.notify(next ? "Advanced tool view: on" : "Advanced tool view: off", "info");
|
|
21
|
-
},
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
pi.on("session_start", (_event, ctx) => {
|
|
25
|
-
applyViewStatus(ctx);
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
pi.on("session_switch", (_event, ctx) => {
|
|
29
|
-
applyViewStatus(ctx);
|
|
30
|
-
});
|
|
31
|
-
|
|
32
7
|
pi.on("tool_execution_start", (event, ctx) => {
|
|
33
8
|
if (!ctx.hasUI) return;
|
|
34
9
|
activeTools += 1;
|
package/package.json
CHANGED