<commit_before>const {exec} = require('child_process');
const {homedir} = require('os');
const {resolve, basename} = require('path');
const {writeFileSync} = require('fs');

const {app, dialog} = require('electron');
const {sync: mkdirpSync} = require('mkdirp');
const Config = require('electron-config');
const ms = require('ms');
const shellEnv = require('shell-env');

const config = require('./config');
const notify = require('./notify');

// local storage
const cache = new Config();

// modules path
const path = resolve(homedir(), '.hyper_plugins');
const localPath = resolve(homedir(), '.hyper_plugins', 'local');
const availableExtensions = new Set([
  'onApp', 'onWindow', 'onUnload', 'middleware',
  'reduceUI', 'reduceSessions', 'reduceTermGroups',
  'decorateMenu', 'decorateTerm', 'decorateHyper',
  'decorateHyperTerm', // for backwards compatibility with hyperterm
  'decorateTab',
  'decorateNotification', 'decorateNotifications',
  'decorateTabs', 'decorateConfig', 'decorateEnv',
  'decorateTermGroup', 'getTermProps',
  'getTabProps', 'getTabsProps', 'getTermGroupProps',
  'mapHyperTermState', 'mapTermsState',
  'mapHeaderState', 'mapNotificationsState',
  'mapHyperTermDispatch', 'mapTermsDispatch',
  'mapHeaderDispatch', 'mapNotificationsDispatch'
]);

// init plugin directories if not present
mkdirpSync(path);
mkdirpSync(localPath);

// caches
let plugins = config.getPlugins();
let paths = getPaths(plugins);
let id = getId(plugins);
let modules = requirePlugins();

function getId(plugins_) {
  return JSON.stringify(plugins_);
}
<commit_msg>add onRendererWindow, because it actually available. check ./lib/utils/plugins.js:193 (#924)<commit_after>const {exec} = require('child_process');
const {homedir} = require('os');
const {resolve, basename} = require('path');
const {writeFileSync} = require('fs');

const {app, dialog} = require('electron');
const {sync: mkdirpSync} = require('mkdirp');
const Config = require('electron-config');
const ms = require('ms');
const shellEnv = require('shell-env');

const config = require('./config');
const notify = require('./notify');

// local storage
const cache = new Config();

// modules path
const path = resolve(homedir(), '.hyper_plugins');
const localPath = resolve(homedir(), '.hyper_plugins', 'local');
const availableExtensions = new Set([
  'onApp', 'onWindow', 'onRendererWindow', 'onUnload', 'middleware',
  'reduceUI', 'reduceSessions', 'reduceTermGroups',
  'decorateMenu', 'decorateTerm', 'decorateHyper',
  'decorateHyperTerm', // for backwards compatibility with hyperterm
  'decorateTab',
  'decorateNotification', 'decorateNotifications',
  'decorateTabs', 'decorateConfig', 'decorateEnv',
  'decorateTermGroup', 'getTermProps',
  'getTabProps', 'getTabsProps', 'getTermGroupProps',
  'mapHyperTermState', 'mapTermsState',
  'mapHeaderState', 'mapNotificationsState',
  'mapHyperTermDispatch', 'mapTermsDispatch',
  'mapHeaderDispatch', 'mapNotificationsDispatch'
]);

// init plugin directories if not present
mkdirpSync(path);
mkdirpSync(localPath);

// caches
let plugins = config.getPlugins();
let paths = getPaths(plugins);
let id = getId(plugins);
let modules = requirePlugins();

function getId(plugins_) {
  return JSON.stringify(plugins_);
}

{'fraction_non_alphanumeric': 0.16014782876501385, 'fraction_numerical': 0.0018478595626732369, 'mean_word_length': 6.845410628019324, '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': '4066835', 'n_tokens_mistral': 992, 'n_tokens_neox': 967, 'n_words': 243}