///
import type { JSONObject } from '@matrixai/rpc';
import type { DeepPartial, FileSystem, ObjectEmpty, POJO, PolykeyAgentOptions } from './types.js';
import type { PolykeyWorkerManager } from './workers/types.js';
import type { SeedNodes } from './nodes/types.js';
import type { AgentClientManifest } from './nodes/agent/callers/index.js';
import Logger from '@matrixai/logger';
import { DB } from '@matrixai/db';
import { createDestroyStartStop } from '@matrixai/async-init';
import Audit from './audit/Audit.js';
import KeyRing from './keys/KeyRing.js';
import CertManager from './keys/CertManager.js';
import Status from './status/Status.js';
import Schema from './schema/Schema.js';
import VaultManager from './vaults/VaultManager.js';
import ACL from './acl/ACL.js';
import NodeManager from './nodes/NodeManager.js';
import NodeGraph from './nodes/NodeGraph.js';
import NodeConnectionManager from './nodes/NodeConnectionManager.js';
import NotificationsManager from './notifications/NotificationsManager.js';
import GestaltGraph from './gestalts/GestaltGraph.js';
import Sigchain from './sigchain/Sigchain.js';
import Discovery from './discovery/Discovery.js';
import SessionManager from './sessions/SessionManager.js';
import IdentitiesManager from './identities/IdentitiesManager.js';
import TaskManager from './tasks/TaskManager.js';
import ClientService from './client/ClientService.js';
import * as keysEvents from './keys/events.js';
interface PolykeyAgent extends createDestroyStartStop.CreateDestroyStartStop {
}
declare class PolykeyAgent {
/**
* Create the Polykey Agent.
*
* All optional configuration is deep-merged with defaults.
*
* If any of the optional dependencies is injected, their lifecycle will not
* be managed by `PolykeyAgent`. Furthermore, if you inject an optional
* dependency, make sure you are injecting all upstream transitive
* dependencies at the same time. For example if you inject `acl`, you must
* also inject `db`.
*/
static createPolykeyAgent({ password, options, fresh, fs, logger, }: {
password: string;
options?: DeepPartial;
fresh?: boolean;
fs?: FileSystem;
logger?: Logger;
}): Promise;
readonly nodePath: string;
readonly audit: Audit;
readonly status: Status;
readonly schema: Schema;
readonly keyRing: KeyRing;
readonly db: DB;
readonly certManager: CertManager;
readonly identitiesManager: IdentitiesManager;
readonly sigchain: Sigchain;
readonly acl: ACL;
readonly gestaltGraph: GestaltGraph;
readonly nodeGraph: NodeGraph;
readonly taskManager: TaskManager;
readonly nodeConnectionManager: NodeConnectionManager;
readonly nodeManager: NodeManager;
readonly discovery: Discovery;
readonly vaultManager: VaultManager;
readonly notificationsManager: NotificationsManager;
readonly sessionManager: SessionManager;
readonly fs: FileSystem;
readonly logger: Logger;
readonly clientService: ClientService;
protected workerManager: PolykeyWorkerManager | undefined;
protected _startTime: number;
protected _versionMetadata: JSONObject;
protected handleEventCertManagerCertChange: (evt: keysEvents.EventCertManagerCertChange) => Promise;
constructor({ nodePath, audit, status, schema, keyRing, db, certManager, identitiesManager, sigchain, acl, gestaltGraph, nodeGraph, taskManager, nodeConnectionManager, nodeManager, discovery, vaultManager, notificationsManager, sessionManager, clientService, fs, logger, versionMetadata, }: {
nodePath: string;
audit: Audit;
status: Status;
schema: Schema;
keyRing: KeyRing;
db: DB;
certManager: CertManager;
identitiesManager: IdentitiesManager;
sigchain: Sigchain;
acl: ACL;
gestaltGraph: GestaltGraph;
nodeGraph: NodeGraph;
taskManager: TaskManager;
nodeConnectionManager: NodeConnectionManager;
nodeManager: NodeManager;
discovery: Discovery;
vaultManager: VaultManager;
notificationsManager: NotificationsManager;
sessionManager: SessionManager;
clientService: ClientService;
fs: FileSystem;
logger: Logger;
versionMetadata: POJO;
});
get clientServiceHost(): import("@matrixai/ws/types.js").Host;
get clientServicePort(): import("@matrixai/ws/types.js").Port;
get agentServiceHost(): import("./network/types.js").Host;
get agentServicePort(): import("./network/types.js").Port;
get versionMetadata(): JSONObject;
/**
* Returns the time the `PolykeyAgent` was started at in milliseconds since Unix epoch
*/
get startTime(): number;
start({ password, options, fresh, }: {
password: string;
options?: DeepPartial<{
clientServiceHost: string;
clientServicePort: number;
agentServiceHost: string;
agentServicePort: number;
ipv6Only: boolean;
workers: number;
keys: ObjectEmpty | {
recoveryCode: string;
} | {
privateKey: Buffer;
} | {
privateKeyPath: string;
};
mdns: {
groups: Array;
port: number;
};
network: string;
seedNodes: SeedNodes;
}>;
workers?: number;
fresh?: boolean;
}): Promise;
/**
* Asynchronously stops the PolykeyAgent
*/
stop(): Promise;
destroy(password: string): Promise;
}
export default PolykeyAgent;
export type { PolykeyAgentOptions };