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, TOON) via the pluggable registry and provides FromContextBlock for converting internal types to GCF payloads.
TOON (Token-Oriented Object Notation) encoder for knowing context output. Uses the official toon-format/toon-go library for spec-conformant encoding.
TOON is a compact, human-readable format designed for LLM contexts. It uses tabular arrays (header + rows) for uniform object collections, which is ideal for symbol lists where every entry has the same fields.
Spec: https://github.com/toon-format/spec Library: https://github.com/toon-format/toon-go
Index ¶
- Variables
- func Encode(p *Payload) string
- func EncodeDelta(d *DeltaPayload) string
- func EncodeTOON(p *Payload) (string, error)
- func EncodeWith(name string, p *Payload) (string, error)
- func EncodeWithSession(p *Payload, s *Session) string
- func ListNames() string
- func Register(c *Codec)
- type Codec
- type Components
- type Decoder
- type DeltaPayload
- type Edge
- type Encoder
- type Payload
- type Session
- type Symbol
Constants ¶
This section is empty.
Variables ¶
var KindAbbrev = gcf.KindAbbrev
Re-export kind maps.
var KindExpand = gcf.KindExpand
Functions ¶
func EncodeDelta ¶ added in v0.15.0
func EncodeDelta(d *DeltaPayload) string
func EncodeTOON ¶ added in v0.2.0
EncodeTOON encodes a Payload into TOON format using the official library.
func EncodeWith ¶
EncodeWith encodes a payload using the named codec.
func EncodeWithSession ¶
Types ¶
type Codec ¶
Codec is a registered encoding scheme with encode/decode functions and metadata.
type Components ¶
type Components = gcf.Components
type DeltaPayload ¶ added in v0.15.0
type DeltaPayload = gcf.DeltaPayload
type Payload ¶
func DecodeWith ¶
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.