social-agent-cli 1.0.3 → 1.0.4
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/bin/social-agent.js +11 -9
- package/cli.ts +2 -0
- package/maps/linkedin_linkedin_post.json +66 -0
- package/maps/linkedin_linkedin_send_connection_request.json +37 -0
- package/maps/linkedin_post.json +70 -0
- package/maps/x.json +69 -0
- package/maps/x_post.json +64 -0
- package/maps/x_tweet_be/304/237enmeyi_/303/266/304/237ren.json +39 -0
- package/maps/x_tweet_retweet_/303/266/304/237ren.json +46 -0
- package/package.json +2 -1
package/bin/social-agent.js
CHANGED
|
@@ -17,15 +17,17 @@ for (const dir of ["maps", "profiles", "screenshots", "knowledge"]) {
|
|
|
17
17
|
mkdirSync(join(DATA_DIR, dir), { recursive: true });
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
// Knowledge dosyalarını kopyala (yoksa)
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
20
|
+
// Knowledge ve default map dosyalarını kopyala (yoksa)
|
|
21
|
+
const { readdirSync, copyFileSync } = await import("node:fs");
|
|
22
|
+
for (const dirName of ["knowledge", "maps"]) {
|
|
23
|
+
const src = join(PKG_DIR, dirName);
|
|
24
|
+
const dest = join(DATA_DIR, dirName);
|
|
25
|
+
if (existsSync(src)) {
|
|
26
|
+
for (const file of readdirSync(src)) {
|
|
27
|
+
const destFile = join(dest, file);
|
|
28
|
+
if (!existsSync(destFile)) {
|
|
29
|
+
copyFileSync(join(src, file), destFile);
|
|
30
|
+
}
|
|
29
31
|
}
|
|
30
32
|
}
|
|
31
33
|
}
|
package/cli.ts
CHANGED
|
@@ -42,6 +42,7 @@ async function cmdLogin(platform: string) {
|
|
|
42
42
|
}
|
|
43
43
|
const driver = new BrowserDriver(platform, url);
|
|
44
44
|
await driver.login();
|
|
45
|
+
process.exit(0);
|
|
45
46
|
}
|
|
46
47
|
|
|
47
48
|
async function cmdLearn(taskDescription: string, platform: string) {
|
|
@@ -66,6 +67,7 @@ async function cmdLearn(taskDescription: string, platform: string) {
|
|
|
66
67
|
for (const [i, step] of map.steps.entries()) {
|
|
67
68
|
console.log(` ${i + 1}. [${step.action}] ${step.description} → ${step.selector || step.url || ""}`);
|
|
68
69
|
}
|
|
70
|
+
process.exit(0);
|
|
69
71
|
}
|
|
70
72
|
|
|
71
73
|
async function cmdPost(content: string, platforms?: string[], imagePaths?: string[]) {
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"platform": "linkedin",
|
|
3
|
+
"version": 1,
|
|
4
|
+
"action": "linkedin_post",
|
|
5
|
+
"description": "LinkedIn platformunda metin içerikli post paylaşma",
|
|
6
|
+
"lastUpdated": "2026-03-14T11:33:00.454Z",
|
|
7
|
+
"parameters": [
|
|
8
|
+
"{{CONTENT}}"
|
|
9
|
+
],
|
|
10
|
+
"steps": [
|
|
11
|
+
{
|
|
12
|
+
"action": "goto",
|
|
13
|
+
"description": "LinkedIn ana sayfasına git",
|
|
14
|
+
"url": "https://www.linkedin.com/feed/"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"action": "wait",
|
|
18
|
+
"description": "Sayfanın yüklenmesini bekle",
|
|
19
|
+
"waitMs": 3000
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"action": "click",
|
|
23
|
+
"description": "Gönderi oluşturma kutusuna tıkla",
|
|
24
|
+
"selector": "button.rBknNMyPiauEsphJukuFITVzZCRzAenPRs",
|
|
25
|
+
"fallbackSelectors": [
|
|
26
|
+
".share-box-feed-entry__top-bar button.artdeco-button--tertiary",
|
|
27
|
+
"button[class*='share-box-feed-entry']"
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"action": "wait",
|
|
32
|
+
"description": "Post oluşturma modalının açılmasını bekle",
|
|
33
|
+
"waitMs": 2000
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"action": "type",
|
|
37
|
+
"description": "Post içeriğini yaz",
|
|
38
|
+
"selector": "div.ql-editor[role='textbox']",
|
|
39
|
+
"fallbackSelectors": [
|
|
40
|
+
"div[aria-label='Metin Düzenleyici']",
|
|
41
|
+
"div.editor-content div[contenteditable='true']",
|
|
42
|
+
"div[data-placeholder='Ne hakkında konuşmak istiyorsunuz?']"
|
|
43
|
+
],
|
|
44
|
+
"value": "{{CONTENT}}"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"action": "wait",
|
|
48
|
+
"description": "İçeriğin yazılmasını bekle",
|
|
49
|
+
"waitMs": 1000
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"action": "click",
|
|
53
|
+
"description": "Gönder butonuna tıkla",
|
|
54
|
+
"selector": "button.share-actions__primary-action",
|
|
55
|
+
"fallbackSelectors": [
|
|
56
|
+
"button[aria-label='Gönderi paylaş']",
|
|
57
|
+
"button.artdeco-button--primary[class*='share-actions']"
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"action": "wait",
|
|
62
|
+
"description": "Gönderinin paylaşılmasını bekle",
|
|
63
|
+
"waitMs": 3000
|
|
64
|
+
}
|
|
65
|
+
]
|
|
66
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"platform": "linkedin",
|
|
3
|
+
"version": 1,
|
|
4
|
+
"action": "linkedin_send_connection_request",
|
|
5
|
+
"description": "LinkedIn mynetwork/grow sayfasından bir kişiye bağlantı isteği gönderme",
|
|
6
|
+
"lastUpdated": "2026-03-14T11:44:38.451Z",
|
|
7
|
+
"parameters": [
|
|
8
|
+
"{{USERNAME}}"
|
|
9
|
+
],
|
|
10
|
+
"steps": [
|
|
11
|
+
{
|
|
12
|
+
"action": "goto",
|
|
13
|
+
"description": "LinkedIn Ağım/Grow sayfasına git",
|
|
14
|
+
"url": "https://www.linkedin.com/mynetwork/grow/"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"action": "wait",
|
|
18
|
+
"description": "Sayfa ve öneri kartlarının yüklenmesini bekle",
|
|
19
|
+
"waitMs": 3000
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"action": "click",
|
|
23
|
+
"description": "{{USERNAME}} kişisinin bağlantı kurma (Connect) butonuna tıkla",
|
|
24
|
+
"selector": "button[aria-label*='{{USERNAME}}'][aria-label*='bağlantı' i]",
|
|
25
|
+
"fallbackSelectors": [
|
|
26
|
+
"button[aria-label*='{{USERNAME}}'][aria-label*='Connect' i]",
|
|
27
|
+
"button[aria-label*='{{USERNAME}}'][aria-label*='Invite' i]",
|
|
28
|
+
"//button[contains(@aria-label,'{{USERNAME}}') and (contains(@aria-label,'bağlantı') or contains(@aria-label,'Connect'))]"
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"action": "wait",
|
|
33
|
+
"description": "Bağlantı isteği gönderilmesini veya modal açılmasını bekle",
|
|
34
|
+
"waitMs": 2000
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
{
|
|
2
|
+
"platform": "linkedin",
|
|
3
|
+
"action": "post",
|
|
4
|
+
"description": "LinkedIn üzerinden yeni bir metin postu paylaşma",
|
|
5
|
+
"version": 1,
|
|
6
|
+
"lastUpdated": "2026-03-14T12:00:00.000Z",
|
|
7
|
+
"parameters": ["{{CONTENT}}"],
|
|
8
|
+
"steps": [
|
|
9
|
+
{
|
|
10
|
+
"action": "click",
|
|
11
|
+
"description": "Gönderi oluştur kutusuna tıkla",
|
|
12
|
+
"selector": "button.share-box-feed-entry__trigger",
|
|
13
|
+
"fallbackSelectors": [
|
|
14
|
+
"[aria-label*='Start a post']",
|
|
15
|
+
"[aria-label*='Gönderi başlat']",
|
|
16
|
+
"button[aria-label*='post']",
|
|
17
|
+
".share-box-feed-entry__trigger"
|
|
18
|
+
]
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"action": "wait",
|
|
22
|
+
"description": "Post oluşturma modalının açılmasını bekle",
|
|
23
|
+
"waitMs": 1500
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"action": "click",
|
|
27
|
+
"description": "Metin alanına tıkla",
|
|
28
|
+
"selector": "[role='textbox'][aria-label*='Text editor']",
|
|
29
|
+
"fallbackSelectors": [
|
|
30
|
+
"[role='textbox'][contenteditable='true']",
|
|
31
|
+
".ql-editor[contenteditable='true']",
|
|
32
|
+
"[aria-label*='Metin düzenleyici']",
|
|
33
|
+
"[data-placeholder*='What do you want']",
|
|
34
|
+
"[data-placeholder*='Ne hakkında']"
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"action": "type",
|
|
39
|
+
"description": "Post metnini yaz",
|
|
40
|
+
"selector": "[role='textbox'][aria-label*='Text editor']",
|
|
41
|
+
"value": "{{CONTENT}}",
|
|
42
|
+
"fallbackSelectors": [
|
|
43
|
+
"[role='textbox'][contenteditable='true']",
|
|
44
|
+
".ql-editor[contenteditable='true']"
|
|
45
|
+
]
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"action": "wait",
|
|
49
|
+
"description": "Metin girişi sonrası bekleme",
|
|
50
|
+
"waitMs": 1000
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"action": "click",
|
|
54
|
+
"description": "Gönder butonuna tıkla",
|
|
55
|
+
"selector": "button.share-actions__primary-action",
|
|
56
|
+
"fallbackSelectors": [
|
|
57
|
+
"[aria-label='Post']",
|
|
58
|
+
"[aria-label='Gönder']",
|
|
59
|
+
"button[aria-label*='Post']",
|
|
60
|
+
"button[aria-label*='Paylaş']",
|
|
61
|
+
"button.artdeco-button--primary[type='button']"
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"action": "wait",
|
|
66
|
+
"description": "Post gönderimini bekle",
|
|
67
|
+
"waitMs": 2000
|
|
68
|
+
}
|
|
69
|
+
]
|
|
70
|
+
}
|
package/maps/x.json
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"platform": "x",
|
|
3
|
+
"version": 1,
|
|
4
|
+
"lastUpdated": "2026-03-14T11:09:04.533Z",
|
|
5
|
+
"steps": [
|
|
6
|
+
{
|
|
7
|
+
"action": "click",
|
|
8
|
+
"description": "Click the new post button in the sidebar",
|
|
9
|
+
"selector": "[data-testid='SideNav_NewTweet_Button']",
|
|
10
|
+
"fallbackSelectors": [
|
|
11
|
+
"a[href='/compose/post']",
|
|
12
|
+
"[aria-label*='Gönder'][role='link']",
|
|
13
|
+
"nav [role='link']:last-child"
|
|
14
|
+
]
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"action": "wait",
|
|
18
|
+
"description": "Wait for the compose dialog to appear",
|
|
19
|
+
"waitMs": 1500,
|
|
20
|
+
"selector": "[data-testid='tweetTextarea_0']",
|
|
21
|
+
"fallbackSelectors": [
|
|
22
|
+
"[role='dialog'] [contenteditable='true']",
|
|
23
|
+
".public-DraftEditor-content",
|
|
24
|
+
"[data-testid='toolBar'] ~ div [contenteditable]"
|
|
25
|
+
]
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"action": "click",
|
|
29
|
+
"description": "Focus the text input area",
|
|
30
|
+
"selector": "[data-testid='tweetTextarea_0']",
|
|
31
|
+
"fallbackSelectors": [
|
|
32
|
+
"[role='dialog'] [contenteditable='true']",
|
|
33
|
+
".public-DraftEditor-content",
|
|
34
|
+
"[data-testid='tweetTextarea_0RichTextInputContainer'] [contenteditable]"
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"action": "type",
|
|
39
|
+
"description": "Type the post content",
|
|
40
|
+
"selector": "[data-testid='tweetTextarea_0']",
|
|
41
|
+
"value": "{{CONTENT}}",
|
|
42
|
+
"fallbackSelectors": [
|
|
43
|
+
"[role='dialog'] [contenteditable='true']",
|
|
44
|
+
".public-DraftEditor-content",
|
|
45
|
+
"[data-testid='tweetTextarea_0RichTextInputContainer'] [contenteditable]"
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"action": "wait",
|
|
50
|
+
"description": "Wait for content to be entered",
|
|
51
|
+
"waitMs": 500
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"action": "click",
|
|
55
|
+
"description": "Click the Post/Gönder button to submit",
|
|
56
|
+
"selector": "[data-testid='tweetButton']",
|
|
57
|
+
"fallbackSelectors": [
|
|
58
|
+
"[data-testid='tweetButtonInline']",
|
|
59
|
+
"[role='dialog'] [role='button'][data-testid='tweetButton']",
|
|
60
|
+
"button[type='button'] span span:has-text('Gönder')"
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"action": "wait",
|
|
65
|
+
"description": "Wait for post to be submitted",
|
|
66
|
+
"waitMs": 2000
|
|
67
|
+
}
|
|
68
|
+
]
|
|
69
|
+
}
|
package/maps/x_post.json
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"platform": "x",
|
|
3
|
+
"action": "post",
|
|
4
|
+
"description": "X (Twitter) üzerinden yeni bir metin postu paylaşma",
|
|
5
|
+
"version": 1,
|
|
6
|
+
"lastUpdated": "2026-03-14T12:00:00.000Z",
|
|
7
|
+
"parameters": ["{{CONTENT}}"],
|
|
8
|
+
"steps": [
|
|
9
|
+
{
|
|
10
|
+
"action": "click",
|
|
11
|
+
"description": "Sidebar'daki post butonuna tıkla",
|
|
12
|
+
"selector": "[data-testid='SideNav_NewTweet_Button']",
|
|
13
|
+
"fallbackSelectors": [
|
|
14
|
+
"a[href='/compose/post']",
|
|
15
|
+
"[aria-label*='Post'][role='link']",
|
|
16
|
+
"[aria-label*='Gönder'][role='link']"
|
|
17
|
+
]
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"action": "wait",
|
|
21
|
+
"description": "Compose dialog açılmasını bekle",
|
|
22
|
+
"waitMs": 1500
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"action": "click",
|
|
26
|
+
"description": "Metin alanına tıkla",
|
|
27
|
+
"selector": "[data-testid='tweetTextarea_0']",
|
|
28
|
+
"fallbackSelectors": [
|
|
29
|
+
"[role='textbox'][contenteditable='true']",
|
|
30
|
+
".public-DraftEditor-content",
|
|
31
|
+
"[data-testid='tweetTextarea_0RichTextInputContainer'] [contenteditable]"
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"action": "type",
|
|
36
|
+
"description": "Post metnini yaz",
|
|
37
|
+
"selector": "[data-testid='tweetTextarea_0']",
|
|
38
|
+
"value": "{{CONTENT}}",
|
|
39
|
+
"fallbackSelectors": [
|
|
40
|
+
"[role='textbox'][contenteditable='true']",
|
|
41
|
+
".public-DraftEditor-content"
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"action": "wait",
|
|
46
|
+
"description": "Metin girişi sonrası bekleme",
|
|
47
|
+
"waitMs": 500
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"action": "click",
|
|
51
|
+
"description": "Gönder butonuna tıkla",
|
|
52
|
+
"selector": "[data-testid='tweetButton']",
|
|
53
|
+
"fallbackSelectors": [
|
|
54
|
+
"[data-testid='tweetButtonInline']",
|
|
55
|
+
"[role='button'][data-testid*='tweet']"
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"action": "wait",
|
|
60
|
+
"description": "Post gönderimini bekle",
|
|
61
|
+
"waitMs": 2000
|
|
62
|
+
}
|
|
63
|
+
]
|
|
64
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"platform": "x",
|
|
3
|
+
"version": 1,
|
|
4
|
+
"lastUpdated": "2026-03-14T11:21:59.765Z",
|
|
5
|
+
"action": "tweet_beğenmeyi_öğren",
|
|
6
|
+
"description": "tweet beğenmeyi öğren",
|
|
7
|
+
"parameters": [
|
|
8
|
+
"{{TWEET_URL}}"
|
|
9
|
+
],
|
|
10
|
+
"steps": [
|
|
11
|
+
{
|
|
12
|
+
"action": "goto",
|
|
13
|
+
"description": "Beğenilecek tweet'in sayfasına git",
|
|
14
|
+
"url": "{{TWEET_URL}}",
|
|
15
|
+
"fallbackSelectors": []
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"action": "wait",
|
|
19
|
+
"description": "Tweet içeriğinin yüklenmesini bekle",
|
|
20
|
+
"waitMs": 2000,
|
|
21
|
+
"fallbackSelectors": []
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"action": "click",
|
|
25
|
+
"description": "Tweet'in altındaki beğen (kalp) butonuna tıkla",
|
|
26
|
+
"selector": "[data-testid=\"like\"]",
|
|
27
|
+
"fallbackSelectors": [
|
|
28
|
+
"[aria-label*=\"Beğen\"]",
|
|
29
|
+
"button[role=\"button\"] svg[viewBox=\"0 0 24 24\"]"
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"action": "wait",
|
|
34
|
+
"description": "Beğeni animasyonunun tamamlanmasını bekle",
|
|
35
|
+
"waitMs": 1000,
|
|
36
|
+
"fallbackSelectors": []
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"platform": "x",
|
|
3
|
+
"version": 1,
|
|
4
|
+
"lastUpdated": "2026-03-14T12:01:17.966Z",
|
|
5
|
+
"action": "tweet_retweet_öğren",
|
|
6
|
+
"description": "Belirtilen tweet sayfasına git, retweet butonuna tıkla ve onay ver",
|
|
7
|
+
"parameters": [
|
|
8
|
+
"{{TWEET_URL}}"
|
|
9
|
+
],
|
|
10
|
+
"steps": [
|
|
11
|
+
{
|
|
12
|
+
"action": "goto",
|
|
13
|
+
"description": "Belirtilen tweet sayfasına git",
|
|
14
|
+
"url": "{{TWEET_URL}}"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"action": "wait",
|
|
18
|
+
"description": "Tweet sayfasının yüklenmesini bekle",
|
|
19
|
+
"waitMs": 2000
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"action": "click",
|
|
23
|
+
"description": "Retweet butonuna tıkla",
|
|
24
|
+
"selector": "[data-testid='retweet']",
|
|
25
|
+
"fallbackSelectors": [
|
|
26
|
+
"button[aria-label*='Yeniden gönder']",
|
|
27
|
+
"button[aria-label*='Repost']",
|
|
28
|
+
"[data-testid='unretweet']"
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"action": "wait",
|
|
33
|
+
"description": "Retweet menüsünün açılmasını bekle",
|
|
34
|
+
"waitMs": 1000
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"action": "click",
|
|
38
|
+
"description": "Yeniden gönder seçeneğine tıkla",
|
|
39
|
+
"selector": "[data-testid='retweetConfirm']",
|
|
40
|
+
"fallbackSelectors": [
|
|
41
|
+
"[role='menuitem'][data-testid='retweetConfirm']",
|
|
42
|
+
"[role='menu'] [role='menuitem']:first-child"
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
]
|
|
46
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "social-agent-cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "AI-powered social media agent - free APIs + browser automation with self-healing selectors",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"ai/",
|
|
19
19
|
"platforms/",
|
|
20
20
|
"knowledge/",
|
|
21
|
+
"maps/",
|
|
21
22
|
"hooks/",
|
|
22
23
|
"config.example.json",
|
|
23
24
|
"tsconfig.json"
|