{"modulePath":"github.com/memcode-ai/memcode","version":"v0.56.16","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package protocol\n\nPackage 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.\n\nstdout 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.\n\n## Functions\n\n```go\nfunc Run(ctx context.Context, sess *runtime.Session, in io.Reader, out io.Writer) error\n```\nRun drives one stream-json session over (in, out) until in closes (or ctx ends).\n\n","path":"github.com/memcode-ai/memcode/internal/agent/protocol","name":"protocol","synopsis":"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.","isRedistributable":true}
