@giladbarnea/pi-simple-team 1.0.44 → 1.0.46
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/index.ts +0 -3
- package/package.json +1 -1
- package/render-support/settings.ts +0 -4
- package/render-support/text.ts +2 -60
package/index.ts
CHANGED
|
@@ -69,7 +69,6 @@ interface TeammateState {
|
|
|
69
69
|
rejectReady?: (error: Error) => void;
|
|
70
70
|
alive: boolean;
|
|
71
71
|
deliveryQueue: Promise<void>;
|
|
72
|
-
stderr: string;
|
|
73
72
|
}
|
|
74
73
|
|
|
75
74
|
interface TeamState {
|
|
@@ -353,7 +352,6 @@ function createTeammateState(team: TeamState, teammateSpec: TeammateSpec): Teamm
|
|
|
353
352
|
rejectReady,
|
|
354
353
|
alive: true,
|
|
355
354
|
deliveryQueue: Promise.resolve(),
|
|
356
|
-
stderr: "",
|
|
357
355
|
};
|
|
358
356
|
}
|
|
359
357
|
|
|
@@ -416,7 +414,6 @@ function attachRpcTeammate(team: TeamState, teammate: TeammateState, participant
|
|
|
416
414
|
|
|
417
415
|
proc.stderr?.on("data", (chunk: Buffer | string) => {
|
|
418
416
|
const text = typeof chunk === "string" ? chunk : chunk.toString("utf8");
|
|
419
|
-
teammate.stderr += text;
|
|
420
417
|
appendTeamLog(team, { team: team.name, teammate: teammate.name, direction: "runtime", kind: "stderr", summary: preview(text) });
|
|
421
418
|
});
|
|
422
419
|
proc.on("exit", (code, signal) => {
|
package/package.json
CHANGED
|
@@ -155,10 +155,6 @@ export function treeStyle(cwd?: string): TreeStyle {
|
|
|
155
155
|
return settingEnum("treeStyle", ["unicode", "ascii"] as const, "unicode", cwd);
|
|
156
156
|
}
|
|
157
157
|
|
|
158
|
-
export function pendingStatusAnimation(cwd?: string): boolean {
|
|
159
|
-
return settingBoolean("pendingStatusAnimation", false, cwd);
|
|
160
|
-
}
|
|
161
|
-
|
|
162
158
|
export function diffBackgroundEnabled(cwd?: string): boolean {
|
|
163
159
|
return settingBoolean("diffBackgrounds", true, cwd);
|
|
164
160
|
}
|
package/render-support/text.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { pathToFileURL } from "node:url";
|
|
|
5
5
|
|
|
6
6
|
import { stableRenderWidth, stripAnsi } from "./ansi.js";
|
|
7
7
|
import { glyphs, truncateText } from "./glyphs.js";
|
|
8
|
-
import {
|
|
8
|
+
import { settingNumber, stackToolCalls } from "./settings.js";
|
|
9
9
|
import { stackPrefix, toolLabel, treeConnector, type TreeBranch } from "./theme.js";
|
|
10
10
|
|
|
11
11
|
export class TruncatedLines {
|
|
@@ -122,67 +122,9 @@ export function readResultSummary(result: any, args: any, theme: any): string {
|
|
|
122
122
|
return summary;
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
-
interface BlinkEntry {
|
|
126
|
-
invalidate: () => void;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
const blinkEntries = new Map<unknown, BlinkEntry>();
|
|
130
|
-
let blinkTimer: ReturnType<typeof setInterval> | undefined;
|
|
131
|
-
|
|
132
|
-
function blinkKey(context: any): unknown {
|
|
133
|
-
return context?.toolCallId ?? context?.id ?? context;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
function startBlinkTimer(): void {
|
|
137
|
-
if (blinkTimer) return;
|
|
138
|
-
blinkTimer = setInterval(() => {
|
|
139
|
-
for (const entry of blinkEntries.values()) {
|
|
140
|
-
try {
|
|
141
|
-
entry.invalidate();
|
|
142
|
-
} catch {
|
|
143
|
-
// Rendering invalidation is best-effort only.
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
if (blinkEntries.size === 0 && blinkTimer) {
|
|
147
|
-
clearInterval(blinkTimer);
|
|
148
|
-
blinkTimer = undefined;
|
|
149
|
-
}
|
|
150
|
-
}, 450);
|
|
151
|
-
blinkTimer.unref?.();
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
function trackBlink(context: any): void {
|
|
155
|
-
const key = blinkKey(context);
|
|
156
|
-
if (!key || typeof context?.invalidate !== "function") return;
|
|
157
|
-
blinkEntries.set(key, { invalidate: () => context.invalidate() });
|
|
158
|
-
startBlinkTimer();
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
export function clearBlink(context: any): void {
|
|
162
|
-
const key = blinkKey(context);
|
|
163
|
-
if (key) blinkEntries.delete(key);
|
|
164
|
-
if (blinkEntries.size === 0 && blinkTimer) {
|
|
165
|
-
clearInterval(blinkTimer);
|
|
166
|
-
blinkTimer = undefined;
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
export function blinkingPrefix(theme: any, context: any, cwd?: string): string {
|
|
171
|
-
trackBlink(context);
|
|
172
|
-
const on = Math.floor(Date.now() / 450) % 2 === 0;
|
|
173
|
-
const g = glyphs(context?.cwd ?? cwd);
|
|
174
|
-
return theme.fg(on ? "success" : "muted", on ? g.bullet : g.emptyBullet);
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
export function pendingStatusPrefix(theme: any, context: any, cwd?: string): string {
|
|
178
|
-
if (pendingStatusAnimation(context?.cwd ?? cwd)) return blinkingPrefix(theme, context, cwd);
|
|
179
|
-
clearBlink(context);
|
|
180
|
-
return theme.fg("warning", glyphs(context?.cwd ?? cwd).bullet);
|
|
181
|
-
}
|
|
182
|
-
|
|
183
125
|
export function renderPendingCall(call: string, theme: any, context: any, cwd?: string): TruncatedLines | ReturnType<typeof makeEmpty> {
|
|
184
126
|
if (!context?.executionStarted || !context?.isPartial || stackToolCalls(context?.cwd ?? cwd)) return makeEmpty();
|
|
185
|
-
return makeTruncatedLines(`${
|
|
127
|
+
return makeTruncatedLines(`${theme.fg("warning", glyphs(context?.cwd ?? cwd).bullet)}${call}`);
|
|
186
128
|
}
|
|
187
129
|
|
|
188
130
|
export function renderPendingDetail(text: string, theme: any, cwd?: string): TruncatedLines {
|