From cafba41193183cddd499f723b100a19e0655e3ce Mon Sep 17 00:00:00 2001 From: Levi Neely Date: Fri, 14 Aug 2026 15:33:25 +0200 Subject: [PATCH] =?UTF-8?q?docs:=20update=20for=20Request=E2=86=92Rdwr=20r?= =?UTF-8?q?ename=20and=20sub-agent=20examples?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/9p.md | 4 ++++ doc/architecture.md | 2 +- doc/edsl.md | 12 ++++++------ 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/doc/9p.md b/doc/9p.md index ffbe95d..416451b 100644 --- a/doc/9p.md +++ b/doc/9p.md @@ -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 diff --git a/doc/architecture.md b/doc/architecture.md index 1f2c853..c03b1aa 100644 --- a/doc/architecture.md +++ b/doc/architecture.md @@ -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: diff --git a/doc/edsl.md b/doc/edsl.md index ab7bc09..de56fd2 100644 --- a/doc/edsl.md +++ b/doc/edsl.md @@ -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.