@deathbeam/pi-delegate 0.0.11 → 0.0.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/index.ts +11 -2
- package/package.json +1 -1
package/index.ts
CHANGED
|
@@ -99,6 +99,7 @@ const DELEGATION_TOOLS = new Set(["delegate", "delegate_list", "delegate_steer",
|
|
|
99
99
|
const MODEL_TIERS = new Set(["cheap", "balanced", "strong"]);
|
|
100
100
|
const WIDGET_KEY = "delegate";
|
|
101
101
|
const RESULT_MESSAGE = "delegate-result";
|
|
102
|
+
const TASK_PREVIEW_LINES = 5;
|
|
102
103
|
|
|
103
104
|
function expandPath(value: string, cwd: string): string {
|
|
104
105
|
return resolve(cwd, value.replace(/^~(?=\/|$)/, homedir()));
|
|
@@ -409,8 +410,16 @@ export default function (pi: ExtensionAPI) {
|
|
|
409
410
|
const jobs = () => [...running.values(), ...recent];
|
|
410
411
|
const bodyHeight = () => Math.max(0, tui.terminal.rows - 3);
|
|
411
412
|
// The list pane already draws a border, and the muted model line sets the task apart.
|
|
412
|
-
const taskLines = (job: InspectJob, width: number) =>
|
|
413
|
-
wrapTextWithAnsi(job.task.trim(), Math.max(1, width)).map((line) =>
|
|
413
|
+
const taskLines = (job: InspectJob, width: number) => {
|
|
414
|
+
const lines = wrapTextWithAnsi(job.task.trim(), Math.max(1, width)).map((line) =>
|
|
415
|
+
theme.fg("text", line),
|
|
416
|
+
);
|
|
417
|
+
if (lines.length <= TASK_PREVIEW_LINES) return lines;
|
|
418
|
+
return [
|
|
419
|
+
...lines.slice(0, TASK_PREVIEW_LINES),
|
|
420
|
+
theme.fg("muted", `… ${lines.length - TASK_PREVIEW_LINES} more lines`),
|
|
421
|
+
];
|
|
422
|
+
};
|
|
414
423
|
const toolsLines = (job: InspectJob, width: number) =>
|
|
415
424
|
wrapTextWithAnsi(formatTools(job.tools), Math.max(1, width)).map((line) =>
|
|
416
425
|
theme.fg("dim", line),
|