adapters

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package adapters defines verified capture integration contracts.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter interface {
	Descriptor() Descriptor
	Detect(context.Context) (Detection, error)
	Install(context.Context, InstallOptions) (InstallResult, error)
	Uninstall(context.Context, InstallOptions) (InstallResult, error)
	HealthCheck(context.Context) error
	Ingest(context.Context, io.Reader) ([]RawRecord, error)
	Normalize(RawRecord) (RawRecord, error)
	ExtractProjectSignals(RawRecord) ProjectSignals
}

Adapter has one stable lifecycle. It emits signals; app.Service resolves projects.

type Capabilities

type Capabilities struct {
	ModelIdentity       bool `json:"model_identity"`
	InputTokens         bool `json:"input_tokens"`
	OutputTokens        bool `json:"output_tokens"`
	ReasoningTokens     bool `json:"reasoning_tokens"`
	CacheTokens         bool `json:"cache_tokens"`
	ContextUsage        bool `json:"context_usage"`
	ToolCalls           bool `json:"tool_calls"`
	MCPCalls            bool `json:"mcp_calls"`
	Costs               bool `json:"costs"`
	PromptSizes         bool `json:"prompt_sizes"`
	ResponseSizes       bool `json:"response_sizes"`
	SessionLifecycle    bool `json:"session_lifecycle"`
	TaskMetadata        bool `json:"task_metadata"`
	ProjectIdentity     bool `json:"project_identity"`
	WorkingDirectory    bool `json:"working_directory"`
	VCSContext          bool `json:"vcs_context"`
	WorkspaceContext    bool `json:"workspace_context"`
	ProjectSwitchEvents bool `json:"project_switch_events"`
	StructuredEvents    bool `json:"structured_events"`
}

Capabilities reports only data an adapter can actually provide.

type Descriptor

type Descriptor struct {
	ID           string       `json:"id"`
	Name         string       `json:"name"`
	Version      string       `json:"version"`
	Capabilities Capabilities `json:"capabilities"`
}

type Detection

type Detection struct {
	Available bool   `json:"available"`
	Evidence  string `json:"evidence"`
}

type GenericJSONL

type GenericJSONL struct{}

GenericJSONL imports caller-supplied normalized records. It does not infer metrics.

func (GenericJSONL) Descriptor

func (GenericJSONL) Descriptor() Descriptor

func (GenericJSONL) Detect

func (GenericJSONL) ExtractProjectSignals

func (GenericJSONL) ExtractProjectSignals(RawRecord) ProjectSignals

func (GenericJSONL) HealthCheck

func (GenericJSONL) HealthCheck(context.Context) error

func (GenericJSONL) Ingest

func (GenericJSONL) Ingest(_ context.Context, reader io.Reader) ([]RawRecord, error)

func (GenericJSONL) Install

func (GenericJSONL) Normalize

func (GenericJSONL) Normalize(record RawRecord) (RawRecord, error)

func (GenericJSONL) Uninstall

type InstallOptions

type InstallOptions struct {
	DryRun bool
}

type InstallResult

type InstallResult struct {
	Changed bool     `json:"changed"`
	Actions []string `json:"actions"`
}

type ProjectSignals

type ProjectSignals struct {
	Project   string
	CWD       string
	GitRoot   string
	Workspace string
}

type RawRecord

type RawRecord struct {
	Source  string
	Payload []byte
}

type Registry

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

func Default

func Default() *Registry

func NewRegistry

func NewRegistry(items ...Adapter) (*Registry, error)

func (*Registry) Get

func (r *Registry) Get(id string) (Adapter, bool)

func (*Registry) List

func (r *Registry) List() []Adapter

Jump to

Keyboard shortcuts

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