Commit3de2bbd9Recorded27 Apr 2026Repositorysigil-irc
Bump to v0.8.0; rewire deps to extracted standalone repos
Message
package.sgl
name: "sigil-irc"
version: "0.7.0" -> "0.8.0"
sigil: "^0.14"
dependencies:
sigil-socket ^0.9.0 (codeberg:sigil/sigil) -> ^0.14 (codeberg:sigil/sigil-socket)
sigil-tls ^0.9.0 (codeberg:sigil/sigil) -> ^0.14.1 (codeberg:sigil/sigil-tls)
sigil-crypto ^0.9.0 (codeberg:sigil/sigil) -> ^0.15 (codeberg:sigil/sigil-crypto)
sigil-stdlib dropped from explicit deps — auto-derived from
`sigil: "^0.14"` per the 0.14 ecosystem convention. Why minor (0.7 -> 0.8) instead of patch (0.7.x -> 0.7.y):
the diff reshapes sigil-irc from a client-only library into
the canonical IRC protocol library (parser + types + state
machines for both directions of the protocol). New top-level
modules: identity, tags, numerics, capability,
cap-negotiation, sasl, sasl-scram, batch, chathistory,
read-marker, monitor. The legacy convenience client API in
(sigil irc connection) is preserved unchanged for backwards
compatibility. dev-redirects.sgl — point at all extracted standalone repos
for local development (sigil-lang, sigil-socket, sigil-tls,
sigil-crypto). sigil.lock — regenerated against the new dep graph.
Resolved versions: sigil-stdlib 0.14.11, sigil-socket 0.14.0,
sigil-tls 0.14.1, sigil-crypto 0.15.0, sigil-lib 0.14.11. .gitignore — add .sigil/ (deps cache). README + CHANGELOG — documented the new module set, server-
side examples, identity story, and the v0.8.0 entry.Changed
.gitignore | 1 +
CHANGELOG.md | 24 ++++++++++++++++++++++++
README.md | 133 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------
dev-redirects.sgl | 16 +++++++++++++---
package.sgl | 21 ++++++++++++---------
sigil.lock | 35 ++++++++++++++++-------------------
6 files changed, 169 insertions(+), 61 deletions(-)Diff
.gitignoremodified
@@ -1 +1,2 @@
1
build/+2
.sigil/CHANGELOG.mdmodified
@@ -7,6 +7,30 @@ All notable changes to this project will be documented in this file.
7
The format is based on [Keep a Changelog](https://keepachangelog.com/), 8
and this project adheres to [Semantic Versioning](https://semver.org/). 9
+10
## [0.8.0] - 2026-04-27+11
+12
### Added+13
+14
- Reshaped from a client-only library into the canonical IRC protocol library for the Sigil ecosystem. Adds parser, types, capability descriptors, numeric constants, and state-machine helpers covering both client AND server flows.+15
- Added IRCv3 message tags: full `@key=value;…` parsing/serialization with escape handling (`\:` `\s` `\\` `\r` `\n`), typed accessors for `time`, `msgid`, `account`, `batch`, `label`, `+draft/reply`, `+typing`, plus a tagged-line builder `make-irc-command/tags`.+16
- Added `(sigil irc identity)`: qualified `<nick>@<server-domain>` identity with display + canonical accessors. Federation-readiness constraint — future CrafterNet sovereign-per-server federation requires identities to be qualified from day one.+17
- Added `(sigil irc numerics)`: named bindings for 50+ numeric reply codes (welcome, MOTD, errors, SASL, MONITOR, standard replies).+18
- Added `(sigil irc capability)`: capability descriptor record + parser for `LS`/`REQ` argument bodies. Tier 1 caps (`sasl`, `message-tags`, `server-time`, `account-tag`, `account-notify`, `extended-join`, `userhost-in-names`, `multi-prefix`, `away-notify`, `chghost`, `invite-notify`, `setname`, `batch`, `labeled-response`, `echo-message`, `cap-notify`) + Tier 2 caps (`draft/chathistory`, `draft/read-marker`, `MONITOR`).+19
- Added `(sigil irc cap-negotiation)`: client and server CAP state machines as composable values. Multi-line `LS` continuation, atomic `REQ` enable/disable, NAK rejection, `LIST`, `END`, `NEW`/`DEL` runtime announcements.+20
- Added `(sigil irc sasl)`: SASL state machines for client and server. PLAIN + EXTERNAL mechanisms ship working; chunked AUTHENTICATE base64 encoding/decoding handles the 400-char chunking spec including the empty-+ terminator. Pluggable `verify` callback for server-side credential check; pluggable `scram-driver` slot for SCRAM mechanisms.+21
- Added `(sigil irc sasl-scram)`: SCRAM-SHA-256 driver per RFC 5802 / RFC 7677. Both client and server flows. Server uses a `fetch` callback to retrieve persistently stored `scram-credentials` (salt + iterations + stored-key + server-key); never stores plaintext passwords. `derive-scram-credentials` helper for use at user registration. Requires sigil-crypto v0.15.0+ (`pbkdf2-sha256`, `hmac-sha256-bytes`).+22
- Added `(sigil irc batch)`: `BATCH +reftag` / `BATCH -reftag` line builders, reftag generator, and a batch-context tracker for receiving sides.+23
- Added `(sigil irc chathistory)`: `CHATHISTORY` query parser/serializer for BEFORE / AFTER / LATEST / AROUND / BETWEEN / TARGETS subcommands; selector parser for `*` / `timestamp=` / `msgid=`; FAIL standard-reply error codes.+24
- Added `(sigil irc read-marker)`: `MARKREAD` parser + builders for the `draft/read-marker` capability (cross-device last-read sync).+25
- Added `(sigil irc monitor)`: MONITOR client-side line builder, server-side numeric reply builders for `RPL_MONONLINE` (730), `RPL_MONOFFLINE` (731), `RPL_MONLIST` (732), `RPL_ENDOFMONLIST` (733), `ERR_MONLISTFULL` (734).+26
- Added comprehensive test suite covering each new module with IRCv3 spec-derived test vectors. SCRAM-SHA-256 end-to-end tests guard on crypto-primitive availability and skip gracefully on older sigil binaries.+27
+28
### Changed+29
+30
- Bumped sigil version requirement to `^0.14`.+31
- Reorganized dependencies to point at extracted standalone repos (`codeberg:sigil/sigil-socket`, `codeberg:sigil/sigil-tls`, `codeberg:sigil/sigil-crypto`) instead of the old monorepo path. Bumped sigil-crypto to `^0.15` for SCRAM-SHA-256 primitives.+32
- Existing client API in `(sigil irc connection)` retained unchanged for backwards compatibility.+33
34
## [0.7.0] - 2026-03-01 35
36
### AddedREADME.mdmodified
@@ -1,70 +1,143 @@
1
# sigil-irc 2
−3
A [Sigil](https://codeberg.org/sigil/sigil) library for IRC messaging. Provides a full client with TLS support, SASL authentication, channel tracking, and cooperative non-blocking I/O.+3
The canonical IRC protocol library for the [Sigil](https://codeberg.org/sigil/sigil) ecosystem. Covers both client and server flows for modern IRCv3 (Tier 1 ratified caps + Tier 2 high-value drafts), plus a convenience client API with TLS and cooperative I/O. 4
5
## Features 6
−7
- **TLS connections** -- secure connections to IRC servers−8
- **SASL authentication** -- PLAIN mechanism via CAP negotiation−9
- **Message parsing** -- full IRC protocol message parsing and construction−10
- **Channel tracking** -- automatic join/part/nick tracking−11
- **Event handlers** -- per-command and general message handlers−12
- **NickServ** -- built-in IDENTIFY support (including grouped nicks)−13
- **Nick collision** -- automatic fallback with `_` suffix−14
- **Cooperative I/O** -- blocking (`irc-run`) or non-blocking (`irc-tick`) event loops+7
### Wire layer 8
−16
## Usage+9
- **IRC line parser** — handles RFC 1459/2812 prefix/command/params/trailing+10
- **IRCv3 message tags** — full `@key=value;…` parsing/serialization with escape handling (`\:` `\s` `\\` `\r` `\n`)+11
- **Identity type** — fully-qualified `<nick>@<server-domain>` with display + canonical accessors (federation-ready from day one)+12
- **Numeric reply constants** — named bindings for the 50+ relevant IRC numerics (welcome, MOTD, errors, SASL, MONITOR) 13
−18
Add `sigil-irc` as a dependency in your `package.sgl`:+14
### Capability negotiation (both directions) 15
−20
```scheme−21
(from-git url: "codeberg:sigil/sigil-irc" package: "sigil-irc")−22
```+16
- **CAP state machines** — `cap-client-state` and `cap-server-state` advance values with no I/O+17
- **Tier 1 caps** — `sasl`, `message-tags`, `server-time`, `account-tag`, `account-notify`, `extended-join`, `userhost-in-names`, `multi-prefix`, `away-notify`, `chghost`, `invite-notify`, `setname`, `batch`, `labeled-response`, `echo-message`, `cap-notify`+18
- **Tier 2 caps** — `draft/chathistory`, `draft/read-marker`, `MONITOR`+19
+20
### SASL (both directions)+21
+22
- **PLAIN** — `authzid \0 authcid \0 password`+23
- **EXTERNAL** — TLS client cert+24
- **SCRAM-SHA-256** — RFC 5802 / RFC 7677 challenge-response (requires sigil-crypto v0.15.0+ for `pbkdf2-sha256` + `hmac-sha256-bytes`)+25
- **Chunked AUTHENTICATE** — full base64 chunking per the IRCv3 spec+26
+27
### IRCv3 features+28
+29
- **BATCH** — start/end line builders, reftag generator, batch-tag tracking+30
- **CHATHISTORY** — query parsing (BEFORE/AFTER/LATEST/AROUND/BETWEEN/TARGETS) + serialization+31
- **MARKREAD (`draft/read-marker`)** — query/set parsing + line builders+32
- **MONITOR** — subcommand parsing + numeric reply builders (730–734)+33
- **Server-time, msgid, account, batch, label, +draft/reply, +typing** — typed tag accessors+34
+35
### Convenience client (legacy)+36
+37
The `(sigil irc connection)` module retains a high-level client convenience API with TLS, SASL, channel tracking, NickServ identify, and an event loop — backwards compatible with prior sigil-irc releases.+38
+39
## Usage 40
−24
Then connect and handle messages:+41
### Client (high-level convenience) 42
43
```scheme 44
(import (sigil irc)) 45
46
(define conn (make-irc-connection−30
host: "irc.libera.chat"+47
server: "irc.libera.chat" 48
port: 6697 49
nick: "mybot"−33
tls?: #t))+50
tls: #t)) 51
−35
(irc-on conn "PRIVMSG"+52
(irc-on conn 'PRIVMSG 53
(lambda (msg)−37
(irc-privmsg conn (irc-message-target msg)−38
"Hello!")))+54
(irc-privmsg conn (irc-message-target msg) "Hello!"))) 55
56
(irc-connect conn) 57
(irc-join conn "#mychannel") 58
(irc-run conn) 59
``` 60
+61
### Server (consumer drives I/O)+62
+63
```scheme+64
(import (sigil irc message)+65
(sigil irc cap-negotiation)+66
(sigil irc capability)+67
(sigil irc sasl)+68
(sigil irc numerics))+69
+70
;; Build per-connection state+71
(define cap (make-cap-server-state+72
server-name: "enclave.example"+73
supported: (list (make-cap CAP-SASL value: "PLAIN,EXTERNAL")+74
(make-cap CAP-MESSAGE-TAGS)+75
(make-cap CAP-SERVER-TIME)+76
(make-cap CAP-BATCH)+77
(make-cap CAP-LABELED-RESPONSE))))+78
+79
(define sasl-state+80
(make-sasl-server-state+81
supported-mechanisms: (list SASL-PLAIN SASL-EXTERNAL)+82
server-name: "enclave.example"+83
verify: my-password-checker))+84
+85
;; Inside your accept fiber, on each line:+86
(let* ((msg (parse-irc-message line))+87
(cap-out (cap-server-advance cap msg client-nick: nick))+88
(sasl-out (sasl-server-advance sasl-state msg client-prefix: nick)))+89
(for-each write-line cap-out)+90
(for-each write-line sasl-out))+91
```+92
+93
### Identity is per-server from day one+94
+95
```scheme+96
(import (sigil irc identity))+97
+98
(define alice (make-irc-identity "alice" "enclave.example"))+99
(irc-identity->canonical alice) ; => "[email protected]"+100
(irc-identity->display alice) ; => "alice" (default: nick only)+101
(irc-identity->display alice show-server?: #t)+102
; => "[email protected]"+103
```+104
+105
This is a federation-readiness constraint: future CrafterNet sovereign-per-server federation hinges on identities being qualified from day one. Local-display helpers strip the suffix for UX; storage and protocol always use the canonical form.+106
107
## Modules 108
−47
| Module | Description |−48
|--------|-------------|+109
| Module | Purpose |+110
|--------|---------| 111
| `(sigil irc)` | Top-level re-exports |−50
| `(sigil irc message)` | IRC message parsing and construction |−51
| `(sigil irc connection)` | Connection lifecycle, event handling, I/O loop |+112
| `(sigil irc message)` | Line parsing/serialization, IRCv3 tags |+113
| `(sigil irc tags)` | Typed tag accessors (server-time, account, batch, label, …) |+114
| `(sigil irc identity)` | Qualified `nick@server` identity |+115
| `(sigil irc numerics)` | Numeric reply constants |+116
| `(sigil irc capability)` | Capability descriptors, Tier 1+2 names |+117
| `(sigil irc cap-negotiation)` | CAP state machines (client + server) |+118
| `(sigil irc sasl)` | SASL state machines (PLAIN, EXTERNAL, mechanism dispatch) |+119
| `(sigil irc sasl-scram)` | SCRAM-SHA-256 driver (RFC 5802/7677) |+120
| `(sigil irc batch)` | BATCH command + tag helpers |+121
| `(sigil irc chathistory)` | CHATHISTORY query parser/serializer |+122
| `(sigil irc read-marker)` | `draft/read-marker` (MARKREAD) helpers |+123
| `(sigil irc monitor)` | MONITOR command + numeric reply builders |+124
| `(sigil irc connection)` | High-level client convenience API (TLS, event loop) | 125
126
## Dependencies 127
−55
- sigil-stdlib−56
- sigil-socket−57
- sigil-tls−58
- sigil-crypto+128
- sigil-socket (TCP)+129
- sigil-tls (TLS for the convenience client)+130
- sigil-crypto v0.15.0+ (base64, HMAC, PBKDF2 — SCRAM needs the v0.15 SHA-256 byte primitives) 131
−60
## Building+132
## Building / testing 133
134
```bash 135
sigil deps install−64
sigil build 136
sigil test 137
``` 138
+139
For development against unreleased sibling packages, use a `dev-redirects.sgl` and run `sigil test --redirects ./dev-redirects.sgl`.+140
141
## License 142
143
BSD-3-Clausedev-redirects.sglmodified
@@ -1,6 +1,16 @@
−1
;; Development redirects — point dependencies at local checkouts+1
;; Development redirects — point from-git deps at local sibling checkouts+2
;; during dev. Use: sigil <cmd> --redirects ./dev-redirects.sgl 3
(redirects 4
repos: (list 5
(for-repo−5
url: "codeberg:sigil/sigil"−6
use: (from-path dir: "../sigil"))))+6
url: "codeberg:sigil/sigil-lang"+7
use: (from-path dir: "../sigil-lang"))+8
(for-repo+9
url: "codeberg:sigil/sigil-socket"+10
use: (from-path dir: "../sigil-socket"))+11
(for-repo+12
url: "codeberg:sigil/sigil-tls"+13
use: (from-path dir: "../sigil-tls"))+14
(for-repo+15
url: "codeberg:sigil/sigil-crypto"+16
use: (from-path dir: "../sigil-crypto"))))package.sglmodified
@@ -1,12 +1,16 @@
−1
;;; sigil-irc - IRC client library+1
;;; sigil-irc - IRC protocol library 2
;;;−3
;;; Provides IRC client functionality with TLS support, SASL authentication,−4
;;; and cooperative non-blocking I/O for concurrent applications.+3
;;; Provides IRC parser, types, capability descriptors, numeric constants,+4
;;; and state-machine helpers covering both client and server flows for+5
;;; modern IRCv3 (Tier 1 ratified caps + Tier 2 high-value drafts:+6
;;; chathistory, draft/read-marker, MONITOR, SCRAM-SHA-256). Includes a+7
;;; convenience client API with TLS support and cooperative non-blocking I/O. 8
9
(package 10
name: "sigil-irc"−8
version: "0.7.0"−9
description: "IRC client library with TLS and SASL support"+11
version: "0.8.0"+12
sigil: "^0.14"+13
description: "IRC protocol library — both directions, IRCv3 + drafts" 14
url: "https://codeberg.org/sigil/sigil-irc" 15
license: "BSD-3-Clause" 16
authors: (list "David Wilson <[email protected]>")@@ -24,10 +28,9 @@
28
optimize: 2)) 29
30
dependencies: (list−27
(from-git url: "codeberg:sigil/sigil" package: "sigil-stdlib" version: "^0.9.0")−28
(from-git url: "codeberg:sigil/sigil" package: "sigil-socket" version: "^0.9.0")−29
(from-git url: "codeberg:sigil/sigil" package: "sigil-tls" version: "^0.9.0")−30
(from-git url: "codeberg:sigil/sigil" package: "sigil-crypto" version: "^0.9.0"))+31
(from-git url: "codeberg:sigil/sigil-socket" version: "^0.14")+32
(from-git url: "codeberg:sigil/sigil-tls" version: "^0.14.1")+33
(from-git url: "codeberg:sigil/sigil-crypto" version: "^0.15")) 34
35
tasks: (list 36
(tasksigil.lockmodified
@@ -1,27 +1,24 @@
1
;; Auto-generated by sigil deps install. Do not edit. 2
(lock 3
(package name: "sigil-stdlib"−4
url: "codeberg:sigil/sigil"−5
ref: "^0.9.0"−6
sha: "54f66e8ec446b65b75ab6f12454d2c0aa269f2c0"+4
url: "codeberg:sigil/sigil-lang"+5
ref: "^0.14"+6
sha: "c6f6a80928ab7409e434c650e0f8a8f9c76929a6" 7
package-selector: "sigil-stdlib"−8
version: "0.9.1")+8
version: "0.14.7") 9
(package name: "sigil-socket"−10
url: "codeberg:sigil/sigil"−11
ref: "^0.9.0"−12
sha: "54f66e8ec446b65b75ab6f12454d2c0aa269f2c0"−13
package-selector: "sigil-socket"−14
version: "0.9.1")+10
url: "codeberg:sigil/sigil-socket"+11
ref: "^0.14"+12
sha: "cfc8005ebf26b8234f933be11514a78b96c325e0"+13
version: "0.14.0") 14
(package name: "sigil-tls"−16
url: "codeberg:sigil/sigil"−17
ref: "^0.9.0"−18
sha: "54f66e8ec446b65b75ab6f12454d2c0aa269f2c0"−19
package-selector: "sigil-tls"−20
version: "0.9.1")+15
url: "codeberg:sigil/sigil-tls"+16
ref: "^0.14.1"+17
sha: "722f1ae58644ffe2d129f78fabbbe1e517cdf29a"+18
version: "0.14.1") 19
(package name: "sigil-crypto"−22
url: "codeberg:sigil/sigil"−23
ref: "^0.9.0"−24
sha: "54f66e8ec446b65b75ab6f12454d2c0aa269f2c0"−25
package-selector: "sigil-crypto"−26
version: "0.9.1")+20
url: "codeberg:sigil/sigil-crypto"+21
ref: "^0.15"+22
sha: "71e41e7320566bf057828a586f1239041d08d525"+23
version: "0.15.0") 24
)