Documentation
¶
Index ¶
- type Provider
- func (p *Provider) AreHooksInstalled(ctx context.Context, repoRoot string) bool
- func (p *Provider) BuildHookEvents(ctx context.Context, event *hooks.Event, bs api.BlobPutter) ([]broker.RawEvent, error)
- func (p *Provider) DiscoverSubagentTranscripts(_ context.Context, _ string, dctx hooks.DiscoveryContext) ([]string, error)
- func (p *Provider) DisplayName() string
- func (p *Provider) HookBinary(ctx context.Context, repoRoot string) (string, error)
- func (p *Provider) InstallHooks(ctx context.Context, repoRoot string, binaryPath string) (int, error)
- func (p *Provider) IsAvailable() bool
- func (p *Provider) Name() string
- func (p *Provider) ParseHookEvent(ctx context.Context, hookName string, stdin io.Reader) (*hooks.Event, error)
- func (p *Provider) ReadFromOffset(ctx context.Context, transcriptRef string, offset int, bs api.BlobPutter) ([]broker.RawEvent, int, error)
- func (p *Provider) SubagentStateKey(subagentTranscriptRef string) string
- func (p *Provider) TranscriptOffset(ctx context.Context, transcriptRef string) (int, error)
- func (p *Provider) UninstallHooks(ctx context.Context, repoRoot string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider implements hooks.HookProvider for Kiro CLI.
func New ¶ added in v0.5.1
func New() *Provider
New returns the Kiro CLI hook provider for explicit registration via providers.NewHookRegistry().
func (*Provider) AreHooksInstalled ¶
func (*Provider) BuildHookEvents ¶
func (p *Provider) BuildHookEvents(ctx context.Context, event *hooks.Event, bs api.BlobPutter) ([]broker.RawEvent, error)
BuildHookEvents constructs RawEvents directly from hook payloads. Implements hooks.DirectHookEmitter.
func (*Provider) DiscoverSubagentTranscripts ¶ added in v0.3.8
func (p *Provider) DiscoverSubagentTranscripts(_ context.Context, _ string, dctx hooks.DiscoveryContext) ([]string, error)
DiscoverSubagentTranscripts returns AgentCrew child .jsonl paths for dctx.
Filtering rules:
- cwd must match dctx.Cwd
- .jsonl mtime must fall in [dctx.PromptTime, dctx.StopTime]
- created_at > dctx.PromptTime for a candidate child; <= for a parent. Kiro stamps created_at at session creation, which precedes the user prompt for parents and follows it for AgentCrew stages.
Discovery requires exactly one parent-shaped session (cwd match, mtime in window, created_at <= PromptTime). With no parent anchor or multiple overlapping parents, discovery returns nil to avoid misattribution.
func (*Provider) DisplayName ¶
func (*Provider) HookBinary ¶
func (*Provider) InstallHooks ¶
func (*Provider) IsAvailable ¶
func (*Provider) ParseHookEvent ¶
func (p *Provider) ParseHookEvent(ctx context.Context, hookName string, stdin io.Reader) (*hooks.Event, error)
ParseHookEvent parses the Kiro CLI hook payload.
func (*Provider) ReadFromOffset ¶
func (p *Provider) ReadFromOffset(ctx context.Context, transcriptRef string, offset int, bs api.BlobPutter) ([]broker.RawEvent, int, error)
ReadFromOffset branches by transcript-ref shape. SQLite composite refs (parent) stay a no-op because direct postToolUse hooks own parent capture and replay would duplicate. JSONL refs (subagent children supplied by the discoverer) are replayed since no direct-hook surface exists for inner stage edits.
func (*Provider) SubagentStateKey ¶ added in v0.3.8
SubagentStateKey returns a stable capture-state key for a child transcript, derived from its Kiro session UUID.
func (*Provider) TranscriptOffset ¶
TranscriptOffset reports the current file-write count when the conversation store can be read. Replay is disabled for Kiro CLI, so unreadable or missing transcript refs degrade to offset 0.