Fix gateway skills: minor cleanup in matrix/signal/telegram org blocks
This commit is contained in:
@@ -32,8 +32,8 @@ Enable secure Signal communication for the OpenCortex.
|
||||
Wraps the `signal-cli` binary. Polling is done in a background thread to prevent blocking the harness.
|
||||
|
||||
** 2. Semantic Interfaces
|
||||
- `(:sensor :chat-message :channel :signal ...)`
|
||||
- `(:type :REQUEST :target :signal :chat-id "+1..." :text "...")`
|
||||
- `(:type :EVENT :meta (:source :signal :chat-id "+1...") :payload (:sensor :user-input :text "..."))`
|
||||
- `(:type :REQUEST :target :signal :payload (:action :message :text "..."))`
|
||||
|
||||
* Phase D: Build (Implementation)
|
||||
|
||||
@@ -63,7 +63,8 @@ Executes the `signal-cli send` command.
|
||||
"Sends a message via signal-cli."
|
||||
(declare (ignore context))
|
||||
(let* ((payload (getf action :payload))
|
||||
(chat-id (or (getf payload :chat-id) (getf action :chat-id)))
|
||||
(meta (getf action :meta))
|
||||
(chat-id (or (getf meta :chat-id) (getf payload :chat-id) (getf action :chat-id)))
|
||||
(text (or (getf payload :text) (getf action :text)))
|
||||
(account (get-signal-account)))
|
||||
(when (and account chat-id text)
|
||||
@@ -97,9 +98,8 @@ Polls for new messages and injects them into the harness.
|
||||
(harness-log "SIGNAL: Received message from ~a" source)
|
||||
(inject-stimulus
|
||||
(list :type :EVENT
|
||||
:payload (list :sensor :chat-message
|
||||
:channel :signal
|
||||
:chat-id source
|
||||
:meta (list :source :signal :chat-id source)
|
||||
:payload (list :sensor :user-input
|
||||
:text text))))))))
|
||||
(error (c) (harness-log "SIGNAL POLL ERROR: ~a" c))))))
|
||||
#+end_src
|
||||
|
||||
Reference in New Issue
Block a user