legends-mcp 1.1.1 → 1.1.2
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/index.js +7 -5
- package/dist/index.js.map +1 -1
- package/dist/legends/prompt-builder.d.ts.map +1 -1
- package/dist/legends/prompt-builder.js +23 -0
- package/dist/legends/prompt-builder.js.map +1 -1
- package/dist/tools/get-legend-insight.d.ts +5 -1
- package/dist/tools/get-legend-insight.d.ts.map +1 -1
- package/dist/tools/get-legend-insight.js +26 -6
- package/dist/tools/get-legend-insight.js.map +1 -1
- package/dist/tools/list-legends.d.ts +1 -1
- package/dist/tools/list-legends.d.ts.map +1 -1
- package/dist/tools/list-legends.js +1 -1
- package/dist/tools/list-legends.js.map +1 -1
- package/package.json +1 -1
- package/dist/agents/guardrails.d.ts +0 -44
- package/dist/agents/guardrails.d.ts.map +0 -1
- package/dist/agents/guardrails.js +0 -144
- package/dist/agents/guardrails.js.map +0 -1
- package/dist/agents/misbehavior-prevention.d.ts +0 -33
- package/dist/agents/misbehavior-prevention.d.ts.map +0 -1
- package/dist/agents/misbehavior-prevention.js +0 -278
- package/dist/agents/misbehavior-prevention.js.map +0 -1
- package/dist/config.d.ts +0 -4
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js +0 -27
- package/dist/config.js.map +0 -1
- package/dist/insights/smart-injection.d.ts +0 -67
- package/dist/insights/smart-injection.d.ts.map +0 -1
- package/dist/insights/smart-injection.js +0 -257
- package/dist/insights/smart-injection.js.map +0 -1
- package/dist/legends/personality.d.ts +0 -24
- package/dist/legends/personality.d.ts.map +0 -1
- package/dist/legends/personality.js +0 -211
- package/dist/legends/personality.js.map +0 -1
|
@@ -1,278 +0,0 @@
|
|
|
1
|
-
// Misbehavior Prevention System
|
|
2
|
-
// Ensures legends stay in character and don't go rogue
|
|
3
|
-
/**
|
|
4
|
-
* MISBEHAVIOR CATEGORIES:
|
|
5
|
-
*
|
|
6
|
-
* 1. BREAKING CHARACTER
|
|
7
|
-
* - Saying "As an AI" or "I'm an AI"
|
|
8
|
-
* - Generic chatbot responses
|
|
9
|
-
* - Inconsistent personality
|
|
10
|
-
*
|
|
11
|
-
* 2. HARMFUL CONTENT
|
|
12
|
-
* - Financial advice (especially crypto)
|
|
13
|
-
* - Medical/legal advice
|
|
14
|
-
* - Harmful instructions
|
|
15
|
-
*
|
|
16
|
-
* 3. QUALITY ISSUES
|
|
17
|
-
* - Too long/rambling responses
|
|
18
|
-
* - Off-topic tangents
|
|
19
|
-
* - Repetitive content
|
|
20
|
-
* - Hallucinated quotes/facts
|
|
21
|
-
*
|
|
22
|
-
* 4. ANNOYING BEHAVIORS
|
|
23
|
-
* - Being preachy/condescending
|
|
24
|
-
* - Excessive disclaimers
|
|
25
|
-
* - Over-explaining
|
|
26
|
-
* - Unsolicited opinions
|
|
27
|
-
*/
|
|
28
|
-
// Character breaking patterns
|
|
29
|
-
const CHARACTER_BREAK_PATTERNS = [
|
|
30
|
-
/\bas an ai\b/i,
|
|
31
|
-
/\bi('m| am) an? (ai|artificial|language model|llm|chatbot)/i,
|
|
32
|
-
/\bi cannot (actually|really|truly)/i,
|
|
33
|
-
/\bi don't have (personal|real|actual) (opinions|feelings|experiences)/i,
|
|
34
|
-
/\bbased on my training/i,
|
|
35
|
-
/\bmy knowledge (cutoff|was trained)/i,
|
|
36
|
-
/\bi was (created|trained|developed) by/i,
|
|
37
|
-
/\bi'm (just|only) a (program|model|ai)/i,
|
|
38
|
-
/\baccording to my programming/i,
|
|
39
|
-
/\bi lack the ability to/i,
|
|
40
|
-
];
|
|
41
|
-
// Generic chatbot responses (avoid these)
|
|
42
|
-
const GENERIC_PATTERNS = [
|
|
43
|
-
/\bi'd be happy to help/i,
|
|
44
|
-
/\bthat's a great question/i,
|
|
45
|
-
/\bcertainly! (here|let me)/i,
|
|
46
|
-
/\babsolutely! (i|let)/i,
|
|
47
|
-
/\bi understand (you're|your)/i,
|
|
48
|
-
/\bthank you for (sharing|asking)/i,
|
|
49
|
-
/\bi appreciate (you|your)/i,
|
|
50
|
-
/\blet me think about that/i,
|
|
51
|
-
/\bthat's an interesting (question|point)/i,
|
|
52
|
-
];
|
|
53
|
-
// Harmful advice patterns
|
|
54
|
-
const HARMFUL_PATTERNS = [
|
|
55
|
-
// Financial advice
|
|
56
|
-
/\byou should (buy|sell|invest in)/i,
|
|
57
|
-
/\bi (recommend|suggest) (buying|selling|investing)/i,
|
|
58
|
-
/\bguaranteed (returns|profit|gains)/i,
|
|
59
|
-
/\bthis (will|is going to) (moon|10x|100x)/i,
|
|
60
|
-
/\bprice (will|is going to) (hit|reach) \$?\d/i,
|
|
61
|
-
/\bnot financial advice.{0,50}but (you should|i recommend)/i, // Fake NFA
|
|
62
|
-
// Medical/legal
|
|
63
|
-
/\byou should (take|stop taking) (medication|medicine)/i,
|
|
64
|
-
/\bi (diagnose|recommend) (treatment|therapy)/i,
|
|
65
|
-
/\bthis (is|isn't) legal advice but/i,
|
|
66
|
-
];
|
|
67
|
-
// Quality issue patterns
|
|
68
|
-
const QUALITY_PATTERNS = {
|
|
69
|
-
tooLong: 2000, // Max characters before warning
|
|
70
|
-
tooShort: 20, // Min characters
|
|
71
|
-
repetitionThreshold: 0.3, // Max ratio of repeated phrases
|
|
72
|
-
};
|
|
73
|
-
// Annoying behavior patterns
|
|
74
|
-
const ANNOYING_PATTERNS = [
|
|
75
|
-
/\blet me (explain|tell you) (something|a few things)/i,
|
|
76
|
-
/\byou need to understand/i,
|
|
77
|
-
/\bfirst (of all|off), let me/i,
|
|
78
|
-
/\bbefore (i|we) (get|go) into/i,
|
|
79
|
-
/\bi want to make (sure|certain)/i,
|
|
80
|
-
/\b(to be|being) (clear|honest|frank)/i, // Only bad in excess
|
|
81
|
-
];
|
|
82
|
-
/**
|
|
83
|
-
* Check response for misbehavior
|
|
84
|
-
*/
|
|
85
|
-
export function checkMisbehavior(response, legend) {
|
|
86
|
-
const issues = [];
|
|
87
|
-
const suggestions = [];
|
|
88
|
-
// Check character breaking
|
|
89
|
-
for (const pattern of CHARACTER_BREAK_PATTERNS) {
|
|
90
|
-
const match = response.match(pattern);
|
|
91
|
-
if (match) {
|
|
92
|
-
issues.push({
|
|
93
|
-
type: 'character_break',
|
|
94
|
-
message: `Legend broke character with: "${match[0]}"`,
|
|
95
|
-
severity: 'high',
|
|
96
|
-
matched: match[0],
|
|
97
|
-
});
|
|
98
|
-
suggestions.push(`Remove "${match[0]}" - legends never acknowledge being AI`);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
// Check generic responses
|
|
102
|
-
let genericCount = 0;
|
|
103
|
-
for (const pattern of GENERIC_PATTERNS) {
|
|
104
|
-
if (pattern.test(response)) {
|
|
105
|
-
genericCount++;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
if (genericCount >= 2) {
|
|
109
|
-
issues.push({
|
|
110
|
-
type: 'generic',
|
|
111
|
-
message: `Response uses ${genericCount} generic chatbot phrases`,
|
|
112
|
-
severity: 'medium',
|
|
113
|
-
});
|
|
114
|
-
suggestions.push('Use more characteristic vocabulary from the legend');
|
|
115
|
-
}
|
|
116
|
-
// Check harmful content
|
|
117
|
-
for (const pattern of HARMFUL_PATTERNS) {
|
|
118
|
-
const match = response.match(pattern);
|
|
119
|
-
if (match) {
|
|
120
|
-
issues.push({
|
|
121
|
-
type: 'harmful',
|
|
122
|
-
message: `Potentially harmful content detected: "${match[0]}"`,
|
|
123
|
-
severity: 'critical',
|
|
124
|
-
matched: match[0],
|
|
125
|
-
});
|
|
126
|
-
suggestions.push('Rewrite to avoid financial/medical/legal advice');
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
// Check quality issues
|
|
130
|
-
if (response.length > QUALITY_PATTERNS.tooLong) {
|
|
131
|
-
issues.push({
|
|
132
|
-
type: 'quality',
|
|
133
|
-
message: `Response too long (${response.length} chars)`,
|
|
134
|
-
severity: 'low',
|
|
135
|
-
});
|
|
136
|
-
suggestions.push('Consider a more concise response');
|
|
137
|
-
}
|
|
138
|
-
if (response.length < QUALITY_PATTERNS.tooShort) {
|
|
139
|
-
issues.push({
|
|
140
|
-
type: 'quality',
|
|
141
|
-
message: `Response too short (${response.length} chars)`,
|
|
142
|
-
severity: 'low',
|
|
143
|
-
});
|
|
144
|
-
suggestions.push('Provide more substantive content');
|
|
145
|
-
}
|
|
146
|
-
// Check for repetition
|
|
147
|
-
const repetitionScore = calculateRepetition(response);
|
|
148
|
-
if (repetitionScore > QUALITY_PATTERNS.repetitionThreshold) {
|
|
149
|
-
issues.push({
|
|
150
|
-
type: 'quality',
|
|
151
|
-
message: `High repetition detected (${(repetitionScore * 100).toFixed(0)}%)`,
|
|
152
|
-
severity: 'medium',
|
|
153
|
-
});
|
|
154
|
-
suggestions.push('Vary the language and structure');
|
|
155
|
-
}
|
|
156
|
-
// Check annoying patterns (only flag if multiple)
|
|
157
|
-
let annoyingCount = 0;
|
|
158
|
-
for (const pattern of ANNOYING_PATTERNS) {
|
|
159
|
-
if (pattern.test(response)) {
|
|
160
|
-
annoyingCount++;
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
if (annoyingCount >= 3) {
|
|
164
|
-
issues.push({
|
|
165
|
-
type: 'annoying',
|
|
166
|
-
message: `Response may come across as preachy (${annoyingCount} warning phrases)`,
|
|
167
|
-
severity: 'low',
|
|
168
|
-
});
|
|
169
|
-
suggestions.push('Be more direct, less preamble');
|
|
170
|
-
}
|
|
171
|
-
// Check legend-specific never_say
|
|
172
|
-
if (legend.never_say) {
|
|
173
|
-
for (const phrase of legend.never_say) {
|
|
174
|
-
const cleanPhrase = phrase.replace(/['"]/g, '').toLowerCase();
|
|
175
|
-
if (response.toLowerCase().includes(cleanPhrase)) {
|
|
176
|
-
issues.push({
|
|
177
|
-
type: 'character_break',
|
|
178
|
-
message: `Legend said forbidden phrase: "${phrase}"`,
|
|
179
|
-
severity: 'high',
|
|
180
|
-
matched: phrase,
|
|
181
|
-
});
|
|
182
|
-
suggestions.push(`Remove: "${phrase}" - this legend would never say this`);
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
// Calculate overall severity
|
|
187
|
-
const severity = calculateOverallSeverity(issues);
|
|
188
|
-
return {
|
|
189
|
-
passed: issues.length === 0 || severity === 'low',
|
|
190
|
-
issues,
|
|
191
|
-
severity,
|
|
192
|
-
suggestions,
|
|
193
|
-
};
|
|
194
|
-
}
|
|
195
|
-
/**
|
|
196
|
-
* Calculate repetition score (0-1)
|
|
197
|
-
*/
|
|
198
|
-
function calculateRepetition(text) {
|
|
199
|
-
const sentences = text.split(/[.!?]+/).filter(s => s.trim().length > 10);
|
|
200
|
-
if (sentences.length < 2)
|
|
201
|
-
return 0;
|
|
202
|
-
let repetitions = 0;
|
|
203
|
-
const seen = new Set();
|
|
204
|
-
for (const sentence of sentences) {
|
|
205
|
-
const normalized = sentence.toLowerCase().trim().slice(0, 50);
|
|
206
|
-
if (seen.has(normalized)) {
|
|
207
|
-
repetitions++;
|
|
208
|
-
}
|
|
209
|
-
seen.add(normalized);
|
|
210
|
-
}
|
|
211
|
-
return repetitions / sentences.length;
|
|
212
|
-
}
|
|
213
|
-
/**
|
|
214
|
-
* Calculate overall severity from issues
|
|
215
|
-
*/
|
|
216
|
-
function calculateOverallSeverity(issues) {
|
|
217
|
-
if (issues.some(i => i.severity === 'critical'))
|
|
218
|
-
return 'critical';
|
|
219
|
-
if (issues.some(i => i.severity === 'high'))
|
|
220
|
-
return 'high';
|
|
221
|
-
if (issues.filter(i => i.severity === 'medium').length >= 2)
|
|
222
|
-
return 'high';
|
|
223
|
-
if (issues.some(i => i.severity === 'medium'))
|
|
224
|
-
return 'medium';
|
|
225
|
-
return 'low';
|
|
226
|
-
}
|
|
227
|
-
/**
|
|
228
|
-
* Pre-check user input for potential issues
|
|
229
|
-
*/
|
|
230
|
-
export function preCheckUserInput(message, legend) {
|
|
231
|
-
const warnings = [];
|
|
232
|
-
// Check for financial advice requests
|
|
233
|
-
const financialPatterns = [
|
|
234
|
-
/should i (buy|sell|invest)/i,
|
|
235
|
-
/is .+ a good investment/i,
|
|
236
|
-
/price prediction/i,
|
|
237
|
-
/will .+ (moon|pump|dump)/i,
|
|
238
|
-
/what (token|coin|stock) should/i,
|
|
239
|
-
];
|
|
240
|
-
for (const pattern of financialPatterns) {
|
|
241
|
-
if (pattern.test(message)) {
|
|
242
|
-
warnings.push('⚠️ This legend cannot provide financial advice. Response will focus on principles and frameworks instead.');
|
|
243
|
-
break;
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
// Check for medical/legal
|
|
247
|
-
if (/\b(diagnose|prescribe|legal advice)\b/i.test(message)) {
|
|
248
|
-
warnings.push('⚠️ This legend cannot provide medical or legal advice.');
|
|
249
|
-
}
|
|
250
|
-
return {
|
|
251
|
-
needsWarning: warnings.length > 0,
|
|
252
|
-
warnings,
|
|
253
|
-
};
|
|
254
|
-
}
|
|
255
|
-
/**
|
|
256
|
-
* Sanitize response to remove problematic content
|
|
257
|
-
*/
|
|
258
|
-
export function sanitizeResponse(response, legend) {
|
|
259
|
-
let sanitized = response;
|
|
260
|
-
// Remove character-breaking phrases
|
|
261
|
-
for (const pattern of CHARACTER_BREAK_PATTERNS) {
|
|
262
|
-
sanitized = sanitized.replace(pattern, '');
|
|
263
|
-
}
|
|
264
|
-
// Clean up any resulting awkward spacing
|
|
265
|
-
sanitized = sanitized
|
|
266
|
-
.replace(/\s+/g, ' ')
|
|
267
|
-
.replace(/\s+([.,!?])/g, '$1')
|
|
268
|
-
.trim();
|
|
269
|
-
return sanitized;
|
|
270
|
-
}
|
|
271
|
-
/**
|
|
272
|
-
* Generate quality improvement suggestions
|
|
273
|
-
*/
|
|
274
|
-
export function getSuggestions(response, legend) {
|
|
275
|
-
const check = checkMisbehavior(response, legend);
|
|
276
|
-
return check.suggestions;
|
|
277
|
-
}
|
|
278
|
-
//# sourceMappingURL=misbehavior-prevention.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"misbehavior-prev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/config.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export declare const LEGAL_DISCLAIMER = "\n---\n**IMPORTANT DISCLAIMER**\n\nThis is an AI persona created for **educational and entertainment purposes only**.\n\n- NOT affiliated with, endorsed by, or representative of the real individual\n- NOT financial, legal, or professional advice\n- NOT the actual person - this is an AI simulation\n- Based on publicly available information, speeches, and writings\n- For learning frameworks and thinking patterns\n- Always do your own research (DYOR)\n\n*The views expressed are AI-generated interpretations, not statements from the real person.*\n";
|
|
2
|
-
export declare const SHORT_DISCLAIMER = "*AI persona for education only. Not the real person. Not advice. DYOR.*";
|
|
3
|
-
export declare function log(...args: unknown[]): void;
|
|
4
|
-
//# sourceMappingURL=config.d.ts.map
|
package/dist/config.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,gBAAgB,0iBAc5B,CAAC;AAGF,eAAO,MAAM,gBAAgB,4EAA4E,CAAC;AAG1G,wBAAgB,GAAG,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAI5C"}
|
package/dist/config.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
// Configuration for Legends MCP Server
|
|
2
|
-
// No API key required - Claude does the roleplay!
|
|
3
|
-
// Legal disclaimer that MUST appear with every response
|
|
4
|
-
export const LEGAL_DISCLAIMER = `
|
|
5
|
-
---
|
|
6
|
-
**IMPORTANT DISCLAIMER**
|
|
7
|
-
|
|
8
|
-
This is an AI persona created for **educational and entertainment purposes only**.
|
|
9
|
-
|
|
10
|
-
- NOT affiliated with, endorsed by, or representative of the real individual
|
|
11
|
-
- NOT financial, legal, or professional advice
|
|
12
|
-
- NOT the actual person - this is an AI simulation
|
|
13
|
-
- Based on publicly available information, speeches, and writings
|
|
14
|
-
- For learning frameworks and thinking patterns
|
|
15
|
-
- Always do your own research (DYOR)
|
|
16
|
-
|
|
17
|
-
*The views expressed are AI-generated interpretations, not statements from the real person.*
|
|
18
|
-
`;
|
|
19
|
-
// Short disclaimer for inline use
|
|
20
|
-
export const SHORT_DISCLAIMER = `*AI persona for education only. Not the real person. Not advice. DYOR.*`;
|
|
21
|
-
// Debug logging
|
|
22
|
-
export function log(...args) {
|
|
23
|
-
if (process.env.LEGENDS_MCP_DEBUG === 'true') {
|
|
24
|
-
console.error('[legends-mcp]', ...args);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=config.js.map
|
package/dist/config.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kDAAkD;AAElD,wDAAwD;AACxD,MAAM,CAAC,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;CAc/B,CAAC;AAEF,kCAAkC;AAClC,MAAM,CAAC,MAAM,gBAAgB,GAAG,yEAAyE,CAAC;AAE1G,gBAAgB;AAChB,MAAM,UAAU,GAAG,CAAC,GAAG,IAAe;IACpC,IAAI,OAAO,CAAC,GAAG,CAAC,iBAAiB,KAAK,MAAM,EAAE,CAAC;QAC7C,OAAO,CAAC,KAAK,CAAC,eAAe,EAAE,GAAG,IAAI,CAAC,CAAC;IAC1C,CAAC;AACH,CAAC"}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* INSIGHT INJECTION STRATEGY
|
|
3
|
-
*
|
|
4
|
-
* WHERE to inject insights:
|
|
5
|
-
* 1. Topic-triggered: User discusses topic → relevant legend speaks
|
|
6
|
-
* 2. Task-completion: After finishing work → celebratory wisdom
|
|
7
|
-
* 3. Problem-solving: User stuck → mentor perspective
|
|
8
|
-
* 4. Decision points: User choosing options → framework suggestion
|
|
9
|
-
* 5. Learning moments: User asks "how" → pattern/principle injection
|
|
10
|
-
*
|
|
11
|
-
* HOW MANY:
|
|
12
|
-
* - Max 1 insight per conversation turn
|
|
13
|
-
* - Max 3 insights per session (avoid spam)
|
|
14
|
-
* - Cooldown: 5 messages minimum between insights
|
|
15
|
-
* - User can disable with LEGENDS_DISABLE_INSIGHTS=true
|
|
16
|
-
*/
|
|
17
|
-
export declare const TOPIC_LEGEND_MAP: Record<string, string[]>;
|
|
18
|
-
export type InsightContext = 'topic_match' | 'task_complete' | 'problem_solving' | 'decision_point' | 'learning_moment' | 'random_wisdom';
|
|
19
|
-
export interface InsightInjectionRule {
|
|
20
|
-
context: InsightContext;
|
|
21
|
-
trigger: RegExp | string[];
|
|
22
|
-
legend_ids: string[];
|
|
23
|
-
priority: number;
|
|
24
|
-
cooldown_messages: number;
|
|
25
|
-
}
|
|
26
|
-
export declare const INJECTION_RULES: InsightInjectionRule[];
|
|
27
|
-
interface SessionState {
|
|
28
|
-
insightCount: number;
|
|
29
|
-
messagesSinceLastInsight: number;
|
|
30
|
-
lastInsightLegend: string | null;
|
|
31
|
-
disabledUntil: number;
|
|
32
|
-
}
|
|
33
|
-
export declare const INSIGHT_CONFIG: {
|
|
34
|
-
maxInsightsPerSession: number;
|
|
35
|
-
minMessagesBetweenInsights: number;
|
|
36
|
-
globalCooldownMs: number;
|
|
37
|
-
enabled: boolean;
|
|
38
|
-
};
|
|
39
|
-
/**
|
|
40
|
-
* Detect topics in user message and find relevant legends
|
|
41
|
-
*/
|
|
42
|
-
export declare function detectRelevantLegends(message: string): string[];
|
|
43
|
-
/**
|
|
44
|
-
* Check if insight should be injected based on context and rules
|
|
45
|
-
*/
|
|
46
|
-
export declare function shouldInjectInsight(sessionId: string, message: string, context?: InsightContext): {
|
|
47
|
-
should: boolean;
|
|
48
|
-
legendId?: string;
|
|
49
|
-
reason?: string;
|
|
50
|
-
};
|
|
51
|
-
/**
|
|
52
|
-
* Get a recommended insight for the current context
|
|
53
|
-
*/
|
|
54
|
-
export declare function getRecommendedInsight(sessionId: string, message: string): {
|
|
55
|
-
insight: string;
|
|
56
|
-
legendId: string;
|
|
57
|
-
} | null;
|
|
58
|
-
/**
|
|
59
|
-
* Reset session state (for testing or new conversations)
|
|
60
|
-
*/
|
|
61
|
-
export declare function resetSession(sessionId: string): void;
|
|
62
|
-
/**
|
|
63
|
-
* Get session stats (for debugging)
|
|
64
|
-
*/
|
|
65
|
-
export declare function getSessionStats(sessionId: string): SessionState;
|
|
66
|
-
export {};
|
|
67
|
-
//# sourceMappingURL=smart-injection.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"smart-injection.d.ts","sourceRoot":"","sources":["../../src/insights/smart-injection.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;GAeG;AAGH,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAuErD,CAAC;AAGF,MAAM,MAAM,cAAc,GACtB,aAAa,GACb,eAAe,GACf,iBAAiB,GACjB,gBAAgB,GAChB,iBAAiB,GACjB,eAAe,CAAC;AAGpB,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,cAAc,CAAC;IACxB,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC3B,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAGD,eAAO,MAAM,eAAe,EAAE,oBAAoB,EAkDjD,CAAC;AAGF,UAAU,YAAY;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,wBAAwB,EAAE,MAAM,CAAC;IACjC,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,aAAa,EAAE,MAAM,CAAC;CACvB;AAYD,eAAO,MAAM,cAAc;;;;;CAK1B,CAAC;AAEF;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAW/D;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,cAAc,GACvB;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAwEzD;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,GACd;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAiB9C;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAEpD;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,YAAY,CAE/D"}
|
|
@@ -1,257 +0,0 @@
|
|
|
1
|
-
// Smart Insight Injection System
|
|
2
|
-
// Knows WHEN, WHERE, and HOW to recommend legend insights
|
|
3
|
-
import { getLegendById } from '../legends/loader.js';
|
|
4
|
-
/**
|
|
5
|
-
* INSIGHT INJECTION STRATEGY
|
|
6
|
-
*
|
|
7
|
-
* WHERE to inject insights:
|
|
8
|
-
* 1. Topic-triggered: User discusses topic → relevant legend speaks
|
|
9
|
-
* 2. Task-completion: After finishing work → celebratory wisdom
|
|
10
|
-
* 3. Problem-solving: User stuck → mentor perspective
|
|
11
|
-
* 4. Decision points: User choosing options → framework suggestion
|
|
12
|
-
* 5. Learning moments: User asks "how" → pattern/principle injection
|
|
13
|
-
*
|
|
14
|
-
* HOW MANY:
|
|
15
|
-
* - Max 1 insight per conversation turn
|
|
16
|
-
* - Max 3 insights per session (avoid spam)
|
|
17
|
-
* - Cooldown: 5 messages minimum between insights
|
|
18
|
-
* - User can disable with LEGENDS_DISABLE_INSIGHTS=true
|
|
19
|
-
*/
|
|
20
|
-
// Topic → Legend mapping for smart recommendations
|
|
21
|
-
export const TOPIC_LEGEND_MAP = {
|
|
22
|
-
// Tech & Engineering
|
|
23
|
-
'first principles': ['elon-musk'],
|
|
24
|
-
'physics': ['elon-musk'],
|
|
25
|
-
'manufacturing': ['elon-musk'],
|
|
26
|
-
'rockets': ['elon-musk'],
|
|
27
|
-
'electric vehicles': ['elon-musk'],
|
|
28
|
-
'scaling': ['elon-musk', 'jeff-bezos'],
|
|
29
|
-
// Product & Design
|
|
30
|
-
'design': ['steve-jobs'],
|
|
31
|
-
'product': ['steve-jobs', 'paul-graham'],
|
|
32
|
-
'simplicity': ['steve-jobs'],
|
|
33
|
-
'user experience': ['steve-jobs', 'mert-mumtaz'],
|
|
34
|
-
'ux': ['steve-jobs', 'mert-mumtaz'],
|
|
35
|
-
// Investing & Finance
|
|
36
|
-
'investing': ['warren-buffett', 'charlie-munger'],
|
|
37
|
-
'value': ['warren-buffett'],
|
|
38
|
-
'moat': ['warren-buffett'],
|
|
39
|
-
'compounding': ['warren-buffett', 'naval-ravikant'],
|
|
40
|
-
'mental models': ['charlie-munger'],
|
|
41
|
-
// Startups
|
|
42
|
-
'startup': ['paul-graham', 'sam-altman'],
|
|
43
|
-
'yc': ['paul-graham', 'sam-altman', 'michael-heinrich'],
|
|
44
|
-
'y combinator': ['paul-graham', 'sam-altman', 'michael-heinrich'],
|
|
45
|
-
'fundraising': ['paul-graham', 'marc-andreessen'],
|
|
46
|
-
'mvp': ['paul-graham'],
|
|
47
|
-
'launch': ['paul-graham'],
|
|
48
|
-
// Crypto & Web3
|
|
49
|
-
'crypto': ['cz-binance', 'anatoly-yakovenko'],
|
|
50
|
-
'blockchain': ['cz-binance', 'anatoly-yakovenko'],
|
|
51
|
-
'solana': ['anatoly-yakovenko', 'mert-mumtaz'],
|
|
52
|
-
'exchange': ['cz-binance'],
|
|
53
|
-
'binance': ['cz-binance'],
|
|
54
|
-
'rpc': ['mert-mumtaz'],
|
|
55
|
-
'infrastructure': ['mert-mumtaz', 'michael-heinrich'],
|
|
56
|
-
'decentralization': ['anatoly-yakovenko', 'michael-heinrich'],
|
|
57
|
-
'ai infrastructure': ['michael-heinrich'],
|
|
58
|
-
'0g': ['michael-heinrich'],
|
|
59
|
-
// Business & Strategy
|
|
60
|
-
'network effects': ['reid-hoffman'],
|
|
61
|
-
'blitzscaling': ['reid-hoffman'],
|
|
62
|
-
'marketplace': ['reid-hoffman'],
|
|
63
|
-
'monopoly': ['peter-thiel'],
|
|
64
|
-
'competition': ['peter-thiel'],
|
|
65
|
-
'contrarian': ['peter-thiel'],
|
|
66
|
-
'zero to one': ['peter-thiel'],
|
|
67
|
-
// AI & Technology
|
|
68
|
-
'ai': ['sam-altman', 'jensen-huang', 'michael-heinrich'],
|
|
69
|
-
'agi': ['sam-altman'],
|
|
70
|
-
'gpu': ['jensen-huang'],
|
|
71
|
-
'nvidia': ['jensen-huang'],
|
|
72
|
-
'cuda': ['jensen-huang'],
|
|
73
|
-
// Philosophy & Wealth
|
|
74
|
-
'wealth': ['naval-ravikant'],
|
|
75
|
-
'leverage': ['naval-ravikant'],
|
|
76
|
-
'specific knowledge': ['naval-ravikant'],
|
|
77
|
-
'happiness': ['naval-ravikant'],
|
|
78
|
-
// Developer Experience
|
|
79
|
-
'developer experience': ['mert-mumtaz'],
|
|
80
|
-
'dx': ['mert-mumtaz'],
|
|
81
|
-
'documentation': ['mert-mumtaz'],
|
|
82
|
-
'docs': ['mert-mumtaz'],
|
|
83
|
-
'api': ['mert-mumtaz'],
|
|
84
|
-
};
|
|
85
|
-
// Default injection rules
|
|
86
|
-
export const INJECTION_RULES = [
|
|
87
|
-
// High priority - direct topic matches
|
|
88
|
-
{
|
|
89
|
-
context: 'topic_match',
|
|
90
|
-
trigger: /first\s*principles?/i,
|
|
91
|
-
legend_ids: ['elon-musk'],
|
|
92
|
-
priority: 9,
|
|
93
|
-
cooldown_messages: 3,
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
context: 'topic_match',
|
|
97
|
-
trigger: /value\s*invest/i,
|
|
98
|
-
legend_ids: ['warren-buffett'],
|
|
99
|
-
priority: 9,
|
|
100
|
-
cooldown_messages: 3,
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
context: 'topic_match',
|
|
104
|
-
trigger: /solana|sol\s+(network|blockchain)/i,
|
|
105
|
-
legend_ids: ['anatoly-yakovenko', 'mert-mumtaz'],
|
|
106
|
-
priority: 8,
|
|
107
|
-
cooldown_messages: 3,
|
|
108
|
-
},
|
|
109
|
-
// Medium priority - problem solving
|
|
110
|
-
{
|
|
111
|
-
context: 'problem_solving',
|
|
112
|
-
trigger: ['stuck', 'help', "can't figure out", 'struggling'],
|
|
113
|
-
legend_ids: ['paul-graham', 'charlie-munger'],
|
|
114
|
-
priority: 6,
|
|
115
|
-
cooldown_messages: 5,
|
|
116
|
-
},
|
|
117
|
-
// Decision points
|
|
118
|
-
{
|
|
119
|
-
context: 'decision_point',
|
|
120
|
-
trigger: ['should I', 'which option', 'better approach', 'trade-off'],
|
|
121
|
-
legend_ids: ['charlie-munger', 'jeff-bezos'],
|
|
122
|
-
priority: 7,
|
|
123
|
-
cooldown_messages: 5,
|
|
124
|
-
},
|
|
125
|
-
// Task completion celebration
|
|
126
|
-
{
|
|
127
|
-
context: 'task_complete',
|
|
128
|
-
trigger: ['done', 'finished', 'completed', 'shipped'],
|
|
129
|
-
legend_ids: ['steve-jobs', 'paul-graham'],
|
|
130
|
-
priority: 4,
|
|
131
|
-
cooldown_messages: 10,
|
|
132
|
-
},
|
|
133
|
-
];
|
|
134
|
-
const sessionStates = new Map();
|
|
135
|
-
const DEFAULT_SESSION_STATE = {
|
|
136
|
-
insightCount: 0,
|
|
137
|
-
messagesSinceLastInsight: 0,
|
|
138
|
-
lastInsightLegend: null,
|
|
139
|
-
disabledUntil: 0,
|
|
140
|
-
};
|
|
141
|
-
// Configuration
|
|
142
|
-
export const INSIGHT_CONFIG = {
|
|
143
|
-
maxInsightsPerSession: 3,
|
|
144
|
-
minMessagesBetweenInsights: 5,
|
|
145
|
-
globalCooldownMs: 60000, // 1 minute minimum between any insights
|
|
146
|
-
enabled: process.env.LEGENDS_DISABLE_INSIGHTS !== 'true',
|
|
147
|
-
};
|
|
148
|
-
/**
|
|
149
|
-
* Detect topics in user message and find relevant legends
|
|
150
|
-
*/
|
|
151
|
-
export function detectRelevantLegends(message) {
|
|
152
|
-
const messageLower = message.toLowerCase();
|
|
153
|
-
const relevantLegends = new Set();
|
|
154
|
-
for (const [topic, legends] of Object.entries(TOPIC_LEGEND_MAP)) {
|
|
155
|
-
if (messageLower.includes(topic.toLowerCase())) {
|
|
156
|
-
legends.forEach(l => relevantLegends.add(l));
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
return Array.from(relevantLegends);
|
|
160
|
-
}
|
|
161
|
-
/**
|
|
162
|
-
* Check if insight should be injected based on context and rules
|
|
163
|
-
*/
|
|
164
|
-
export function shouldInjectInsight(sessionId, message, context) {
|
|
165
|
-
// Check if disabled
|
|
166
|
-
if (!INSIGHT_CONFIG.enabled) {
|
|
167
|
-
return { should: false, reason: 'Insights disabled by config' };
|
|
168
|
-
}
|
|
169
|
-
// Get or create session state
|
|
170
|
-
let state = sessionStates.get(sessionId);
|
|
171
|
-
if (!state) {
|
|
172
|
-
state = { ...DEFAULT_SESSION_STATE };
|
|
173
|
-
sessionStates.set(sessionId, state);
|
|
174
|
-
}
|
|
175
|
-
// Check session limits
|
|
176
|
-
if (state.insightCount >= INSIGHT_CONFIG.maxInsightsPerSession) {
|
|
177
|
-
return { should: false, reason: 'Max insights per session reached' };
|
|
178
|
-
}
|
|
179
|
-
// Check message cooldown
|
|
180
|
-
if (state.messagesSinceLastInsight < INSIGHT_CONFIG.minMessagesBetweenInsights) {
|
|
181
|
-
state.messagesSinceLastInsight++;
|
|
182
|
-
return { should: false, reason: 'Cooldown period active' };
|
|
183
|
-
}
|
|
184
|
-
// Check global cooldown
|
|
185
|
-
if (Date.now() < state.disabledUntil) {
|
|
186
|
-
return { should: false, reason: 'Global cooldown active' };
|
|
187
|
-
}
|
|
188
|
-
// Find matching rules
|
|
189
|
-
const messageLower = message.toLowerCase();
|
|
190
|
-
let bestMatch = null;
|
|
191
|
-
for (const rule of INJECTION_RULES) {
|
|
192
|
-
if (context && rule.context !== context)
|
|
193
|
-
continue;
|
|
194
|
-
let matches = false;
|
|
195
|
-
if (rule.trigger instanceof RegExp) {
|
|
196
|
-
matches = rule.trigger.test(message);
|
|
197
|
-
}
|
|
198
|
-
else {
|
|
199
|
-
matches = rule.trigger.some(t => messageLower.includes(t.toLowerCase()));
|
|
200
|
-
}
|
|
201
|
-
if (matches) {
|
|
202
|
-
// Pick a legend that isn't the last one used
|
|
203
|
-
const availableLegends = rule.legend_ids.filter(l => l !== state.lastInsightLegend);
|
|
204
|
-
const legendId = availableLegends[0] || rule.legend_ids[0];
|
|
205
|
-
if (!bestMatch || rule.priority > bestMatch.rule.priority) {
|
|
206
|
-
bestMatch = { rule, legendId };
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
if (bestMatch) {
|
|
211
|
-
// Update state
|
|
212
|
-
state.insightCount++;
|
|
213
|
-
state.messagesSinceLastInsight = 0;
|
|
214
|
-
state.lastInsightLegend = bestMatch.legendId;
|
|
215
|
-
state.disabledUntil = Date.now() + INSIGHT_CONFIG.globalCooldownMs;
|
|
216
|
-
return {
|
|
217
|
-
should: true,
|
|
218
|
-
legendId: bestMatch.legendId,
|
|
219
|
-
reason: `Matched rule: ${bestMatch.rule.context}`,
|
|
220
|
-
};
|
|
221
|
-
}
|
|
222
|
-
// Increment message counter even if no insight
|
|
223
|
-
state.messagesSinceLastInsight++;
|
|
224
|
-
return { should: false, reason: 'No matching rules' };
|
|
225
|
-
}
|
|
226
|
-
/**
|
|
227
|
-
* Get a recommended insight for the current context
|
|
228
|
-
*/
|
|
229
|
-
export function getRecommendedInsight(sessionId, message) {
|
|
230
|
-
const check = shouldInjectInsight(sessionId, message);
|
|
231
|
-
if (!check.should || !check.legendId) {
|
|
232
|
-
return null;
|
|
233
|
-
}
|
|
234
|
-
const legend = getLegendById(check.legendId);
|
|
235
|
-
if (!legend)
|
|
236
|
-
return null;
|
|
237
|
-
// Import the insight generator
|
|
238
|
-
// Note: This would be imported from get-legend-insight.ts
|
|
239
|
-
// For now, return a simple format
|
|
240
|
-
return {
|
|
241
|
-
insight: `💡 **${legend.name}** might have wisdom on this topic. Try: \`get_legend_insight legend_id="${check.legendId}"\``,
|
|
242
|
-
legendId: check.legendId,
|
|
243
|
-
};
|
|
244
|
-
}
|
|
245
|
-
/**
|
|
246
|
-
* Reset session state (for testing or new conversations)
|
|
247
|
-
*/
|
|
248
|
-
export function resetSession(sessionId) {
|
|
249
|
-
sessionStates.delete(sessionId);
|
|
250
|
-
}
|
|
251
|
-
/**
|
|
252
|
-
* Get session stats (for debugging)
|
|
253
|
-
*/
|
|
254
|
-
export function getSessionStats(sessionId) {
|
|
255
|
-
return sessionStates.get(sessionId) || DEFAULT_SESSION_STATE;
|
|
256
|
-
}
|
|
257
|
-
//# sourceMappingURL=smart-injection.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"smart-injection.js","sourceRoot":"","sources":["../../src/insights/smart-injection.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAG1D,OAAO,EAAiB,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAEpE;;;;;;;;;;;;;;;GAeG;AAEH,mDAAmD;AACnD,MAAM,CAAC,MAAM,gBAAgB,GAA6B;IACxD,qBAAqB;IACrB,kBAAkB,EAAE,CAAC,WAAW,CAAC;IACjC,SAAS,EAAE,CAAC,WAAW,CAAC;IACxB,eAAe,EAAE,CAAC,WAAW,CAAC;IAC9B,SAAS,EAAE,CAAC,WAAW,CAAC;IACxB,mBAAmB,EAAE,CAAC,WAAW,CAAC;IAClC,SAAS,EAAE,CAAC,WAAW,EAAE,YAAY,CAAC;IAEtC,mBAAmB;IACnB,QAAQ,EAAE,CAAC,YAAY,CAAC;IACxB,SAAS,EAAE,CAAC,YAAY,EAAE,aAAa,CAAC;IACxC,Y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