sessionquery

package
v0.3.15 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 13, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(cfg Config, deps Deps) (agentkit.Tool, error)

New registers tool/session-search (alias kind tool/session-query): cross-session FTS, browse, and scroll.

Types

type Config

type Config struct {
	SessionsDir  string `json:"sessionsDir"`
	DefaultLimit int    `json:"defaultLimit"`
}

type Deps

type Deps struct {
	Index     capsessionindex.Service `json:"index"`
	Workspace workspace.Service       `json:"workspace"`
}

type Input

type Input struct {
	Mode string `json:"mode,omitempty" jsonschema:"search (default) | list | scroll"`
	// Search: FTS query. List: ignored. Scroll: optional when jumping to a session without a hit.
	Query string `json:"query,omitempty" jsonschema:"Keywords for mode=search"`
	// Scroll: session id from a prior search hit or list row.
	SessionID string `json:"session_id,omitempty" jsonschema:"Required for mode=scroll"`
	// Scroll: anchor event seq (from search hit); 0 means latest in session.
	Seq int64 `json:"seq,omitempty" jsonschema:"Anchor seq for mode=scroll"`
	// Scroll: lines before/after anchor (default 3 each when scroll and both zero).
	Before int `json:"before,omitempty"`
	After  int `json:"after,omitempty"`
	Limit  int `json:"limit,omitempty" jsonschema:"Max hits (search) or sessions (list); default 10, max 50"`
}

Input supports Hermes-style session_search shapes: search (FTS), list (browse sessions), scroll (context around a hit).

type Output

type Output struct {
	Mode      string                           `json:"mode"`
	Hits      []capsessionindex.Hit            `json:"hits,omitempty"`
	Sessions  []capsessionindex.SessionSummary `json:"sessions,omitempty"`
	Messages  []capsessionindex.MessageRow     `json:"messages,omitempty"`
	Count     int                              `json:"count"`
	SessionID string                           `json:"session_id,omitempty"`
	AnchorSeq int64                            `json:"anchor_seq,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL