daedalus-cli 3.80.5 → 3.81.0

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.
@@ -573,13 +573,17 @@ function autoResizeInput() {
573
573
  chatInput.style.height = Math.min(chatInput.scrollHeight, 180) + 'px';
574
574
  }
575
575
 
576
+ let isSubmittingChat = false;
577
+
576
578
  if (chatForm && chatInput) {
577
579
  chatInput.addEventListener('input', autoResizeInput);
578
580
 
579
581
  chatInput.addEventListener('keydown', (e) => {
580
582
  if (e.key === 'Enter' && !e.shiftKey) {
581
583
  e.preventDefault();
582
- chatForm.dispatchEvent(new Event('submit', { cancelable: true }));
584
+ if (!isSubmittingChat) {
585
+ chatForm.dispatchEvent(new Event('submit', { cancelable: true }));
586
+ }
583
587
  return;
584
588
  }
585
589
 
@@ -623,8 +627,14 @@ if (chatForm && chatInput) {
623
627
 
624
628
  chatForm.addEventListener('submit', async (e) => {
625
629
  e.preventDefault();
630
+ if (isSubmittingChat) return;
631
+
626
632
  const text = chatInput.value.trim();
627
633
  if (!text && !currentAttachment) return;
634
+
635
+ isSubmittingChat = true;
636
+ const sendBtn = document.getElementById('chat-send-btn');
637
+ if (sendBtn) sendBtn.disabled = true;
628
638
 
629
639
  let effectiveText = text;
630
640
  if (currentAttachment && !currentAttachment.isImage && currentAttachment.textContent) {
@@ -661,12 +671,16 @@ if (chatForm && chatInput) {
661
671
  });
662
672
 
663
673
  if (!res.ok) {
674
+ isSubmittingChat = false;
675
+ if (sendBtn) sendBtn.disabled = false;
664
676
  removeThinkingSpinner();
665
677
  const errData = await res.json().catch(() => ({}));
666
678
  addChatMessage('error', `Error: ${errData.error || res.statusText}`);
667
679
  if (chatStatusBadge) chatStatusBadge.textContent = 'ERROR';
668
680
  }
669
681
  } catch (err) {
682
+ isSubmittingChat = false;
683
+ if (sendBtn) sendBtn.disabled = false;
670
684
  removeThinkingSpinner();
671
685
  addChatMessage('error', `Network Error: ${err.message}`);
672
686
  if (chatStatusBadge) chatStatusBadge.textContent = 'ERROR';
@@ -955,6 +969,9 @@ function connectSSE() {
955
969
  }
956
970
 
957
971
  if (data.type === 'chat_done') {
972
+ isSubmittingChat = false;
973
+ const sendBtn = document.getElementById('chat-send-btn');
974
+ if (sendBtn) sendBtn.disabled = false;
958
975
  removeThinkingSpinner();
959
976
  if (activeAssistantBody && activeAssistantBody.dataset.raw) {
960
977
  activeAssistantBody.innerHTML = renderMarkdown(activeAssistantBody.dataset.raw);
@@ -973,6 +990,9 @@ function connectSSE() {
973
990
  }
974
991
 
975
992
  if (data.type === 'chat_error') {
993
+ isSubmittingChat = false;
994
+ const sendBtn = document.getElementById('chat-send-btn');
995
+ if (sendBtn) sendBtn.disabled = false;
976
996
  removeThinkingSpinner();
977
997
  addChatMessage('error', `Execution error: ${data.content}`, null, null, data.timestamp);
978
998
  if (chatStatusBadge) chatStatusBadge.textContent = 'ERROR';
@@ -1657,13 +1677,23 @@ function applyTouchOptimizations(configs) {
1657
1677
  */
1658
1678
  function addDualInteractionListeners(el, handler) {
1659
1679
  if (!el) return;
1680
+ let lastHandledTime = 0;
1681
+ function safeHandler(e) {
1682
+ const now = Date.now();
1683
+ if (now - lastHandledTime < 350) {
1684
+ if (e && typeof e.preventDefault === 'function') e.preventDefault();
1685
+ return;
1686
+ }
1687
+ lastHandledTime = now;
1688
+ handler(e);
1689
+ }
1660
1690
  el.addEventListener('pointerdown', function (e) {
1661
- e.preventDefault();
1662
- handler();
1691
+ safeHandler(e);
1663
1692
  });
1664
- // Keep click for keyboard / accessibility
1665
1693
  if (!el.dataset._hasClickBound) {
1666
- el.addEventListener('click', handler);
1694
+ el.addEventListener('click', function (e) {
1695
+ safeHandler(e);
1696
+ });
1667
1697
  el.dataset._hasClickBound = 'true';
1668
1698
  }
1669
1699
  }
@@ -1702,15 +1732,6 @@ document.addEventListener('DOMContentLoaded', function () {
1702
1732
  }
1703
1733
  );
1704
1734
 
1705
- // #send-btn — submits the chat form
1706
- addDualInteractionListeners(
1707
- document.getElementById('send-btn'),
1708
- function () {
1709
- var form = document.getElementById('chat-form');
1710
- if (form) form.dispatchEvent(new Event('submit', { bubbles: true, cancelable: true }));
1711
- }
1712
- );
1713
-
1714
1735
  // #model-modal-close — closes model selection modal
1715
1736
  addDualInteractionListeners(
1716
1737
  document.getElementById('model-modal-close'),
@@ -38,6 +38,15 @@ async function handleActivate(event) {
38
38
  }
39
39
 
40
40
  async function handleFetch(event) {
41
+ if (event.request.method !== 'GET') {
42
+ return;
43
+ }
44
+
45
+ const url = new URL(event.request.url);
46
+ if (url.pathname.startsWith('/api') || url.pathname.startsWith('/telemetry') || url.pathname.startsWith('/qr')) {
47
+ return;
48
+ }
49
+
41
50
  try {
42
51
  const cachedResponse = await caches.match(event.request);
43
52
  if (cachedResponse) {
@@ -45,7 +54,7 @@ async function handleFetch(event) {
45
54
  }
46
55
 
47
56
  const networkResponse = await fetch(event.request);
48
- if (networkResponse && networkResponse.status === 200) {
57
+ if (networkResponse && networkResponse.status === 200 && event.request.method === 'GET') {
49
58
  const responseClone = networkResponse.clone();
50
59
  await caches.open(CACHE_NAME).then((cache) => {
51
60
  return cache.put(event.request, responseClone);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "daedalus-cli",
3
- "version": "3.80.5",
3
+ "version": "3.81.0",
4
4
  "description": "Local-first AI coding CLI with embedded model router, multi-agent orchestration, and codebase indexing",
5
5
  "type": "module",
6
6
  "bin": {