Fix gateway skills: minor cleanup in matrix/signal/telegram org blocks

This commit is contained in:
2026-04-25 18:44:41 -04:00
parent 2db53fae17
commit 5f2b7e8d16
3 changed files with 18 additions and 19 deletions

View File

@@ -32,8 +32,8 @@ Integrate the OpenCortex into the Matrix federation for secure, distributed chat
Autonomous background polling of the Matrix homeserver. Uses `dexador` for HTTP and `cl-json` for parsing.
** 2. Semantic Interfaces
- `(:sensor :chat-message :channel :matrix ...)`
- `(:type :REQUEST :target :matrix :room-id "..." :text "...")`
- `(:type :EVENT :meta (:source :matrix :room-id "...") :payload (:sensor :user-input :text "..."))`
- `(:type :REQUEST :target :matrix :payload (:action :message :text "..."))`
* Phase D: Build (Implementation)
@@ -73,7 +73,8 @@ Sends an `m.room.message` to a Matrix room.
"Sends a message via Matrix Client API."
(declare (ignore context))
(let* ((payload (getf action :payload))
(room-id (or (getf payload :room-id) (getf action :room-id)))
(meta (getf action :meta))
(room-id (or (getf meta :room-id) (getf payload :room-id) (getf action :room-id)))
(text (or (getf payload :text) (getf action :text)))
(hs (get-matrix-homeserver))
(token (get-matrix-token))
@@ -126,10 +127,8 @@ Polls the `/sync` endpoint and processes timeline events.
(harness-log "MATRIX: Received message from ~a in ~a" sender room-id)
(inject-stimulus
(list :type :EVENT
:payload (list :sensor :chat-message
:channel :matrix
:room-id room-id
:sender sender
:meta (list :source :matrix :room-id room-id :sender sender)
:payload (list :sensor :user-input
:text body)))))))))
(error (c) (harness-log "MATRIX SYNC ERROR: ~a" c))))))
#+end_src