Merge branch 'worktree-agent-a717651aa412e3b7c'

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-03 01:00:02 +00:00
60 changed files with 4265 additions and 222 deletions
+26
View File
@@ -84,8 +84,22 @@ type SearchRequest struct {
// and private/ scratch, see ClassifyArtifacts). Off by default: artifact
// search surfaces only deliverables.
IncludeDebug bool `json:"include_debug,omitempty"`
// Scope narrows a kind=chat search to one chat ("chat:<session id>").
// A scoped search returns every text-part occurrence of Query in that
// chat's messages, newest message first, one result per occurrence with
// its message id, part index and offset, paged by Cursor/NextCursor.
Scope string `json:"scope,omitempty"`
// Cursor continues a scoped chat search: a previous reply's NextCursor,
// or a chat_messages next_cursor to start just before the messages a
// client already holds. Empty starts at the newest message.
Cursor string `json:"cursor,omitempty"`
// CaseSensitive makes a scoped chat search match case exactly.
CaseSensitive bool `json:"case_sensitive,omitempty"`
}
// SearchChatScope is a scoped chat search's Scope for one session.
func SearchChatScope(sessionID string) string { return "chat:" + sessionID }
// SearchResponse is the bounded set of matches. Results are ordered by recency
// descending (a chat's last use for kind chat), numeric entity/visit IDs
// descending, then target ascending, before the cap applies; Score records the
@@ -105,6 +119,11 @@ type SearchResponse struct {
// ScannedChats is how many chat transcripts a chat search read message
// text from (kind chat only); additive, so older peers ignore it.
ScannedChats int `json:"scanned_chats,omitempty"`
// NextCursor continues a scoped chat search that stopped before the
// chat's oldest message (result cap or scan budget); empty when done.
NextCursor string `json:"next_cursor,omitempty"`
// ScannedMessages is how many messages a scoped chat search read.
ScannedMessages int `json:"scanned_messages,omitempty"`
}
// SearchResult is one typed, navigable match. Kind selects which payload is
@@ -202,6 +221,13 @@ type SearchChat struct {
MessageID string `json:"message_id,omitempty"`
Role string `json:"role,omitempty"`
Snippet string `json:"snippet,omitempty"`
// Part and Offset locate one occurrence in a scoped chat search: the
// index of the text part in the message's parts and the match's start
// in that part's text, in UTF-16 code units (as a browser or Dart string
// counts). Length is the match's length in the same units.
Part int `json:"part,omitempty"`
Offset int `json:"offset,omitempty"`
Length int `json:"length,omitempty"`
}
// SearchChatTarget is a chat hit's target token.