protocol

package
v0.41.4 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 16 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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