protocol

package
v0.31.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 3, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package protocol drives an interactive memcode session over the stream-json control protocol (newline-delimited JSON on stdio) — the machine-facing twin of the TUI. It binds the SAME runtime seams the TUI uses (SetOutput / SetApprover / SetAsker / SetObserver) to a JSON transport, so the agent loop is untouched. This is what the sdk/agent wrapper speaks to a `memcode run --protocol stream-json` subprocess.

stdout carries machine events ONLY (one wire.Envelope per line); diagnostics go to stderr. A turn-runner goroutine executes turns so the stdin reader stays free to service permission/ask responses and cancels mid-turn.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, sess *runtime.Session, in io.Reader, out io.Writer) error

Run drives one stream-json session over (in, out) until in closes (or ctx ends).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL