MCPcopy Create free account
hub / github.com/compozy/agh / agentSpawnBundle

Function agentSpawnBundle

internal/cli/spawn.go:152–177  ·  view source on GitHub ↗
(record *AgentSpawnRecord)

Source from the content-addressed store, hash-verified

150}
151
152func agentSpawnBundle(record *AgentSpawnRecord) outputBundle {
153 if record == nil {
154 record = &AgentSpawnRecord{}
155 }
156 return outputBundle{
157 jsonValue: record,
158 human: func() (string, error) {
159 return renderHumanBlocks(
160 renderHumanSection("Spawn", []keyValue{
161 {Label: spawnSessionValue, Value: stringOrDash(record.Session.ID)},
162 {Label: spawnAgentValue, Value: stringOrDash(record.Session.AgentName)},
163 {Label: spawnProviderValue, Value: stringOrDash(record.Session.Provider)},
164 {Label: spawnWorkspaceValue, Value: stringOrDash(record.Session.WorkspaceID)},
165 {Label: spawnParentValue, Value: stringOrDash(record.Lineage.ParentSessionID)},
166 {Label: spawnRootValue, Value: stringOrDash(record.Lineage.RootSessionID)},
167 {Label: "Depth", Value: fmt.Sprintf("%d", record.Lineage.SpawnDepth)},
168 {Label: "Role", Value: stringOrDash(record.Lineage.SpawnRole)},
169 {Label: "TTL Expires", Value: stringOrDash(formatTimePtr(record.Lineage.TTLExpiresAt))},
170 }),
171 ), nil
172 },
173 toon: func() (string, error) {
174 return renderJSONPreview(record)
175 },
176 }
177}

Callers 1

runSpawnCommandFunction · 0.85

Calls 5

renderHumanBlocksFunction · 0.85
renderHumanSectionFunction · 0.85
stringOrDashFunction · 0.85
formatTimePtrFunction · 0.85
renderJSONPreviewFunction · 0.85

Tested by

no test coverage detected