"use strict";
/* Socket Lib - Built with rolldown */
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const require_primordials_error = require('../primordials/error.js');
const require_primordials_string = require('../primordials/string.js');
const require_paths_socket = require('../paths/socket.js');
const require_cacache__internal = require('./_internal.js');

//#region src/cacache/write.ts
/**
* @file Cache write entrypoints — `put` (insert/replace by key) and `remove`
*   (single-key delete). Both reject wildcards; for pattern deletes use
*   `clear({ prefix: 'foo*' })`.
*/
/**
* Put data into the Socket shared cache with a key.
*
* @example
*   ;```typescript
*   await put('socket-sdk:scans:abc123', Buffer.from('result data'))
*   ```
*
* @throws {TypeError} If key contains wildcards (*)
*/
async function put(key, data, options) {
	if (require_primordials_string.StringPrototypeIncludes(key, "*")) throw new require_primordials_error.TypeErrorCtor("Cache key cannot contain wildcards (*). Wildcards are only supported in clear({ prefix: \"pattern*\" }).");
	/* c8 ignore next - External cacache call */
	return await require_cacache__internal.getCacache().put(require_paths_socket.getSocketCacacheDir(), key, data, options);
}
/**
* Remove an entry from the Socket shared cache by key.
*
* @example
*   ;```typescript
*   await remove('socket-sdk:scans:abc123')
*   ```
*
* @throws {TypeError} If key contains wildcards (*)
*/
async function remove(key) {
	if (require_primordials_string.StringPrototypeIncludes(key, "*")) throw new require_primordials_error.TypeErrorCtor("Cache key cannot contain wildcards (*). Use clear({ prefix: \"pattern*\" }) to remove multiple entries.");
	/* c8 ignore next - External cacache call */
	return await require_cacache__internal.getCacache().rm.entry(require_paths_socket.getSocketCacacheDir(), key);
}

//#endregion
exports.put = put;
exports.remove = remove;