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 +16 -11
- package/bin/social-agent.js +6 -0
- package/cli.ts +8 -8
- package/package.json +1 -1
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
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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
|
package/bin/social-agent.js
CHANGED
package/cli.ts
CHANGED
|
@@ -181,17 +181,17 @@ switch (command) {
|
|
|
181
181
|
}
|
|
182
182
|
|
|
183
183
|
case "run": {
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
const runPlatform = BROWSER_PLATFORMS[
|
|
187
|
-
const runCmd = BROWSER_PLATFORMS[
|
|
188
|
-
?
|
|
189
|
-
:
|
|
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:
|
|
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
|
|