type Agent {
  id: String!
}

type AgentConfig {
  id: String!
  modules: [ModuleConfig!]!
  exchange: [ExchangeConfig!]!
}

type DebugTrace {
  agentId: String!
  events: [Event!]!
}

type Event {
  agentId: String!
  eventName: String!
  eventType: String!
  moduleId: String!
  moduleClass: String!
  methodName: String!
  time: Float!
  callId: String!
  callerId: String!
  arguments: JSON
  result: JSON
  exception: String
}

type ExchangeConfig {
  module: String
  fieldName: String
  protocol: String!
  provider: JSON!
}

"""
The `JSON` scalar type represents JSON values as specified by [ECMA-404](https://ecma-international.org/wp-content/uploads/ECMA-404_2nd_edition_december_2017.pdf).
"""
scalar JSON @specifiedBy(url: "https://ecma-international.org/wp-content/uploads/ECMA-404_2nd_edition_december_2017.pdf")

type ModuleConfig {
  module: String!
  id: String!
  provides: [String!]
  uses: [String!]
  config: JSON
}

type Mutation {
  clearLog(agentId: String!): DebugTrace!
}

type Query {
  listAgents: [Agent!]!
  agentConfig(agentId: String!): AgentConfig!
  debugLog(agentId: String!): DebugTrace!
}