Documentation
¶
Index ¶
- Constants
- func AddAttributeString(attributes map[string]string, key string, value string)
- func FirstArrayString(payload map[string]any, keys ...string) string
- func FirstNonEmpty(values ...string) string
- func HookTimeoutSecondsFor(harness registry.Harness, event string) int
- func NestedString(payload map[string]any, path ...string) string
- func PayloadBool(payload map[string]any, keys ...string) bool
- func PayloadBoolString(payload map[string]any, keys ...string) string
- func PayloadObject(rawPayload json.RawMessage) (map[string]any, bool)
- func PayloadString(payload map[string]any, key string) string
- func PayloadStringAny(payload map[string]any, keys ...string) string
- func RawStdinDefaultsReportHookCommand[T Transition](binary string, harness registry.Harness, transition T, event string, ...) string
- func RenderScriptTemplate(template string, integrationID string, binary string, source string, ...) string
- func ReportHookCommand[T Transition](binary string, harness registry.Harness, transition T, event string, ...) string
- func RunCommand(ctx context.Context, timeout time.Duration, outputLimit int, executable string, ...) ([]byte, error)
- func ShellQuote(value string) string
- type Adapter
- type BaseAdapter
- type Capabilities
- type CommandHookInstallSpec
- type CursorCommandHookInstallSpec
- type CursorJSONHookInstallPlan
- type CursorJSONHooksAction
- type Definition
- type EnvField
- type EnvKeys
- type HookAdapter
- type HookInvocation
- type HookPayloadValidator
- type HookResult
- type HookTransition
- type ImportManifestInstallPlan
- type InstallAction
- type InstallAdvisor
- type InstallPlan
- type Installable
- type JSONCommandHookInstallPlan
- type JSONCommandHooksAction
- type ManagedTextBlockAction
- type ManagedTextBlockInstallPlan
- type PayloadAdapter
- type PayloadDefaults
- type PluginDirectoryAction
- type PluginDirectoryInstallPlan
- type PluginRegistration
- type PluginRegistrationState
- type RenderedFileAction
- type RenderedFileInstallPlan
- type RenderedFileInstallSpec
- type RenderedFilesAction
- type RenderedFilesInstallPlan
- type Resumable
- type ScreenManifestProvider
- type ShimAction
- type Transition
Constants ¶
View Source
const ( ManagedMarker = "aht managed integration" HookTimeoutSeconds = 5 HookTypeCommand = "command" HookEventSessionStart = "SessionStart" HookEventSessionEnd = "SessionEnd" HookEventUserPromptSubmit = "UserPromptSubmit" HookEventPostToolUse = "PostToolUse" HookEventPostToolUseFailure = "PostToolUseFailure" HookEventPreToolUse = "PreToolUse" HookEventStop = "Stop" ResumeFlag = "--resume" HookActivityRunning HookTransition = "activity:running" HookActivityWaiting HookTransition = "activity:waiting" HookActivityIdle HookTransition = "activity:idle" HookActivityFailed HookTransition = "activity:failed" HookActivityInterrupted HookTransition = "activity:interrupted" HookPresenceGone HookTransition = "presence:gone" )
Variables ¶
This section is empty.
Functions ¶
func AddAttributeString ¶
func FirstNonEmpty ¶
func HookTimeoutSecondsFor ¶
HookTimeoutSecondsFor returns the native command-hook timeout for an event.
func PayloadObject ¶
func PayloadObject(rawPayload json.RawMessage) (map[string]any, bool)
func RenderScriptTemplate ¶
func ReportHookCommand ¶
func RunCommand ¶
func RunCommand(ctx context.Context, timeout time.Duration, outputLimit int, executable string, args ...string) ([]byte, error)
RunCommand executes a command with bounded output and a caller-specified timeout. It never returns a partial successful response when the output budget is exceeded.
func ShellQuote ¶
Types ¶
type Adapter ¶
type Adapter interface {
Definition() Definition
}
type BaseAdapter ¶
type BaseAdapter struct {
// contains filtered or unexported fields
}
func NewBaseAdapter ¶
func NewBaseAdapter(definition Definition) BaseAdapter
func (BaseAdapter) Definition ¶
func (adapter BaseAdapter) Definition() Definition
type Capabilities ¶
type CommandHookInstallSpec ¶
type CursorJSONHookInstallPlan ¶
type CursorJSONHookInstallPlan struct {
Path string
Source string
Label string
ConfigLabel string
Hooks []CursorCommandHookInstallSpec
}
type CursorJSONHooksAction ¶
type CursorJSONHooksAction struct {
Plan CursorJSONHookInstallPlan
}
type Definition ¶
type HookAdapter ¶
type HookAdapter interface {
HandleHook(invocation HookInvocation) HookResult
}
type HookInvocation ¶
type HookPayloadValidator ¶
type HookPayloadValidator func(json.RawMessage) bool
func PayloadValidator ¶
func PayloadValidator[T any]() HookPayloadValidator
type HookResult ¶
type HookResult struct {
Report registry.Observation
ReportOK bool
Response map[string]any
}
type HookTransition ¶
type HookTransition string
HookTransition is the closed, dimension-aware state used by generated hook specifications that need to store a transition before rendering it.
func (HookTransition) State ¶ added in v1.3.0
func (transition HookTransition) State() string
State returns the activity or presence state represented by the transition.
type InstallAction ¶
type InstallAction interface {
// contains filtered or unexported methods
}
type InstallAdvisor ¶
type InstallPlan ¶
type InstallPlan struct {
Actions []InstallAction
}
type Installable ¶
type Installable interface {
InstallPlan(binary string) InstallPlan
}
type JSONCommandHooksAction ¶
type JSONCommandHooksAction struct {
Plan JSONCommandHookInstallPlan
}
type ManagedTextBlockAction ¶
type ManagedTextBlockAction struct {
Plan ManagedTextBlockInstallPlan
}
type PayloadAdapter ¶
type PayloadAdapter interface {
PayloadCompatible(rawPayload json.RawMessage) bool
PayloadDefaults(payload map[string]any) (PayloadDefaults, error)
}
type PayloadDefaults ¶
type PluginDirectoryAction ¶
type PluginDirectoryAction struct {
Plan PluginDirectoryInstallPlan
}
type PluginDirectoryInstallPlan ¶
type PluginDirectoryInstallPlan struct {
Dir string
Label string
Files []RenderedFileInstallSpec
SnippetOrder []string
MarkerFile string
ObsoleteFiles []string
ImportManifest *ImportManifestInstallPlan
Registration PluginRegistration
}
type PluginRegistration ¶
type PluginRegistration interface {
ID() string
Label() string
Inspect(ctx context.Context, pluginDir string) (PluginRegistrationState, error)
EnsureMutable(pluginDir string) error
Install(ctx context.Context, pluginDir string) error
CleanupFailedInstall(ctx context.Context, previousState PluginRegistrationState, pluginDir string) error
Remove(ctx context.Context, pluginDir string) error
}
type PluginRegistrationState ¶
type PluginRegistrationState uint8
const ( PluginRegistrationMissing PluginRegistrationState = iota PluginRegistrationCurrent PluginRegistrationStale PluginRegistrationForeign )
type RenderedFileAction ¶
type RenderedFileAction struct {
Plan RenderedFileInstallPlan
}
type RenderedFileInstallPlan ¶
type RenderedFileInstallSpec ¶
type RenderedFilesAction ¶
type RenderedFilesAction struct {
Plan RenderedFilesInstallPlan
}
type RenderedFilesInstallPlan ¶
type RenderedFilesInstallPlan struct {
Dir string
Label string
ConfigLabel string
Files []RenderedFileInstallSpec
SnippetOrder []string
}
type ScreenManifestProvider ¶
type ScreenManifestProvider interface {
ScreenManifest() string
}
type ShimAction ¶
type ShimAction struct{}
type Transition ¶
type Transition interface {
registry.Activity | registry.Presence | HookTransition
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.