@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,175 @@
|
|
|
1
|
+
export { SocialAiAnalyzeInputSchema, SocialAiAnalyzeOutputSchema, type SocialAiAnalyzeInput, type SocialAiAnalyzeOutput, type SocialPost, type AnalyzedPost, } from '../schemas/ai';
|
|
2
|
+
/**
|
|
3
|
+
* Social AI Analyze Node
|
|
4
|
+
*
|
|
5
|
+
* Uses Claude to analyze social media posts for relevance, sentiment,
|
|
6
|
+
* complaint detection, and urgency. Batches posts to stay within context limits.
|
|
7
|
+
*
|
|
8
|
+
* Requires `context.services.anthropic` to be provided by the host application.
|
|
9
|
+
* Optionally uses `context.services.analyzedPosts` to store results.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* const result = await socialAiAnalyzeNode.executor({
|
|
14
|
+
* twitterPosts: [...],
|
|
15
|
+
* redditPosts: [...],
|
|
16
|
+
* topic: 'Project management software',
|
|
17
|
+
* userIntent: 'Find people frustrated with current tools'
|
|
18
|
+
* }, context);
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare const socialAiAnalyzeNode: import("@jam-nodes/core").NodeDefinition<{
|
|
22
|
+
topic: string;
|
|
23
|
+
userIntent: string;
|
|
24
|
+
posts?: {
|
|
25
|
+
url: string;
|
|
26
|
+
id: string;
|
|
27
|
+
platform: "reddit" | "twitter" | "linkedin";
|
|
28
|
+
text: string;
|
|
29
|
+
authorName: string;
|
|
30
|
+
authorHandle: string;
|
|
31
|
+
authorUrl: string;
|
|
32
|
+
engagement: {
|
|
33
|
+
comments: number;
|
|
34
|
+
likes: number;
|
|
35
|
+
shares: number;
|
|
36
|
+
views?: number | undefined;
|
|
37
|
+
};
|
|
38
|
+
postedAt: string;
|
|
39
|
+
title?: string | undefined;
|
|
40
|
+
authorFollowers?: number | undefined;
|
|
41
|
+
}[] | undefined;
|
|
42
|
+
twitterPosts?: {
|
|
43
|
+
url: string;
|
|
44
|
+
id: string;
|
|
45
|
+
platform: "reddit" | "twitter" | "linkedin";
|
|
46
|
+
text: string;
|
|
47
|
+
authorName: string;
|
|
48
|
+
authorHandle: string;
|
|
49
|
+
authorUrl: string;
|
|
50
|
+
engagement: {
|
|
51
|
+
comments: number;
|
|
52
|
+
likes: number;
|
|
53
|
+
shares: number;
|
|
54
|
+
views?: number | undefined;
|
|
55
|
+
};
|
|
56
|
+
postedAt: string;
|
|
57
|
+
title?: string | undefined;
|
|
58
|
+
authorFollowers?: number | undefined;
|
|
59
|
+
}[] | undefined;
|
|
60
|
+
redditPosts?: {
|
|
61
|
+
url: string;
|
|
62
|
+
id: string;
|
|
63
|
+
platform: "reddit" | "twitter" | "linkedin";
|
|
64
|
+
text: string;
|
|
65
|
+
authorName: string;
|
|
66
|
+
authorHandle: string;
|
|
67
|
+
authorUrl: string;
|
|
68
|
+
engagement: {
|
|
69
|
+
comments: number;
|
|
70
|
+
likes: number;
|
|
71
|
+
shares: number;
|
|
72
|
+
views?: number | undefined;
|
|
73
|
+
};
|
|
74
|
+
postedAt: string;
|
|
75
|
+
title?: string | undefined;
|
|
76
|
+
authorFollowers?: number | undefined;
|
|
77
|
+
}[] | undefined;
|
|
78
|
+
linkedinPosts?: {
|
|
79
|
+
url: string;
|
|
80
|
+
id: string;
|
|
81
|
+
platform: "reddit" | "twitter" | "linkedin";
|
|
82
|
+
text: string;
|
|
83
|
+
authorName: string;
|
|
84
|
+
authorHandle: string;
|
|
85
|
+
authorUrl: string;
|
|
86
|
+
engagement: {
|
|
87
|
+
comments: number;
|
|
88
|
+
likes: number;
|
|
89
|
+
shares: number;
|
|
90
|
+
views?: number | undefined;
|
|
91
|
+
};
|
|
92
|
+
postedAt: string;
|
|
93
|
+
title?: string | undefined;
|
|
94
|
+
authorFollowers?: number | undefined;
|
|
95
|
+
}[] | undefined;
|
|
96
|
+
monitoringConfigId?: string | undefined;
|
|
97
|
+
}, {
|
|
98
|
+
analyzedPosts: {
|
|
99
|
+
url: string;
|
|
100
|
+
id: string;
|
|
101
|
+
platform: "reddit" | "twitter" | "linkedin";
|
|
102
|
+
text: string;
|
|
103
|
+
authorName: string;
|
|
104
|
+
authorHandle: string;
|
|
105
|
+
authorUrl: string;
|
|
106
|
+
engagement: {
|
|
107
|
+
comments: number;
|
|
108
|
+
likes: number;
|
|
109
|
+
shares: number;
|
|
110
|
+
views?: number | undefined;
|
|
111
|
+
};
|
|
112
|
+
postedAt: string;
|
|
113
|
+
relevanceScore: number;
|
|
114
|
+
sentiment: "positive" | "negative" | "neutral";
|
|
115
|
+
isComplaint: boolean;
|
|
116
|
+
urgencyLevel: "low" | "medium" | "high";
|
|
117
|
+
aiSummary: string;
|
|
118
|
+
matchedKeywords: string[];
|
|
119
|
+
title?: string | undefined;
|
|
120
|
+
authorFollowers?: number | undefined;
|
|
121
|
+
}[];
|
|
122
|
+
highPriorityPosts: {
|
|
123
|
+
url: string;
|
|
124
|
+
id: string;
|
|
125
|
+
platform: "reddit" | "twitter" | "linkedin";
|
|
126
|
+
text: string;
|
|
127
|
+
authorName: string;
|
|
128
|
+
authorHandle: string;
|
|
129
|
+
authorUrl: string;
|
|
130
|
+
engagement: {
|
|
131
|
+
comments: number;
|
|
132
|
+
likes: number;
|
|
133
|
+
shares: number;
|
|
134
|
+
views?: number | undefined;
|
|
135
|
+
};
|
|
136
|
+
postedAt: string;
|
|
137
|
+
relevanceScore: number;
|
|
138
|
+
sentiment: "positive" | "negative" | "neutral";
|
|
139
|
+
isComplaint: boolean;
|
|
140
|
+
urgencyLevel: "low" | "medium" | "high";
|
|
141
|
+
aiSummary: string;
|
|
142
|
+
matchedKeywords: string[];
|
|
143
|
+
title?: string | undefined;
|
|
144
|
+
authorFollowers?: number | undefined;
|
|
145
|
+
}[];
|
|
146
|
+
complaints: {
|
|
147
|
+
url: string;
|
|
148
|
+
id: string;
|
|
149
|
+
platform: "reddit" | "twitter" | "linkedin";
|
|
150
|
+
text: string;
|
|
151
|
+
authorName: string;
|
|
152
|
+
authorHandle: string;
|
|
153
|
+
authorUrl: string;
|
|
154
|
+
engagement: {
|
|
155
|
+
comments: number;
|
|
156
|
+
likes: number;
|
|
157
|
+
shares: number;
|
|
158
|
+
views?: number | undefined;
|
|
159
|
+
};
|
|
160
|
+
postedAt: string;
|
|
161
|
+
relevanceScore: number;
|
|
162
|
+
sentiment: "positive" | "negative" | "neutral";
|
|
163
|
+
isComplaint: boolean;
|
|
164
|
+
urgencyLevel: "low" | "medium" | "high";
|
|
165
|
+
aiSummary: string;
|
|
166
|
+
matchedKeywords: string[];
|
|
167
|
+
title?: string | undefined;
|
|
168
|
+
authorFollowers?: number | undefined;
|
|
169
|
+
}[];
|
|
170
|
+
totalAnalyzed: number;
|
|
171
|
+
highPriorityCount: number;
|
|
172
|
+
complaintCount: number;
|
|
173
|
+
averageRelevance: number;
|
|
174
|
+
}>;
|
|
175
|
+
//# sourceMappingURL=analyze-posts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analyze-posts.d.ts","sourceRoot":"","sources":["../../src/ai/analyze-posts.ts"],"names":[],"mappings":"AAgBA,OAAO,EACL,0BAA0B,EAC1B,2BAA2B,EAC3B,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,UAAU,EACf,KAAK,YAAY,GAClB,MAAM,eAAe,CAAC;AAEvB;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6K9B,CAAC"}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { defineNode } from '@jam-nodes/core';
|
|
2
|
+
import { SocialAiAnalyzeInputSchema, SocialAiAnalyzeOutputSchema, } from '../schemas/ai';
|
|
3
|
+
import { buildAnalysisPrompt, normalizeSentiment, normalizeUrgency, MIN_RELEVANCE_SCORE, ANALYSIS_BATCH_SIZE, } from '../prompts/analyze-posts';
|
|
4
|
+
// Re-export schemas and types for convenience
|
|
5
|
+
export { SocialAiAnalyzeInputSchema, SocialAiAnalyzeOutputSchema, } from '../schemas/ai';
|
|
6
|
+
/**
|
|
7
|
+
* Social AI Analyze Node
|
|
8
|
+
*
|
|
9
|
+
* Uses Claude to analyze social media posts for relevance, sentiment,
|
|
10
|
+
* complaint detection, and urgency. Batches posts to stay within context limits.
|
|
11
|
+
*
|
|
12
|
+
* Requires `context.services.anthropic` to be provided by the host application.
|
|
13
|
+
* Optionally uses `context.services.analyzedPosts` to store results.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* const result = await socialAiAnalyzeNode.executor({
|
|
18
|
+
* twitterPosts: [...],
|
|
19
|
+
* redditPosts: [...],
|
|
20
|
+
* topic: 'Project management software',
|
|
21
|
+
* userIntent: 'Find people frustrated with current tools'
|
|
22
|
+
* }, context);
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export const socialAiAnalyzeNode = defineNode({
|
|
26
|
+
type: 'social_ai_analyze',
|
|
27
|
+
name: 'Social AI Analyze',
|
|
28
|
+
description: 'Analyze social media posts for relevance, sentiment, and urgency using AI',
|
|
29
|
+
category: 'action',
|
|
30
|
+
inputSchema: SocialAiAnalyzeInputSchema,
|
|
31
|
+
outputSchema: SocialAiAnalyzeOutputSchema,
|
|
32
|
+
estimatedDuration: 60,
|
|
33
|
+
capabilities: {
|
|
34
|
+
supportsRerun: true,
|
|
35
|
+
supportsBulkActions: true,
|
|
36
|
+
},
|
|
37
|
+
executor: async (input, context) => {
|
|
38
|
+
try {
|
|
39
|
+
// Require Anthropic service
|
|
40
|
+
if (!context.services?.anthropic) {
|
|
41
|
+
return {
|
|
42
|
+
success: false,
|
|
43
|
+
error: 'Anthropic service not configured. Please provide context.services.anthropic.',
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
// Combine posts from all platforms
|
|
47
|
+
const allPosts = [
|
|
48
|
+
...(input.twitterPosts || []),
|
|
49
|
+
...(input.redditPosts || []),
|
|
50
|
+
...(input.linkedinPosts || []),
|
|
51
|
+
...(input.posts || []),
|
|
52
|
+
];
|
|
53
|
+
if (allPosts.length === 0) {
|
|
54
|
+
return {
|
|
55
|
+
success: true,
|
|
56
|
+
output: {
|
|
57
|
+
analyzedPosts: [],
|
|
58
|
+
highPriorityPosts: [],
|
|
59
|
+
complaints: [],
|
|
60
|
+
totalAnalyzed: 0,
|
|
61
|
+
highPriorityCount: 0,
|
|
62
|
+
complaintCount: 0,
|
|
63
|
+
averageRelevance: 0,
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
// Batch posts for Claude (to stay within context limits)
|
|
68
|
+
const allAnalyzedPosts = [];
|
|
69
|
+
for (let i = 0; i < allPosts.length; i += ANALYSIS_BATCH_SIZE) {
|
|
70
|
+
const batch = allPosts.slice(i, i + ANALYSIS_BATCH_SIZE);
|
|
71
|
+
const prompt = buildAnalysisPrompt(input.topic, input.userIntent, batch);
|
|
72
|
+
const responseText = await context.services.anthropic.generateText({
|
|
73
|
+
prompt,
|
|
74
|
+
model: 'claude-sonnet-4-20250514',
|
|
75
|
+
maxTokens: 4000,
|
|
76
|
+
});
|
|
77
|
+
// Parse JSON from response
|
|
78
|
+
const jsonMatch = responseText.match(/\[[\s\S]*\]/);
|
|
79
|
+
if (!jsonMatch) {
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
try {
|
|
83
|
+
const analyzed = JSON.parse(jsonMatch[0]);
|
|
84
|
+
// Merge analysis with original post data
|
|
85
|
+
for (const analysis of analyzed) {
|
|
86
|
+
const originalPost = batch.find((p) => p.id === analysis.id);
|
|
87
|
+
if (originalPost && analysis.relevanceScore >= MIN_RELEVANCE_SCORE) {
|
|
88
|
+
allAnalyzedPosts.push({
|
|
89
|
+
...originalPost,
|
|
90
|
+
relevanceScore: analysis.relevanceScore,
|
|
91
|
+
sentiment: normalizeSentiment(analysis.sentiment),
|
|
92
|
+
isComplaint: Boolean(analysis.isComplaint),
|
|
93
|
+
urgencyLevel: normalizeUrgency(analysis.urgencyLevel),
|
|
94
|
+
aiSummary: analysis.aiSummary || '',
|
|
95
|
+
matchedKeywords: analysis.matchedKeywords || [],
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
catch {
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
// Sort by relevance (highest first)
|
|
105
|
+
allAnalyzedPosts.sort((a, b) => b.relevanceScore - a.relevanceScore);
|
|
106
|
+
// Filter high priority and complaints
|
|
107
|
+
const highPriorityPosts = allAnalyzedPosts.filter((p) => p.urgencyLevel === 'high' || p.relevanceScore >= 80);
|
|
108
|
+
const complaints = allAnalyzedPosts.filter((p) => p.isComplaint);
|
|
109
|
+
// Calculate average relevance
|
|
110
|
+
const averageRelevance = allAnalyzedPosts.length > 0
|
|
111
|
+
? Math.round(allAnalyzedPosts.reduce((sum, p) => sum + p.relevanceScore, 0) /
|
|
112
|
+
allAnalyzedPosts.length)
|
|
113
|
+
: 0;
|
|
114
|
+
// Store analyzed posts if service available
|
|
115
|
+
if (context.services?.analyzedPosts && input.monitoringConfigId && allAnalyzedPosts.length > 0) {
|
|
116
|
+
await context.services.analyzedPosts.storePosts({
|
|
117
|
+
monitoringConfigId: input.monitoringConfigId,
|
|
118
|
+
posts: allAnalyzedPosts.map(post => ({
|
|
119
|
+
platform: post.platform,
|
|
120
|
+
externalId: post.id,
|
|
121
|
+
url: post.url,
|
|
122
|
+
text: post.text,
|
|
123
|
+
authorName: post.authorName,
|
|
124
|
+
authorHandle: post.authorHandle,
|
|
125
|
+
authorUrl: post.authorUrl,
|
|
126
|
+
authorFollowers: post.authorFollowers,
|
|
127
|
+
engagement: post.engagement,
|
|
128
|
+
relevanceScore: post.relevanceScore,
|
|
129
|
+
sentiment: post.sentiment,
|
|
130
|
+
isComplaint: post.isComplaint,
|
|
131
|
+
urgencyLevel: post.urgencyLevel,
|
|
132
|
+
aiSummary: post.aiSummary,
|
|
133
|
+
matchedKeywords: post.matchedKeywords,
|
|
134
|
+
postedAt: new Date(post.postedAt),
|
|
135
|
+
})),
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
// Optional: send notification if service available
|
|
139
|
+
if (context.services?.notifications && allAnalyzedPosts.length > 0) {
|
|
140
|
+
await context.services.notifications.send({
|
|
141
|
+
userId: context.userId,
|
|
142
|
+
title: 'Social Posts Analyzed',
|
|
143
|
+
message: `Analyzed ${allAnalyzedPosts.length} posts (${highPriorityPosts.length} high priority)`,
|
|
144
|
+
data: {
|
|
145
|
+
totalAnalyzed: allAnalyzedPosts.length,
|
|
146
|
+
highPriority: highPriorityPosts.length,
|
|
147
|
+
complaints: complaints.length,
|
|
148
|
+
},
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
return {
|
|
152
|
+
success: true,
|
|
153
|
+
output: {
|
|
154
|
+
analyzedPosts: allAnalyzedPosts,
|
|
155
|
+
highPriorityPosts,
|
|
156
|
+
complaints,
|
|
157
|
+
totalAnalyzed: allAnalyzedPosts.length,
|
|
158
|
+
highPriorityCount: highPriorityPosts.length,
|
|
159
|
+
complaintCount: complaints.length,
|
|
160
|
+
averageRelevance,
|
|
161
|
+
},
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
catch (error) {
|
|
165
|
+
return {
|
|
166
|
+
success: false,
|
|
167
|
+
error: error instanceof Error ? error.message : 'Failed to analyze posts',
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
});
|
|
172
|
+
//# sourceMappingURL=analyze-posts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analyze-posts.js","sourceRoot":"","sources":["../../src/ai/analyze-posts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EACL,0BAA0B,EAC1B,2BAA2B,GAG5B,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,0BAA0B,CAAC;AAElC,8CAA8C;AAC9C,OAAO,EACL,0BAA0B,EAC1B,2BAA2B,GAK5B,MAAM,eAAe,CAAC;AAEvB;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,UAAU,CAAC;IAC5C,IAAI,EAAE,mBAAmB;IACzB,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE,2EAA2E;IACxF,QAAQ,EAAE,QAAQ;IAClB,WAAW,EAAE,0BAA0B;IACvC,YAAY,EAAE,2BAA2B;IACzC,iBAAiB,EAAE,EAAE;IACrB,YAAY,EAAE;QACZ,aAAa,EAAE,IAAI;QACnB,mBAAmB,EAAE,IAAI;KAC1B;IAED,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;QACjC,IAAI,CAAC;YACH,4BAA4B;YAC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CAAC,yBAAyB;aAC1E,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export { DraftEmailsInputSchema, DraftEmailsOutputSchema, DraftEmailInfoSchema, ContactSchema, type DraftEmailsInput, type DraftEmailsOutput, type DraftEmailInfo, type Contact, } from '../schemas/ai';
|
|
2
|
+
/**
|
|
3
|
+
* Draft Emails Node
|
|
4
|
+
*
|
|
5
|
+
* Uses Claude to generate personalized email drafts for each contact.
|
|
6
|
+
* Requires `context.services.anthropic` for AI generation and
|
|
7
|
+
* `context.services.emailDrafts` for storing drafts.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* const result = await draftEmailsNode.executor({
|
|
12
|
+
* contacts: [{ id: '1', name: 'John', email: 'john@acme.com', title: 'CTO', company: 'Acme' }],
|
|
13
|
+
* productDescription: 'AI-powered SEO tool'
|
|
14
|
+
* }, context);
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export declare const draftEmailsNode: import("@jam-nodes/core").NodeDefinition<{
|
|
18
|
+
contacts: {
|
|
19
|
+
id: string;
|
|
20
|
+
title: string;
|
|
21
|
+
company: string;
|
|
22
|
+
name: string;
|
|
23
|
+
email: string;
|
|
24
|
+
}[];
|
|
25
|
+
productDescription: string;
|
|
26
|
+
emailTemplate?: string | undefined;
|
|
27
|
+
subject?: string | undefined;
|
|
28
|
+
approval?: {
|
|
29
|
+
required: boolean;
|
|
30
|
+
message?: string | undefined;
|
|
31
|
+
} | undefined;
|
|
32
|
+
}, {
|
|
33
|
+
emails: {
|
|
34
|
+
status: string;
|
|
35
|
+
body: string;
|
|
36
|
+
id: string;
|
|
37
|
+
subject: string;
|
|
38
|
+
toEmail: string;
|
|
39
|
+
toName: string;
|
|
40
|
+
toCompany: string;
|
|
41
|
+
toTitle: string;
|
|
42
|
+
}[];
|
|
43
|
+
draftedCount: number;
|
|
44
|
+
}>;
|
|
45
|
+
//# sourceMappingURL=draft-emails.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"draft-emails.d.ts","sourceRoot":"","sources":["../../src/ai/draft-emails.ts"],"names":[],"mappings":"AAeA,OAAO,EACL,sBAAsB,EACtB,uBAAuB,EACvB,oBAAoB,EACpB,aAAa,EACb,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,OAAO,GACb,MAAM,eAAe,CAAC;AAEvB;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmI1B,CAAC"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { defineNode } from '@jam-nodes/core';
|
|
2
|
+
import { DraftEmailsInputSchema, DraftEmailsOutputSchema, } from '../schemas/ai';
|
|
3
|
+
import { buildEmailPrompt, buildSubjectPrompt, cleanEmailBody, cleanSubjectLine, } from '../prompts/draft-emails';
|
|
4
|
+
// Re-export schemas for convenience
|
|
5
|
+
export { DraftEmailsInputSchema, DraftEmailsOutputSchema, DraftEmailInfoSchema, ContactSchema, } from '../schemas/ai';
|
|
6
|
+
/**
|
|
7
|
+
* Draft Emails Node
|
|
8
|
+
*
|
|
9
|
+
* Uses Claude to generate personalized email drafts for each contact.
|
|
10
|
+
* Requires `context.services.anthropic` for AI generation and
|
|
11
|
+
* `context.services.emailDrafts` for storing drafts.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* const result = await draftEmailsNode.executor({
|
|
16
|
+
* contacts: [{ id: '1', name: 'John', email: 'john@acme.com', title: 'CTO', company: 'Acme' }],
|
|
17
|
+
* productDescription: 'AI-powered SEO tool'
|
|
18
|
+
* }, context);
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export const draftEmailsNode = defineNode({
|
|
22
|
+
type: 'draft_emails',
|
|
23
|
+
name: 'Draft Emails',
|
|
24
|
+
description: 'Generate personalized email drafts for contacts using AI',
|
|
25
|
+
category: 'action',
|
|
26
|
+
inputSchema: DraftEmailsInputSchema,
|
|
27
|
+
outputSchema: DraftEmailsOutputSchema,
|
|
28
|
+
estimatedDuration: 30,
|
|
29
|
+
capabilities: {
|
|
30
|
+
supportsRerun: true,
|
|
31
|
+
supportsBulkActions: true,
|
|
32
|
+
},
|
|
33
|
+
executor: async (input, context) => {
|
|
34
|
+
try {
|
|
35
|
+
// Require Anthropic service
|
|
36
|
+
if (!context.services?.anthropic) {
|
|
37
|
+
return {
|
|
38
|
+
success: false,
|
|
39
|
+
error: 'Anthropic service not configured. Please provide context.services.anthropic.',
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
// Require email drafts service
|
|
43
|
+
if (!context.services?.emailDrafts) {
|
|
44
|
+
return {
|
|
45
|
+
success: false,
|
|
46
|
+
error: 'Email drafts service not configured. Please provide context.services.emailDrafts.',
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
if (!context.campaignId) {
|
|
50
|
+
return {
|
|
51
|
+
success: false,
|
|
52
|
+
error: 'Campaign ID is required in execution context',
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
// Get sender name from workflow variables
|
|
56
|
+
const senderName = context.variables['senderName'];
|
|
57
|
+
if (!senderName) {
|
|
58
|
+
return {
|
|
59
|
+
success: false,
|
|
60
|
+
error: 'Please set your name in settings before creating email campaigns.',
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
const emails = [];
|
|
64
|
+
// Generate and save drafts for each contact
|
|
65
|
+
for (const contact of input.contacts) {
|
|
66
|
+
if (!contact.email) {
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
try {
|
|
70
|
+
// Generate personalized email body using prompt helper
|
|
71
|
+
const emailPrompt = buildEmailPrompt(contact, input.productDescription, senderName, input.emailTemplate);
|
|
72
|
+
const rawBody = await context.services.anthropic.generateText({
|
|
73
|
+
prompt: emailPrompt,
|
|
74
|
+
model: 'claude-sonnet-4-20250514',
|
|
75
|
+
maxTokens: 250,
|
|
76
|
+
});
|
|
77
|
+
// Clean up the email body
|
|
78
|
+
const emailBody = cleanEmailBody(rawBody);
|
|
79
|
+
// Generate subject line
|
|
80
|
+
const subjectPrompt = buildSubjectPrompt(contact, emailBody);
|
|
81
|
+
const rawSubject = await context.services.anthropic.generateText({
|
|
82
|
+
prompt: subjectPrompt,
|
|
83
|
+
model: 'claude-sonnet-4-20250514',
|
|
84
|
+
maxTokens: 50,
|
|
85
|
+
});
|
|
86
|
+
// Clean up subject
|
|
87
|
+
const emailSubject = cleanSubjectLine(rawSubject);
|
|
88
|
+
// Save to database via service
|
|
89
|
+
const savedEmail = await context.services.emailDrafts.createDraft({
|
|
90
|
+
campaignId: context.campaignId,
|
|
91
|
+
userId: context.userId,
|
|
92
|
+
toEmail: contact.email,
|
|
93
|
+
toName: contact.name,
|
|
94
|
+
toCompany: contact.company,
|
|
95
|
+
toTitle: contact.title,
|
|
96
|
+
subject: emailSubject,
|
|
97
|
+
body: emailBody,
|
|
98
|
+
contactId: contact.id,
|
|
99
|
+
});
|
|
100
|
+
emails.push({
|
|
101
|
+
id: savedEmail.id,
|
|
102
|
+
toEmail: savedEmail.toEmail,
|
|
103
|
+
toName: savedEmail.toName || '',
|
|
104
|
+
toCompany: savedEmail.toCompany || '',
|
|
105
|
+
toTitle: savedEmail.toTitle || '',
|
|
106
|
+
subject: savedEmail.subject,
|
|
107
|
+
body: savedEmail.body,
|
|
108
|
+
status: savedEmail.status,
|
|
109
|
+
});
|
|
110
|
+
// Small delay between API calls to avoid rate limiting
|
|
111
|
+
await new Promise(resolve => setTimeout(resolve, 200));
|
|
112
|
+
}
|
|
113
|
+
catch {
|
|
114
|
+
// Continue with other contacts even if one fails
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
const output = {
|
|
118
|
+
emails,
|
|
119
|
+
draftedCount: emails.length,
|
|
120
|
+
};
|
|
121
|
+
return {
|
|
122
|
+
success: true,
|
|
123
|
+
output,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
catch (error) {
|
|
127
|
+
return {
|
|
128
|
+
success: false,
|
|
129
|
+
error: error instanceof Error ? error.message : 'Failed to draft emails',
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
});
|
|
134
|
+
//# sourceMappingURL=draft-emails.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"draft-emails.js","sourceRoot":"","sources":["../../src/ai/draft-emails.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EACL,sBAAsB,EACtB,uBAAuB,GAGxB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,gBAAgB,GACjB,MAAM,yBAAyB,CAAC;AAEjC,oCAAoC;AACpC,OAAO,EACL,sBAAsB,EACtB,uBAAuB,EACvB,oBAAoB,EACpB,aAAa,GAKd,MAAM,eAAe,CAAC;AAEvB;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,UAAU,CAAC;IACxC,IAAI,EAAE,cAAc;IACpB,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,0DAA0D;IACvE,QAAQ,EAAE,QAAQ;IAClB,WAAW,EAAE,sBAAsB;IACnC,YAAY,EAAE,uBAAuB;IACrC,iBAAiB,EAAE,EAAE;IACrB,YAAY,EAAE;QACZ,aAAa,EAAE,IAAI;QACnB,mBAAmB,EAAE,IAAI;KAC1B;IAED,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;QACjC,IAAI,CAAC;YACH,4BAA4B;YAC5B,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,SAAS,EAAE,CAAC;gBACjC,OAAO;oBACL,OAAO,EAAE,KAAK;oBACd,KAAK,EAAE,8EAA8E;iBACtF,CA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AED,MAAM,MAAM,GAAsB;gBAChC,MAAM;gBACN,YAAY,EAAE,MAAM,CAAC,MAAM;aAC5B,CAAC;YAEF,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,MAAM;aACP,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,wBAAwB;aACzE,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { socialKeywordGeneratorNode, SocialKeywordGeneratorInputSchema, SocialKeywordGeneratorOutputSchema, type SocialKeywordGeneratorInput, type SocialKeywordGeneratorOutput, } from './keyword-generator';
|
|
2
|
+
export { draftEmailsNode, DraftEmailsInputSchema, DraftEmailsOutputSchema, DraftEmailInfoSchema, ContactSchema, type DraftEmailsInput, type DraftEmailsOutput, type DraftEmailInfo, type Contact, } from './draft-emails';
|
|
3
|
+
export { socialAiAnalyzeNode, SocialAiAnalyzeInputSchema, SocialAiAnalyzeOutputSchema, type SocialAiAnalyzeInput, type SocialAiAnalyzeOutput, type SocialPost, type AnalyzedPost, } from './analyze-posts';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ai/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,0BAA0B,EAC1B,iCAAiC,EACjC,kCAAkC,EAClC,KAAK,2BAA2B,EAChC,KAAK,4BAA4B,GAClC,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,eAAe,EACf,sBAAsB,EACtB,uBAAuB,EACvB,oBAAoB,EACpB,aAAa,EACb,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,OAAO,GACb,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,mBAAmB,EACnB,0BAA0B,EAC1B,2BAA2B,EAC3B,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,UAAU,EACf,KAAK,YAAY,GAClB,MAAM,iBAAiB,CAAC"}
|
package/dist/ai/index.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { socialKeywordGeneratorNode, SocialKeywordGeneratorInputSchema, SocialKeywordGeneratorOutputSchema, } from './keyword-generator';
|
|
2
|
+
export { draftEmailsNode, DraftEmailsInputSchema, DraftEmailsOutputSchema, DraftEmailInfoSchema, ContactSchema, } from './draft-emails';
|
|
3
|
+
export { socialAiAnalyzeNode, SocialAiAnalyzeInputSchema, SocialAiAnalyzeOutputSchema, } from './analyze-posts';
|
|
4
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ai/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,0BAA0B,EAC1B,iCAAiC,EACjC,kCAAkC,GAGnC,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,eAAe,EACf,sBAAsB,EACtB,uBAAuB,EACvB,oBAAoB,EACpB,aAAa,GAKd,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,mBAAmB,EACnB,0BAA0B,EAC1B,2BAA2B,GAK5B,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export { SocialKeywordGeneratorInputSchema, SocialKeywordGeneratorOutputSchema, type SocialKeywordGeneratorInput, type SocialKeywordGeneratorOutput, } from '../schemas/ai';
|
|
2
|
+
/**
|
|
3
|
+
* Social Keyword Generator Node
|
|
4
|
+
*
|
|
5
|
+
* Uses Claude to generate platform-specific search keywords from a user's
|
|
6
|
+
* natural language topic description. Outputs ready-to-use search queries
|
|
7
|
+
* for Twitter, Reddit, and LinkedIn.
|
|
8
|
+
*
|
|
9
|
+
* Requires `context.services.anthropic` to be provided by the host application.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* const result = await socialKeywordGeneratorNode.executor({
|
|
14
|
+
* topic: 'People frustrated with project management tools',
|
|
15
|
+
* userKeywords: ['asana', 'monday.com']
|
|
16
|
+
* }, context);
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export declare const socialKeywordGeneratorNode: import("@jam-nodes/core").NodeDefinition<{
|
|
20
|
+
topic: string;
|
|
21
|
+
userKeywords?: string[] | undefined;
|
|
22
|
+
}, {
|
|
23
|
+
reddit: {
|
|
24
|
+
keywords: string[];
|
|
25
|
+
};
|
|
26
|
+
twitter: {
|
|
27
|
+
keywords: string[];
|
|
28
|
+
searchQuery: string;
|
|
29
|
+
};
|
|
30
|
+
linkedin: {
|
|
31
|
+
keywords: string[];
|
|
32
|
+
searchQueries: string[];
|
|
33
|
+
};
|
|
34
|
+
topic: string;
|
|
35
|
+
allKeywords: string[];
|
|
36
|
+
}>;
|
|
37
|
+
//# sourceMappingURL=keyword-generator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keyword-generator.d.ts","sourceRoot":"","sources":["../../src/ai/keyword-generator.ts"],"names":[],"mappings":"AASA,OAAO,EACL,iCAAiC,EACjC,kCAAkC,EAClC,KAAK,2BAA2B,EAChC,KAAK,4BAA4B,GAClC,MAAM,eAAe,CAAC;AAEvB;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;EAmHrC,CAAC"}
|