Kind: Class
Source: atloria-monorepo/packages/doc-automation/src/v2/stages/stage-10-generation/context-resolver.ts
ContextResolver - Resolves cross-chunk entity references
When generating documentation for a document, we may need entities that exist in OTHER chunks. This resolver fetches them from the global entity map without loading everything into memory.
Methods
| Method | Signature | Returns |
|---|---|---|
setEntityMap | setEntityMap(entityMap: Map<string, Entity>) | void |
resolveForPlan | resolveForPlan(plan: DocumentPlan) | Promise<Entity[]> |
resolveByName | resolveByName(entityName: string) | `Entity |
resolveById | resolveById(entityId: string) | `Entity |
handleDeepLoadRequest | handleDeepLoadRequest(request: DeepLoadRequest) | Promise<DeepLoadResponse> |
getByFilePath | getByFilePath(pattern: string) | Entity[] |
getByType | getByType(type: Entity['type']) | Entity[] |
clearCache | clearCache() | void |
getCacheStats | getCacheStats() | { size: number; hits: string[] } |
hasEntity | hasEntity(entityId: string) | boolean |
getEntityCount | getEntityCount() | number |
Where it refuses work
ContextResolverstops the work with an early return whencached?.found.ContextResolverstops the work with an early return whenentity.name === entityName.ContextResolverstops the work with an early return whenthis.deepLoadedCache.has(cacheKey).
Was this page helpful?