social-agent-cli 1.1.5 → 1.1.7
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/cli.ts +8 -8
- package/install.ts +69 -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/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
|
|
package/install.ts
CHANGED
|
@@ -210,18 +210,79 @@ Bu dosyayı düzenlemek için: ${promptPath}
|
|
|
210
210
|
}
|
|
211
211
|
|
|
212
212
|
// 8. /social komutu
|
|
213
|
-
console.log("\n
|
|
213
|
+
console.log("\n 7. /social Komutu\n ─────────────────");
|
|
214
214
|
const commandsDir = join(homedir(), ".claude", "commands");
|
|
215
215
|
mkdirSync(commandsDir, { recursive: true });
|
|
216
|
-
const socialCommandSrc = join(ROOT, "..", "social-bot", "social-mode-prompt.md"); // fallback
|
|
217
216
|
const socialCommandDest = join(commandsDir, "social.md");
|
|
218
217
|
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
218
|
+
const socialCommandContent = `Kullanıcı sosyal medya paylaşımı yapmak istiyor. Şu akışı takip et:
|
|
219
|
+
|
|
220
|
+
## 1. Analiz Et
|
|
221
|
+
|
|
222
|
+
**Konuşma geçmişinden:**
|
|
223
|
+
- Bu oturumda ne yaptın, hangi dosyalar değişti, hangi bug'lar çözüldü
|
|
224
|
+
- İlginç teknik zorluklar, alınan kararlar
|
|
225
|
+
- Paylaşılmaya değer hikaye ne?
|
|
226
|
+
|
|
227
|
+
**Git geçmişinden:**
|
|
228
|
+
- \`git log --oneline -10\` ve \`git diff --stat HEAD~3..HEAD\`
|
|
229
|
+
|
|
230
|
+
**Post geçmişinden (üslup analizi için):**
|
|
231
|
+
- \`social-agent history\` ile önceki postlara bak ve aynı tonda yaz
|
|
232
|
+
|
|
233
|
+
**Proje bilgisinden:**
|
|
234
|
+
- README.md veya package.json
|
|
235
|
+
|
|
236
|
+
## 2. Platform Seçimi
|
|
237
|
+
|
|
238
|
+
Bağlı platformları göster ve hangilerine göndermek istediğini sor:
|
|
239
|
+
\`\`\`bash
|
|
240
|
+
social-agent status
|
|
241
|
+
\`\`\`
|
|
242
|
+
|
|
243
|
+
## 3. Post İçeriği Oluştur
|
|
244
|
+
|
|
245
|
+
Her seçilen platform için **ayrı** içerik hazırla:
|
|
246
|
+
- **X**: max 280 karakter, kısa ve vurucu, 2-3 hashtag
|
|
247
|
+
- **Mastodon**: uzun, teknik detay, problem→çözüm hikayesi
|
|
248
|
+
- **LinkedIn**: profesyonel ton, sektörel değer
|
|
249
|
+
|
|
250
|
+
Kurallar: Reklam değil samimi. CTA yok. Kullanıcının dilinde yaz. Konuşma geçmişinden somut detay kullan.
|
|
251
|
+
|
|
252
|
+
## 4. Image Sorusu
|
|
253
|
+
|
|
254
|
+
Kullanıcıya sor: "Görsel oluşturayım mı?"
|
|
255
|
+
|
|
256
|
+
Onaylarsa:
|
|
257
|
+
1. Platform boyutuna uygun HTML görsel oluştur (X: 1200x675, LinkedIn: 1200x627, Mastodon: 1200x630)
|
|
258
|
+
2. Koyu arka plan, neon vurgular, modern minimal tasarım
|
|
259
|
+
3. HTML'i \`/tmp/social-post-PLATFORM.html\` olarak kaydet
|
|
260
|
+
4. Screenshot al:
|
|
261
|
+
\`\`\`bash
|
|
262
|
+
social-agent screenshot /tmp/social-post-PLATFORM.html /tmp/social-post-PLATFORM.jpeg GENISLIK YUKSEKLIK
|
|
263
|
+
\`\`\`
|
|
264
|
+
5. Kullanıcıya dosya yolunu göster
|
|
265
|
+
|
|
266
|
+
## 5. Onay Al
|
|
267
|
+
|
|
268
|
+
Post içeriklerini ve görselleri göster. "Onaylıyor musun? Düzenleme?"
|
|
269
|
+
|
|
270
|
+
## 6. Gönder (onay gelince)
|
|
271
|
+
|
|
272
|
+
ÖNEMLI: Gönderme işlemlerini \`run_in_background: true\` ile arka planda çalıştır.
|
|
273
|
+
|
|
274
|
+
\`\`\`bash
|
|
275
|
+
social-agent post "İÇERİK" --platforms mastodon --image /tmp/social-post-mastodon.jpeg
|
|
276
|
+
social-agent run x "şu mesajı tweetle: İÇERİK" --yes
|
|
277
|
+
social-agent run linkedin "şu mesajı paylaş: İÇERİK" --yes
|
|
278
|
+
social-agent run PLATFORM "DOĞAL_DİL_KOMUTU" --yes
|
|
279
|
+
\`\`\`
|
|
280
|
+
|
|
281
|
+
Kullanıcıya "Arka planda gönderiliyor" de ve diğer işlere devam et.
|
|
282
|
+
`;
|
|
283
|
+
|
|
284
|
+
writeFileSync(socialCommandDest, socialCommandContent);
|
|
285
|
+
console.log(" ✓ /social komutu oluşturuldu: ~/.claude/commands/social.md");
|
|
225
286
|
|
|
226
287
|
// 9. Platform Login & Learn
|
|
227
288
|
console.log(`
|