@zle13/pi-recap 0.1.1 → 0.1.2
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 +1 -1
- package/lib/summary.ts +5 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -111,7 +111,7 @@ All settings are optional:
|
|
|
111
111
|
| `prompts.recap` | Built-in | Replace the recap system prompt |
|
|
112
112
|
| `prompts.name` | Built-in | Replace the naming system prompt |
|
|
113
113
|
|
|
114
|
-
Word and turn limits must be positive safe integers. Invalid values use their defaults. Title length stays fixed at 60 code points. Prompt overrides should request one plain-text content line; validation and length caps still apply.
|
|
114
|
+
Word and turn limits must be positive safe integers. Invalid values use their defaults. Title length stays fixed at 60 code points. Prompt overrides should request one plain-text content line; validation and length caps still apply. Recaps keep the model's trailing punctuation (`.`, `?`, `!`), so a recap may end with an open question; session titles strip trailing periods.
|
|
115
115
|
|
|
116
116
|
For example, disable automatic naming and use a custom naming prompt for explicit `/autoname` calls:
|
|
117
117
|
|
package/lib/summary.ts
CHANGED
|
@@ -75,7 +75,7 @@ export function cleanLine(line: string): string {
|
|
|
75
75
|
.replace(/`/g, "")
|
|
76
76
|
.replace(/\[([^\]]+)\]\([^)]*\)/g, "$1")
|
|
77
77
|
.replace(/^['"“”‘’]+|['"“”‘’]+$/g, "")
|
|
78
|
-
.replace(/\s+/g, " ").trim()
|
|
78
|
+
.replace(/\s+/g, " ").trim();
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
export function cleanOutput(text: string, kind: "recap" | "name", maxWords: number): string {
|
|
@@ -84,7 +84,10 @@ export function cleanOutput(text: string, kind: "recap" | "name", maxWords: numb
|
|
|
84
84
|
const lines = text.split(/\r?\n/).map(line => line.trim()).filter(Boolean)
|
|
85
85
|
.filter(line => !/^#+\s*/.test(line)).map(cleanLine).filter(Boolean);
|
|
86
86
|
if (lines.length !== 1) throw new Error("Expected one nonempty plain-text line");
|
|
87
|
-
const line =
|
|
87
|
+
const line = kind === "name"
|
|
88
|
+
// Titles are noun phrases; a trailing period reads as a defect, unlike in recaps.
|
|
89
|
+
? lines[0].replace(/[.。]+$/, "")
|
|
90
|
+
: lines[0];
|
|
88
91
|
if (kind === "name") {
|
|
89
92
|
const chars = Array.from(line);
|
|
90
93
|
if (chars.length <= TITLE_MAX_CHARS) return line;
|