query AgentStatus {
  agentStatus {
    isInitialized
    isUnlocked
    did
    didDocument
    error
  }
}

mutation RequestCapability($authInfo: AuthInfoInput!) {
  agentRequestCapability(authInfo: $authInfo)
}

mutation RetrieveCapability($requestId: String!, $rand: String!) {
  agentGenerateJwt(requestId: $requestId, rand: $rand)
}

query Me {
  agent {
    did
    directMessageLanguage
    perspective {
      links {
        author
        timestamp
        proof {
          signature
          key
          valid
          invalid
        }
        data {
          source
          predicate
          target
        }
        status
      }
    }
  }
}

query GetApps {
  agentGetApps {
    requestId
    revoked
    auth {
      appName
      appDesc
      appUrl
      capabilities {
        with {
          domain
          pointers
        }
        can
      }
    }
  }
}

mutation RevokeToken($requestId: String!) {
  agentRevokeToken(requestId: $requestId) {
    requestId
    revoked
    auth {
      appName
      appDesc
      appUrl
      capabilities {
        with {
          domain
          pointers
        }
        can
      }
    }
  }
}

mutation RemoveApp($requestId: String!) {
  agentRemoveApp(requestId: $requestId) {
    requestId
    revoked
    auth {
      appName
      appDesc
      appUrl
      capabilities {
        with {
          domain
          pointers
        }
        can
      }
    }
  }
}

mutation Lock($passphrase: String!) {
  agentLock(passphrase: $passphrase) {
    isInitialized
    isUnlocked
    did
    didDocument
    error
  }
}

mutation Unlock($passphrase: String!, $holochain: Boolean!) {
  agentUnlock(passphrase: $passphrase, holochain: $holochain) {
    isInitialized
    isUnlocked
    did
    didDocument
    error
  }
}

query ByDID($did: String!) {
  agentByDID(did: $did) {
    did
    directMessageLanguage
    perspective {
      links {
        author
        timestamp
        proof {
          signature
          key
          valid
          invalid
        }
        data {
          source
          predicate
          target
        }
        status
      }
    }
  }
}

mutation Generate($passphrase: String!) {
  agentGenerate(passphrase: $passphrase) {
    isInitialized
    isUnlocked
    did
    didDocument
    error
  }
}

mutation SignMessage($message: String!) {
  agentSignMessage(message: $message) {
    signature
    publicKey
  }
}

mutation AddEntanglementProofs($proofs: [EntanglementProofInput!]!) {
  agentAddEntanglementProofs(proofs: $proofs) {
    did
    didSigningKeyId
    deviceKeyType
    deviceKey
    deviceKeySignedByDid
    didSignedByDeviceKey
  }
}

mutation DeleteEntanglementProofs($proofs: [EntanglementProofInput!]!) {
  agentDeleteEntanglementProofs(proofs: $proofs) {
    did
    didSigningKeyId
    deviceKeyType
    deviceKey
    deviceKeySignedByDid
    didSignedByDeviceKey
  }
}

mutation EntanglementProofPreFlight(
  $deviceKey: String!
  $deviceKeyType: String!
) {
  agentEntanglementProofPreFlight(
    deviceKey: $deviceKey
    deviceKeyType: $deviceKeyType
  ) {
    did
    didSigningKeyId
    deviceKeyType
    deviceKey
    deviceKeySignedByDid
    didSignedByDeviceKey
  }
}

subscription SubscriptionAgentStatusChanged {
  agentStatusChanged {
    did
    didDocument
    error
    isInitialized
    isUnlocked
  }
}
