@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.
- package/index.ts +43 -46
- 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
|
|
148
|
+
return `You are an engineering knowledge extractor. Given a development session transcript, extract reusable insights as structured JSON.
|
|
150
149
|
|
|
151
|
-
|
|
152
|
-
- "User Asked:" = the human
|
|
153
|
-
- "Assistant Response:" = the AI
|
|
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
|
-
|
|
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
|
|
160
|
-
"current_focus": "
|
|
161
|
-
"next_steps": ["
|
|
162
|
-
"decisions": ["Decision made
|
|
163
|
-
"patterns_used": ["
|
|
164
|
-
"preferences_expressed": ["
|
|
165
|
-
"problems_solved": ["Problem encountered and
|
|
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
|
-
</
|
|
169
|
-
|
|
170
|
-
<
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
- "
|
|
181
|
-
- "
|
|
182
|
-
- "
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
-
|
|
192
|
-
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
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 =
|
|
609
|
+
const systemPrompt =
|
|
610
|
+
options?.systemPrompt || getPromptForMode(mode, userName);
|
|
614
611
|
|
|
615
612
|
// Validate config
|
|
616
613
|
if (!provider) {
|