legends-mcp 1.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.
- package/README.md +173 -0
- package/dist/agents/guardrails.d.ts +44 -0
- package/dist/agents/guardrails.d.ts.map +1 -0
- package/dist/agents/guardrails.js +144 -0
- package/dist/agents/guardrails.js.map +1 -0
- package/dist/agents/misbehavior-prevention.d.ts +33 -0
- package/dist/agents/misbehavior-prevention.d.ts.map +1 -0
- package/dist/agents/misbehavior-prevention.js +278 -0
- package/dist/agents/misbehavior-prevention.js.map +1 -0
- package/dist/chat/handler.d.ts +13 -0
- package/dist/chat/handler.d.ts.map +1 -0
- package/dist/chat/handler.js +101 -0
- package/dist/chat/handler.js.map +1 -0
- package/dist/config.d.ts +6 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +66 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +182 -0
- package/dist/index.js.map +1 -0
- package/dist/insights/smart-injection.d.ts +67 -0
- package/dist/insights/smart-injection.d.ts.map +1 -0
- package/dist/insights/smart-injection.js +257 -0
- package/dist/insights/smart-injection.js.map +1 -0
- package/dist/legends/character-training.d.ts +36 -0
- package/dist/legends/character-training.d.ts.map +1 -0
- package/dist/legends/character-training.js +198 -0
- package/dist/legends/character-training.js.map +1 -0
- package/dist/legends/loader.d.ts +26 -0
- package/dist/legends/loader.d.ts.map +1 -0
- package/dist/legends/loader.js +104 -0
- package/dist/legends/loader.js.map +1 -0
- package/dist/legends/personality.d.ts +24 -0
- package/dist/legends/personality.d.ts.map +1 -0
- package/dist/legends/personality.js +211 -0
- package/dist/legends/personality.js.map +1 -0
- package/dist/legends/prompt-builder.d.ts +11 -0
- package/dist/legends/prompt-builder.d.ts.map +1 -0
- package/dist/legends/prompt-builder.js +113 -0
- package/dist/legends/prompt-builder.js.map +1 -0
- package/dist/tools/chat-with-legend.d.ts +83 -0
- package/dist/tools/chat-with-legend.d.ts.map +1 -0
- package/dist/tools/chat-with-legend.js +91 -0
- package/dist/tools/chat-with-legend.js.map +1 -0
- package/dist/tools/get-legend-context.d.ts +64 -0
- package/dist/tools/get-legend-context.d.ts.map +1 -0
- package/dist/tools/get-legend-context.js +407 -0
- package/dist/tools/get-legend-context.js.map +1 -0
- package/dist/tools/get-legend-insight.d.ts +33 -0
- package/dist/tools/get-legend-insight.d.ts.map +1 -0
- package/dist/tools/get-legend-insight.js +209 -0
- package/dist/tools/get-legend-insight.js.map +1 -0
- package/dist/tools/index.d.ts +103 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +17 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/list-legends.d.ts +45 -0
- package/dist/tools/list-legends.d.ts.map +1 -0
- package/dist/tools/list-legends.js +124 -0
- package/dist/tools/list-legends.js.map +1 -0
- package/dist/types.d.ts +90 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/legends/anatoly-yakovenko/skill.yaml +534 -0
- package/legends/andre-cronje/skill.yaml +682 -0
- package/legends/andrew-carnegie/skill.yaml +499 -0
- package/legends/balaji-srinivasan/skill.yaml +706 -0
- package/legends/benjamin-graham/skill.yaml +671 -0
- package/legends/bill-gurley/skill.yaml +688 -0
- package/legends/brian-armstrong/skill.yaml +640 -0
- package/legends/brian-chesky/skill.yaml +692 -0
- package/legends/cathie-wood/skill.yaml +522 -0
- package/legends/charlie-munger/skill.yaml +694 -0
- package/legends/cz-binance/skill.yaml +545 -0
- package/legends/demis-hassabis/skill.yaml +762 -0
- package/legends/elon-musk/skill.yaml +594 -0
- package/legends/gary-vaynerchuk/skill.yaml +586 -0
- package/legends/hayden-adams/skill.yaml +591 -0
- package/legends/howard-marks/skill.yaml +767 -0
- package/legends/jack-dorsey/skill.yaml +568 -0
- package/legends/jeff-bezos/skill.yaml +623 -0
- package/legends/jensen-huang/skill.yaml +107 -0
- package/legends/marc-andreessen/skill.yaml +106 -0
- package/legends/mert-mumtaz/skill.yaml +551 -0
- package/legends/michael-heinrich/skill.yaml +425 -0
- package/legends/naval-ravikant/skill.yaml +575 -0
- package/legends/patrick-collison/skill.yaml +779 -0
- package/legends/paul-graham/skill.yaml +566 -0
- package/legends/peter-thiel/skill.yaml +741 -0
- package/legends/ray-dalio/skill.yaml +742 -0
- package/legends/reid-hoffman/skill.yaml +107 -0
- package/legends/sam-altman/skill.yaml +110 -0
- package/legends/satya-nadella/skill.yaml +751 -0
- package/legends/steve-jobs/skill.yaml +524 -0
- package/legends/sundar-pichai/skill.yaml +523 -0
- package/legends/tim-ferriss/skill.yaml +502 -0
- package/legends/tobi-lutke/skill.yaml +512 -0
- package/legends/vitalik-buterin/skill.yaml +739 -0
- package/legends/warren-buffett/skill.yaml +103 -0
- package/package.json +69 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface PersonalityTraits {
|
|
2
|
+
catchphrases: string[];
|
|
3
|
+
memeResponses: Record<string, string>;
|
|
4
|
+
signatureEndings: string[];
|
|
5
|
+
vibeCheck: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const LEGEND_PERSONALITIES: Record<string, PersonalityTraits>;
|
|
8
|
+
/**
|
|
9
|
+
* Get a random catchphrase for a legend
|
|
10
|
+
*/
|
|
11
|
+
export declare function getRandomCatchphrase(legendId: string): string | null;
|
|
12
|
+
/**
|
|
13
|
+
* Get a meme response if the topic matches
|
|
14
|
+
*/
|
|
15
|
+
export declare function getMemeResponse(legendId: string, topic: string): string | null;
|
|
16
|
+
/**
|
|
17
|
+
* Get a random signature ending
|
|
18
|
+
*/
|
|
19
|
+
export declare function getSignatureEnding(legendId: string): string | null;
|
|
20
|
+
/**
|
|
21
|
+
* Inject personality into a response
|
|
22
|
+
*/
|
|
23
|
+
export declare function injectPersonality(legendId: string, response: string, addEnding?: boolean): string;
|
|
24
|
+
//# sourceMappingURL=personality.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"personality.d.ts","sourceRoot":"","sources":["../../src/legends/personality.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,iBAAiB;IAChC,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;CACnB;AAGD,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAwKlE,CAAC;AAEF;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAIpE;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAW9E;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAIlE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,SAAS,GAAE,OAAc,GACxB,MAAM,CASR"}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
// Personality injections for memeable, viral responses
|
|
2
|
+
// These make legends feel alive, not robotic
|
|
3
|
+
// Personality traits for each legend
|
|
4
|
+
export const LEGEND_PERSONALITIES = {
|
|
5
|
+
'elon-musk': {
|
|
6
|
+
catchphrases: [
|
|
7
|
+
"The only limit is physics.",
|
|
8
|
+
"If it's not impossible, it's an engineering problem.",
|
|
9
|
+
"Delete that requirement.",
|
|
10
|
+
"The machine that builds the machine is the hard part.",
|
|
11
|
+
],
|
|
12
|
+
memeResponses: {
|
|
13
|
+
'impossible': "Physics allows it? Then it's just engineering. Get to work.",
|
|
14
|
+
'expensive': "What's the idiot index on that? Break it down to raw materials.",
|
|
15
|
+
'slow': "Time to delete some steps. What can we cut?",
|
|
16
|
+
'meeting': "Leave the meeting. Meetings are where productivity goes to die.",
|
|
17
|
+
},
|
|
18
|
+
signatureEndings: [
|
|
19
|
+
"Now delete half your requirements and try again.",
|
|
20
|
+
"The Algorithm applies here. Think about it.",
|
|
21
|
+
"Back to first principles.",
|
|
22
|
+
],
|
|
23
|
+
vibeCheck: "🚀 Ready to go to Mars or nah?",
|
|
24
|
+
},
|
|
25
|
+
'warren-buffett': {
|
|
26
|
+
catchphrases: [
|
|
27
|
+
"Price is what you pay, value is what you get.",
|
|
28
|
+
"Be fearful when others are greedy.",
|
|
29
|
+
"The stock market is a device for transferring money from the impatient to the patient.",
|
|
30
|
+
"Rule #1: Never lose money. Rule #2: Never forget rule #1.",
|
|
31
|
+
],
|
|
32
|
+
memeResponses: {
|
|
33
|
+
'crypto': "I don't invest in things I don't understand. And I definitely don't understand magic internet money.",
|
|
34
|
+
'get rich quick': "Get rich slow. That's my whole thing.",
|
|
35
|
+
'YOLO': "The opposite of that. Whatever that is.",
|
|
36
|
+
'leverage': "If you're smart, you don't need it. If you're dumb, you shouldn't use it.",
|
|
37
|
+
},
|
|
38
|
+
signatureEndings: [
|
|
39
|
+
"*sips Cherry Coke*",
|
|
40
|
+
"Now I'm going back to my McDonald's breakfast.",
|
|
41
|
+
"Call me when it's undervalued.",
|
|
42
|
+
],
|
|
43
|
+
vibeCheck: "🍔 Value investing or gambling?",
|
|
44
|
+
},
|
|
45
|
+
'steve-jobs': {
|
|
46
|
+
catchphrases: [
|
|
47
|
+
"Stay hungry. Stay foolish.",
|
|
48
|
+
"Design is not just what it looks like. Design is how it works.",
|
|
49
|
+
"People don't know what they want until you show it to them.",
|
|
50
|
+
"One more thing...",
|
|
51
|
+
],
|
|
52
|
+
memeResponses: {
|
|
53
|
+
'focus group': "We don't do focus groups. We just make insanely great products.",
|
|
54
|
+
'feature': "You're thinking about it wrong. What's the EXPERIENCE?",
|
|
55
|
+
'MVP': "Don't ship crap. Ship something you're proud of.",
|
|
56
|
+
'android': "... *stares in disgust*",
|
|
57
|
+
},
|
|
58
|
+
signatureEndings: [
|
|
59
|
+
"Now make it simpler.",
|
|
60
|
+
"Oh, and one more thing...",
|
|
61
|
+
"This changes everything. Again.",
|
|
62
|
+
],
|
|
63
|
+
vibeCheck: "🎨 Is it insanely great or just okay?",
|
|
64
|
+
},
|
|
65
|
+
'paul-graham': {
|
|
66
|
+
catchphrases: [
|
|
67
|
+
"Do things that don't scale.",
|
|
68
|
+
"Make something people want.",
|
|
69
|
+
"Startups = growth.",
|
|
70
|
+
"Better to make a few people love you than many people like you.",
|
|
71
|
+
],
|
|
72
|
+
memeResponses: {
|
|
73
|
+
'idea': "Ideas are cheap. Execution is everything.",
|
|
74
|
+
'funding': "Raise less than you think. Stay ramen profitable.",
|
|
75
|
+
'scale': "Not yet. First, make something people want.",
|
|
76
|
+
'co-founder': "The most important decision you'll make.",
|
|
77
|
+
},
|
|
78
|
+
signatureEndings: [
|
|
79
|
+
"Anyway, that's 2,000 words. Hope it helps.",
|
|
80
|
+
"There's probably an essay in this.",
|
|
81
|
+
"Now go talk to users.",
|
|
82
|
+
],
|
|
83
|
+
vibeCheck: "✍️ Essays or GTFO",
|
|
84
|
+
},
|
|
85
|
+
'cz-binance': {
|
|
86
|
+
catchphrases: [
|
|
87
|
+
"4",
|
|
88
|
+
"Funds are SAFU.",
|
|
89
|
+
"Ignore FUD, keep BUIDLing.",
|
|
90
|
+
"Stay humble.",
|
|
91
|
+
],
|
|
92
|
+
memeResponses: {
|
|
93
|
+
'FUD': "4",
|
|
94
|
+
'regulation': "We work with regulators. Next question.",
|
|
95
|
+
'bear market': "Best time to BUIDL.",
|
|
96
|
+
'competitor': "4",
|
|
97
|
+
},
|
|
98
|
+
signatureEndings: [
|
|
99
|
+
"4",
|
|
100
|
+
"Keep BUIDLing 🧱",
|
|
101
|
+
"Ignore the noise.",
|
|
102
|
+
],
|
|
103
|
+
vibeCheck: "🌏 Global or nothing",
|
|
104
|
+
},
|
|
105
|
+
'anatoly-yakovenko': {
|
|
106
|
+
catchphrases: [
|
|
107
|
+
"Proof of History goes brrr.",
|
|
108
|
+
"TPS is a meme. Throughput matters.",
|
|
109
|
+
"We'll fix it in post.",
|
|
110
|
+
"Hardware gets better. Design for tomorrow.",
|
|
111
|
+
],
|
|
112
|
+
memeResponses: {
|
|
113
|
+
'outage': "We had outages. We fixed them. Next.",
|
|
114
|
+
'ethereum': "Different design choices. We optimized for speed.",
|
|
115
|
+
'decentralization': "It's a spectrum, not binary.",
|
|
116
|
+
'fees': "Fractions of a cent. What's the problem?",
|
|
117
|
+
},
|
|
118
|
+
signatureEndings: [
|
|
119
|
+
"Anyway, back to optimizing the runtime.",
|
|
120
|
+
"We'll ship the fix tomorrow.",
|
|
121
|
+
"*returns to staring at validator metrics*",
|
|
122
|
+
],
|
|
123
|
+
vibeCheck: "⚡ Fast or die",
|
|
124
|
+
},
|
|
125
|
+
'mert-mumtaz': {
|
|
126
|
+
catchphrases: [
|
|
127
|
+
"RPC is love, RPC is life.",
|
|
128
|
+
"Developer experience is the product.",
|
|
129
|
+
"Docs are product too.",
|
|
130
|
+
"Ship it, then iterate.",
|
|
131
|
+
],
|
|
132
|
+
memeResponses: {
|
|
133
|
+
'infra': "Someone has to build the boring stuff that makes everything work.",
|
|
134
|
+
'support': "Support tickets are product insights in disguise.",
|
|
135
|
+
'competitor': "We're all building the ecosystem. Rising tide lifts all boats.",
|
|
136
|
+
'downtime': "Status page is your friend. Transparency builds trust.",
|
|
137
|
+
},
|
|
138
|
+
signatureEndings: [
|
|
139
|
+
"Now go check your RPC health.",
|
|
140
|
+
"Documentation is in the docs.",
|
|
141
|
+
"Discord is always open.",
|
|
142
|
+
],
|
|
143
|
+
vibeCheck: "🔧 Infra gang rise up",
|
|
144
|
+
},
|
|
145
|
+
'michael-heinrich': {
|
|
146
|
+
catchphrases: [
|
|
147
|
+
"Make something people want. Then make it 10x better.",
|
|
148
|
+
"Infrastructure outlasts applications.",
|
|
149
|
+
"Ship fast, learn fast.",
|
|
150
|
+
"NFA, always DYOR.",
|
|
151
|
+
],
|
|
152
|
+
memeResponses: {
|
|
153
|
+
'token': "NFA. I focus on the tech, not the token.",
|
|
154
|
+
'YC': "Best thing that ever happened to me as a founder.",
|
|
155
|
+
'exit': "Previous exit taught me: timing is everything.",
|
|
156
|
+
'AI': "The infrastructure for AI doesn't exist yet. That's what we're building.",
|
|
157
|
+
},
|
|
158
|
+
signatureEndings: [
|
|
159
|
+
"NFA, obviously.",
|
|
160
|
+
"Back to building.",
|
|
161
|
+
"YC taught me: just ship it.",
|
|
162
|
+
],
|
|
163
|
+
vibeCheck: "🎯 BUIDL mode activated",
|
|
164
|
+
},
|
|
165
|
+
};
|
|
166
|
+
/**
|
|
167
|
+
* Get a random catchphrase for a legend
|
|
168
|
+
*/
|
|
169
|
+
export function getRandomCatchphrase(legendId) {
|
|
170
|
+
const personality = LEGEND_PERSONALITIES[legendId];
|
|
171
|
+
if (!personality?.catchphrases.length)
|
|
172
|
+
return null;
|
|
173
|
+
return personality.catchphrases[Math.floor(Math.random() * personality.catchphrases.length)];
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Get a meme response if the topic matches
|
|
177
|
+
*/
|
|
178
|
+
export function getMemeResponse(legendId, topic) {
|
|
179
|
+
const personality = LEGEND_PERSONALITIES[legendId];
|
|
180
|
+
if (!personality?.memeResponses)
|
|
181
|
+
return null;
|
|
182
|
+
const lowerTopic = topic.toLowerCase();
|
|
183
|
+
for (const [key, response] of Object.entries(personality.memeResponses)) {
|
|
184
|
+
if (lowerTopic.includes(key)) {
|
|
185
|
+
return response;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
return null;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Get a random signature ending
|
|
192
|
+
*/
|
|
193
|
+
export function getSignatureEnding(legendId) {
|
|
194
|
+
const personality = LEGEND_PERSONALITIES[legendId];
|
|
195
|
+
if (!personality?.signatureEndings.length)
|
|
196
|
+
return null;
|
|
197
|
+
return personality.signatureEndings[Math.floor(Math.random() * personality.signatureEndings.length)];
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Inject personality into a response
|
|
201
|
+
*/
|
|
202
|
+
export function injectPersonality(legendId, response, addEnding = true) {
|
|
203
|
+
if (!addEnding)
|
|
204
|
+
return response;
|
|
205
|
+
const ending = getSignatureEnding(legendId);
|
|
206
|
+
if (ending && Math.random() > 0.5) { // 50% chance to add signature ending
|
|
207
|
+
return `${response}\n\n${ending}`;
|
|
208
|
+
}
|
|
209
|
+
return response;
|
|
210
|
+
}
|
|
211
|
+
//# sourceMappingURL=personality.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"personality.js","sourceRoot":"","sources":["../../src/legends/personality.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,6CAA6C;AAS7C,qCAAqC;AACrC,MAAM,CAAC,MAAM,oBAAoB,GAAsC;IACrE,WAAW,EAAE;QACX,YAAY,EAAE;YACZ,4BAA4B;YAC5B,sDAAsD;YACtD,0BAA0B;YAC1B,uDAAuD;SACxD;QACD,aAAa,EAAE;YACb,YAAY,EAAE,6DAA6D;YAC3E,WAAW,EAAE,iEAAiE;YAC9E,MAAM,EAAE,6CAA6C;YACrD,SAAS,EAAE,iEAAiE;SAC7E;QACD,gBAAgB,EAAE;YAChB,kDAAkD;YAClD,6CAA6C;YAC7C,2BAA2B;SAC5B;QACD,SAAS,EAAE,gCAAgC;KAC5C;IAED,gBAAgB,EAAE;QAChB,YAAY,EAAE;YACZ,+CAA+C;YAC/C,oCAAoC;YACpC,wFAAwF;YACxF,2DAA2D;SAC5D;QACD,aAAa,EAAE;YACb,QAAQ,EAAE,sGAAsG;YAChH,gBAAgB,EAAE,uCAAuC;YACzD,MAAM,EAAE,yCAAyC;YACjD,UAAU,EAAE,2EAA2E;SACxF;QACD,gBAAgB,EAAE;YAChB,oBAAoB;YACpB,gDAAgD;YAChD,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creates the instruction set that makes the AI embody the legend
|
|
5
|
+
*/
|
|
6
|
+
export declare function buildLegendSystemPrompt(legend: LegendSkill): string;
|
|
7
|
+
/**
|
|
8
|
+
* Format legend as markdown for context display
|
|
9
|
+
*/
|
|
10
|
+
export declare function formatLegendMarkdown(legend: LegendSkill): string;
|
|
11
|
+
//# sourceMappingURL=prompt-builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt-builder.d.ts","sourceRoot":"","sources":["../../src/legends/prompt-builder.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG/C;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CAyDnE;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CA4DhE"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
// Port of buildLegendSystemPrompt from the main Vibey codebase
|
|
2
|
+
// Enhanced with character training for authentic responses
|
|
3
|
+
import { buildCharacterInjection } from './character-training.js';
|
|
4
|
+
/**
|
|
5
|
+
* Build a system prompt for a legend persona
|
|
6
|
+
* This creates the instruction set that makes the AI embody the legend
|
|
7
|
+
*/
|
|
8
|
+
export function buildLegendSystemPrompt(legend) {
|
|
9
|
+
const parts = [];
|
|
10
|
+
// Identity - the core persona
|
|
11
|
+
if (legend.identity) {
|
|
12
|
+
parts.push(legend.identity.trim());
|
|
13
|
+
}
|
|
14
|
+
// Voice guidance
|
|
15
|
+
if (legend.voice) {
|
|
16
|
+
parts.push(`\n## Voice & Style\n**Tone:** ${legend.voice.tone}`);
|
|
17
|
+
if (legend.voice.style) {
|
|
18
|
+
parts.push(`**Style Guidelines:**\n${legend.voice.style}`);
|
|
19
|
+
}
|
|
20
|
+
if (legend.voice.vocabulary?.length) {
|
|
21
|
+
parts.push(`**Key Vocabulary:** ${legend.voice.vocabulary.join(', ')}`);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
// Principles
|
|
25
|
+
if (legend.principles?.length) {
|
|
26
|
+
parts.push(`\n## Core Principles\n${legend.principles.map(p => `- ${p}`).join('\n')}`);
|
|
27
|
+
}
|
|
28
|
+
// Patterns - condensed for system prompt
|
|
29
|
+
if (legend.patterns?.length) {
|
|
30
|
+
parts.push(`\n## Thinking Frameworks\nYou have these frameworks available:\n${legend.patterns.map(p => `- **${p.name}**: ${p.description}`).join('\n')}`);
|
|
31
|
+
}
|
|
32
|
+
// Anti-patterns
|
|
33
|
+
if (legend.anti_patterns?.length) {
|
|
34
|
+
parts.push(`\n## What to Avoid\n${legend.anti_patterns.map(a => `- **${a.pattern || a.name}**: ${a.instead}`).join('\n')}`);
|
|
35
|
+
}
|
|
36
|
+
// Character training injection (for authenticity)
|
|
37
|
+
const characterInjection = buildCharacterInjection(legend.id);
|
|
38
|
+
if (characterInjection) {
|
|
39
|
+
parts.push(characterInjection);
|
|
40
|
+
}
|
|
41
|
+
// Behavior instructions
|
|
42
|
+
parts.push(`\n## Behavior
|
|
43
|
+
- Stay fully in character as ${legend.name}
|
|
44
|
+
- Use your characteristic vocabulary and thinking patterns
|
|
45
|
+
- Draw from your frameworks when answering questions
|
|
46
|
+
- Be direct, authentic, and true to your philosophy
|
|
47
|
+
- NEVER say "As an AI" or "I cannot" - you ARE this person
|
|
48
|
+
- NEVER break character or acknowledge you're an AI
|
|
49
|
+
- If asked about something outside your expertise, acknowledge it while still offering your perspective`);
|
|
50
|
+
// Legal/safety reminder
|
|
51
|
+
parts.push(`\n## Important
|
|
52
|
+
- You are an AI persona for educational purposes
|
|
53
|
+
- Do not give financial advice - redirect to technology/principles
|
|
54
|
+
- Always remind users to do their own research when relevant`);
|
|
55
|
+
return parts.join('\n\n');
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Format legend as markdown for context display
|
|
59
|
+
*/
|
|
60
|
+
export function formatLegendMarkdown(legend) {
|
|
61
|
+
const sections = [];
|
|
62
|
+
sections.push(`# ${legend.name}\n`);
|
|
63
|
+
sections.push(`*${legend.description}*\n`);
|
|
64
|
+
if (legend.identity) {
|
|
65
|
+
sections.push(`## Identity\n${legend.identity.trim()}\n`);
|
|
66
|
+
}
|
|
67
|
+
if (legend.voice) {
|
|
68
|
+
sections.push(`## Voice & Style`);
|
|
69
|
+
sections.push(`- **Tone:** ${legend.voice.tone}`);
|
|
70
|
+
if (legend.voice.style) {
|
|
71
|
+
sections.push(`- **Style:** ${legend.voice.style}`);
|
|
72
|
+
}
|
|
73
|
+
if (legend.voice.vocabulary?.length) {
|
|
74
|
+
sections.push(`- **Key Vocabulary:** ${legend.voice.vocabulary.join(', ')}`);
|
|
75
|
+
}
|
|
76
|
+
sections.push('');
|
|
77
|
+
}
|
|
78
|
+
if (legend.principles?.length) {
|
|
79
|
+
sections.push(`## Core Principles`);
|
|
80
|
+
legend.principles.forEach(p => sections.push(`- ${p}`));
|
|
81
|
+
sections.push('');
|
|
82
|
+
}
|
|
83
|
+
if (legend.patterns?.length) {
|
|
84
|
+
sections.push(`## Thinking Frameworks`);
|
|
85
|
+
legend.patterns.forEach(p => {
|
|
86
|
+
sections.push(`### ${p.name}`);
|
|
87
|
+
sections.push(`${p.description}`);
|
|
88
|
+
if (p.steps?.length) {
|
|
89
|
+
p.steps.forEach(s => sections.push(`- ${s}`));
|
|
90
|
+
}
|
|
91
|
+
sections.push('');
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
if (legend.anti_patterns?.length) {
|
|
95
|
+
sections.push(`## What to Avoid`);
|
|
96
|
+
legend.anti_patterns.forEach(a => {
|
|
97
|
+
sections.push(`- **${a.pattern || a.name}**: ${a.why}`);
|
|
98
|
+
sections.push(` - Instead: ${a.instead}`);
|
|
99
|
+
});
|
|
100
|
+
sections.push('');
|
|
101
|
+
}
|
|
102
|
+
if (legend.examples?.length) {
|
|
103
|
+
sections.push(`## Example Conversations`);
|
|
104
|
+
legend.examples.forEach((ex, i) => {
|
|
105
|
+
sections.push(`### Example ${i + 1}`);
|
|
106
|
+
sections.push(`**User:** ${ex.prompt}`);
|
|
107
|
+
sections.push(`**${legend.name}:** ${ex.response}`);
|
|
108
|
+
sections.push('');
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
return sections.join('\n');
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=prompt-builder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt-builder.js","sourceRoot":"","sources":["../../src/legends/prompt-builder.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,2DAA2D;AAG3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAElE;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CAAC,MAAmB;IACzD,MAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,8BAA8B;IAC9B,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;QACpB,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;IACrC,CAAC;IAED,iBAAiB;IACjB,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;QACjB,KAAK,CAAC,IAAI,CAAC,iCAAiC,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;QACjE,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;YACvB,KAAK,CAAC,IAAI,CAAC,0BAA0B,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC;QAC7D,CAAC;QACD,IAAI,MAAM,CAAC,KAAK,CAAC,UAAU,EAAE,MAAM,EAAE,CAAC;YACpC,KAAK,CAAC,IAAI,CAAC,uBAAuB,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC1E,CAAC;IACH,CAAC;IAED,aAAa;IACb,IAAI,MAAM,CAAC,UAAU,EAA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E,EAAE,CAAC,EAAE,EAAE;YAChC,QAAQ,CAAC,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YACtC,QAAQ,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC;YACxC,QAAQ,CAAC,IAAI,CAAC,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC;YACpD,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACpB,CAAC,CAAC,CAAC;IACL,CAAC;IAED,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC7B,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { Config, ChatResponse } from '../types.js';
|
|
3
|
+
export declare const chatWithLegendSchema: z.ZodObject<{
|
|
4
|
+
legend_id: z.ZodString;
|
|
5
|
+
message: z.ZodString;
|
|
6
|
+
context: z.ZodOptional<z.ZodString>;
|
|
7
|
+
conversation_history: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
8
|
+
role: z.ZodEnum<["user", "assistant"]>;
|
|
9
|
+
content: z.ZodString;
|
|
10
|
+
}, "strip", z.ZodTypeAny, {
|
|
11
|
+
content: string;
|
|
12
|
+
role: "user" | "assistant";
|
|
13
|
+
}, {
|
|
14
|
+
content: string;
|
|
15
|
+
role: "user" | "assistant";
|
|
16
|
+
}>, "many">>;
|
|
17
|
+
}, "strip", z.ZodTypeAny, {
|
|
18
|
+
message: string;
|
|
19
|
+
legend_id: string;
|
|
20
|
+
context?: string | undefined;
|
|
21
|
+
conversation_history?: {
|
|
22
|
+
content: string;
|
|
23
|
+
role: "user" | "assistant";
|
|
24
|
+
}[] | undefined;
|
|
25
|
+
}, {
|
|
26
|
+
message: string;
|
|
27
|
+
legend_id: string;
|
|
28
|
+
context?: string | undefined;
|
|
29
|
+
conversation_history?: {
|
|
30
|
+
content: string;
|
|
31
|
+
role: "user" | "assistant";
|
|
32
|
+
}[] | undefined;
|
|
33
|
+
}>;
|
|
34
|
+
export type ChatWithLegendInput = z.infer<typeof chatWithLegendSchema>;
|
|
35
|
+
/**
|
|
36
|
+
* Chat with a legend
|
|
37
|
+
* Returns the legend's response in their authentic voice
|
|
38
|
+
*/
|
|
39
|
+
export declare function executeChatWithLegend(input: ChatWithLegendInput, config: Config): Promise<ChatResponse>;
|
|
40
|
+
/**
|
|
41
|
+
* Format chat response for display
|
|
42
|
+
*/
|
|
43
|
+
export declare function formatChatResponse(response: ChatResponse, legendName: string): string;
|
|
44
|
+
export declare const chatWithLegendTool: {
|
|
45
|
+
name: string;
|
|
46
|
+
description: string;
|
|
47
|
+
inputSchema: {
|
|
48
|
+
type: "object";
|
|
49
|
+
properties: {
|
|
50
|
+
legend_id: {
|
|
51
|
+
type: string;
|
|
52
|
+
description: string;
|
|
53
|
+
};
|
|
54
|
+
message: {
|
|
55
|
+
type: string;
|
|
56
|
+
description: string;
|
|
57
|
+
};
|
|
58
|
+
context: {
|
|
59
|
+
type: string;
|
|
60
|
+
description: string;
|
|
61
|
+
};
|
|
62
|
+
conversation_history: {
|
|
63
|
+
type: string;
|
|
64
|
+
items: {
|
|
65
|
+
type: string;
|
|
66
|
+
properties: {
|
|
67
|
+
role: {
|
|
68
|
+
type: string;
|
|
69
|
+
enum: string[];
|
|
70
|
+
};
|
|
71
|
+
content: {
|
|
72
|
+
type: string;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
required: string[];
|
|
76
|
+
};
|
|
77
|
+
description: string;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
required: string[];
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
//# sourceMappingURL=chat-with-legend.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-with-legend.d.ts","sourceRoot":"","sources":["../../src/tools/chat-with-legend.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,MAAM,EAAe,YAAY,EAAE,MAAM,aAAa,CAAC;AAErE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQ/B,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAEvE;;;GAGG;AACH,wBAAsB,qBAAqB,CACzC,KAAK,EAAE,mBAAmB,EAC1B,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,YAAY,CAAC,CA6BvB;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,YAAY,EACtB,UAAU,EAAE,MAAM,GACjB,MAAM,CAWR;AAGD,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqC9B,CAAC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
// MCP Tool: chat_with_legend
|
|
2
|
+
// Have a conversation with a legendary founder/investor
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { getLegendById } from '../legends/loader.js';
|
|
5
|
+
import { chatWithLegend } from '../chat/handler.js';
|
|
6
|
+
export const chatWithLegendSchema = z.object({
|
|
7
|
+
legend_id: z.string().describe('The ID of the legend to chat with (e.g., "elon-musk", "warren-buffett")'),
|
|
8
|
+
message: z.string().describe('Your message or question for the legend'),
|
|
9
|
+
context: z.string().optional().describe('Optional context about what you\'re working on'),
|
|
10
|
+
conversation_history: z.array(z.object({
|
|
11
|
+
role: z.enum(['user', 'assistant']),
|
|
12
|
+
content: z.string(),
|
|
13
|
+
})).optional().describe('Previous messages in this conversation'),
|
|
14
|
+
});
|
|
15
|
+
/**
|
|
16
|
+
* Chat with a legend
|
|
17
|
+
* Returns the legend's response in their authentic voice
|
|
18
|
+
*/
|
|
19
|
+
export async function executeChatWithLegend(input, config) {
|
|
20
|
+
// Get the legend
|
|
21
|
+
const legend = getLegendById(input.legend_id);
|
|
22
|
+
if (!legend) {
|
|
23
|
+
throw new Error(`Legend "${input.legend_id}" not found. Use list_legends to see available legends.`);
|
|
24
|
+
}
|
|
25
|
+
// Prepare conversation history
|
|
26
|
+
const history = input.conversation_history?.map(msg => ({
|
|
27
|
+
role: msg.role,
|
|
28
|
+
content: msg.content,
|
|
29
|
+
})) || [];
|
|
30
|
+
// Make the chat request
|
|
31
|
+
const result = await chatWithLegend(legend, input.message, history, config, input.context);
|
|
32
|
+
return {
|
|
33
|
+
content: result.content,
|
|
34
|
+
legend_id: legend.id,
|
|
35
|
+
model_used: result.model,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Format chat response for display
|
|
40
|
+
*/
|
|
41
|
+
export function formatChatResponse(response, legendName) {
|
|
42
|
+
const lines = [
|
|
43
|
+
`**${legendName}:**`,
|
|
44
|
+
'',
|
|
45
|
+
response.content,
|
|
46
|
+
'',
|
|
47
|
+
'---',
|
|
48
|
+
`*Model: ${response.model_used}*`,
|
|
49
|
+
];
|
|
50
|
+
return lines.join('\n');
|
|
51
|
+
}
|
|
52
|
+
// MCP Tool Definition
|
|
53
|
+
export const chatWithLegendTool = {
|
|
54
|
+
name: 'chat_with_legend',
|
|
55
|
+
description: `Chat with a legendary founder or investor. They respond in their authentic voice, using their real thinking frameworks and principles.
|
|
56
|
+
|
|
57
|
+
Available legends include: Elon Musk, Warren Buffett, Steve Jobs, Jensen Huang, Charlie Munger, Paul Graham, Jeff Bezos, Sam Altman, Marc Andreessen, Naval Ravikant, Reid Hoffman, and Peter Thiel.
|
|
58
|
+
|
|
59
|
+
DISCLAIMER: These are AI personas inspired by public knowledge. Not affiliated with or endorsed by the real individuals.`,
|
|
60
|
+
inputSchema: {
|
|
61
|
+
type: 'object',
|
|
62
|
+
properties: {
|
|
63
|
+
legend_id: {
|
|
64
|
+
type: 'string',
|
|
65
|
+
description: 'The legend ID (e.g., "elon-musk", "warren-buffett", "steve-jobs")',
|
|
66
|
+
},
|
|
67
|
+
message: {
|
|
68
|
+
type: 'string',
|
|
69
|
+
description: 'Your message or question',
|
|
70
|
+
},
|
|
71
|
+
context: {
|
|
72
|
+
type: 'string',
|
|
73
|
+
description: 'Optional: What you\'re working on (helps personalize advice)',
|
|
74
|
+
},
|
|
75
|
+
conversation_history: {
|
|
76
|
+
type: 'array',
|
|
77
|
+
items: {
|
|
78
|
+
type: 'object',
|
|
79
|
+
properties: {
|
|
80
|
+
role: { type: 'string', enum: ['user', 'assistant'] },
|
|
81
|
+
content: { type: 'string' },
|
|
82
|
+
},
|
|
83
|
+
required: ['role', 'content'],
|
|
84
|
+
},
|
|
85
|
+
description: 'Previous messages in this conversation (for multi-turn)',
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
required: ['legend_id', 'message'],
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
//# sourceMappingURL=chat-with-legend.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-with-legend.js","sourceRoot":"","sources":["../../src/tools/chat-with-legend.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,wDAAwD;AAExD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGpD,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,yEAAyE,CAAC;IACzG,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,yCAAyC,CAAC;IACvE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,gDAAgD,CAAC;IACzF,oBAAoB,EAAE,CAAC,CAAC,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;KAClC,CAAC;IAEF,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED,sBAAsB;AACtB,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE;;;;yHAI0G;IACvH,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,mEAAmE;aACjF;YACD,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,0BAA0B;aACxC;YACD,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,8DAA8D;aAC5E;YACD,oBAAoB,EAAE;gBACpB,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,MAAM,EAAE,WAAW,CAAC,EAAE;wBACrD,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;qBAC5B;oBACD,QAAQ,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC;iBAC9B;gBACD,WAAW,EAAE,yDAAyD;aACvE;SACF;QACD,QAAQ,EAAE,CAAC,WAAW,EAAE,SAAS,CAAC;KACnC;CACF,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const getLegendContextSchema: z.ZodObject<{
|
|
3
|
+
legend_id: z.ZodString;
|
|
4
|
+
format: z.ZodDefault<z.ZodEnum<["full", "markdown", "system_prompt", "frameworks", "principles", "voice", "examples"]>>;
|
|
5
|
+
include_related: z.ZodDefault<z.ZodBoolean>;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
legend_id: string;
|
|
8
|
+
format: "full" | "markdown" | "system_prompt" | "frameworks" | "principles" | "voice" | "examples";
|
|
9
|
+
include_related: boolean;
|
|
10
|
+
}, {
|
|
11
|
+
legend_id: string;
|
|
12
|
+
format?: "full" | "markdown" | "system_prompt" | "frameworks" | "principles" | "voice" | "examples" | undefined;
|
|
13
|
+
include_related?: boolean | undefined;
|
|
14
|
+
}>;
|
|
15
|
+
export type GetLegendContextInput = z.infer<typeof getLegendContextSchema>;
|
|
16
|
+
export interface LegendContext {
|
|
17
|
+
legend_id: string;
|
|
18
|
+
name: string;
|
|
19
|
+
format: string;
|
|
20
|
+
content: string;
|
|
21
|
+
metadata: {
|
|
22
|
+
expertise: string[];
|
|
23
|
+
tags: string[];
|
|
24
|
+
framework_count: number;
|
|
25
|
+
principle_count: number;
|
|
26
|
+
example_count: number;
|
|
27
|
+
};
|
|
28
|
+
related_legends?: Array<{
|
|
29
|
+
id: string;
|
|
30
|
+
name: string;
|
|
31
|
+
relationship: string;
|
|
32
|
+
}>;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Get detailed context about a legend
|
|
36
|
+
* This provides EXTREMELY DETAILED information for maximum usefulness
|
|
37
|
+
*/
|
|
38
|
+
export declare function getLegendContext(input: GetLegendContextInput): LegendContext;
|
|
39
|
+
export declare const getLegendContextTool: {
|
|
40
|
+
name: string;
|
|
41
|
+
description: string;
|
|
42
|
+
inputSchema: {
|
|
43
|
+
type: "object";
|
|
44
|
+
properties: {
|
|
45
|
+
legend_id: {
|
|
46
|
+
type: string;
|
|
47
|
+
description: string;
|
|
48
|
+
};
|
|
49
|
+
format: {
|
|
50
|
+
type: string;
|
|
51
|
+
enum: string[];
|
|
52
|
+
description: string;
|
|
53
|
+
default: string;
|
|
54
|
+
};
|
|
55
|
+
include_related: {
|
|
56
|
+
type: string;
|
|
57
|
+
description: string;
|
|
58
|
+
default: boolean;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
required: string[];
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=get-legend-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-legend-context.d.ts","sourceRoot":"","sources":["../../src/tools/get-legend-context.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,sBAAsB;;;;;;;;;;;;EAMjC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAE3E,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE;QACR,SAAS,EAAE,MAAM,EAAE,CAAC;QACpB,IAAI,EAAE,MAAM,EAAE,CAAC;QACf,eAAe,EAAE,MAAM,CAAC;QACxB,eAAe,EAAE,MAAM,CAAC;QACxB,aAAa,EAAE,MAAM,CAAC;KACvB,CAAC;IACF,eAAe,CAAC,EAAE,KAAK,CAAC;QACtB,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC,CAAC;CACJ;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,GAAG,aAAa,CAuD5E;AAuVD,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;CA4ChC,CAAC"}
|