clawaid 1.1.26 → 1.1.28
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/dist/server.js +1 -1
- package/package.json +1 -1
- package/web/index.html +110 -6
package/dist/server.js
CHANGED
|
@@ -336,7 +336,7 @@ app.get('/api/fingerprint', (_req, res) => {
|
|
|
336
336
|
res.json({ fingerprint: require('./diagnose').getMachineFingerprint() });
|
|
337
337
|
});
|
|
338
338
|
app.get('/api/health', (_req, res) => {
|
|
339
|
-
res.json({ ok: true, version: '1.1.
|
|
339
|
+
res.json({ ok: true, version: '1.1.28', name: 'ClawAid', sessions: activeSessions.size });
|
|
340
340
|
});
|
|
341
341
|
function createServer(port) {
|
|
342
342
|
return new Promise((resolve) => {
|
package/package.json
CHANGED
package/web/index.html
CHANGED
|
@@ -166,6 +166,52 @@
|
|
|
166
166
|
.schk-icon.pending { color: var(--text-muted); }
|
|
167
167
|
.schk-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
168
168
|
|
|
169
|
+
/* ═══ AI Thinking Card ══════════════════════════════════════════════════ */
|
|
170
|
+
.ai-thinking-card {
|
|
171
|
+
background: var(--surface);
|
|
172
|
+
border: 1px solid var(--border);
|
|
173
|
+
border-radius: var(--radius);
|
|
174
|
+
box-shadow: var(--shadow-sm);
|
|
175
|
+
padding: 20px;
|
|
176
|
+
animation: fadeUp .24s ease both;
|
|
177
|
+
margin-bottom: 12px;
|
|
178
|
+
}
|
|
179
|
+
.ai-thinking-hd {
|
|
180
|
+
display: flex; align-items: center; gap: 12px; margin-bottom: 14px;
|
|
181
|
+
}
|
|
182
|
+
.ai-thinking-icon {
|
|
183
|
+
font-size: 24px; animation: pulse-glow 2s ease-in-out infinite;
|
|
184
|
+
}
|
|
185
|
+
.ai-thinking-title { font-size: 14px; font-weight: 600; }
|
|
186
|
+
.ai-thinking-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
|
|
187
|
+
.ai-thinking-steps {
|
|
188
|
+
display: flex; flex-direction: column; gap: 8px;
|
|
189
|
+
}
|
|
190
|
+
.ai-step-row {
|
|
191
|
+
display: flex; align-items: center; gap: 10px; font-size: 12px;
|
|
192
|
+
color: var(--text-secondary); opacity: 0;
|
|
193
|
+
animation: fadeIn .4s ease forwards;
|
|
194
|
+
}
|
|
195
|
+
.ai-step-row .dot {
|
|
196
|
+
width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
|
|
197
|
+
animation: pulse-dot 1.5s ease-in-out infinite;
|
|
198
|
+
flex-shrink: 0;
|
|
199
|
+
}
|
|
200
|
+
.ai-step-row.done .dot { background: var(--green); animation: none; }
|
|
201
|
+
.ai-step-row.done { color: var(--green); }
|
|
202
|
+
@keyframes pulse-glow {
|
|
203
|
+
0%, 100% { transform: scale(1); opacity: 1; }
|
|
204
|
+
50% { transform: scale(1.1); opacity: .8; }
|
|
205
|
+
}
|
|
206
|
+
@keyframes pulse-dot {
|
|
207
|
+
0%, 100% { opacity: 1; transform: scale(1); }
|
|
208
|
+
50% { opacity: .4; transform: scale(.7); }
|
|
209
|
+
}
|
|
210
|
+
@keyframes fadeIn {
|
|
211
|
+
from { opacity: 0; transform: translateY(6px); }
|
|
212
|
+
to { opacity: 1; transform: translateY(0); }
|
|
213
|
+
}
|
|
214
|
+
|
|
169
215
|
/* ═══ Fix Step Cards ══════════════════════════════════════════════════════ */
|
|
170
216
|
.fix-card {
|
|
171
217
|
background: var(--surface);
|
|
@@ -558,7 +604,7 @@
|
|
|
558
604
|
<!-- Steps feed -->
|
|
559
605
|
<div id="feed" class="hidden"></div>
|
|
560
606
|
|
|
561
|
-
<div class="footer">ClawAid v1.1.
|
|
607
|
+
<div class="footer">ClawAid v1.1.28</div>
|
|
562
608
|
|
|
563
609
|
</div>
|
|
564
610
|
|
|
@@ -714,6 +760,44 @@
|
|
|
714
760
|
function updateScanProgress(msg) {
|
|
715
761
|
var sub = document.getElementById('scan-sub');
|
|
716
762
|
if (sub) sub.textContent = msg || '';
|
|
763
|
+
|
|
764
|
+
// Show AI thinking card when AI starts analyzing
|
|
765
|
+
if (msg && msg.indexOf('AI') !== -1 && !document.getElementById('ai-thinking-card')) {
|
|
766
|
+
var aiCard = document.createElement('div');
|
|
767
|
+
aiCard.className = 'ai-thinking-card';
|
|
768
|
+
aiCard.id = 'ai-thinking-card';
|
|
769
|
+
var thinkTitle = isZh ? '🤖 AI 正在分析你的系统...' : '🤖 AI is analyzing your system...';
|
|
770
|
+
var thinkSub = isZh ? '通常需要 10-20 秒' : 'Usually takes 10-20 seconds';
|
|
771
|
+
var steps = isZh
|
|
772
|
+
? ['读取配置文件和日志', '检查 Gateway 状态', '分析错误模式', '生成诊断方案']
|
|
773
|
+
: ['Reading config files & logs', 'Checking gateway status', 'Analyzing error patterns', 'Generating diagnosis'];
|
|
774
|
+
aiCard.innerHTML = '<div class="ai-thinking-hd">'
|
|
775
|
+
+ '<div class="ai-thinking-icon">🧠</div>'
|
|
776
|
+
+ '<div><div class="ai-thinking-title">' + thinkTitle + '</div>'
|
|
777
|
+
+ '<div class="ai-thinking-sub">' + thinkSub + '</div></div>'
|
|
778
|
+
+ '</div>'
|
|
779
|
+
+ '<div class="ai-thinking-steps" id="ai-thinking-steps"></div>';
|
|
780
|
+
feed.appendChild(aiCard);
|
|
781
|
+
scrollDown();
|
|
782
|
+
// Animate steps appearing one by one
|
|
783
|
+
var stepsEl = aiCard.querySelector('#ai-thinking-steps');
|
|
784
|
+
steps.forEach(function(s, i) {
|
|
785
|
+
setTimeout(function() {
|
|
786
|
+
if (!document.getElementById('ai-thinking-card')) return;
|
|
787
|
+
var row = document.createElement('div');
|
|
788
|
+
row.className = 'ai-step-row';
|
|
789
|
+
row.style.animationDelay = '0s';
|
|
790
|
+
row.innerHTML = '<span class="dot"></span> ' + s;
|
|
791
|
+
stepsEl.appendChild(row);
|
|
792
|
+
scrollDown();
|
|
793
|
+
// Mark previous step as done
|
|
794
|
+
if (i > 0) {
|
|
795
|
+
var prev = stepsEl.children[i - 1];
|
|
796
|
+
if (prev) prev.className = 'ai-step-row done';
|
|
797
|
+
}
|
|
798
|
+
}, i * 3000);
|
|
799
|
+
});
|
|
800
|
+
}
|
|
717
801
|
}
|
|
718
802
|
|
|
719
803
|
function addReadStep(step, idx) {
|
|
@@ -1201,6 +1285,11 @@
|
|
|
1201
1285
|
var diagnosisHtml = '';
|
|
1202
1286
|
var pendingFix = data.pendingFix;
|
|
1203
1287
|
if (pendingFix && pendingFix.description) {
|
|
1288
|
+
var cmdHtml = '';
|
|
1289
|
+
if (pendingFix.command) {
|
|
1290
|
+
cmdHtml = '<div style="margin-top:8px;padding:8px 10px;background:var(--surface-alt);border-radius:6px;font-family:var(--mono);font-size:11px;color:var(--text-secondary);word-break:break-all;">'
|
|
1291
|
+
+ '🔧 ' + (isZh ? '修复方案:' : 'Fix: ') + '<code>' + esc(pendingFix.command) + '</code></div>';
|
|
1292
|
+
}
|
|
1204
1293
|
diagnosisHtml = '<div style="background:var(--surface);border:1px solid var(--border);border-radius:10px;padding:12px;margin-bottom:12px;">'
|
|
1205
1294
|
+ '<div style="font-weight:700;font-size:14px;margin-bottom:8px;">'
|
|
1206
1295
|
+ (isZh ? '🔍 已找到问题:' : '🔍 Issue found:')
|
|
@@ -1208,7 +1297,9 @@
|
|
|
1208
1297
|
+ '<div style="display:flex;align-items:flex-start;gap:8px;">'
|
|
1209
1298
|
+ '<span style="flex-shrink:0;">⚠️</span>'
|
|
1210
1299
|
+ '<div style="font-size:13px;">' + esc(pendingFix.description) + '</div>'
|
|
1211
|
-
+ '</div
|
|
1300
|
+
+ '</div>'
|
|
1301
|
+
+ cmdHtml
|
|
1302
|
+
+ '</div>';
|
|
1212
1303
|
}
|
|
1213
1304
|
|
|
1214
1305
|
// Also show rule findings if available
|
|
@@ -1255,8 +1346,8 @@
|
|
|
1255
1346
|
div.className = 'card pw-card';
|
|
1256
1347
|
div.innerHTML = '<div class="pw-hd">'
|
|
1257
1348
|
+ '<span class="pw-emoji">🩺</span>'
|
|
1258
|
-
+ '<div class="pw-title">' + (isZh ? '
|
|
1259
|
-
+ '<div class="pw-sub">' + (isZh ? '
|
|
1349
|
+
+ '<div class="pw-title">' + (isZh ? '🎯 问题已定位,修复方案已就绪' : '🎯 Issue identified, fix ready') + '</div>'
|
|
1350
|
+
+ '<div class="pw-sub">' + (isZh ? '付费解锁 → AI 自动执行修复 → 30秒搞定(自己排查可能要 1-2 小时)' : 'Pay to unlock → AI auto-fixes → 30s done (vs 1-2 hours manual debugging)') + '</div>'
|
|
1260
1351
|
+ '</div>'
|
|
1261
1352
|
+ diagnosisHtml
|
|
1262
1353
|
+ buyBtnHtml
|
|
@@ -1277,13 +1368,22 @@
|
|
|
1277
1368
|
|
|
1278
1369
|
// Fetch fingerprint for buy URL (Stripe) or xunhupay order creation
|
|
1279
1370
|
var _pwFingerprint = '';
|
|
1371
|
+
var _fpReady = false;
|
|
1372
|
+
// Disable buy button until fingerprint is loaded
|
|
1373
|
+
var _buyBtn = document.getElementById('pw-buy');
|
|
1374
|
+
if (_buyBtn && !isCN) { _buyBtn.style.opacity = '0.5'; _buyBtn.style.pointerEvents = 'none'; }
|
|
1280
1375
|
fetch('/api/fingerprint').then(function(r){return r.json();}).then(function(d) {
|
|
1281
1376
|
_pwFingerprint = d.fingerprint || '';
|
|
1377
|
+
_fpReady = true;
|
|
1282
1378
|
if (!isCN) {
|
|
1283
1379
|
var btn = document.getElementById('pw-buy');
|
|
1284
|
-
if (btn && d.fingerprint)
|
|
1380
|
+
if (btn && d.fingerprint) {
|
|
1381
|
+
btn.href = STRIPE_URL + '?client_reference_id=' + encodeURIComponent(d.fingerprint);
|
|
1382
|
+
btn.style.opacity = '1';
|
|
1383
|
+
btn.style.pointerEvents = 'auto';
|
|
1384
|
+
}
|
|
1285
1385
|
}
|
|
1286
|
-
}).catch(function(){});
|
|
1386
|
+
}).catch(function(){ _fpReady = true; });
|
|
1287
1387
|
|
|
1288
1388
|
// Auto-poll after buy (works for both Stripe and Xunhupay)
|
|
1289
1389
|
var pollTimer = null, pollCount = 0, MAX_POLLS = 120;
|
|
@@ -1620,6 +1720,10 @@
|
|
|
1620
1720
|
stepTypes[data.index] = step.type || 'read';
|
|
1621
1721
|
ev('step_viewed', { step_number: data.index, type: step.type, risk: step.risk || 'low' });
|
|
1622
1722
|
|
|
1723
|
+
// Remove AI thinking card when first real step arrives
|
|
1724
|
+
var aiCard = document.getElementById('ai-thinking-card');
|
|
1725
|
+
if (aiCard) aiCard.remove();
|
|
1726
|
+
|
|
1623
1727
|
if (step.type === 'read') {
|
|
1624
1728
|
if (!document.getElementById('scan-block')) {
|
|
1625
1729
|
addScanBlock();
|