<commit_before>'use strict'

// external plugins
const ExternalAuth = require('./auth')
const Mesh = require('seneca-mesh')

// load related modules
const ExternalCore = require('./redirect/core_external')
const InternalCore = require('./redirect/core_internal')
const ConcordaCore = require('./impl/concorda-core')

// services
const ConcordaClient = require('./client')
const ConcordaUser = require('./user')
const ConcordaTag = require('./tag')

var ConcordaDummyData = require('./impl/util/dummyData')

module.exports = function (options) {
  var seneca = this

  var name = 'concorda'
  var meshOptions = {
    auto: true
  }

  var useLocalCore = false
  if (
    (options.concorda && options.concorda) &&
    (options.concorda.local === true || options.concorda.local === 'true')
  ) {
    useLocalCore = true
  }

  seneca
    .use(ExternalAuth, options)

  if (useLocalCore) {
    seneca.log.info('Concorda', 'using local core implementation')
    seneca
      .use(InternalCore, options)
      .use(ConcordaCore, options)

    // add services to expose via mesh
    meshOptions.pin = ['role: user', 'role: concorda-communication']
  }
  else {
    seneca.log.info('Concorda', 'using external micro-service')
    seneca
      .use(ExternalCore, options)

    seneca.log.info('register as mesh client: ', meshOptions)
    seneca
      .use(Mesh, meshOptions)
  }
<commit_msg>changes for core options<commit_after>'use strict'

// external plugins
const ExternalAuth = require('./auth')
const Mesh = require('seneca-mesh')

// load related modules
const ExternalCore = require('./redirect/core_external')
const InternalCore = require('./redirect/core_internal')
const ConcordaCore = require('./impl/concorda-core')

// services
const ConcordaClient = require('./client')
const ConcordaUser = require('./user')
const ConcordaTag = require('./tag')

var ConcordaDummyData = require('./impl/util/dummyData')

module.exports = function (options) {
  var seneca = this

  var name = 'concorda'
  var meshOptions = {
    auto: true
  }

  var useLocalCore = true
  if (
    (options.concorda && options.concorda) &&
    (options.concorda.external_core === true || options.concorda.external_core === 'true')
  ) {
    useLocalCore = false
  }

  seneca
    .use(ExternalAuth, options)

  if (useLocalCore) {
    seneca.log.info('Concorda', 'using local core implementation')
    seneca
      .use(InternalCore, options)
      .use(ConcordaCore, options)

    // add services to expose via mesh
    meshOptions.pin = ['role: user', 'role: concorda-communication']
  }
  else {
    seneca.log.info('Concorda', 'using external micro-service')
    seneca
      .use(ExternalCore, options)

    seneca.log.info('register as mesh client: ', meshOptions)
    seneca
      .use(Mesh, meshOptions)
  }

{'fraction_non_alphanumeric': 0.13533834586466165, 'fraction_numerical': 0.0, 'mean_word_length': 3.565359477124183, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4063517', 'n_tokens_mistral': 878, 'n_tokens_neox': 847, 'n_words': 207}