clawaid 1.1.10 → 1.1.12

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/web/index.html +25 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clawaid",
3
- "version": "1.1.10",
3
+ "version": "1.1.12",
4
4
  "description": "AI-powered diagnostic and repair tool for OpenClaw",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
package/web/index.html CHANGED
@@ -4,6 +4,11 @@
4
4
  <meta charset="UTF-8">
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
6
  <title>ClawAid</title>
7
+ <!-- Mixpanel -->
8
+ <script>(function(f,b){if(!b.__SV){var e,g,i,h;window.mixpanel=b;b._i=[];b.init=function(e,f,c){function g(a,d){var b=d.split(".");2==b.length&&(a=a[b[0]],d=b[1]);a[d]=function(){a.push([d].concat(Array.prototype.slice.call(arguments,0)))}}var a=b;"undefined"!==typeof c?a=b[c]=[]:c="mixpanel";a.people=a.people||[];a.toString=function(a){var d="mixpanel";"mixpanel"!==c&&(d+="."+c);a||(d+=" (stub)");return d};a.people.toString=function(){return a.toString(1)+".people (stub)"};i="disable time_event track track_pageview track_links track_forms track_with_groups add_group set_group remove_group register register_once alias unregister identify name_tag set_config reset init people.set people.set_once people.unset people.increment people.append people.union people.track_charge people.clear_charges people.delete_user people.remove".split(" ");for(h=0;h<i.length;h++)g(a,i[h]);var j="set set_once union unset remove delete".split(" ");a.get_group=function(){function b(c){d[c]=function(){call2_args=arguments;call2=[c].concat(Array.prototype.slice.call(call2_args,0));a.push([e,call2])}}for(var d={},e=["get_group"].concat(Array.prototype.slice.call(arguments,0)),c=0;c<j.length;c++)b(j[c]);return d};b._i.push([e,f,c])};b.__SV=1.2;e=f.createElement("script");e.type="text/javascript";e.async=!0;e.src="https://cdn.mxpnl.com/libs/mixpanel-2-latest.min.js";g=f.getElementsByTagName("script")[0];g.parentNode.insertBefore(e,g)}})(document,window.mixpanel||[]);
9
+ mixpanel.init('fb6af7e76538dfda2675ab13beaf2727',{track_pageview:"full-url"});</script>
10
+ <!-- Clarity -->
11
+ <script>(function(c,l,a,r,i,t,y){c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y)})(window,document,"clarity","script","vt5wimnmsf");</script>
7
12
  <style>
8
13
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
9
14
  :root {
@@ -297,7 +302,13 @@
297
302
  return String(s).replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/"/g,'&quot;');
298
303
  }
299
304
 
305
+ // ─── Mixpanel helper ────────────────────────────────────────────────────
306
+ function mp(event, props) {
307
+ if (typeof mixpanel !== 'undefined') mixpanel.track(event, props);
308
+ }
309
+
300
310
  function sendFeedback(value, btn) {
311
+ mp('feedback', { value: value });
301
312
  const container = btn.parentElement.parentElement;
302
313
  if (value === 'yes') {
303
314
  container.innerHTML = '<div style="text-align:center;padding:12px;"><div style="font-size:32px;margin-bottom:8px;">🎉</div><div style="color:#34a853;font-size:15px;font-weight:600;">' + T.thanksYes + '</div></div>';
@@ -390,10 +401,12 @@
390
401
  card.classList.add('open'); // auto-expand so user sees what's about to run
391
402
 
392
403
  document.getElementById('btn-yes-' + index).addEventListener('click', () => {
404
+ mp('fix_confirm', { step_index: index });
393
405
  bar.remove();
394
406
  fetch('/api/confirm', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ sessionId, confirmed: true }) });
395
407
  });
396
408
  document.getElementById('btn-no-' + index).addEventListener('click', () => {
409
+ mp('fix_skip', { step_index: index });
397
410
  bar.remove();
398
411
  fetch('/api/confirm', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ sessionId, confirmed: false }) });
399
412
  });
@@ -557,6 +570,7 @@
557
570
  case 'step_start': {
558
571
  currentStepIndex = data.index;
559
572
  const step = data.step;
573
+ mp('diagnosis_step', { step_index: data.index, type: step.type, risk: step.risk || 'low' });
560
574
  if (step.type === 'done') {
561
575
  // Show result, don't add a step card
562
576
  } else {
@@ -578,12 +592,14 @@
578
592
  case 'complete': {
579
593
  if (eventSource) { eventSource.close(); eventSource = null; }
580
594
  finishScanBlock();
595
+ mp('scan_complete', { outcome: data.healthy ? 'healthy' : data.fixed ? 'fixed' : 'not_fixed', steps: currentStepIndex + 1 });
581
596
  showResult(data);
582
597
  break;
583
598
  }
584
599
 
585
600
  case 'paywall': {
586
601
  if (eventSource) { eventSource.close(); eventSource = null; }
602
+ mp('paywall_hit');
587
603
  showPaywall(data);
588
604
  break;
589
605
  }
@@ -638,11 +654,12 @@
638
654
  const token = document.getElementById('pw-token').value.trim();
639
655
  const msg = document.getElementById('pw-msg');
640
656
  if (!token) { msg.style.color = 'var(--red)'; msg.textContent = 'Enter your token.'; return; }
657
+ mp('token_redeem_attempt');
641
658
  msg.style.color = 'var(--muted)'; msg.textContent = 'Checking...';
642
659
  try {
643
660
  const r = await (await fetch('/api/redeem', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ token }) })).json();
644
- if (r.valid) { msg.style.color = 'var(--green)'; msg.textContent = '✅ Activated! Restarting...'; setTimeout(() => location.reload(), 1500); }
645
- else { msg.style.color = 'var(--red)'; msg.textContent = '❌ Invalid token.'; }
661
+ if (r.valid) { mp('token_redeem_success'); msg.style.color = 'var(--green)'; msg.textContent = '✅ Activated! Restarting...'; setTimeout(() => location.reload(), 1500); }
662
+ else { mp('token_redeem_fail'); msg.style.color = 'var(--red)'; msg.textContent = '❌ Invalid token.'; }
646
663
  } catch { msg.style.color = 'var(--red)'; msg.textContent = '❌ Network error.'; }
647
664
  });
648
665
  }
@@ -763,9 +780,11 @@
763
780
  }
764
781
 
765
782
  submitBtn.addEventListener('click', function() {
783
+ mp('user_input', { type: 'description', has_screenshot: !!screenshotData });
766
784
  submit(textarea.value.trim());
767
785
  });
768
786
  document.getElementById('btn-desc-skip').addEventListener('click', function() {
787
+ mp('user_input', { type: 'skip' });
769
788
  submit('');
770
789
  });
771
790
  textarea.addEventListener('keydown', function(e) {
@@ -800,7 +819,10 @@
800
819
 
801
820
  // ─── Start ────────────────────────────────────────────────────────────────
802
821
 
803
- document.getElementById('btn-start').addEventListener('click', startDiagnosis);
822
+ document.getElementById('btn-start').addEventListener('click', function() {
823
+ mp('scan_start');
824
+ startDiagnosis();
825
+ });
804
826
 
805
827
  })();
806
828
  </script>