buildExecutionReceipt (execution-receipt.ts)

open-multi-agent · ai

Builds typed execution receipts with token usage, validating schema; guards used for receipt creation.

import type {
  AgentRunResult,
  RunFlag,
  TeamRunResult,
  TraceEvent,
} from '../types.js'

/** A dependency observed between tasks assigned to different worker roles. */
export interface ExecutionReceiptDependencyEdge {
  readonly from: string
  readonly to: string
}

/** Approval fact derived from a run result; the primary row stays in MemoryStore. */
export interface ExecutionReceiptApprovalDecision {
  readonly requestId: string
  readonly scope: 'plan' | 'task_round' | 'task_dispatch' | 'tool_call'
  readonly requestHash: string
  readonly decision: 'approved' | 'rejected'
  readonly reviewerId: string
  readonly reviewerDisplayName?: string
  readonly decidedAt: string
}

/**
 * Structured execution facts derived from run records and optional trace events.
 * Agent output text is

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search 40K more like it.

Get a free API key