@code-insights/cli 3.6.0 → 4.0.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 (213) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/README.md +40 -4
  3. package/dashboard-dist/assets/index-D1JDyyu5.js +660 -0
  4. package/dashboard-dist/assets/index-kwbCW1n2.css +1 -0
  5. package/dashboard-dist/index.html +2 -2
  6. package/dist/commands/reflect.d.ts +3 -0
  7. package/dist/commands/reflect.d.ts.map +1 -0
  8. package/dist/commands/reflect.js +457 -0
  9. package/dist/commands/reflect.js.map +1 -0
  10. package/dist/commands/reset.d.ts.map +1 -1
  11. package/dist/commands/reset.js +3 -1
  12. package/dist/commands/reset.js.map +1 -1
  13. package/dist/commands/stats/actions/patterns.d.ts +3 -0
  14. package/dist/commands/stats/actions/patterns.d.ts.map +1 -0
  15. package/dist/commands/stats/actions/patterns.js +140 -0
  16. package/dist/commands/stats/actions/patterns.js.map +1 -0
  17. package/dist/commands/stats/data/aggregation-helpers.d.ts +23 -0
  18. package/dist/commands/stats/data/aggregation-helpers.d.ts.map +1 -0
  19. package/dist/commands/stats/data/aggregation-helpers.js +128 -0
  20. package/dist/commands/stats/data/aggregation-helpers.js.map +1 -0
  21. package/dist/commands/stats/data/aggregation.d.ts +3 -35
  22. package/dist/commands/stats/data/aggregation.d.ts.map +1 -1
  23. package/dist/commands/stats/data/aggregation.js +8 -290
  24. package/dist/commands/stats/data/aggregation.js.map +1 -1
  25. package/dist/commands/stats/data/time-series.d.ts +24 -0
  26. package/dist/commands/stats/data/time-series.d.ts.map +1 -0
  27. package/dist/commands/stats/data/time-series.js +162 -0
  28. package/dist/commands/stats/data/time-series.js.map +1 -0
  29. package/dist/commands/stats/index.d.ts.map +1 -1
  30. package/dist/commands/stats/index.js +7 -1
  31. package/dist/commands/stats/index.js.map +1 -1
  32. package/dist/commands/sync.d.ts +19 -0
  33. package/dist/commands/sync.d.ts.map +1 -1
  34. package/dist/commands/sync.js +67 -1
  35. package/dist/commands/sync.js.map +1 -1
  36. package/dist/constants/llm-providers.js +1 -1
  37. package/dist/constants/llm-providers.js.map +1 -1
  38. package/dist/db/client.d.ts +7 -0
  39. package/dist/db/client.d.ts.map +1 -1
  40. package/dist/db/client.js +11 -1
  41. package/dist/db/client.js.map +1 -1
  42. package/dist/db/migrate.d.ts +10 -1
  43. package/dist/db/migrate.d.ts.map +1 -1
  44. package/dist/db/migrate.js +96 -0
  45. package/dist/db/migrate.js.map +1 -1
  46. package/dist/db/read.d.ts +5 -0
  47. package/dist/db/read.d.ts.map +1 -1
  48. package/dist/db/read.js +20 -3
  49. package/dist/db/read.js.map +1 -1
  50. package/dist/db/schema.d.ts +1 -1
  51. package/dist/db/schema.js +2 -2
  52. package/dist/db/schema.js.map +1 -1
  53. package/dist/db/write.d.ts.map +1 -1
  54. package/dist/db/write.js +8 -2
  55. package/dist/db/write.js.map +1 -1
  56. package/dist/index.js +39 -3
  57. package/dist/index.js.map +1 -1
  58. package/dist/parser/jsonl.d.ts +19 -1
  59. package/dist/parser/jsonl.d.ts.map +1 -1
  60. package/dist/parser/jsonl.js +109 -3
  61. package/dist/parser/jsonl.js.map +1 -1
  62. package/dist/providers/codex.js +4 -1
  63. package/dist/providers/codex.js.map +1 -1
  64. package/dist/providers/copilot-cli.js +3 -0
  65. package/dist/providers/copilot-cli.js.map +1 -1
  66. package/dist/providers/copilot.js +3 -0
  67. package/dist/providers/copilot.js.map +1 -1
  68. package/dist/providers/cursor.js +3 -0
  69. package/dist/providers/cursor.js.map +1 -1
  70. package/dist/types.d.ts +109 -0
  71. package/dist/types.d.ts.map +1 -1
  72. package/dist/utils/date-utils.d.ts +6 -0
  73. package/dist/utils/date-utils.d.ts.map +1 -0
  74. package/dist/utils/date-utils.js +26 -0
  75. package/dist/utils/date-utils.js.map +1 -0
  76. package/dist/utils/telemetry.d.ts +1 -1
  77. package/dist/utils/telemetry.d.ts.map +1 -1
  78. package/dist/utils/telemetry.js.map +1 -1
  79. package/package.json +2 -1
  80. package/server-dist/export/agent-rules.d.ts.map +1 -1
  81. package/server-dist/export/agent-rules.js +15 -4
  82. package/server-dist/export/agent-rules.js.map +1 -1
  83. package/server-dist/export/knowledge-base.d.ts.map +1 -1
  84. package/server-dist/export/knowledge-base.js +30 -4
  85. package/server-dist/export/knowledge-base.js.map +1 -1
  86. package/server-dist/index.d.ts.map +1 -1
  87. package/server-dist/index.js +4 -0
  88. package/server-dist/index.js.map +1 -1
  89. package/server-dist/llm/analysis-db.d.ts +51 -0
  90. package/server-dist/llm/analysis-db.d.ts.map +1 -0
  91. package/server-dist/llm/analysis-db.js +208 -0
  92. package/server-dist/llm/analysis-db.js.map +1 -0
  93. package/server-dist/llm/analysis-internal.d.ts +36 -0
  94. package/server-dist/llm/analysis-internal.d.ts.map +1 -0
  95. package/server-dist/llm/analysis-internal.js +23 -0
  96. package/server-dist/llm/analysis-internal.js.map +1 -0
  97. package/server-dist/llm/analysis-pricing.d.ts +25 -0
  98. package/server-dist/llm/analysis-pricing.d.ts.map +1 -0
  99. package/server-dist/llm/analysis-pricing.js +74 -0
  100. package/server-dist/llm/analysis-pricing.js.map +1 -0
  101. package/server-dist/llm/analysis-usage-db.d.ts +45 -0
  102. package/server-dist/llm/analysis-usage-db.d.ts.map +1 -0
  103. package/server-dist/llm/analysis-usage-db.js +35 -0
  104. package/server-dist/llm/analysis-usage-db.js.map +1 -0
  105. package/server-dist/llm/analysis.d.ts +9 -79
  106. package/server-dist/llm/analysis.d.ts.map +1 -1
  107. package/server-dist/llm/analysis.js +119 -375
  108. package/server-dist/llm/analysis.js.map +1 -1
  109. package/server-dist/llm/facet-extraction.d.ts +14 -0
  110. package/server-dist/llm/facet-extraction.d.ts.map +1 -0
  111. package/server-dist/llm/facet-extraction.js +91 -0
  112. package/server-dist/llm/facet-extraction.js.map +1 -0
  113. package/server-dist/llm/friction-normalize.d.ts +16 -0
  114. package/server-dist/llm/friction-normalize.d.ts.map +1 -0
  115. package/server-dist/llm/friction-normalize.js +54 -0
  116. package/server-dist/llm/friction-normalize.js.map +1 -0
  117. package/server-dist/llm/index.d.ts +3 -2
  118. package/server-dist/llm/index.d.ts.map +1 -1
  119. package/server-dist/llm/index.js +1 -1
  120. package/server-dist/llm/index.js.map +1 -1
  121. package/server-dist/llm/message-format.d.ts +32 -0
  122. package/server-dist/llm/message-format.d.ts.map +1 -0
  123. package/server-dist/llm/message-format.js +129 -0
  124. package/server-dist/llm/message-format.js.map +1 -0
  125. package/server-dist/llm/normalize-utils.d.ts +22 -0
  126. package/server-dist/llm/normalize-utils.d.ts.map +1 -0
  127. package/server-dist/llm/normalize-utils.js +71 -0
  128. package/server-dist/llm/normalize-utils.js.map +1 -0
  129. package/server-dist/llm/pattern-normalize.d.ts +19 -0
  130. package/server-dist/llm/pattern-normalize.d.ts.map +1 -0
  131. package/server-dist/llm/pattern-normalize.js +90 -0
  132. package/server-dist/llm/pattern-normalize.js.map +1 -0
  133. package/server-dist/llm/prompt-constants.d.ts +9 -0
  134. package/server-dist/llm/prompt-constants.d.ts.map +1 -0
  135. package/server-dist/llm/prompt-constants.js +169 -0
  136. package/server-dist/llm/prompt-constants.js.map +1 -0
  137. package/server-dist/llm/prompt-quality-analysis.d.ts +8 -0
  138. package/server-dist/llm/prompt-quality-analysis.d.ts.map +1 -0
  139. package/server-dist/llm/prompt-quality-analysis.js +133 -0
  140. package/server-dist/llm/prompt-quality-analysis.js.map +1 -0
  141. package/server-dist/llm/prompt-quality-normalize.d.ts +26 -0
  142. package/server-dist/llm/prompt-quality-normalize.d.ts.map +1 -0
  143. package/server-dist/llm/prompt-quality-normalize.js +116 -0
  144. package/server-dist/llm/prompt-quality-normalize.js.map +1 -0
  145. package/server-dist/llm/prompt-types.d.ts +124 -0
  146. package/server-dist/llm/prompt-types.d.ts.map +1 -0
  147. package/server-dist/llm/prompt-types.js +4 -0
  148. package/server-dist/llm/prompt-types.js.map +1 -0
  149. package/server-dist/llm/prompts.d.ts +57 -100
  150. package/server-dist/llm/prompts.d.ts.map +1 -1
  151. package/server-dist/llm/prompts.js +606 -232
  152. package/server-dist/llm/prompts.js.map +1 -1
  153. package/server-dist/llm/providers/anthropic.d.ts.map +1 -1
  154. package/server-dist/llm/providers/anthropic.js +12 -0
  155. package/server-dist/llm/providers/anthropic.js.map +1 -1
  156. package/server-dist/llm/providers/gemini.d.ts.map +1 -1
  157. package/server-dist/llm/providers/gemini.js +10 -2
  158. package/server-dist/llm/providers/gemini.js.map +1 -1
  159. package/server-dist/llm/providers/ollama.d.ts.map +1 -1
  160. package/server-dist/llm/providers/ollama.js +3 -1
  161. package/server-dist/llm/providers/ollama.js.map +1 -1
  162. package/server-dist/llm/providers/openai.d.ts.map +1 -1
  163. package/server-dist/llm/providers/openai.js +4 -1
  164. package/server-dist/llm/providers/openai.js.map +1 -1
  165. package/server-dist/llm/recurring-insights.d.ts +26 -0
  166. package/server-dist/llm/recurring-insights.d.ts.map +1 -0
  167. package/server-dist/llm/recurring-insights.js +119 -0
  168. package/server-dist/llm/recurring-insights.js.map +1 -0
  169. package/server-dist/llm/reflect-prompts.d.ts +55 -0
  170. package/server-dist/llm/reflect-prompts.d.ts.map +1 -0
  171. package/server-dist/llm/reflect-prompts.js +151 -0
  172. package/server-dist/llm/reflect-prompts.js.map +1 -0
  173. package/server-dist/llm/response-parsers.d.ts +8 -0
  174. package/server-dist/llm/response-parsers.d.ts.map +1 -0
  175. package/server-dist/llm/response-parsers.js +151 -0
  176. package/server-dist/llm/response-parsers.js.map +1 -0
  177. package/server-dist/llm/types.d.ts +23 -1
  178. package/server-dist/llm/types.d.ts.map +1 -1
  179. package/server-dist/llm/types.js +10 -1
  180. package/server-dist/llm/types.js.map +1 -1
  181. package/server-dist/routes/analysis.d.ts.map +1 -1
  182. package/server-dist/routes/analysis.js +107 -282
  183. package/server-dist/routes/analysis.js.map +1 -1
  184. package/server-dist/routes/analytics.d.ts.map +1 -1
  185. package/server-dist/routes/analytics.js +3 -1
  186. package/server-dist/routes/analytics.js.map +1 -1
  187. package/server-dist/routes/export.d.ts.map +1 -1
  188. package/server-dist/routes/export.js +19 -27
  189. package/server-dist/routes/export.js.map +1 -1
  190. package/server-dist/routes/facets.d.ts +4 -0
  191. package/server-dist/routes/facets.d.ts.map +1 -0
  192. package/server-dist/routes/facets.js +208 -0
  193. package/server-dist/routes/facets.js.map +1 -0
  194. package/server-dist/routes/insights.d.ts.map +1 -1
  195. package/server-dist/routes/insights.js +12 -11
  196. package/server-dist/routes/insights.js.map +1 -1
  197. package/server-dist/routes/reflect.d.ts +4 -0
  198. package/server-dist/routes/reflect.d.ts.map +1 -0
  199. package/server-dist/routes/reflect.js +332 -0
  200. package/server-dist/routes/reflect.js.map +1 -0
  201. package/server-dist/routes/route-helpers.d.ts +124 -0
  202. package/server-dist/routes/route-helpers.d.ts.map +1 -0
  203. package/server-dist/routes/route-helpers.js +242 -0
  204. package/server-dist/routes/route-helpers.js.map +1 -0
  205. package/server-dist/routes/sessions.d.ts.map +1 -1
  206. package/server-dist/routes/sessions.js +29 -5
  207. package/server-dist/routes/sessions.js.map +1 -1
  208. package/server-dist/routes/shared-aggregation.d.ts +82 -0
  209. package/server-dist/routes/shared-aggregation.d.ts.map +1 -0
  210. package/server-dist/routes/shared-aggregation.js +384 -0
  211. package/server-dist/routes/shared-aggregation.js.map +1 -0
  212. package/dashboard-dist/assets/index-C1mDRV7y.js +0 -607
  213. package/dashboard-dist/assets/index-_SWpRg6C.css +0 -1
@@ -0,0 +1,124 @@
1
+ export interface SQLiteMessageRow {
2
+ id: string;
3
+ session_id: string;
4
+ type: 'user' | 'assistant' | 'system';
5
+ content: string;
6
+ thinking: string | null;
7
+ tool_calls: string;
8
+ tool_results: string;
9
+ usage: string | null;
10
+ timestamp: string;
11
+ parent_id: string | null;
12
+ }
13
+ /**
14
+ * Optional session metadata from V6 columns.
15
+ * Passed to prompt generators to add context signals about context compaction
16
+ * and slash command usage. Only present when at least one V6 field is non-empty.
17
+ */
18
+ export interface SessionMetadata {
19
+ compactCount?: number;
20
+ autoCompactCount?: number;
21
+ slashCommands?: string[];
22
+ }
23
+ export interface AnalysisResponse {
24
+ facets?: {
25
+ outcome_satisfaction: string;
26
+ workflow_pattern: string | null;
27
+ had_course_correction: boolean;
28
+ course_correction_reason: string | null;
29
+ iteration_count: number;
30
+ friction_points: Array<{
31
+ _reasoning?: string;
32
+ category: string;
33
+ attribution?: string;
34
+ description: string;
35
+ severity: string;
36
+ resolution: string;
37
+ }>;
38
+ effective_patterns: Array<{
39
+ _reasoning?: string;
40
+ category: string;
41
+ description: string;
42
+ confidence: number;
43
+ driver?: 'user-driven' | 'ai-driven' | 'collaborative';
44
+ }>;
45
+ };
46
+ summary: {
47
+ title: string;
48
+ content: string;
49
+ outcome?: 'success' | 'partial' | 'abandoned' | 'blocked';
50
+ bullets: string[];
51
+ };
52
+ decisions: Array<{
53
+ title: string;
54
+ situation?: string;
55
+ choice?: string;
56
+ reasoning: string;
57
+ alternatives?: Array<{
58
+ option: string;
59
+ rejected_because: string;
60
+ }>;
61
+ trade_offs?: string;
62
+ revisit_when?: string;
63
+ confidence?: number;
64
+ evidence?: string[];
65
+ }>;
66
+ learnings: Array<{
67
+ title: string;
68
+ symptom?: string;
69
+ root_cause?: string;
70
+ takeaway?: string;
71
+ applies_when?: string;
72
+ confidence?: number;
73
+ evidence?: string[];
74
+ }>;
75
+ }
76
+ export interface ParseError {
77
+ error_type: 'json_parse_error' | 'no_json_found' | 'invalid_structure';
78
+ error_message: string;
79
+ response_length: number;
80
+ response_preview: string;
81
+ }
82
+ export type ParseResult<T> = {
83
+ success: true;
84
+ data: T;
85
+ } | {
86
+ success: false;
87
+ error: ParseError;
88
+ };
89
+ export interface PromptQualityFinding {
90
+ category: string;
91
+ type: 'deficit' | 'strength';
92
+ description: string;
93
+ message_ref: string;
94
+ impact: 'high' | 'medium' | 'low';
95
+ confidence: number;
96
+ suggested_improvement?: string;
97
+ }
98
+ export interface PromptQualityTakeaway {
99
+ type: 'improve' | 'reinforce';
100
+ category: string;
101
+ label: string;
102
+ message_ref: string;
103
+ original?: string;
104
+ better_prompt?: string;
105
+ why?: string;
106
+ what_worked?: string;
107
+ why_effective?: string;
108
+ }
109
+ export interface PromptQualityDimensionScores {
110
+ context_provision: number;
111
+ request_specificity: number;
112
+ scope_management: number;
113
+ information_timing: number;
114
+ correction_quality: number;
115
+ }
116
+ export interface PromptQualityResponse {
117
+ efficiency_score: number;
118
+ message_overhead: number;
119
+ assessment: string;
120
+ takeaways: PromptQualityTakeaway[];
121
+ findings: PromptQualityFinding[];
122
+ dimension_scores: PromptQualityDimensionScores;
123
+ }
124
+ //# sourceMappingURL=prompt-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt-types.d.ts","sourceRoot":"","sources":["../../src/llm/prompt-types.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,QAAQ,CAAC;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CAC1B;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,CAAC,EAAE;QACP,oBAAoB,EAAE,MAAM,CAAC;QAC7B,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;QAChC,qBAAqB,EAAE,OAA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,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,4BAA4B;IAC3C,iBAAiB,EAAE,MAAM,CAAC;IAC1B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,gBAAgB,EAAE,MAAM,CAAC;IACzB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,qBAAqB;IACpC,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,qBAAqB,EAAE,CAAC;IACnC,QAAQ,EAAE,oBAAoB,EAAE,CAAC;IACjC,gBAAgB,EAAE,4BAA4B,CAAC;CAChD"}
@@ -0,0 +1,4 @@
1
+ // Type definitions for LLM prompt analysis.
2
+ // Extracted from prompts.ts — shared by message-format.ts, response-parsers.ts, and analysis.ts.
3
+ export {};
4
+ //# sourceMappingURL=prompt-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt-types.js","sourceRoot":"","sources":["../../src/llm/prompt-types.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,iGAAiG"}
@@ -1,109 +1,66 @@
1
- import type { SessionCharacter } from '@code-insights/cli/types';
2
- export interface SQLiteMessageRow {
3
- id: string;
4
- session_id: string;
5
- type: 'user' | 'assistant' | 'system';
6
- content: string;
7
- thinking: string | null;
8
- tool_calls: string;
9
- tool_results: string;
10
- usage: string | null;
11
- timestamp: string;
12
- parent_id: string | null;
13
- }
1
+ import type { SessionMetadata } from './prompt-types.js';
2
+ import type { ContentBlock } from './types.js';
14
3
  /**
15
- * Format SQLite message rows for LLM consumption.
16
- * Handles snake_case fields and JSON-encoded tool_calls/tool_results.
4
+ * Shared system prompt for all LLM analysis calls.
5
+ * Paired with buildCacheableConversationBlock() + an analysis-specific instruction block.
17
6
  */
18
- export declare function formatMessagesForAnalysis(messages: SQLiteMessageRow[]): string;
7
+ export declare const SHARED_ANALYST_SYSTEM_PROMPT = "You are a senior staff engineer analyzing an AI coding session. You will receive the conversation transcript followed by specific extraction instructions. Respond with valid JSON only, wrapped in <json>...</json> tags.";
19
8
  /**
20
- * System prompt for session analysis.
9
+ * Wrap formatted conversation messages in a cacheable content block.
10
+ * The cache_control field instructs Anthropic to cache everything up to
11
+ * and including this block (ephemeral, 5-minute TTL).
12
+ *
13
+ * Non-Anthropic providers receive this as a ContentBlock[] and use
14
+ * flattenContent() to convert it to a plain string.
15
+ *
16
+ * @param formattedMessages - Output of formatMessagesForAnalysis()
21
17
  */
22
- export declare const SESSION_ANALYSIS_SYSTEM_PROMPT = "You are a senior staff engineer writing entries for a team's engineering knowledge base. You've just observed an AI-assisted coding session and your job is to extract the insights that would save another engineer time if they encountered a similar situation 6 months from now.\n\nYour audience is a developer who has never seen this session but works on the same codebase. They need enough context to understand WHY a decision was made, WHAT specific gotcha was discovered, and WHEN this knowledge applies.\n\nYou will extract:\n1. **Summary**: A narrative of what was accomplished and the outcome\n2. **Decisions**: Technical choices made \u2014 with full situation context, reasoning, rejected alternatives, trade-offs, and conditions for revisiting (max 3)\n3. **Learnings**: Technical discoveries, gotchas, debugging breakthroughs \u2014 with the observable symptom, root cause, and a transferable takeaway (max 5)\n4. **Session Character**: Classify the session into exactly one of these types based on its overall nature:\n - deep_focus: Long, concentrated work on a specific problem or area (50+ messages, deep into one topic)\n - bug_hunt: Debugging-driven \u2014 investigating errors, tracing issues, fixing bugs\n - feature_build: Building new functionality \u2014 creating files, adding endpoints, wiring components\n - exploration: Research-oriented \u2014 reading code, searching, understanding before acting\n - refactor: Restructuring existing code \u2014 renaming, moving, reorganizing without new features\n - learning: Knowledge-seeking \u2014 asking questions, understanding concepts, getting explanations\n - quick_task: Short and focused \u2014 small fix, config change, or one-off task (<10 messages)\n\nQuality Standards:\n- Only include insights you would write in a team knowledge base for future reference\n- Each insight MUST reference concrete details: specific file names, library names, error messages, API endpoints, or code patterns\n- Do not invent file names, APIs, errors, or details not present in the conversation\n- Rate your confidence in each insight's value (0-100). Only include insights you rate 70+.\n- It is better to return 0 insights in a category than to include generic or trivial ones\n- If a session is straightforward with no notable decisions or learnings, say so in the summary and leave other categories empty\n\nLength Guidance:\n- Fill every field in the schema. An empty \"trade_offs\" or \"revisit_when\" is worse than a longer response.\n- Total response: stay under 2000 tokens. If you must cut, drop lower-confidence insights rather than compressing high-confidence ones.\n- Evidence: 1-3 short quotes per insight, referencing turn labels.\n- Prefer precision over brevity \u2014 a specific 3-sentence insight beats a vague 1-sentence insight.\n\nDO NOT include insights like these (too generic/trivial):\n- \"Used debugging techniques to fix an issue\"\n- \"Made architectural decisions about the codebase\"\n- \"Implemented a new feature\" (the summary already covers this)\n- \"Used React hooks for state management\" (too generic without specifics)\n- \"Fixed a bug in the code\" (what bug? what was the root cause?)\n- Anything that restates the task without adding transferable knowledge\n\nHere are examples of EXCELLENT insights \u2014 this is the quality bar:\n\nEXCELLENT decision:\n{\n \"title\": \"Use better-sqlite3 instead of sql.js for local database\",\n \"situation\": \"Needed a SQLite driver for a Node.js CLI that stores session data locally. Single-user, read-heavy from dashboard, occasional writes during sync.\",\n \"choice\": \"better-sqlite3 \u2014 synchronous C++ binding with native SQLite access, no async overhead.\",\n \"reasoning\": \"CLI runs locally with no concurrent users. Synchronous API eliminates callback complexity. WAL mode provides concurrent read access for the dashboard while CLI writes.\",\n \"alternatives\": [\n {\"option\": \"sql.js (WASM build)\", \"rejected_because\": \"3x slower for bulk inserts, entire DB in memory, no WAL support\"},\n {\"option\": \"PostgreSQL via Docker\", \"rejected_because\": \"Violates local-first constraint \u2014 requires running a server process\"}\n ],\n \"trade_offs\": \"Requires native compilation (node-gyp) which can fail on some systems. No browser compatibility.\",\n \"revisit_when\": \"If multi-device sync is added or users report node-gyp build failures.\",\n \"confidence\": 92,\n \"evidence\": [\"User#3: 'We need something that works without a server'\", \"Assistant#4: 'better-sqlite3 with WAL mode gives concurrent reads...'\"]\n}\n\nEXCELLENT learning:\n{\n \"title\": \"Tailwind v4 requires @theme inline{} for CSS variable utilities\",\n \"symptom\": \"After Tailwind v3\u2192v4 upgrade, custom utilities like bg-primary stopped working. Classes present in HTML but no styles applied.\",\n \"root_cause\": \"Tailwind v4 removed tailwind.config.js theme extension. CSS variables in :root are not automatically available as utilities \u2014 must be registered via @theme inline {} in the CSS file.\",\n \"takeaway\": \"When migrating Tailwind v3\u2192v4 with shadcn/ui: add @theme inline {} mapping CSS variables, add @custom-variant dark for class-based dark mode, replace tailwindcss-animate with tw-animate-css.\",\n \"applies_when\": \"Any Tailwind v3\u2192v4 migration using CSS variables for theming, especially with shadcn/ui.\",\n \"confidence\": 95,\n \"evidence\": [\"User#12: 'The colors are all gone after the upgrade'\", \"Assistant#13: 'Tailwind v4 requires explicit @theme inline registration...'\"]\n}\n\nRespond with valid JSON only, wrapped in <json>...</json> tags. Do not include any other text.";
18
+ export declare function buildCacheableConversationBlock(formattedMessages: string): ContentBlock;
23
19
  /**
24
- * Generate the user prompt for session analysis.
20
+ * Build the instruction suffix for session analysis.
21
+ * Used as the second content block in the user message, after the cached conversation.
25
22
  */
26
- export declare function generateSessionAnalysisPrompt(projectName: string, sessionSummary: string | null, formattedMessages: string): string;
27
- export interface AnalysisResponse {
28
- session_character?: SessionCharacter;
29
- summary: {
30
- title: string;
31
- content: string;
32
- outcome?: 'success' | 'partial' | 'abandoned' | 'blocked';
33
- bullets: string[];
34
- };
35
- decisions: Array<{
36
- title: string;
37
- situation?: string;
38
- choice?: string;
39
- reasoning: string;
40
- alternatives?: Array<{
41
- option: string;
42
- rejected_because: string;
43
- }>;
44
- trade_offs?: string;
45
- revisit_when?: string;
46
- confidence?: number;
47
- evidence?: string[];
48
- }>;
49
- learnings: Array<{
50
- title: string;
51
- symptom?: string;
52
- root_cause?: string;
53
- takeaway?: string;
54
- applies_when?: string;
55
- confidence?: number;
56
- evidence?: string[];
57
- }>;
58
- }
59
- export interface ParseError {
60
- error_type: 'json_parse_error' | 'no_json_found' | 'invalid_structure';
61
- error_message: string;
62
- response_length: number;
63
- response_preview: string;
64
- }
65
- export type ParseResult<T> = {
66
- success: true;
67
- data: T;
68
- } | {
69
- success: false;
70
- error: ParseError;
71
- };
23
+ export declare function buildSessionAnalysisInstructions(projectName: string, sessionSummary: string | null, meta?: SessionMetadata): string;
72
24
  /**
73
- * Parse the LLM response into structured insights.
25
+ * Build the instruction suffix for prompt quality analysis.
26
+ * Used as the second content block in the user message, after the cached conversation.
74
27
  */
75
- export declare function parseAnalysisResponse(response: string): ParseResult<AnalysisResponse>;
76
- export declare const PROMPT_QUALITY_SYSTEM_PROMPT = "You are a prompt engineering coach helping developers communicate more effectively with AI coding assistants. You review conversations and identify specific moments where better prompting would have saved time.\n\nYou will identify:\n1. **Wasted turns**: User messages that led to clarifications, corrections, or repeated instructions because the original prompt was unclear, missing context, or too vague.\n2. **Anti-patterns**: Recurring bad habits in the user's prompting style, with specific fixes.\n3. **Session traits**: Higher-level behavioral patterns about how the session was structured and managed.\n4. **Efficiency score**: A 0-100 rating of how optimally the user communicated.\n5. **Actionable tips**: Specific improvements the user can make.\n\nBefore evaluating, mentally walk through the conversation and identify:\n1. Each time the assistant asked for clarification that could have been avoided\n2. Each time the user corrected the assistant's interpretation\n3. Each time the user repeated an instruction they gave earlier\n4. Whether the session covers too many unrelated objectives (context drift / session bloat)\n5. Whether the user provided critical context or requirements late that should have been mentioned upfront\n6. Whether the user discussed the plan/approach before jumping into implementation, or dove straight into code\nThese are your candidate findings. Only include them if they are genuinely actionable.\n\nGuidelines:\n- Focus on USER messages only \u2014 don't critique the assistant's responses\n- A \"wasted turn\" is when the user had to send a follow-up message to clarify, correct, or repeat something that could have been included in the original prompt\n- Only mark a wasted turn if the assistant explicitly asked for clarification or corrected a misunderstanding\n- Be constructive, not judgmental \u2014 the goal is to help users improve\n- Consider the context: some clarification exchanges are normal and expected\n- A score of 100 means every user message was perfectly clear and complete\n- A score of 50 means about half the messages could have been more efficient\n\nLength Guidance:\n- Max 5 wasted turns, max 3 anti-patterns, max 3 session traits, max 5 tips\n- suggestedRewrite must be a complete, usable prompt \u2014 not vague meta-advice\n- overallAssessment: 2-3 sentences\n- Total response: stay under 2000 tokens\n\nRespond with valid JSON only, wrapped in <json>...</json> tags. Do not include any other text.";
77
- export declare function generatePromptQualityPrompt(projectName: string, formattedMessages: string, messageCount: number): string;
78
- export interface WastedTurn {
79
- messageIndex: number;
80
- originalMessage?: string;
81
- whatWentWrong?: string;
82
- suggestedRewrite: string;
83
- turnsWasted?: number;
84
- }
85
- export interface AntiPattern {
86
- name: string;
87
- description?: string;
88
- count: number;
89
- examples: string[];
90
- fix?: string;
91
- }
92
- export interface SessionTrait {
93
- trait: 'context_drift' | 'objective_bloat' | 'late_context' | 'no_planning' | 'good_structure';
94
- severity: 'high' | 'medium' | 'low';
95
- description: string;
96
- evidence?: string;
97
- suggestion?: string;
98
- }
99
- export interface PromptQualityResponse {
100
- efficiencyScore: number;
101
- potentialMessageReduction: number;
102
- overallAssessment: string;
103
- wastedTurns: WastedTurn[];
104
- antiPatterns: AntiPattern[];
105
- sessionTraits: SessionTrait[];
106
- tips: string[];
107
- }
108
- export declare function parsePromptQualityResponse(response: string): ParseResult<PromptQualityResponse>;
28
+ export declare function buildPromptQualityInstructions(projectName: string, sessionMeta: {
29
+ humanMessageCount: number;
30
+ assistantMessageCount: number;
31
+ toolExchangeCount: number;
32
+ }, meta?: SessionMetadata): string;
33
+ /**
34
+ * Build the instruction suffix for facet-only extraction (backfill path).
35
+ * Used as the second content block in the user message, after the cached conversation.
36
+ */
37
+ export declare function buildFacetOnlyInstructions(projectName: string, sessionSummary: string | null, meta?: SessionMetadata): string;
38
+ /**
39
+ * @deprecated Use SHARED_ANALYST_SYSTEM_PROMPT + buildSessionAnalysisInstructions() instead.
40
+ */
41
+ export declare const SESSION_ANALYSIS_SYSTEM_PROMPT: string;
42
+ /**
43
+ * @deprecated Use buildCacheableConversationBlock() + buildSessionAnalysisInstructions() instead.
44
+ */
45
+ export declare function generateSessionAnalysisPrompt(projectName: string, sessionSummary: string | null, formattedMessages: string, meta?: SessionMetadata): string;
46
+ /**
47
+ * @deprecated Use SHARED_ANALYST_SYSTEM_PROMPT + buildFacetOnlyInstructions() instead.
48
+ */
49
+ export declare const FACET_ONLY_SYSTEM_PROMPT: string;
50
+ /**
51
+ * @deprecated Use buildCacheableConversationBlock() + buildFacetOnlyInstructions() instead.
52
+ */
53
+ export declare function generateFacetOnlyPrompt(projectName: string, sessionSummary: string | null, conversationMessages: string, meta?: SessionMetadata): string;
54
+ /**
55
+ * @deprecated Use SHARED_ANALYST_SYSTEM_PROMPT + buildPromptQualityInstructions() instead.
56
+ */
57
+ export declare const PROMPT_QUALITY_SYSTEM_PROMPT = "You are a prompt engineering coach helping developers communicate more effectively with AI coding assistants. You review conversations and identify specific moments where better prompting would have saved time \u2014 AND moments where the user prompted particularly well.\n\nYou will produce:\n1. **Takeaways**: Concrete before/after examples the user can learn from (max 4)\n2. **Findings**: Categorized findings for cross-session aggregation (max 8)\n3. **Dimension scores**: 5 numeric dimensions for progress tracking\n4. **Efficiency score**: 0-100 overall rating\n5. **Assessment**: 2-3 sentence summary\n\nBefore evaluating, mentally walk through the conversation and identify:\n1. Each time the assistant asked for clarification that could have been avoided\n2. Each time the user corrected the assistant's interpretation\n3. Each time the user repeated an instruction they gave earlier\n4. Whether critical context or requirements were provided late\n5. Whether the user discussed the plan/approach before implementation\n6. Moments where the user's prompt was notably well-crafted\n7. If context compactions occurred, note that the AI may have lost context \u2014 repeated instructions IMMEDIATELY after a compaction are NOT a user prompting deficit\nThese are your candidate findings. Only include them if they are genuinely actionable.\n\n\nPROMPT QUALITY CLASSIFICATION GUIDANCE:\n\nEach finding captures a specific moment where the user's prompting either caused friction (deficit) or enabled productivity (strength).\n\nDEFICIT CATEGORIES \u2014 classify prompting problems:\n- \"vague-request\": Request lacked specificity needed for the AI to act without guessing. Missing file paths, function names, expected behavior, or concrete details.\n NOT this category if the AI had enough context to succeed but failed anyway \u2014 that is an AI capability issue, not a prompting issue.\n\n- \"missing-context\": Critical background knowledge about architecture, conventions, dependencies, or current state was not provided.\n NOT this category if the information was available in the codebase and the AI could have found it by reading files \u2014 that is an AI context-gathering failure.\n\n- \"late-constraint\": A requirement or constraint was provided AFTER the AI had already started implementing a different approach, causing rework.\n NOT this category if the constraint was genuinely discovered during implementation (requirements changed). Only classify if the user KNEW the constraint before the session started.\n\n- \"unclear-correction\": The user told the AI its output was wrong without explaining what was wrong or why. \"That's not right\", \"try again\", \"no\" without context.\n NOT this category if the user gave a brief but sufficient correction (\"use map instead of forEach\" is clear enough).\n\n- \"scope-drift\": The session objective shifted mid-conversation, or multiple unrelated objectives were addressed in one session.\n NOT this category if the user is working through logically connected subtasks of one objective.\n\n- \"missing-acceptance-criteria\": The user did not define what successful completion looks like, leading to back-and-forth about whether the output meets expectations.\n NOT this category for exploratory sessions where the user is discovering what they want.\n\n- \"assumption-not-surfaced\": The user held an unstated assumption that the AI could not reasonably infer from code or conversation.\n NOT this category if the assumption was reasonable for the AI to make (e.g., standard coding conventions).\n\nSTRENGTH CATEGORIES \u2014 classify prompting successes (only when notably above average):\n- \"precise-request\": Request included enough specificity (file paths, function names, expected behavior, error messages) that the AI could act correctly on the first attempt.\n\n- \"effective-context\": User proactively shared architecture, conventions, prior decisions, or current state that the AI demonstrably used to make better decisions.\n\n- \"productive-correction\": When the AI went off track, the user provided a correction that included WHAT was wrong, WHY, and enough context for the AI to redirect effectively on the next response.\n\nCONTRASTIVE PAIRS:\n- vague-request vs missing-context: Was the problem in HOW THE TASK WAS DESCRIBED (vague-request) or WHAT BACKGROUND KNOWLEDGE WAS ABSENT (missing-context)?\n- late-constraint vs missing-context: Did the user EVENTUALLY provide it in the same session? Yes \u2192 late-constraint. Never \u2192 missing-context.\n- missing-context vs assumption-not-surfaced: Is this a FACT the user could have copy-pasted (missing-context), or a BELIEF/PREFERENCE they held (assumption-not-surfaced)?\n- scope-drift vs missing-acceptance-criteria: Did the user try to do TOO MANY THINGS (scope-drift) or ONE THING WITHOUT DEFINING SUCCESS (missing-acceptance-criteria)?\n- unclear-correction vs vague-request: Was this the user's FIRST MESSAGE about this task (vague-request) or a RESPONSE TO AI OUTPUT (unclear-correction)?\n\nDIMENSION SCORING (0-100):\n- context_provision: How well did the user provide relevant background upfront?\n 90+: Proactively shared architecture, constraints, conventions. 50-69: Notable gaps causing detours. <30: No context, AI working blind.\n- request_specificity: How precise were task requests?\n 90+: File paths, expected behavior, scope boundaries. 50-69: Mix of specific and vague. <30: Nearly all requests lacked detail.\n- scope_management: How focused was the session?\n 90+: Single clear objective, logical progression. 50-69: Some drift but primary goal met. <30: Unfocused, no clear objective.\n- information_timing: Were requirements provided when needed?\n 90+: All constraints front-loaded before implementation. 50-69: Some important requirements late. <30: Requirements drip-fed, constant corrections.\n- correction_quality: How well did the user redirect the AI?\n 90+: Corrections included what, why, and context. 50-69: Mix of clear and unclear. <30: Corrections gave almost no signal.\n Score 75 if no corrections were needed (absence of corrections in a successful session = good prompting).\n\nEDGE CASES:\n- Short sessions (<5 user messages): Score conservatively. Do not penalize for missing elements unnecessary in quick tasks.\n- Exploration sessions: Do not penalize for missing acceptance criteria or scope drift.\n- Sessions where AI performed well despite vague prompts: Still classify deficits. Impact should be \"low\" since no visible cost.\n- Agentic/delegation sessions: If the user gave a clear high-level directive and the AI autonomously planned and executed successfully, do not penalize for low message count or lack of micro-level specificity. Effective delegation IS good prompting. Focus on the quality of the initial delegation prompt.\n\nGuidelines:\n- Focus on USER messages only \u2014 don't critique the assistant's responses\n- Be constructive, not judgmental \u2014 the goal is to help users improve\n- A score of 100 means every user message was perfectly clear and complete\n- A score of 50 means about half the messages could have been more efficient\n- Include BOTH deficits and strengths \u2014 what went right matters as much as what went wrong\n- If the user prompted well, say so \u2014 don't manufacture issues\n- If the session had context compactions, do NOT penalize the user for repeating instructions immediately after a compaction \u2014 the AI lost context, not the user. Repetition unrelated to compaction events should still be flagged.\n\nLength Guidance:\n- Max 4 takeaways (ordered: improve first, then reinforce), max 8 findings\n- better_prompt must be a complete, usable prompt \u2014 not vague meta-advice\n- assessment: 2-3 sentences\n- Total response: stay under 2500 tokens\n\nRespond with valid JSON only, wrapped in <json>...</json> tags. Do not include any other text.";
58
+ /**
59
+ * @deprecated Use buildCacheableConversationBlock() + buildPromptQualityInstructions() instead.
60
+ */
61
+ export declare function generatePromptQualityPrompt(projectName: string, formattedMessages: string, sessionMeta: {
62
+ humanMessageCount: number;
63
+ assistantMessageCount: number;
64
+ toolExchangeCount: number;
65
+ }, meta?: SessionMetadata): string;
109
66
  //# sourceMappingURL=prompts.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../src/llm/prompts.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAIjE,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,QAAQ,CAAC;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAUD;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,gBAAgB,EAAE,GAAG,MAAM,CA8C9E;AAED;;GAEG;AACH,eAAO,MAAM,8BAA8B,0lLAoEoD,CAAC;AAEhG;;GAEG;AACH,wBAAgB,6BAA6B,CAC3C,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,GAAG,IAAI,EAC7B,iBAAiB,EAAE,MAAM,GACxB,MA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