import type { AgentKeyManager } from './types/key-manager.js';
import type { BearerDid } from '@enbox/dids';
import type { EnboxPlatformAgent } from './types/agent.js';
import type { EnboxRpc } from '@enbox/dwn-clients';
import type { LocalDwnStrategy } from './local-dwn.js';
import type { SecretStore } from './secret-store.js';
import type { SyncEngine } from './types/sync.js';
import type { DidInterface, DidRequest, DidResponse } from './did-api.js';
import type { DwnInterface, DwnResponse, ProcessDwnRequest, SendDwnRequest } from './types/dwn.js';
import type { ProcessVcRequest, SendVcRequest, VcResponse } from './types/vc.js';
import { AgentCryptoApi } from './crypto-api.js';
import { AgentDidApi } from './did-api.js';
import { AgentDwnApi } from './dwn-api.js';
import { AgentIdentityApi } from './identity-api.js';
import { AgentPermissionsApi } from './permissions-api.js';
import { HdIdentityVault } from './hd-identity-vault.js';
import { LocalKeyManager } from './local-key-manager.js';
/**
 * Initialization parameters for {@link EnboxUserAgent}, including an optional recovery phrase that
 * can be used to derive keys to encrypt the vault and generate a DID.
 */
export type AgentInitializeParams = {
    /**
      * The password used to secure the Agent vault.
      *
      * The password selected should be strong and securely managed to prevent unauthorized access.
      */
    password: string;
    /**
     * An optional recovery phrase used to deterministically generate the cryptographic keys for the
     * Agent vault.
     *
     * Supplying this phrase enables the vault's contents to be restored or replicated across devices.
     * If omitted, a new phrase is generated, which should be securely recorded for future recovery needs.
     */
    recoveryPhrase?: string;
    /**
     * Optional dwnEndpoints to register didService endpoints during EnboxUserAgent initialization
     *
     * The dwnEndpoints are used to register DWN endpoints against the agent DID created during
     * EnboxUserAgent.initialize() =>  DidDht.create(). This allows the
     * agent to properly recover connectedDids from DWN. Also, this pattern can be used on the server
     * side in place of the agentDid-->connectedDids pattern.
     */
    dwnEndpoints?: string[];
};
export type AgentStartParams = {
    /**
     * The password used to unlock the previously initialized Agent vault.
     */
    password: string;
};
export type AgentParams<TKeyManager extends AgentKeyManager = LocalKeyManager> = {
    /** Optional. The Decentralized Identifier (DID) representing this Enbox User Agent. */
    agentDid?: BearerDid;
    /** Encrypted vault used for managing the Agent's DID and associated keys. */
    agentVault: HdIdentityVault;
    /** Provides cryptographic capabilties like signing, encryption, hashing and key derivation. */
    cryptoApi: AgentCryptoApi;
    /** Specifies the local path to be used by the Agent's persistent data stores. */
    dataPath?: string;
    /** Facilitates DID operations including create, update, and resolve. */
    didApi: AgentDidApi<TKeyManager>;
    /** Facilitates DWN operations including processing and sending requests. */
    dwnApi: AgentDwnApi;
    /** Facilitates decentralized Identity operations including create, import, and export. */
    identityApi: AgentIdentityApi<TKeyManager>;
    /** Responsible for securely managing the cryptographic keys of the agent. */
    keyManager: TKeyManager;
    /** Facilitates fetching, requesting, creating, revoking and validating revocation status of permissions */
    permissionsApi: AgentPermissionsApi;
    /** Remote procedure call (RPC) client used to communicate with other Enbox services. */
    rpcClient: EnboxRpc;
    /** Vault-backed secret store for classified credentials. */
    secretsApi?: SecretStore;
    /** Facilitates data synchronization of DWN records between nodes. */
    syncApi: SyncEngine;
};
export type CreateUserAgentParams = Partial<AgentParams> & {
    localDwnStrategy?: LocalDwnStrategy;
    /**
     * When set, the agent operates in "remote mode": no in-process DWN is
     * created. All `processRequest()` calls are routed through RPC to
     * this endpoint instead.
     *
     * Typically set by `AuthManager.create()` after standalone discovery
     * determines that a local DWN server is running.
     */
    localDwnEndpoint?: string;
};
export declare class EnboxUserAgent<TKeyManager extends AgentKeyManager = LocalKeyManager> implements EnboxPlatformAgent<TKeyManager> {
    crypto: AgentCryptoApi;
    did: AgentDidApi<TKeyManager>;
    dwn: AgentDwnApi;
    identity: AgentIdentityApi<TKeyManager>;
    keyManager: TKeyManager;
    permissions: AgentPermissionsApi;
    rpc: EnboxRpc;
    secrets: SecretStore;
    sync: SyncEngine;
    vault: HdIdentityVault;
    private _agentDid?;
    constructor(params: AgentParams<TKeyManager>);
    get agentDid(): BearerDid;
    set agentDid(did: BearerDid);
    /**
     * If any of the required agent components are not provided, instantiate default implementations.
     */
    static create({ dataPath, localDwnStrategy, localDwnEndpoint, agentDid, agentVault, cryptoApi, didApi, dwnApi, identityApi, keyManager, permissionsApi, rpcClient, secretsApi, syncApi }?: CreateUserAgentParams): Promise<EnboxUserAgent>;
    firstLaunch(): Promise<boolean>;
    /**
     * Initializes the User Agent with a password, and optionally a recovery phrase.
     *
     * This method is typically called once, the first time the Agent is launched, and is responsible
     * for setting up the agent's operational environment, cryptographic key material, and readiness
     * for processing requests.
     *
     * The password is used to secure the Agent vault, and the recovery phrase is used to derive the
     * cryptographic keys for the vault. If a recovery phrase is not provided, a new recovery phrase
     * will be generated and returned. The password should be chosen and entered by the end-user.
     */
    initialize({ password, recoveryPhrase, dwnEndpoints }: AgentInitializeParams): Promise<string>;
    processDidRequest<T extends DidInterface>(request: DidRequest<T>): Promise<DidResponse<T>>;
    processDwnRequest<T extends DwnInterface>(request: ProcessDwnRequest<T>): Promise<DwnResponse<T>>;
    processVcRequest(_request: ProcessVcRequest): Promise<VcResponse>;
    sendDidRequest<T extends DidInterface>(_request: DidRequest<T>): Promise<DidResponse<T>>;
    sendDwnRequest<T extends DwnInterface>(request: SendDwnRequest<T>): Promise<DwnResponse<T>>;
    sendVcRequest(_request: SendVcRequest): Promise<VcResponse>;
    start({ password }: AgentInitializeParams): Promise<void>;
}
//# sourceMappingURL=enbox-user-agent.d.ts.map