<commit_before>var otherchat = new Otherchat(),
    Web = require('other-web') // Extended-local web search?

var cmd = OtherchatFeature({
  tokens: ['web'],
  version: 'web.0.1',
  apiKey: 'cdb6b77b-99c3-454e-8e89-185badc4644e'
})

cmd.on('query', (context, promise) => {

  try{

    var results = await Web.search( context.query )
    results = results.map( page => {
      return oc.types.twoLineChatComplete({
        title: page.title,
        detail: page.href,
        actionName: 'go',
        action: function( selected ){
          client.browser.open(selected.detail)
        }
      })
    })

    promise.resolve( results )

  }

  catch (error) {
    promise.reject( `Something went wrong: ${error}` )
  }
  
})<commit_msg>Updating web bundle to the new style and added thoughts<commit_after>//
// WEB
// Either does a web search or opens a URL
//

// When you click the 'go' action, the browser opened should allow you
// to selecting text and then post the equiv of a screenshot+link. This
// lets you talk about things on the web, link them with context, all
// without leaving Other Chat. Think a much better version of the web
// snippets thing on Twitter.

var feature = new OtherchatFeature({
      apiKey: 'cdb6b77b-99c3-454e-8e89-185badc4644e',
      version: 'web-bundle.0.1'
    })
    otherchat = new Otherchat( feature ),
    Web = require('other-web') // Extended-local web search?

var cmd = feature.command({
  tokens: ['web'],
  version: 'web.0.1',
  apiKey: 'cdb6b77b-99c3-454e-8e89-185badc4644e'
})

cmd.on('query', (context, promise) => {

  try {

    var results = await Web.search( context.query )
    results = results.map( page => {
      return oc.types.chatComplete({
        title: page.title,
        detail: page.href,
        actionName: 'go',
        action: function( selected ){
          client.browser.open(selected.detail)
        }
      })
    })

    promise.resolve( results )

  }

  catch (error) promise.reject( error )
  
})
{'fraction_non_alphanumeric': 0.13155241935483872, 'fraction_numerical': 0.031754032258064516, 'mean_word_length': 2.6488970588235294, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '5271623', 'n_tokens_mistral': 675, 'n_tokens_neox': 636, 'n_words': 180}