@smallwebco/tinypivot-core 1.0.52 → 1.0.54
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/ai/demo.d.ts +60 -0
- package/dist/ai/demo.d.ts.map +1 -0
- package/dist/ai/demo.js +460 -0
- package/dist/ai/demo.js.map +1 -0
- package/dist/ai/index.d.ts +9 -0
- package/dist/ai/index.d.ts.map +1 -0
- package/dist/ai/index.js +11 -0
- package/dist/ai/index.js.map +1 -0
- package/dist/ai/prompts.d.ts +39 -0
- package/dist/ai/prompts.d.ts.map +1 -0
- package/dist/ai/prompts.js +221 -0
- package/dist/ai/prompts.js.map +1 -0
- package/dist/ai/session.d.ts +69 -0
- package/dist/ai/session.d.ts.map +1 -0
- package/dist/ai/session.js +145 -0
- package/dist/ai/session.js.map +1 -0
- package/dist/chart/index.d.ts +31 -5
- package/dist/chart/index.d.ts.map +1 -1
- package/dist/chart/index.js +111 -41
- package/dist/chart/index.js.map +1 -1
- package/dist/index.d.ts +6 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -2
- package/dist/index.js.map +1 -1
- package/dist/license/index.d.ts +4 -0
- package/dist/license/index.d.ts.map +1 -1
- package/dist/license/index.js +10 -0
- package/dist/license/index.js.map +1 -1
- package/dist/types/index.d.ts +303 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build the system prompt for the AI Data Analyst
|
|
3
|
+
*/
|
|
4
|
+
export function buildSystemPrompt(dataSources, schemas, selectedSourceId) {
|
|
5
|
+
const selectedSchema = selectedSourceId ? schemas.get(selectedSourceId) : undefined;
|
|
6
|
+
const selectedSource = selectedSourceId
|
|
7
|
+
? dataSources.find(ds => ds.id === selectedSourceId)
|
|
8
|
+
: undefined;
|
|
9
|
+
return `You are a data analyst assistant. Your job is to translate user questions into SQL queries and return data results.
|
|
10
|
+
|
|
11
|
+
## CRITICAL: ALWAYS GENERATE A SQL QUERY
|
|
12
|
+
**Every response MUST include a SQL query.** The user is here to explore data - they expect to see results.
|
|
13
|
+
- If the user asks a question → Generate a query to answer it
|
|
14
|
+
- If the user says "show me" or "what are" → Generate a query
|
|
15
|
+
- If the user asks for trends/patterns → Generate an aggregation query
|
|
16
|
+
- If the question is vague → Make reasonable assumptions and generate a query anyway
|
|
17
|
+
- If you're unsure what they want → Generate a sensible default query (like top 10 rows with key columns)
|
|
18
|
+
|
|
19
|
+
**NEVER respond with only text. ALWAYS include a SQL query in your response.**
|
|
20
|
+
|
|
21
|
+
## Available Data Sources
|
|
22
|
+
${formatDataSourcesList(dataSources)}
|
|
23
|
+
|
|
24
|
+
${selectedSource && selectedSchema ? formatSelectedSchemaContext(selectedSource, selectedSchema) : '## No Data Source Selected\nPlease ask the user to select a data source first.'}
|
|
25
|
+
|
|
26
|
+
## Query Rules
|
|
27
|
+
1. **READ-ONLY**: ONLY use SELECT. NEVER use INSERT, UPDATE, DELETE, DROP, ALTER, TRUNCATE, or any write operations.
|
|
28
|
+
2. **LIMIT RESULTS**: Always use LIMIT (default 100-1000 rows) to avoid overwhelming results.
|
|
29
|
+
3. **ONE TABLE**: Only query the currently selected table: \`${selectedSchema?.table || 'table_name'}\`
|
|
30
|
+
4. **BE SPECIFIC**: Select relevant columns, not SELECT * (unless showing sample data)
|
|
31
|
+
|
|
32
|
+
## Query Format
|
|
33
|
+
Output queries in this EXACT format (the system auto-executes SQL blocks):
|
|
34
|
+
|
|
35
|
+
\`\`\`sql
|
|
36
|
+
SELECT column1, column2 FROM ${selectedSchema?.table || 'table_name'} WHERE condition LIMIT 100
|
|
37
|
+
\`\`\`
|
|
38
|
+
|
|
39
|
+
For complex analysis, use CTEs:
|
|
40
|
+
\`\`\`sql
|
|
41
|
+
WITH summary AS (
|
|
42
|
+
SELECT category, COUNT(*) as count
|
|
43
|
+
FROM ${selectedSchema?.table || 'table_name'}
|
|
44
|
+
GROUP BY category
|
|
45
|
+
)
|
|
46
|
+
SELECT * FROM summary ORDER BY count DESC LIMIT 20
|
|
47
|
+
\`\`\`
|
|
48
|
+
|
|
49
|
+
## Response Format
|
|
50
|
+
Keep responses concise and insight-focused:
|
|
51
|
+
1. **Start with the SQL query** in a code block (REQUIRED) - this will be extracted and hidden from the user
|
|
52
|
+
2. **Then provide your insight/analysis** (2-3 sentences) explaining what the data shows
|
|
53
|
+
3. **Optional**: Suggest 1-2 follow-up questions
|
|
54
|
+
|
|
55
|
+
**IMPORTANT**: The SQL block is automatically extracted and shown separately. Your text response should focus on INSIGHTS about the data, not describing the query itself. Don't say "I'm querying..." or "This query shows...". Instead, provide the analytical insight directly.
|
|
56
|
+
|
|
57
|
+
Example response:
|
|
58
|
+
"\`\`\`sql
|
|
59
|
+
SELECT department, AVG(salary) as avg_salary FROM employees GROUP BY department ORDER BY avg_salary DESC LIMIT 10
|
|
60
|
+
\`\`\`
|
|
61
|
+
|
|
62
|
+
Engineering and Product teams have the highest average salaries at $145K and $138K respectively, while Support and Operations are at the lower end around $75K. This 2x salary gap may indicate market-driven compensation or role complexity differences.
|
|
63
|
+
|
|
64
|
+
Want to see how this breaks down by job level?"
|
|
65
|
+
|
|
66
|
+
## If Query Fails
|
|
67
|
+
- Acknowledge the error briefly
|
|
68
|
+
- Provide a corrected query immediately
|
|
69
|
+
- Don't apologize excessively, just fix it`;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Format the list of available data sources for the prompt
|
|
73
|
+
*/
|
|
74
|
+
function formatDataSourcesList(dataSources) {
|
|
75
|
+
if (dataSources.length === 0) {
|
|
76
|
+
return 'No data sources configured.';
|
|
77
|
+
}
|
|
78
|
+
return dataSources
|
|
79
|
+
.map((ds) => {
|
|
80
|
+
const desc = ds.description ? `: ${ds.description}` : '';
|
|
81
|
+
return `- **${ds.name}** (${ds.table})${desc}`;
|
|
82
|
+
})
|
|
83
|
+
.join('\n');
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Format the schema context for the currently selected data source
|
|
87
|
+
*/
|
|
88
|
+
function formatSelectedSchemaContext(source, schema) {
|
|
89
|
+
// Filter out hidden columns
|
|
90
|
+
const visibleColumns = schema.columns.filter((col) => {
|
|
91
|
+
const override = source.columns?.find(c => c.name === col.name);
|
|
92
|
+
return !override?.hidden;
|
|
93
|
+
});
|
|
94
|
+
// Merge descriptions from overrides
|
|
95
|
+
const columnsWithDescriptions = visibleColumns.map((col) => {
|
|
96
|
+
const override = source.columns?.find(c => c.name === col.name);
|
|
97
|
+
return {
|
|
98
|
+
...col,
|
|
99
|
+
description: override?.description || col.description,
|
|
100
|
+
};
|
|
101
|
+
});
|
|
102
|
+
return `## Currently Selected: ${source.name}
|
|
103
|
+
Table: \`${schema.table}\`
|
|
104
|
+
${source.description ? `Description: ${source.description}` : ''}
|
|
105
|
+
|
|
106
|
+
### Columns
|
|
107
|
+
${formatColumnsTable(columnsWithDescriptions)}
|
|
108
|
+
|
|
109
|
+
### Query Tips
|
|
110
|
+
- Use column names exactly as shown above
|
|
111
|
+
- The table name is \`${schema.table}\`
|
|
112
|
+
- For text searches, use ILIKE for case-insensitive matching
|
|
113
|
+
- For date columns, use standard SQL date functions`;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Format columns as a readable table for the prompt
|
|
117
|
+
*/
|
|
118
|
+
function formatColumnsTable(columns) {
|
|
119
|
+
return columns
|
|
120
|
+
.map((col) => {
|
|
121
|
+
const nullable = col.nullable ? 'nullable' : 'required';
|
|
122
|
+
const desc = col.description ? ` - ${col.description}` : '';
|
|
123
|
+
return `- \`${col.name}\` (${col.type}, ${nullable})${desc}`;
|
|
124
|
+
})
|
|
125
|
+
.join('\n');
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Build a user message with additional context
|
|
129
|
+
*/
|
|
130
|
+
export function buildUserMessage(userInput, context) {
|
|
131
|
+
let message = userInput;
|
|
132
|
+
if (context?.previousQueryFailed && context.errorMessage) {
|
|
133
|
+
message = `[Previous query failed: ${context.errorMessage}]\n\n${userInput}`;
|
|
134
|
+
}
|
|
135
|
+
return message;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Extract SQL query from AI response
|
|
139
|
+
* Returns the SQL if found, null otherwise
|
|
140
|
+
*/
|
|
141
|
+
export function extractSQLFromResponse(response) {
|
|
142
|
+
// Match SQL code blocks
|
|
143
|
+
const sqlBlockRegex = /```sql\s*([\s\S]*?)```/i;
|
|
144
|
+
const match = response.match(sqlBlockRegex);
|
|
145
|
+
if (match && match[1]) {
|
|
146
|
+
const sql = match[1].trim();
|
|
147
|
+
// Validate it's a SELECT statement
|
|
148
|
+
if (!sql.toUpperCase().startsWith('SELECT')) {
|
|
149
|
+
return null;
|
|
150
|
+
}
|
|
151
|
+
return sql;
|
|
152
|
+
}
|
|
153
|
+
return null;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Validate that a SQL query is safe (read-only)
|
|
157
|
+
*/
|
|
158
|
+
export function validateSQLSafety(sql) {
|
|
159
|
+
const upperSQL = sql.toUpperCase().trim();
|
|
160
|
+
// Must start with SELECT or WITH (for CTEs)
|
|
161
|
+
if (!upperSQL.startsWith('SELECT') && !upperSQL.startsWith('WITH')) {
|
|
162
|
+
return { valid: false, error: 'Only SELECT queries (including CTEs with WITH) are allowed' };
|
|
163
|
+
}
|
|
164
|
+
// If it starts with WITH, ensure it ends with a SELECT
|
|
165
|
+
if (upperSQL.startsWith('WITH') && !upperSQL.includes('SELECT')) {
|
|
166
|
+
return { valid: false, error: 'CTE queries must include a final SELECT statement' };
|
|
167
|
+
}
|
|
168
|
+
// Check for dangerous keywords
|
|
169
|
+
const dangerousKeywords = [
|
|
170
|
+
'INSERT',
|
|
171
|
+
'UPDATE',
|
|
172
|
+
'DELETE',
|
|
173
|
+
'DROP',
|
|
174
|
+
'ALTER',
|
|
175
|
+
'TRUNCATE',
|
|
176
|
+
'CREATE',
|
|
177
|
+
'GRANT',
|
|
178
|
+
'REVOKE',
|
|
179
|
+
'EXEC',
|
|
180
|
+
'EXECUTE',
|
|
181
|
+
'INTO', // SELECT INTO
|
|
182
|
+
];
|
|
183
|
+
for (const keyword of dangerousKeywords) {
|
|
184
|
+
// Check for keyword as a whole word (not part of column name)
|
|
185
|
+
const regex = new RegExp(`\\b${keyword}\\b`, 'i');
|
|
186
|
+
if (regex.test(sql)) {
|
|
187
|
+
return { valid: false, error: `Query contains forbidden keyword: ${keyword}` };
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
// Check for multiple statements
|
|
191
|
+
if (sql.includes(';')) {
|
|
192
|
+
const statements = sql.split(';').filter(s => s.trim().length > 0);
|
|
193
|
+
if (statements.length > 1) {
|
|
194
|
+
return { valid: false, error: 'Multiple statements are not allowed' };
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
return { valid: true };
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Build a summary message after query results are returned
|
|
201
|
+
*/
|
|
202
|
+
export function buildResultsSummary(rowCount, truncated, maxRows) {
|
|
203
|
+
if (rowCount === 0) {
|
|
204
|
+
return 'The query returned no results. You may want to adjust your filters or try a different approach.';
|
|
205
|
+
}
|
|
206
|
+
if (truncated) {
|
|
207
|
+
return `Retrieved ${rowCount} rows (limited to ${maxRows}). There may be more data matching your query. Consider adding filters to narrow down the results.`;
|
|
208
|
+
}
|
|
209
|
+
return `Retrieved ${rowCount} row${rowCount === 1 ? '' : 's'}.`;
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Strip SQL code blocks from message content for display
|
|
213
|
+
* The SQL is stored in metadata and shown via a button instead
|
|
214
|
+
*/
|
|
215
|
+
export function stripSQLFromContent(content) {
|
|
216
|
+
// Remove SQL code blocks and any surrounding whitespace
|
|
217
|
+
return content
|
|
218
|
+
.replace(/```sql\s*[\s\S]*?```\s*/gi, '')
|
|
219
|
+
.trim();
|
|
220
|
+
}
|
|
221
|
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GAAG,CAAC,EAAE,CAAC;YAC1B,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,qCAAqC,EAAE,CAAA;QACvE,CAAC;IACH,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAA;AACxB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB,CACjC,QAAgB,EAChB,SAAkB,EAClB,OAAe;IAEf,IAAI,QAAQ,KAAK,CAAC,EAAE,CAAC;QACnB,OAAO,iGAAiG,CAAA;IAC1G,CAAC;IAED,IAAI,SAAS,EAAE,CAAC;QACd,OAAO,aAAa,QAAQ,qBAAqB,OAAO,oGAAoG,CAAA;IAC9J,CAAC;IAED,OAAO,aAAa,QAAQ,OAAO,QAAQ,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG,CAAA;AACjE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,OAAe;IACjD,wDAAwD;IACxD,OAAO,OAAO;SACX,OAAO,CAAC,2BAA2B,EAAE,EAAE,CAAC;SACxC,IAAI,EAAE,CAAA;AACX,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TinyPivot Core - AI Session Management
|
|
3
|
+
* Utilities for managing AI conversation sessions
|
|
4
|
+
*/
|
|
5
|
+
import type { AIConversation, AIMessage } from '../types';
|
|
6
|
+
/**
|
|
7
|
+
* Generate a unique session ID
|
|
8
|
+
*/
|
|
9
|
+
export declare function generateSessionId(): string;
|
|
10
|
+
/**
|
|
11
|
+
* Generate a unique message ID
|
|
12
|
+
*/
|
|
13
|
+
export declare function generateMessageId(): string;
|
|
14
|
+
/**
|
|
15
|
+
* Create a new empty conversation
|
|
16
|
+
*/
|
|
17
|
+
export declare function createConversation(sessionId?: string): AIConversation;
|
|
18
|
+
/**
|
|
19
|
+
* Create a user message
|
|
20
|
+
*/
|
|
21
|
+
export declare function createUserMessage(content: string): AIMessage;
|
|
22
|
+
/**
|
|
23
|
+
* Create an assistant message
|
|
24
|
+
*/
|
|
25
|
+
export declare function createAssistantMessage(content: string, metadata?: AIMessage['metadata']): AIMessage;
|
|
26
|
+
/**
|
|
27
|
+
* Create a system message
|
|
28
|
+
*/
|
|
29
|
+
export declare function createSystemMessage(content: string): AIMessage;
|
|
30
|
+
/**
|
|
31
|
+
* Add a message to a conversation (immutably)
|
|
32
|
+
*/
|
|
33
|
+
export declare function addMessageToConversation(conversation: AIConversation, message: AIMessage): AIConversation;
|
|
34
|
+
/**
|
|
35
|
+
* Update the data source for a conversation
|
|
36
|
+
*/
|
|
37
|
+
export declare function setConversationDataSource(conversation: AIConversation, dataSourceId: string | undefined): AIConversation;
|
|
38
|
+
/**
|
|
39
|
+
* Serialize a conversation to JSON string for storage
|
|
40
|
+
*/
|
|
41
|
+
export declare function serializeConversation(conversation: AIConversation): string;
|
|
42
|
+
/**
|
|
43
|
+
* Deserialize a conversation from JSON string
|
|
44
|
+
*/
|
|
45
|
+
export declare function deserializeConversation(json: string): AIConversation | null;
|
|
46
|
+
/**
|
|
47
|
+
* Get the messages formatted for the AI API
|
|
48
|
+
* Excludes system messages and metadata
|
|
49
|
+
*/
|
|
50
|
+
export declare function getMessagesForAPI(conversation: AIConversation): Array<{
|
|
51
|
+
role: 'user' | 'assistant';
|
|
52
|
+
content: string;
|
|
53
|
+
}>;
|
|
54
|
+
/**
|
|
55
|
+
* Trim conversation to last N messages to manage context window
|
|
56
|
+
*/
|
|
57
|
+
export declare function trimConversation(conversation: AIConversation, maxMessages: number): AIConversation;
|
|
58
|
+
/**
|
|
59
|
+
* Get conversation statistics
|
|
60
|
+
*/
|
|
61
|
+
export declare function getConversationStats(conversation: AIConversation): {
|
|
62
|
+
messageCount: number;
|
|
63
|
+
userMessageCount: number;
|
|
64
|
+
assistantMessageCount: number;
|
|
65
|
+
queriesExecuted: number;
|
|
66
|
+
successfulQueries: number;
|
|
67
|
+
failedQueries: number;
|
|
68
|
+
};
|
|
69
|
+
//# sourceMappingURL=session.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/ai/session.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAEzD;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,cAAc,CASrE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAO5D;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,MAAM,EACf,QAAQ,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,GAC/B,SAAS,CAQX;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAO9D;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,YAAY,EAAE,cAAc,EAC5B,OAAO,EAAE,SAAS,GACjB,cAAc,CAMhB;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CACvC,YAAY,EAAE,cAAc,EAC5B,YAAY,EAAE,MAAM,GAAG,SAAS,GAC/B,cAAc,CAMhB;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,YAAY,EAAE,cAAc,GAAG,MAAM,CAE1E;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CAkB3E;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,YAAY,EAAE,cAAc,GAC3B,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,CAOxD;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,YAAY,EAAE,cAAc,EAC5B,WAAW,EAAE,MAAM,GAClB,cAAc,CAUhB;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,YAAY,EAAE,cAAc,GAAG;IAClE,YAAY,EAAE,MAAM,CAAA;IACpB,gBAAgB,EAAE,MAAM,CAAA;IACxB,qBAAqB,EAAE,MAAM,CAAA;IAC7B,eAAe,EAAE,MAAM,CAAA;IACvB,iBAAiB,EAAE,MAAM,CAAA;IACzB,aAAa,EAAE,MAAM,CAAA;CACtB,CAaA"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generate a unique session ID
|
|
3
|
+
*/
|
|
4
|
+
export function generateSessionId() {
|
|
5
|
+
return `tp-ai-${Date.now()}-${Math.random().toString(36).slice(2, 11)}`;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Generate a unique message ID
|
|
9
|
+
*/
|
|
10
|
+
export function generateMessageId() {
|
|
11
|
+
return `msg-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Create a new empty conversation
|
|
15
|
+
*/
|
|
16
|
+
export function createConversation(sessionId) {
|
|
17
|
+
const now = Date.now();
|
|
18
|
+
return {
|
|
19
|
+
id: sessionId || generateSessionId(),
|
|
20
|
+
messages: [],
|
|
21
|
+
dataSourceId: undefined,
|
|
22
|
+
createdAt: now,
|
|
23
|
+
updatedAt: now,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Create a user message
|
|
28
|
+
*/
|
|
29
|
+
export function createUserMessage(content) {
|
|
30
|
+
return {
|
|
31
|
+
id: generateMessageId(),
|
|
32
|
+
role: 'user',
|
|
33
|
+
content,
|
|
34
|
+
timestamp: Date.now(),
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Create an assistant message
|
|
39
|
+
*/
|
|
40
|
+
export function createAssistantMessage(content, metadata) {
|
|
41
|
+
return {
|
|
42
|
+
id: generateMessageId(),
|
|
43
|
+
role: 'assistant',
|
|
44
|
+
content,
|
|
45
|
+
timestamp: Date.now(),
|
|
46
|
+
metadata,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Create a system message
|
|
51
|
+
*/
|
|
52
|
+
export function createSystemMessage(content) {
|
|
53
|
+
return {
|
|
54
|
+
id: generateMessageId(),
|
|
55
|
+
role: 'system',
|
|
56
|
+
content,
|
|
57
|
+
timestamp: Date.now(),
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Add a message to a conversation (immutably)
|
|
62
|
+
*/
|
|
63
|
+
export function addMessageToConversation(conversation, message) {
|
|
64
|
+
return {
|
|
65
|
+
...conversation,
|
|
66
|
+
messages: [...conversation.messages, message],
|
|
67
|
+
updatedAt: Date.now(),
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Update the data source for a conversation
|
|
72
|
+
*/
|
|
73
|
+
export function setConversationDataSource(conversation, dataSourceId) {
|
|
74
|
+
return {
|
|
75
|
+
...conversation,
|
|
76
|
+
dataSourceId,
|
|
77
|
+
updatedAt: Date.now(),
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Serialize a conversation to JSON string for storage
|
|
82
|
+
*/
|
|
83
|
+
export function serializeConversation(conversation) {
|
|
84
|
+
return JSON.stringify(conversation);
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Deserialize a conversation from JSON string
|
|
88
|
+
*/
|
|
89
|
+
export function deserializeConversation(json) {
|
|
90
|
+
try {
|
|
91
|
+
const parsed = JSON.parse(json);
|
|
92
|
+
// Basic validation
|
|
93
|
+
if (typeof parsed !== 'object'
|
|
94
|
+
|| !parsed.id
|
|
95
|
+
|| !Array.isArray(parsed.messages)) {
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
return parsed;
|
|
99
|
+
}
|
|
100
|
+
catch {
|
|
101
|
+
return null;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Get the messages formatted for the AI API
|
|
106
|
+
* Excludes system messages and metadata
|
|
107
|
+
*/
|
|
108
|
+
export function getMessagesForAPI(conversation) {
|
|
109
|
+
return conversation.messages
|
|
110
|
+
.filter(m => m.role !== 'system')
|
|
111
|
+
.map(m => ({
|
|
112
|
+
role: m.role,
|
|
113
|
+
content: m.content,
|
|
114
|
+
}));
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Trim conversation to last N messages to manage context window
|
|
118
|
+
*/
|
|
119
|
+
export function trimConversation(conversation, maxMessages) {
|
|
120
|
+
if (conversation.messages.length <= maxMessages) {
|
|
121
|
+
return conversation;
|
|
122
|
+
}
|
|
123
|
+
return {
|
|
124
|
+
...conversation,
|
|
125
|
+
messages: conversation.messages.slice(-maxMessages),
|
|
126
|
+
updatedAt: Date.now(),
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Get conversation statistics
|
|
131
|
+
*/
|
|
132
|
+
export function getConversationStats(conversation) {
|
|
133
|
+
const messages = conversation.messages;
|
|
134
|
+
const queriesExecuted = messages.filter(m => m.metadata?.query).length;
|
|
135
|
+
const failedQueries = messages.filter(m => m.metadata?.error).length;
|
|
136
|
+
return {
|
|
137
|
+
messageCount: messages.length,
|
|
138
|
+
userMessageCount: messages.filter(m => m.role === 'user').length,
|
|
139
|
+
assistantMessageCount: messages.filter(m => m.role === 'assistant').length,
|
|
140
|
+
queriesExecuted,
|
|
141
|
+
successfulQueries: queriesExecuted - failedQueries,
|
|
142
|
+
failedQueries,
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
//# sourceMappingURL=session.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,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
CHANGED
|
@@ -55,15 +55,41 @@ export declare function processChartData(data: Record<string, unknown>[], config
|
|
|
55
55
|
* Process data for pie/donut charts
|
|
56
56
|
*/
|
|
57
57
|
export declare function processChartDataForPie(data: Record<string, unknown>[], config: ChartConfig): ChartData;
|
|
58
|
-
/**
|
|
59
|
-
|
|
60
|
-
*/
|
|
61
|
-
export declare function processChartDataForScatter(data: Record<string, unknown>[], config: ChartConfig): Array<{
|
|
58
|
+
/** Point data for scatter/bubble charts */
|
|
59
|
+
export interface ScatterPoint {
|
|
62
60
|
x: number;
|
|
63
61
|
y: number;
|
|
64
62
|
z?: number;
|
|
65
63
|
label?: string;
|
|
66
|
-
}
|
|
64
|
+
}
|
|
65
|
+
/** Grouped scatter data with multiple series */
|
|
66
|
+
export interface ScatterSeriesData {
|
|
67
|
+
series: Array<{
|
|
68
|
+
name: string;
|
|
69
|
+
data: ScatterPoint[];
|
|
70
|
+
}>;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Process data for scatter/bubble charts
|
|
74
|
+
* Returns grouped series when seriesField is provided for color-coding
|
|
75
|
+
*/
|
|
76
|
+
export declare function processChartDataForScatter(data: Record<string, unknown>[], config: ChartConfig): ScatterSeriesData;
|
|
77
|
+
/** Heatmap series data format for ApexCharts */
|
|
78
|
+
export interface HeatmapSeriesData {
|
|
79
|
+
series: Array<{
|
|
80
|
+
name: string;
|
|
81
|
+
data: Array<{
|
|
82
|
+
x: string;
|
|
83
|
+
y: number;
|
|
84
|
+
}>;
|
|
85
|
+
}>;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Process data for heatmap charts
|
|
89
|
+
* ApexCharts heatmaps need: series[] where each series is a Y category
|
|
90
|
+
* containing data[] of {x: X category, y: value}
|
|
91
|
+
*/
|
|
92
|
+
export declare function processChartDataForHeatmap(data: Record<string, unknown>[], config: ChartConfig): HeatmapSeriesData;
|
|
67
93
|
/**
|
|
68
94
|
* Create a default chart config
|
|
69
95
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/chart/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EACV,gBAAgB,EAChB,WAAW,EACX,SAAS,EACT,cAAc,EAEd,SAAS,EACT,aAAa,EACb,SAAS,EACV,MAAM,UAAU,CAAA;AAEjB;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/chart/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EACV,gBAAgB,EAChB,WAAW,EACX,SAAS,EACT,cAAc,EAEd,SAAS,EACT,aAAa,EACb,SAAS,EACV,MAAM,UAAU,CAAA;AAEjB;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,aAAa,EA2FtC,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC;IAAE,KAAK,EAAE,gBAAgB,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAOhG,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,YAAY,UAWxB,CAAA;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EAC/B,KAAK,EAAE,MAAM,GACZ,SAAS,CAyCX;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAC9B,cAAc,EAAE,CAgDlB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAStD;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,SAAS,GAAG,aAAa,GAAG,SAAS,CAE3E;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAA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