subagents

package
v0.16.521 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2026 License: AGPL-3.0 Imports: 15 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package subagents lists the subagents of a Claude Code conversation: the transcripts Claude Code writes next to the conversation's own (<session>/subagents/agent-<id>.jsonl, with an agent-<id>.meta.json), each summed up the way the previous runtime's inspector showed it.

Index

Constants

This section is empty.

Variables

View Source
var FileName = regexp.MustCompile(`^agent-[\w-]+\.jsonl$`)

FileName matches a subagent transcript's file name.

Functions

func DirFor

func DirFor(jsonlPath string) string

DirFor is the folder of a conversation's subagent transcripts.

func Files

func Files(jsonlPath string) []string

Files are the subagent transcripts of a conversation, by name; none when the folder cannot be read.

Types

type Lister

type Lister struct {
	// Now is the clock (tests freeze it); nil is the real one.
	Now func() time.Time
	// contains filtered or unexported fields
}

Lister lists subagents, keeping each settled summary until its transcript changes.

func (*Lister) List

func (l *Lister) List(jsonlPath string) []Summary

List is every subagent of a conversation, the most recently started first.

type Paths

type Paths struct {
	ClaudeProjects, CodexSessions string
}

Paths are where the agents keep their transcripts: only a jsonl under one of them may be read.

func (Paths) Allowed

func (p Paths) Allowed(file string) bool

Allowed says whether a path is a transcript of either agent.

func (Paths) Codex

func (p Paths) Codex(file string) bool

Codex says whether a path is a Codex transcript.

type Route

type Route struct {
	Lister *Lister
	Paths  Paths
	// 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
}

Route answers GET <platform API>/subagents?jsonlPath=<transcript>: the subagents of a Claude conversation; a Codex one has none ({subagents: [], supported: false}).

func (*Route) Answer

func (rt *Route) Answer(r *http.Request) (int, any, http.Header)

Answer is the whole answer, refusals included.

func (*Route) AnswerTranscript

func (rt *Route) AnswerTranscript(r *http.Request, id string) (int, any, http.Header)

AnswerTranscript answers GET <platform API>/subagents/<id>?jsonlPath=<transcript>: the entries of one subagent's transcript, flattened (every line of it is a sidechain, which the parser folds into one agent group).

type Summary

type Summary struct {
	ID          string  `json:"id"`
	AgentType   any     `json:"agentType"`
	Description any     `json:"description"`
	ToolUseID   any     `json:"toolUseId"`
	Background  bool    `json:"background"`
	Status      string  `json:"status"`
	StartedAt   any     `json:"startedAt"`
	UpdatedAt   float64 `json:"updatedAt"`
	ToolUses    int     `json:"toolUses"`
	LastAction  any     `json:"lastAction"`
	Prompt      string  `json:"prompt"`
	Result      any     `json:"result"`
}

Summary is one subagent as the inspector lists it. The fields taken from the meta file keep the value found there.

func Summarize

func Summarize(raw string, meta any, id string, mtimeMs float64, now float64) (s Summary, ok bool)

Summarize sums up one subagent transcript; ok is false where the previous runtime failed on it (a line or a meta file holding null), which left the subagent out.

Jump to

Keyboard shortcuts

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