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.
03.1k
1import { HandlerCallbackOptions, WorkboxPlugin, WorkboxPluginCallbackParam } from 'workbox-core/types.js';2import { Strategy } from './Strategy.js';3import './_version.js';4/**5 * A class created every time a Strategy instance calls6 * {@link workbox-strategies.Strategy~handle} or7 * {@link workbox-strategies.Strategy~handleAll} that wraps all fetch and8 * cache actions around plugin callbacks and keeps track of when the strategy9 * is "done" (i.e. all added `event.waitUntil()` promises have resolved).10 *11 * @memberof workbox-strategies12 */13declare class StrategyHandler {14 request: Request;15 url?: URL;16 event: ExtendableEvent;17 params?: any;18 private _cacheKeys;19 private readonly _strategy;20 private readonly _extendLifetimePromises;21 private readonly _handlerDeferred;22 private readonly _plugins;23 private readonly _pluginStateMap;24 /**25 * Creates a new instance associated with the passed strategy and event26 * that's handling the request.27 *28 * The constructor also initializes the state that will be passed to each of29 * the plugins handling this request.30 *31 * @param {workbox-strategies.Strategy} strategy32 * @param {Object} options33 * @param {Request|string} options.request A request to run this strategy for.34 * @param {ExtendableEvent} options.event The event associated with the35 * request.36 * @param {URL} [options.url]37 * @param {*} [options.params] The return value from the38 * {@link workbox-routing~matchCallback} (if applicable).39 */40 constructor(strategy: Strategy, options: HandlerCallbackOptions);41 /**42 * Fetches a given request (and invokes any applicable plugin callback43 * methods) using the `fetchOptions` (for non-navigation requests) and44 * `plugins` defined on the `Strategy` object.45 *46 * The following plugin lifecycle methods are invoked when using this method:47 * - `requestWillFetch()`48 * - `fetchDidSucceed()`49 * - `fetchDidFail()`50 *51 * @param {Request|string} input The URL or request to fetch.52 * @return {Promise<Response>}53 */54 fetch(input: RequestInfo): Promise<Response>;55 /**56 * Calls `this.fetch()` and (in the background) runs `this.cachePut()` on57 * the response generated by `this.fetch()`.58 *59 * The call to `this.cachePut()` automatically invokes `this.waitUntil()`,60 * so you do not have to manually call `waitUntil()` on the event.61 *62 * @param {Request|string} input The request or URL to fetch and cache.63 * @return {Promise<Response>}64 */65 fetchAndCachePut(input: RequestInfo): Promise<Response>;66 /**67 * Matches a request from the cache (and invokes any applicable plugin68 * callback methods) using the `cacheName`, `matchOptions`, and `plugins`69 * defined on the strategy object.70 *71 * The following plugin lifecycle methods are invoked when using this method:72 * - cacheKeyWillBeUsed()73 * - cachedResponseWillBeUsed()74 *75 * @param {Request|string} key The Request or URL to use as the cache key.76 * @return {Promise<Response|undefined>} A matching response, if found.77 */78 cacheMatch(key: RequestInfo): Promise<Response | undefined>;79 /**80 * Puts a request/response pair in the cache (and invokes any applicable81 * plugin callback methods) using the `cacheName` and `plugins` defined on82 * the strategy object.83 *84 * The following plugin lifecycle methods are invoked when using this method:85 * - cacheKeyWillBeUsed()86 * - cacheWillUpdate()87 * - cacheDidUpdate()88 *89 * @param {Request|string} key The request or URL to use as the cache key.90 * @param {Response} response The response to cache.91 * @return {Promise<boolean>} `false` if a cacheWillUpdate caused the response92 * not be cached, and `true` otherwise.93 */94 cachePut(key: RequestInfo, response: Response): Promise<boolean>;95 /**96 * Checks the list of plugins for the `cacheKeyWillBeUsed` callback, and97 * executes any of those callbacks found in sequence. The final `Request`98 * object returned by the last plugin is treated as the cache key for cache99 * reads and/or writes. If no `cacheKeyWillBeUsed` plugin callbacks have100 * been registered, the passed request is returned unmodified101 *102 * @param {Request} request103 * @param {string} mode104 * @return {Promise<Request>}105 */106 getCacheKey(request: Request, mode: 'read' | 'write'): Promise<Request>;107 /**108 * Returns true if the strategy has at least one plugin with the given109 * callback.110 *111 * @param {string} name The name of the callback to check for.112 * @return {boolean}113 */114 hasCallback<C extends keyof WorkboxPlugin>(name: C): boolean;115 /**116 * Runs all plugin callbacks matching the given name, in order, passing the117 * given param object (merged ith the current plugin state) as the only118 * argument.119 *120 * Note: since this method runs all plugins, it's not suitable for cases121 * where the return value of a callback needs to be applied prior to calling122 * the next callback. See123 * {@link workbox-strategies.StrategyHandler#iterateCallbacks}124 * below for how to handle that case.125 *126 * @param {string} name The name of the callback to run within each plugin.127 * @param {Object} param The object to pass as the first (and only) param128 * when executing each callback. This object will be merged with the129 * current plugin state prior to callback execution.130 */131 runCallbacks<C extends keyof NonNullable<WorkboxPlugin>>(name: C, param: Omit<WorkboxPluginCallbackParam[C], 'state'>): Promise<void>;132 /**133 * Accepts a callback and returns an iterable of matching plugin callbacks,134 * where each callback is wrapped with the current handler state (i.e. when135 * you call each callback, whatever object parameter you pass it will136 * be merged with the plugin's current state).137 *138 * @param {string} name The name fo the callback to run139 * @return {Array<Function>}140 */141 iterateCallbacks<C extends keyof WorkboxPlugin>(name: C): Generator<NonNullable<WorkboxPlugin[C]>>;142 /**143 * Adds a promise to the144 * [extend lifetime promises]{@link https://w3c.github.io/ServiceWorker/#extendableevent-extend-lifetime-promises}145 * of the event associated with the request being handled (usually a146 * `FetchEvent`).147 *148 * Note: you can await149 * {@link workbox-strategies.StrategyHandler~doneWaiting}150 * to know when all added promises have settled.151 *152 * @param {Promise} promise A promise to add to the extend lifetime promises153 * of the event that triggered the request.154 */155 waitUntil<T>(promise: Promise<T>): Promise<T>;156 /**157 * Returns a promise that resolves once all promises passed to158 * {@link workbox-strategies.StrategyHandler~waitUntil}159 * have settled.160 *161 * Note: any work done after `doneWaiting()` settles should be manually162 * passed to an event's `waitUntil()` method (not this handler's163 * `waitUntil()` method), otherwise the service worker thread may be killed164 * prior to your work completing.165 */166 doneWaiting(): Promise<void>;167 /**168 * Stops running the strategy and immediately resolves any pending169 * `waitUntil()` promises.170 */171 destroy(): void;172 /**173 * This method will call cacheWillUpdate on the available plugins (or use174 * status === 200) to determine if the Response is safe and valid to cache.175 *176 * @param {Request} options.request177 * @param {Response} options.response178 * @return {Promise<Response|undefined>}179 *180 * @private181 */182 _ensureResponseSafeToCache(response: Response): Promise<Response | undefined>;183}184export { StrategyHandler };185 