Documentation
¶
Overview ¶
Package sources is what a whole conversation refers to, read from its transcript the way the previous runtime's conversation sources route did: the links of the agent's answers (documents, merge requests, tracker issues and the rest of the web) and the filesystem paths it worked with.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Collector ¶
type Collector struct {
Links *Links
// contains filtered or unexported fields
}
Collector gathers the links of entries fed in order, so a transcript can be indexed a stretch at a time.
type Links ¶
type Links struct {
// TrackerURL is the issue tracker's origin (https://tracker.example.com): a bare issue key becomes
// <TrackerURL>/issue/<key>. TrackerHosts are the hosts its issue links use, IssueKeys its project keys.
TrackerURL string
TrackerHosts []string
IssueKeys []string
// GitLabHosts are the GitLabs whose merge requests are recognised.
GitLabHosts []string
// DocsHost serves published documents (/a/<slug>) and boards (/b/<slug>); ReaderHost and ReaderPath are where the
// platform reads a document (<ReaderPath><slug>).
DocsHost, ReaderHost, ReaderPath string
}
Links names the services whose links are told apart.
type MRMention ¶ added in v0.15.40
type MRMention struct {
// URL is https://<host>/<project>/-/merge_requests/<iid>, without what follows the number.
URL string
Host string
Project string
IID string
Timestamp float64
}
MRMention is a merge request link somebody wrote in the conversation: the agent in its answer or the person in a message. What a tool printed (a grep through test fixtures, a log) is not a mention, and neither is a link to a server that is not one of the deployment's GitLabs.
type Made ¶ added in v0.16.42
type Made struct {
Links *Links
// contains filtered or unexported fields
}
Made collects what a conversation made or touched: what package outputs tells of its calls (a published page, a page shown with `harnessly open`, a write into a design) and every page of the catalogue named by the link list of a successful tool result (a board made by a script, a page read back). A link only the agent's text or the person mentions is not one: it is quoted, not touched.
type MadeLink ¶ added in v0.16.42
MadeLink is a document, a board, a design or a tracker task the conversation made, opened or changed. Ref is the page's address (a board keeps its ?k= key, which opens it), the design's id or the task's address.
type Mentions ¶ added in v0.15.40
type Mentions struct {
Links *Links
// contains filtered or unexported fields
}
Mentions gathers the merge request links of the texts of a conversation, in the order entries are fed.
type Paths ¶
type Paths struct {
// contains filtered or unexported fields
}
Paths are the filesystem locations a conversation worked with, in the order first seen: a Set of the previous runtime, values as they came (a patch file without a path counts as one too).
type Result ¶
type Result struct {
Links []Link
// MRs are the merge requests the agent and the person wrote down, oldest first; they are not in Value().
MRs []MRMention
WorkPaths []any
Size int64
// Made are the documents, boards and designs the conversation made or touched, newest first.
Made []MadeLink
}
Result is what the route answers for a transcript.
type Route ¶
type Route struct {
Links *Links
// Home holds the transcripts the route may read (.claude/projects and .codex/sessions under it).
Home string
// Codex are the options Codex transcripts are read with.
Codex transcript.CodexOptions
// Authorized is the old API's own check (a page session or the cli-token), SessionOK the page session the handler
// asks for besides.
Authorized, SessionOK func(*http.Request) bool
// contains filtered or unexported fields
}
Route answers GET <platform API>/sources?jsonlPath=&cwd=: the links and work paths of a whole conversation. The index of a transcript is kept and grows with the file: a request reads only the whole lines appended since the previous one, in the stretches the previous runtime read, so both see the same entries.
func (*Route) Read ¶
Read is the sources of a transcript: found is false for a path that is not an allowed transcript file, failed true where the previous runtime's parser threw (it answered 500).
func (*Route) ReadBudget ¶ added in v0.16.42
func (rt *Route) ReadBudget(path, cwd string, budget int64) (res Result, found, failed, complete bool)
ReadBudget is Read for a page that cannot wait for a long transcript: a growth of at most budget bytes is read now and the answer is complete; a larger one is read behind (one reader a transcript, in the background) and the answer is what has been read so far, not complete. Ask again for the rest.