pi-bar 0.3.27 → 0.3.28
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/README.md +3 -3
- package/extensions/status-footer.ts +61 -11
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
claude-opus-4.7 ❯ think:med ❯ 2.6% / 1.0M ❯ Inspecting package structure ❯ plan:active
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
-

|
|
13
|
+

|
|
14
|
+

|
|
15
15
|
|
|
16
16
|
## Why use it?
|
|
17
17
|
|
|
@@ -1009,10 +1009,40 @@ class FooterTldrEngine {
|
|
|
1009
1009
|
}
|
|
1010
1010
|
|
|
1011
1011
|
function checkpointSystemPrompt(job: TldrCheckpointJob): string {
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1012
|
+
// Tense + exemplars vary by priority. Final TLDRs describe completed turns;
|
|
1013
|
+
// using -ing examples for final caused all final TLDRs to slip back into
|
|
1014
|
+
// present-progressive even though the literal instruction said past tense.
|
|
1015
|
+
// Immediate TLDRs cover a brand-new user request; they need a rephrase
|
|
1016
|
+
// directive instead of generic filler like "Continuing with task".
|
|
1017
|
+
let tenseInstruction: string;
|
|
1018
|
+
let goodExamples: string;
|
|
1019
|
+
if (job.displayPriority === "final") {
|
|
1020
|
+
tenseInstruction = "Start with a past-tense verb describing what was completed.";
|
|
1021
|
+
goodExamples = [
|
|
1022
|
+
"- Updated footer summary behavior",
|
|
1023
|
+
"- Investigated live TLDR regressions",
|
|
1024
|
+
"- Refined sanitizer for stray prefixes",
|
|
1025
|
+
"- Wrapped up extension release",
|
|
1026
|
+
].join("\n");
|
|
1027
|
+
} else if (job.displayPriority === "immediate") {
|
|
1028
|
+
tenseInstruction =
|
|
1029
|
+
"Rephrase the user's new request as a concise present-progressive task clause. Do not write \"Continuing\", \"Investigating user input\", or any generic filler.";
|
|
1030
|
+
goodExamples = [
|
|
1031
|
+
"- Reviewing footer summary behavior",
|
|
1032
|
+
"- Investigating live TLDR regressions",
|
|
1033
|
+
"- Refining sanitizer for stray prefixes",
|
|
1034
|
+
"- Preparing extension release",
|
|
1035
|
+
].join("\n");
|
|
1036
|
+
} else {
|
|
1037
|
+
tenseInstruction = "Start with a present-tense -ing verb describing current work.";
|
|
1038
|
+
goodExamples = [
|
|
1039
|
+
"- Reviewing footer summary behavior",
|
|
1040
|
+
"- Investigating live TLDR regressions",
|
|
1041
|
+
"- Refining sanitizer for stray prefixes",
|
|
1042
|
+
"- Wrapping up extension release",
|
|
1043
|
+
].join("\n");
|
|
1044
|
+
}
|
|
1045
|
+
|
|
1016
1046
|
// Frame the model as a human developer describing visible work, not an agent
|
|
1017
1047
|
// summarizing its own mechanics. The banned phrases and few-shot examples
|
|
1018
1048
|
// fix concrete regressions observed in backtests: tool-name verbs, success
|
|
@@ -1021,8 +1051,8 @@ function checkpointSystemPrompt(job: TldrCheckpointJob): string {
|
|
|
1021
1051
|
Describe the work progress as if a human developer were doing it.
|
|
1022
1052
|
Focus on the task activity and current outcome, not agent mechanics.
|
|
1023
1053
|
Do not mention tools, tool calls, prompts, messages, model output, or implementation details.
|
|
1024
|
-
Do not start with tool-
|
|
1025
|
-
Use human-developer verbs instead: Reviewing, Investigating, Exploring, Updating, Refining, Fixing, Implementing, Wrapping up.
|
|
1054
|
+
Do not start with tool-narration verbs such as Read, Reading, Grep, Listing, Counting, Extracting, Displaying, Editing, Writing, Running, Publishing, Capturing, Verifying, Validating, Checking, Confirming, Searching, Finding.
|
|
1055
|
+
Use human-developer verbs instead: Reviewing, Investigating, Exploring, Updating, Refining, Fixing, Implementing, Wrapping up, Bumping, Releasing.
|
|
1026
1056
|
Do not use file paths, file extensions, code identifiers, package names, or version strings.
|
|
1027
1057
|
Do not use backticks, asterisks, underscores, quotes, or any markdown formatting.
|
|
1028
1058
|
Do not append filler suffixes such as "with success", "successfully", or "completed successfully".
|
|
@@ -1039,16 +1069,15 @@ Output only the status fragment itself. No prefixes, labels, bullets, or quotes.
|
|
|
1039
1069
|
Plain text only; no markdown, JSON, code, file paths, or tool names.
|
|
1040
1070
|
|
|
1041
1071
|
Good examples:
|
|
1042
|
-
|
|
1043
|
-
- Investigating live TLDR regressions
|
|
1044
|
-
- Refining sanitizer for stray prefixes
|
|
1045
|
-
- Wrapping up extension release
|
|
1072
|
+
${goodExamples}
|
|
1046
1073
|
|
|
1047
1074
|
Bad examples:
|
|
1048
1075
|
- Editing extensions/status-footer.ts with success.
|
|
1049
1076
|
- Reading status-footer file completed successfully.
|
|
1050
1077
|
- Publishing \`pi-bar@0.3.3\` to npm.
|
|
1051
1078
|
- Grepping for sanitizeTldrText callers.
|
|
1079
|
+
- Continuing with task progression.
|
|
1080
|
+
- Investigating user input responses.
|
|
1052
1081
|
|
|
1053
1082
|
${tenseInstruction}`;
|
|
1054
1083
|
}
|
|
@@ -1236,6 +1265,26 @@ function stripIdentifierLeaks(text: string): string {
|
|
|
1236
1265
|
.trim();
|
|
1237
1266
|
}
|
|
1238
1267
|
|
|
1268
|
+
// After identifier removal the sentence often has a dangling preposition like
|
|
1269
|
+
// "Bumping version to for publishing" (was "to 0.3.2 for publishing") or a
|
|
1270
|
+
// trailing "to"/"version". Run in a fix-point loop so chained leftovers (e.g.
|
|
1271
|
+
// "to version") collapse cleanly.
|
|
1272
|
+
const DANGLING_TRAILING_PREP_PATTERN =
|
|
1273
|
+
/\s+(?:to|at|as|of|by|for|in|on|with|from|version|v)\s*[.!?,;:]?\s*$/i;
|
|
1274
|
+
const DANGLING_PREP_CHAIN_PATTERN =
|
|
1275
|
+
/\b(to|at|as|of|by|from|version|v)\s+(for|in|on|with|from|after|before|during|to|at|as|of|by|and|but|or)\b/gi;
|
|
1276
|
+
|
|
1277
|
+
function stripDanglingPrepositions(text: string): string {
|
|
1278
|
+
let cleaned = text;
|
|
1279
|
+
let previous: string;
|
|
1280
|
+
do {
|
|
1281
|
+
previous = cleaned;
|
|
1282
|
+
cleaned = cleaned.replace(DANGLING_PREP_CHAIN_PATTERN, "$2");
|
|
1283
|
+
cleaned = cleaned.replace(DANGLING_TRAILING_PREP_PATTERN, "").trim();
|
|
1284
|
+
} while (cleaned !== previous && cleaned.length > 0);
|
|
1285
|
+
return cleaned;
|
|
1286
|
+
}
|
|
1287
|
+
|
|
1239
1288
|
// Trailing filler suffixes observed in backtests:
|
|
1240
1289
|
// "... with success.", "... completed successfully.", "... successfully."
|
|
1241
1290
|
const SUCCESS_SUFFIX_PATTERN =
|
|
@@ -1265,7 +1314,8 @@ function sanitizeTldrText(
|
|
|
1265
1314
|
const withoutMarkdown = stripMarkdownFormatting(stripped);
|
|
1266
1315
|
const withoutScaffolding = stripLeakedScaffolding(withoutMarkdown) || withoutMarkdown;
|
|
1267
1316
|
const withoutLeaks = stripIdentifierLeaks(withoutScaffolding) || withoutScaffolding;
|
|
1268
|
-
const
|
|
1317
|
+
const withoutDangling = stripDanglingPrepositions(withoutLeaks) || withoutLeaks;
|
|
1318
|
+
const withoutSuccess = stripSuccessSuffix(withoutDangling) || withoutDangling;
|
|
1269
1319
|
return truncateText(withoutSuccess, maxChars);
|
|
1270
1320
|
}
|
|
1271
1321
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-bar",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.28",
|
|
4
4
|
"description": "Pi footer/statusline showing active model, thinking level, context pressure, live TLDR, and extension statuses.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -51,6 +51,6 @@
|
|
|
51
51
|
"extensions": [
|
|
52
52
|
"./extensions/status-footer.ts"
|
|
53
53
|
],
|
|
54
|
-
"image": "https://cdn.jsdelivr.net/npm/pi-bar@0.3.
|
|
54
|
+
"image": "https://cdn.jsdelivr.net/npm/pi-bar@0.3.28/assets/screenshot-yellow.png"
|
|
55
55
|
}
|
|
56
56
|
}
|