summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/libpanto-cleanup.md33
1 files changed, 31 insertions, 2 deletions
diff --git a/docs/libpanto-cleanup.md b/docs/libpanto-cleanup.md
index bc1e1aa..7c53e02 100644
--- a/docs/libpanto-cleanup.md
+++ b/docs/libpanto-cleanup.md
@@ -86,10 +86,39 @@ touching `agent.zig`.
> `addAssistantMessage(blocks, ?usage)` on the real type (the separate
> method deleted), so the alias already has the intended one-method shape.
+> **Updated during implementation (impl cleanups synced the internals to the
+> public names):** the public-API shaping we'd done in the façade was pushed
+> *into* the internal types, so the wrappers collapsed to trivial forwarders
+> (and two of the three behavioral types became plain aliases):
+> - **`Stream` is now aliased** (`pub const Stream = agent_mod.Stream`).
+> `Stream.phase`→`state` and `Phase`→`State` renamed in the impl; `state`
+> is the one intended-public field (the transparent state machine), and
+> the rest (`_agent`/`_queue`/`_response`/`_start`/`_persisted`/
+> `_pending_error`) are underscore-prefixed internal state. `Agent.run`
+> returns `*Stream`.
+> - **Compaction renamed in the impl:** the pure no-persist transform is now
+> the private `_compactInPlace`; `compactAndPersist`→`compact` (the public
+> name, persists by default).
+> - **System-prompt split in the impl:** `addSystemMessage(text, mode)`
+> became `addSystemMessage(text)` + `setSystemPrompt(text)` (mode is an
+> internal `_persistSystemMessage` detail).
+> - **`UserMessage` moved to module scope** (off `Agent`); `public.UserMessage`
+> aliases it.
+> - **Pure-internal `Agent` fields underscore-prefixed:** `_open_stream_fn`
+> (the test seam), `_auto_compacted`, `_retry_prng`. The method-gated
+> state (`config`/`registry`/`session`/`conversation`) stays unprefixed
+> — it backs `setConfig`/`registerTool*`/`conversation()`/`sessionId()`
+> and is heavily referenced; the door is the method.
+>
+> Result: the `Agent` façade is now **pure 1:1 forwarders** (no renames or
+> merges left). It remains a wrapper only because `init` heap-pins the inner
+> (making the handle copyable / move-safe) and `conversation()`/`sessionId()`
+> are accessors. `Conversation` and `Stream` are aliases.
+
| bucket | rule | types |
| --- | --- | --- |
-| **behavioral** | wrap a **pointer** to a heap-pinned internal | `Agent`, `Stream` |
-| **behavioral (pared + aliased)** | trim the real type to the public surface, then alias | `Conversation` |
+| **behavioral (thin wrapper)** | heap-pin the inner; every method a 1:1 forwarder | `Agent` |
+| **behavioral (pared + aliased)** | trim the real type to the public surface, then alias | `Conversation`, `Stream` |
| **data (read/output)** | **alias** straight through; inspected field-by-field | `Event` (+ nested), `Usage`, `Pricing`, `SessionInfo` |
| **data (constructed)** | **alias** straight through; Zig users build them with `ArrayList` directly | `ContentBlock`, `Message`, the block types, `Config` family, `ResultPart` |