Documentation
¶
Overview ¶
Package exthook runs optional external processes for experimental client-side automation. See CLIENT_HOOKS.md in the repo root for the full protocol and security notes. Hook-related MARCHAT_* variables appear in marchat-client -doctor output; receive/send paths are validated there when set.
Enable with environment variables (no config file yet):
MARCHAT_CLIENT_HOOK_RECEIVE: absolute path to executable (one JSON line on stdin) MARCHAT_CLIENT_HOOK_SEND: same for outbound chat-related sends MARCHAT_CLIENT_HOOK_TIMEOUT_SEC: optional, default 5 MARCHAT_CLIENT_HOOK_RECEIVE_TYPING=1: include typing indicators in receive hook (default: off) MARCHAT_CLIENT_HOOK_DEBUG=1: log successful hook runs (duration, optional stdout preview)
Security: only absolute paths are accepted. Hooks see plaintext after decrypt (receive) or plaintext before wire send (send). Do not point at untrusted binaries.
Index ¶
Constants ¶
const ( EventMessageReceived = "message_received" EventMessageSend = "message_send" )
Event names are stable for trial integrations; not yet a public protocol.
Variables ¶
This section is empty.
Functions ¶
func FireReceive ¶
FireReceive runs asynchronously after the client has prepared a chat message (including decrypt).
func ValidateHookExecutable ¶
ValidateHookExecutable checks that path is non-empty, absolute, and refers to an existing regular file. It returns the cleaned path. Used by client diagnostics (-doctor).
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
Example stdin hook: append each JSON line to a log file for spike testing.
|
Example stdin hook: append each JSON line to a log file for spike testing. |