Team Ai
Datasetpublic

Brunobkr/llama.cpp_AlgMor24_github

ΩFFFΣLLIa • llama.cpp • AlgMor24 ██████╗ ███████╗███████╗███████╗██╗ ██╗ ██╗ █████╗ ██╔═══██╗██╔════╝██╔════╝██╔════╝██║ ██║ ██║██╔══██╗ ██║ ██║█████╗ █████╗ █████╗ ██║ ██║ ██║███████║ ██║ ██║██╔══╝ ██╔══╝ ██╔══╝ ██║ ██║ ██║██╔══██║ ╚██████╔╝██║ ██║ ███████╗███████╗███████╗██║██║ ██║ ╚═════╝ ╚═╝ ╚═╝ ╚══════╝╚══════╝╚══════╝╚═╝╚═╝ ╚═╝ High-Performance LLM / VLM Inference & Autonomous Agentic Ecosystem… See the full description on the dataset page: https://huggingface.co/datasets/Brunobkr/llama.cpp_AlgMor24_github.

sourceHugging Faceupdated 2mo agoView on Hugging Face
0likes3.1kdownloads
experimental-cli-worker.mjs2842 linesDownload Raw Back to internal
1import { createRequire as __prettierCreateRequire } from "module";2import { fileURLToPath as __prettierFileUrlToPath } from "url";3import { dirname as __prettierDirname } from "path";4const require = __prettierCreateRequire(import.meta.url);5const __filename = __prettierFileUrlToPath(import.meta.url);6const __dirname = __prettierDirname(__filename);7 8// node_modules/atomically/dist/index.js9import { once } from "events";10import { createWriteStream } from "fs";11import path2 from "path";12import { Readable } from "stream";13 14// node_modules/stubborn-fs/dist/index.js15import fs from "fs";16import { promisify } from "util";17 18// node_modules/stubborn-utils/dist/attemptify_async.js19var attemptifyAsync = (fn, options) => {20  const { onError } = options;21  return function attemptified(...args) {22    return fn.apply(void 0, args).catch(onError);23  };24};25var attemptify_async_default = attemptifyAsync;26 27// node_modules/stubborn-utils/dist/attemptify_sync.js28var attemptifySync = (fn, options) => {29  const { onError } = options;30  return function attemptified(...args) {31    try {32      return fn.apply(void 0, args);33    } catch (error) {34      return onError(error);35    }36  };37};38var attemptify_sync_default = attemptifySync;39 40// node_modules/stubborn-utils/dist/constants.js41var RETRY_INTERVAL = 250;42 43// node_modules/stubborn-utils/dist/retryify_async.js44var retryifyAsync = (fn, options) => {45  const { isRetriable } = options;46  return function retryified(options2) {47    const { timeout } = options2;48    const interval = options2.interval ?? RETRY_INTERVAL;49    const timestamp = Date.now() + timeout;50    return function attempt3(...args) {51      return fn.apply(void 0, args).catch((error) => {52        if (!isRetriable(error))53          throw error;54        if (Date.now() >= timestamp)55          throw error;56        const delay = Math.round(interval * Math.random());57        if (delay > 0) {58          const delayPromise = new Promise((resolve3) => setTimeout(resolve3, delay));59          return delayPromise.then(() => attempt3.apply(void 0, args));60        } else {61          return attempt3.apply(void 0, args);62        }63      });64    };65  };66};67var retryify_async_default = retryifyAsync;68 69// node_modules/stubborn-utils/dist/retryify_sync.js70var retryifySync = (fn, options) => {71  const { isRetriable } = options;72  return function retryified(options2) {73    const { timeout } = options2;74    const timestamp = Date.now() + timeout;75    return function attempt3(...args) {76      while (true) {77        try {78          return fn.apply(void 0, args);79        } catch (error) {80          if (!isRetriable(error))81            throw error;82          if (Date.now() >= timestamp)83            throw error;84          continue;85        }86      }87    };88  };89};90var retryify_sync_default = retryifySync;91 92// node_modules/stubborn-fs/dist/constants.js93import process from "process";94 95// node_modules/stubborn-fs/dist/handlers.js96var Handlers = {97  /* API */98  isChangeErrorOk: (error) => {99    if (!Handlers.isNodeError(error))100      return false;101    const { code } = error;102    if (code === "ENOSYS")103      return true;104    if (!IS_USER_ROOT && (code === "EINVAL" || code === "EPERM"))105      return true;106    return false;107  },108  isNodeError: (error) => {109    return error instanceof Error;110  },111  isRetriableError: (error) => {112    if (!Handlers.isNodeError(error))113      return false;114    const { code } = error;115    if (code === "EMFILE" || code === "ENFILE" || code === "EAGAIN" || code === "EBUSY" || code === "EACCESS" || code === "EACCES" || code === "EACCS" || code === "EPERM")116      return true;117    return false;118  },119  onChangeError: (error) => {120    if (!Handlers.isNodeError(error))121      throw error;122    if (Handlers.isChangeErrorOk(error))123      return;124    throw error;125  }126};127var handlers_default = Handlers;128 129// node_modules/stubborn-fs/dist/constants.js130var ATTEMPTIFY_CHANGE_ERROR_OPTIONS = {131  onError: handlers_default.onChangeError132};133var ATTEMPTIFY_NOOP_OPTIONS = {134  onError: () => void 0135};136var IS_USER_ROOT = process.getuid ? !process.getuid() : false;137var RETRYIFY_OPTIONS = {138  isRetriable: handlers_default.isRetriableError139};140 141// node_modules/stubborn-fs/dist/index.js142var FS = {143  attempt: {144    /* ASYNC */145    chmod: attemptify_async_default(promisify(fs.chmod), ATTEMPTIFY_CHANGE_ERROR_OPTIONS),146    chown: attemptify_async_default(promisify(fs.chown), ATTEMPTIFY_CHANGE_ERROR_OPTIONS),147    close: attemptify_async_default(promisify(fs.close), ATTEMPTIFY_NOOP_OPTIONS),148    fsync: attemptify_async_default(promisify(fs.fsync), ATTEMPTIFY_NOOP_OPTIONS),149    mkdir: attemptify_async_default(promisify(fs.mkdir), ATTEMPTIFY_NOOP_OPTIONS),150    realpath: attemptify_async_default(promisify(fs.realpath), ATTEMPTIFY_NOOP_OPTIONS),151    stat: attemptify_async_default(promisify(fs.stat), ATTEMPTIFY_NOOP_OPTIONS),152    unlink: attemptify_async_default(promisify(fs.unlink), ATTEMPTIFY_NOOP_OPTIONS),153    /* SYNC */154    chmodSync: attemptify_sync_default(fs.chmodSync, ATTEMPTIFY_CHANGE_ERROR_OPTIONS),155    chownSync: attemptify_sync_default(fs.chownSync, ATTEMPTIFY_CHANGE_ERROR_OPTIONS),156    closeSync: attemptify_sync_default(fs.closeSync, ATTEMPTIFY_NOOP_OPTIONS),157    existsSync: attemptify_sync_default(fs.existsSync, ATTEMPTIFY_NOOP_OPTIONS),158    fsyncSync: attemptify_sync_default(fs.fsync, ATTEMPTIFY_NOOP_OPTIONS),159    mkdirSync: attemptify_sync_default(fs.mkdirSync, ATTEMPTIFY_NOOP_OPTIONS),160    realpathSync: attemptify_sync_default(fs.realpathSync, ATTEMPTIFY_NOOP_OPTIONS),161    statSync: attemptify_sync_default(fs.statSync, ATTEMPTIFY_NOOP_OPTIONS),162    unlinkSync: attemptify_sync_default(fs.unlinkSync, ATTEMPTIFY_NOOP_OPTIONS)163  },164  retry: {165    /* ASYNC */166    close: retryify_async_default(promisify(fs.close), RETRYIFY_OPTIONS),167    fsync: retryify_async_default(promisify(fs.fsync), RETRYIFY_OPTIONS),168    open: retryify_async_default(promisify(fs.open), RETRYIFY_OPTIONS),169    readFile: retryify_async_default(promisify(fs.readFile), RETRYIFY_OPTIONS),170    rename: retryify_async_default(promisify(fs.rename), RETRYIFY_OPTIONS),171    stat: retryify_async_default(promisify(fs.stat), RETRYIFY_OPTIONS),172    write: retryify_async_default(promisify(fs.write), RETRYIFY_OPTIONS),173    writeFile: retryify_async_default(promisify(fs.writeFile), RETRYIFY_OPTIONS),174    /* SYNC */175    closeSync: retryify_sync_default(fs.closeSync, RETRYIFY_OPTIONS),176    fsyncSync: retryify_sync_default(fs.fsyncSync, RETRYIFY_OPTIONS),177    openSync: retryify_sync_default(fs.openSync, RETRYIFY_OPTIONS),178    readFileSync: retryify_sync_default(fs.readFileSync, RETRYIFY_OPTIONS),179    renameSync: retryify_sync_default(fs.renameSync, RETRYIFY_OPTIONS),180    statSync: retryify_sync_default(fs.statSync, RETRYIFY_OPTIONS),181    writeSync: retryify_sync_default(fs.writeSync, RETRYIFY_OPTIONS),182    writeFileSync: retryify_sync_default(fs.writeFileSync, RETRYIFY_OPTIONS)183  }184};185var dist_default = FS;186 187// node_modules/atomically/dist/constants.js188import process2 from "process";189var DEFAULT_ENCODING = "utf8";190var DEFAULT_FILE_MODE = 438;191var DEFAULT_FOLDER_MODE = 511;192var DEFAULT_READ_OPTIONS = {};193var DEFAULT_WRITE_OPTIONS = {};194var DEFAULT_USER_UID = process2.geteuid ? process2.geteuid() : -1;195var DEFAULT_USER_GID = process2.getegid ? process2.getegid() : -1;196var DEFAULT_INTERVAL_ASYNC = 200;197var DEFAULT_TIMEOUT_ASYNC = 7500;198var IS_POSIX = !!process2.getuid;199var IS_USER_ROOT2 = process2.getuid ? !process2.getuid() : false;200var LIMIT_BASENAME_LENGTH = 128;201 202// node_modules/atomically/dist/utils/lang.js203var isException = (value) => {204  return value instanceof Error && "code" in value;205};206var isFunction = (value) => {207  return typeof value === "function";208};209var isString = (value) => {210  return typeof value === "string";211};212var isUndefined = (value) => {213  return value === void 0;214};215 216// node_modules/atomically/dist/utils/scheduler.js217var Queues = {};218var Scheduler = {219  /* API */220  next: (id) => {221    const queue = Queues[id];222    if (!queue)223      return;224    queue.shift();225    const job = queue[0];226    if (job) {227      job(() => Scheduler.next(id));228    } else {229      delete Queues[id];230    }231  },232  schedule: (id) => {233    return new Promise((resolve3) => {234      let queue = Queues[id];235      if (!queue)236        queue = Queues[id] = [];237      queue.push(resolve3);238      if (queue.length > 1)239        return;240      resolve3(() => Scheduler.next(id));241    });242  }243};244var scheduler_default = Scheduler;245 246// node_modules/atomically/dist/utils/temp.js247import path from "path";248 249// node_modules/when-exit/dist/node/interceptor.js250import process4 from "process";251 252// node_modules/when-exit/dist/node/constants.js253import process3 from "process";254var IS_LINUX = process3.platform === "linux";255var IS_WINDOWS = process3.platform === "win32";256 257// node_modules/when-exit/dist/node/signals.js258var Signals = ["SIGHUP", "SIGINT", "SIGTERM"];259if (!IS_WINDOWS) {260  Signals.push("SIGALRM", "SIGABRT", "SIGVTALRM", "SIGXCPU", "SIGXFSZ", "SIGUSR2", "SIGTRAP", "SIGSYS", "SIGQUIT", "SIGIOT");261}262if (IS_LINUX) {263  Signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT");264}265var signals_default = Signals;266 267// node_modules/when-exit/dist/node/interceptor.js268var Interceptor = class {269  /* CONSTRUCTOR */270  constructor() {271    this.callbacks = /* @__PURE__ */ new Set();272    this.exited = false;273    this.exit = (signal) => {274      if (this.exited)275        return;276      this.exited = true;277      for (const callback of this.callbacks) {278        callback();279      }280      if (signal) {281        if (IS_WINDOWS && (signal !== "SIGINT" && signal !== "SIGTERM" && signal !== "SIGKILL")) {282          process4.kill(process4.pid, "SIGTERM");283        } else {284          process4.kill(process4.pid, signal);285        }286      }287    };288    this.hook = () => {289      process4.once("exit", () => this.exit());290      for (const signal of signals_default) {291        try {292          process4.once(signal, () => this.exit(signal));293        } catch {294        }295      }296    };297    this.register = (callback) => {298      this.callbacks.add(callback);299      return () => {300        this.callbacks.delete(callback);301      };302    };303    this.hook();304  }305};306var interceptor_default = new Interceptor();307 308// node_modules/when-exit/dist/node/index.js309var whenExit = interceptor_default.register;310var node_default = whenExit;311 312// node_modules/atomically/dist/utils/temp.js313var Temp = {314  /* VARIABLES */315  store: {},316  // filePath => purge317  /* API */318  create: (filePath) => {319    const randomness = `000000${Math.floor(Math.random() * 16777215).toString(16)}`.slice(-6);320    const timestamp = Date.now().toString().slice(-10);321    const prefix = "tmp-";322    const suffix = `.${prefix}${timestamp}${randomness}`;323    const tempPath = `${filePath}${suffix}`;324    return tempPath;325  },326  get: (filePath, creator, purge = true) => {327    const tempPath = Temp.truncate(creator(filePath));328    if (tempPath in Temp.store)329      return Temp.get(filePath, creator, purge);330    Temp.store[tempPath] = purge;331    const disposer = () => delete Temp.store[tempPath];332    return [tempPath, disposer];333  },334  purge: (filePath) => {335    if (!Temp.store[filePath])336      return;337    delete Temp.store[filePath];338    dist_default.attempt.unlink(filePath);339  },340  purgeSync: (filePath) => {341    if (!Temp.store[filePath])342      return;343    delete Temp.store[filePath];344    dist_default.attempt.unlinkSync(filePath);345  },346  purgeSyncAll: () => {347    for (const filePath in Temp.store) {348      Temp.purgeSync(filePath);349    }350  },351  truncate: (filePath) => {352    const basename = path.basename(filePath);353    if (basename.length <= LIMIT_BASENAME_LENGTH)354      return filePath;355    const truncable = /^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(basename);356    if (!truncable)357      return filePath;358    const truncationLength = basename.length - LIMIT_BASENAME_LENGTH;359    return `${filePath.slice(0, -basename.length)}${truncable[1]}${truncable[2].slice(0, -truncationLength)}${truncable[3]}`;360  }361};362node_default(Temp.purgeSyncAll);363var temp_default = Temp;364 365// node_modules/atomically/dist/index.js366function readFile(filePath, options = DEFAULT_READ_OPTIONS) {367  if (isString(options))368    return readFile(filePath, { encoding: options });369  const timeout = options.timeout ?? DEFAULT_TIMEOUT_ASYNC;370  const retryOptions = { timeout, interval: DEFAULT_INTERVAL_ASYNC };371  return dist_default.retry.readFile(retryOptions)(filePath, options);372}373function writeFile(filePath, data, options, callback) {374  if (isFunction(options))375    return writeFile(filePath, data, DEFAULT_WRITE_OPTIONS, options);376  const promise = writeFileAsync(filePath, data, options);377  if (callback)378    promise.then(callback, callback);379  return promise;380}381async function writeFileAsync(filePath, data, options = DEFAULT_WRITE_OPTIONS) {382  if (isString(options))383    return writeFileAsync(filePath, data, { encoding: options });384  const timeout = options.timeout ?? DEFAULT_TIMEOUT_ASYNC;385  const retryOptions = { timeout, interval: DEFAULT_INTERVAL_ASYNC };386  let schedulerCustomDisposer = null;387  let schedulerDisposer = null;388  let tempDisposer = null;389  let tempPath = null;390  let fd = null;391  try {392    if (options.schedule)393      schedulerCustomDisposer = await options.schedule(filePath);394    schedulerDisposer = await scheduler_default.schedule(filePath);395    const filePathReal = await dist_default.attempt.realpath(filePath);396    const filePathExists = !!filePathReal;397    filePath = filePathReal || filePath;398    [tempPath, tempDisposer] = temp_default.get(filePath, options.tmpCreate || temp_default.create, !(options.tmpPurge === false));399    const useStatChown = IS_POSIX && isUndefined(options.chown);400    const useStatMode = isUndefined(options.mode);401    if (filePathExists && (useStatChown || useStatMode)) {402      const stats = await dist_default.attempt.stat(filePath);403      if (stats) {404        options = { ...options };405        if (useStatChown) {406          options.chown = { uid: stats.uid, gid: stats.gid };407        }408        if (useStatMode) {409          options.mode = stats.mode;410        }411      }412    }413    if (!filePathExists) {414      const parentPath = path2.dirname(filePath);415      await dist_default.attempt.mkdir(parentPath, {416        mode: DEFAULT_FOLDER_MODE,417        recursive: true418      });419    }420    fd = await dist_default.retry.open(retryOptions)(tempPath, "w", options.mode || DEFAULT_FILE_MODE);421    if (options.tmpCreated) {422      options.tmpCreated(tempPath);423    }424    if (isString(data)) {425      await dist_default.retry.write(retryOptions)(fd, data, 0, options.encoding || DEFAULT_ENCODING);426    } else if (data instanceof Readable) {427      const writeStream = createWriteStream(tempPath, { fd, autoClose: false });428      const finishPromise = once(writeStream, "finish");429      data.pipe(writeStream);430      await finishPromise;431    } else if (!isUndefined(data)) {432      await dist_default.retry.write(retryOptions)(fd, data, 0, data.length, 0);433    }434    if (options.fsync !== false) {435      if (options.fsyncWait !== false) {436        await dist_default.retry.fsync(retryOptions)(fd);437      } else {438        dist_default.attempt.fsync(fd);439      }440    }441    await dist_default.retry.close(retryOptions)(fd);442    fd = null;443    if (options.chown && (options.chown.uid !== DEFAULT_USER_UID || options.chown.gid !== DEFAULT_USER_GID)) {444      await dist_default.attempt.chown(tempPath, options.chown.uid, options.chown.gid);445    }446    if (options.mode && options.mode !== DEFAULT_FILE_MODE) {447      await dist_default.attempt.chmod(tempPath, options.mode);448    }449    try {450      await dist_default.retry.rename(retryOptions)(tempPath, filePath);451    } catch (error) {452      if (!isException(error))453        throw error;454      if (error.code !== "ENAMETOOLONG")455        throw error;456      await dist_default.retry.rename(retryOptions)(tempPath, temp_default.truncate(filePath));457    }458    tempDisposer();459    tempPath = null;460  } finally {461    if (fd)462      await dist_default.attempt.close(fd);463    if (tempPath)464      temp_default.purge(tempPath);465    if (schedulerCustomDisposer)466      schedulerCustomDisposer();467    if (schedulerDisposer)468      schedulerDisposer();469  }470}471 472// node_modules/@prettier/cli/dist/prettier_serial.js473import process8 from "process";474import * as prettier from "../index.mjs";475 476// scripts/build/shims/shared.js477var OPTIONAL_OBJECT = 1;478var createMethodShim = (methodName, getImplementation) => (flags, object, ...arguments_) => {479  if (flags | OPTIONAL_OBJECT && (object === void 0 || object === null)) {480    return;481  }482  const implementation = getImplementation.call(object) ?? object[methodName];483  return implementation.apply(object, arguments_);484};485 486// scripts/build/shims/method-replace-all.js487var stringReplaceAll = String.prototype.replaceAll ?? function(pattern, replacement) {488  if (pattern.global) {489    return this.replace(pattern, replacement);490  }491  return this.split(pattern).join(replacement);492};493var replaceAll = createMethodShim("replaceAll", function() {494  if (typeof this === "string") {495    return stringReplaceAll;496  }497});498var method_replace_all_default = replaceAll;499 500// node_modules/function-once/dist/index.js501var once2 = (fn) => {502  let called = false;503  let result;504  return () => {505    if (!called) {506      called = true;507      result = fn();508    }509    return result;510  };511};512var dist_default3 = once2;513 514// node_modules/import-meta-resolve/lib/resolve.js515import assert2 from "assert";516import { statSync, realpathSync } from "fs";517import process5 from "process";518import { fileURLToPath as fileURLToPath3, pathToFileURL } from "url";519import path4 from "path";520import { builtinModules } from "module";521 522// node_modules/import-meta-resolve/lib/get-format.js523import { fileURLToPath as fileURLToPath2 } from "url";524 525// node_modules/import-meta-resolve/lib/package-json-reader.js526import fs2 from "fs";527import path3 from "path";528import { fileURLToPath } from "url";529 530// node_modules/import-meta-resolve/lib/errors.js531import v8 from "v8";532import assert from "assert";533import { format, inspect } from "util";534var own = {}.hasOwnProperty;535var classRegExp = /^([A-Z][a-z\d]*)+$/;536var kTypes = /* @__PURE__ */ new Set([537  "string",538  "function",539  "number",540  "object",541  // Accept 'Function' and 'Object' as alternative to the lower cased version.542  "Function",543  "Object",544  "boolean",545  "bigint",546  "symbol"547]);548var codes = {};549function formatList(array, type = "and") {550  return array.length < 3 ? array.join(` ${type} `) : `${array.slice(0, -1).join(", ")}, ${type} ${array[array.length - 1]}`;551}552var messages = /* @__PURE__ */ new Map();553var nodeInternalPrefix = "__node_internal_";554var userStackTraceLimit;555codes.ERR_INVALID_ARG_TYPE = createError(556  "ERR_INVALID_ARG_TYPE",557  /**558   * @param {string} name559   * @param {Array<string> | string} expected560   * @param {unknown} actual561   */562  (name, expected, actual) => {563    assert.ok(typeof name === "string", "'name' must be a string");564    if (!Array.isArray(expected)) {565      expected = [expected];566    }567    let message = "The ";568    if (name.endsWith(" argument")) {569      message += `${name} `;570    } else {571      const type = name.includes(".") ? "property" : "argument";572      message += `"${name}" ${type} `;573    }574    message += "must be ";575    const types = [];576    const instances = [];577    const other = [];578    for (const value of expected) {579      assert.ok(580        typeof value === "string",581        "All expected entries have to be of type string"582      );583      if (kTypes.has(value)) {584        types.push(value.toLowerCase());585      } else if (classRegExp.exec(value) === null) {586        assert.ok(587          value !== "object",588          'The value "object" should be written as "Object"'589        );590        other.push(value);591      } else {592        instances.push(value);593      }594    }595    if (instances.length > 0) {596      const pos = types.indexOf("object");597      if (pos !== -1) {598        types.slice(pos, 1);599        instances.push("Object");600      }601    }602    if (types.length > 0) {603      message += `${types.length > 1 ? "one of type" : "of type"} ${formatList(604        types,605        "or"606      )}`;607      if (instances.length > 0 || other.length > 0) message += " or ";608    }609    if (instances.length > 0) {610      message += `an instance of ${formatList(instances, "or")}`;611      if (other.length > 0) message += " or ";612    }613    if (other.length > 0) {614      if (other.length > 1) {615        message += `one of ${formatList(other, "or")}`;616      } else {617        if (other[0].toLowerCase() !== other[0]) message += "an ";618        message += `${other[0]}`;619      }620    }621    message += `. Received ${determineSpecificType(actual)}`;622    return message;623  },624  TypeError625);626codes.ERR_INVALID_MODULE_SPECIFIER = createError(627  "ERR_INVALID_MODULE_SPECIFIER",628  /**629   * @param {string} request630   * @param {string} reason631   * @param {string} [base]632   */633  (request, reason, base = void 0) => {634    return `Invalid module "${request}" ${reason}${base ? ` imported from ${base}` : ""}`;635  },636  TypeError637);638codes.ERR_INVALID_PACKAGE_CONFIG = createError(639  "ERR_INVALID_PACKAGE_CONFIG",640  /**641   * @param {string} path642   * @param {string} [base]643   * @param {string} [message]644   */645  (path7, base, message) => {646    return `Invalid package config ${path7}${base ? ` while importing ${base}` : ""}${message ? `. ${message}` : ""}`;647  },648  Error649);650codes.ERR_INVALID_PACKAGE_TARGET = createError(651  "ERR_INVALID_PACKAGE_TARGET",652  /**653   * @param {string} packagePath654   * @param {string} key655   * @param {unknown} target656   * @param {boolean} [isImport=false]657   * @param {string} [base]658   */659  (packagePath, key, target, isImport = false, base = void 0) => {660    const relatedError = typeof target === "string" && !isImport && target.length > 0 && !target.startsWith("./");661    if (key === ".") {662      assert.ok(isImport === false);663      return `Invalid "exports" main target ${JSON.stringify(target)} defined in the package config ${packagePath}package.json${base ? ` imported from ${base}` : ""}${relatedError ? '; targets must start with "./"' : ""}`;664    }665    return `Invalid "${isImport ? "imports" : "exports"}" target ${JSON.stringify(666      target667    )} defined for '${key}' in the package config ${packagePath}package.json${base ? ` imported from ${base}` : ""}${relatedError ? '; targets must start with "./"' : ""}`;668  },669  Error670);671codes.ERR_MODULE_NOT_FOUND = createError(672  "ERR_MODULE_NOT_FOUND",673  /**674   * @param {string} path675   * @param {string} base676   * @param {boolean} [exactUrl]677   */678  (path7, base, exactUrl = false) => {679    return `Cannot find ${exactUrl ? "module" : "package"} '${path7}' imported from ${base}`;680  },681  Error682);683codes.ERR_NETWORK_IMPORT_DISALLOWED = createError(684  "ERR_NETWORK_IMPORT_DISALLOWED",685  "import of '%s' by %s is not supported: %s",686  Error687);688codes.ERR_PACKAGE_IMPORT_NOT_DEFINED = createError(689  "ERR_PACKAGE_IMPORT_NOT_DEFINED",690  /**691   * @param {string} specifier692   * @param {string} packagePath693   * @param {string} base694   */695  (specifier, packagePath, base) => {696    return `Package import specifier "${specifier}" is not defined${packagePath ? ` in package ${packagePath}package.json` : ""} imported from ${base}`;697  },698  TypeError699);700codes.ERR_PACKAGE_PATH_NOT_EXPORTED = createError(701  "ERR_PACKAGE_PATH_NOT_EXPORTED",702  /**703   * @param {string} packagePath704   * @param {string} subpath705   * @param {string} [base]706   */707  (packagePath, subpath, base = void 0) => {708    if (subpath === ".")709      return `No "exports" main defined in ${packagePath}package.json${base ? ` imported from ${base}` : ""}`;710    return `Package subpath '${subpath}' is not defined by "exports" in ${packagePath}package.json${base ? ` imported from ${base}` : ""}`;711  },712  Error713);714codes.ERR_UNSUPPORTED_DIR_IMPORT = createError(715  "ERR_UNSUPPORTED_DIR_IMPORT",716  "Directory import '%s' is not supported resolving ES modules imported from %s",717  Error718);719codes.ERR_UNSUPPORTED_RESOLVE_REQUEST = createError(720  "ERR_UNSUPPORTED_RESOLVE_REQUEST",721  'Failed to resolve module specifier "%s" from "%s": Invalid relative URL or base scheme is not hierarchical.',722  TypeError723);724codes.ERR_UNKNOWN_FILE_EXTENSION = createError(725  "ERR_UNKNOWN_FILE_EXTENSION",726  /**727   * @param {string} extension728   * @param {string} path729   */730  (extension, path7) => {731    return `Unknown file extension "${extension}" for ${path7}`;732  },733  TypeError734);735codes.ERR_INVALID_ARG_VALUE = createError(736  "ERR_INVALID_ARG_VALUE",737  /**738   * @param {string} name739   * @param {unknown} value740   * @param {string} [reason='is invalid']741   */742  (name, value, reason = "is invalid") => {743    let inspected = inspect(value);744    if (inspected.length > 128) {745      inspected = `${inspected.slice(0, 128)}...`;746    }747    const type = name.includes(".") ? "property" : "argument";748    return `The ${type} '${name}' ${reason}. Received ${inspected}`;749  },750  TypeError751  // Note: extra classes have been shaken out.752  // , RangeError753);754function createError(sym, value, constructor) {755  messages.set(sym, value);756  return makeNodeErrorWithCode(constructor, sym);757}758function makeNodeErrorWithCode(Base, key) {759  return NodeError;760  function NodeError(...parameters) {761    const limit = Error.stackTraceLimit;762    if (isErrorStackTraceLimitWritable()) Error.stackTraceLimit = 0;763    const error = new Base();764    if (isErrorStackTraceLimitWritable()) Error.stackTraceLimit = limit;765    const message = getMessage(key, parameters, error);766    Object.defineProperties(error, {767      // Note: no need to implement `kIsNodeError` symbol, would be hard,768      // probably.769      message: {770        value: message,771        enumerable: false,772        writable: true,773        configurable: true774      },775      toString: {776        /** @this {Error} */777        value() {778          return `${this.name} [${key}]: ${this.message}`;779        },780        enumerable: false,781        writable: true,782        configurable: true783      }784    });785    captureLargerStackTrace(error);786    error.code = key;787    return error;788  }789}790function isErrorStackTraceLimitWritable() {791  try {792    if (v8.startupSnapshot.isBuildingSnapshot()) {793      return false;794    }795  } catch {796  }797  const desc = Object.getOwnPropertyDescriptor(Error, "stackTraceLimit");798  if (desc === void 0) {799    return Object.isExtensible(Error);800  }801  return own.call(desc, "writable") && desc.writable !== void 0 ? desc.writable : desc.set !== void 0;802}803function hideStackFrames(wrappedFunction) {804  const hidden = nodeInternalPrefix + wrappedFunction.name;805  Object.defineProperty(wrappedFunction, "name", { value: hidden });806  return wrappedFunction;807}808var captureLargerStackTrace = hideStackFrames(809  /**810   * @param {Error} error811   * @returns {Error}812   */813  // @ts-expect-error: fine814  function(error) {815    const stackTraceLimitIsWritable = isErrorStackTraceLimitWritable();816    if (stackTraceLimitIsWritable) {817      userStackTraceLimit = Error.stackTraceLimit;818      Error.stackTraceLimit = Number.POSITIVE_INFINITY;819    }820    Error.captureStackTrace(error);821    if (stackTraceLimitIsWritable) Error.stackTraceLimit = userStackTraceLimit;822    return error;823  }824);825function getMessage(key, parameters, self) {826  const message = messages.get(key);827  assert.ok(message !== void 0, "expected `message` to be found");828  if (typeof message === "function") {829    assert.ok(830      message.length <= parameters.length,831      // Default options do not count.832      `Code: ${key}; The provided arguments length (${parameters.length}) does not match the required ones (${message.length}).`833    );834    return Reflect.apply(message, self, parameters);835  }836  const regex3 = /%[dfijoOs]/g;837  let expectedLength = 0;838  while (regex3.exec(message) !== null) expectedLength++;839  assert.ok(840    expectedLength === parameters.length,841    `Code: ${key}; The provided arguments length (${parameters.length}) does not match the required ones (${expectedLength}).`842  );843  if (parameters.length === 0) return message;844  parameters.unshift(message);845  return Reflect.apply(format, null, parameters);846}847function determineSpecificType(value) {848  if (value === null || value === void 0) {849    return String(value);850  }851  if (typeof value === "function" && value.name) {852    return `function ${value.name}`;853  }854  if (typeof value === "object") {855    if (value.constructor && value.constructor.name) {856      return `an instance of ${value.constructor.name}`;857    }858    return `${inspect(value, { depth: -1 })}`;859  }860  let inspected = inspect(value, { colors: false });861  if (inspected.length > 28) {862    inspected = `${inspected.slice(0, 25)}...`;863  }864  return `type ${typeof value} (${inspected})`;865}866 867// node_modules/import-meta-resolve/lib/package-json-reader.js868var hasOwnProperty = {}.hasOwnProperty;869var { ERR_INVALID_PACKAGE_CONFIG } = codes;870var cache = /* @__PURE__ */ new Map();871function read(jsonPath, { base, specifier }) {872  const existing = cache.get(jsonPath);873  if (existing) {874    return existing;875  }876  let string2;877  try {878    string2 = fs2.readFileSync(path3.toNamespacedPath(jsonPath), "utf8");879  } catch (error) {880    const exception = (881      /** @type {ErrnoException} */882      error883    );884    if (exception.code !== "ENOENT") {885      throw exception;886    }887  }888  const result = {889    exists: false,890    pjsonPath: jsonPath,891    main: void 0,892    name: void 0,893    type: "none",894    // Ignore unknown types for forwards compatibility895    exports: void 0,896    imports: void 0897  };898  if (string2 !== void 0) {899    let parsed;900    try {901      parsed = JSON.parse(string2);902    } catch (error_) {903      const cause = (904        /** @type {ErrnoException} */905        error_906      );907      const error = new ERR_INVALID_PACKAGE_CONFIG(908        jsonPath,909        (base ? `"${specifier}" from ` : "") + fileURLToPath(base || specifier),910        cause.message911      );912      error.cause = cause;913      throw error;914    }915    result.exists = true;916    if (hasOwnProperty.call(parsed, "name") && typeof parsed.name === "string") {917      result.name = parsed.name;918    }919    if (hasOwnProperty.call(parsed, "main") && typeof parsed.main === "string") {920      result.main = parsed.main;921    }922    if (hasOwnProperty.call(parsed, "exports")) {923      result.exports = parsed.exports;924    }925    if (hasOwnProperty.call(parsed, "imports")) {926      result.imports = parsed.imports;927    }928    if (hasOwnProperty.call(parsed, "type") && (parsed.type === "commonjs" || parsed.type === "module")) {929      result.type = parsed.type;930    }931  }932  cache.set(jsonPath, result);933  return result;934}935function getPackageScopeConfig(resolved) {936  let packageJSONUrl = new URL("package.json", resolved);937  while (true) {938    const packageJSONPath2 = packageJSONUrl.pathname;939    if (packageJSONPath2.endsWith("node_modules/package.json")) {940      break;941    }942    const packageConfig = read(fileURLToPath(packageJSONUrl), {943      specifier: resolved944    });945    if (packageConfig.exists) {946      return packageConfig;947    }948    const lastPackageJSONUrl = packageJSONUrl;949    packageJSONUrl = new URL("../package.json", packageJSONUrl);950    if (packageJSONUrl.pathname === lastPackageJSONUrl.pathname) {951      break;952    }953  }954  const packageJSONPath = fileURLToPath(packageJSONUrl);955  return {956    pjsonPath: packageJSONPath,957    exists: false,958    type: "none"959  };960}961function getPackageType(url2) {962  return getPackageScopeConfig(url2).type;963}964 965// node_modules/import-meta-resolve/lib/get-format.js966var { ERR_UNKNOWN_FILE_EXTENSION } = codes;967var hasOwnProperty2 = {}.hasOwnProperty;968var extensionFormatMap = {969  // @ts-expect-error: hush.970  __proto__: null,971  ".cjs": "commonjs",972  ".js": "module",973  ".json": "json",974  ".mjs": "module"975};976function mimeToFormat(mime) {977  if (mime && /\s*(text|application)\/javascript\s*(;\s*charset=utf-?8\s*)?/i.test(mime))978    return "module";979  if (mime === "application/json") return "json";980  return null;981}982var protocolHandlers = {983  // @ts-expect-error: hush.984  __proto__: null,985  "data:": getDataProtocolModuleFormat,986  "file:": getFileProtocolModuleFormat,987  "http:": getHttpProtocolModuleFormat,988  "https:": getHttpProtocolModuleFormat,989  "node:"() {990    return "builtin";991  }992};993function getDataProtocolModuleFormat(parsed) {994  const { 1: mime } = /^([^/]+\/[^;,]+)[^,]*?(;base64)?,/.exec(995    parsed.pathname996  ) || [null, null, null];997  return mimeToFormat(mime);998}999function extname(url2) {1000  const pathname = url2.pathname;1001  let index = pathname.length;1002  while (index--) {1003    const code = pathname.codePointAt(index);1004    if (code === 47) {1005      return "";1006    }1007    if (code === 46) {1008      return pathname.codePointAt(index - 1) === 47 ? "" : pathname.slice(index);1009    }1010  }1011  return "";1012}1013function getFileProtocolModuleFormat(url2, _context, ignoreErrors) {1014  const value = extname(url2);1015  if (value === ".js") {1016    const packageType = getPackageType(url2);1017    if (packageType !== "none") {1018      return packageType;1019    }1020    return "commonjs";1021  }1022  if (value === "") {1023    const packageType = getPackageType(url2);1024    if (packageType === "none" || packageType === "commonjs") {1025      return "commonjs";1026    }1027    return "module";1028  }1029  const format3 = extensionFormatMap[value];1030  if (format3) return format3;1031  if (ignoreErrors) {1032    return void 0;1033  }1034  const filepath = fileURLToPath2(url2);1035  throw new ERR_UNKNOWN_FILE_EXTENSION(value, filepath);1036}1037function getHttpProtocolModuleFormat() {1038}1039function defaultGetFormatWithoutErrors(url2, context) {1040  const protocol = url2.protocol;1041  if (!hasOwnProperty2.call(protocolHandlers, protocol)) {1042    return null;1043  }1044  return protocolHandlers[protocol](url2, context, true) || null;1045}1046 1047// node_modules/import-meta-resolve/lib/utils.js1048var { ERR_INVALID_ARG_VALUE } = codes;1049var DEFAULT_CONDITIONS = Object.freeze(["node", "import"]);1050var DEFAULT_CONDITIONS_SET = new Set(DEFAULT_CONDITIONS);1051function getDefaultConditions() {1052  return DEFAULT_CONDITIONS;1053}1054function getDefaultConditionsSet() {1055  return DEFAULT_CONDITIONS_SET;1056}1057function getConditionsSet(conditions) {1058  if (conditions !== void 0 && conditions !== getDefaultConditions()) {1059    if (!Array.isArray(conditions)) {1060      throw new ERR_INVALID_ARG_VALUE(1061        "conditions",1062        conditions,1063        "expected an array"1064      );1065    }1066    return new Set(conditions);1067  }1068  return getDefaultConditionsSet();1069}1070 1071// node_modules/import-meta-resolve/lib/resolve.js1072var RegExpPrototypeSymbolReplace = RegExp.prototype[Symbol.replace];1073var {1074  ERR_NETWORK_IMPORT_DISALLOWED,1075  ERR_INVALID_MODULE_SPECIFIER,1076  ERR_INVALID_PACKAGE_CONFIG: ERR_INVALID_PACKAGE_CONFIG2,1077  ERR_INVALID_PACKAGE_TARGET,1078  ERR_MODULE_NOT_FOUND,1079  ERR_PACKAGE_IMPORT_NOT_DEFINED,1080  ERR_PACKAGE_PATH_NOT_EXPORTED,1081  ERR_UNSUPPORTED_DIR_IMPORT,1082  ERR_UNSUPPORTED_RESOLVE_REQUEST1083} = codes;1084var own2 = {}.hasOwnProperty;1085var invalidSegmentRegEx = /(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))?(\\|\/|$)/i;1086var deprecatedInvalidSegmentRegEx = /(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))(\\|\/|$)/i;1087var invalidPackageNameRegEx = /^\.|%|\\/;1088var patternRegEx = /\*/g;1089var encodedSeparatorRegEx = /%2f|%5c/i;1090var emittedPackageWarnings = /* @__PURE__ */ new Set();1091var doubleSlashRegEx = /[/\\]{2}/;1092function emitInvalidSegmentDeprecation(target, request, match2, packageJsonUrl, internal, base, isTarget) {1093  if (process5.noDeprecation) {1094    return;1095  }1096  const pjsonPath = fileURLToPath3(packageJsonUrl);1097  const double = doubleSlashRegEx.exec(isTarget ? target : request) !== null;1098  process5.emitWarning(1099    `Use of deprecated ${double ? "double slash" : "leading or trailing slash matching"} resolving "${target}" for module request "${request}" ${request === match2 ? "" : `matched to "${match2}" `}in the "${internal ? "imports" : "exports"}" field module resolution of the package at ${pjsonPath}${base ? ` imported from ${fileURLToPath3(base)}` : ""}.`,1100    "DeprecationWarning",1101    "DEP0166"1102  );1103}1104function emitLegacyIndexDeprecation(url2, packageJsonUrl, base, main) {1105  if (process5.noDeprecation) {1106    return;1107  }1108  const format3 = defaultGetFormatWithoutErrors(url2, { parentURL: base.href });1109  if (format3 !== "module") return;1110  const urlPath = fileURLToPath3(url2.href);1111  const packagePath = fileURLToPath3(new URL(".", packageJsonUrl));1112  const basePath = fileURLToPath3(base);1113  if (!main) {1114    process5.emitWarning(1115      `No "main" or "exports" field defined in the package.json for ${packagePath} resolving the main entry point "${urlPath.slice(1116        packagePath.length1117      )}", imported from ${basePath}.1118Default "index" lookups for the main are deprecated for ES modules.`,1119      "DeprecationWarning",1120      "DEP0151"1121    );1122  } else if (path4.resolve(packagePath, main) !== urlPath) {1123    process5.emitWarning(1124      `Package ${packagePath} has a "main" field set to "${main}", excluding the full filename and extension to the resolved file at "${urlPath.slice(1125        packagePath.length1126      )}", imported from ${basePath}.1127 Automatic extension resolution of the "main" field is deprecated for ES modules.`,1128      "DeprecationWarning",1129      "DEP0151"1130    );1131  }1132}1133function tryStatSync(path7) {1134  try {1135    return statSync(path7);1136  } catch {1137  }1138}1139function fileExists(url2) {1140  const stats = statSync(url2, { throwIfNoEntry: false });1141  const isFile = stats ? stats.isFile() : void 0;1142  return isFile === null || isFile === void 0 ? false : isFile;1143}1144function legacyMainResolve(packageJsonUrl, packageConfig, base) {1145  let guess;1146  if (packageConfig.main !== void 0) {1147    guess = new URL(packageConfig.main, packageJsonUrl);1148    if (fileExists(guess)) return guess;1149    const tries2 = [1150      `./${packageConfig.main}.js`,1151      `./${packageConfig.main}.json`,1152      `./${packageConfig.main}.node`,1153      `./${packageConfig.main}/index.js`,1154      `./${packageConfig.main}/index.json`,1155      `./${packageConfig.main}/index.node`1156    ];1157    let i2 = -1;1158    while (++i2 < tries2.length) {1159      guess = new URL(tries2[i2], packageJsonUrl);1160      if (fileExists(guess)) break;1161      guess = void 0;1162    }1163    if (guess) {1164      emitLegacyIndexDeprecation(1165        guess,1166        packageJsonUrl,1167        base,1168        packageConfig.main1169      );1170      return guess;1171    }1172  }1173  const tries = ["./index.js", "./index.json", "./index.node"];1174  let i = -1;1175  while (++i < tries.length) {1176    guess = new URL(tries[i], packageJsonUrl);1177    if (fileExists(guess)) break;1178    guess = void 0;1179  }1180  if (guess) {1181    emitLegacyIndexDeprecation(guess, packageJsonUrl, base, packageConfig.main);1182    return guess;1183  }1184  throw new ERR_MODULE_NOT_FOUND(1185    fileURLToPath3(new URL(".", packageJsonUrl)),1186    fileURLToPath3(base)1187  );1188}1189function finalizeResolution(resolved, base, preserveSymlinks) {1190  if (encodedSeparatorRegEx.exec(resolved.pathname) !== null) {1191    throw new ERR_INVALID_MODULE_SPECIFIER(1192      resolved.pathname,1193      'must not include encoded "/" or "\\" characters',1194      fileURLToPath3(base)1195    );1196  }1197  let filePath;1198  try {1199    filePath = fileURLToPath3(resolved);1200  } catch (error) {

Showing the first 1,200 of 2842 lines. Download the file for the rest.

Brunobkr/llama.cpp_AlgMor24_github · Team Ai