social-agent-cli 1.0.2 → 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.
@@ -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 knowledgeSrc = join(PKG_DIR, "knowledge");
22
- const knowledgeDest = join(DATA_DIR, "knowledge");
23
- if (existsSync(knowledgeSrc)) {
24
- const { readdirSync, copyFileSync } = await import("node:fs");
25
- for (const file of readdirSync(knowledgeSrc)) {
26
- const dest = join(knowledgeDest, file);
27
- if (!existsSync(dest)) {
28
- copyFileSync(join(knowledgeSrc, file), dest);
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
  }
@@ -54,6 +56,23 @@ switch (command) {
54
56
  run("install.ts");
55
57
  break;
56
58
 
59
+ case "config":
60
+ case "--config": {
61
+ const promptFile = join(DATA_DIR, "social-mode-prompt.md");
62
+ const configFile = join(DATA_DIR, "config.json");
63
+ const target = args[0] === "api" ? configFile : promptFile;
64
+
65
+ if (!existsSync(target)) {
66
+ console.log(`Dosya bulunamadı: ${target}\nÖnce 'social-agent setup' çalıştır.`);
67
+ process.exit(1);
68
+ }
69
+
70
+ const editor = process.env.EDITOR || "nano";
71
+ const { spawnSync } = await import("node:child_process");
72
+ spawnSync(editor, [target], { stdio: "inherit" });
73
+ break;
74
+ }
75
+
57
76
  case "login":
58
77
  case "learn":
59
78
  case "run":
@@ -67,43 +86,52 @@ switch (command) {
67
86
  case undefined:
68
87
  case "--help":
69
88
  case "-h":
89
+ case "help":
70
90
  console.log(`
71
- social-agent - AI destekli sosyal medya otomasyon aracı
91
+ social-agent v1.0 - AI-powered social media automation
92
+
93
+ Setup:
94
+ social-agent setup First-time setup wizard
95
+ social-agent config Edit AI personality & preferences
96
+ social-agent config api Edit API keys (config.json)
97
+
98
+ Browser Platforms (X, LinkedIn, Instagram, Facebook):
99
+ social-agent login <platform> Select Chrome profile & verify login
100
+ social-agent learn "<task>" <platform> Teach AI a new action
101
+ social-agent run <platform> "<cmd>" Execute with natural language
72
102
 
73
- Kurulum:
74
- social-agent setup İlk kurulum (isim, profil, platformlar)
103
+ API Platforms (Mastodon, Bluesky, Telegram):
104
+ social-agent post "<text>" --platforms mastodon,bluesky
75
105
 
76
- Komutlar:
77
- social-agent login <platform> Chrome profil seç ve giriş yap
78
- social-agent learn "<görev>" <platform> AI ile aksiyon öğret
79
- social-agent run <platform> "<komut>" Doğal dil ile çalıştır
80
- social-agent post "<metin>" --platforms x,mastodon Post at
81
- social-agent status Bağlı platformları göster
82
- social-agent history Post geçmişi
106
+ Info:
107
+ social-agent status Show connected platforms
108
+ social-agent history Show action history
109
+ social-agent help This help message
83
110
 
84
- Örnekler:
85
- social-agent setup
111
+ Examples:
86
112
  social-agent login x
87
- social-agent learn "tweet beğenmeyi öğren" x
88
- social-agent run x "şu tweeti beğen: https://x.com/..."
89
- social-agent run linkedin "3 insana bağlantı isteği gönder"
90
- social-agent post "Yeni özellik!" --platforms x,mastodon
91
-
92
- Ayarlar:
93
- ~/.social-agent/ Data dizini
94
- ~/.social-agent/config.json Platform API ayarları
95
- ~/.social-agent/social-mode-prompt.md AI asistan profili (düzenlenebilir)
96
- ~/.social-agent/knowledge/ Platform bilgileri
97
- ~/.social-agent/maps/ Öğrenilmiş aksiyonlar
98
- ~/.social-agent/history.json Post geçmişi
99
-
100
- Claude Code entegrasyonu:
101
- claude-social Sosyal medya farkındalıklı mod
102
- /social Elle post oluştur
113
+ social-agent learn x → learn to post (default)
114
+ social-agent learn "learn to like tweets" x → learn liking
115
+ social-agent run x "like this tweet: https://..."
116
+ social-agent run x "like and retweet: https://..."
117
+ social-agent run linkedin "send 3 connection requests"
118
+ social-agent post "New feature!" --platforms mastodon
119
+
120
+ Data:
121
+ ~/.social-agent/ All data lives here
122
+ ~/.social-agent/social-mode-prompt.md AI personality (edit with: social-agent config)
123
+ ~/.social-agent/config.json API keys (edit with: social-agent config api)
124
+ ~/.social-agent/knowledge/ Platform knowledge files
125
+ ~/.social-agent/maps/ Learned action maps
126
+ ~/.social-agent/history.json Action log
127
+
128
+ Claude Code:
129
+ claude-social Social-aware mode (suggests posts at milestones)
130
+ /social Create post from current work context
103
131
  `);
104
132
  break;
105
133
 
106
134
  default:
107
- console.log(`Bilinmeyen komut: ${command}. --help ile kullanımı gör.`);
135
+ console.log(`Unknown command: ${command}\nRun 'social-agent help' for usage.`);
108
136
  process.exit(1);
109
137
  }
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
+ }
@@ -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.2",
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"