@linimin/pi-letscook 0.1.32 → 0.1.33
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/CHANGELOG.md +7 -0
- package/extensions/completion/index.ts +59 -43
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.33
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
|
|
7
|
+
- kept full mission text in `/cook` confirmation instead of truncating mission anchors during derivation
|
|
8
|
+
- refined `/cook` activity and completion-role text contrast by reducing overuse of `dim` styling in high-value status surfaces
|
|
9
|
+
|
|
3
10
|
## 0.1.32
|
|
4
11
|
|
|
5
12
|
### Changed
|
|
@@ -203,7 +203,7 @@ class StartupAnalystOverlay extends Container {
|
|
|
203
203
|
|
|
204
204
|
private updateDisplay(): void {
|
|
205
205
|
this.title.setText(this.theme.fg("accent", this.theme.bold("/cook proposal analyst")));
|
|
206
|
-
this.body.setText(this.theme
|
|
206
|
+
this.body.setText(formatInlineRunningText(this.theme, this.lines, { primaryAssistant: true }));
|
|
207
207
|
this.footer.setText(this.theme.fg("muted", "Esc cancel • This analysis runs before /cook writes canonical workflow state"));
|
|
208
208
|
}
|
|
209
209
|
|
|
@@ -1946,10 +1946,6 @@ function deriveMissionAnchor(rawGoal: string, projectName: string): string {
|
|
|
1946
1946
|
.replace(/\bwith docs\b/gi, "with docs parity")
|
|
1947
1947
|
.trim();
|
|
1948
1948
|
|
|
1949
|
-
if (mission.length > 120) {
|
|
1950
|
-
mission = `${mission.slice(0, 117).trimEnd()}...`;
|
|
1951
|
-
}
|
|
1952
|
-
|
|
1953
1949
|
if (!/[.!?。!?]$/u.test(mission)) mission += ".";
|
|
1954
1950
|
return mission;
|
|
1955
1951
|
}
|
|
@@ -2938,6 +2934,53 @@ function collapseRecentActivity(items: string[], maxItems = 4): string[] {
|
|
|
2938
2934
|
return collapsed.slice(-maxItems);
|
|
2939
2935
|
}
|
|
2940
2936
|
|
|
2937
|
+
function formatInlineRunningText(theme: any, lines: string[], options?: { primaryAssistant?: boolean }): string {
|
|
2938
|
+
let text = "";
|
|
2939
|
+
for (const [index, line] of lines.entries()) {
|
|
2940
|
+
if (index > 0) text += "\n";
|
|
2941
|
+
if (index === 0) {
|
|
2942
|
+
const [prefix, ...rest] = line.split(" ");
|
|
2943
|
+
text += theme.fg("warning", prefix);
|
|
2944
|
+
if (rest.length > 0) text += ` ${theme.fg("accent", rest.join(" "))}`;
|
|
2945
|
+
continue;
|
|
2946
|
+
}
|
|
2947
|
+
if (line.startsWith("tool:") || line.startsWith("progress:")) {
|
|
2948
|
+
text += theme.fg("toolOutput", line);
|
|
2949
|
+
continue;
|
|
2950
|
+
}
|
|
2951
|
+
if (line.startsWith("activity:")) {
|
|
2952
|
+
text += theme.fg(line.includes("stalled") ? "warning" : "dim", line);
|
|
2953
|
+
continue;
|
|
2954
|
+
}
|
|
2955
|
+
if (line === "recent tools:") {
|
|
2956
|
+
text += theme.fg("muted", line);
|
|
2957
|
+
continue;
|
|
2958
|
+
}
|
|
2959
|
+
if (line.startsWith("- ")) {
|
|
2960
|
+
text += `${theme.fg("muted", "- ")}${theme.fg("muted", line.slice(2))}`;
|
|
2961
|
+
continue;
|
|
2962
|
+
}
|
|
2963
|
+
if (line.startsWith("elapsed:")) {
|
|
2964
|
+
text += theme.fg("dim", line);
|
|
2965
|
+
continue;
|
|
2966
|
+
}
|
|
2967
|
+
if (line.startsWith("assistant:")) {
|
|
2968
|
+
text += options?.primaryAssistant ? line : theme.fg("muted", line);
|
|
2969
|
+
continue;
|
|
2970
|
+
}
|
|
2971
|
+
if (line.startsWith("next:") || line.startsWith("verifying:")) {
|
|
2972
|
+
text += theme.fg("muted", line);
|
|
2973
|
+
continue;
|
|
2974
|
+
}
|
|
2975
|
+
if (line.startsWith("rationale:") || line.startsWith("state-delta:")) {
|
|
2976
|
+
text += theme.fg("dim", line);
|
|
2977
|
+
continue;
|
|
2978
|
+
}
|
|
2979
|
+
text += theme.fg("muted", line);
|
|
2980
|
+
}
|
|
2981
|
+
return text;
|
|
2982
|
+
}
|
|
2983
|
+
|
|
2941
2984
|
function buildInlineRunningLines(details: {
|
|
2942
2985
|
role?: string;
|
|
2943
2986
|
startedAt?: number;
|
|
@@ -3473,7 +3516,7 @@ export default function completionExtension(pi: ExtensionAPI) {
|
|
|
3473
3516
|
const task = typeof args.task === "string" ? args.task.trim() : "";
|
|
3474
3517
|
let text = theme.fg("toolTitle", theme.bold("completion_role ")) + theme.fg("accent", role);
|
|
3475
3518
|
if (task) {
|
|
3476
|
-
text += `\n${theme.fg("
|
|
3519
|
+
text += `\n${theme.fg("muted", task)}`;
|
|
3477
3520
|
}
|
|
3478
3521
|
return new Text(text, 0, 0);
|
|
3479
3522
|
},
|
|
@@ -3501,53 +3544,26 @@ export default function completionExtension(pi: ExtensionAPI) {
|
|
|
3501
3544
|
};
|
|
3502
3545
|
if (isPartial) {
|
|
3503
3546
|
const lines = buildInlineRunningLines(details);
|
|
3504
|
-
|
|
3505
|
-
for (const [index, line] of lines.entries()) {
|
|
3506
|
-
if (index > 0) text += "\n";
|
|
3507
|
-
if (index === 0) {
|
|
3508
|
-
const [prefix, ...rest] = line.split(" ");
|
|
3509
|
-
text += theme.fg("warning", prefix);
|
|
3510
|
-
if (rest.length > 0) text += ` ${theme.fg("accent", rest.join(" "))}`;
|
|
3511
|
-
continue;
|
|
3512
|
-
}
|
|
3513
|
-
if (line.startsWith("tool:") || line.startsWith("progress:")) {
|
|
3514
|
-
text += theme.fg("toolOutput", line);
|
|
3515
|
-
continue;
|
|
3516
|
-
}
|
|
3517
|
-
if (line.startsWith("activity:")) {
|
|
3518
|
-
text += theme.fg(line.includes("stalled") ? "warning" : "dim", line);
|
|
3519
|
-
continue;
|
|
3520
|
-
}
|
|
3521
|
-
if (line === "recent tools:") {
|
|
3522
|
-
text += theme.fg("dim", line);
|
|
3523
|
-
continue;
|
|
3524
|
-
}
|
|
3525
|
-
if (line.startsWith("- ")) {
|
|
3526
|
-
text += `${theme.fg("muted", "- ")}${theme.fg("dim", line.slice(2))}`;
|
|
3527
|
-
continue;
|
|
3528
|
-
}
|
|
3529
|
-
text += theme.fg("dim", line);
|
|
3530
|
-
}
|
|
3531
|
-
return new Text(text, 0, 0);
|
|
3547
|
+
return new Text(formatInlineRunningText(theme, lines), 0, 0);
|
|
3532
3548
|
}
|
|
3533
3549
|
const role = details.role ?? "completion-role";
|
|
3534
3550
|
const ok = details.status === "ok" && !result.isError;
|
|
3535
3551
|
let text = `${theme.fg(ok ? "success" : "error", ok ? "done" : "error")} ${theme.fg("toolTitle", theme.bold(role))}`;
|
|
3536
|
-
if (details.startedAt !== undefined) text += `\n${theme.fg("
|
|
3552
|
+
if (details.startedAt !== undefined) text += `\n${theme.fg("muted", `elapsed: ${formatElapsed(nowMs() - details.startedAt)}`)}`;
|
|
3537
3553
|
if (details.toolActivity) text += `\n${theme.fg("toolOutput", `tool: ${details.toolActivity}`)}`;
|
|
3538
3554
|
if (details.progress) text += `\n${theme.fg("toolOutput", `progress: ${details.progress}`)}`;
|
|
3539
|
-
else if (details.assistantSummary) text += `\
|
|
3540
|
-
if (details.rationale) text += `\n${theme.fg("
|
|
3541
|
-
if (details.nextStep) text += `\n${theme.fg("
|
|
3542
|
-
if (details.verifying) text += `\n${theme.fg("
|
|
3555
|
+
else if (details.assistantSummary) text += `\nassistant: ${details.assistantSummary}`;
|
|
3556
|
+
if (details.rationale) text += `\n${theme.fg("muted", `rationale: ${details.rationale}`)}`;
|
|
3557
|
+
if (details.nextStep) text += `\n${theme.fg("muted", `next: ${details.nextStep}`)}`;
|
|
3558
|
+
if (details.verifying) text += `\n${theme.fg("muted", `verifying: ${details.verifying}`)}`;
|
|
3543
3559
|
if (details.stateDeltas?.length) {
|
|
3544
|
-
for (const delta of details.stateDeltas.slice(-4)) text += `\n${theme.fg("
|
|
3560
|
+
for (const delta of details.stateDeltas.slice(-4)) text += `\n${theme.fg("muted", `state-delta: ${delta}`)}`;
|
|
3545
3561
|
}
|
|
3546
3562
|
if (details.transcription?.appended?.length) {
|
|
3547
3563
|
text += `\n${theme.fg("success", `transcribed: ${details.transcription.appended.join(", ")}`)}`;
|
|
3548
3564
|
}
|
|
3549
3565
|
if (details.transcription?.skipped?.length && expanded) {
|
|
3550
|
-
text += `\n${theme.fg("
|
|
3566
|
+
text += `\n${theme.fg("muted", `skipped: ${details.transcription.skipped.join(" | ")}`)}`;
|
|
3551
3567
|
}
|
|
3552
3568
|
if (details.transcription?.errors?.length) {
|
|
3553
3569
|
text += `\n${theme.fg("warning", `warnings: ${details.transcription.errors.join(" | ")}`)}`;
|
|
@@ -3565,14 +3581,14 @@ export default function completionExtension(pi: ExtensionAPI) {
|
|
|
3565
3581
|
for (const key of summaryKeys) {
|
|
3566
3582
|
const value = reportFields[key];
|
|
3567
3583
|
if (!value) continue;
|
|
3568
|
-
text += `\n${theme.fg("
|
|
3584
|
+
text += `\n${theme.fg("muted", `${key}: `)}${value}`;
|
|
3569
3585
|
}
|
|
3570
3586
|
const body = result.content.find((item) => item.type === "text");
|
|
3571
3587
|
if (expanded && body?.type === "text") {
|
|
3572
3588
|
text += `\n\n${body.text}`;
|
|
3573
3589
|
} else if (!expanded && body?.type === "text") {
|
|
3574
3590
|
const preview = body.text.split("\n").slice(0, 4).join("\n");
|
|
3575
|
-
text += `\n${theme.fg("
|
|
3591
|
+
text += `\n${theme.fg("muted", preview)}`;
|
|
3576
3592
|
}
|
|
3577
3593
|
if (details.stderr && expanded) text += `\n${theme.fg("error", details.stderr)}`;
|
|
3578
3594
|
return new Text(text, 0, 0);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@linimin/pi-letscook",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.33",
|
|
4
4
|
"description": "Pi package for long-running completion workflows with canonical .agent state, role-based subagents, continuity, and verification helpers.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"private": false,
|