modelstat 0.0.30 → 0.0.32

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/dist/cli.mjs CHANGED
@@ -44378,14 +44378,18 @@ async function summariseSlice(sessionId, slice, adapters2) {
44378
44378
  Object.keys(first.tool_calls ?? {}).length ? `tool calls: ${Object.keys(first.tool_calls).slice(0, 5).join(", ")}` : null
44379
44379
  ].filter(Boolean).join("; ");
44380
44380
  const excerpts = sampleAndRedactExcerpts(slice);
44381
- const excerptBlock = excerpts.length ? excerpts.map((e, i) => ` [turn ${i + 1}] "${e.replace(/\s+/g, " ").trim()}"`).join("\n") : "";
44382
- const prompt = excerptBlock ? `Session context: ${promptFacts || "generic coding session"}.
44381
+ if (excerpts.length === 0) {
44382
+ throw new Error(
44383
+ `parser produced 0 content excerpts for session ${sessionId} (${slice.length} turns) \u2014 the summariser would only see metadata and produce "${slice.length} turns on ${first.tool}". Check the parser for ${first.tool} (likely extractExcerpt stripped everything as code or the session is pure tool_use).`
44384
+ );
44385
+ }
44386
+ const excerptBlock = excerpts.map((e, i) => ` [turn ${i + 1}] "${e.replace(/\s+/g, " ").trim()}"`).join("\n");
44387
+ const prompt = `Session context: ${promptFacts || "generic coding session"}.
44383
44388
 
44384
44389
  Sampled excerpts from the conversation (already redacted of PII and secrets):
44385
44390
  ${excerptBlock}
44386
44391
 
44387
- Write the SHORTEST keyword-dense paragraph (1-3 sentences, \u2264${ABSTRACT_OUTPUT_MAX_CHARS} chars) naming exactly what was achieved. Lead with an outcome verb. Pack with concrete domain keywords (frameworks, features, components, decisions). Skip narration and filler.` : `Session context: ${promptFacts || "generic coding session"}.
44388
- Write the shortest possible paragraph naming the project + tool + visible action. Skip filler.`;
44392
+ Write the SHORTEST keyword-dense paragraph (1-3 sentences, \u2264${ABSTRACT_OUTPUT_MAX_CHARS} chars) naming exactly what was achieved. Lead with an outcome verb. Pack with concrete domain keywords (frameworks, features, components, decisions). Skip narration and filler.`;
44389
44393
  const rawAbstract = await adapters2.summarize({
44390
44394
  prompt,
44391
44395
  maxTokens: SUMMARISER_MAX_TOKENS