Documentation
¶
Overview ¶
hook_guard.go protects against cross-agent hook forwarding. Cursor IDE invokes any hook configured under .claude/settings.json or .cursor/hooks.json for the active session — when only one of those files is installed, the other agent's hook command receives the event. shouldSkipForwardedHook detects this by inspecting the transcript path: if it lives inside another registered agent's session directory, the firing agent is forwarded and must no-op so the session isn't claimed for the wrong agent (#1262).
hook_registry.go provides hook command registration for agents. The lifecycle dispatcher (DispatchLifecycleEvent) handles all lifecycle events. PostTodo is the only hook that's handled directly (not via lifecycle dispatcher).
hooks_claudecode_posttodo.go contains the PostTodo hook handler for Claude Code. This is a Claude-specific hook that creates incremental checkpoints during subagent execution. It's not part of the generic lifecycle dispatcher because it requires special handling: - Only fires for TodoWrite tool invocations - Creates incremental checkpoints (not full checkpoints) - Only activates when in subagent context (pre-task file exists)
lifecycle.go implements the generic lifecycle event dispatcher. It routes normalized events from any agent to the appropriate framework actions.
The dispatcher inverts the current flow from "agent handler calls framework functions" to "framework dispatcher calls agent methods." Agents are passive data providers; the dispatcher handles all orchestration: state transitions, strategy calls, file change detection, metadata generation.
Index ¶
- Constants
- func AgentTranscriptPath(transcriptDir, agentID string) string
- func BranchExistsLocally(ctx context.Context, branchName string) (bool, error)
- func BranchExistsOnRemote(ctx context.Context, branchName string) (bool, error)
- func CapturePrePromptState(ctx context.Context, ag agent.Agent, sessionID, sessionRef string) error
- func CapturePreTaskState(ctx context.Context, toolUseID string) error
- func CheckoutBranch(ctx context.Context, ref string) error
- func CleanupPrePromptState(ctx context.Context, sessionID string) error
- func CleanupPreTaskState(ctx context.Context, toolUseID string) error
- func CountTodosFromToolInput(toolInput json.RawMessage) int
- func DispatchLifecycleEvent(ctx context.Context, ag agent.Agent, event *agent.Event) error
- func EnsurePluginBinDir() (string, error)
- func ExtractLastCompletedTodoFromToolInput(toolInput json.RawMessage) string
- func ExtractTodoContentFromToolInput(toolInput json.RawMessage) string
- func FetchAndCheckoutRemoteBranch(ctx context.Context, branchName string) error
- func FetchBlobsByHash(ctx context.Context, hashes []plumbing.Hash) error
- func FetchCheckpointRef(ctx context.Context, ref plumbing.ReferenceName) error
- func FetchMetadataBranch(ctx context.Context) error
- func FetchMetadataFromCheckpointRemote(ctx context.Context) error
- func FetchMetadataTreeOnly(ctx context.Context) error
- func FilterAndNormalizePaths(files []string, cwd string) []string
- func FindActivePreTaskFile(ctx context.Context) (taskToolUseID string, found bool)
- func FindCheckpointUUID(lines []transcriptLine, toolUseID string) (string, bool)
- func GetAgentsWithHooksInstalled(ctx context.Context) []types.AgentName
- func GetCurrentBranch(ctx context.Context) (string, error)
- func GetCurrentHookAgent() (agent.Agent, error)
- func GetLogLevel() string
- func GetNextCheckpointSequence(sessionID, taskToolUseID string) int
- func GetStrategy(_ context.Context) *strategy.ManualCommitStrategy
- func HasUncommittedChanges(ctx context.Context) (bool, error)
- func InstalledAgentDisplayNames(ctx context.Context) []string
- func IsAccessibleMode() bool
- func IsEnabled(ctx context.Context) (bool, error)
- func IsOfficialPlugin(name string) bool
- func IsOnDefaultBranch(ctx context.Context) (bool, string, error)
- func JoinAgentNames(names []types.AgentName) string
- func LoadEntireSettings(ctx context.Context) (*settings.EntireSettings, error)
- func MaybeRunPlugin(ctx context.Context, rootCmd *cobra.Command, args []string) (handled bool, exitCode int)
- func NewAccessibleForm(groups ...*huh.Group) *huh.Form
- func NewAuthenticatedAPIClient(ctx context.Context, insecureHTTP bool) (*api.Client, error)
- func NewAuthenticatedEntireAPICellClient(ctx context.Context, insecureHTTP bool, fullName, ulid string) (*api.Client, error)
- func NewHelpCmd(rootCmd *cobra.Command) *cobra.Command
- func NewRootCmd() *cobra.Command
- func ParseSubagentTypeAndDescription(toolInput json.RawMessage) (agentType, description string)
- func PluginBinDir() (string, error)
- func PluginDataDir(name string) (string, error)
- func PrependPluginBinDirToPATH(ctx context.Context) func()
- func RemoveInstalledPlugin(name string) error
- func SaveEntireSettings(ctx context.Context, s *settings.EntireSettings) error
- func SaveEntireSettingsLocal(ctx context.Context, s *settings.EntireSettings) error
- func ShouldCheckCheckpointPolicyWarning(cmd *cobra.Command) bool
- func ShouldSkipOnDefaultBranch(ctx context.Context) (bool, string)
- func TruncateTranscriptAtUUID(lines []transcriptLine, uuid string) []transcriptLine
- func ValidateBranchName(ctx context.Context, branchName string) error
- func WarnCheckpointPolicyIfNeeded(ctx context.Context, w io.Writer, currentVersion string)
- type EnableOptions
- type EntireSettings
- type FileChanges
- type GitAuthor
- type GitHubBootstrapOptions
- type InstallPluginOptions
- type InstalledPlugin
- type PrePromptState
- type PreTaskState
- type SilentError
- type SubagentCheckpointHookInput
- type TempFileDeleteError
Constants ¶
const ( EntireSettingsFile = settings.EntireSettingsFile EntireSettingsLocalFile = settings.EntireSettingsLocalFile )
Package-level aliases to avoid shadowing the settings package with local variables named "settings".
const ( EntireDir = paths.EntireDir EntireTmpDir = paths.EntireTmpDir EntireMetadataDir = paths.EntireMetadataDir )
Directory paths - re-exported from paths package for convenience
const DisabledMessage = "Entire is disabled. Run `entire enable` to re-enable."
DisabledMessage is the message shown when Entire is disabled
Variables ¶
This section is empty.
Functions ¶
func AgentTranscriptPath ¶
AgentTranscriptPath returns the path to a subagent's transcript file. Subagent transcripts are stored as agent-{agentId}.jsonl in the same directory as the main transcript.
func BranchExistsLocally ¶
BranchExistsLocally checks if a local branch exists.
func BranchExistsOnRemote ¶
BranchExistsOnRemote checks if a branch exists on the origin remote. First checks local remote-tracking refs, then queries the actual remote via git ls-remote in case local refs are stale (e.g., after a fresh clone that didn't fetch all branches).
func CapturePrePromptState ¶
CapturePrePromptState captures current untracked files and transcript position before a prompt and saves them to a state file.
The agent parameter is used to determine the transcript position via TranscriptAnalyzer. If the agent does not implement TranscriptAnalyzer, the transcript offset will be 0. The sessionRef parameter is optional — if empty, transcript position won't be captured.
Works correctly from any subdirectory within the repository.
func CapturePreTaskState ¶
CapturePreTaskState captures current untracked files before a Task execution and saves them to a state file. Works correctly from any subdirectory within the repository.
func CheckoutBranch ¶
CheckoutBranch switches to the specified local branch or commit. Uses git CLI instead of go-git to work around go-git v5 bug where Checkout deletes untracked files (see https://github.com/go-git/go-git/issues/970). Should be switched back to go-git once we upgrade to go-git v6 Returns an error if the ref doesn't exist or checkout fails.
func CleanupPrePromptState ¶
CleanupPrePromptState removes the state file after use
func CleanupPreTaskState ¶
CleanupPreTaskState removes the task state file after use
func CountTodosFromToolInput ¶
func CountTodosFromToolInput(toolInput json.RawMessage) int
CountTodosFromToolInput returns the number of todo items in the TodoWrite tool_input. Returns 0 if the JSON is invalid or empty.
This function unwraps the outer tool_input object to extract the todos array, then delegates to strategy.CountTodos for the actual count.
func DispatchLifecycleEvent ¶ added in v0.4.6
DispatchLifecycleEvent routes a normalized lifecycle event to the appropriate handler. Returns nil if the event was handled successfully.
func EnsurePluginBinDir ¶ added in v0.6.1
EnsurePluginBinDir creates the managed install dir if it doesn't exist.
func ExtractLastCompletedTodoFromToolInput ¶
func ExtractLastCompletedTodoFromToolInput(toolInput json.RawMessage) string
ExtractLastCompletedTodoFromToolInput extracts the content of the last completed todo item. In PostToolUse[TodoWrite], the tool_input contains the NEW todo list where the just-finished work is marked as "completed". The last completed item represents the work that was just done.
Returns empty string if no completed items exist or JSON is invalid.
func ExtractTodoContentFromToolInput ¶
func ExtractTodoContentFromToolInput(toolInput json.RawMessage) string
ExtractTodoContentFromToolInput extracts the content of the in-progress todo item from TodoWrite tool_input. Falls back to the first pending item if no in-progress item is found. Returns empty string if no suitable item is found or JSON is invalid.
This function unwraps the outer tool_input object to extract the todos array, then delegates to strategy.ExtractInProgressTodo for the actual parsing logic.
func FetchAndCheckoutRemoteBranch ¶
FetchAndCheckoutRemoteBranch fetches a branch from origin and creates a local tracking branch. Uses git CLI instead of go-git for fetch because go-git doesn't use credential helpers, which breaks HTTPS URLs that require authentication.
func FetchBlobsByHash ¶ added in v0.5.1
FetchBlobsByHash fetches specific blob objects from the remote by their SHA-1 hashes. Uses "git fetch <target> <hash>" which goes through normal credential helpers, unlike fetch-pack which bypasses them. Requires the server to support uploadpack.allowReachableSHA1InWant (GitHub, GitLab, Bitbucket all do).
The fetch target is resolved via resolveCheckpointFetchTarget, which defers to checkpoint/remote.FetchURL for the effective remote URL when available.
If fetching by hash fails, falls back to a full metadata branch fetch.
func FetchCheckpointRef ¶ added in v0.8.0
func FetchCheckpointRef(ctx context.Context, ref plumbing.ReferenceName) error
FetchCheckpointRef fetches a single per-checkpoint ref (refs/entire/checkpoints/ <shard>/<id>) from the checkpoint remote into the local ref of the same name, so the git-refs store can resolve a checkpoint written on another machine. Best-effort: the caller treats a fetch failure as "checkpoint not found".
func FetchMetadataBranch ¶
FetchMetadataBranch fetches the entire/checkpoints/v1 branch from origin with full blob content. Used as a fallback by resume/explain when the tree-only probe is insufficient (e.g. the metadata.json blob is missing).
func FetchMetadataFromCheckpointRemote ¶ added in v0.5.3
FetchMetadataFromCheckpointRemote fetches the entire/checkpoints/v1 branch from the configured checkpoint_remote URL and updates the local branch. Returns an error if the fetch fails or no checkpoint_remote is configured.
func FetchMetadataTreeOnly ¶ added in v0.5.1
FetchMetadataTreeOnly fetches the entire/checkpoints/v1 commit+tree graph from origin to resolve the latest checkpoint, relying on --filter=blob:none (when filtered fetches are enabled) to skip blob content rather than on a shallow --depth=1 fetch.
It deliberately does NOT use --depth=1. A depth-1 fetch adds the fetched tip to .git/shallow, and any ref pointing at a shallow commit (the durable refs/remotes/origin/<branch> that git updates opportunistically, or the local primary) can no longer be walked past that boundary. A later `git merge-base` against it then falsely reports "no common ancestor", which makes push and `entire doctor` treat an ordinary diverged-but-behind branch as disconnected (see strategy.IsMetadataDisconnected). Fetching at full depth keeps the remote-tracking ref connected; git fetches incrementally, so after the first fetch only new commits/trees travel.
It also heals a repo that an older CLI already shallowed: the ref-scoped deep fetch removes the boundary left by a prior --depth=1 fetch rather than letting it linger forever, without deepening an independently-shallow source tree.
func FilterAndNormalizePaths ¶
FilterAndNormalizePaths converts absolute paths to relative and filters out infrastructure paths and paths outside the repo.
func FindActivePreTaskFile ¶
FindActivePreTaskFile finds an active pre-task file in .entire/tmp/ and returns the parent Task's tool_use_id. Returns ("", false) if no pre-task file exists. When multiple pre-task files exist (nested subagents), returns the most recently modified one. Works correctly from any subdirectory within the repository.
func FindCheckpointUUID ¶
FindCheckpointUUID finds the UUID of the message containing the tool_result for the given tool_use_id. This is used to find the checkpoint point for transcript truncation when rewinding to a task. Returns the UUID and true if found, empty string and false otherwise.
func GetAgentsWithHooksInstalled ¶
GetAgentsWithHooksInstalled returns names of agents that have hooks installed.
func GetCurrentBranch ¶
GetCurrentBranch returns the name of the current branch. Returns an error if in detached HEAD state or if not in a git repository.
func GetCurrentHookAgent ¶
GetCurrentHookAgent returns the agent for the currently executing hook. Returns the agent based on the hook command structure (e.g., "entire hooks claude-code ...") rather than guessing from directory presence. Falls back to GetAgent() if not in a hook context.
func GetLogLevel ¶
func GetLogLevel() string
GetLogLevel returns the configured log level from settings. Returns empty string if not configured (caller should use default). Note: ENTIRE_LOG_LEVEL env var takes precedence; check it first.
func GetNextCheckpointSequence ¶
GetNextCheckpointSequence returns the next sequence number for incremental checkpoints. It counts existing checkpoint files in the task metadata checkpoints directory. Returns 1 if no checkpoints exist yet.
func GetStrategy ¶
func GetStrategy(_ context.Context) *strategy.ManualCommitStrategy
GetStrategy returns the manual-commit strategy instance with blob fetching enabled so that checkpoint reads work after treeless fetches.
func HasUncommittedChanges ¶
HasUncommittedChanges checks if there are any uncommitted changes in the repository. This includes staged changes, unstaged changes, and untracked files. Uses git CLI instead of go-git because go-git doesn't respect global gitignore (core.excludesfile) which can cause false positives for globally ignored files.
func InstalledAgentDisplayNames ¶ added in v0.5.4
InstalledAgentDisplayNames returns user-facing display names for agents with hooks installed.
func IsAccessibleMode ¶
func IsAccessibleMode() bool
IsAccessibleMode returns true if accessibility mode is enabled via the ACCESSIBLE environment variable.
func IsEnabled ¶
IsEnabled returns whether Entire is currently enabled. Returns true by default if settings cannot be loaded.
func IsOfficialPlugin ¶ added in v0.6.1
func IsOnDefaultBranch ¶
IsOnDefaultBranch checks if the repository is currently on the default branch. It determines the default branch by: 1. Checking the remote origin's HEAD reference 2. Falling back to common names (main, master) if remote HEAD is unavailable Returns (isDefault, branchName, error)
func JoinAgentNames ¶
JoinAgentNames joins agent names into a comma-separated string.
func LoadEntireSettings ¶
func LoadEntireSettings(ctx context.Context) (*settings.EntireSettings, error)
LoadEntireSettings loads the Entire settings from .entire/settings.json, then applies any overrides from .entire/settings.local.json if it exists. Returns default settings if neither file exists. Works correctly from any subdirectory within the repository.
func MaybeRunPlugin ¶ added in v0.6.1
func MaybeRunPlugin(ctx context.Context, rootCmd *cobra.Command, args []string) (handled bool, exitCode int)
MaybeRunPlugin returns (true, exitCode) when an external command was resolved and run. On launch failure (e.g. missing executable bit) returns (true, 1) after printing to stderr. On no-match returns (false, 0) so the caller can fall through to Cobra.
Telemetry and the version-check notice mirror Cobra's PersistentPostRun behavior for built-ins: both fire only on a successful (exit-0) run.
func NewAccessibleForm ¶
NewAccessibleForm creates a new huh form with Entire's standard theme, switching to accessibility mode when ACCESSIBLE is set.
func NewAuthenticatedAPIClient ¶ added in v0.5.2
NewAuthenticatedAPIClient creates an API client targeting api.BaseURL() (the data API origin) carrying a token valid for that audience, minted by exchanging the matching login context's JWT at its own core (see auth.ResolveDataAPIToken).
Pass insecureHTTP=true to allow plain HTTP base URLs for local development. Only the data origin is checked here — the bearer travels there on resource requests; the exchange leg is guarded by the per-context token manager (https required outside loopback/opt-in).
func NewAuthenticatedEntireAPICellClient ¶ added in v0.8.0
func NewAuthenticatedEntireAPICellClient(ctx context.Context, insecureHTTP bool, fullName, ulid string) (*api.Client, error)
NewAuthenticatedEntireAPICellClient creates an API client for repo-scoped entire-api routes (e.g. experts). It exchanges the login JWT for a jurisdictional identity token and dials the entire-api cell directly, because the BFF does not proxy these routes for bearer callers (COR-666).
fullName (owner/repo) and/or ulid identify the repo whose cell to reach. When either is supplied, the repo's OWNING cell + jurisdiction are resolved from the control plane (mirroring the BFF's per-repo cell selection) so the call lands in the region that hosts the repo. Resolution is best-effort: any failure yields a nil target and NewEntireAPICellClient falls back to home-jurisdiction routing, so the common same-region case never regresses.
func NewHelpCmd ¶
NewHelpCmd creates a custom help command that supports a hidden -t flag to display the entire command tree.
func NewRootCmd ¶
func ParseSubagentTypeAndDescription ¶
func ParseSubagentTypeAndDescription(toolInput json.RawMessage) (agentType, description string)
ParseSubagentTypeAndDescription extracts subagent_type and description from Task tool_input. Returns empty strings if parsing fails or fields are not present.
func PluginBinDir ¶ added in v0.6.1
PluginBinDir returns the managed install directory. Binaries (or symlinks) placed here are auto-discovered by the kubectl-style dispatcher because main.go prepends this dir to PATH before MaybeRunPlugin runs.
func PluginDataDir ¶ added in v0.6.1
PluginDataDir returns the per-plugin data directory for the given bare name (e.g. "pgr" for `entire-pgr`). The returned path is not created — that's the plugin's responsibility on first use.
Returns an error for names the dispatcher would never invoke (empty, flag-shaped, agent-protocol-reserved, "."/".." path-traversal, slashes). This guarantees ENTIRE_PLUGIN_DATA_DIR always points inside the managed data subtree.
func PrependPluginBinDirToPATH ¶ added in v0.6.1
PrependPluginBinDirToPATH prepends the managed bin dir to the process's PATH so the kubectl dispatcher discovers managed-installed plugins. Idempotent against an already-prepended dir.
Returns a restore closure the caller invokes to revert PATH to its previous value. Restoring matters when no plugin runs: built-in commands and the subprocesses they spawn (git, hooks, less, …) should see the user's original PATH, not one with the managed plugin dir prepended. When a plugin *is* dispatched, callers can simply skip the restore — the process exits anyway, and the plugin child intentionally inherits the prepended PATH so it can spawn sibling managed plugins.
Errors and no-op cases (already-prepended, lookup failure) return a no-op restore so callers always have a safe func to call. Failures are emitted at debug level — the surface symptom ("my managed plugin doesn't run") is otherwise silent and hard to diagnose; a debug log surfaces the cause for users who flip log_level=DEBUG.
func RemoveInstalledPlugin ¶ added in v0.6.1
RemoveInstalledPlugin removes every managed-dir entry whose bare name matches name. Symlinks are unlinked without touching the source file.
Iterating all variants matters on Windows, where entire-foo.exe, entire-foo.bat, and entire-foo.cmd all map to bare name "foo" and could otherwise leave a runnable variant behind after `entire plugin remove foo`. On Unix the loop typically runs once.
func SaveEntireSettings ¶
func SaveEntireSettings(ctx context.Context, s *settings.EntireSettings) error
SaveEntireSettings saves the Entire settings to .entire/settings.json.
func SaveEntireSettingsLocal ¶
func SaveEntireSettingsLocal(ctx context.Context, s *settings.EntireSettings) error
SaveEntireSettingsLocal saves the Entire settings to .entire/settings.local.json.
func ShouldCheckCheckpointPolicyWarning ¶ added in v0.7.8
func ShouldSkipOnDefaultBranch ¶
ShouldSkipOnDefaultBranch checks if we're on the default branch. Returns (shouldSkip, branchName). If shouldSkip is true, the caller should skip the operation to avoid polluting main/master history. If the branch cannot be determined, returns (false, "") to allow the operation.
func TruncateTranscriptAtUUID ¶
func TruncateTranscriptAtUUID(lines []transcriptLine, uuid string) []transcriptLine
TruncateTranscriptAtUUID returns transcript lines up to and including the line with the given UUID. If the UUID is not found or is empty, returns the entire transcript.
func ValidateBranchName ¶
ValidateBranchName checks if a branch name is valid using git check-ref-format. Returns an error if the name is invalid or contains unsafe characters.
Types ¶
type EnableOptions ¶ added in v0.4.9
type EnableOptions struct {
LocalDev bool
UseLocalSettings bool
UseProjectSettings bool
ForceHooks bool
SkipPushSessions bool
CheckpointRemote string
Telemetry bool
AbsoluteGitHookPath bool
// SuppressDoneMessage tells `runEnableInteractive` to skip its final
// "Ready." line and the "commit the configuration files" hint. Set
// when the caller is running the bootstrap flow, which takes over
// presentation of the final state (commit, push, done).
SuppressDoneMessage bool
Yes bool
SearchSkill bool
AgentHelpSkill bool
}
EnableOptions holds the flags for `entire enable`.
type EntireSettings ¶
type EntireSettings = settings.EntireSettings
EntireSettings is an alias for settings.EntireSettings.
type FileChanges ¶ added in v0.4.3
type FileChanges struct {
Modified []string // Modified or staged files
New []string // Untracked files (filtered if previouslyUntracked provided)
Deleted []string // Deleted files (staged or unstaged)
}
FileChanges holds categorized file changes from git status.
func DetectFileChanges ¶ added in v0.4.3
func DetectFileChanges(ctx context.Context, previouslyUntracked []string) (*FileChanges, error)
DetectFileChanges returns categorized file changes from the current git status.
previouslyUntracked controls new-file detection:
- nil: all untracked files go into New
- non-nil: only untracked files NOT in the pre-existing set go into New
Modified includes both worktree and staging modified/added files. Deleted includes both staged and unstaged deletions. All results exclude .entire/ directory.
type GitAuthor ¶
GitAuthor represents the git user configuration
func GetGitAuthor ¶
GetGitAuthor retrieves the git user.name and user.email from the repository config. It checks local config first, then falls back to global config. If go-git can't find the config, it falls back to using the git command. Returns fallback defaults if no user is configured anywhere.
type GitHubBootstrapOptions ¶ added in v0.5.6
type GitHubBootstrapOptions struct {
// InitRepo is true if --init-repo was passed (accept git init without prompt).
InitRepo bool
// NoInitRepo is true if --no-init-repo was passed (decline without prompt).
NoInitRepo bool
// RepoName is the GitHub repository name (no owner).
RepoName string
// RepoOwner is the GitHub user or org login.
RepoOwner string
// RepoVisibility is one of "public", "private", "internal".
RepoVisibility string
// NoGitHub skips the GitHub repo creation step.
NoGitHub bool
// InitialCommitMessage overrides the default commit message prompt.
InitialCommitMessage string
// SkipInitialCommit leaves the newly-created files unstaged so the
// user can commit themselves. The GitHub repo (if requested) is
// still created, but nothing is pushed.
SkipInitialCommit bool
// Yes accepts all defaults without prompting: init repo, create GitHub
// repo under the user's account (private), default commit message.
// Explicit flags (--no-github, --repo-owner, etc.) take precedence.
Yes bool
}
GitHubBootstrapOptions holds flags that let `entire enable` run on a folder that isn't yet a git repository. All fields are optional; supplying one skips the matching interactive prompt.
type InstallPluginOptions ¶ added in v0.6.1
type InstallPluginOptions struct {
// SourcePath is the absolute (or working-dir-relative) path to the plugin
// executable. Its basename — minus any platform extension — must match
// `entire-<name>` so the dispatcher can resolve it.
SourcePath string
// Force replaces an already-installed plugin with the same name.
Force bool
}
InstallPluginOptions configures InstallPluginFromPath.
type InstalledPlugin ¶ added in v0.6.1
type InstalledPlugin struct {
// Name is the bare plugin name (without the `entire-` prefix and any
// platform-specific extension).
Name string
// Path is the absolute path inside the managed bin dir.
Path string
// Symlink is true when Path is a symlink to a source location elsewhere
// (the typical local-dev install). LinkTarget is populated in that case.
Symlink bool
LinkTarget string
}
InstalledPlugin describes a single entry in the managed bin dir.
func FindInstalledPlugin ¶ added in v0.6.1
func FindInstalledPlugin(name string) (*InstalledPlugin, error)
FindInstalledPlugin returns the entry for the given bare name, or nil if it isn't installed in the managed dir.
func InstallPluginFromPath ¶ added in v0.6.1
func InstallPluginFromPath(opts InstallPluginOptions) (*InstalledPlugin, error)
InstallPluginFromPath symlinks SourcePath into the managed bin dir. The caller is responsible for built-in conflict checks (resolvePlugin already gates dispatch on rootCmd.Find — installing a name that shadows a built-in is allowed but the built-in still wins at runtime).
Refuses names the dispatcher will never invoke (agent-protocol prefix, flag-shaped, "."/"..", slashes), and refuses self-install when the source is the same file as the would-be managed entry. The replace step is atomic: a new symlink is created at <dest>.tmp and renamed onto <dest>, so a failed --force never leaves the previous install missing.
func ListInstalledPlugins ¶ added in v0.6.1
func ListInstalledPlugins() ([]*InstalledPlugin, error)
ListInstalledPlugins enumerates entries in the managed bin dir whose name starts with `entire-`. Sorted by bare name. A missing dir returns no error and an empty slice.
type PrePromptState ¶
type PrePromptState struct {
SessionID string `json:"session_id"`
Timestamp string `json:"timestamp"`
UntrackedFiles []string `json:"untracked_files"`
// TranscriptOffset is the unified transcript position when this state was captured.
// For Claude Code (JSONL), this is the line count.
// For Gemini CLI (JSON), this is the message count.
// Zero means not set or session just started.
TranscriptOffset int `json:"transcript_offset,omitempty"`
// LastTranscriptIdentifier is the agent-specific identifier at the transcript position.
// UUID for Claude Code, message ID for Gemini CLI. Optional metadata.
LastTranscriptIdentifier string `json:"last_transcript_identifier,omitempty"`
// Deprecated: StartMessageIndex is the old Gemini-specific field.
// Migrated to TranscriptOffset on load.
StartMessageIndex int `json:"start_message_index,omitempty"`
// Deprecated: StepTranscriptStart is the old Claude-specific field.
// Migrated to TranscriptOffset on load.
StepTranscriptStart int `json:"step_transcript_start,omitempty"`
// Deprecated: LastTranscriptLineCount is the oldest name for transcript position.
// Migrated to TranscriptOffset on load.
LastTranscriptLineCount int `json:"last_transcript_line_count,omitempty"`
}
PrePromptState stores the state captured before a user prompt
func LoadPrePromptState ¶
func LoadPrePromptState(ctx context.Context, sessionID string) (*PrePromptState, error)
LoadPrePromptState loads previously captured state. Returns nil if no state file exists.
func (*PrePromptState) PreUntrackedFiles ¶ added in v0.4.3
func (s *PrePromptState) PreUntrackedFiles() []string
PreUntrackedFiles returns the untracked files list, or nil if the receiver is nil. This nil-vs-empty distinction lets DetectFileChanges know whether to skip new-file detection. When the receiver is non-nil but UntrackedFiles is nil (e.g., old state files deserialized with "untracked_files": null), returns an empty non-nil slice so that all current untracked files are correctly treated as new.
type PreTaskState ¶
type PreTaskState struct {
ToolUseID string `json:"tool_use_id"`
Timestamp string `json:"timestamp"`
UntrackedFiles []string `json:"untracked_files"`
}
PreTaskState stores the state captured before a task execution
func LoadPreTaskState ¶
func LoadPreTaskState(ctx context.Context, toolUseID string) (*PreTaskState, error)
LoadPreTaskState loads previously captured task state. Returns nil if no state file exists.
func (*PreTaskState) PreUntrackedFiles ¶ added in v0.4.3
func (s *PreTaskState) PreUntrackedFiles() []string
PreUntrackedFiles returns the untracked files list, or nil if the receiver is nil. See PrePromptState.PreUntrackedFiles for nil-vs-empty semantics.
type SilentError ¶
type SilentError struct {
Err error
}
SilentError wraps an error to signal that the error message has already been printed to the user. main.go checks for this type to avoid duplicate output.
func NewSilentError ¶
func NewSilentError(err error) *SilentError
NewSilentError creates a SilentError wrapping the given error. Use this when you've already printed a user-friendly error message and don't want main.go to print the error again.
func (*SilentError) AlreadyPrinted ¶ added in v0.7.8
func (e *SilentError) AlreadyPrinted() bool
AlreadyPrinted reports that the user-facing message has already been written.
func (*SilentError) Error ¶
func (e *SilentError) Error() string
func (*SilentError) Unwrap ¶
func (e *SilentError) Unwrap() error
type SubagentCheckpointHookInput ¶
type SubagentCheckpointHookInput struct {
SessionID string `json:"session_id"`
TranscriptPath string `json:"transcript_path"`
ToolName string `json:"tool_name"`
ToolUseID string `json:"tool_use_id"`
ToolInput json.RawMessage `json:"tool_input"`
ToolResponse json.RawMessage `json:"tool_response"`
}
SubagentCheckpointHookInput represents the JSON input from PostToolUse hooks for subagent checkpoint creation (TodoWrite, Edit, Write)
type TempFileDeleteError ¶ added in v0.4.6
TempFileDeleteError contains a file name and the error that occurred during deletion.
Source Files
¶
- activity_cmd.go
- activity_render.go
- activity_tui.go
- activity_types.go
- agent_group.go
- agent_help_cmd.go
- aliascmd.go
- api_client.go
- api_cmd.go
- attach.go
- attach_transcript.go
- attribution.go
- auth.go
- auth_context.go
- authcmd.go
- checkpoint_group.go
- checkpoint_policy.go
- checkpoint_policy_telemetry.go
- checkpoint_policy_warning.go
- checkpoint_policy_write.go
- checkpoint_tokens.go
- clean.go
- commit_message.go
- config.go
- constants.go
- corecmd.go
- dispatch.go
- dispatch_tui.go
- dispatch_wizard.go
- doctor.go
- doctor_bundle.go
- doctor_logs.go
- entireapi_client.go
- errors.go
- experts_cell_target.go
- experts_cmd.go
- experts_tui.go
- explain.go
- explain_export.go
- explain_summary_provider.go
- git_operations.go
- grant.go
- head_checkpoint_flags.go
- help.go
- hook_guard.go
- hook_registry.go
- hooks.go
- hooks_claudecode_posttodo.go
- hooks_cmd.go
- hooks_git_cmd.go
- import_cmd.go
- investigate_bridge.go
- keys.go
- labs.go
- lifecycle.go
- login.go
- logout.go
- mcp.go
- org.go
- plugin.go
- plugin_env.go
- plugin_group.go
- plugin_official.go
- plugin_store.go
- progress.go
- project.go
- recap.go
- recap_errors.go
- recap_tui.go
- repo.go
- repo_clone.go
- repo_mirror.go
- repo_mirror_collaborators.go
- repo_mirror_create_wizard.go
- repo_mirror_probe.go
- reset.go
- resolveref.go
- resume.go
- resume_continue.go
- resume_picker.go
- review_bridge.go
- review_context.go
- review_helpers.go
- rewind.go
- root.go
- runner_apply.go
- runner_gather.go
- runner_group.go
- runner_init.go
- runner_prompt.go
- runner_setup.go
- search_cmd.go
- search_tui.go
- session_adopt.go
- session_current.go
- session_finalize.go
- session_tokens.go
- sessions.go
- setup.go
- setup_agent_help_skill.go
- setup_github.go
- setup_managed_scaffold.go
- setup_search_skill.go
- state.go
- status.go
- status_style.go
- tokens_profile.go
- trace.go
- trace_cmd.go
- trail_cmd.go
- trail_context_cache.go
- trail_resume_cmd.go
- trail_review_cmd.go
- trail_watch_cmd.go
- transcript.go
- types.go
- utils.go
Directories
¶
| Path | Synopsis |
|---|---|
|
Package agent provides interfaces and types for integrating with coding agents.
|
Package agent provides interfaces and types for integrating with coding agents. |
|
claudecode
Package claudecode implements the Agent interface for Claude Code.
|
Package claudecode implements the Agent interface for Claude Code. |
|
codex
Package codex implements the Agent interface for OpenAI's Codex CLI.
|
Package codex implements the Agent interface for OpenAI's Codex CLI. |
|
copilotcli
Package copilotcli implements the Agent interface for GitHub Copilot CLI.
|
Package copilotcli implements the Agent interface for GitHub Copilot CLI. |
|
cursor
Package cursor implements the Agent interface for Cursor.
|
Package cursor implements the Agent interface for Cursor. |
|
external
Package external provides an adapter that bridges external agent binaries (discovered via PATH as entire-agent-<name>) to the agent.Agent interface.
|
Package external provides an adapter that bridges external agent binaries (discovered via PATH as entire-agent-<name>) to the agent.Agent interface. |
|
factoryaidroid
Package factoryaidroid implements the Agent interface for Factory AI Droid.
|
Package factoryaidroid implements the Agent interface for Factory AI Droid. |
|
geminicli
Package geminicli implements the Agent interface for Gemini CLI.
|
Package geminicli implements the Agent interface for Gemini CLI. |
|
opencode
Package opencode implements the Agent interface for OpenCode.
|
Package opencode implements the Agent interface for OpenCode. |
|
pi
Package pi implements the Agent interface for the pi coding agent (https://github.com/earendil-works/pi-mono).
|
Package pi implements the Agent interface for the pi coding agent (https://github.com/earendil-works/pi-mono). |
|
pi/pijsonl
Package pijsonl provides shared parsing primitives for Pi's session JSONL format.
|
Package pijsonl provides shared parsing primitives for Pi's session JSONL format. |
|
skilldiscovery
Package skilldiscovery holds the per-agent registries (curated built-ins, install hints) and the keyword match helper that the `entire review` picker uses to discover review-adjacent skills.
|
Package skilldiscovery holds the per-agent registries (curated built-ins, install hints) and the keyword match helper that the `entire review` picker uses to discover review-adjacent skills. |
|
spawn
Package spawn provides the Spawner interface used by both `entire review` and `entire investigate` to start an agent process non-interactively.
|
Package spawn provides the Spawner interface used by both `entire review` and `entire investigate` to start an agent process non-interactively. |
|
testutil
Package testutil provides shared test utilities for agent packages.
|
Package testutil provides shared test utilities for agent packages. |
|
vogon
Package vogon implements the Agent interface for a deterministic test agent used as an E2E canary.
|
Package vogon implements the Agent interface for a deterministic test agent used as an E2E canary. |
|
Package agentimport imports a coding agent's pre-existing local transcripts into Entire as read-only, commit-less checkpoints on the v1 metadata branch.
|
Package agentimport imports a coding agent's pre-existing local transcripts into Entire as read-only, commit-less checkpoints on the v1 metadata branch. |
|
Package agentlaunch is the shared "launch a normal coding agent session with a composed prompt" helper, used by `entire investigate fix`.
|
Package agentlaunch is the shared "launch a normal coding agent session with a composed prompt" helper, used by `entire investigate fix`. |
|
Package benchutil provides test fixture helpers for CLI benchmarks.
|
Package benchutil provides test fixture helpers for CLI benchmarks. |
|
Package checkpoint provides types and interfaces for checkpoint storage.
|
Package checkpoint provides types and interfaces for checkpoint storage. |
|
fsstore
Package fsstore is a reference, test-only persistent checkpoint backend that stores checkpoints as JSON files on disk.
|
Package fsstore is a reference, test-only persistent checkpoint backend that stores checkpoints as JSON files on disk. |
|
id
Package id provides the CheckpointID type for identifying checkpoints.
|
Package id provides the CheckpointID type for identifying checkpoints. |
|
Package execx provides explicit helpers for spawning subprocesses with a chosen TTY attachment mode, replacing env-var signalling with real OS state.
|
Package execx provides explicit helpers for spawning subprocesses with a chosen TTY attachment mode, replacing env-var signalling with real OS state. |
|
Package gitexec runs the git CLI from inside the codebase.
|
Package gitexec runs the git CLI from inside the codebase. |
|
Package gitremote provides general-purpose git remote URL utilities: parsing, resolving, and redacting remote URLs.
|
Package gitremote provides general-purpose git remote URL utilities: parsing, resolving, and redacting remote URLs. |
|
Package interactive provides TTY-related helpers shared between the cli and strategy packages without inducing an import cycle (strategy cannot import cli).
|
Package interactive provides TTY-related helpers shared between the cli and strategy packages without inducing an import cycle (strategy cannot import cli). |
|
internal
|
|
|
flock
Package flock provides a small cross-process advisory-lock primitive built on POSIX flock (Unix) / LockFileEx (Windows).
|
Package flock provides a small cross-process advisory-lock primitive built on POSIX flock (Unix) / LockFileEx (Windows). |
|
Package investigate contains the env-var contract between `entire investigate` (which spawns the agent process) and the lifecycle hook (which adopts the session), plus the persisted run state for resuming an investigation.
|
Package investigate contains the env-var contract between `entire investigate` (which spawns the agent process) and the lifecycle hook (which adopts the session), plus the persisted run state for resuming an investigation. |
|
flowchart
Package flowchart renders Mermaid flowcharts as top-down Unicode box diagrams for terminal display.
|
Package flowchart renders Mermaid flowcharts as top-down Unicode box diagrams for terminal display. |
|
Package jsonutil provides JSON utilities with consistent formatting.
|
Package jsonutil provides JSON utilities with consistent formatting. |
|
Package lockfile provides cross-process file locks.
|
Package lockfile provides cross-process file locks. |
|
Package logging provides structured logging for the Entire CLI using slog.
|
Package logging provides structured logging for the Entire CLI using slog. |
|
Package mdrender renders markdown to terminal-styled output using the shared entire CLI palette (orange H1, cyan H2, indigo H3, plus chroma syntax highlighting).
|
Package mdrender renders markdown to terminal-styled output using the shared entire CLI palette (orange H1, cyan H2, indigo H3, plus chroma syntax highlighting). |
|
Package osroot provides traversal-resistant file I/O helpers built on os.Root (Go 1.24+).
|
Package osroot provides traversal-resistant file I/O helpers built on os.Root (Go 1.24+). |
|
Package proclive captures a process's identity (PID plus a start-time fingerprint) and later reports whether that exact process is still alive.
|
Package proclive captures a process's identity (PID plus a start-time fingerprint) and later reports whether that exact process is still alive. |
|
Package procutil holds helpers for cancelling spawned subprocesses.
|
Package procutil holds helpers for cancelling spawned subprocesses. |
|
Package provenance owns the env-var contract that lets the lifecycle hook recognize a spawned agent process as part of `entire review` or `entire investigate`.
|
Package provenance owns the env-var contract that lets the lifecycle hook recognize a spawned agent process as part of `entire review` or `entire investigate`. |
|
Package recap contains the server-backed data types and static renderer behind `entire recap`.
|
Package recap contains the server-backed data types and static renderer behind `entire recap`. |
|
Package review — see env.go for package-level rationale.
|
Package review — see env.go for package-level rationale. |
|
types
Package types defines the per-agent abstraction interfaces for `entire review`.
|
Package types defines the per-agent abstraction interfaces for `entire review`. |
|
Package runnerdefaults embeds the canonical generic trail runner configs, so `entire runner setup` can scaffold them into a repository that has none yet.
|
Package runnerdefaults embeds the canonical generic trail runner configs, so `entire runner setup` can scaffold them into a repository that has none yet. |
|
Package search provides search functionality via the Entire search service.
|
Package search provides search functionality via the Entire search service. |
|
Package settings provides configuration loading for Entire.
|
Package settings provides configuration loading for Entire. |
|
Pre-push OPF rewrite for entire/checkpoints/v1.
|
Pre-push OPF rewrite for entire/checkpoints/v1. |
|
Package stringutil provides UTF-8 safe string manipulation utilities.
|
Package stringutil provides UTF-8 safe string manipulation utilities. |
|
Package summarize provides AI-powered summarization of development sessions.
|
Package summarize provides AI-powered summarization of development sessions. |
|
Package testutil provides shared test utilities for both integration and e2e tests.
|
Package testutil provides shared test utilities for both integration and e2e tests. |
|
Package trail provides types and helpers for managing trail metadata.
|
Package trail provides types and helpers for managing trail metadata. |
|
Package trailers provides parsing and formatting for Entire commit message trailers.
|
Package trailers provides parsing and formatting for Entire commit message trailers. |
|
Package transcript provides shared types and utilities for parsing JSONL transcripts.
|
Package transcript provides shared types and utilities for parsing JSONL transcripts. |
|
compact
Package compact converts full.jsonl transcripts into a normalized, compact transcript.jsonl format.
|
Package compact converts full.jsonl transcripts into a normalized, compact transcript.jsonl format. |
|
Package tuiutil hosts width-aware text helpers for fixed-width TUI dashboards: ANSI/control-char stripping, display-width-based truncation and padding, and a compact duration formatter.
|
Package tuiutil hosts width-aware text helpers for fixed-width TUI dashboards: ANSI/control-char stripping, display-width-based truncation and padding, and a compact duration formatter. |
|
Package uiform builds huh forms wired to Entire's standard theme and accessibility behavior.
|
Package uiform builds huh forms wired to Entire's standard theme and accessibility behavior. |
|
Package validation provides input validation functions for the Entire CLI.
|
Package validation provides input validation functions for the Entire CLI. |