tape

package
v0.0.0-...-332dcef Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package tape implements append-only audit logs aligned with Republic's tape schema.

Index

Constants

View Source
const FileName = ".tape.jsonl"

Variables

This section is empty.

Functions

This section is empty.

Types

type EinoHandler

type EinoHandler struct {
	// contains filtered or unexported fields
}

func NewEinoHandler

func NewEinoHandler(store *JSONLStore, meta RunMeta) *EinoHandler

func (*EinoHandler) Needed

func (h *EinoHandler) Needed(ctx context.Context, info *callbacks.RunInfo, timing callbacks.CallbackTiming) bool

func (*EinoHandler) OnEnd

func (*EinoHandler) OnEndWithStreamOutput

func (h *EinoHandler) OnEndWithStreamOutput(ctx context.Context, info *callbacks.RunInfo, output *schema.StreamReader[callbacks.CallbackOutput]) context.Context

func (*EinoHandler) OnError

func (h *EinoHandler) OnError(ctx context.Context, info *callbacks.RunInfo, err error) context.Context

func (*EinoHandler) OnStart

func (*EinoHandler) OnStartWithStreamInput

func (h *EinoHandler) OnStartWithStreamInput(ctx context.Context, info *callbacks.RunInfo, input *schema.StreamReader[callbacks.CallbackInput]) context.Context

type Entry

type Entry struct {
	ID      int64          `json:"id"`
	Kind    string         `json:"kind"`
	Payload map[string]any `json:"payload"`
	Meta    map[string]any `json:"meta,omitempty"`
	Date    string         `json:"date"`
}

func Anchor

func Anchor(name string, state, meta map[string]any) Entry

func ErrorPayload

func ErrorPayload(message string, extra, meta map[string]any) Entry

func Event

func Event(name string, data, meta map[string]any) Entry

func Message

func Message(msg, meta map[string]any) Entry

func System

func System(content string, meta map[string]any) Entry

func ToolCall

func ToolCall(calls []map[string]any, meta map[string]any) Entry

func ToolResult

func ToolResult(results []any, meta map[string]any) Entry

type JSONLStore

type JSONLStore struct {
	// contains filtered or unexported fields
}

func OpenJSONL

func OpenJSONL(path string) (*JSONLStore, error)

func (*JSONLStore) Append

func (s *JSONLStore) Append(e Entry) error

func (*JSONLStore) Close

func (s *JSONLStore) Close() error

func (*JSONLStore) Path

func (s *JSONLStore) Path() string

type RunMeta

type RunMeta struct {
	RunID    string
	Provider string
	Model    string
}

Jump to

Keyboard shortcuts

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