"use strict";
/* Socket Lib - Built with rolldown */
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const require_secrets_find = require('./find.js');

//#region src/secrets/socket-api-token.ts
/**
* @file Convenience helper for reading the Socket API token from the canonical
*   env → keychain precedence order. Centralizes two constants every fleet
*   consumer would otherwise hard-code: the keychain service name
*   (`socket-cli`) and the env-var + account fallback list (`SOCKET_API_TOKEN`
*   canonical, `SOCKET_API_KEY` legacy alias). Consumers like firewall and
*   wheelhouse hooks call `readSocketApiToken()` instead of redoing the
*   `resolve({ service, accounts })` boilerplate.
*/
const SOCKET_CLI_SERVICE = "socket-cli";
const TOKEN_ACCOUNTS = ["SOCKET_API_TOKEN", "SOCKET_API_KEY"];
async function readSocketApiToken(options) {
	return (await require_secrets_find.resolve({
		service: SOCKET_CLI_SERVICE,
		accounts: TOKEN_ACCOUNTS,
		allowEnvOnly: options?.allowEnvOnly
	}))?.value;
}
function readSocketApiTokenSync(options) {
	return require_secrets_find.resolveSync({
		service: SOCKET_CLI_SERVICE,
		accounts: TOKEN_ACCOUNTS,
		allowEnvOnly: options?.allowEnvOnly
	})?.value;
}

//#endregion
exports.readSocketApiToken = readSocketApiToken;
exports.readSocketApiTokenSync = readSocketApiTokenSync;