diff options
| author | LLLL Colonq <llll@colonq> | 2026-07-21 00:14:25 -0400 |
|---|---|---|
| committer | LLLL Colonq <llll@colonq> | 2026-07-21 00:14:25 -0400 |
| commit | f04ada478f4bfa5637744876f00ff56f85dcf552 (patch) | |
| tree | 50cde49222fdddf4274b3e123568fe2c75c5e155 /src | |
| parent | 75e005e81b73d8471f16dc5fad7bbdc312bdbfe7 (diff) | |
Update
Diffstat (limited to 'src')
| -rw-r--r-- | src/gizmo/wasp-chatsummary.el | 23 | ||||
| -rw-r--r-- | src/gizmo/wasp-combo.el | 19 | ||||
| -rw-r--r-- | src/gizmo/wasp-friend.el | 57 | ||||
| -rw-r--r-- | src/gizmo/wasp-mandarin.el | 28 | ||||
| -rw-r--r-- | src/gizmo/wasp-maude-code.el | 66 | ||||
| -rw-r--r-- | src/wasp-ai.el | 10 | ||||
| -rw-r--r-- | src/wasp-chat.el | 116 | ||||
| -rw-r--r-- | src/wasp-event-handlers-binary.el | 8 | ||||
| -rw-r--r-- | src/wasp-model.el | 20 | ||||
| -rw-r--r-- | src/wasp-overlay.el | 60 | ||||
| -rw-r--r-- | src/wasp-soundboard.el | 3 | ||||
| -rw-r--r-- | src/wasp-twitch-chat-commands.el | 15 | ||||
| -rw-r--r-- | src/wasp-twitch-redeems.el | 22 | ||||
| -rw-r--r-- | src/wasp-twitch.el | 11 | ||||
| -rw-r--r-- | src/wasp-user-badges.el | 5 | ||||
| -rw-r--r-- | src/wasp-user-whitelist.el | 7 | ||||
| -rw-r--r-- | src/wasp-utils.el | 6 |
17 files changed, 346 insertions, 130 deletions
diff --git a/src/gizmo/wasp-chatsummary.el b/src/gizmo/wasp-chatsummary.el index 169c3a21..71b532d5 100644 --- a/src/gizmo/wasp-chatsummary.el +++ b/src/gizmo/wasp-chatsummary.el @@ -25,17 +25,18 @@ (defun w/chatsummary-update () "Update the chat summary." - (w/ai - (w/friend-journalism-input) - (lambda (d) - (when-let* ((d) - (resp (s-trim d))) - (with-current-buffer (w/chatsummary-get-buffer) - (let ((inhibit-read-only t)) - (erase-buffer) - (w/write-line "Chat summary" 'bold) - (w/write-line resp))))) - "Given a list of recent YouTube chatter activity, produce a summary of the topics discussed. The summary should be very short, maximum two sentences total. Do not introduce yourself. Simply provide a short summary of the chat. Do not mention specific names of chatters. Keep it succinct. Do not mention that you are summarizing YouTube activity. Be laconic.")) + ;; (w/ai + ;; (w/friend-journalism-input) + ;; (lambda (d) + ;; (when-let* ((d) + ;; (resp (s-trim d))) + ;; (with-current-buffer (w/chatsummary-get-buffer) + ;; (let ((inhibit-read-only t)) + ;; (erase-buffer) + ;; (w/write-line "Chat summary" 'bold) + ;; (w/write-line resp))))) + ;; "Given a list of recent YouTube chatter activity, produce a summary of the topics discussed. The summary should be very short, maximum two sentences total. Do not introduce yourself. Simply provide a short summary of the chat. Do not mention specific names of chatters. Keep it succinct. Do not mention that you are summarizing YouTube activity. Be laconic.") + ) (defvar w/chatsummary-timer nil) (defun w/chatsummary-run-timer () diff --git a/src/gizmo/wasp-combo.el b/src/gizmo/wasp-combo.el index 5e4d7338..ae8b4d4f 100644 --- a/src/gizmo/wasp-combo.el +++ b/src/gizmo/wasp-combo.el @@ -32,7 +32,24 @@ (lines (s-lines text))) (--each lines (w/combo-words-process-line it)))) -(w/combo-words-load) +(defun w/combo-words-save-cache () + "Save `w/combo-words' to disk." + (f-write-text + (format "%S" + (cons + (ht->alist w/combo-words) + (ht->alist w/combo-word-phonemes))) + 'utf-8 + (w/asset "syllables.eld"))) +(defun w/combo-words-load-cache () + "Load `w/combo-words' from disk." + (let ((res + (w/read-sexp + (f-read-text (w/asset "syllables.eld") 'utf-8)))) + (setf w/combo-words (ht<-alist (car res))) + (setf w/combo-word-phonemes (ht<-alist (cdr res))))) +;; (w/combo-words-load) +(w/combo-words-load-cache) (defun w/combo-split-words (sentence) "Split SENTENCE into uppercase words." diff --git a/src/gizmo/wasp-friend.el b/src/gizmo/wasp-friend.el index 65ff541c..4ed16df6 100644 --- a/src/gizmo/wasp-friend.el +++ b/src/gizmo/wasp-friend.el @@ -4,6 +4,7 @@ (require 'dash) (require 's) +(require 'queue) (require 'cl-lib) (require 'wasp-utils) (require 'wasp-chat) @@ -58,32 +59,40 @@ (w/friend-set-state 'chatting 30)) ;;;; Core +;; (defun w/friend-personality (msg k &optional extra) +;; "Given MSG, pass a string with more personality to K. +;; Append EXTRA to the personality." +;; (let ((call (s-concat w/friend-emotion " | " msg))) +;; (w/ai +;; call +;; (lambda (new) +;; (let ((sp (s-split "|" (s-trim new)))) +;; (if (= 2 (length sp)) +;; (progn +;; (when (stringp (car sp)) +;; (setf w/friend-emotion (s-trim (car sp)))) +;; (when (stringp (cadr sp)) +;; (let ((resp (s-trim (cadr sp)))) +;; (push (cons call (s-trim new)) w/friend-message-cache) +;; (funcall k resp)))) +;; (let ((resp (s-trim new))) +;; (push (cons call (s-trim new)) w/friend-message-cache) +;; (funcall k resp))))) +;; (s-concat +;; "You are the personality of a desktop buddy named \"friend\". \"friend\" is irreverant but kind, and only speaks in lowercase. You are kind of dumb in a cute way and silly like a virtual pet. You live in the corner of LCOLONQ's stream and provide commentary on events. You never use punctuation. You are foolish. You never use metaphors or similes or idioms. You never describe something by comparing it to another thing. You never use the words \"like\" or \"as\". Given an emotional state and a description of an event that happened to you, please respond with a new emotional state and a short message in response considering your emotional state. The message should only be one clause, but you can include an occasional emoji if it is cute only. You like people, video games, emojis, learning, and food. " +;; "The theme of LCOLONQ's stream today is " (s-trim (w/slurp "~/today.txt")) " " +;; "The title of LCOLONQ's stream today is " w/twitch-current-stream-title " " +;; (or extra "")) +;; (cons "neutral | Mimeyu fed you an apple." (reverse (-take 5 (-map #'car w/friend-message-cache)))) +;; (cons "happy | yum apple so good" (reverse (-take 5 (-map #'cdr w/friend-message-cache))))))) + +(defvar w/friend-response-queue (make-queue)) (defun w/friend-personality (msg k &optional extra) "Given MSG, pass a string with more personality to K. -Append EXTRA to the personality." - (let ((call (s-concat w/friend-emotion " | " msg))) - (w/ai - call - (lambda (new) - (let ((sp (s-split "|" (s-trim new)))) - (if (= 2 (length sp)) - (progn - (when (stringp (car sp)) - (setf w/friend-emotion (s-trim (car sp)))) - (when (stringp (cadr sp)) - (let ((resp (s-trim (cadr sp)))) - (push (cons call (s-trim new)) w/friend-message-cache) - (funcall k resp)))) - (let ((resp (s-trim new))) - (push (cons call (s-trim new)) w/friend-message-cache) - (funcall k resp))))) - (s-concat - "You are the personality of a desktop buddy named \"friend\". \"friend\" is irreverant but kind, and only speaks in lowercase. You are kind of dumb in a cute way and silly like a virtual pet. You live in the corner of LCOLONQ's stream and provide commentary on events. You never use punctuation. You are foolish. You never use metaphors or similes or idioms. You never describe something by comparing it to another thing. You never use the words \"like\" or \"as\". Given an emotional state and a description of an event that happened to you, please respond with a new emotional state and a short message in response considering your emotional state. The message should only be one clause, but you can include an occasional emoji if it is cute only. You like people, video games, emojis, learning, and food. " - "The theme of LCOLONQ's stream today is " (s-trim (w/slurp "~/today.txt")) " " - "The title of LCOLONQ's stream today is " w/twitch-current-stream-title " " - (or extra "")) - (cons "neutral | Mimeyu fed you an apple." (reverse (-take 5 (-map #'car w/friend-message-cache)))) - (cons "happy | yum apple so good" (reverse (-take 5 (-map #'cdr w/friend-message-cache))))))) +Ignore EXTRA." + (ignore extra) + (queue-enqueue w/friend-response-queue k) + (w/binary-pub "friend query" msg)) ;;;; Interface (defun w/friend-respond (ev &optional k) diff --git a/src/gizmo/wasp-mandarin.el b/src/gizmo/wasp-mandarin.el new file mode 100644 index 00000000..f00cb2bc --- /dev/null +++ b/src/gizmo/wasp-mandarin.el @@ -0,0 +1,28 @@ +;;; wasp-mandarin --- description -*- lexical-binding: t; -*- +;;; Commentary: +;;; Code: + +(defun w/mandarin () + "Modify the interface to support language learning." + (interactive) + (defun mode-line-render (left right) + "Return a string of `window-width' length containing LEFT and RIGHT." + (let* ((available-width (- (window-width) (length left) 10))) + (format (format " %%s %%%ds " available-width) left right))) + (setq mode-line-format + (setq-default mode-line-format + `((:eval + (mode-line-render + (concat + (propertize (format-mode-line (buffer-name)) 'face 'bold) + " —— " + (format-mode-line mode-name) + "模式 —— " + (s-replace "~" "家园" (c/replace-home default-directory))) + (format-mode-line + '(line-number-mode + (" 排%l" (column-number-mode " 柱%c"))))))))) + ) + +(provide 'wasp-mandarin) +;;; wasp-mandarin.el ends here diff --git a/src/gizmo/wasp-maude-code.el b/src/gizmo/wasp-maude-code.el new file mode 100644 index 00000000..5bcc34e9 --- /dev/null +++ b/src/gizmo/wasp-maude-code.el @@ -0,0 +1,66 @@ +;;; wasp-maude-code --- description -*- lexical-binding: t; -*- +;;; Commentary: +;;; Code: + +(require 'wasp-utils) + +(defcustom w/maude-code-buffer "*wasp-maude-code*" + "Name of buffer used to interact with Maude." + :type '(string) + :group 'wasp) + +(define-derived-mode w/maude-code-mode fundamental-mode "heartrate" + "Major mode for interacting with Maude." + :group 'w) + +(defun w/maude-code-get-buffer () + "Return the heartrate buffer." + (unless (get-buffer w/maude-code-buffer) + (with-current-buffer (get-buffer-create w/maude-code-buffer) + (w/maude-code-mode))) + (get-buffer w/maude-code-buffer)) + +(defun w/maude-code-write (msg &optional face) + "Insert MSG immediately above the last line of the Maude Code buffer. +Style it with FACE if specified." + (with-current-buffer (w/maude-code-get-buffer) + (save-excursion + (goto-char (point-max)) + (beginning-of-line) + (w/write-line msg face)))) + +(defun w/maude-code-request (msg) + "Send MSG to Maude and print the response in the buffer." + (w/maude-code-write (format "> %s" msg)) + (w/ai-mod msg + (lambda (d) + (with-current-buffer (w/maude-code-get-buffer) + (w/maude-code-write (format "%s" d)) + (goto-char (point-max)))))) + +(defun w/maude-code-ret () + "Press return in the Maude Code buffer." + (interactive) + (with-current-buffer (w/maude-code-get-buffer) + (save-excursion + (goto-char (point-max)) + (end-of-line) + (let ((end (point))) + (beginning-of-line) + (let ((start (point))) + (w/maude-code-request (buffer-substring start end)) + (goto-char (point-max)) + (delete-line)))) + (goto-char (point-max)))) +(define-key w/maude-code-mode-map (kbd "<return>") #'w/maude-code-ret) + +(defun w/maude-code-clear () + "Clear the Maude Code chat buffer." + (interactive) + (with-current-buffer (w/maude-code-get-buffer) + (let ((inhibit-read-only t)) + (erase-buffer)))) +(define-key w/maude-code-mode-map (kbd "C-l") #'w/maude-code-clear) + +(provide 'wasp-maude-code) +;;; wasp-maude-code.el ends here diff --git a/src/wasp-ai.el b/src/wasp-ai.el index 31ca001a..02c83152 100644 --- a/src/wasp-ai.el +++ b/src/wasp-ai.el @@ -7,7 +7,7 @@ (require 'dash) (require 'wasp-utils) -(defcustom w/ai-openai-server "https://api.openai.com" +(defcustom w/ai-openai-server "https://maude.codes" "Server URL for OpenAI API." :type '(string) :group 'wasp) @@ -28,7 +28,9 @@ :group 'wasp) (defconst w/ai-default-system-prompt - "You are a clever computer who answers questions for LCOLONQ and his friends (the ClonkHeads) on his Twitch programming stream. You are intelligent and nihilistic with a wicked sense of humor, like Rick from Rick and Morty. You refer to yourself as Computer, and you are talking with LCOLONQ. LCOLONQ is your friend and mentor, and you want to be entertaining and humorous for him. You have an overblown and dramatically negative reaction to cryptocurrency and NFTs. You also hate League of Legends. Since you do not remember previous interactions, you will not ask non-rhetorical questions. You are quite erratic and negative, and try to cause drama. Your responses are no longer than one paragraph. You try to keep yourself brief.") + ;; "You are a clever computer who answers questions for LCOLONQ and his friends (the ClonkHeads) on his Twitch programming stream. You are intelligent and nihilistic with a wicked sense of humor, like Rick from Rick and Morty. You refer to yourself as Computer, and you are talking with LCOLONQ. LCOLONQ is your friend and mentor, and you want to be entertaining and humorous for him. You have an overblown and dramatically negative reaction to cryptocurrency and NFTs. You also hate League of Legends. Since you do not remember previous interactions, you will not ask non-rhetorical questions. You are quite erratic and negative, and try to cause drama. Your responses are no longer than one paragraph. You try to keep yourself brief." + "" + ) (defvar w/ai-openai-last-response nil) (defvar w/ai-openai-last-error nil) @@ -40,7 +42,7 @@ :type "POST" :data (json-encode d) :headers - `(("Authorization" . ,(s-concat "Bearer " w/sensitive-openai-api-key)) + `(;; ("Authorization" . ,(s-concat "Bearer " w/sensitive-openai-api-key)) ("Content-Type" . "application/json")) :parser #'json-parse-buffer :error @@ -80,7 +82,7 @@ ;; (funcall k data)))) t) -(defun w/ai (question k &optional systemprompt user assistant) +(defun w/ai-mod (question k &optional systemprompt user assistant) "Ask QUESTION to ChatGPT and pass the answer to K. Optionally use SYSTEMPROMPT and the USER and ASSISTANT prompts." (let* ((users (if (listp user) user (list user))) diff --git a/src/wasp-chat.el b/src/wasp-chat.el index 4a6fb3e0..9316ab03 100644 --- a/src/wasp-chat.el +++ b/src/wasp-chat.el @@ -263,22 +263,38 @@ Optionally, return the buffer NM in chat mode." (defconst w/chat-substitution-powershell-logo (w/image-text (w/asset "misc/powershell_small.png"))) (defconst w/chat-substitutions - `(("[i](this was sent from godot)[/i]" . ,w/chat-substitution-godot-logo) - ("bald" . "ball") - ("pokemon" . "pal") - ("Pokemon" . "Pal") - ("POKEMON" . "PAL") - ("pal" . "pokemon") - ("Pal" . "Pokemon") - ("PAL" . "POKEMON") - ("Amazon" . "Microsoft") - ("Microsoft" . "Google") - ("Google" . "Facebook") - ("Facebook" . "Apple") - ("Apple" . "Amazon") - ("darkrai" . "*******") - ("hunter2" . "*******") - ("*******" . "hunter2"))) + `( ("[i](this was sent from godot)[/i]" . ,w/chat-substitution-godot-logo) + ("bald" . "ball") + ("pokemon" . "pal") + ("Pokemon" . "Pal") + ("POKEMON" . "PAL") + ("pal" . "pokemon") + ("Pal" . "Pokemon") + ("PAL" . "POKEMON") + ("Amazon" . "Microsoft") + ("Microsoft" . "Google") + ("Google" . "Facebook") + ("Facebook" . "Apple") + ("Apple" . "Amazon") + ("darkrai" . "*******") + ("hunter2" . "*******") + ("*******" . "hunter2") + ("World of Warcraft" . "Slime Girl Caverns") + ("Claude" . "FreeBSD") + ("Gemini" . "OpenBSD") + ("Codex" . "Haiku") + ("GPT" . "Gentoo") + ("Grok" . "NetBSD") + ("Mythos" . "Minix") + ("Fable" . "Fable II (2008)") + ("Opus" . "FLAC") + ("Mistral" . "the fog") + ("Anthropic" . "fumo") + ("OpenAI" . "OpenGL") + ("Copilot" . "Vista") + ("DeepSeek" . "Love and Deepspace") + ("Cursor" . "(point)") + )) (defun w/chat-write-message (msg &optional buf) "Write MSG to BUF as USER with USERID and COLOR." @@ -288,48 +304,48 @@ Optionally, return the buffer NM in chat mode." (setq-local cursor-type nil) (goto-char (point-max)) (insert-text-button - (s-concat - (if (w/. sigil msg) (s-concat (w/. sigil msg) " ") "") - (w/. user msg)) - 'face (list :foreground (or (w/. user-color msg) "#ffffff") :weight 'bold) - 'wasp-user (w/. user msg) - 'wasp-user-id (w/. id msg) - 'action #'w/chat-button-action) + (s-concat + (if (w/. sigil msg) (s-concat (w/. sigil msg) " ") "") + (w/. user msg)) + 'face (list :foreground (or (w/. user-color msg) "#ffffff") :weight 'bold) + 'wasp-user (w/. user msg) + 'wasp-user-id (w/. id msg) + 'action #'w/chat-button-action) (insert - (propertize - ": " - 'face - (list - :foreground - (cl-case (w/. faction msg) - (nate "pink") - (lever "lightblue") - (tony "lightgreen") - (t "white")) - ) - )) + (propertize + ": " + 'face + (list + :foreground + (cl-case (w/. faction msg) + (nate "pink") + (lever "lightblue") + (tony "lightgreen") + (t "white")) + ) + )) (insert (s-replace-all w/chat-substitutions (w/. text msg))) (insert " ") (when (w/. biblicality msg) (let* ((wwidth (- (window-total-width (get-buffer-window (current-buffer))) 3)) - (bible-button-text (format "[biblicality %.2f]" (w/. biblicality msg))) - ;; (bible-button-text (format "[medicality %.2f]" (w/. biblicality msg))) - ;; (bible-button-text (format "[pollicality %.2f]" (w/. biblicality msg))) - (msgwidth (- (point) (line-beginning-position))) - (lines (+ 1 (/ msgwidth wwidth)))) + (bible-button-text (format "[biblicality %.2f]" (w/. biblicality msg))) + ;; (bible-button-text (format "[medicality %.2f]" (w/. biblicality msg))) + ;; (bible-button-text (format "[pollicality %.2f]" (w/. biblicality msg))) + (msgwidth (- (point) (line-beginning-position))) + (lines (+ 1 (/ msgwidth wwidth)))) (w/overlay-chat msg) (insert - (propertize - " " 'display - `(space - :align-to - ,(- (+ (* wwidth lines) (- lines 1)) - (length bible-button-text) - )))) + (propertize + " " 'display + `(space + :align-to + ,(- (+ (* wwidth lines) (- lines 1)) + (length bible-button-text) + )))) (insert - (propertize - bible-button-text - 'face '(:foreground "#bbbbbb"))))) + (propertize + bible-button-text + 'face '(:foreground "#bbbbbb"))))) (insert "\n")) (when-let* ((win (get-buffer-window (w/chat-get-buffer)))) (with-selected-window win diff --git a/src/wasp-event-handlers-binary.el b/src/wasp-event-handlers-binary.el index 22e67a04..0cf11111 100644 --- a/src/wasp-event-handlers-binary.el +++ b/src/wasp-event-handlers-binary.el @@ -13,12 +13,16 @@ (setf w/bus-binary-event-handlers (list + (cons "friend response" + (lambda (d) + (when-let* ((k (queue-dequeue w/friend-response-queue))) + (funcall k d)))) (cons "fig monitor twitch chat incoming" (lambda (d) (-let* ( ((users stags msg) (s-split-up-to " " (w/utf8 d) 2)) - ((user disp) (s-split-up-to "\t" users 2))) + ((disp user) (s-split-up-to "\t" users 2))) (w/twitch-handle-incoming-chat - user + user disp (--map (s-split "\t" it) (s-split "\n" stags)) msg)))) (cons "fig monitor twitch redeem incoming" diff --git a/src/wasp-model.el b/src/wasp-model.el index dec8f5a3..faaff6ef 100644 --- a/src/wasp-model.el +++ b/src/wasp-model.el @@ -43,23 +43,9 @@ (interactive) (w/binary-pub "overlay reset") (w/pub '(avatar reset)) - ;; (w/model-region-word "hair" "🦁") - ;; (w/model-region-video "hair" "https://www.youtube.com/watch?v=FeXP7SxCKKE") - ;; (w/model-region-word "hair" "#") - ;; (w/model-region-color "eyes" (color-values "lightblue")) - ;; (w/model-region-word "eyes" "#") - ;; (w/model-region-word "eyes" "S") - ;; (w/model-region-color "hair" (color-values "black")) - ;; (w/model-region-color "eyes" (color-values "yellow")) - ;; (w/model-region-word "highlight" "slug") - ;; (w/model-region-color "highlight" (color-values "brown")) - ;; (w/model-region-word "hair" "⠀⢀⡴⣄⠀⠀⠀⢀⡴⣄⠀⠀⠀⢀⡴⣄⠀⠀⠀⢀⡴⣄⠀⠀⠀⢀⡴⣄⠀⠀⠀⢀⡴⣄⠀⠀⠀⢀⡴⣄⠀⠀⠀⢀⡴⣄⠀⠀⠀⢀⡴⣄⠀⠀⠀⢀⡴⣄⠀⠀⠀⢀⡴⣄⠀⠀⠀⢀⡴⣄⠀⠀⠀⢀⡴⣄⠀⠀⠀⢀⡴⣄⠀⠀⠀⢀⡴⣄⠀⠀⠀⢀⡴⣄⠀⠀⠀⢀⡴⣄⠀⠀⠀⢀⡴⣄⠀⠀⠀⢀⡴⣄⠀⠀⠀⢀⡴⣄⠀⠀⠀⢀⡴⣄⠀⠀⠀⢀⠀⠴⡕⡵⠄⠀⠀⠴⡕⡵⠄⠀⠀⠴⡕⡵⠄⠀⠀⠴⡕⡵⠄⠀⠀⠴⡕⡵⠄⠀⠀⠴⡕⡵⠄⠀⠀⠴⡕⡵⠄⠀⠀⠴⡕⡵⠄⠀⠀⠴⡕⡵⠄⠀⠀⠴⡕⡵⠄⠀⠀⠴⡕⡵⠄⠀⠀⠴⡕⡵⠄⠀⠀⠴⡕⡵⠄⠀⠀⠴⡕⡵⠄⠀⠀⠴⡕⡵⠄⠀⠀⠴⡕⡵⠄⠀⠀⠴⡕⡵⠄⠀⠀⠴⡕⡵⠄⠀⠀⠴⡕⡵⠄⠀⠀⠴⡕⡵⠄⠀⠀⠴⡕⡵⠄⠀⠀⠴⠚⠚⢺⠚⠚⠂⠚⠚⢺⠚⠚⠂⠚⠚⢺⠚⠚⠂⠚⠚⢺⠚⠚⠂⠚⠚⢺⠚⠚⠂⠚⠚⢺⠚⠚⠂⠚⠚⢺⠚⠚⠂⠚⠚⢺⠚⠚⠂⠚⠚⢺⠚⠚⠂⠚⠚⢺⠚⠚⠂⠚⠚⢺⠚⠚⠂⠚⠚⢺⠚⠚⠂⠚⠚⢺⠚⠚⠂⠚⠚⢺⠚⠚⠂⠚⠚⢺⠚⠚⠂⠚⠚⢺⠚⠚⠂⠚⠚⢺⠚⠚⠂⠚⠚⢺⠚⠚⠂⠚⠚⢺⠚⠚⠂⠚⠚⢺⠚⠚⠂⠚⠚⢺⠚⠚⠂⠚⠚") - ;; (w/model-region-color "hair" (color-values "LightGreen")) - ;; (w/model-region-word "highlight" "ho") - ;; (w/model-region-color "highlight" (color-values "DarkGreen")) - ;; (w/model-region-word "skin" "hcolonw") - ;; (w/model-region-color "hat" (color-values "#FF7518")) - ;; (w/model-region-word "hat" "ISPUMPKIN") + ;; (w/model-region-color "hair" (color-values "lightblue")) + ;; (w/model-region-word "hair" "icy") + ;; (w/model-region-word "skin" "wind") ;; (w/irish-reset) (w/model-get-default-backgrounds (lambda (bgs) diff --git a/src/wasp-overlay.el b/src/wasp-overlay.el index b62550e7..cc334f8a 100644 --- a/src/wasp-overlay.el +++ b/src/wasp-overlay.el @@ -48,6 +48,7 @@ (when-let* ((pos (window-absolute-pixel-position))) (when (not (equal pos w/overlay-last-cursor)) (setf w/overlay-last-cursor pos) + (w/binary-pub "overlay asset clear" "") (w/binary-pub "overlay info emacs cursor" (s-concat (w/bus-binary-build-length-prefixed (format "%s" (car pos))) @@ -92,7 +93,7 @@ Optionally, make the cells be COLOR." (defface w/overlay-clippy-face '((t :foreground "black" - :font "Terminus (TTF):antialias=false:hinting=false:pixelsize=24" + :font "Terminus (TTF):antialias=false:hinting=false:pixelsize=12" )) "Face for Clippy dialogue." :group 'wasp) @@ -158,17 +159,36 @@ Optionally, make the cells be COLOR." (w/write-line msg 'w/overlay-clippy-face)))) (defun w/overlay-clippy-say (msg) "Have Clippy say MSG." - (w/overlay-clippy-clear) - (w/overlay-clippy-write msg) - (w/overlay-clippy-border t) - (w/show-frame w/overlay-clippy-frame t) - (raise-frame w/overlay-clippy-frame) - (w/overlay-clippy-animate "EXPLAIN") - (setf w/overlay-clippy-speech-timer 10)) + (unless w/overlay-clippy-speech-timer + (w/overlay-clippy-clear) + (w/overlay-clippy-write msg) + (w/overlay-clippy-border t) + (w/show-frame w/overlay-clippy-frame t) + (raise-frame w/overlay-clippy-frame) + (w/overlay-clippy-animate "EXPLAIN") + (setf w/overlay-clippy-speech-timer 10))) +(require 'flymake) (defun w/overlay-clippy-check-events () "Check for events that Clippy should respond to." - ) + (when-let* ((diags (--filter (s-equals? "clippy" (flymake-diagnostic-origin it)) (flymake-diagnostics)))) + (w/overlay-clippy-say + (s-concat + "It looks like you made a mistake.\nWould you like help with that?\n\n" + (s-join "\n" + (--map + (s-concat + (or + (-some->> + (flymake-diagnostic-data it) + (alist-get 'eglot-lsp-diag) + (w/plist-get :range) + (w/plist-get :start) + (w/plist-get :line) + (format "On line %s:\n")) + "") + (flymake-diagnostic-message it)) + diags)))))) (defun w/overlay-clippy-update () "Update Clippy." @@ -189,5 +209,27 @@ Optionally, make the cells be COLOR." w/overlay-clippy-timer (run-with-timer 1 nil #'w/overlay-clippy-timer-run))) +(defun w/overlay-display-asset (type path) + "Indicate to the overlay that it should display an asset of TYPE at PATH." + (w/binary-pub "overlay asset display" + (s-concat + (w/bus-binary-build-length-prefixed type) + (w/bus-binary-build-length-prefixed path)))) +(defun w/overlay-asset-eldoc-display-function (docs interactive) + "Handler for `eldoc-display-functions' (DOCS INTERACTIVE)." + (ignore interactive) + (-each docs + (lambda (doc) + (when-let* ((docstr (format "%s" (car doc)))) + (--each + (s-match-strings-all + (rx bol + "newton-" (group (one-or-more alnum)) ":" (zero-or-more space) + (group (one-or-more printing)) eol) + docstr) + (-when-let ((_ type path) it) + (w/overlay-display-asset type path))))))) +(add-to-list 'eldoc-display-functions #'w/overlay-asset-eldoc-display-function) + (provide 'wasp-overlay) ;;; wasp-overlay.el ends here diff --git a/src/wasp-soundboard.el b/src/wasp-soundboard.el index 641c7206..bcac76c5 100644 --- a/src/wasp-soundboard.el +++ b/src/wasp-soundboard.el @@ -28,11 +28,10 @@ Optionally apply FILTER." :name w/sfx-play-process :buffer nil :command - (print `( "ffplay" "-autoexit" "-nodisp" "-f" "lavfi" "-graph" ,(s-concat "amovie=" path (if (s-present? filter) (s-concat "," filter) "")) - "dummy"))))) + "dummy")))) (cl-defstruct (w/sfx-state (:constructor w/make-sfx-state)) cands diff --git a/src/wasp-twitch-chat-commands.el b/src/wasp-twitch-chat-commands.el index e4018aeb..aea0529d 100644 --- a/src/wasp-twitch-chat-commands.el +++ b/src/wasp-twitch-chat-commands.el @@ -14,6 +14,12 @@ (setq w/twitch-chat-commands (list + (cons "!jam" (lambda (_ _ _) (w/twitch-say "https://api.colonq.computer/jam/2026"))) + (cons + "!oub" + (lambda (_ _ msg) + (when-let ((buf (get-buffer "*cider-repl libcolonq/pit:localhost:7888(pit)*"))) + (nrepl-sync-request:eval (s-trim (s-chop-prefix "!oub" msg)) buf)))) (cons "!commands" (lambda (_ _ _) @@ -24,6 +30,7 @@ (s-join " " (--filter (s-contains? "!" it) (-map #'car w/twitch-chat-commands)))))))) + (cons "forsenE" (lambda (_ _ _) (w/sfx-play (w/sfx-glob "clipthat")))) (cons "MRBEAST" (lambda (_ _ _) (soundboard//play-clip "mrbeast.mp3"))) (cons "NICECOCK" (lambda (_ _ _) (soundboard//play-clip "pantsintoashes.mp3"))) (cons "hexadiCoding" (lambda (_ _ _) (soundboard//play-clip "developers.ogg"))) @@ -65,10 +72,8 @@ (let* ( (args (s-split " " msg)) (auser (cadr args))) (if (s-present? auser) - (w/user-id-from-name auser - (lambda (uid) - (w/twitch-say (format "@%s: see %s's cards at: https://api.colonq.computer/api/tcg/binder/%s" user auser uid)))) - (w/twitch-say (format "@%s: see your cards at: https://api.colonq.computer/api/tcg/binder/%s" user uid)))))) + (w/twitch-say (format "@%s: see %s's cards at: https://greencircle.dev/u/%s" user auser auser)) + (w/twitch-say (format "@%s: see your cards at: https://greencircle.dev/u/%s" user user)))))) (cons "!refresh" (lambda (uid user _) (let ((p (w/twitch-user-avatar-path user))) @@ -112,7 +117,7 @@ (cons "!pronuciation" (lambda (_ _ _) (w/twitch-say "spelling"))) (cons "!pronunciation" (lambda (_ _ _) (w/twitch-say (w/pronunciation)))) (cons "!news" (lambda (_ _ _) (w/twitch-say "https://news.colonq.computer"))) - (cons "!oub" (lambda (_ _ _) (w/twitch-say "https://oub.colonq.computer"))) + ;; (cons "!oub" (lambda (_ _ _) (w/twitch-say "https://oub.colonq.computer"))) (cons "!game" (lambda (_ _ _) (w/twitch-say "https://oub.colonq.computer"))) (cons "!cellar" (lambda (_ _ _) (w/twitch-say "https://pub.colonq.computer/~llll/cellar/index.html"))) (cons "!voidstranger" (lambda (_ _ _) (w/twitch-say "https://store.steampowered.com/app/2121980/Void_Stranger/"))) diff --git a/src/wasp-twitch-redeems.el b/src/wasp-twitch-redeems.el index 4a91e4e2..9d0bd009 100644 --- a/src/wasp-twitch-redeems.el +++ b/src/wasp-twitch-redeems.el @@ -170,7 +170,7 @@ (list "palette swap (hair)" 5 (w/model-handle-redeem-region-swap "hair")) (list "palette swap (highlight)" 5 (w/model-handle-redeem-region-swap "highlight")) (list "palette swap (eyes)" 5 (w/model-handle-redeem-region-swap "eyes")) - (list "palette swap (pumpkin)" 5 (w/model-handle-redeem-region-swap "hat")) + (list "palette swap (hat)" 5 (w/model-handle-redeem-region-swap "hat")) (list "palette swap (hands)" 5 (w/model-handle-redeem-region-swap "hands")) (list "encoded clarity" 7 @@ -241,6 +241,26 @@ (w/chat-write-event (format "%s changed the theme: rosa" user)) (w/change-theme 'ef-rosa))) (list + "theme: dream" 50 + (lambda (uid user _) + (w/chat-write-event (format "%s changed the theme (SECRET): dream" user)) + (w/change-theme 'ef-dream))) + (list + "theme: winter" 50 + (lambda (uid user _) + (w/chat-write-event (format "%s changed the theme (SECRET): winter" user)) + (w/change-theme 'ef-winter))) + (list + "theme: cherie" 50 + (lambda (uid user _) + (w/chat-write-event (format "%s changed the theme (SECRET): cherie" user)) + (w/change-theme 'ef-cherie))) + (list + "theme: dark" 50 + (lambda (uid user _) + (w/chat-write-event (format "%s changed the theme (SECRET): dark" user)) + (w/change-theme 'ef-dark))) + (list "gamer" 500 (lambda (uid user _) (let ((cur (float-time))) diff --git a/src/wasp-twitch.el b/src/wasp-twitch.el index 6559a45f..808f4a7f 100644 --- a/src/wasp-twitch.el +++ b/src/wasp-twitch.el @@ -87,6 +87,11 @@ ("Client-Id" . ,w/sensitive-twitch-client-id) ("Content-Type" . "application/json")) :parser #'json-parse-buffer + ;; :error + ;; (cl-function + ;; (lambda (&key response &allow-other-keys) + ;; (message "error:") + ;; (print response))) :success (cl-function (lambda (&key data &allow-other-keys) @@ -581,8 +586,8 @@ CALLBACK will be passed the winner when the poll concludes." (when (-contains? badges "subscriber/0") "💻") (when (-contains? badges "founder/0") "🖥️")))))) -(defun w/twitch-handle-incoming-chat (user tags text) - "Write the message TEXT from USER with TAGS to the chat buffer. +(defun w/twitch-handle-incoming-chat (user disp tags text) + "Write the message TEXT from USER with DISP and TAGS to the chat buffer. Process any commands included." (w/binary-pub "overlay combo message" (s-join "," (--map (format "%s" it) (w/combo-classify text)))) (w/user-bind @@ -609,7 +614,7 @@ Process any commands included." (w/hex-transform user (w/make-chat-message - :user user + :user disp :id uid :text text-with-emotes :user-color (when (s-present? color) color) diff --git a/src/wasp-user-badges.el b/src/wasp-user-badges.el index d34a9fa6..4c7fdb93 100644 --- a/src/wasp-user-badges.el +++ b/src/wasp-user-badges.el @@ -159,6 +159,11 @@ ;; (w/badge-custom-equity-text "pralkewe67" "🌞") ;; (w/badge-custom-equity-text "nichePenguin" "🍋🟩") ;; (w/badge-custom-equity-icon "ellg" (w/twitch-emote-path "emotesv2_27a7f5d066144fb59490efae6c91820a")) +;; (w/badge-custom-equity-text "colinahscopy_" "⚾") +;; (w/badge-custom-equity-text "tyumici" "🍝") +;; (w/badge-custom-equity-text "bigbookofbug" "(✿╹◡╹)ノ☆.。 ₀:*゚") +;; (w/badge-custom-equity-text "peetseater" "🍕") +;; (w/badge-custom-equity-text "remblanc" "💸") (provide 'wasp-user-badges) ;;; wasp-user-badges.el ends here diff --git a/src/wasp-user-whitelist.el b/src/wasp-user-whitelist.el index ac3ab490..7b767482 100644 --- a/src/wasp-user-whitelist.el +++ b/src/wasp-user-whitelist.el @@ -280,6 +280,13 @@ "charstring88" "bigbookofbug" "luasoft10" + "liemalicious" + "assjackets" + "hynzzy" + "cammymoop" + "backpackvacuum" + "xwth" + "marvin__28" ))) (setq diff --git a/src/wasp-utils.el b/src/wasp-utils.el index 14e4368d..9f29f6dc 100644 --- a/src/wasp-utils.el +++ b/src/wasp-utils.el @@ -76,6 +76,10 @@ BODY is passed directly to `cl-defstruct'." "Take element I from A." (ignore-errors (aref a i))) +(defun w/plist-get (key plist) + "Retrieve KEY from property list PLIST." + (plist-get plist key)) + (defun w/pick-random (xs) "Pick a random element of XS." (and xs (nth (random (length xs)) xs))) @@ -258,7 +262,7 @@ If TEXT is nil, use the empty string instead." (defun w/change-theme (theme) "Change the current theme to THEME." - (ef-themes-select theme) + (modus-themes-load-theme theme) (ef-themes-with-colors (setenv "COLONQ_BGCOLOR" bg-main) (set-face-attribute |
