legends-mcp 1.0.1 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/README.md +43 -72
  2. package/dist/config.d.ts +2 -4
  3. package/dist/config.d.ts.map +1 -1
  4. package/dist/config.js +15 -54
  5. package/dist/config.js.map +1 -1
  6. package/dist/index.js +28 -25
  7. package/dist/index.js.map +1 -1
  8. package/dist/tools/get-legend-context.d.ts +4 -14
  9. package/dist/tools/get-legend-context.d.ts.map +1 -1
  10. package/dist/tools/get-legend-context.js +5 -12
  11. package/dist/tools/get-legend-context.js.map +1 -1
  12. package/dist/tools/get-legend-insight.d.ts +3 -11
  13. package/dist/tools/get-legend-insight.d.ts.map +1 -1
  14. package/dist/tools/get-legend-insight.js +5 -10
  15. package/dist/tools/get-legend-insight.js.map +1 -1
  16. package/dist/tools/index.d.ts +1 -22
  17. package/dist/tools/index.d.ts.map +1 -1
  18. package/dist/tools/index.js +3 -3
  19. package/dist/tools/index.js.map +1 -1
  20. package/dist/tools/list-legends.d.ts +4 -12
  21. package/dist/tools/list-legends.d.ts.map +1 -1
  22. package/dist/tools/list-legends.js +2 -7
  23. package/dist/tools/list-legends.js.map +1 -1
  24. package/dist/tools/summon-legend.d.ts +42 -0
  25. package/dist/tools/summon-legend.d.ts.map +1 -0
  26. package/dist/tools/summon-legend.js +98 -0
  27. package/dist/tools/summon-legend.js.map +1 -0
  28. package/dist/types.d.ts +0 -30
  29. package/dist/types.d.ts.map +1 -1
  30. package/dist/types.js +1 -1
  31. package/dist/types.js.map +1 -1
  32. package/package.json +8 -9
  33. package/dist/chat/handler.d.ts +0 -13
  34. package/dist/chat/handler.d.ts.map +0 -1
  35. package/dist/chat/handler.js +0 -101
  36. package/dist/chat/handler.js.map +0 -1
  37. package/dist/tools/chat-with-legend.d.ts +0 -83
  38. package/dist/tools/chat-with-legend.d.ts.map +0 -1
  39. package/dist/tools/chat-with-legend.js +0 -91
  40. package/dist/tools/chat-with-legend.js.map +0 -1
@@ -1,83 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,91 +0,0 @@
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
@@ -1 +0,0 @@
1
- {"version":3,"file":"chat-with-legend.js","sourceRoot":"","sources":["../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