readUsageFields function

Map<String, String> readUsageFields(
  1. String workspaceDir,
  2. String nodePath, {
  3. required ModelPriceTable modelPrices,
  4. UsageFlare? flare,
})

The step's usage telemetry as the result fields to merge — an EMPTY map when the envelope is absent, unreadable, malformed, or carries no usage at all. readUsageReport owns the read, so this is fail-safe for the same reason it is.

modelPrices is REQUIRED here, because a caller that forgets it silently drops every subscription-billed lane's cost — which is the defect bead pow-zetn closes. Every result() edge reads it off the ambient AgentConfig; the optional flare is that edge's ExplorationTransport.flare.

Implementation

Map<String, String> readUsageFields(
  String workspaceDir,
  String nodePath, {
  required ModelPriceTable modelPrices,
  UsageFlare? flare,
}) =>
    readUsageReport(
      workspaceDir,
      nodePath,
      modelPrices: modelPrices,
      flare: flare,
    )?.toResultFields() ??
    const {};