social-agent-cli 5.1.0 → 5.1.1

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.
@@ -18,19 +18,50 @@ async function upload() {
18
18
  const fc = await fcPromise;
19
19
  await fc.setFiles(filePath);
20
20
 
21
- // 2. Editör modal'ı çıkarsa "İleri/Bitti/Done/Next" butonuna tıkla
21
+ // 2. Editör/düzenleme modal'ı çıkarsa kapat
22
22
  await page.waitForTimeout(3000);
23
- for (const text of ["İleri", "Bitti", "Done", "Next", "Tamam"]) {
23
+
24
+ // X: "Düzenle" overlay'ındaki X (kapat) butonunu veya overlay'ı kapat
25
+ // LinkedIn: "İleri/Bitti/Done" butonuna tıkla
26
+ const closeButtons = [
27
+ // LinkedIn
28
+ { role: "button" as const, name: "İleri" },
29
+ { role: "button" as const, name: "Bitti" },
30
+ { role: "button" as const, name: "Done" },
31
+ { role: "button" as const, name: "Next" },
32
+ { role: "button" as const, name: "Tamam" },
33
+ ];
34
+
35
+ for (const btn of closeButtons) {
24
36
  try {
25
- const btn = page.getByRole("button", { name: text });
26
- if (await btn.isVisible({ timeout: 1000 })) {
27
- await btn.click();
37
+ const el = page.getByRole(btn.role, { name: btn.name });
38
+ if (await el.isVisible({ timeout: 500 })) {
39
+ await el.click();
28
40
  await page.waitForTimeout(1500);
29
41
  break;
30
42
  }
31
43
  } catch {}
32
44
  }
33
45
 
46
+ // X: Düzenle overlay'ı hâlâ açıksa, overlay dışına tıkla veya ESC
47
+ try {
48
+ const overlay = page.locator('[data-testid="editButton"]');
49
+ if (await overlay.isVisible({ timeout: 500 })) {
50
+ // Overlay'ın dışına tıkla veya ESC bas
51
+ await page.keyboard.press("Escape");
52
+ await page.waitForTimeout(1000);
53
+ }
54
+ } catch {}
55
+
56
+ // X: "Düzenle" yazısı hâlâ görünüyorsa, overlay'ın X butonuna bas
57
+ try {
58
+ const closeBtn = page.locator('[aria-label="Close"], [aria-label="Kapat"], [data-testid="app-bar-close"]');
59
+ if (await closeBtn.first().isVisible({ timeout: 500 })) {
60
+ await closeBtn.first().click();
61
+ await page.waitForTimeout(1000);
62
+ }
63
+ } catch {}
64
+
34
65
  console.log("OK");
35
66
  process.exit(0);
36
67
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "social-agent-cli",
3
- "version": "5.1.0",
3
+ "version": "5.1.1",
4
4
  "description": "AI-powered social media agent - free APIs + browser automation with self-healing selectors",
5
5
  "type": "module",
6
6
  "bin": {