social-agent-cli 1.1.4 → 1.1.6

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/runner.ts CHANGED
@@ -17,7 +17,8 @@ const BROWSER_PLATFORMS: Record<string, string> = {
17
17
  */
18
18
  export async function runCommand(
19
19
  platform: string,
20
- command: string
20
+ command: string,
21
+ autoConfirm = false
21
22
  ): Promise<void> {
22
23
  const url = BROWSER_PLATFORMS[platform];
23
24
  if (!url) {
@@ -29,16 +30,20 @@ export async function runCommand(
29
30
  const plan = await createPlan(platform, command);
30
31
 
31
32
  // 2. Onay al
32
- console.log("");
33
- const { createInterface } = await import("node:readline");
34
- const rl = createInterface({ input: process.stdin, output: process.stdout });
35
- const answer = await new Promise<string>((resolve) => {
36
- rl.question("Bu planı çalıştırayım mı? (E/h): ", (a) => { rl.close(); resolve(a.trim()); });
37
- });
38
-
39
- if (answer && answer.toLowerCase() !== "e") {
40
- console.log("İptal edildi.");
41
- process.exit(0);
33
+ if (!autoConfirm) {
34
+ console.log("");
35
+ const { createInterface } = await import("node:readline");
36
+ const rl = createInterface({ input: process.stdin, output: process.stdout });
37
+ const answer = await new Promise<string>((resolve) => {
38
+ rl.question("Bu planı çalıştırayım mı? (E/h): ", (a) => { rl.close(); resolve(a.trim()); });
39
+ });
40
+
41
+ if (answer && answer.toLowerCase() !== "e") {
42
+ console.log("İptal edildi.");
43
+ process.exit(0);
44
+ }
45
+ } else {
46
+ console.log("\n[runner] Otomatik onay (--yes)\n");
42
47
  }
43
48
 
44
49
  // 3. Adımları çalıştır
@@ -73,6 +73,12 @@ switch (command) {
73
73
  break;
74
74
  }
75
75
 
76
+ case "screenshot": {
77
+ // social-agent screenshot /tmp/input.html /tmp/output.jpeg 1200 675
78
+ run("core/screenshot.ts", args);
79
+ break;
80
+ }
81
+
76
82
  case "login":
77
83
  case "learn":
78
84
  case "run":
package/cli.ts CHANGED
@@ -181,17 +181,17 @@ switch (command) {
181
181
  }
182
182
 
183
183
  case "run": {
184
- // npx tsx cli.ts run x "son 3 tweeti beğen ve takip et"
185
- // npx tsx cli.ts run linkedin "bağlantı isteği gönder"
186
- const runPlatform = BROWSER_PLATFORMS[args[0]] ? args[0] : "x";
187
- const runCmd = BROWSER_PLATFORMS[args[0]]
188
- ? args.slice(1).join(" ")
189
- : args.join(" ");
184
+ const hasYes = args.includes("--yes") || args.includes("-y");
185
+ const filteredArgs = args.filter(a => a !== "--yes" && a !== "-y");
186
+ const runPlatform = BROWSER_PLATFORMS[filteredArgs[0]] ? filteredArgs[0] : "x";
187
+ const runCmd = BROWSER_PLATFORMS[filteredArgs[0]]
188
+ ? filteredArgs.slice(1).join(" ")
189
+ : filteredArgs.join(" ");
190
190
  if (!runCmd) {
191
- console.log('Kullanım: tsx cli.ts run <platform> "doğal dil komutu"');
191
+ console.log('Kullanım: social-agent run <platform> "doğal dil komutu" [--yes]');
192
192
  break;
193
193
  }
194
- await runCommand(runPlatform, runCmd);
194
+ await runCommand(runPlatform, runCmd, hasYes);
195
195
  break;
196
196
  }
197
197
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "social-agent-cli",
3
- "version": "1.1.4",
3
+ "version": "1.1.6",
4
4
  "description": "AI-powered social media agent - free APIs + browser automation with self-healing selectors",
5
5
  "type": "module",
6
6
  "bin": {