social-agent-cli 1.6.0 → 1.6.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.
Files changed (2) hide show
  1. package/install.ts +33 -5
  2. package/package.json +1 -1
package/install.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { createInterface } from "node:readline";
2
- import { writeFileSync, existsSync, mkdirSync, copyFileSync, readFileSync } from "node:fs";
2
+ import { writeFileSync, existsSync, mkdirSync, copyFileSync, readFileSync, readdirSync } from "node:fs";
3
3
  import { join, dirname } from "node:path";
4
4
  import { fileURLToPath } from "node:url";
5
5
  import { execSync } from "node:child_process";
@@ -22,6 +22,38 @@ async function main() {
22
22
  const rl = createInterface({ input: process.stdin, output: process.stdout });
23
23
 
24
24
  console.log(`\n Social Agent Setup\n ──────────────────\n`);
25
+
26
+ // Eski kurulumu temizle
27
+ if (existsSync(ROOT)) {
28
+ const { rmSync: rm } = await import("node:fs");
29
+ // maps, profiles, screenshots temizle (config ve knowledge koru)
30
+ for (const dir of ["maps", "profiles", "screenshots"]) {
31
+ const p = join(ROOT, dir);
32
+ if (existsSync(p)) { rm(p, { recursive: true, force: true }); }
33
+ }
34
+ // Eski format map dosyalarını temizle (x_post.json gibi)
35
+ try {
36
+ for (const f of readdirSync(ROOT)) {
37
+ if (f.endsWith(".json") && f.includes("_") && f !== "config.json" && f !== "profile-map.json" && f !== "history.json") {
38
+ rm(join(ROOT, f), { force: true });
39
+ }
40
+ }
41
+ } catch {}
42
+ // social-mode-prompt.md sil (yenisi oluşturulacak)
43
+ const oldPrompt = join(ROOT, "social-mode-prompt.md");
44
+ if (existsSync(oldPrompt)) rm(oldPrompt, { force: true });
45
+ // .social-enabled/.social-disabled sil
46
+ for (const f of [".social-enabled", ".social-disabled"]) {
47
+ const p = join(ROOT, f);
48
+ if (existsSync(p)) rm(p, { force: true });
49
+ }
50
+ console.log(" ✓ Eski kalıntılar temizlendi\n");
51
+ }
52
+
53
+ // Dizinleri oluştur
54
+ for (const dir of ["maps", "profiles", "screenshots", "knowledge"]) {
55
+ mkdirSync(join(ROOT, dir), { recursive: true });
56
+ }
25
57
  const name = await ask(rl, "Adın");
26
58
  const language = await ask(rl, "Post dili", "tr");
27
59
  const style = await ask(rl, "Post stili (developer/casual/professional)", "developer");
@@ -119,10 +151,6 @@ Gönderme komutları (HER ZAMAN bu komutları kullan, asla cd veya npx tsx kulla
119
151
  writeFileSync(configPath, JSON.stringify(config, null, 2));
120
152
  console.log(` ✓ Config oluşturuldu: ${configPath}`);
121
153
 
122
- // 4. Dizinleri oluştur
123
- for (const dir of ["maps", "profiles", "screenshots", "knowledge"]) {
124
- mkdirSync(join(ROOT, dir), { recursive: true });
125
- }
126
154
 
127
155
  // Sessiz kurulumlar
128
156
  if (!existsSync(join(PKG_DIR, "node_modules"))) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "social-agent-cli",
3
- "version": "1.6.0",
3
+ "version": "1.6.1",
4
4
  "description": "AI-powered social media agent - free APIs + browser automation with self-healing selectors",
5
5
  "type": "module",
6
6
  "bin": {