social-agent-cli 1.2.0 → 1.2.2
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/ai/planner.ts +3 -2
- package/ai/runner.ts +32 -0
- package/cli.ts +2 -2
- package/maps/linkedin_post.json +6 -22
- package/maps/x_post.json +5 -20
- package/package.json +1 -1
package/ai/planner.ts
CHANGED
|
@@ -142,8 +142,9 @@ GÖREV: Bu komutu yerine getirmek için bir çalıştırma planı oluştur.
|
|
|
142
142
|
Kurallar:
|
|
143
143
|
- Mevcut map varsa "use_map" kullan, mapAction'a action adını yaz
|
|
144
144
|
- Mevcut map yoksa "learn_new" kullan, AI otomatik öğrenecek
|
|
145
|
-
-
|
|
146
|
-
-
|
|
145
|
+
- Mevcut map'in parametrelerini kontrol et. Komutta dosya/görsel/fotoğraf varsa ama map'te {{IMAGE}} parametresi yoksa, bu map yetersizdir - "learn_new" ile görsel destekli versiyonunu öğret
|
|
146
|
+
- Parametreleri doldur ({{TWEET_URL}}, {{USERNAME}}, {{CONTENT}}, {{IMAGE}} vb.)
|
|
147
|
+
- Belirli kişi/URL verilmemişse platformun keşif/öneri sayfalarını kullan
|
|
147
148
|
- Tekrar eden işlemler için "repeat" kullan
|
|
148
149
|
- Adımları doğru sırada planla
|
|
149
150
|
- Kısa ve net analiz yaz`;
|
package/ai/runner.ts
CHANGED
|
@@ -77,8 +77,10 @@ export async function runCommand(
|
|
|
77
77
|
for (let r = 0; r < repeatCount; r++) {
|
|
78
78
|
if (repeatCount > 1) console.log(` [${r + 1}/${repeatCount}]`);
|
|
79
79
|
|
|
80
|
+
const imageParam = step.parameters["{{IMAGE}}"] || step.parameters["IMAGE"] || "";
|
|
80
81
|
const post: Post = {
|
|
81
82
|
content: step.parameters["{{CONTENT}}"] || step.parameters["CONTENT"] || "",
|
|
83
|
+
images: imageParam ? [imageParam] : undefined,
|
|
82
84
|
platform,
|
|
83
85
|
};
|
|
84
86
|
|
|
@@ -94,6 +96,36 @@ export async function runCommand(
|
|
|
94
96
|
}
|
|
95
97
|
|
|
96
98
|
let steps = [...map.steps];
|
|
99
|
+
|
|
100
|
+
// IMAGE parametresi var ama map'te upload step'i yok → gönder butonundan önce upload ekle
|
|
101
|
+
if (imageParam && !steps.some(s => s.action === "upload")) {
|
|
102
|
+
// Gönder butonunun index'ini bul (genelde son click)
|
|
103
|
+
const sendIdx = steps.findLastIndex((s: any) => s.action === "click" && s.description?.toLowerCase().match(/gönder|post|tweet|paylaş|send|submit/));
|
|
104
|
+
if (sendIdx > -1) {
|
|
105
|
+
steps.splice(sendIdx, 0,
|
|
106
|
+
{
|
|
107
|
+
action: "upload" as const,
|
|
108
|
+
description: "Görsel yükle",
|
|
109
|
+
selector: "input[type='file']",
|
|
110
|
+
value: "{{IMAGE}}",
|
|
111
|
+
fallbackSelectors: ["[data-testid='fileInput']", "input[accept*='image']", "input[type='file'][accept]"],
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
action: "wait" as const,
|
|
115
|
+
description: "Görsel yüklenmesini bekle",
|
|
116
|
+
waitMs: 2000,
|
|
117
|
+
}
|
|
118
|
+
);
|
|
119
|
+
console.log(` [auto] Görsel yükleme adımı eklendi (map'e kaydedilecek)`);
|
|
120
|
+
|
|
121
|
+
// Map'i güncelle - sonraki isteklerde de kullanılsın
|
|
122
|
+
const { saveMap } = await import("./mapper.js");
|
|
123
|
+
map.steps = steps;
|
|
124
|
+
map.parameters = [...(map.parameters || []), "{{IMAGE}}"];
|
|
125
|
+
map.version++;
|
|
126
|
+
saveMap(map);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
97
129
|
let stepIdx = 0;
|
|
98
130
|
let healAttempt = 0;
|
|
99
131
|
|
package/cli.ts
CHANGED
|
@@ -129,9 +129,9 @@ async function cmdTest(platform: string) {
|
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
-
function cmdStatus() {
|
|
132
|
+
async function cmdStatus() {
|
|
133
133
|
const config = loadConfig();
|
|
134
|
-
const { getSavedProfile } =
|
|
134
|
+
const { getSavedProfile } = await import("./core/profiles.js");
|
|
135
135
|
|
|
136
136
|
console.log("\n Platform Durumu\n ───────────────");
|
|
137
137
|
|
package/maps/linkedin_post.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"platform": "linkedin",
|
|
3
3
|
"action": "post",
|
|
4
|
-
"description": "LinkedIn üzerinden
|
|
5
|
-
"version":
|
|
6
|
-
"lastUpdated": "2026-03-
|
|
7
|
-
"parameters": ["{{CONTENT}}"
|
|
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
8
|
"steps": [
|
|
9
9
|
{
|
|
10
10
|
"action": "click",
|
|
@@ -13,8 +13,7 @@
|
|
|
13
13
|
"fallbackSelectors": [
|
|
14
14
|
"[aria-label*='Start a post']",
|
|
15
15
|
"[aria-label*='Gönderi başlat']",
|
|
16
|
-
"button[aria-label*='post']"
|
|
17
|
-
".share-box-feed-entry__trigger"
|
|
16
|
+
"button[aria-label*='post']"
|
|
18
17
|
]
|
|
19
18
|
},
|
|
20
19
|
{
|
|
@@ -47,21 +46,6 @@
|
|
|
47
46
|
"description": "Metin girişi sonrası bekleme",
|
|
48
47
|
"waitMs": 1000
|
|
49
48
|
},
|
|
50
|
-
{
|
|
51
|
-
"action": "upload",
|
|
52
|
-
"description": "Görsel yükle (varsa)",
|
|
53
|
-
"selector": "input[type='file'][accept*='image']",
|
|
54
|
-
"value": "{{IMAGE}}",
|
|
55
|
-
"fallbackSelectors": [
|
|
56
|
-
".share-creation-state__file-input input[type='file']",
|
|
57
|
-
"input[type='file']"
|
|
58
|
-
]
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
"action": "wait",
|
|
62
|
-
"description": "Görsel yüklenmesini bekle",
|
|
63
|
-
"waitMs": 3000
|
|
64
|
-
},
|
|
65
49
|
{
|
|
66
50
|
"action": "click",
|
|
67
51
|
"description": "Gönder butonuna tıkla",
|
|
@@ -76,7 +60,7 @@
|
|
|
76
60
|
{
|
|
77
61
|
"action": "wait",
|
|
78
62
|
"description": "Post gönderimini bekle",
|
|
79
|
-
"waitMs":
|
|
63
|
+
"waitMs": 2000
|
|
80
64
|
}
|
|
81
65
|
]
|
|
82
66
|
}
|
package/maps/x_post.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"platform": "x",
|
|
3
3
|
"action": "post",
|
|
4
|
-
"description": "X (Twitter) üzerinden
|
|
5
|
-
"version":
|
|
6
|
-
"lastUpdated": "2026-03-
|
|
7
|
-
"parameters": ["{{CONTENT}}"
|
|
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
8
|
"steps": [
|
|
9
9
|
{
|
|
10
10
|
"action": "click",
|
|
@@ -46,21 +46,6 @@
|
|
|
46
46
|
"description": "Metin girişi sonrası bekleme",
|
|
47
47
|
"waitMs": 500
|
|
48
48
|
},
|
|
49
|
-
{
|
|
50
|
-
"action": "upload",
|
|
51
|
-
"description": "Görsel yükle (varsa)",
|
|
52
|
-
"selector": "[data-testid='fileInput']",
|
|
53
|
-
"value": "{{IMAGE}}",
|
|
54
|
-
"fallbackSelectors": [
|
|
55
|
-
"input[type='file'][accept*='image']",
|
|
56
|
-
"input[data-testid='fileInput']"
|
|
57
|
-
]
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
"action": "wait",
|
|
61
|
-
"description": "Görsel yüklenmesini bekle",
|
|
62
|
-
"waitMs": 2000
|
|
63
|
-
},
|
|
64
49
|
{
|
|
65
50
|
"action": "click",
|
|
66
51
|
"description": "Gönder butonuna tıkla",
|
|
@@ -73,7 +58,7 @@
|
|
|
73
58
|
{
|
|
74
59
|
"action": "wait",
|
|
75
60
|
"description": "Post gönderimini bekle",
|
|
76
|
-
"waitMs":
|
|
61
|
+
"waitMs": 2000
|
|
77
62
|
}
|
|
78
63
|
]
|
|
79
64
|
}
|