/**
 * Runtime detection for @agentuity/local
 *
 * Detects the current JavaScript runtime and provides
 * appropriate local storage implementations.
 */
/**
 * Detect the current runtime environment.
 */
export function detectRuntime() {
    // Bun has a global Bun object
    if (typeof globalThis.Bun !== 'undefined') {
        return 'bun';
    }
    // Deno has a global Deno object
    if (typeof globalThis.Deno !== 'undefined') {
        return 'deno';
    }
    // Cloudflare Workers have caches.default
    if (typeof globalThis.caches !== 'undefined' &&
        'default' in globalThis.caches) {
        return 'workers';
    }
    // Node.js has process.versions.node
    if (typeof globalThis.process !== 'undefined' &&
        globalThis.process?.versions?.node) {
        return 'node';
    }
    return 'unknown';
}
/**
 * Check if local services are available for the current runtime.
 */
export function isLocalAvailable() {
    const runtime = detectRuntime();
    return runtime === 'bun'; // Only Bun is supported for now
}
/**
 * Get the current runtime name for logging.
 */
export function getRuntimeName() {
    return detectRuntime();
}
//# sourceMappingURL=runtime.js.map