wire

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package wire provides graph payload encoding for knowing's MCP server.

Core GCF types and encoding are provided by github.com/blackwell-systems/gcf-go. This package adds knowing-specific codecs (binary, JSON) via the pluggable registry and provides FromContextBlock for converting internal types to GCF payloads.

Index

Constants

This section is empty.

Variables

View Source
var KindAbbrev = gcf.KindAbbrev

Re-export kind maps.

View Source
var KindExpand = gcf.KindExpand

Functions

func Encode

func Encode(p *Payload) string

func EncodeDelta added in v0.15.0

func EncodeDelta(d *DeltaPayload) string

func EncodeWith

func EncodeWith(name string, p *Payload) (string, error)

EncodeWith encodes a payload using the named codec.

func EncodeWithSession

func EncodeWithSession(p *Payload, s *Session) string

func ListNames

func ListNames() string

ListNames returns all registered codec names in sorted order.

func Register

func Register(c *Codec)

Register adds a codec to the registry. Panics on duplicate name.

Types

type Codec

type Codec struct {
	Name        string
	Description string
	Encode      Encoder
	Decode      Decoder
}

Codec is a registered encoding scheme with encode/decode functions and metadata.

func Get

func Get(name string) (*Codec, error)

Get returns the codec for the given name, or an error if not found.

func List

func List() []*Codec

List returns all registered codecs.

type Components

type Components = gcf.Components

type Decoder

type Decoder func(input string) (*Payload, error)

Decoder parses a wire format string back into a Payload.

type DeltaPayload added in v0.15.0

type DeltaPayload = gcf.DeltaPayload

type Edge

type Edge = gcf.Edge

type Encoder

type Encoder func(p *Payload) (string, error)

Encoder serializes a Payload into a wire format string.

type Payload

type Payload = gcf.Payload

func Decode

func Decode(input string) (*Payload, error)

func DecodeWith

func DecodeWith(name string, input string) (*Payload, error)

DecodeWith decodes input using the named codec.

func FromContextBlock

func FromContextBlock(ctx stdctx.Context, block *knowingctx.ContextBlock, tool string, store types.GraphStore) (*Payload, error)

FromContextBlock converts a ContextBlock into a wire.Payload, optionally querying the store for edges between the included symbols.

type Session

type Session = gcf.Session

func NewSession

func NewSession() *Session

type Symbol

type Symbol = gcf.Symbol

Re-export core GCF types so existing internal/wire consumers compile without changing their imports. New code should import gcf-go directly.

Jump to

Keyboard shortcuts

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