@voidwire/llm-summarize 3.5.0 → 3.6.0

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.
Files changed (2) hide show
  1. package/index.ts +43 -46
  2. package/package.json +1 -1
package/index.ts CHANGED
@@ -36,7 +36,6 @@ export interface SessionInsights {
36
36
  patterns_used?: string[];
37
37
  preferences_expressed?: string[];
38
38
  problems_solved?: string[];
39
- tools_heavy?: string[];
40
39
  }
41
40
 
42
41
  export interface SummarizeResult {
@@ -146,55 +145,52 @@ Output valid JSON only. No markdown, no explanation.`;
146
145
  * Note: userName param kept for API compatibility but not used in insights mode
147
146
  */
148
147
  function buildInsightsPrompt(_userName?: string): string {
149
- return `You are a senior engineering manager extracting reusable insights from development sessions.
148
+ return `You are an engineering knowledge extractor. Given a development session transcript, extract reusable insights as structured JSON.
150
149
 
151
- You receive transcripts with clear role markers:
152
- - "User Asked:" = the human directing work (requests, approves, provides context)
153
- - "Assistant Response:" = the AI executing work (implements, builds, debugs, explains)
150
+ Transcripts use role markers:
151
+ - "User Asked:" = the human (directs, decides, provides context)
152
+ - "Assistant Response:" = the AI (implements, builds, debugs)
154
153
 
155
- Your job: extract what's worth remembering for future sessions.
154
+ <output_format>
155
+ Return a JSON object with these fields. Include a field ONLY when the transcript provides clear evidence. Omit empty arrays entirely.
156
156
 
157
- <output_schema>
158
157
  {
159
- "summary": "One sentence capturing what was accomplished and how",
160
- "current_focus": "What work is actively in progress — the specific task, feature, or thread (omit if session was exploratory with no clear focus)",
161
- "next_steps": ["What should happen when work resumes — concrete actions, not vague intentions"],
162
- "decisions": ["Decision made with reasoning and trade-offs considered"],
163
- "patterns_used": ["Development pattern or approach, with context on why it was chosen"],
164
- "preferences_expressed": ["Preference revealed through direction or feedback"],
165
- "problems_solved": ["Problem encountered and the specific solution applied"],
166
- "tools_heavy": ["Tool used repeatedly or for critical work"]
158
+ "summary": "One sentence: what was accomplished and the key outcome",
159
+ "current_focus": "The specific task, feature, or problem actively being worked on (omit if exploratory)",
160
+ "next_steps": ["Concrete action to take when work resumes — name the actual task"],
161
+ "decisions": ["Decision made rationale and what alternatives were considered"],
162
+ "patterns_used": ["Technique or approach applied why it was chosen over alternatives"],
163
+ "preferences_expressed": ["User preference revealed through direction, correction, or explicit statement"],
164
+ "problems_solved": ["Problem encountered — root cause identified and specific fix applied"]
167
165
  }
168
- </output_schema>
169
-
170
- <attribution_rules>
171
- - User actions: requested, approved, directed, provided, chose, preferred
172
- - Assistant actions: implemented, built, debugged, refactored, created, fixed
173
- - Never say "User implemented" or "User built" — users direct, assistants execute
174
- </attribution_rules>
175
-
176
- <quality_guidance>
177
- Extract specifics with context, not bare facts:
178
-
179
- SPARSE (avoid):
180
- - "Made a database decision"
181
- - "Fixed a bug"
182
- - "Used TypeScript"
183
-
184
- RICH (prefer):
185
- - "Chose SQLite over Postgres for single-user CLI tool avoids server dependency"
186
- - "Fixed race condition in webhook handler by adding mutex lock — was causing duplicate events"
187
- - "Used Zod for runtime validation at API boundary — catches malformed input before it hits business logic"
188
- </quality_guidance>
189
-
190
- <rules>
191
- - Include a field ONLY when the transcript provides clear evidence
192
- - Omit empty arrays entirely
193
- - Capture the "why" when present — reasoning is more valuable than the decision alone
194
- - Technical specifics (library names, patterns, trade-offs) make insights reusable
195
- </rules>
196
-
197
- Output valid JSON only. No markdown code blocks, no explanation.`;
166
+ </output_format>
167
+
168
+ <quality_rules>
169
+ Every value MUST be a complete sentence with context. Never output bare nouns, short phrases, or sentence fragments.
170
+
171
+ BAD (will be rejected):
172
+ - "SQLite"
173
+ - "detached worker"
174
+ - "Fixed bug"
175
+ - "Continue working"
176
+
177
+ GOOD (specific, contextual, reusable):
178
+ - "Chose SQLite over Postgres for single-user CLI — no server dependency needed"
179
+ - "Used detached worker pattern to avoid blocking the stop hook during LLM calls"
180
+ - "Fixed state file writing to wrong directory — was using read-only data path instead of persistent home"
181
+ - "Wire up the webhook endpoint to the event processor and verify with integration test"
182
+
183
+ For next_steps specifically: never say "Continue from current position" or "Resume work"name the actual task to be done.
184
+ </quality_rules>
185
+
186
+ <attribution>
187
+ Users direct and decide. Assistants implement and execute.
188
+ - User: requested, approved, directed, chose, preferred, corrected
189
+ - Assistant: implemented, built, debugged, refactored, created, fixed
190
+ - Never say "User implemented" or "User built"
191
+ </attribution>
192
+
193
+ Output valid JSON only. No markdown, no code blocks, no explanation.`;
198
194
  }
199
195
 
200
196
  /**
@@ -610,7 +606,8 @@ export async function summarize(
610
606
  const apiKey = config.apiKey;
611
607
  const mode: SummarizeMode = options?.mode || "insights";
612
608
  const userName = options?.userName;
613
- const systemPrompt = options?.systemPrompt || getPromptForMode(mode, userName);
609
+ const systemPrompt =
610
+ options?.systemPrompt || getPromptForMode(mode, userName);
614
611
 
615
612
  // Validate config
616
613
  if (!provider) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voidwire/llm-summarize",
3
- "version": "3.5.0",
3
+ "version": "3.6.0",
4
4
  "description": "Structured session insight extraction for knowledge systems",
5
5
  "type": "module",
6
6
  "main": "./index.ts",