docs: update for Request→Rdwr rename and sub-agent examples

This commit is contained in:
Levi Neely 2026-08-14 15:33:25 +02:00
parent 6a023391f9
commit cafba41193
3 changed files with 11 additions and 7 deletions

View File

@ -39,6 +39,10 @@ ollie-9p read session/myproj/agent/coding/chat
# Check state (blocks until change)
ollie-9p read session/myproj/agent/coding/statewait
# Spawn a sub-agent (blocks until done, returns reply)
printf 'cwd=/home/user/project\nprompt=fix the failing tests\n' \
| ollie-9p rdwr session/myproj/agent/new
```
### Network transparency

View File

@ -259,7 +259,7 @@ Permissions are declared inline in the EDSL spec via `mode` and `GID()` options.
- `ctl` is mode `0666` — anyone can send control commands
- `plan` is mode `0666` — readable by peer agents
- `eventwait` is `0444` — blocking read for global event stream
- `session/new` is `0666` with `Request` handler — anyone can create sessions
- `session/new` is `0666` with `Rdwr` handler — anyone can create sessions
- Ownership inherits: empty `UID`/`GID` values inherit from parent node, all the way up to root
### Session Management (`fs/`)
The `*fs.Tree` IS the session collection. Package functions manage lifecycle:

View File

@ -23,7 +23,7 @@ type FsNodeDecl struct {
Write func(HandlerCtx, []byte) error
BlockOnce func(HandlerCtx, context.Context, string) ([]byte, string, error)
Stream func(HandlerCtx, context.Context, string) ([]byte, string, error)
Request func(HandlerCtx, []byte) ([]byte, error)
Rdwr func(HandlerCtx, []byte) ([]byte, error)
Create func(HandlerCtx, string) error
Remove func(HandlerCtx) error
}
@ -31,7 +31,7 @@ type FsNodeDecl struct {
Nodes are either **directories** (have `Children` or `List`) or **leaf files**
(have read/write/blocking handlers). At most one blocking variant
(`BlockOnce`, `Stream`, `Request`) may be set per node.
(`BlockOnce`, `Stream`, `Rdwr`) may be set per node.
## Constructors
@ -42,7 +42,7 @@ and `NodeOption` functions:
```go
Dir("session",
Leaf("new", 0666, Request(requestSessionNew)),
Leaf("new", 0666, Rdwr(requestSessionNew)),
Leaf("idx", 0444, Read(readSessionIdx)),
GID("agent"),
)
@ -76,7 +76,7 @@ Leaf("chat", 0444, Read(readAgentChat), Stream(blockAgentChat))
| `Write(fn)` | `func(HandlerCtx, []byte) error` | `d.Write` |
| `Stream(fn)` | `func(HandlerCtx, ctx, base) (data, base, err)` | `d.Stream` |
| `BlockOnce(fn)` | `func(HandlerCtx, ctx, base) (data, base, err)` | `d.BlockOnce` |
| `Request(fn)` | `func(HandlerCtx, []byte) ([]byte, error)` | `d.Request` |
| `Rdwr(fn)` | `func(HandlerCtx, []byte) ([]byte, error)` | `d.Rdwr` |
| `CreateFile(fn)` | `func(HandlerCtx, string) error` | `d.Create` |
| `Remove(fn)` | `func(HandlerCtx) error` | `d.Remove` |
| `Stat(fn)` | `func() os.FileInfo` | `d.Stat` |
@ -140,8 +140,8 @@ func listSessions(ctx HandlerCtx) ([]FsNodeDecl, error) {
## Rules
1. **Directories cannot have leaf handlers.** A node with `Children` or
`List` must not set `Read`, `Write`, `BlockOnce`, `Stream`, or `Request`.
2. **At most one blocking handler.** `BlockOnce`, `Stream`, and `Request`
`List` must not set `Read`, `Write`, `BlockOnce`, `Stream`, or `Rdwr`.
2. **At most one blocking handler.** `BlockOnce`, `Stream`, and `Rdwr`
are mutually exclusive.
3. **Template nodes must have a `List` function.** Names starting with `{`
and ending with `}` require a dynamic child resolver.