integration

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const ManifestVersion = 1

Variables

This section is empty.

Functions

func Fingerprint

func Fingerprint(content []byte) string

func SaveManifest

func SaveManifest(path string, manifest Manifest) error

func VerifyOwnership

func VerifyOwnership(entry ManifestEntry, content []byte) error

Types

type AdapterDeps

type AdapterDeps struct {
	Detector Detector
	Run      CommandRunner
	Now      func() time.Time
}

type AntigravityAdapter

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

func NewAntigravityAdapter

func NewAntigravityAdapter() *AntigravityAdapter

func NewAntigravityAdapterWithDeps

func NewAntigravityAdapterWithDeps(deps AdapterDeps) *AntigravityAdapter

func (*AntigravityAdapter) Detect

func (a *AntigravityAdapter) Detect(root string) Detection

func (*AntigravityAdapter) Inspect

func (a *AntigravityAdapter) Inspect(root string, scope Scope) (HostState, error)

func (*AntigravityAdapter) Install

func (a *AntigravityAdapter) Install(_ context.Context, plan HostPlan) (HostResult, error)

func (*AntigravityAdapter) Name

func (a *AntigravityAdapter) Name() string

func (*AntigravityAdapter) Plan

func (a *AntigravityAdapter) Plan(root string, scope Scope) (HostPlan, error)

func (*AntigravityAdapter) Scopes

func (a *AntigravityAdapter) Scopes() []Scope

func (*AntigravityAdapter) Verify

func (a *AntigravityAdapter) Verify(root string) Verification

type ClaudeCodeAdapter

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

func NewClaudeCodeAdapter

func NewClaudeCodeAdapter() *ClaudeCodeAdapter

func NewClaudeCodeAdapterWithDeps

func NewClaudeCodeAdapterWithDeps(deps AdapterDeps) *ClaudeCodeAdapter

func (*ClaudeCodeAdapter) Detect

func (a *ClaudeCodeAdapter) Detect(root string) Detection

func (*ClaudeCodeAdapter) Inspect

func (a *ClaudeCodeAdapter) Inspect(root string, scope Scope) (HostState, error)

func (*ClaudeCodeAdapter) Install

func (a *ClaudeCodeAdapter) Install(ctx context.Context, plan HostPlan) (HostResult, error)

func (*ClaudeCodeAdapter) Name

func (a *ClaudeCodeAdapter) Name() string

func (*ClaudeCodeAdapter) Plan

func (a *ClaudeCodeAdapter) Plan(root string, scope Scope) (HostPlan, error)

func (*ClaudeCodeAdapter) Scopes

func (a *ClaudeCodeAdapter) Scopes() []Scope

func (*ClaudeCodeAdapter) Verify

func (a *ClaudeCodeAdapter) Verify(root string) Verification

type CodexAdapter

type CodexAdapter struct {
	NativeProjectCLI bool
	// contains filtered or unexported fields
}

CodexAdapter uses a manual project config by default because the current official `codex mcp add` command writes user configuration and has no project scope flag. NativeProjectCLI is an explicit capability switch for a future Codex release that provides project-scoped registration.

func NewCodexAdapter

func NewCodexAdapter() *CodexAdapter

func NewCodexAdapterWithDeps

func NewCodexAdapterWithDeps(deps AdapterDeps, nativeProjectCLI bool) *CodexAdapter

func (*CodexAdapter) Detect

func (a *CodexAdapter) Detect(root string) Detection

func (*CodexAdapter) Inspect

func (a *CodexAdapter) Inspect(root string, scope Scope) (HostState, error)

func (*CodexAdapter) Install

func (a *CodexAdapter) Install(ctx context.Context, plan HostPlan) (HostResult, error)

func (*CodexAdapter) Name

func (a *CodexAdapter) Name() string

func (*CodexAdapter) Plan

func (a *CodexAdapter) Plan(root string, scope Scope) (HostPlan, error)

func (*CodexAdapter) Scopes

func (a *CodexAdapter) Scopes() []Scope

func (*CodexAdapter) Verify

func (a *CodexAdapter) Verify(root string) Verification

type CommandRunner

type CommandRunner func(ctx context.Context, dir, command string, args []string) ([]byte, error)

type Confidence

type Confidence string

Confidence describes how strongly detection evidence identifies a host.

const (
	ConfidenceNone   Confidence = "none"
	ConfidenceLow    Confidence = "low"
	ConfidenceMedium Confidence = "medium"
	ConfidenceHigh   Confidence = "high"
)

type CursorAdapter

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

func NewCursorAdapter

func NewCursorAdapter() *CursorAdapter

func NewCursorAdapterWithDeps

func NewCursorAdapterWithDeps(deps AdapterDeps) *CursorAdapter

func (*CursorAdapter) Detect

func (a *CursorAdapter) Detect(root string) Detection

func (*CursorAdapter) Inspect

func (a *CursorAdapter) Inspect(root string, scope Scope) (HostState, error)

func (*CursorAdapter) Install

func (a *CursorAdapter) Install(_ context.Context, plan HostPlan) (HostResult, error)

func (*CursorAdapter) Name

func (a *CursorAdapter) Name() string

func (*CursorAdapter) Plan

func (a *CursorAdapter) Plan(root string, scope Scope) (HostPlan, error)

func (*CursorAdapter) Scopes

func (a *CursorAdapter) Scopes() []Scope

func (*CursorAdapter) Verify

func (a *CursorAdapter) Verify(root string) Verification

type Detection

type Detection struct {
	Host          string     `json:"host"`
	Detected      bool       `json:"detected"`
	Executable    string     `json:"executable"`
	ProjectConfig string     `json:"projectConfig"`
	Scopes        []Scope    `json:"scopes"`
	Method        string     `json:"method"`
	Confidence    Confidence `json:"confidence"`
	Reason        string     `json:"reason"`
}

Detection is evidence gathered without executing or modifying the host.

func DetectAll

func DetectAll(registry *Registry, root string) []Detection

type DetectionProbe

type DetectionProbe struct {
	Executable    string
	ProjectConfig string
	Scopes        []Scope
	Method        string
}

DetectionProbe describes passive evidence for one host.

type Detector

type Detector struct {
	LookPath func(string) (string, error)
	Stat     func(string) (os.FileInfo, error)
}

Detector permits hermetic PATH and filesystem tests.

func DefaultDetector

func DefaultDetector() Detector

func (Detector) Detect

func (d Detector) Detect(root, host string, probe DetectionProbe) Detection

type HostAction

type HostAction struct {
	Kind        string   `json:"kind"`
	Target      string   `json:"target"`
	Command     string   `json:"command"`
	Args        []string `json:"args"`
	Description string   `json:"description"`
}

HostAction is one deterministic install step. Command and Args are separate so adapters never need shell concatenation.

type HostAdapter

type HostAdapter interface {
	Name() string
	Scopes() []Scope
	Detect(root string) Detection
	Plan(root string, scope Scope) (HostPlan, error)
	Install(ctx context.Context, plan HostPlan) (HostResult, error)
	Inspect(root string, scope Scope) (HostState, error)
	Verify(root string) Verification
}

HostAdapter isolates host-specific schemas and commands from init orchestration.

type HostPlan

type HostPlan struct {
	Host     string       `json:"host"`
	Root     string       `json:"root"`
	Scope    Scope        `json:"scope"`
	Actions  []HostAction `json:"actions"`
	Warnings []string     `json:"warnings"`
}

HostPlan describes a proposed host mutation.

type HostResult

type HostResult struct {
	Host       string   `json:"host"`
	Status     string   `json:"status"`
	Changed    bool     `json:"changed"`
	Targets    []string `json:"targets"`
	Backups    []string `json:"backups"`
	Warnings   []string `json:"warnings"`
	NextAction string   `json:"nextAction"`
}

HostResult describes the outcome of applying a HostPlan.

type HostState

type HostState struct {
	Host        string `json:"host"`
	Scope       Scope  `json:"scope"`
	Registered  bool   `json:"registered"`
	Owned       bool   `json:"owned"`
	Target      string `json:"target"`
	Fingerprint string `json:"fingerprint"`
	Reason      string `json:"reason"`
}

HostState is the inspectable registration state of an adapter.

type JSONMergeOptions

type JSONMergeOptions struct {
	Root       string
	Target     string
	KeyPath    []string
	ServerName string
	Server     any
	Now        func() time.Time
	WriteFile  func(path, content string) error
}

type JSONMergeResult

type JSONMergeResult struct {
	Changed bool   `json:"changed"`
	Target  string `json:"target"`
	Backup  string `json:"backup"`
}

func MergeJSONServer

func MergeJSONServer(options JSONMergeOptions) (JSONMergeResult, error)

MergeJSONServer mutates one named nested server entry, preserving all other semantic JSON values. Existing files are backed up before atomic replacement.

type Manifest

type Manifest struct {
	Version int             `json:"version"`
	Entries []ManifestEntry `json:"entries"`
}

func LoadManifest

func LoadManifest(path string) (Manifest, error)

func NewManifest

func NewManifest() Manifest

type ManifestEntry

type ManifestEntry struct {
	Host         string `json:"host"`
	Scope        Scope  `json:"scope"`
	ServerName   string `json:"serverName"`
	Root         string `json:"root"`
	RootStrategy string `json:"rootStrategy"`
	Method       string `json:"method"`
	Target       string `json:"target"`
	Fingerprint  string `json:"fingerprint"`
	InstalledAt  string `json:"installedAt,omitempty"`
}

type Registry

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

Registry stores adapters by stable CLI name.

func DefaultRegistry

func DefaultRegistry() *Registry

DefaultRegistry contains the supported project-scoped coding-agent adapters.

func MustRegistry

func MustRegistry(adapters ...HostAdapter) *Registry

func NewRegistry

func NewRegistry(adapters ...HostAdapter) (*Registry, error)

func (*Registry) Adapters

func (r *Registry) Adapters() []HostAdapter

func (*Registry) Detect

func (r *Registry) Detect(root string) []Detection

func (*Registry) Get

func (r *Registry) Get(name string) (HostAdapter, bool)

func (*Registry) Install

func (r *Registry) Install(ctx context.Context, plan HostPlan) (HostResult, error)

func (*Registry) Names

func (r *Registry) Names() []string

func (*Registry) Plan

func (r *Registry) Plan(name, root string, scope Scope) (HostPlan, error)

type Scope

type Scope string

Scope is the configuration boundary an adapter can manage.

const (
	ScopeProject Scope = "project"
	ScopeGlobal  Scope = "global"
)

type Selection

type Selection struct {
	Selected    []string `json:"selected"`
	Suggestions []string `json:"suggestions"`
	Ambiguous   bool     `json:"ambiguous"`
	Reason      string   `json:"reason"`
}

Selection is a non-mutating resolution of an --agent choice.

func SelectHosts

func SelectHosts(selection string, interactive bool, detections []Detection) (Selection, error)

type VSCodeAdapter

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

func NewVSCodeAdapter

func NewVSCodeAdapter() *VSCodeAdapter

func NewVSCodeAdapterWithDeps

func NewVSCodeAdapterWithDeps(deps AdapterDeps) *VSCodeAdapter

func (*VSCodeAdapter) Detect

func (a *VSCodeAdapter) Detect(root string) Detection

func (*VSCodeAdapter) Inspect

func (a *VSCodeAdapter) Inspect(root string, scope Scope) (HostState, error)

func (*VSCodeAdapter) Install

func (a *VSCodeAdapter) Install(_ context.Context, plan HostPlan) (HostResult, error)

func (*VSCodeAdapter) Name

func (a *VSCodeAdapter) Name() string

func (*VSCodeAdapter) Plan

func (a *VSCodeAdapter) Plan(root string, scope Scope) (HostPlan, error)

func (*VSCodeAdapter) Scopes

func (a *VSCodeAdapter) Scopes() []Scope

func (*VSCodeAdapter) Verify

func (a *VSCodeAdapter) Verify(root string) Verification

type Verification

type Verification struct {
	Host   string `json:"host"`
	Status string `json:"status"`
	Reason string `json:"reason"`
	Remedy string `json:"remedy"`
}

Verification is the deepest deterministic verification available for a host.

Jump to

Keyboard shortcuts

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