docs: global terminology update from kernel/core to harness
This commit is contained in:
@@ -19,7 +19,7 @@ The *Telegram Gateway* provides bi-directional communication between the Soverei
|
||||
Enable mobile/remote access to the Org-Agent via a secure Telegram bot.
|
||||
|
||||
** 2. Success Criteria
|
||||
- [ ] *Inbound:* Messages from authorized Telegram IDs are injected into the Kernel Bus.
|
||||
- [ ] *Inbound:* Messages from authorized Telegram IDs are injected into the harness Bus.
|
||||
- [ ] *Outbound:* The `:telegram` target correctly routes messages to the Bot API.
|
||||
- [ ] *Persistence:* The polling offset is maintained to prevent duplicate processing.
|
||||
|
||||
@@ -82,19 +82,19 @@ Fetches the Bot API token from the secure vault.
|
||||
(token (get-telegram-token))
|
||||
(url (format nil "https://api.telegram.org/bot~a/sendMessage" token)))
|
||||
(when (and token chat-id text)
|
||||
(kernel-log "TELEGRAM: Sending message to ~a..." chat-id)
|
||||
(harness-log "TELEGRAM: Sending message to ~a..." chat-id)
|
||||
(handler-case
|
||||
(dex:post url
|
||||
:headers '(("Content-Type" . "application/json"))
|
||||
:content (cl-json:encode-json-to-string
|
||||
`((chat_id . ,chat-id) (text . ,text))))
|
||||
(error (c) (kernel-log "TELEGRAM ERROR: ~a" c))))))
|
||||
(error (c) (harness-log "TELEGRAM ERROR: ~a" c))))))
|
||||
#+end_src
|
||||
|
||||
** Sensor: getUpdates & Injection
|
||||
#+begin_src lisp :tangle ../src/gateway-telegram.lisp
|
||||
(defun telegram-process-updates ()
|
||||
"Polls for new messages and injects them into the kernel."
|
||||
"Polls for new messages and injects them into the harness."
|
||||
(let* ((token (get-telegram-token))
|
||||
(url (format nil "https://api.telegram.org/bot~a/getUpdates?offset=~a"
|
||||
token (1+ *telegram-last-update-id*))))
|
||||
@@ -111,14 +111,14 @@ Fetches the Bot API token from the secure vault.
|
||||
(text (cdr (assoc :text message))))
|
||||
(setf *telegram-last-update-id* update-id)
|
||||
(when (and text chat-id)
|
||||
(kernel-log "TELEGRAM: Received message from ~a" chat-id)
|
||||
(harness-log "TELEGRAM: Received message from ~a" chat-id)
|
||||
(inject-stimulus
|
||||
(list :type :EVENT
|
||||
:payload (list :sensor :chat-message
|
||||
:channel :telegram
|
||||
:chat-id (format nil "~a" chat-id)
|
||||
:text text)))))))
|
||||
(error (c) (kernel-log "TELEGRAM POLL ERROR: ~a" c))))))
|
||||
(error (c) (harness-log "TELEGRAM POLL ERROR: ~a" c))))))
|
||||
#+end_src
|
||||
|
||||
** Start Polling
|
||||
@@ -135,7 +135,7 @@ Initializes the Telegram background thread.
|
||||
(telegram-process-updates)
|
||||
(sleep 3)))
|
||||
:name "org-agent-telegram-gateway"))
|
||||
(kernel-log "TELEGRAM: Gateway polling active.")))
|
||||
(harness-log "TELEGRAM: Gateway polling active.")))
|
||||
#+end_src
|
||||
|
||||
** Stop Polling
|
||||
|
||||
Reference in New Issue
Block a user