@jam-nodes/nodes 0.1.2 → 0.2.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/dist/ai/analyze-posts.d.ts +175 -0
- package/dist/ai/analyze-posts.d.ts.map +1 -0
- package/dist/ai/analyze-posts.js +172 -0
- package/dist/ai/analyze-posts.js.map +1 -0
- package/dist/ai/draft-emails.d.ts +45 -0
- package/dist/ai/draft-emails.d.ts.map +1 -0
- package/dist/ai/draft-emails.js +134 -0
- package/dist/ai/draft-emails.js.map +1 -0
- package/dist/ai/index.d.ts +4 -0
- package/dist/ai/index.d.ts.map +1 -0
- package/dist/ai/index.js +4 -0
- package/dist/ai/index.js.map +1 -0
- package/dist/ai/keyword-generator.d.ts +37 -0
- package/dist/ai/keyword-generator.d.ts.map +1 -0
- package/dist/ai/keyword-generator.js +124 -0
- package/dist/ai/keyword-generator.js.map +1 -0
- package/dist/index.d.ts +323 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +29 -0
- package/dist/index.js.map +1 -1
- package/dist/integrations/apollo/index.d.ts +2 -0
- package/dist/integrations/apollo/index.d.ts.map +1 -0
- package/dist/integrations/apollo/index.js +2 -0
- package/dist/integrations/apollo/index.js.map +1 -0
- package/dist/integrations/apollo/search-contacts.d.ts +158 -0
- package/dist/integrations/apollo/search-contacts.d.ts.map +1 -0
- package/dist/integrations/apollo/search-contacts.js +161 -0
- package/dist/integrations/apollo/search-contacts.js.map +1 -0
- package/dist/integrations/dataforseo/index.d.ts +3 -0
- package/dist/integrations/dataforseo/index.d.ts.map +1 -0
- package/dist/integrations/dataforseo/index.js +3 -0
- package/dist/integrations/dataforseo/index.js.map +1 -0
- package/dist/integrations/dataforseo/keyword-research.d.ts +96 -0
- package/dist/integrations/dataforseo/keyword-research.d.ts.map +1 -0
- package/dist/integrations/dataforseo/keyword-research.js +115 -0
- package/dist/integrations/dataforseo/keyword-research.js.map +1 -0
- package/dist/integrations/dataforseo/seo-audit.d.ts +257 -0
- package/dist/integrations/dataforseo/seo-audit.d.ts.map +1 -0
- package/dist/integrations/dataforseo/seo-audit.js +266 -0
- package/dist/integrations/dataforseo/seo-audit.js.map +1 -0
- package/dist/integrations/index.d.ts +5 -0
- package/dist/integrations/index.d.ts.map +1 -0
- package/dist/integrations/index.js +9 -0
- package/dist/integrations/index.js.map +1 -0
- package/dist/integrations/openai/index.d.ts +2 -0
- package/dist/integrations/openai/index.d.ts.map +1 -0
- package/dist/integrations/openai/index.js +2 -0
- package/dist/integrations/openai/index.js.map +1 -0
- package/dist/integrations/openai/sora-video.d.ts +89 -0
- package/dist/integrations/openai/sora-video.d.ts.map +1 -0
- package/dist/integrations/openai/sora-video.js +93 -0
- package/dist/integrations/openai/sora-video.js.map +1 -0
- package/dist/integrations/social/index.d.ts +4 -0
- package/dist/integrations/social/index.d.ts.map +1 -0
- package/dist/integrations/social/index.js +4 -0
- package/dist/integrations/social/index.js.map +1 -0
- package/dist/integrations/social/linkedin-monitor.d.ts +166 -0
- package/dist/integrations/social/linkedin-monitor.d.ts.map +1 -0
- package/dist/integrations/social/linkedin-monitor.js +167 -0
- package/dist/integrations/social/linkedin-monitor.js.map +1 -0
- package/dist/integrations/social/reddit-monitor.d.ts +177 -0
- package/dist/integrations/social/reddit-monitor.d.ts.map +1 -0
- package/dist/integrations/social/reddit-monitor.js +162 -0
- package/dist/integrations/social/reddit-monitor.js.map +1 -0
- package/dist/integrations/social/twitter-monitor.d.ts +186 -0
- package/dist/integrations/social/twitter-monitor.d.ts.map +1 -0
- package/dist/integrations/social/twitter-monitor.js +174 -0
- package/dist/integrations/social/twitter-monitor.js.map +1 -0
- package/dist/prompts/analyze-posts.d.ts +31 -0
- package/dist/prompts/analyze-posts.d.ts.map +1 -0
- package/dist/prompts/analyze-posts.js +87 -0
- package/dist/prompts/analyze-posts.js.map +1 -0
- package/dist/prompts/draft-emails.d.ts +19 -0
- package/dist/prompts/draft-emails.d.ts.map +1 -0
- package/dist/prompts/draft-emails.js +117 -0
- package/dist/prompts/draft-emails.js.map +1 -0
- package/dist/prompts/index.d.ts +4 -0
- package/dist/prompts/index.d.ts.map +1 -0
- package/dist/prompts/index.js +7 -0
- package/dist/prompts/index.js.map +1 -0
- package/dist/prompts/keyword-generator.d.ts +17 -0
- package/dist/prompts/keyword-generator.d.ts.map +1 -0
- package/dist/prompts/keyword-generator.js +61 -0
- package/dist/prompts/keyword-generator.js.map +1 -0
- package/dist/schemas/ai.d.ts +1212 -0
- package/dist/schemas/ai.d.ts.map +1 -0
- package/dist/schemas/ai.js +119 -0
- package/dist/schemas/ai.js.map +1 -0
- package/dist/schemas/index.d.ts +2 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/index.js +9 -0
- package/dist/schemas/index.js.map +1 -0
- package/package.json +14 -6
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Contact } from '../schemas/ai';
|
|
2
|
+
/**
|
|
3
|
+
* Build the email body generation prompt.
|
|
4
|
+
*/
|
|
5
|
+
export declare function buildEmailPrompt(contact: Contact, productDescription: string, senderName: string, template?: string): string;
|
|
6
|
+
/**
|
|
7
|
+
* Build the subject line generation prompt.
|
|
8
|
+
*/
|
|
9
|
+
export declare function buildSubjectPrompt(contact: Contact, emailBody: string): string;
|
|
10
|
+
/**
|
|
11
|
+
* Clean up email body text.
|
|
12
|
+
* Removes subject lines and em dashes.
|
|
13
|
+
*/
|
|
14
|
+
export declare function cleanEmailBody(body: string): string;
|
|
15
|
+
/**
|
|
16
|
+
* Clean up subject line text.
|
|
17
|
+
*/
|
|
18
|
+
export declare function cleanSubjectLine(subject: string): string;
|
|
19
|
+
//# sourceMappingURL=draft-emails.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"draft-emails.d.ts","sourceRoot":"","sources":["../../src/prompts/draft-emails.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE7C;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,OAAO,EAChB,kBAAkB,EAAE,MAAM,EAC1B,UAAU,EAAE,MAAM,EAClB,QAAQ,CAAC,EAAE,MAAM,GAChB,MAAM,CAoDR;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAmC9E;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAMnD;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CASxD"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build the email body generation prompt.
|
|
3
|
+
*/
|
|
4
|
+
export function buildEmailPrompt(contact, productDescription, senderName, template) {
|
|
5
|
+
const signatureInstruction = `
|
|
6
|
+
|
|
7
|
+
SIGNATURE: End the email with:
|
|
8
|
+
Best,
|
|
9
|
+
${senderName}`;
|
|
10
|
+
if (template) {
|
|
11
|
+
return `Use this template to write a personalized cold email.
|
|
12
|
+
|
|
13
|
+
Template: ${template}
|
|
14
|
+
|
|
15
|
+
Contact: ${contact.name}, ${contact.title} at ${contact.company}
|
|
16
|
+
Product: ${productDescription}
|
|
17
|
+
|
|
18
|
+
STRICT RULES:
|
|
19
|
+
- 3-4 sentences MAX (excluding signature)
|
|
20
|
+
- DO NOT include "Subject:" in the body, only output email content
|
|
21
|
+
- Replace placeholders and personalize
|
|
22
|
+
- No fluff, every word must earn its place
|
|
23
|
+
- No em dashes or double hyphens
|
|
24
|
+
${signatureInstruction}`;
|
|
25
|
+
}
|
|
26
|
+
return `Write a cold outreach email.
|
|
27
|
+
|
|
28
|
+
TO: ${contact.name}, ${contact.title} at ${contact.company}
|
|
29
|
+
SELLING: ${productDescription}
|
|
30
|
+
|
|
31
|
+
STRICT FORMAT (3-4 sentences only):
|
|
32
|
+
1. HOOK: One line referencing their specific role/company/challenge
|
|
33
|
+
2. VALUE: What THEY get (not what you do) - be specific
|
|
34
|
+
3. CTA: Tiny ask - "quick call" or "10 min chat" - make it easy to say yes
|
|
35
|
+
|
|
36
|
+
RULES:
|
|
37
|
+
- DO NOT include "Subject:" line - only output the email body
|
|
38
|
+
- 3-4 sentences MAX (excluding signature). No more.
|
|
39
|
+
- Write like a busy founder texting, not a marketer writing copy
|
|
40
|
+
- No fluff words: "just", "actually", "really", "I wanted to", "I'd love to"
|
|
41
|
+
- No cliches: "reaching out", "hope this finds you well", "excited to share"
|
|
42
|
+
- No buzzwords: "innovative", "cutting-edge", "revolutionary", "game-changing"
|
|
43
|
+
- No em dashes or double hyphens. Use periods or commas instead.
|
|
44
|
+
- Create subtle urgency without being fake
|
|
45
|
+
- Sound like you spent 2 minutes researching them (because you did)
|
|
46
|
+
|
|
47
|
+
GOOD EXAMPLE:
|
|
48
|
+
Hey Sarah,
|
|
49
|
+
|
|
50
|
+
Running content at a Series A startup is tough. You're probably creating way more than you can actually promote. Built something that finds the exact keywords your buyers search and turns them into content briefs. Takes 10 min to see if it's useful for Acme.
|
|
51
|
+
|
|
52
|
+
Worth a quick look?
|
|
53
|
+
${signatureInstruction}`;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Build the subject line generation prompt.
|
|
57
|
+
*/
|
|
58
|
+
export function buildSubjectPrompt(contact, emailBody) {
|
|
59
|
+
const companyShort = (contact.company.split(' ')[0] ?? contact.company).toLowerCase();
|
|
60
|
+
return `Write a subject line for this cold email.
|
|
61
|
+
|
|
62
|
+
Email: ${emailBody}
|
|
63
|
+
|
|
64
|
+
Recipient: ${contact.name} at ${contact.company}
|
|
65
|
+
|
|
66
|
+
RULES:
|
|
67
|
+
- 3-6 words, under 35 chars
|
|
68
|
+
- lowercase, no punctuation except commas
|
|
69
|
+
- NO dashes, hyphens, em dashes, or colons
|
|
70
|
+
- Lead with SPECIFIC VALUE they get (keyword found, traffic opportunity, etc.)
|
|
71
|
+
- Include company name, not person name
|
|
72
|
+
- Sound like a slack message from a colleague, not marketing
|
|
73
|
+
|
|
74
|
+
BANNED PATTERNS (do not use):
|
|
75
|
+
- "Never X again" / "Stop X-ing"
|
|
76
|
+
- "Unlock" / "Discover" / "Transform"
|
|
77
|
+
- "AI-powered" / "Game-changing"
|
|
78
|
+
- Any tagline or slogan style
|
|
79
|
+
- Questions
|
|
80
|
+
|
|
81
|
+
GOOD: "found 3 keywords for ${companyShort}"
|
|
82
|
+
GOOD: "${companyShort} seo opportunity"
|
|
83
|
+
GOOD: "traffic idea for ${companyShort}"
|
|
84
|
+
GOOD: "${companyShort} ranking on page 2"
|
|
85
|
+
|
|
86
|
+
BAD: "Never launch to crickets again"
|
|
87
|
+
BAD: "Quick question about your SEO"
|
|
88
|
+
BAD: "Unlock your SEO potential"
|
|
89
|
+
BAD: "${contact.name} - quick idea"
|
|
90
|
+
|
|
91
|
+
Output ONLY the subject line, lowercase, no quotes.`;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Clean up email body text.
|
|
95
|
+
* Removes subject lines and em dashes.
|
|
96
|
+
*/
|
|
97
|
+
export function cleanEmailBody(body) {
|
|
98
|
+
return body
|
|
99
|
+
.replace(/^Subject:.*\n\n?/i, '')
|
|
100
|
+
.replace(/\s*[—–]\s*/g, '. ')
|
|
101
|
+
.replace(/\s*--\s*/g, '. ')
|
|
102
|
+
.trim();
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Clean up subject line text.
|
|
106
|
+
*/
|
|
107
|
+
export function cleanSubjectLine(subject) {
|
|
108
|
+
return subject
|
|
109
|
+
.replace(/^["']|["']$/g, '')
|
|
110
|
+
.replace(/^subject:\s*/i, '')
|
|
111
|
+
.replace(/\s*[—–]\s*/g, ', ')
|
|
112
|
+
.replace(/\s+-\s+/g, ', ')
|
|
113
|
+
.replace(/:/g, '')
|
|
114
|
+
.toLowerCase()
|
|
115
|
+
.trim();
|
|
116
|
+
}
|
|
117
|
+
//# sourceMappingURL=draft-emails.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"draft-emails.js","sourceRoot":"","sources":["../../src/prompts/draft-emails.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAC9B,OAAgB,EAChB,kBAA0B,EAC1B,UAAkB,EAClB,QAAiB;IAEjB,MAAM,oBAAoB,GAAG;;;;EAI7B,UAAU,EAAE,CAAC;IAEb,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO;;YAEC,QAAQ;;WAET,OAAO,CAAC,IAAI,KAAK,OAAO,CAAC,KAAK,OAAO,OAAO,CAAC,OAAO;WACpD,kBAAkB;;;;;;;;EAQ3B,oBAAoB,EAAE,CAAC;IACvB,CAAC;IAED,OAAO;;MAEH,OAAO,CAAC,IAAI,KAAK,OAAO,CAAC,KAAK,OAAO,OAAO,CAAC,OAAO;WAC/C,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;EAwB3B,oBAAoB,EAAE,CAAC;AACzB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAAgB,EAAE,SAAiB;IACpE,MAAM,YAAY,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC;IAEtF,OAAO;;SAEA,SAAS;;aAEL,OAAO,CAAC,IAAI,OAAO,OAAO,CAAC,OAAO;;;;;;;;;;;;;;;;;8BAiBjB,YAAY;SACjC,YAAY;0BACK,YAAY;SAC7B,YAAY;;;;;QAKb,OAAO,CAAC,IAAI;;oDAEgC,CAAC;AACrD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,IAAY;IACzC,OAAO,IAAI;SACR,OAAO,CAAC,mBAAmB,EAAE,EAAE,CAAC;SAChC,OAAO,CAAC,aAAa,EAAE,IAAI,CAAC;SAC5B,OAAO,CAAC,WAAW,EAAE,IAAI,CAAC;SAC1B,IAAI,EAAE,CAAC;AACZ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAe;IAC9C,OAAO,OAAO;SACX,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC;SAC3B,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC;SAC5B,OAAO,CAAC,aAAa,EAAE,IAAI,CAAC;SAC5B,OAAO,CAAC,UAAU,EAAE,IAAI,CAAC;SACzB,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC;SACjB,WAAW,EAAE;SACb,IAAI,EAAE,CAAC;AACZ,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { KEYWORD_GENERATION_PROMPT, buildUserKeywordsSection, buildKeywordPrompt, } from './keyword-generator';
|
|
2
|
+
export { buildEmailPrompt, buildSubjectPrompt, cleanEmailBody, cleanSubjectLine, } from './draft-emails';
|
|
3
|
+
export { ANALYSIS_PROMPT, buildAnalysisPrompt, normalizeSentiment, normalizeUrgency, MIN_RELEVANCE_SCORE, ANALYSIS_BATCH_SIZE, } from './analyze-posts';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/prompts/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,yBAAyB,EACzB,wBAAwB,EACxB,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,gBAAgB,GACjB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// Keyword Generator
|
|
2
|
+
export { KEYWORD_GENERATION_PROMPT, buildUserKeywordsSection, buildKeywordPrompt, } from './keyword-generator';
|
|
3
|
+
// Draft Emails
|
|
4
|
+
export { buildEmailPrompt, buildSubjectPrompt, cleanEmailBody, cleanSubjectLine, } from './draft-emails';
|
|
5
|
+
// Analyze Posts
|
|
6
|
+
export { ANALYSIS_PROMPT, buildAnalysisPrompt, normalizeSentiment, normalizeUrgency, MIN_RELEVANCE_SCORE, ANALYSIS_BATCH_SIZE, } from './analyze-posts';
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/prompts/index.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,OAAO,EACL,yBAAyB,EACzB,wBAAwB,EACxB,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAE7B,eAAe;AACf,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,gBAAgB,GACjB,MAAM,gBAAgB,CAAC;AAExB,gBAAgB;AAChB,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prompt for generating platform-specific social media search keywords.
|
|
3
|
+
*
|
|
4
|
+
* Template variables:
|
|
5
|
+
* - {{TOPIC}}: The user's topic description
|
|
6
|
+
* - {{USER_KEYWORDS_SECTION}}: Optional section with user-provided keywords
|
|
7
|
+
*/
|
|
8
|
+
export declare const KEYWORD_GENERATION_PROMPT = "You are an expert at social media monitoring and search optimization. Given a topic description, generate search keywords for finding relevant posts on Twitter, Reddit, and LinkedIn.\n\n<topic>\n{{TOPIC}}\n</topic>\n\n{{USER_KEYWORDS_SECTION}}\n\nGenerate search keywords following these guidelines:\n\n1. **Core Keywords**: Direct terms related to the topic\n2. **Brand/Product Keywords**: Specific products/tools/brands if applicable\n3. **Industry Terms**: Professional/industry-specific terminology\n\nIMPORTANT CONSTRAINTS:\n- For Reddit: Generate ONLY 8-12 specific, multi-word keywords. Reddit's search API has query length limits. Avoid generic single words like \"frustrated\", \"recommend\", \"alternative\". Focus on specific product names and multi-word phrases.\n- For Twitter: Can be more comprehensive since Twitter handles longer queries well.\n- For LinkedIn: Focus on professional context and industry terms.\n\nRespond in this exact JSON format:\n{\n \"twitter\": {\n \"keywords\": [\"keyword1\", \"keyword2\", ...],\n \"searchQuery\": \"(keyword1 OR keyword2 OR \\\"multi word\\\") -is:retweet\"\n },\n \"reddit\": {\n \"keywords\": [\"keyword1\", \"keyword2\", ...]\n },\n \"linkedin\": {\n \"keywords\": [\"keyword1\", \"keyword2\", ...],\n \"searchQueries\": [\"query1\", \"query2\", ...]\n }\n}";
|
|
9
|
+
/**
|
|
10
|
+
* Build the user keywords section if keywords are provided.
|
|
11
|
+
*/
|
|
12
|
+
export declare function buildUserKeywordsSection(userKeywords?: string[]): string;
|
|
13
|
+
/**
|
|
14
|
+
* Build the complete keyword generation prompt.
|
|
15
|
+
*/
|
|
16
|
+
export declare function buildKeywordPrompt(topic: string, userKeywords?: string[]): string;
|
|
17
|
+
//# sourceMappingURL=keyword-generator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keyword-generator.d.ts","sourceRoot":"","sources":["../../src/prompts/keyword-generator.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,g0CAgCpC,CAAC;AAEH;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,CASxE;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,CAIjF"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prompt for generating platform-specific social media search keywords.
|
|
3
|
+
*
|
|
4
|
+
* Template variables:
|
|
5
|
+
* - {{TOPIC}}: The user's topic description
|
|
6
|
+
* - {{USER_KEYWORDS_SECTION}}: Optional section with user-provided keywords
|
|
7
|
+
*/
|
|
8
|
+
export const KEYWORD_GENERATION_PROMPT = `You are an expert at social media monitoring and search optimization. Given a topic description, generate search keywords for finding relevant posts on Twitter, Reddit, and LinkedIn.
|
|
9
|
+
|
|
10
|
+
<topic>
|
|
11
|
+
{{TOPIC}}
|
|
12
|
+
</topic>
|
|
13
|
+
|
|
14
|
+
{{USER_KEYWORDS_SECTION}}
|
|
15
|
+
|
|
16
|
+
Generate search keywords following these guidelines:
|
|
17
|
+
|
|
18
|
+
1. **Core Keywords**: Direct terms related to the topic
|
|
19
|
+
2. **Brand/Product Keywords**: Specific products/tools/brands if applicable
|
|
20
|
+
3. **Industry Terms**: Professional/industry-specific terminology
|
|
21
|
+
|
|
22
|
+
IMPORTANT CONSTRAINTS:
|
|
23
|
+
- For Reddit: Generate ONLY 8-12 specific, multi-word keywords. Reddit's search API has query length limits. Avoid generic single words like "frustrated", "recommend", "alternative". Focus on specific product names and multi-word phrases.
|
|
24
|
+
- For Twitter: Can be more comprehensive since Twitter handles longer queries well.
|
|
25
|
+
- For LinkedIn: Focus on professional context and industry terms.
|
|
26
|
+
|
|
27
|
+
Respond in this exact JSON format:
|
|
28
|
+
{
|
|
29
|
+
"twitter": {
|
|
30
|
+
"keywords": ["keyword1", "keyword2", ...],
|
|
31
|
+
"searchQuery": "(keyword1 OR keyword2 OR \\"multi word\\") -is:retweet"
|
|
32
|
+
},
|
|
33
|
+
"reddit": {
|
|
34
|
+
"keywords": ["keyword1", "keyword2", ...]
|
|
35
|
+
},
|
|
36
|
+
"linkedin": {
|
|
37
|
+
"keywords": ["keyword1", "keyword2", ...],
|
|
38
|
+
"searchQueries": ["query1", "query2", ...]
|
|
39
|
+
}
|
|
40
|
+
}`;
|
|
41
|
+
/**
|
|
42
|
+
* Build the user keywords section if keywords are provided.
|
|
43
|
+
*/
|
|
44
|
+
export function buildUserKeywordsSection(userKeywords) {
|
|
45
|
+
if (!userKeywords?.length) {
|
|
46
|
+
return '';
|
|
47
|
+
}
|
|
48
|
+
return `<user_keywords>
|
|
49
|
+
The user also wants to include these specific keywords:
|
|
50
|
+
${userKeywords.join(', ')}
|
|
51
|
+
</user_keywords>`;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Build the complete keyword generation prompt.
|
|
55
|
+
*/
|
|
56
|
+
export function buildKeywordPrompt(topic, userKeywords) {
|
|
57
|
+
return KEYWORD_GENERATION_PROMPT
|
|
58
|
+
.replace('{{TOPIC}}', topic)
|
|
59
|
+
.replace('{{USER_KEYWORDS_SECTION}}', buildUserKeywordsSection(userKeywords));
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=keyword-generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keyword-generator.js","sourceRoot":"","sources":["../../src/prompts/keyword-generator.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgCvC,CAAC;AAEH;;GAEG;AACH,MAAM,UAAU,wBAAwB,CAAC,YAAuB;IAC9D,IAAI,CAAC,YAAY,EAAE,MAAM,EAAE,CAAC;QAC1B,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO;;EAEP,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC;iBACR,CAAC;AAClB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAa,EAAE,YAAuB;IACvE,OAAO,yBAAyB;SAC7B,OAAO,CAAC,WAAW,EAAE,KAAK,CAAC;SAC3B,OAAO,CAAC,2BAA2B,EAAE,wBAAwB,CAAC,YAAY,CAAC,CAAC,CAAC;AAClF,CAAC"}
|