Commits


Use vendored http library for HTTPS. - replace the libtls Conn, the ffi module, and the inline HTTP formatter with http::post - slack_post is six lines; parse_ok takes &str because http:: decodes Content-Length and Transfer-Encoding internally - drop -C link-arg=-ltls; vendor/http.rs carries #[link(name = "tls")] which propagates to dependents - vendor http at ssh://ijanc@ijanc.org/http commit ebd3a89


Auto-detect Block Kit payloads and post as blocks. If the message parses as a non-empty JSON array whose first element is an object with a string "type" field, send it as a "blocks" payload with a static fallback "text" for push and legacy notifications. Any other input, including messages that happen to be valid JSON but do not match that shape, is sent verbatim as text.


Use vendored jackson library for request and response JSON. Drop the hand-rolled json_escape() and the substring-based response scanner in favor of jackson's json_struct! macro. PostMessage and PostResponse capture the wire format as plain Rust structs and the generated ToJson/FromJson impls handle (de)serialisation, including escapes and optional fields via Option<T>. jackson lives under vendor/ as a single file and is built as a separate rlib linked via --extern, so sm.rs is still one rustc invocation away from a binary. vendor/VENDOR records the upstream commit so updates are a straightforward re-copy.


Document the Slack mrkdwn formatting that is handled server-side. sm transmits the message body verbatim and Slack renders it using its own mrkdwn variant, which is similar to but not identical to CommonMark. Add a matching FORMATTING section to README.md and sm.1 pointing at the upstream reference so callers do not assume CommonMark syntax. Also exclude the local channels scratch file from the working tree.


Initial import of sm, a minimal Slack message CLI. sm posts a single message to a Slack channel through the chat.postMessage API. TLS is provided by libtls over a raw TCP stream, and JSON is generated and parsed inline so there are no crate dependencies beyond the Rust standard library. The channel id and the message come from argv; a message of "-" is read from standard input. The token is taken from the SLACK_USER_TOKEN environment variable. sm exits 0 on success; on failure it exits non-zero and writes a diagnostic to standard error, distinguishing input, transport, and API errors.