Documentation
¶
Overview ¶
Package adapters defines verified capture integration contracts.
Index ¶
- func HasMarkerBlock(path, marker string) bool
- type Adapter
- type Capabilities
- type CaptureQuality
- type Descriptor
- type Detection
- type GenericJSONL
- func (GenericJSONL) Descriptor() Descriptor
- func (GenericJSONL) Detect(context.Context) (Detection, error)
- func (GenericJSONL) ExtractProjectSignals(RawRecord) ProjectSignals
- func (GenericJSONL) HealthCheck(context.Context) error
- func (GenericJSONL) Ingest(_ context.Context, reader io.Reader) ([]RawRecord, error)
- func (GenericJSONL) Install(_ context.Context, _ InstallOptions) (InstallResult, error)
- func (GenericJSONL) Normalize(record RawRecord) (RawRecord, error)
- func (GenericJSONL) PlanInstall(context.Context, SetupOptions) (SetupPlan, error)
- func (GenericJSONL) Status(context.Context) (SetupStatus, error)
- func (GenericJSONL) Test(context.Context) (TestResult, error)
- func (GenericJSONL) Uninstall(_ context.Context, _ InstallOptions) (InstallResult, error)
- type InstallOptions
- type InstallResult
- type ProjectSignals
- type RawRecord
- type Registry
- type SetupChange
- type SetupOptions
- type SetupPlan
- type SetupState
- type SetupStatus
- type TestResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HasMarkerBlock ¶ added in v0.3.0
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)
PlanInstall(context.Context, SetupOptions) (SetupPlan, error)
Status(context.Context) (SetupStatus, error)
Test(context.Context) (TestResult, 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 CaptureQuality ¶ added in v0.3.0
type CaptureQuality string
const ( CaptureProviderReported CaptureQuality = "provider_reported" CaptureAgentReported CaptureQuality = "agent_reported" CaptureOTELReported CaptureQuality = "otel_reported" CaptureLifecycleOnly CaptureQuality = "lifecycle_only" CaptureExperimental CaptureQuality = "experimental" CaptureEstimated CaptureQuality = "estimated" CaptureManualImport CaptureQuality = "manual_import" )
type Descriptor ¶
type Descriptor struct {
ID string `json:"id"`
Name string `json:"name"`
Version string `json:"version"`
Capabilities Capabilities `json:"capabilities"`
}
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) ExtractProjectSignals ¶
func (GenericJSONL) ExtractProjectSignals(RawRecord) ProjectSignals
func (GenericJSONL) HealthCheck ¶
func (GenericJSONL) HealthCheck(context.Context) error
func (GenericJSONL) Install ¶
func (GenericJSONL) Install(_ context.Context, _ InstallOptions) (InstallResult, error)
func (GenericJSONL) PlanInstall ¶ added in v0.3.0
func (GenericJSONL) PlanInstall(context.Context, SetupOptions) (SetupPlan, error)
func (GenericJSONL) Status ¶ added in v0.3.0
func (GenericJSONL) Status(context.Context) (SetupStatus, error)
func (GenericJSONL) Test ¶ added in v0.3.0
func (GenericJSONL) Test(context.Context) (TestResult, error)
func (GenericJSONL) Uninstall ¶
func (GenericJSONL) Uninstall(_ context.Context, _ InstallOptions) (InstallResult, error)
type InstallOptions ¶
type InstallOptions struct {
DryRun bool
}
type InstallResult ¶
type InstallResult struct {
Changed bool `json:"changed"`
Actions []string `json:"actions"`
Changes []SetupChange `json:"changes,omitempty"`
}
type ProjectSignals ¶
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func NewRegistry ¶
type SetupChange ¶ added in v0.3.0
type SetupChange struct {
Path string `json:"path"`
Action string `json:"action"`
BackupPath string `json:"backup_path,omitempty"`
Description string `json:"description"`
}
func ApplyMarkerBlock ¶ added in v0.3.0
func ApplyMarkerBlock(path, marker, content string, dryRun bool) (SetupChange, error)
func RemoveMarkerBlock ¶ added in v0.3.0
func RemoveMarkerBlock(path, marker string, dryRun bool) (SetupChange, error)
type SetupOptions ¶ added in v0.3.0
type SetupPlan ¶ added in v0.3.0
type SetupPlan struct {
AdapterID string `json:"adapter_id"`
State SetupState `json:"state"`
CaptureQuality CaptureQuality `json:"capture_quality"`
Changes []SetupChange `json:"changes"`
Notes []string `json:"notes"`
}
type SetupState ¶ added in v0.3.0
type SetupState string
const ( SetupAvailable SetupState = "available" SetupInstalled SetupState = "installed" SetupPartial SetupState = "partial" SetupDrifted SetupState = "drifted" )
type SetupStatus ¶ added in v0.3.0
type SetupStatus struct {
AdapterID string `json:"adapter_id"`
Available bool `json:"available"`
Installed bool `json:"installed"`
State SetupState `json:"state"`
CaptureQuality CaptureQuality `json:"capture_quality"`
Evidence string `json:"evidence"`
Notes []string `json:"notes,omitempty"`
}
type TestResult ¶ added in v0.3.0
Click to show internal directories.
Click to hide internal directories.