MCPcopy Create free account
hub / github.com/Noumena-Network/code / extractTeammateTranscriptsFromTasks

Function extractTeammateTranscriptsFromTasks

src/utils/sessionStorage.ts:4497–4518  ·  view source on GitHub ↗
(tasks: {
  [taskId: string]: {
    type: string
    identity?: { agentId: string }
    messages?: Message[]
  }
})

Source from the content-addressed store, hash-verified

4495 * uses a random agentId for transcript storage.
4496 */
4497export function extractTeammateTranscriptsFromTasks(tasks: {
4498 [taskId: string]: {
4499 type: string
4500 identity?: { agentId: string }
4501 messages?: Message[]
4502 }
4503}): { [agentId: string]: Message[] } {
4504 const transcripts: { [agentId: string]: Message[] } = {}
4505
4506 for (const task of Object.values(tasks)) {
4507 if (
4508 task.type === 'in_process_teammate' &&
4509 task.identity?.agentId &&
4510 task.messages &&
4511 task.messages.length > 0
4512 ) {
4513 transcripts[task.identity.agentId] = task.messages
4514 }
4515 }
4516
4517 return transcripts
4518}
4519
4520/**
4521 * Load subagent transcripts for the given agent IDs

Callers 1

FeedbackFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected