@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 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. Output cleanup strips trailing periods but preserves trailing `?` and `!`, so a recap may end with an open question.
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().replace(/[.。]+$/, "");
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 = lines[0];
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zle13/pi-recap",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Session recaps and automatic session naming for Pi.",
5
5
  "type": "module",
6
6
  "keywords": [