Documentation
¶
Index ¶
- Variables
- func Abandoned(currentConfigRoot, previousProfile, previousExecutable string) bool
- func AllowTools(path string, tools []string) error
- func Command(executable, configRoot, vendor string) (string, error)
- func DisallowTools(path string, tools []string) error
- func Install(path, command string) error
- func ParseManagedCommand(command string) (executable, configRoot string, ok bool)
- func PortableCommand(vendor string) (string, error)
- func Rebind(path, command string) error
- func Remove(path, command string) error
- func Status(path, command string) (bool, error)
- type BindingState
- type Inspection
Constants ¶
This section is empty.
Variables ¶
var OvergentMCPTools = []string{
"mcp__overgent__acknowledge_context",
"mcp__overgent__begin_work",
"mcp__overgent__check_coordination",
"mcp__overgent__finish_work",
"mcp__overgent__get_resolutions",
"mcp__overgent__report_checkpoint",
"mcp__overgent__report_event",
"mcp__overgent__update_intent",
}
OvergentMCPTools are the coordination tools `overgent mcp` registers, in the permission form Claude Code matches. The MCP server is the source of truth for this list; a test there asserts the two agree, so adding a tool without pre-approving it fails in CI rather than at a member's keyboard.
Functions ¶
func Abandoned ¶
Abandoned reports whether a managed binding owned by previousProfile can be adopted onto currentConfigRoot without asking the member first.
The question this answers is not "is it ours" - every binding this package recognizes is ours - but "is anything still using it". A binding nothing can still be using is not a decision, it is a leftover, and presenting it as a decision is what stranded members behind a Reconnect button that named the same profile on both sides of the arrow.
It is deliberately conservative: an unrecognized previous executable, or a profile that still exists and still holds an enrolled device, is left for an explicit reconnect. False here costs a confirmation; true here silently moves a binding that another live profile depends on.
func AllowTools ¶
AllowTools pre-approves exactly Overgent's own coordination tools in the settings file this package already manages.
A member who has just run `setup claude` is then asked to approve begin_work, check_coordination, report_checkpoint and finish_work one at a time, which is four interruptions from the coordination layer before any work happens — and a coordination harness that interrupts more than it prevents is worse than none. These tools publish bounded intent and read back a brief; they do not edit files, run commands, or reach outside the Project.
The grant is deliberately narrow. Only the exact tool names above are added, never a wildcard and never another server's tools, entries a member already wrote are preserved, and `Remove` withdraws exactly what was granted.
func Command ¶
Command builds the managed hook command for a vendor.
Cursor is accepted here because it invokes the same executable through the same `agent-hook --vendor` entry point, but it is NOT accepted by this package's file operations: Cursor's configuration is a different document (`.cursor/hooks.json`, a versioned object keyed by camelCase event name with its own per-handler fields) rather than the Claude/Codex settings shape these functions read and write. internal/cursorsetup owns that file and appends the `--event` argument each Cursor hook needs, because two of Cursor's events name themselves nowhere in their payload.
func DisallowTools ¶
DisallowTools withdraws exactly the entries AllowTools granted, leaving every other permission a member configured untouched.
func Install ¶
Install structurally adds Overgent's exact managed hooks while preserving all unrelated settings and hooks. The command is intentionally a fixed string assembled from application-owned absolute paths, never user input.
func ParseManagedCommand ¶
ParseManagedCommand splits a managed Overgent hook command into the executable it runs and the Overgent profile it is bound to. A portable command names no profile, so it reports an empty config root.
It fails closed. Anything that is not exactly the shape Command and PortableCommand write is not ours to interpret, and every caller treats ok=false as "leave this alone".
func PortableCommand ¶
Types ¶
type BindingState ¶
type BindingState string
const ( BindingNotConfigured BindingState = "not_configured" BindingCurrent BindingState = "current" BindingPartial BindingState = "partial" BindingOtherProfile BindingState = "other_profile" )
type Inspection ¶
type Inspection struct {
State BindingState
ExistingCommand string
}
func Inspect ¶
func Inspect(path, command string) (Inspection, error)
Inspect distinguishes a complete current binding from a partial install and from a structurally valid Overgent binding owned by another local profile. Unknown or conflicting managed-looking commands fail closed.