Commit013a72a1Recorded25 Apr 2026Repositorysigil-nrepl

Extract sigil-nrepl from sigil monorepo

Message

Initial standalone release extracted via git filter-repo from packages/sigil-nrepl/ at monorepo master c165430d. Pure-library extraction — no CLI submodule (sigil-cli's sigil nrepl subcommand, if any, remains in sigil-cli and imports from this package).

Scaffolding: - README describing the (sigil nrepl) server + (sigil nrepl client) library surface, wire protocol, and embedding examples. - .gitignore covering build/ and .sigil/ artifacts. - manifest.scm for guix-shell dev environment. - dev-redirects.sgl pointing codeberg:sigil/sigil and codeberg:sigil/sigil-repl at local sibling checkouts.

package.sgl: - version "0.13.1" - url -> https://codeberg.org/sigil/sigil-nrepl - sigil-stdlib + sigil-socket swapped from from-workspace to from-git monorepo-resident form pinned ^0.13.1. - sigil-repl pin unchanged at ^0.13.1 (already from-git).

sigil deps install clean (6 lock entries); sigil build clean; sigil test 3/3 passed (test-client.sgl).

Changed
 .gitignore        |  2 ++
 README.md         | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 dev-redirects.sgl | 13 +++++++++++++
 manifest.scm      |  7 +++++++
 package.sgl       |  7 ++++---
 sigil.lock        | 33 +++++++++++++++++++++++++++++++++
 6 files changed, 137 insertions(+), 3 deletions(-)
Diff
.gitignoreadded
@@ -0,0 +1,2 @@
+1
build/
+2
.sigil/
README.mdadded
@@ -0,0 +1,78 @@
+1
# sigil-nrepl
+2
+3
Network REPL server for
+4
[Sigil](https://codeberg.org/sigil/sigil) — provides a JSON-RPC-style
+5
nREPL endpoint that editors and live-development tools connect to.
+6
Built on `(sigil repl)` for prompt rendering and command parsing, and
+7
on `(sigil socket)` for transport.
+8
+9
Long-running Sigil apps (live-crafter, cinder-cantata, game servers,
+10
etc.) embed an nREPL server so the developer can evaluate code, switch
+11
modules, inspect state, and iterate on running code without restarting
+12
the process.
+13
+14
## Modules
+15
+16
| Module | Purpose |
+17
|------------------------|------------------------------------------------------------------------------|
+18
| `(sigil nrepl)` | nREPL server: connection handling, session state, op dispatch (eval/doc/...)|
+19
| `(sigil nrepl client)` | nREPL client: connect, send requests, named-connection registry |
+20
+21
## Wire protocol
+22
+23
Messages are length-prefixed S-expressions:
+24
+25
```
+26
<length:u32-be><sexp>
+27
```
+28
+29
Request format: `(request :id <string> :op <symbol> [:module <string>] [...params])`
+30
+31
Response format: `(response :id <string> :status <symbol> [...results])`
+32
+33
Ops supported: `eval`, `complete`, `doc`, `describe`, `macroexpand`,
+34
`switch-module`, `modules`.
+35
+36
## Embedding an nREPL server
+37
+38
```scheme
+39
(import (sigil nrepl))
+40
+41
(define server (nrepl-start port: 7888))
+42
+43
;; In your app's main loop, drain pending requests:
+44
(nrepl-process-pending server)
+45
+46
;; On shutdown:
+47
(nrepl-stop server)
+48
```
+49
+50
## Connecting from a client
+51
+52
```scheme
+53
(import (sigil nrepl client))
+54
+55
(define conn (nrepl-connect "127.0.0.1" 7888))
+56
(nrepl-eval conn "(+ 1 2)") ; => ((status . ok) (value . "3"))
+57
(nrepl-switch-module conn "(my app)")
+58
(nrepl-disconnect conn)
+59
```
+60
+61
## Build and test
+62
+63
```
+64
sigil deps install
+65
sigil build
+66
sigil test --report
+67
```
+68
+69
Local development against an unreleased sigil monorepo or against a
+70
local sigil-repl checkout:
+71
+72
```
+73
sigil build --redirects ./dev-redirects.sgl
+74
```
+75
+76
## License
+77
+78
BSD-3-Clause. See `LICENSE` in the sigil monorepo for the canonical copy.
dev-redirects.sgladded
@@ -0,0 +1,13 @@
+1
;; Development redirects — point from-git deps at local sibling checkouts
+2
;; during monorepo dev. Use: sigil build --redirects ./dev-redirects.sgl
+3
;;
+4
;; sigil-socket is still inside the monorepo (not yet extracted), so it
+5
;; resolves via the sigil redirect below.
+6
(redirects
+7
repos: (list
+8
(for-repo
+9
url: "codeberg:sigil/sigil"
+10
use: (from-path dir: "../sigil"))
+11
(for-repo
+12
url: "codeberg:sigil/sigil-repl"
+13
use: (from-path dir: "../task-extract-sigil-repl/sigil-repl"))))
manifest.scmadded
@@ -0,0 +1,7 @@
+1
;; sigil-nrepl Development Environment
+2
;; Use with: guix shell -m manifest.scm
+3
+4
(specifications->manifest
+5
'("gcc-toolchain"
+6
"make"
+7
"pkg-config"))
package.sglmodified
@@ -6,15 +6,16 @@
6
7
(package
8
name: "sigil-nrepl"
+9
version: "0.13.1"
10
description: "Network REPL server for Sigil"
10
url: "https://codeberg.org/sigil/sigil"
+11
url: "https://codeberg.org/sigil/sigil-nrepl"
12
license: "BSD-3-Clause"
13
authors: (list "David Wilson <[email protected]>")
14
15
dependencies: (list
15
(from-workspace name: "sigil-stdlib")
+16
(from-git url: "codeberg:sigil/sigil" package: "sigil-stdlib" version: "^0.13.1")
17
(from-git url: "codeberg:sigil/sigil-repl" version: "^0.13.1")
17
(from-workspace name: "sigil-socket"))
+18
(from-git url: "codeberg:sigil/sigil" package: "sigil-socket" version: "^0.13.1"))
19
20
21
tasks: (list
sigil.lockadded
@@ -0,0 +1,33 @@
+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.13.1"
+6
sha: "1aea1cecd3487bf07d071da2c1e7eb3cf4bbdb21"
+7
package-selector: "sigil-stdlib")
+8
(package name: "sigil-repl"
+9
url: "codeberg:sigil/sigil-repl"
+10
ref: "^0.13.1"
+11
sha: "abcc915709fc3d9915d775a544bd18481e4c88ce"
+12
version: "0.13.1")
+13
(package name: "sigil-socket"
+14
url: "codeberg:sigil/sigil"
+15
ref: "^0.13.1"
+16
sha: "1aea1cecd3487bf07d071da2c1e7eb3cf4bbdb21"
+17
package-selector: "sigil-socket")
+18
(package name: "sigil-ansi"
+19
url: "codeberg:sigil/sigil"
+20
ref: "^0.13.1"
+21
sha: "1aea1cecd3487bf07d071da2c1e7eb3cf4bbdb21"
+22
package-selector: "sigil-ansi")
+23
(package name: "sigil-hooks"
+24
url: "codeberg:sigil/sigil"
+25
ref: "^0.13.1"
+26
sha: "1aea1cecd3487bf07d071da2c1e7eb3cf4bbdb21"
+27
package-selector: "sigil-hooks")
+28
(package name: "sigil-docs"
+29
url: "codeberg:sigil/sigil"
+30
ref: "^0.13.1"
+31
sha: "1aea1cecd3487bf07d071da2c1e7eb3cf4bbdb21"
+32
package-selector: "sigil-docs")
+33
)