@clubnet/seedclub 0.2.24 → 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.
@@ -69,8 +69,8 @@ function truncateDebugText(value: string): string {
69
69
  return `${lines.slice(0, MAX_DEBUG_TEXT_LINES).join("\n")}\n...[truncated ${lines.length - MAX_DEBUG_TEXT_LINES} lines]`;
70
70
  }
71
71
 
72
- function getDebugText(result: any): string | null {
73
- if (!isUiDebugEnabled()) return null;
72
+ function getDebugText(result: any, expanded: boolean): string | null {
73
+ if (!isUiDebugEnabled() && !expanded) return null;
74
74
  const details = result?.details == null ? null : truncateDebugText(JSON.stringify(result.details, null, 2));
75
75
  const toolText =
76
76
  typeof result?.content?.[0]?.text === "string" ? truncateDebugText(String(result.content[0].text)) : "";
@@ -83,6 +83,30 @@ function getDebugText(result: any): 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 = getDebugText(result);
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 = getDebugText(result);
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
  };
@@ -97,7 +97,7 @@ let lastCtx: ExtensionContext | undefined;
97
97
  const top = theme.fg("dim", truncateToWidth(state.modelLine, usableWidth));
98
98
  const topAligned = joinLeftRight(top, topRight, usableWidth);
99
99
  if (!state.userLine) return [`${INSET}${topAligned}`];
100
- const bottomLeft = theme.fg("text", state.userLine);
100
+ const bottomLeft = theme.fg("dim", state.userLine);
101
101
  const bottom = joinLeftRight(
102
102
  bottomLeft,
103
103
  "",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clubnet/seedclub",
3
- "version": "0.2.24",
3
+ "version": "0.2.26",
4
4
  "description": "A branded command-line agent wrapper around pi, with integrated Seed Club commands, tools, and app actions",
5
5
  "license": "MIT",
6
6
  "repository": {