Documentation
¶
Index ¶
- Constants
- func AppendInstruction(filePath, block string) (bool, error)
- func ConfigHasDevtap(path string) bool
- func ConfirmOverwrite(path string) bool
- func FindProjectInstruction(paths []string) string
- func InstallInstruction(projectDir string, projectFiles []string, block string)
- type Adapter
- type InstallConfig
- type Session
Constants ¶
const InstructionBlockLint = `` /* 222-byte string literal not displayed */
InstructionBlockLint is the instruction block for lint-based adapters (aider).
const InstructionBlockMCP = `` /* 1324-byte string literal not displayed */
InstructionBlockMCP is the instruction block for MCP-capable adapters.
Variables ¶
This section is empty.
Functions ¶
func AppendInstruction ¶
AppendInstruction upserts the devtap instruction block in filePath. If a devtap block exists, it is replaced with block; otherwise block is appended. Returns true if the file content changed.
func ConfigHasDevtap ¶
ConfigHasDevtap checks whether the config file at path exists and already contains a devtap configuration entry.
func ConfirmOverwrite ¶
ConfirmOverwrite prompts the user to confirm overwriting an existing devtap configuration. Returns true if the user answers yes.
func FindProjectInstruction ¶
FindProjectInstruction returns the path of the first existing file from paths, or an empty string if none exist.
func InstallInstruction ¶
InstallInstruction handles the full instruction injection flow:
- Find the first existing project instruction file → append (idempotent)
- If not found → create the highest priority project file
Types ¶
type Adapter ¶
type Adapter interface {
// Name returns the adapter identifier (e.g., "claude-code", "codex", "aider").
Name() string
// DiscoverSessions finds active sessions for this tool in the given project dir.
DiscoverSessions(projectDir string) ([]Session, error)
// Install configures the tool to integrate with devtap.
// For MCP-capable tools, this writes .mcp.json in the project dir.
// For tools without MCP, this creates tool-specific integration files.
Install(config InstallConfig) error
}
Adapter abstracts the integration with different AI coding tools.
type InstallConfig ¶
type InstallConfig struct {
ProjectDir string
AutoLoop bool
MaxRetries int
// ExtraArgs are additional CLI flags appended to mcp-serve / drain commands
// (e.g. ["--session", "myproject", "--store", "greptimedb"]).
ExtraArgs []string
}
InstallConfig holds configuration for installing devtap integration.