social-agent-cli 1.0.6 → 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 +6 -1
- package/ai/runner.ts +7 -0
- package/install.ts +17 -7
- package/package.json +1 -1
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
|
-
|
|
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
|
|
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})` : "";
|
|
@@ -67,12 +68,21 @@ ${mastodonHandle ? `Mastodon: @${mastodonHandle}` : ""}
|
|
|
67
68
|
Post dili: ${language}
|
|
68
69
|
Post stili: ${style}
|
|
69
70
|
|
|
70
|
-
Kullanıcıyla çalışırken
|
|
71
|
+
Kullanıcıyla çalışırken paylaşılmaya değer anları fark et ve post öner. Sadece commit'lerle sınırlı değil, her türlü ilginç an olabilir:
|
|
71
72
|
- Yeni özellik tamamlandığında
|
|
72
|
-
- İlginç bir bug fix
|
|
73
|
+
- İlginç bir bug fix ve arkasındaki hikaye
|
|
73
74
|
- Performans iyileştirmesi (rakamlarla)
|
|
74
75
|
- Release / milestone
|
|
75
|
-
- Yeni teknoloji entegrasyonu
|
|
76
|
+
- Yeni teknoloji entegrasyonu veya araç keşfi
|
|
77
|
+
- Zorlu bir teknik problem çözüldüğünde
|
|
78
|
+
- Proje ilk çalışır hale geldiğinde
|
|
79
|
+
- Bir API veya servis başarıyla entegre edildiğinde
|
|
80
|
+
- İlginç bir mimari karar alındığında
|
|
81
|
+
- Deploy / canlıya çıkma
|
|
82
|
+
- Test'ler yazıldığında veya coverage arttığında
|
|
83
|
+
- Refactoring sonrası kod kalitesi arttığında
|
|
84
|
+
- Yeni bir şey öğrenildiğinde (TIL anları)
|
|
85
|
+
- Kullanıcı heyecanlı veya gurur duyduğunda (duygusal ipuçlarını yakala)
|
|
76
86
|
|
|
77
87
|
Öneri hassasiyeti: ${sensitivity}/5
|
|
78
88
|
${sensitivityRule}
|
|
@@ -147,9 +157,9 @@ Bu dosyayı düzenlemek için: ${promptPath}
|
|
|
147
157
|
|
|
148
158
|
// 5. npm install
|
|
149
159
|
console.log("\n 4. Bağımlılıklar\n ─────────────────");
|
|
150
|
-
if (!existsSync(join(
|
|
160
|
+
if (!existsSync(join(PKG_DIR, "node_modules"))) {
|
|
151
161
|
console.log(" Yükleniyor...");
|
|
152
|
-
execSync("npm install", { cwd:
|
|
162
|
+
execSync("npm install", { cwd: PKG_DIR, stdio: "inherit" });
|
|
153
163
|
} else {
|
|
154
164
|
console.log(" ✓ Bağımlılıklar zaten yüklü");
|
|
155
165
|
}
|
|
@@ -166,7 +176,7 @@ Bu dosyayı düzenlemek için: ${promptPath}
|
|
|
166
176
|
console.log("\n 5. Git Hook\n ───────────");
|
|
167
177
|
const gitHooksDir = join(homedir(), ".git-hooks");
|
|
168
178
|
mkdirSync(gitHooksDir, { recursive: true });
|
|
169
|
-
const hookSrc = join(
|
|
179
|
+
const hookSrc = join(PKG_DIR, "hooks", "post-push");
|
|
170
180
|
const hookDest = join(gitHooksDir, "post-push");
|
|
171
181
|
|
|
172
182
|
if (existsSync(hookSrc)) {
|