social-agent-cli 1.0.7 → 1.0.8

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/mapper.ts CHANGED
@@ -332,7 +332,12 @@ GÖREV: Ekranın mevcut durumunu analiz et. Amaca ulaşmak için kalan adımlar
332
332
  effort,
333
333
  });
334
334
 
335
- console.log(`\n[heal] Analiz: ${result.analysis}`);
335
+ if (!result || !result.remainingSteps) {
336
+ console.log(`\n[heal] AI geçerli bir plan döndüremedi, orijinal adımlarla devam ediliyor.`);
337
+ return originalSteps.slice(failedStepIndex);
338
+ }
339
+
340
+ console.log(`\n[heal] Analiz: ${result.analysis || "?"}`);
336
341
  console.log(`[heal] ${result.remainingSteps.length} yeni adım planlandı`);
337
342
 
338
343
  // Map'i güncelle: tamamlanan adımlar + yeni kalan adımlar
package/ai/runner.ts CHANGED
@@ -81,6 +81,13 @@ export async function runCommand(
81
81
  const page = await driver.launch();
82
82
 
83
83
  try {
84
+ // Map'in ilk adımı goto değilse platform ana sayfasına git
85
+ if (map.steps[0]?.action !== "goto") {
86
+ console.log(` [${platform}] ${url} açılıyor...`);
87
+ await page.goto(url, { waitUntil: "domcontentloaded", timeout: 30000 });
88
+ await page.waitForTimeout(3000);
89
+ }
90
+
84
91
  let steps = [...map.steps];
85
92
  let stepIdx = 0;
86
93
  let healAttempt = 0;
package/install.ts CHANGED
@@ -6,7 +6,8 @@ import { execSync } from "node:child_process";
6
6
  import { homedir } from "node:os";
7
7
 
8
8
  const __dirname = dirname(fileURLToPath(import.meta.url));
9
- const ROOT = __dirname;
9
+ const PKG_DIR = __dirname;
10
+ const ROOT = process.env.SOCIAL_AGENT_DATA || join(homedir(), ".social-agent");
10
11
 
11
12
  function ask(rl: ReturnType<typeof createInterface>, question: string, defaultVal = ""): Promise<string> {
12
13
  const suffix = defaultVal ? ` (${defaultVal})` : "";
@@ -156,9 +157,9 @@ Bu dosyayı düzenlemek için: ${promptPath}
156
157
 
157
158
  // 5. npm install
158
159
  console.log("\n 4. Bağımlılıklar\n ─────────────────");
159
- if (!existsSync(join(ROOT, "node_modules"))) {
160
+ if (!existsSync(join(PKG_DIR, "node_modules"))) {
160
161
  console.log(" Yükleniyor...");
161
- execSync("npm install", { cwd: ROOT, stdio: "inherit" });
162
+ execSync("npm install", { cwd: PKG_DIR, stdio: "inherit" });
162
163
  } else {
163
164
  console.log(" ✓ Bağımlılıklar zaten yüklü");
164
165
  }
@@ -175,7 +176,7 @@ Bu dosyayı düzenlemek için: ${promptPath}
175
176
  console.log("\n 5. Git Hook\n ───────────");
176
177
  const gitHooksDir = join(homedir(), ".git-hooks");
177
178
  mkdirSync(gitHooksDir, { recursive: true });
178
- const hookSrc = join(ROOT, "hooks", "post-push");
179
+ const hookSrc = join(PKG_DIR, "hooks", "post-push");
179
180
  const hookDest = join(gitHooksDir, "post-push");
180
181
 
181
182
  if (existsSync(hookSrc)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "social-agent-cli",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "AI-powered social media agent - free APIs + browser automation with self-healing selectors",
5
5
  "type": "module",
6
6
  "bin": {