repoenvelope

package
v1.0.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: AGPL-3.0, AGPL-3.0-or-later Imports: 4 Imported by: 0

Documentation

Overview

Package repoenvelope frames repository-derived JSON as untrusted data for agent context (AHI-004). It is the single Go builder for the envelope; the JavaScript adapters under integrations/ implement the same contract.

Index

Constants

View Source
const (
	// Terminator is the envelope's closing line.
	Terminator = "END CORVINT REPOSITORY DATA"
	// Prefix opens the envelope, ending with the newline before the payload.
	Prefix = "" /* 268-byte string literal not displayed */
	// Suffix closes the envelope after the payload.
	Suffix = "\n" + Terminator
	// CollisionCode is the refusal reason when a payload contains Terminator.
	CollisionCode = "corvint-envelope-terminator-collision"
)

Variables

View Source
var ErrTerminatorCollision = errors.New(CollisionCode)

ErrTerminatorCollision reports a payload that could close the envelope early.

Functions

func EscapeHidden

func EscapeHidden(payload string) string

EscapeHidden rewrites every hidden character as literal lowercase \uXXXX text and copies every other byte, including invalid UTF-8, unchanged. Inside a JSON string that spelling decodes to the same value.

func Frame

func Frame(payload string) (string, error)

Frame escapes hidden characters in payload and wraps it in the envelope. It refuses, rather than mangles, a payload that contains Terminator.

Types

This section is empty.

Jump to

Keyboard shortcuts

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