@credo-ts/core
Version:
<p align="center"> <br /> <img alt="Credo Logo" src="https://github.com/openwallet-foundation/credo-ts/blob/c7886cb8377ceb8ee4efe8d264211e561a75072d/images/credo-logo.png" height="250px" /> </p> <h1 align="center"><b>Credo - Core</b></h1
50 lines (49 loc) • 1.96 kB
text/typescript
import { DependencyManager, InjectionToken } from "../../plugins/DependencyManager.mjs";
import { AgentConfig } from "../AgentConfig.mjs";
import "../../plugins/index.mjs";
//#region src/agent/context/AgentContext.d.ts
declare class AgentContext {
/**
* Dependency manager holds all dependencies for the current context. Possibly a child of a parent dependency manager,
* in which case all singleton dependencies from the parent context are also available to this context.
*/
readonly dependencyManager: DependencyManager;
/**
* An identifier that allows to correlate this context across sessions. This identifier is created by the `AgentContextProvider`
* and should only be meaningful to the `AgentContextProvider`. The `contextCorrelationId` MUST uniquely identity the context and
* should be enough to start a new session.
*
* An example of the `contextCorrelationId` is for example the id of the `TenantRecord` that is associated with this context when using the tenant module.
* The `TenantAgentContextProvider` will set the `contextCorrelationId` to the `TenantRecord` id when creating the context, and will be able to create a context
* for a specific tenant using the `contextCorrelationId`.
*/
readonly contextCorrelationId: string;
readonly isRootAgentContext: boolean;
constructor({
dependencyManager,
contextCorrelationId,
isRootAgentContext
}: {
dependencyManager: DependencyManager;
contextCorrelationId: string;
isRootAgentContext?: boolean;
});
/**
* Convenience method to access the agent config for the current context.
*/
get config(): AgentConfig;
/**
* End session the current agent context
*/
endSession(): Promise<void>;
toJSON(): {
contextCorrelationId: string;
};
/**
* Resolve a dependency
*/
resolve<T>(token: InjectionToken<T>): T;
}
//#endregion
export { AgentContext };
//# sourceMappingURL=AgentContext.d.mts.map