Files
Nexus.Reader/src/.documentation/collections/overview.md
T
2026-05-22 09:04:42 +02:00

126 KiB

Project Overview and Architecture

A concise high-level view of how the solution projects fit together, their runtime hosts (server, WASM client, MAUI) and how cross-cutting concerns are wired via dependency injection, mapping and real-time services. Diagrams below show dependencies, startup/service registration, Program.cs control and method-level flows.

=== DIAGRAM 1: Dependency and Model Map (dependency-map) ===

---
config:
  flowchart:
    defaultRenderer: "elk"
---
flowchart TD
    flow_file_nexusreader_application_abstractions_services_ibillingservice_cs_file_1["IBillingService"]
    flow_file_nexusreader_application_abstractions_services_ibookstorageservice_cs_file_1["IBookStorageService"]
    flow_file_nexusreader_application_abstractions_services_iidentityservice_cs_file_1["IIdentityService"]
    flow_file_nexusreader_application_abstractions_services_iknowledgeservice_cs_file_1["IKnowledgeService"]
    flow_file_nexusreader_application_abstractions_messaging_icommand_cs_file_1["ICommand.cs"]
    flow_file_nexusreader_application_abstractions_messaging_icommandhandler_cs_file_1["ICommandHandler"]
    flow_file_nexusreader_application_abstractions_messaging_iquery_cs_file_1["IQuery.cs"]
    flow_file_nexusreader_application_abstractions_messaging_iqueryhandler_cs_file_1["IQueryHandler<TQuery, TResponse>"]
    flow_file_nexusreader_application_abstractions_persistence_iebookrepository_cs_file_1["IEbookRepository"]
    flow_file_nexusreader_infrastructure_identity_tokenlimithandler_cs_file_1["TokenLimitHandler"]
    flow_type_nexusreader_application_abstractions_messaging_icommand_cs_icommand_6[/"ICommand"/]
    flow_type_nexusreader_application_abstractions_messaging_icommand_cs_icommand_tresponse_10[/"ICommand<TResponse>"/]
    flow_type_nexusreader_application_abstractions_messaging_icommandhandler_cs_icommandhandler_tcommand_6[/"ICommandHandler<TCommand>"/]
    flow_type_nexusreader_application_abstractions_messaging_icommandhandler_cs_icommandhandler_tcommand_tresponse_11[/"ICommandHandler<TCommand, TResponse>"/]
    flow_type_nexusreader_application_abstractions_messaging_iquery_cs_iquery_tresponse_6[/"IQuery<TResponse>"/]
    flow_type_nexusreader_application_abstractions_messaging_iqueryhandler_cs_iqueryhandler_6[/"IQueryHandler"/]
    flow_type_nexusreader_application_abstractions_persistence_iebookrepository_cs_iebookrepository_9[/"IEbookRepository"/]
    flow_type_nexusreader_application_abstractions_services_ibillingservice_cs_ibillingservice_6[/"IBillingService"/]
    flow_type_nexusreader_application_abstractions_services_ibookstorageservice_cs_ibookstorageservice_6[/"IBookStorageService"/]
    flow_type_nexusreader_application_abstractions_services_iidentityservice_cs_iidentityservice_6[/"IIdentityService"/]
    flow_file_nexusreader_application_abstractions_messaging_icommand_cs_file_1 -->|interface ICommand| flow_type_nexusreader_application_abstractions_messaging_icommand_cs_icommand_6
    flow_file_nexusreader_application_abstractions_messaging_icommand_cs_file_1 -->|interface ICommand TResponse>| flow_type_nexusreader_application_abstractions_messaging_icommand_cs_icommand_tresponse_10
    flow_file_nexusreader_application_abstractions_messaging_icommandhandler_cs_file_1 -->|interface ICommandHandler TCommand>| flow_type_nexusreader_application_abstractions_messaging_icommandhandler_cs_icommandhandler_tcommand_6
    flow_file_nexusreader_application_abstractions_messaging_icommandhandler_cs_file_1 -->|interface ICommandHandler TCommand, TResponse>| flow_type_nexusreader_application_abstractions_messaging_icommandhandler_cs_icommandhandler_tcommand_tresponse_11
    flow_file_nexusreader_application_abstractions_messaging_iquery_cs_file_1 -->|interface IQuery TResponse>| flow_type_nexusreader_application_abstractions_messaging_iquery_cs_iquery_tresponse_6
    flow_file_nexusreader_application_abstractions_messaging_iqueryhandler_cs_file_1 -->|interface IQueryHandler| flow_type_nexusreader_application_abstractions_messaging_iqueryhandler_cs_iqueryhandler_6
    flow_file_nexusreader_application_abstractions_persistence_iebookrepository_cs_file_1 -->|interface IEbookRepository| flow_type_nexusreader_application_abstractions_persistence_iebookrepository_cs_iebookrepository_9
    flow_file_nexusreader_application_abstractions_services_ibillingservice_cs_file_1 -->|interface IBillingService| flow_type_nexusreader_application_abstractions_services_ibillingservice_cs_ibillingservice_6
    flow_file_nexusreader_application_abstractions_services_ibookstorageservice_cs_file_1 -->|interface IBookStorageService| flow_type_nexusreader_application_abstractions_services_ibookstorageservice_cs_ibookstorageservice_6
    flow_file_nexusreader_application_abstractions_services_iidentityservice_cs_file_1 -->|interface IIdentityService| flow_type_nexusreader_application_abstractions_services_iidentityservice_cs_iidentityservice_6
    flow_file_nexusreader_application_abstractions_services_iknowledgeservice_cs_file_1 -->|interface IKnowledgeService| flow_type_nexusreader_application_abstractions_services_iknowledgeservice_cs_iknowledge_6
    click flow_file_nexusreader_application_abstractions_messaging_iquery_cs_file_1 href "vscode://file/NexusReader.Application/Abstractions/Messaging/IQuery.cs:1:1" "Open source"
    click flow_type_nexusreader_application_abstractions_messaging_iquery_cs_iquery_tresponse_6 href "vscode://file/NexusReader.Application/Abstractions/Messaging/IQuery.cs:6:1" "Open source"
    click flow_file_nexusreader_application_abstractions_messaging_icommand_cs_file_1 href "vscode://file/NexusReader.Application/Abstractions/Messaging/ICommand.cs:1:1" "Open source"
    click flow_type_nexusreader_application_abstractions_messaging_icommand_cs_icommand_6 href "vscode://file/NexusReader.Application/Abstractions/Messaging/ICommand.cs:6:1" "Open source"
    click flow_type_nexusreader_application_abstractions_messaging_icommand_cs_icommand_tresponse_10 href "vscode://file/NexusReader.Application/Abstractions/Messaging/ICommand.cs:10:1" "Open source"
    click flow_file_nexusreader_application_abstractions_messaging_icommandhandler_cs_file_1 href "vscode://file/NexusReader.Application/Abstractions/Messaging/ICommandHandler.cs:1:1" "Open source"
    click flow_type_nexusreader_application_abstractions_messaging_icommandhandler_cs_icommandhandler_tcommand_6 href "vscode://file/NexusReader.Application/Abstractions/Messaging/ICommandHandler.cs:6:1" "Open source"
    click flow_type_nexusreader_application_abstractions_messaging_icommandhandler_cs_icommandhandler_tcommand_tresponse_11 href "vscode://file/NexusReader.Application/Abstractions/Messaging/ICommandHandler.cs:11:1" "Open source"
    click flow_file_nexusreader_application_abstractions_messaging_iqueryhandler_cs_file_1 href "vscode://file/NexusReader.Application/Abstractions/Messaging/IQueryHandler.cs:1:1" "Open source"
    click flow_type_nexusreader_application_abstractions_messaging_iqueryhandler_cs_iqueryhandler_6 href "vscode://file/NexusReader.Application/Abstractions/Messaging/IQueryHandler.cs:6:1" "Open source"
    click flow_file_nexusreader_infrastructure_identity_tokenlimithandler_cs_file_1 href "vscode://file/NexusReader.Infrastructure/Identity/TokenLimitHandler.cs:1:1" "Open source"
    click flow_file_nexusreader_application_abstractions_services_ibillingservice_cs_file_1 href "vscode://file/NexusReader.Application/Abstractions/Services/IBillingService.cs:1:1" "Open source"
    click flow_type_nexusreader_application_abstractions_services_ibillingservice_cs_ibillingservice_6 href "vscode://file/NexusReader.Application/Abstractions/Services/IBillingService.cs:6:1" "Open source"
    click flow_file_nexusreader_application_abstractions_persistence_iebookrepository_cs_file_1 href "vscode://file/NexusReader.Application/Abstractions/Persistence/IEbookRepository.cs:1:1" "Open source"
    click flow_type_nexusreader_application_abstractions_persistence_iebookrepository_cs_iebookrepository_9 href "vscode://file/NexusReader.Application/Abstractions/Persistence/IEbookRepository.cs:9:1" "Open source"
    click flow_file_nexusreader_application_abstractions_services_ibookstorageservice_cs_file_1 href "vscode://file/NexusReader.Application/Abstractions/Services/IBookStorageService.cs:1:1" "Open source"
    click flow_type_nexusreader_application_abstractions_services_ibookstorageservice_cs_ibookstorageservice_6 href "vscode://file/NexusReader.Application/Abstractions/Services/IBookStorageService.cs:6:1" "Open source"
    click flow_file_nexusreader_application_abstractions_services_iidentityservice_cs_file_1 href "vscode://file/NexusReader.Application/Abstractions/Services/IIdentityService.cs:1:1" "Open source"
    click flow_type_nexusreader_application_abstractions_services_iidentityservice_cs_iidentityservice_6 href "vscode://file/NexusReader.Application/Abstractions/Services/IIdentityService.cs:6:1" "Open source"
    click flow_file_nexusreader_application_abstractions_services_iknowledgeservice_cs_file_1 href "vscode://file/NexusReader.Application/Abstractions/Services/IKnowledgeService.cs:1:1" "Open source"

This diagram maps core application interfaces (commands, queries, services, repositories) and shows where infrastructure handlers (e.g., TokenLimitHandler) connect. It highlights ownership: Application contains abstractions, Infrastructure implements runtime concerns.

=== DIAGRAM 2: Startup and Service Registration Flow (primary-runtime) ===

---
config:
  flowchart:
    defaultRenderer: "elk"
---
flowchart TD
    subgraph flow_1_nexusreader_web_client_program_cs["Program.cs"]
    end
    flow_file_nexusreader_web_client_program_cs_file_1["Program.cs"]
    flow_method_nexusreader_web_client_nexusreader_web_client_csproj_project_configuration_1["project-configuration"]
    flow_method_nexusreader_web_client_program_cs_run_wasm_host_59["Run WASM Host"]
    flow_file_nexusreader_application_dependencyinjection_cs_file_1["DependencyInjection"]
    flow_file_nexusreader_application_mappings_mappingconfig_cs_file_1["MappingConfig"]
    flow_file_nexusreader_infrastructure_dependencyinjection_cs_file_1["DependencyInjection"]
    flow_file_nexusreader_web_client_nexusreader_web_client_csproj_file_1["NexusReader.Web.Client.csproj"]
    flow_type_nexusreader_application_dependencyinjection_cs_configured_via_addmapsterconfiguration_extension_10[/"configured via AddMapsterConfiguration extension"/]
    flow_type_nexusreader_application_dependencyinjection_cs_handlers_discovered_in_this_assembly_11[/"handlers discovered in this assembly"/]
    flow_type_nexusreader_application_mappings_mappingconfig_cs_servicemapper_20[/"ServiceMapper"/]
    flow_type_nexusreader_application_mappings_mappingconfig_cs_typeadapterconfig_instance_19[/"TypeAdapterConfig (instance)"/]
    flow_type_nexusreader_infrastructure_dependencyinjection_cs_appdbcontext_36[/"AppDbContext"/]
    flow_type_nexusreader_infrastructure_dependencyinjection_cs_appdbcontext_41[/"AppDbContext"/]
    flow_type_nexusreader_web_client_program_cs_configured_httpclient_40[/"configured HttpClient"/]
    flow_type_nexusreader_web_client_program_cs_n_a_55[/"N/A"/]
    flow_type_nexusreader_web_client_program_cs_nexusauthenticationstateprovider_33[/"NexusAuthenticationStateProvider"/]
    flow_type_nexusreader_web_client_program_cs_throwingdbcontextfactory_49[/"ThrowingDbContextFactory"/]
    flow_type_nexusreader_web_client_program_cs_wasmepubreader_56[/"WasmEpubReader"/]
    flow_type_nexusreader_web_client_program_cs_wasmknowledgeservice_38[/"WasmKnowledgeService"/]
    flow_type_nexusreader_web_client_program_cs_webplatformservice_18[/"WebPlatformService"/]
    flow_file_nexusreader_application_dependencyinjection_cs_file_1 -->|Mapster configuration / mapping profiles| flow_type_nexusreader_application_dependencyinjection_cs_configured_via_addmapsterconfiguration_extension_10
    flow_file_nexusreader_application_dependencyinjection_cs_file_1 -->|MediatR handlers from this assembly| flow_type_nexusreader_application_dependencyinjection_cs_handlers_discovered_in_this_assembly_11
    flow_file_nexusreader_application_mappings_mappingconfig_cs_file_1 -->|IMapper| flow_type_nexusreader_application_mappings_mappingconfig_cs_servicemapper_20
    flow_file_nexusreader_application_mappings_mappingconfig_cs_file_1 -->|TypeAdapterConfig| flow_type_nexusreader_application_mappings_mappingconfig_cs_typeadapterconfig_instance_19
    flow_file_nexusreader_infrastructure_dependencyinjection_cs_file_1 -->|AppDbContext DbContextFactory| flow_type_nexusreader_infrastructure_dependencyinjection_cs_appdbcontext_36
    flow_file_nexusreader_infrastructure_dependencyinjection_cs_file_1 -->|AppDbContext DbContext| flow_type_nexusreader_infrastructure_dependencyinjection_cs_appdbcontext_41
    flow_file_nexusreader_web_client_nexusreader_web_client_csproj_file_1 -->|unknown| flow_method_nexusreader_web_client_nexusreader_web_client_csproj_project_configuration_1
    flow_file_nexusreader_web_client_program_cs_file_1 -->|unknown| flow_method_nexusreader_web_client_program_cs_run_wasm_host_59
    flow_file_nexusreader_web_client_program_cs_file_1 -->|uses| flow_type_nexusreader_web_client_program_cs_configured_httpclient_40
    flow_file_nexusreader_web_client_program_cs_file_1 -->|application services via extension| flow_type_nexusreader_web_client_program_cs_n_a_55
    flow_file_nexusreader_web_client_program_cs_file_1 -->|NexusAuthenticationStateProvider| flow_type_nexusreader_web_client_program_cs_nexusauthenticationstateprovider_33
    flow_file_nexusreader_web_client_program_cs_file_1 -->|IDbContextFactory AppDbContext>| flow_type_nexusreader_web_client_program_cs_throwingdbcontextfactory_49
    flow_file_nexusreader_web_client_program_cs_file_1 -->|IEpubReader| flow_type_nexusreader_web_client_program_cs_wasmepubreader_56
    flow_file_nexusreader_web_client_program_cs_file_1 -->|IKnowledgeService| flow_type_nexusreader_web_client_program_cs_wasmknowledgeservice_38
    flow_file_nexusreader_web_client_program_cs_file_1 -->|IPlatformService| flow_type_nexusreader_web_client_program_cs_webplatformservice_18
    click flow_file_nexusreader_application_mappings_mappingconfig_cs_file_1 href "vscode://file/NexusReader.Application/Mappings/MappingConfig.cs:1:1" "Open source"
    click flow_type_nexusreader_application_mappings_mappingconfig_cs_typeadapterconfig_instance_19 href "vscode://file/NexusReader.Application/Mappings/MappingConfig.cs:19:1" "Open source"
    click flow_type_nexusreader_application_mappings_mappingconfig_cs_servicemapper_20 href "vscode://file/NexusReader.Application/Mappings/MappingConfig.cs:20:1" "Open source"
    click flow_file_nexusreader_web_client_program_cs_file_1 href "vscode://file/NexusReader.Web.Client/Program.cs:1:1" "Open source"
    click flow_type_nexusreader_web_client_program_cs_webplatformservice_18 href "vscode://file/NexusReader.Web.Client/Program.cs:18:1" "Open source"
    click flow_type_nexusreader_web_client_program_cs_nexusauthenticationstateprovider_33 href "vscode://file/NexusReader.Web.Client/Program.cs:33:1" "Open source"
    click flow_type_nexusreader_web_client_program_cs_wasmknowledgeservice_38 href "vscode://file/NexusReader.Web.Client/Program.cs:38:1" "Open source"
    click flow_type_nexusreader_web_client_program_cs_configured_httpclient_40 href "vscode://file/NexusReader.Web.Client/Program.cs:40:1" "Open source"
    click flow_type_nexusreader_web_client_program_cs_throwingdbcontextfactory_49 href "vscode://file/NexusReader.Web.Client/Program.cs:49:1" "Open source"
    click flow_type_nexusreader_web_client_program_cs_n_a_55 href "vscode://file/NexusReader.Web.Client/Program.cs:55:1" "Open source"
    click flow_type_nexusreader_web_client_program_cs_wasmepubreader_56 href "vscode://file/NexusReader.Web.Client/Program.cs:56:1" "Open source"
    click flow_method_nexusreader_web_client_program_cs_run_wasm_host_59 href "vscode://file/NexusReader.Web.Client/Program.cs:59:1" "Open source"
    click flow_file_nexusreader_web_client_nexusreader_web_client_csproj_file_1 href "vscode://file/NexusReader.Web.Client/NexusReader.Web.Client.csproj:1:1" "Open source"
    click flow_method_nexusreader_web_client_nexusreader_web_client_csproj_project_configuration_1 href "vscode://file/NexusReader.Web.Client/NexusReader.Web.Client.csproj:1:1" "Open source"
    click flow_file_nexusreader_application_dependencyinjection_cs_file_1 href "vscode://file/NexusReader.Application/DependencyInjection.cs:1:1" "Open source"
    click flow_type_nexusreader_application_dependencyinjection_cs_configured_via_addmapsterconfiguration_extension_10 href "vscode://file/NexusReader.Application/DependencyInjection.cs:10:1" "Open source"
    click flow_type_nexusreader_application_dependencyinjection_cs_handlers_discovered_in_this_assembly_11 href "vscode://file/NexusReader.Application/DependencyInjection.cs:11:1" "Open source"
    click flow_file_nexusreader_infrastructure_dependencyinjection_cs_file_1 href "vscode://file/NexusReader.Infrastructure/DependencyInjection.cs:1:1" "Open source"
    click flow_type_nexusreader_infrastructure_dependencyinjection_cs_appdbcontext_36 href "vscode://file/NexusReader.Infrastructure/DependencyInjection.cs:36:1" "Open source"
    click flow_type_nexusreader_infrastructure_dependencyinjection_cs_appdbcontext_41 href "vscode://file/NexusReader.Infrastructure/DependencyInjection.cs:41:1" "Open source"

This diagram details how Web.Client's Program.cs configures the WASM host: mapping profiles, MediatR handlers, AppDbContext factories and client-specific service substitutions (WasmKnowledgeService, WebPlatformService). It shows where Infrastructure and Application DI extensions are invoked.

=== DIAGRAM 3: Program.cs Flow (primary-runtime) ===

---
config:
  flowchart:
    defaultRenderer: "elk"
---
flowchart TD
    subgraph flow_1_nexusreader_web_client_program_cs["Program.cs"]
    end
    flow_file_nexusreader_application_abstractions_services_iknowledgeservice_cs_file_1["IKnowledgeService"]
    flow_file_nexusreader_application_abstractions_services_iplatformservice_cs_file_1["IPlatformService"]
    flow_file_nexusreader_web_client_program_cs_file_1["Program.cs"]
    flow_method_nexusreader_application_abstractions_services_iknowledgeservice_cs_askquestionasync_15["AskQuestionAsync"]
    flow_method_nexusreader_application_abstractions_services_iknowledgeservice_cs_verifygroundednessasync_13["VerifyGroundednessAsync"]
    flow_method_nexusreader_web_client_program_cs_findauthorbynameasync_88["FindAuthorByNameAsync"]
    flow_method_nexusreader_web_client_program_cs_getservice_71["GetService"]
    flow_method_nexusreader_web_client_program_cs_program_top_level_startup_15["Program (top-level startup)"]
    flow_method_nexusreader_web_client_program_cs_run_wasm_host_59["Run WASM Host"]
    flow_action_nexusreader_web_client_program_cs_findauthorbynameasync_repository_read_88_88["Reads repository or persistence state"]
    flow_type_nexusreader_application_abstractions_services_iknowledgeservice_cs_groundednessresult_19[/"GroundednessResult"/]
    flow_type_nexusreader_web_client_program_cs_configured_httpclient_40[/"configured HttpClient"/]
    flow_type_nexusreader_web_client_program_cs_n_a_55[/"N/A"/]
    flow_type_nexusreader_web_client_program_cs_nexusauthenticationstateprovider_33[/"NexusAuthenticationStateProvider"/]
    flow_type_nexusreader_web_client_program_cs_throwingbookstorageservice_74[/"ThrowingBookStorageService"/]
    flow_type_nexusreader_web_client_program_cs_throwingdbcontextfactory_49[/"ThrowingDbContextFactory"/]
    flow_type_nexusreader_web_client_program_cs_throwingdbcontextfactory_61[/"ThrowingDbContextFactory"/]
    flow_type_nexusreader_web_client_program_cs_throwingebookrepository_84[/"ThrowingEbookRepository"/]
    flow_type_nexusreader_web_client_program_cs_throwingembeddinggenerator_66[/"ThrowingEmbeddingGenerator"/]
    flow_type_nexusreader_web_client_program_cs_throwingsyncbroadcaster_94[/"ThrowingSyncBroadcaster"/]
    flow_type_nexusreader_web_client_program_cs_wasmepubreader_56[/"WasmEpubReader"/]
    flow_type_nexusreader_web_client_program_cs_wasmknowledgeservice_38[/"WasmKnowledgeService"/]
    flow_type_nexusreader_web_client_program_cs_webplatformservice_18[/"WebPlatformService"/]
    flow_action_nexusreader_web_client_program_cs_getservice_return_71_71(["returns null"])
    flow_file_nexusreader_application_abstractions_services_iknowledgeservice_cs_file_1 -->|dto GroundednessResult| flow_type_nexusreader_application_abstractions_services_iknowledgeservice_cs_groundednessresult_19
    flow_file_nexusreader_web_client_program_cs_file_1 -->|FindAuthorByNameAsync| flow_method_nexusreader_web_client_program_cs_findauthorbynameasync_88
    flow_file_nexusreader_web_client_program_cs_file_1 -->|GetService| flow_method_nexusreader_web_client_program_cs_getservice_71
    flow_file_nexusreader_web_client_program_cs_file_1 -->|Program top-level startup| flow_method_nexusreader_web_client_program_cs_program_top_level_startup_15
    flow_file_nexusreader_web_client_program_cs_file_1 -->|unknown| flow_method_nexusreader_web_client_program_cs_run_wasm_host_59
    flow_file_nexusreader_web_client_program_cs_file_1 -->|uses| flow_type_nexusreader_web_client_program_cs_configured_httpclient_40
    flow_file_nexusreader_web_client_program_cs_file_1 -->|application services via extension| flow_type_nexusreader_web_client_program_cs_n_a_55
    flow_file_nexusreader_web_client_program_cs_file_1 -->|NexusAuthenticationStateProvider| flow_type_nexusreader_web_client_program_cs_nexusauthenticationstateprovider_33
    flow_file_nexusreader_web_client_program_cs_file_1 -->|model ThrowingBookStorageService| flow_type_nexusreader_web_client_program_cs_throwingbookstorageservice_74
    flow_file_nexusreader_web_client_program_cs_file_1 -->|IDbContextFactory AppDbContext>| flow_type_nexusreader_web_client_program_cs_throwingdbcontextfactory_49
    flow_file_nexusreader_web_client_program_cs_file_1 -->|model ThrowingDbContextFactory| flow_type_nexusreader_web_client_program_cs_throwingdbcontextfactory_61
    flow_file_nexusreader_web_client_program_cs_file_1 -->|model ThrowingEbookRepository| flow_type_nexusreader_web_client_program_cs_throwingebookrepository_84
    flow_file_nexusreader_web_client_program_cs_file_1 -->|model ThrowingEmbeddingGenerator| flow_type_nexusreader_web_client_program_cs_throwingembeddinggenerator_66
    flow_file_nexusreader_web_client_program_cs_file_1 -->|model ThrowingSyncBroadcaster| flow_type_nexusreader_web_client_program_cs_throwingsyncbroadcaster_94
    flow_file_nexusreader_web_client_program_cs_file_1 -->|IEpubReader| flow_type_nexusreader_web_client_program_cs_wasmepubreader_56
    flow_file_nexusreader_web_client_program_cs_file_1 -->|IKnowledgeService| flow_type_nexusreader_web_client_program_cs_wasmknowledgeservice_38
    flow_file_nexusreader_web_client_program_cs_file_1 -->|IPlatformService| flow_type_nexusreader_web_client_program_cs_webplatformservice_18
    flow_method_nexusreader_web_client_program_cs_findauthorbynameasync_88 -->|Reads repository or persistence state| flow_action_nexusreader_web_client_program_cs_findauthorbynameasync_repository_read_88_88
    flow_method_nexusreader_web_client_program_cs_getservice_71 -->|returns null| flow_action_nexusreader_web_client_program_cs_getservice_return_71_71
    click flow_file_nexusreader_application_abstractions_services_iknowledgeservice_cs_file_1 href "vscode://file/NexusReader.Application/Abstractions/Services/IKnowledgeService.cs:1:1" "Open source"
    click flow_type_nexusreader_application_abstractions_services_iknowledgeservice_cs_groundednessresult_19 href "vscode://file/NexusReader.Application/Abstractions/Services/IKnowledgeService.cs:19:1" "Open source"
    click flow_method_nexusreader_application_abstractions_services_iknowledgeservice_cs_verifygroundednessasync_13 href "vscode://file/NexusReader.Application/Abstractions/Services/IKnowledgeService.cs:13:1" "Open source"
    click flow_file_nexusreader_application_abstractions_services_iplatformservice_cs_file_1 href "vscode://file/NexusReader.Application/Abstractions/Services/IPlatformService.cs:1:1" "Open source"
    click flow_method_nexusreader_application_abstractions_services_iknowledgeservice_cs_askquestionasync_15 href "vscode://file/NexusReader.Application/Abstractions/Services/IKnowledgeService.cs:15:1" "Open source"
    click flow_file_nexusreader_web_client_program_cs_file_1 href "vscode://file/NexusReader.Web.Client/Program.cs:1:1" "Open source"
    click flow_method_nexusreader_web_client_program_cs_program_top_level_startup_15 href "vscode://file/NexusReader.Web.Client/Program.cs:15:1" "Open source"
    click flow_method_nexusreader_web_client_program_cs_getservice_71 href "vscode://file/NexusReader.Web.Client/Program.cs:71:1" "Open source"
    click flow_action_nexusreader_web_client_program_cs_getservice_return_71_71 href "vscode://file/NexusReader.Web.Client/Program.cs:71:1" "Open source"
    click flow_method_nexusreader_web_client_program_cs_findauthorbynameasync_88 href "vscode://file/NexusReader.Web.Client/Program.cs:88:1" "Open source"
    click flow_action_nexusreader_web_client_program_cs_findauthorbynameasync_repository_read_88_88 href "vscode://file/NexusReader.Web.Client/Program.cs:88:1" "Open source"
    click flow_type_nexusreader_web_client_program_cs_throwingdbcontextfactory_61 href "vscode://file/NexusReader.Web.Client/Program.cs:61:1" "Open source"
    click flow_type_nexusreader_web_client_program_cs_throwingembeddinggenerator_66 href "vscode://file/NexusReader.Web.Client/Program.cs:66:1" "Open source"
    click flow_type_nexusreader_web_client_program_cs_throwingbookstorageservice_74 href "vscode://file/NexusReader.Web.Client/Program.cs:74:1" "Open source"
    click flow_type_nexusreader_web_client_program_cs_throwingebookrepository_84 href "vscode://file/NexusReader.Web.Client/Program.cs:84:1" "Open source"
    click flow_type_nexusreader_web_client_program_cs_throwingsyncbroadcaster_94 href "vscode://file/NexusReader.Web.Client/Program.cs:94:1" "Open source"
    click flow_type_nexusreader_web_client_program_cs_webplatformservice_18 href "vscode://file/NexusReader.Web.Client/Program.cs:18:1" "Open source"
    click flow_type_nexusreader_web_client_program_cs_nexusauthenticationstateprovider_33 href "vscode://file/NexusReader.Web.Client/Program.cs:33:1" "Open source"
    click flow_type_nexusreader_web_client_program_cs_wasmknowledgeservice_38 href "vscode://file/NexusReader.Web.Client/Program.cs:38:1" "Open source"
    click flow_type_nexusreader_web_client_program_cs_configured_httpclient_40 href "vscode://file/NexusReader.Web.Client/Program.cs:40:1" "Open source"
    click flow_type_nexusreader_web_client_program_cs_throwingdbcontextfactory_49 href "vscode://file/NexusReader.Web.Client/Program.cs:49:1" "Open source"
    click flow_type_nexusreader_web_client_program_cs_n_a_55 href "vscode://file/NexusReader.Web.Client/Program.cs:55:1" "Open source"
    click flow_type_nexusreader_web_client_program_cs_wasmepubreader_56 href "vscode://file/NexusReader.Web.Client/Program.cs:56:1" "Open source"
    click flow_method_nexusreader_web_client_program_cs_run_wasm_host_59 href "vscode://file/NexusReader.Web.Client/Program.cs:59:1" "Open source"

This flow emphasizes Program.cs usage: which services are resolved on the WASM client, which are replaced by throwing stubs or Wasm-specific implementations, and how client startup triggers queries/commands.

=== DIAGRAM 4: Program.cs Execution Control Flow (control-flow) ===

flowchart TD
    subgraph NexusReader_Application_Abstractions_Services_IKnowledgeService["IKnowledgeService"]
    end
    subgraph NexusReader_Application_Abstractions_Services_IPlatformService["IPlatformService"]
    end
    subgraph NexusReader_Web_Client_Program["Program"]
    end
    flow_file_nexusreader_application_abstractions_services_iplatformservice_cs_file_1["IPlatformService"]
    flow_file_nexusreader_web_client_program_cs_file_1["Program.cs"]
    flow_method_nexusreader_application_abstractions_services_iknowledgeservice_cs_askquestionasync_15["AskQuestionAsync"]
    flow_method_nexusreader_application_abstractions_services_iknowledgeservice_cs_verifygroundednessasync_13["VerifyGroundednessAsync"]
    flow_method_nexusreader_application_abstractions_services_iplatformservice_cs_getdevicecontext_10["GetDeviceContext"]
    flow_method_nexusreader_application_abstractions_services_iplatformservice_cs_vibrateasync_9["VibrateAsync"]
    flow_method_nexusreader_application_abstractions_services_iplatformservice_cs_vibrateerrorasync_8["VibrateErrorAsync"]
    flow_method_nexusreader_application_abstractions_services_iplatformservice_cs_vibratesuccessasync_7["VibrateSuccessAsync"]
    flow_method_nexusreader_web_client_program_cs_findauthorbynameasync_88["FindAuthorByNameAsync"]
    flow_method_nexusreader_web_client_program_cs_getservice_71["GetService"]
    flow_method_nexusreader_web_client_program_cs_program_top_level_startup_15["Program (top-level startup)"]
    flow_method_nexusreader_web_client_program_cs_run_wasm_host_59["Run WASM Host"]
    flow_action_nexusreader_web_client_program_cs_findauthorbynameasync_repository_read_88_88["Reads repository or persistence state"]
    flow_action_nexusreader_application_commands_ai_verifygroundednesscommand_cs_handle_return_20_20(["Returns result"])
    flow_action_nexusreader_application_queries_library_asklibraryquestionquery_cs_handle_return_30_30(["Returns result"])
    flow_file_nexusreader_application_abstractions_services_iplatformservice_cs_file_1 -->|GetDeviceContext| flow_method_nexusreader_application_abstractions_services_iplatformservice_cs_getdevicecontext_10
    flow_file_nexusreader_application_abstractions_services_iplatformservice_cs_file_1 -->|VibrateAsync| flow_method_nexusreader_application_abstractions_services_iplatformservice_cs_vibrateasync_9
    flow_file_nexusreader_application_abstractions_services_iplatformservice_cs_file_1 -->|VibrateErrorAsync| flow_method_nexusreader_application_abstractions_services_iplatformservice_cs_vibrateerrorasync_8
    flow_file_nexusreader_application_abstractions_services_iplatformservice_cs_file_1 -->|VibrateSuccessAsync| flow_method_nexusreader_application_abstractions_services_iplatformservice_cs_vibratesuccessasync_7
    flow_method_nexusreader_web_client_program_cs_findauthorbynameasync_88 -->|Reads repository or persistence state| flow_action_nexusreader_web_client_program_cs_findauthorbynameasync_repository_read_88_88
    flow_method_nexusreader_web_client_program_cs_getservice_71 -->|returns null| flow_action_nexusreader_web_client_program_cs_getservice_return_71_71
    click flow_action_nexusreader_application_commands_ai_verifygroundednesscommand_cs_handle_return_20_20 href "vscode://file/NexusReader.Application/Commands/AI/VerifyGroundednessCommand.cs:20:1" "Open source"
    click flow_method_nexusreader_application_abstractions_services_iknowledgeservice_cs_verifygroundednessasync_13 href "vscode://file/NexusReader.Application/Abstractions/Services/IKnowledgeService.cs:13:1" "Open source"
    click flow_file_nexusreader_application_abstractions_services_iplatformservice_cs_file_1 href "vscode://file/NexusReader.Application/Abstractions/Services/IPlatformService.cs:1:1" "Open source"
    click flow_method_nexusreader_application_abstractions_services_iplatformservice_cs_vibratesuccessasync_7 href "vscode://file/NexusReader.Application/Abstractions/Services/IPlatformService.cs:7:1" "Open source"
    click flow_method_nexusreader_application_abstractions_services_iplatformservice_cs_vibrateerrorasync_8 href "vscode://file/NexusReader.Application/Abstractions/Services/IPlatformService.cs:8:1" "Open source"
    click flow_method_nexusreader_application_abstractions_services_iplatformservice_cs_vibrateasync_9 href "vscode://file/NexusReader.Application/Abstractions/Services/IPlatformService.cs:9:1" "Open source"
    click flow_method_nexusreader_application_queries_library_asklibraryquestionquery_cs_handle_return_30_30 href "vscode://file/NexusReader.Application/Queries/Library/AskLibraryQuestionQuery.cs:30:1" "Open source"
    click flow_method_nexusreader_application_abstractions_services_iknowledgeservice_cs_askquestionasync_15 href "vscode://file/NexusReader.Application/Abstractions/Services/IKnowledgeService.cs:15:1" "Open source"
    click flow_file_nexusreader_web_client_program_cs_file_1 href "vscode://file/NexusReader.Web.Client/Program.cs:1:1" "Open source"
    click flow_method_nexusreader_web_client_program_cs_program_top_level_startup_15 href "vscode://file/NexusReader.Web.Client/Program.cs:15:1" "Open source"
    click flow_method_nexusreader_web_client_program_cs_getservice_71 href "vscode://file/NexusReader.Web.Client/Program.cs:71:1" "Open source"
    click flow_action_nexusreader_web_client_program_cs_getservice_return_71_71 href "vscode://file/NexusReader.Web.Client/Program.cs:71:1" "Open source"
    click flow_method_nexusreader_web_client_program_cs_findauthorbynameasync_88 href "vscode://file/NexusReader.Web.Client/Program.cs:88:1" "Open source"
    click flow_action_nexusreader_web_client_program_cs_findauthorbynameasync_repository_read_88_88 href "vscode://file/NexusReader.Web.Client/Program.cs:88:1" "Open source"
    click flow_method_nexusreader_web_client_program_cs_run_wasm_host_59 href "vscode://file/NexusReader.Web.Client/Program.cs:59:1" "Open source"

This control-flow diagram traces runtime calls through Program into application commands/queries and platform service calls (e.g., vibration). It illustrates which runtime entrypoints trigger domain/application logic.

=== DIAGRAM 5: Program.cs Contracts and Entities (class-diagram) ===

classDiagram
    class flow_file_nexusreader_application_abstractions_services_iknowledgeservice_cs_file_1["IKnowledgeService"]
    class flow_file_nexusreader_application_abstractions_services_iplatformservice_cs_file_1["IPlatformService"]
    class flow_file_nexusreader_web_client_program_cs_file_1["Program.cs"]
    class flow_type_nexusreader_application_abstractions_services_iknowledgeservice_cs_groundednessresult_19["GroundednessResult"]
    class flow_type_nexusreader_application_abstractions_services_iplatformservice_cs_devicecontext_13["DeviceContext"]
    class flow_type_nexusreader_application_abstractions_services_iplatformservice_cs_devicetype_20["DeviceType"]
    class flow_type_nexusreader_application_abstractions_services_iplatformservice_cs_displayorientation_28["DisplayOrientation"]
    class flow_type_nexusreader_web_client_program_cs_configured_httpclient_40["configured HttpClient"]
    class flow_type_nexusreader_web_client_program_cs_n_a_55["N/A"]
    class flow_type_nexusreader_web_client_program_cs_nexusauthenticationstateprovider_33["NexusAuthenticationStateProvider"]
    class flow_type_nexusreader_web_client_program_cs_throwingbookstorageservice_74["ThrowingBookStorageService"]
    class flow_type_nexusreader_web_client_program_cs_throwingdbcontextfactory_49["ThrowingDbContextFactory"]
    class flow_type_nexusreader_web_client_program_cs_throwingdbcontextfactory_61["ThrowingDbContextFactory"]
    class flow_type_nexusreader_web_client_program_cs_throwingebookrepository_84["ThrowingEbookRepository"]
    class flow_type_nexusreader_web_client_program_cs_throwingembeddinggenerator_66["ThrowingEmbeddingGenerator"]
    class flow_type_nexusreader_web_client_program_cs_throwingsyncbroadcaster_94["ThrowingSyncBroadcaster"]
    class flow_type_nexusreader_web_client_program_cs_wasmepubreader_56["WasmEpubReader"]
    class flow_type_nexusreader_web_client_program_cs_wasmknowledgeservice_38["WasmKnowledgeService"]
    class flow_type_nexusreader_web_client_program_cs_webplatformservice_18["WebPlatformService"]
    flow_file_nexusreader_application_abstractions_services_iknowledgeservice_cs_file_1 --> flow_type_nexusreader_application_abstractions_services_iknowledgeservice_cs_groundednessresult_19 : dto GroundednessResult
    flow_file_nexusreader_application_abstractions_services_iplatformservice_cs_file_1 --> flow_type_nexusreader_application_abstractions_services_iplatformservice_cs_devicecontext_13 : dto DeviceContext
    flow_file_nexusreader_application_abstractions_services_iplatformservice_cs_file_1 --> flow_type_nexusreader_application_abstractions_services_iplatformservice_cs_devicetype_20 : enum DeviceType
    flow_file_nexusreader_application_abstractions_services_iplatformservice_cs_file_1 --> flow_type_nexusreader_application_abstractions_services_iplatformservice_cs_displayorientation_28 : enum DisplayOrientation
    flow_file_nexusreader_web_client_program_cs_file_1 --> flow_type_nexusreader_web_client_program_cs_throwingbookstorageservice_74 : model ThrowingBookStorageService
    flow_file_nexusreader_web_client_program_cs_file_1 --> flow_type_nexusreader_web_client_program_cs_throwingdbcontextfactory_61 : model ThrowingDbContextFactory
    flow_file_nexusreader_web_client_program_cs_file_1 --> flow_type_nexusreader_web_client_program_cs_throwingebookrepository_84 : model ThrowingEbookRepository
    flow_file_nexusreader_web_client_program_cs_file_1 --> flow_type_nexusreader_web_client_program_cs_throwingembeddinggenerator_66 : model ThrowingEmbeddingGenerator
    flow_file_nexusreader_web_client_program_cs_file_1 --> flow_type_nexusreader_web_client_program_cs_throwingsyncbroadcaster_94 : model ThrowingSyncBroadcaster
    click flow_file_nexusreader_application_abstractions_services_iknowledgeservice_cs_file_1 href "vscode://file/NexusReader.Application/Abstractions/Services/IKnowledgeService.cs:1:1" "Open source"
    click flow_type_nexusreader_application_abstractions_services_iknowledgeservice_cs_groundednessresult_19 href "vscode://file/NexusReader.Application/Abstractions/Services/IKnowledgeService.cs:19:1" "Open source"
    click flow_file_nexusreader_application_abstractions_services_iplatformservice_cs_file_1 href "vscode://file/NexusReader.Application/Abstractions/Services/IPlatformService.cs:1:1" "Open source"
    click flow_type_nexusreader_application_abstractions_services_iplatformservice_cs_devicecontext_13 href "vscode://file/NexusReader.Application/Abstractions/Services/IPlatformService.cs:13:1" "Open source"
    click flow_type_nexusreader_application_abstractions_services_iplatformservice_cs_devicetype_20 href "vscode://file/NexusReader.Application/Abstractions/Services/IPlatformService.cs:20:1" "Open source"
    click flow_type_nexusreader_application_abstractions_services_iplatformservice_cs_displayorientation_28 href "vscode://file/NexusReader.Application/Abstractions/Services/IPlatformService.cs:28:1" "Open source"
    click flow_file_nexusreader_web_client_program_cs_file_1 href "vscode://file/NexusReader.Web.Client/Program.cs:1:1" "Open source"
    click flow_type_nexusreader_web_client_program_cs_throwingdbcontextfactory_61 href "vscode://file/NexusReader.Web.Client/Program.cs:61:1" "Open source"
    click flow_type_nexusreader_web_client_program_cs_throwingembeddinggenerator_66 href "vscode://file/NexusReader.Web.Client/Program.cs:66:1" "Open source"
    click flow_type_nexusreader_web_client_program_cs_throwingbookstorageservice_74 href "vscode://file/NexusReader.Web.Client/Program.cs:74:1" "Open source"
    click flow_type_nexusreader_web_client_program_cs_throwingebookrepository_84 href "vscode://file/NexusReader.Web.Client/Program.cs:84:1" "Open source"
    click flow_type_nexusreader_web_client_program_cs_throwingsyncbroadcaster_94 href "vscode://file/NexusReader.Web.Client/Program.cs:94:1" "Open source"
    click flow_type_nexusreader_web_client_program_cs_webplatformservice_18 href "vscode://file/NexusReader.Web.Client/Program.cs:18:1" "Open source"
    click flow_type_nexusreader_web_client_program_cs_nexusauthenticationstateprovider_33 href "vscode://file/NexusReader.Web.Client/Program.cs:33:1" "Open source"
    click flow_type_nexusreader_web_client_program_cs_wasmknowledgeservice_38 href "vscode://file/NexusReader.Web.Client/Program.cs:38:1" "Open source"
    click flow_type_nexusreader_web_client_program_cs_configured_httpclient_40 href "vscode://file/NexusReader.Web.Client/Program.cs:40:1" "Open source"
    click flow_type_nexusreader_web_client_program_cs_throwingdbcontextfactory_49 href "vscode://file/NexusReader.Web.Client/Program.cs:49:1" "Open source"
    click flow_type_nexusreader_web_client_program_cs_n_a_55 href "vscode://file/NexusReader.Web.Client/Program.cs:55:1" "Open source"
    click flow_type_nexusreader_web_client_program_cs_wasmepubreader_56 href "vscode://file/NexusReader.Web.Client/Program.cs:56:1" "Open source"

This class diagram identifies DTOs and platform enums owned by Application abstractions and client-side runtime models substituted in Web.Client. It clarifies contract ownership vs concrete client models.

=== DIAGRAM 6: Program.cs Layer View (dependency-map) ===

---
config:
  flowchart:
    defaultRenderer: "elk"
---
flowchart LR
    subgraph layer_application["application"]
        flow_file_nexusreader_application_abstractions_services_iknowledgeservice_cs_file_1["IKnowledgeService"]
        flow_file_nexusreader_application_abstractions_services_iplatformservice_cs_file_1["IPlatformService"]
        flow_method_nexusreader_application_abstractions_services_iknowledgeservice_cs_askquestionasync_15["AskQuestionAsync"]
        flow_method_nexusreader_application_abstractions_services_iknowledgeservice_cs_verifygroundednessasync_13["VerifyGroundednessAsync"]
        flow_type_nexusreader_application_abstractions_services_iknowledgeservice_cs_groundednessresult_19[/"GroundednessResult"/]
        flow_file_nexusreader_application_abstractions_services_iknowledgeservice_cs_file_1 -->|dto GroundednessResult| flow_type_nexusreader_application_abstractions_services_iknowledgeservice_cs_groundednessresult_19
    end
    subgraph layer_frontend["frontend"]
        flow_file_nexusreader_web_client_program_cs_file_1["Program.cs"]
        flow_action_nexusreader_web_client_program_cs_findauthorbynameasync_repository_read_88_88["Reads repository or persistence state"]
        flow_type_nexusreader_web_client_program_cs_configured_httpclient_40[/"configured HttpClient"/]
        flow_type_nexusreader_web_client_program_cs_nexusauthenticationstateprovider_33[/"NexusAuthenticationStateProvider"/]
        flow_type_nexusreader_web_client_program_cs_throwingbookstorageservice_74[/"ThrowingBookStorageService"/]
        flow_type_nexusreader_web_client_program_cs_throwingdbcontextfactory_49[/"ThrowingDbContextFactory"/]
        flow_type_nexusreader_web_client_program_cs_throwingdbcontextfactory_61[/"ThrowingDbContextFactory"/]
        flow_type_nexusreader_web_client_program_cs_throwingebookrepository_84[/"ThrowingEbookRepository"/]
        flow_type_nexusreader_web_client_program_cs_throwingembeddinggenerator_66[/"ThrowingEmbeddingGenerator"/]
        flow_type_nexusreader_web_client_program_cs_throwingsyncbroadcaster_94[/"ThrowingSyncBroadcaster"/]
        flow_type_nexusreader_web_client_program_cs_wasmknowledgeservice_38[/"WasmKnowledgeService"/]
        flow_type_nexusreader_web_client_program_cs_webplatformservice_18[/"WebPlatformService"/]
        flow_action_nexusreader_web_client_program_cs_getservice_return_71_71(["returns null"])
        flow_file_nexusreader_web_client_program_cs_file_1 -->|uses| flow_type_nexusreader_web_client_program_cs_configured_httpclient_40
        flow_file_nexusreader_web_client_program_cs_file_1 -->|NexusAuthenticationStateProvider| flow_type_nexusreader_web_client_program_cs_nexusauthenticationstateprovider_33
        flow_file_nexusreader_web_client_program_cs_file_1 -->|model ThrowingBookStorageService| flow_type_nexusreader_web_client_program_cs_throwingbookstorageservice_74
        flow_file_nexusreader_web_client_program_cs_file_1 -->|IDbContextFactory AppDbContext>| flow_type_nexusreader_web_client_program_cs_throwingdbcontextfactory_49
        flow_file_nexusreader_web_client_program_cs_file_1 -->|model ThrowingDbContextFactory| flow_type_nexusreader_web_client_program_cs_throwingdbcontextfactory_61
        flow_file_nexusreader_web_client_program_cs_file_1 -->|model ThrowingEbookRepository| flow_type_nexusreader_web_client_program_cs_throwingebookrepository_84
        flow_file_nexusreader_web_client_program_cs_file_1 -->|model ThrowingEmbeddingGenerator| flow_type_nexusreader_web_client_program_cs_throwingembeddinggenerator_66
        flow_file_nexusreader_web_client_program_cs_file_1 -->|model ThrowingSyncBroadcaster| flow_type_nexusreader_web_client_program_cs_throwingsyncbroadcaster_94
        flow_file_nexusreader_web_client_program_cs_file_1 -->|IKnowledgeService| flow_type_nexusreader_web_client_program_cs_wasmknowledgeservice_38
        flow_file_nexusreader_web_client_program_cs_file_1 -->|IPlatformService| flow_type_nexusreader_web_client_program_cs_webplatformservice_18
    end
    click flow_file_nexusreader_application_abstractions_services_iknowledgeservice_cs_file_1 href "vscode://file/NexusReader.Application/Abstractions/Services/IKnowledgeService.cs:1:1" "Open source"
    click flow_type_nexusreader_application_abstractions_services_iknowledgeservice_cs_groundednessresult_19 href "vscode://file/NexusReader.Application/Abstractions/Services/IKnowledgeService.cs:19:1" "Open source"
    click flow_method_nexusreader_application_abstractions_services_iknowledgeservice_cs_verifygroundednessasync_13 href "vscode://file/NexusReader.Application/Abstractions/Services/IKnowledgeService.cs:13:1" "Open source"
    click flow_file_nexusreader_application_abstractions_services_iplatformservice_cs_file_1 href "vscode://file/NexusReader.Application/Abstractions/Services/IPlatformService.cs:1:1" "Open source"
    click flow_method_nexusreader_application_abstractions_services_iknowledgeservice_cs_askquestionasync_15 href "vscode://file/NexusReader.Application/Abstractions/Services/IKnowledgeService.cs:15:1" "Open source"
    click flow_file_nexusreader_web_client_program_cs_file_1 href "vscode://file/NexusReader.Web.Client/Program.cs:1:1" "Open source"
    click flow_action_nexusreader_web_client_program_cs_getservice_return_71_71 href "vscode://file/NexusReader.Web.Client/Program.cs:71:1" "Open source"
    click flow_action_nexusreader_web_client_program_cs_findauthorbynameasync_repository_read_88_88 href "vscode://file/NexusReader.Web.Client/Program.cs:88:1" "Open source"
    click flow_type_nexusreader_web_client_program_cs_throwingdbcontextfactory_61 href "vscode://file/NexusReader.Web.Client/Program.cs:61:1" "Open source"
    click flow_type_nexusreader_web_client_program_cs_throwingembeddinggenerator_66 href "vscode://file/NexusReader.Web.Client/Program.cs:66:1" "Open source"
    click flow_type_nexusreader_web_client_program_cs_throwingbookstorageservice_74 href "vscode://file/NexusReader.Web.Client/Program.cs:74:1" "Open source"
    click flow_type_nexusreader_web_client_program_cs_throwingebookrepository_84 href "vscode://file/NexusReader.Web.Client/Program.cs:84:1" "Open source"
    click flow_type_nexusreader_web_client_program_cs_throwingsyncbroadcaster_94 href "vscode://file/NexusReader.Web.Client/Program.cs:94:1" "Open source"
    click flow_type_nexusreader_web_client_program_cs_webplatformservice_18 href "vscode://file/NexusReader.Web.Client/Program.cs:18:1" "Open source"
    click flow_type_nexusreader_web_client_program_cs_nexusauthenticationstateprovider_33 href "vscode://file/NexusReader.Web.Client/Program.cs:33:1" "Open source"
    click flow_type_nexusreader_web_client_program_cs_wasmknowledgeservice_38 href "vscode://file/NexusReader.Web.Client/Program.cs:38:1" "Open source"
    click flow_type_nexusreader_web_client_program_cs_configured_httpclient_40 href "vscode://file/NexusReader.Web.Client/Program.cs:40:1" "Open source"
    click flow_type_nexusreader_web_client_program_cs_throwingdbcontextfactory_49 href "vscode://file/NexusReader.Web.Client/Program.cs:49:1" "Open source"

Layer view clarifies boundaries: Application owns domain contracts and DTOs; frontend owns runtime wiring and substitutes server-only implementations with client-safe stubs or WASM-specific services.

=== DIAGRAM 7: Method Flow Details (method-flow) ===

flowchart TD
    subgraph NexusReader_Infrastructure_Helpers_ContentHasher["ContentHasher"]
    end
    subgraph NexusReader_Infrastructure_Helpers_JsonRepairHelper["JsonRepairHelper"]
    end
    subgraph NexusReader_Infrastructure_RealTime_SyncHub["SyncHub"]
    end
    flow_file_nexusreader_infrastructure_helpers_contenthasher_cs_file_1["ContentHasher"]
    flow_file_nexusreader_infrastructure_helpers_jsonrepairhelper_cs_file_1["JsonRepairHelper"]
    flow_method_nexusreader_infrastructure_helpers_contenthasher_cs_computehash_9["ComputeHash"]
    flow_method_nexusreader_infrastructure_helpers_jsonrepairhelper_cs_repair_8["Repair"]
    flow_method_nexusreader_infrastructure_realtime_synchub_cs_onconnectedasync_28["OnConnectedAsync"]
    flow_method_nexusreader_infrastructure_realtime_synchub_cs_ondisconnectedasync_38["OnDisconnectedAsync"]
    flow_method_nexusreader_infrastructure_realtime_synchub_cs_synchub_14["SyncHub"]
    flow_method_nexusreader_infrastructure_realtime_synchub_cs_updateprogress_19["UpdateProgress"]
    flow_action_nexusreader_infrastructure_helpers_contenthasher_cs_computehash_branch_11_11{"Evaluates branch condition"}
    flow_action_nexusreader_infrastructure_helpers_jsonrepairhelper_cs_repair_guard_clause_10_10{"Guards early exit or rejection path"}
    flow_action_nexusreader_

This method-flow highlights Infrastructure helpers and the real-time SyncHub lifecycle (connect, disconnect, progress updates) plus utility flows (content hashing, JSON repair). It shows who owns runtime behaviours for syncing and data integrity.

Key Files

  • NexusReader.Web/Program.cs (server entry)
  • NexusReader.Web.Client/Program.cs (WASM entry)
  • NexusReader.Maui/Program.cs (MAUI entry)
  • NexusReader.Application/DependencyInjection.cs
  • NexusReader.Infrastructure/DependencyInjection.cs
  • NexusReader.Application/Abstractions/Services/IKnowledgeService.cs
  • NexusReader.Infrastructure/RealTime/SyncHub.cs
  • NexusReader.Application/Mappings/MappingConfig.cs
<script type="application/json" data-ai-mermaid-metadata="0" data-ai-mermaid-diagram-id="dependency_map_graph">{"edges":[{"id":"edge_flow_file_nexusreader_application_abstractions_messaging_iquery_cs_file_1_flow_type_nexusreader_application_abstractions_messaging_iquery_cs_iquery_tresponse_6_defines_type_6","from":"flow_file_nexusreader_application_abstractions_messaging_iquery_cs_file_1","to":"flow_type_nexusreader_application_abstractions_messaging_iquery_cs_iquery_tresponse_6","relation":"transforms","semanticLabel":"interface IQuery","payload":{"outputSummary":"Marker interface representing a CQRS query that returns a Result-wrapped TResponse via MediatR.","expandedLabel":"defines-type"}},{"id":"edge_flow_file_nexusreader_application_abstractions_messaging_icommand_cs_file_1_flow_type_nexusreader_application_abstractions_messaging_icommand_cs_icommand_6_defines_type_6","from":"flow_file_nexusreader_application_abstractions_messaging_icommand_cs_file_1","to":"flow_type_nexusreader_application_abstractions_messaging_icommand_cs_icommand_6","relation":"transforms","semanticLabel":"interface ICommand","payload":{"outputSummary":"Marker/contract for a command that produces a FluentResults.Result when handled via MediatR.","expandedLabel":"defines-type"}},{"id":"edge_flow_file_nexusreader_application_abstractions_messaging_icommand_cs_file_1_flow_type_nexusreader_application_abstractions_messaging_icommand_cs_icommand_tresponse_10_defines_type_10","from":"flow_file_nexusreader_application_abstractions_messaging_icommand_cs_file_1","to":"flow_type_nexusreader_application_abstractions_messaging_icommand_cs_icommand_tresponse_10","relation":"transforms","semanticLabel":"interface ICommand","payload":{"outputSummary":"Generic command contract that produces a FluentResults.Result when handled via MediatR.","expandedLabel":"defines-type"}},{"id":"edge_flow_file_nexusreader_application_abstractions_messaging_icommandhandler_cs_file_1_flow_type_nexusreader_application_abstractions_messaging_icommandhandler_cs_icommandhandler_tcommand_6_defines_type_6","from":"flow_file_nexusreader_application_abstractions_messaging_icommandhandler_cs_file_1","to":"flow_type_nexusreader_application_abstractions_messaging_icommandhandler_cs_icommandhandler_tcommand_6","relation":"transforms","semanticLabel":"interface ICommandHandler","payload":{"outputSummary":"Represents a command handler that processes a command and returns a FluentResults.Result (no data).","expandedLabel":"defines-type"}},{"id":"edge_flow_file_nexusreader_application_abstractions_messaging_icommandhandler_cs_file_1_flow_type_nexusreader_application_abstractions_messaging_icommandhandler_cs_icommandhandler_tcommand_tresponse_11_defines_type_11","from":"flow_file_nexusreader_application_abstractions_messaging_icommandhandler_cs_file_1","to":"flow_type_nexusreader_application_abstractions_messaging_icommandhandler_cs_icommandhandler_tcommand_tresponse_11","relation":"transforms","semanticLabel":"interface ICommandHandler","payload":{"outputSummary":"Represents a command handler that processes a command and returns a FluentResults.Result with a typed response.","expandedLabel":"defines-type"}},{"id":"edge_flow_file_nexusreader_application_abstractions_messaging_iqueryhandler_cs_file_1_flow_type_nexusreader_application_abstractions_messaging_iqueryhandler_cs_iqueryhandler_6_defines_type_6","from":"flow_file_nexusreader_application_abstractions_messaging_iqueryhandler_cs_file_1","to":"flow_type_nexusreader_application_abstractions_messaging_iqueryhandler_cs_iqueryhandler_6","relation":"transforms","semanticLabel":"interface IQueryHandler","payload":{"outputSummary":"Generic abstraction for query handlers that process TQuery and return Result via MediatR.","expandedLabel":"defines-type"}},{"id":"edge_flow_file_nexusreader_application_abstractions_services_ibillingservice_cs_file_1_flow_type_nexusreader_application_abstractions_services_ibillingservice_cs_ibillingservice_6_defines_type_6","from":"flow_file_nexusreader_application_abstractions_services_ibillingservice_cs_file_1","to":"flow_type_nexusreader_application_abstractions_services_ibillingservice_cs_ibillingservice_6","relation":"transforms","semanticLabel":"interface IBillingService","payload":{"outputSummary":"Service contract for handling billing/subscription lifecycle events (update/delete).","expandedLabel":"defines-type"}},{"id":"edge_flow_file_nexusreader_application_abstractions_persistence_iebookrepository_cs_file_1_flow_type_nexusreader_application_abstractions_persistence_iebookrepository_cs_iebookrepository_9_defines_type_9","from":"flow_file_nexusreader_application_abstractions_persistence_iebookrepository_cs_file_1","to":"flow_type_nexusreader_application_abstractions_persistence_iebookrepository_cs_iebookrepository_9","relation":"transforms","semanticLabel":"interface IEbookRepository","payload":{"outputSummary":"Application-layer persistence abstraction for Authors and Ebooks to avoid direct EF Core dependency.","expandedLabel":"defines-type"}},{"id":"edge_flow_file_nexusreader_application_abstractions_services_ibookstorageservice_cs_file_1_flow_type_nexusreader_application_abstractions_services_ibookstorageservice_cs_ibookstorageservice_6_defines_type_6","from":"flow_file_nexusreader_application_abstractions_services_ibookstorageservice_cs_file_1","to":"flow_type_nexusreader_application_abstractions_services_ibookstorageservice_cs_ibookstorageservice_6","relation":"transforms","semanticLabel":"interface IBookStorageService","payload":{"outputSummary":"Abstraction for persisting ebook and cover files and returning their storage path/URLs.","expandedLabel":"defines-type"}},{"id":"edge_flow_file_nexusreader_application_abstractions_services_iidentityservice_cs_file_1_flow_type_nexusreader_application_abstractions_services_iidentityservice_cs_iidentityservice_6_defines_type_6","from":"flow_file_nexusreader_application_abstractions_services_iidentityservice_cs_file_1","to":"flow_type_nexusreader_application_abstractions_services_iidentityservice_cs_iidentityservice_6","relation":"transforms","semanticLabel":"interface IIdentityService","payload":{"outputSummary":"Application-layer abstraction that specifies authentication/identity operations and a state-invalidated event for consumers.","expandedLabel":"defines-type"}}],"nodes":[{"id":"flow_file_nexusreader_application_abstractions_messaging_iquery_cs_file_1","kind":"dependency","label":"IQuery.cs","sourcePath":"NexusReader.Application/Abstractions/Messaging/IQuery.cs","sourceLine":1},{"id":"flow_type_nexusreader_application_abstractions_messaging_iquery_cs_iquery_tresponse_6","kind":"dependency","label":"IQuery","sourcePath":"NexusReader.Application/Abstractions/Messaging/IQuery.cs","sourceLine":6},{"id":"flow_file_nexusreader_application_abstractions_messaging_icommand_cs_file_1","kind":"dependency","label":"ICommand.cs","sourcePath":"NexusReader.Application/Abstractions/Messaging/ICommand.cs","sourceLine":1},{"id":"flow_type_nexusreader_application_abstractions_messaging_icommand_cs_icommand_6","kind":"dependency","label":"ICommand","sourcePath":"NexusReader.Application/Abstractions/Messaging/ICommand.cs","sourceLine":6},{"id":"flow_type_nexusreader_application_abstractions_messaging_icommand_cs_icommand_tresponse_10","kind":"dependency","label":"ICommand","sourcePath":"NexusReader.Application/Abstractions/Messaging/ICommand.cs","sourceLine":10},{"id":"flow_file_nexusreader_application_abstractions_messaging_icommandhandler_cs_file_1","kind":"dependency","label":"ICommandHandler","sourcePath":"NexusReader.Application/Abstractions/Messaging/ICommandHandler.cs","sourceLine":1},{"id":"flow_type_nexusreader_application_abstractions_messaging_icommandhandler_cs_icommandhandler_tcommand_6","kind":"dependency","label":"ICommandHandler","sourcePath":"NexusReader.Application/Abstractions/Messaging/ICommandHandler.cs","sourceLine":6},{"id":"flow_type_nexusreader_application_abstractions_messaging_icommandhandler_cs_icommandhandler_tcommand_tresponse_11","kind":"dependency","label":"ICommandHandler","sourcePath":"NexusReader.Application/Abstractions/Messaging/ICommandHandler.cs","sourceLine":11},{"id":"flow_file_nexusreader_application_abstractions_messaging_iqueryhandler_cs_file_1","kind":"dependency","label":"IQueryHandler","sourcePath":"NexusReader.Application/Abstractions/Messaging/IQueryHandler.cs","sourceLine":1},{"id":"flow_type_nexusreader_application_abstractions_messaging_iqueryhandler_cs_iqueryhandler_6","kind":"dependency","label":"IQueryHandler","sourcePath":"NexusReader.Application/Abstractions/Messaging/IQueryHandler.cs","sourceLine":6},{"id":"flow_file_nexusreader_infrastructure_identity_tokenlimithandler_cs_file_1","kind":"dependency","label":"TokenLimitHandler","sourcePath":"NexusReader.Infrastructure/Identity/TokenLimitHandler.cs","sourceLine":1},{"id":"flow_file_nexusreader_application_abstractions_services_ibillingservice_cs_file_1","kind":"service","label":"IBillingService","sourcePath":"NexusReader.Application/Abstractions/Services/IBillingService.cs","sourceLine":1},{"id":"flow_type_nexusreader_application_abstractions_services_ibillingservice_cs_ibillingservice_6","kind":"dependency","label":"IBillingService","sourcePath":"NexusReader.Application/Abstractions/Services/IBillingService.cs","sourceLine":6},{"id":"flow_file_nexusreader_application_abstractions_persistence_iebookrepository_cs_file_1","kind":"dependency","label":"IEbookRepository","sourcePath":"NexusReader.Application/Abstractions/Persistence/IEbookRepository.cs","sourceLine":1},{"id":"flow_type_nexusreader_application_abstractions_persistence_iebookrepository_cs_iebookrepository_9","kind":"dependency","label":"IEbookRepository","sourcePath":"NexusReader.Application/Abstractions/Persistence/IEbookRepository.cs","sourceLine":9},{"id":"flow_file_nexusreader_application_abstractions_services_ibookstorageservice_cs_file_1","kind":"service","label":"IBookStorageService","sourcePath":"NexusReader.Application/Abstractions/Services/IBookStorageService.cs","sourceLine":1},{"id":"flow_type_nexusreader_application_abstractions_services_ibookstorageservice_cs_ibookstorageservice_6","kind":"dependency","label":"IBookStorageService","sourcePath":"NexusReader.Application/Abstractions/Services/IBookStorageService.cs","sourceLine":6},{"id":"flow_file_nexusreader_application_abstractions_services_iidentityservice_cs_file_1","kind":"service","label":"IIdentityService","sourcePath":"NexusReader.Application/Abstractions/Services/IIdentityService.cs","sourceLine":1},{"id":"flow_type_nexusreader_application_abstractions_services_iidentityservice_cs_iidentityservice_6","kind":"dependency","label":"IIdentityService","sourcePath":"NexusReader.Application/Abstractions/Services/IIdentityService.cs","sourceLine":6},{"id":"flow_file_nexusreader_application_abstractions_services_iknowledgeservice_cs_file_1","kind":"service","label":"IKnowledgeService","sourcePath":"NexusReader.Application/Abstractions/Services/IKnowledgeService.cs","sourceLine":1}]}</script> <script type="application/json" data-ai-mermaid-metadata="1" data-ai-mermaid-diagram-id="startup_runtime_graph">{"edges":[{"id":"edge_flow_file_nexusreader_application_mappings_mappingconfig_cs_file_1_flow_type_nexusreader_application_mappings_mappingconfig_cs_typeadapterconfig_instance_19_registers_service_19","from":"flow_file_nexusreader_application_mappings_mappingconfig_cs_file_1","to":"flow_type_nexusreader_application_mappings_mappingconfig_cs_typeadapterconfig_instance_19","relation":"uses","semanticLabel":"TypeAdapterConfig","payload":{"outputSummary":"Registers the global Mapster TypeAdapterConfig instance as a singleton","expandedLabel":"registers-service"}},{"id":"edge_flow_file_nexusreader_application_mappings_mappingconfig_cs_file_1_flow_type_nexusreader_application_mappings_mappingconfig_cs_servicemapper_20_registers_service_20","from":"flow_file_nexusreader_application_mappings_mappingconfig_cs_file_1","to":"flow_type_nexusreader_application_mappings_mappingconfig_cs_servicemapper_20","relation":"uses","semanticLabel":"IMapper","payload":{"outputSummary":"Registers Mapster ServiceMapper as the application's IMapper implementation","expandedLabel":"registers-service"}},{"id":"edge_flow_file_nexusreader_web_client_program_cs_file_1_flow_type_nexusreader_web_client_program_cs_webplatformservice_18_registers_service_18","from":"flow_file_nexusreader_web_client_program_cs_file_1","to":"flow_type_nexusreader_web_client_program_cs_webplatformservice_18","relation":"uses","semanticLabel":"IPlatformService","payload":{"outputSummary":"Registers platform abstraction for browser.","expandedLabel":"registers-service"}},{"id":"edge_flow_file_nexusreader_web_client_program_cs_file_1_flow_type_nexusreader_web_client_program_cs_nexusauthenticationstateprovider_33_registers_service_33","from":"flow_file_nexusreader_web_client_program_cs_file_1","to":"flow_type_nexusreader_web_client_program_cs_nexusauthenticationstateprovider_33","relation":"uses","semanticLabel":"NexusAuthenticationStateProvider","payload":{"outputSummary":"Authentication state provider and wiring to AuthenticationStateProvider.","expandedLabel":"registers-service"}},{"id":"edge_flow_file_nexusreader_web_client_program_cs_file_1_flow_type_nexusreader_web_client_program_cs_wasmknowledgeservice_38_registers_service_38","from":"flow_file_nexusreader_web_client_program_cs_file_1","to":"flow_type_nexusreader_web_client_program_cs_wasmknowledgeservice_38","relation":"uses","semanticLabel":"IKnowledgeService","payload":{"outputSummary":"Registers a WASM-specific knowledge service implementation.","expandedLabel":"registers-service"}},{"id":"edge_flow_file_nexusreader_web_client_program_cs_file_1_flow_type_nexusreader_web_client_program_cs_configured_httpclient_40_registers_service_40","from":"flow_file_nexusreader_web_client_program_cs_file_1","to":"flow_type_nexusreader_web_client_program_cs_configured_httpclient_40","relation":"uses","semanticLabel":"HttpClient (named 'NexusAPI')","payload":{"outputSummary":"Adds named HTTP client with base address and authentication header handler.","expandedLabel":"registers-service"}},{"id":"edge_flow_file_nexusreader_web_client_program_cs_file_1_flow_type_nexusreader_web_client_program_cs_throwingdbcontextfactory_49_registers_service_49","from":"flow_file_nexusreader_web_client_program_cs_file_1","to":"flow_type_nexusreader_web_client_program_cs_throwingdbcontextfactory_49","relation":"uses","semanticLabel":"IDbContextFactory","payload":{"outputSummary":"Registers throw-only stub to avoid using DbContext in WASM.","expandedLabel":"registers-service"}},{"id":"edge_flow_file_nexusreader_web_client_program_cs_file_1_flow_type_nexusreader_web_client_program_cs_n_a_55_registers_service_55","from":"flow_file_nexusreader_web_client_program_cs_file_1","to":"flow_type_nexusreader_web_client_program_cs_n_a_55","relation":"uses","semanticLabel":"application services (via extension)","payload":{"outputSummary":"Calls AddApplication() to register application-layer services.","expandedLabel":"registers-service"}},{"id":"edge_flow_file_nexusreader_web_client_program_cs_file_1_flow_type_nexusreader_web_client_program_cs_wasmepubreader_56_registers_service_56","from":"flow_file_nexusreader_web_client_program_cs_file_1","to":"flow_type_nexusreader_web_client_program_cs_wasmepubreader_56","relation":"uses","semanticLabel":"IEpubReader","payload":{"outputSummary":"Registers WASM epub reader implementation.","expandedLabel":"registers-service"}},{"id":"edge_flow_file_nexusreader_web_client_program_cs_file_1_flow_method_nexusreader_web_client_program_cs_run_wasm_host_59_configures_pipeline_59","from":"flow_file_nexusreader_web_client_program_cs_file_1","to":"flow_method_nexusreader_web_client_program_cs_run_wasm_host_59","relation":"calls","semanticLabel":"unknown","payload":{"outputSummary":"unknown","expandedLabel":"configures-pipeline"}},{"id":"edge_flow_file_nexusreader_web_client_nexusreader_web_client_csproj_file_1_flow_method_nexusreader_web_client_nexusreader_web_client_csproj_project_configuration_1_configures_pipeline_1","from":"flow_file_nexusreader_web_client_nexusreader_web_client_csproj_file_1","to":"flow_method_nexusreader_web_client_nexusreader_web_client_csproj_project_configuration_1","relation":"calls","semanticLabel":"unknown","payload":{"outputSummary":"unknown","expandedLabel":"configures-pipeline"}},{"id":"edge_flow_file_nexusreader_application_dependencyinjection_cs_file_1_flow_type_nexusreader_application_dependencyinjection_cs_configured_via_addmapsterconfiguration_extension_10_registers_service_10","from":"flow_file_nexusreader_application_dependencyinjection_cs_file_1","to":"flow_type_nexusreader_application_dependencyinjection_cs_configured_via_addmapsterconfiguration_extension_10","relation":"uses","semanticLabel":"Mapster configuration / mapping profiles","payload":{"outputSummary":"Calls AddMapsterConfiguration to register Mapster mapping setup for the Application project","expandedLabel":"registers-service"}},{"id":"edge_flow_file_nexusreader_application_dependencyinjection_cs_file_1_flow_type_nexusreader_application_dependencyinjection_cs_handlers_discovered_in_this_assembly_11_registers_service_11","from":"flow_file_nexusreader_application_dependencyinjection_cs_file_1","to":"flow_type_nexusreader_application_dependencyinjection_cs_handlers_discovered_in_this_assembly_11","relation":"uses","semanticLabel":"MediatR handlers (from this assembly)","payload":{"outputSummary":"Calls AddMediatR(cfg => cfg.RegisterServicesFromAssembly(Assembly)) to register MediatR handlers","expandedLabel":"registers-service"}},{"id":"edge_flow_file_nexusreader_infrastructure_dependencyinjection_cs_file_1_flow_type_nexusreader_infrastructure_dependencyinjection_cs_appdbcontext_36_registers_service_36","from":"flow_file_nexusreader_infrastructure_dependencyinjection_cs_file_1","to":"flow_type_nexusreader_infrastructure_dependencyinjection_cs_appdbcontext_36","relation":"uses","semanticLabel":"AppDbContext (DbContextFactory)","payload":{"outputSummary":"Adds AppDbContext factory using Npgsql when Postgres connection string is present","expandedLabel":"registers-service"}},{"id":"edge_flow_file_nexusreader_infrastructure_dependencyinjection_cs_file_1_flow_type_nexusreader_infrastructure_dependencyinjection_cs_appdbcontext_41_registers_service_41","from":"flow_file_nexusreader_infrastructure_dependencyinjection_cs_file_1","to":"flow_type_nexusreader_infrastructure_dependencyinjection_cs_appdbcontext_41","relation":"uses","semanticLabel":"AppDbContext (DbContext)","payload":{"outputSummary":"Registers scoped AppDbContext using Npgsql","expandedLabel":"registers-service"}}],"nodes":[{"id":"flow_file_nexusreader_application_mappings_mappingconfig_cs_file_1","kind":"dependency","label":"MappingConfig","sourcePath":"NexusReader.Application/Mappings/MappingConfig.cs","sourceLine":1},{"id":"flow_type_nexusreader_application_mappings_mappingconfig_cs_typeadapterconfig_instance_19","kind":"dependency","label":"TypeAdapterConfig (instance)","sourcePath":"NexusReader.Application/Mappings/MappingConfig.cs","sourceLine":19},{"id":"flow_type_nexusreader_application_mappings_mappingconfig_cs_servicemapper_20","kind":"dependency","label":"ServiceMapper","sourcePath":"NexusReader.Application/Mappings/MappingConfig.cs","sourceLine":20},{"id":"flow_file_nexusreader_web_client_program_cs_file_1","kind":"service","label":"Program.cs","sourcePath":"NexusReader.Web.Client/Program.cs","sourceLine":1},{"id":"flow_type_nexusreader_web_client_program_cs_webplatformservice_18","kind":"dependency","label":"WebPlatformService","sourcePath":"NexusReader.Web.Client/Program.cs","sourceLine":18},{"id":"flow_type_nexusreader_web_client_program_cs_nexusauthenticationstateprovider_33","kind":"dependency","label":"NexusAuthenticationStateProvider","sourcePath":"NexusReader.Web.Client/Program.cs","sourceLine":33},{"id":"flow_type_nexusreader_web_client_program_cs_wasmknowledgeservice_38","kind":"dependency","label":"WasmKnowledgeService","sourcePath":"NexusReader.Web.Client/Program.cs","sourceLine":38},{"id":"flow_type_nexusreader_web_client_program_cs_configured_httpclient_40","kind":"dependency","label":"configured HttpClient","sourcePath":"NexusReader.Web.Client/Program.cs","sourceLine":40},{"id":"flow_type_nexusreader_web_client_program_cs_throwingdbcontextfactory_49","kind":"dependency","label":"ThrowingDbContextFactory","sourcePath":"NexusReader.Web.Client/Program.cs","sourceLine":49},{"id":"flow_type_nexusreader_web_client_program_cs_n_a_55","kind":"dependency","label":"N/A","sourcePath":"NexusReader.Web.Client/Program.cs","sourceLine":55},{"id":"flow_type_nexusreader_web_client_program_cs_wasmepubreader_56","kind":"dependency","label":"WasmEpubReader","sourcePath":"NexusReader.Web.Client/Program.cs","sourceLine":56},{"id":"flow_method_nexusreader_web_client_program_cs_run_wasm_host_59","kind":"method","label":"Run WASM Host","sourcePath":"NexusReader.Web.Client/Program.cs","sourceLine":59},{"id":"flow_file_nexusreader_web_client_nexusreader_web_client_csproj_file_1","kind":"dependency","label":"NexusReader.Web.Client.csproj","sourcePath":"NexusReader.Web.Client/NexusReader.Web.Client.csproj","sourceLine":1},{"id":"flow_method_nexusreader_web_client_nexusreader_web_client_csproj_project_configuration_1","kind":"method","label":"project-configuration","sourcePath":"NexusReader.Web.Client/NexusReader.Web.Client.csproj","sourceLine":1},{"id":"flow_file_nexusreader_application_dependencyinjection_cs_file_1","kind":"dependency","label":"DependencyInjection","sourcePath":"NexusReader.Application/DependencyInjection.cs","sourceLine":1},{"id":"flow_type_nexusreader_application_dependencyinjection_cs_configured_via_addmapsterconfiguration_extension_10","kind":"dependency","label":"configured via AddMapsterConfiguration extension","sourcePath":"NexusReader.Application/DependencyInjection.cs","sourceLine":10},{"id":"flow_type_nexusreader_application_dependencyinjection_cs_handlers_discovered_in_this_assembly_11","kind":"dependency","label":"handlers discovered in this assembly","sourcePath":"NexusReader.Application/DependencyInjection.cs","sourceLine":11},{"id":"flow_file_nexusreader_infrastructure_dependencyinjection_cs_file_1","kind":"dependency","label":"DependencyInjection","sourcePath":"NexusReader.Infrastructure/DependencyInjection.cs","sourceLine":1},{"id":"flow_type_nexusreader_infrastructure_dependencyinjection_cs_appdbcontext_36","kind":"dependency","label":"AppDbContext","sourcePath":"NexusReader.Infrastructure/DependencyInjection.cs","sourceLine":36},{"id":"flow_type_nexusreader_infrastructure_dependencyinjection_cs_appdbcontext_41","kind":"dependency","label":"AppDbContext","sourcePath":"NexusReader.Infrastructure/DependencyInjection.cs","sourceLine":41}]}</script> <script type="application/json" data-ai-mermaid-metadata="2" data-ai-mermaid-diagram-id="primary_runtime_flow_1_nexusreader_web_client_program_cs">{"edges":[{"id":"edge_flow_file_nexusreader_application_abstractions_services_iknowledgeservice_cs_file_1_flow_type_nexusreader_application_abstractions_services_iknowledgeservice_cs_groundednessresult_19_maps_dto_19","from":"flow_file_nexusreader_application_abstractions_services_iknowledgeservice_cs_file_1","to":"flow_type_nexusreader_application_abstractions_services_iknowledgeservice_cs_groundednessresult_19","relation":"transforms","semanticLabel":"dto GroundednessResult","payload":{"outputSummary":"Represents the result of a groundedness check: score, textual rationale, and a boolean grounded flag.","expandedLabel":"maps-dto"}},{"id":"edge_flow_file_nexusreader_web_client_program_cs_file_1_flow_method_nexusreader_web_client_program_cs_program_top_level_startup_15_invokes_15","from":"flow_file_nexusreader_web_client_program_cs_file_1","to":"flow_method_nexusreader_web_client_program_cs_program_top_level_startup_15","relation":"calls","semanticLabel":"Program (top-level startup)","payload":{"outputSummary":"Create the WebAssemblyHostBuilder, register application and platform services, add HTTP client and dummy server-only stubs, then build and run the WASM host.","expandedLabel":"handles-route"}},{"id":"edge_flow_file_nexusreader_web_client_program_cs_file_1_flow_method_nexusreader_web_client_program_cs_getservice_71_invokes_71","from":"flow_file_nexusreader_web_client_program_cs_file_1","to":"flow_method_nexusreader_web_client_program_cs_getservice_71","relation":"calls","semanticLabel":"GetService","payload":{"outputSummary":"Fallback service resolver stub that always returns null.","expandedLabel":"handles-route"}},{"id":"edge_flow_method_nexusreader_web_client_program_cs_getservice_71_flow_action_nexusreader_web_client_program_cs_getservice_return_71_71_returns_71","from":"flow_method_nexusreader_web_client_program_cs_getservice_71","to":"flow_action_nexusreader_web_client_program_cs_getservice_return_71_71","relation":"returns","semanticLabel":"returns null","payload":{"outputSummary":"public object? GetService(...) => null","expandedLabel":"returns"}},{"id":"edge_flow_file_nexusreader_web_client_program_cs_file_1_flow_method_nexusreader_web_client_program_cs_findauthorbynameasync_88_invokes_88","from":"flow_file_nexusreader_web_client_program_cs_file_1","to":"flow_method_nexusreader_web_client_program_cs_findauthorbynameasync_88","relation":"calls","semanticLabel":"FindAuthorByNameAsync","payload":{"outputSummary":"Repository lookup stub that throws because repository access is unsupported in WASM.","expandedLabel":"handles-route"}},{"id":"edge_flow_method_nexusreader_web_client_program_cs_findauthorbynameasync_88_flow_action_nexusreader_web_client_program_cs_findauthorbynameasync_repository_read_88_88_invokes_88","from":"flow_method_nexusreader_web_client_program_cs_findauthorbynameasync_88","to":"flow_action_nexusreader_web_client_program_cs_findauthorbynameasync_repository_read_88_88","relation":"calls","semanticLabel":"Reads repository or persistence state","payload":{"outputSummary":"public Task FindAuthorByNameAsync(string name, CancellationToken cancellationToken = default) => throw new NotSupportedException(ErrorMessage);","expandedLabel":"invokes"}},{"id":"edge_flow_file_nexusreader_web_client_program_cs_file_1_flow_type_nexusreader_web_client_program_cs_throwingdbcontextfactory_61_defines_type_61","from":"flow_file_nexusreader_web_client_program_cs_file_1","to":"flow_type_nexusreader_web_client_program_cs_throwingdbcontextfactory_61","relation":"transforms","semanticLabel":"model ThrowingDbContextFactory","payload":{"outputSummary":"IDbContextFactory implementation that prevents use of EF DbContext in WASM by throwing on creation.","expandedLabel":"defines-type"}},{"id":"edge_flow_file_nexusreader_web_client_program_cs_file_1_flow_type_nexusreader_web_client_program_cs_throwingembeddinggenerator_66_defines_type_66","from":"flow_file_nexusreader_web_client_program_cs_file_1","to":"flow_type_nexusreader_web_client_program_cs_throwingembeddinggenerator_66","relation":"transforms","semanticLabel":"model ThrowingEmbeddingGenerator","payload":{"outputSummary":"IEmbeddingGenerator implementation that disables local embedding generation in WASM (throws on GenerateAsync).","expandedLabel":"defines-type"}},{"id":"edge_flow_file_nexusreader_web_client_program_cs_file_1_flow_type_nexusreader_web_client_program_cs_throwingbookstorageservice_74_defines_type_74","from":"flow_file_nexusreader_web_client_program_cs_file_1","to":"flow_type_nexusreader_web_client_program_cs_throwingbookstorageservice_74","relation":"transforms","semanticLabel":"model ThrowingBookStorageService","payload":{"outputSummary":"IBookStorageService implementation that throws for all file storage operations in WASM.","expandedLabel":"defines-type"}},{"id":"edge_flow_file_nexusreader_web_client_program_cs_file_1_flow_type_nexusreader_web_client_program_cs_throwingebookrepository_84_defines_type_84","from":"flow_file_nexusreader_web_client_program_cs_file_1","to":"flow_type_nexusreader_web_client_program_cs_throwingebookrepository_84","relation":"transforms","semanticLabel":"model ThrowingEbookRepository","payload":{"outputSummary":"IEbookRepository implementation that throws for all repository operations in WASM.","expandedLabel":"defines-type"}},{"id":"edge_flow_file_nexusreader_web_client_program_cs_file_1_flow_type_nexusreader_web_client_program_cs_throwingsyncbroadcaster_94_defines_type_94","from":"flow_file_nexusreader_web_client_program_cs_file_1","to":"flow_type_nexusreader_web_client_program_cs_throwingsyncbroadcaster_94","relation":"transforms","semanticLabel":"model ThrowingSyncBroadcaster","payload":{"outputSummary":"ISyncBroadcaster implementation that throws because real-time broadcasting must run on the server.","expandedLabel":"defines-type"}},{"id":"edge_flow_file_nexusreader_web_client_program_cs_file_1_flow_type_nexusreader_web_client_program_cs_webplatformservice_18_registers_service_18","from":"flow_file_nexusreader_web_client_program_cs_file_1","to":"flow_type_nexusreader_web_client_program_cs_webplatformservice_18","relation":"uses","semanticLabel":"IPlatformService","payload":{"outputSummary":"Registers platform abstraction for browser.","expandedLabel":"registers-service"}},{"id":"edge_flow_file_nexusreader_web_client_program_cs_file_1_flow_type_nexusreader_web_client_program_cs_nexusauthenticationstateprovider_33_registers_service_33","from":"flow_file_nexusreader_web_client_program_cs_file_1","to":"flow_type_nexusreader_web_client_program_cs_nexusauthenticationstateprovider_33","relation":"uses","semanticLabel":"NexusAuthenticationStateProvider","payload":{"outputSummary":"Authentication state provider and wiring to AuthenticationStateProvider.","expandedLabel":"registers-service"}},{"id":"edge_flow_file_nexusreader_web_client_program_cs_file_1_flow_type_nexusreader_web_client_program_cs_wasmknowledgeservice_38_registers_service_38","from":"flow_file_nexusreader_web_client_program_cs_file_1","to":"flow_type_nexusreader_web_client_program_cs_wasmknowledgeservice_38","relation":"uses","semanticLabel":"IKnowledgeService","payload":{"outputSummary":"Registers a WASM-specific knowledge service implementation.","expandedLabel":"registers-service"}},{"id":"edge_flow_file_nexusreader_web_client_program_cs_file_1_flow_type_nexusreader_web_client_program_cs_configured_httpclient_40_registers_service_40","from":"flow_file_nexusreader_web_client_program_cs_file_1","to":"flow_type_nexusreader_web_client_program_cs_configured_httpclient_40","relation":"uses","semanticLabel":"HttpClient (named 'NexusAPI')","payload":{"outputSummary":"Adds named HTTP client with base address and authentication header handler.","expandedLabel":"registers-service"}},{"id":"edge_flow_file_nexusreader_web_client_program_cs_file_1_flow_type_nexusreader_web_client_program_cs_throwingdbcontextfactory_49_registers_service_49","from":"flow_file_nexusreader_web_client_program_cs_file_1","to":"flow_type_nexusreader_web_client_program_cs_throwingdbcontextfactory_49","relation":"uses","semanticLabel":"IDbContextFactory","payload":{"outputSummary":"Registers throw-only stub to avoid using DbContext in WASM.","expandedLabel":"registers-service"}},{"id":"edge_flow_file_nexusreader_web_client_program_cs_file_1_flow_type_nexusreader_web_client_program_cs_n_a_55_registers_service_55","from":"flow_file_nexusreader_web_client_program_cs_file_1","to":"flow_type_nexusreader_web_client_program_cs_n_a_55","relation":"uses","semanticLabel":"application services (via extension)","payload":{"outputSummary":"Calls AddApplication() to register application-layer services.","expandedLabel":"registers-service"}},{"id":"edge_flow_file_nexusreader_web_client_program_cs_file_1_flow_type_nexusreader_web_client_program_cs_wasmepubreader_56_registers_service_56","from":"flow_file_nexusreader_web_client_program_cs_file_1","to":"flow_type_nexusreader_web_client_program_cs_wasmepubreader_56","relation":"uses","semanticLabel":"IEpubReader","payload":{"outputSummary":"Registers WASM epub reader implementation.","expandedLabel":"registers-service"}},{"id":"edge_flow_file_nexusreader_web_client_program_cs_file_1_flow_method_nexusreader_web_client_program_cs_run_wasm_host_59_configures_pipeline_59","from":"flow_file_nexusreader_web_client_program_cs_file_1","to":"flow_method_nexusreader_web_client_program_cs_run_wasm_host_59","relation":"calls","semanticLabel":"unknown","payload":{"outputSummary":"unknown","expandedLabel":"configures-pipeline"}}],"nodes":[{"id":"flow_file_nexusreader_application_abstractions_services_iknowledgeservice_cs_file_1","kind":"service","label":"IKnowledgeService","sourcePath":"NexusReader.Application/Abstractions/Services/IKnowledgeService.cs","sourceLine":1},{"id":"flow_type_nexusreader_application_abstractions_services_iknowledgeservice_cs_groundednessresult_19","kind":"dependency","label":"GroundednessResult","sourcePath":"NexusReader.Application/Abstractions/Services/IKnowledgeService.cs","sourceLine":19},{"id":"flow_method_nexusreader_application_abstractions_services_iknowledgeservice_cs_verifygroundednessasync_13","kind":"method","label":"VerifyGroundednessAsync","sourcePath":"NexusReader.Application/Abstractions/Services/IKnowledgeService.cs","sourceLine":13},{"id":"flow_file_nexusreader_application_abstractions_services_iplatformservice_cs_file_1","kind":"service","label":"IPlatformService","sourcePath":"NexusReader.Application/Abstractions/Services/IPlatformService.cs","sourceLine":1},{"id":"flow_method_nexusreader_application_abstractions_services_iknowledgeservice_cs_askquestionasync_15","kind":"method","label":"AskQuestionAsync","sourcePath":"NexusReader.Application/Abstractions/Services/IKnowledgeService.cs","sourceLine":15},{"id":"flow_file_nexusreader_web_client_program_cs_file_1","kind":"service","label":"Program.cs","sourcePath":"NexusReader.Web.Client/Program.cs","sourceLine":1},{"id":"flow_method_nexusreader_web_client_program_cs_program_top_level_startup_15","kind":"method","label":"Program (top-level startup)","sourcePath":"NexusReader.Web.Client/Program.cs","sourceLine":15},{"id":"flow_method_nexusreader_web_client_program_cs_getservice_71","kind":"method","label":"GetService","sourcePath":"NexusReader.Web.Client/Program.cs","sourceLine":71},{"id":"flow_action_nexusreader_web_client_program_cs_getservice_return_71_71","kind":"return","label":"returns null","sourcePath":"NexusReader.Web.Client/Program.cs","sourceLine":71},{"id":"flow_method_nexusreader_web_client_program_cs_findauthorbynameasync_88","kind":"method","label":"FindAuthorByNameAsync","sourcePath":"NexusReader.Web.Client/Program.cs","sourceLine":88},{"id":"flow_action_nexusreader_web_client_program_cs_findauthorbynameasync_repository_read_88_88","kind":"step","label":"Reads repository or persistence state","sourcePath":"NexusReader.Web.Client/Program.cs","sourceLine":88},{"id":"flow_type_nexusreader_web_client_program_cs_throwingdbcontextfactory_61","kind":"dependency","label":"ThrowingDbContextFactory","sourcePath":"NexusReader.Web.Client/Program.cs","sourceLine":61},{"id":"flow_type_nexusreader_web_client_program_cs_throwingembeddinggenerator_66","kind":"dependency","label":"ThrowingEmbeddingGenerator","sourcePath":"NexusReader.Web.Client/Program.cs","sourceLine":66},{"id":"flow_type_nexusreader_web_client_program_cs_throwingbookstorageservice_74","kind":"dependency","label":"ThrowingBookStorageService","sourcePath":"NexusReader.Web.Client/Program.cs","sourceLine":74},{"id":"flow_type_nexusreader_web_client_program_cs_throwingebookrepository_84","kind":"dependency","label":"ThrowingEbookRepository","sourcePath":"NexusReader.Web.Client/Program.cs","sourceLine":84},{"id":"flow_type_nexusreader_web_client_program_cs_throwingsyncbroadcaster_94","kind":"dependency","label":"ThrowingSyncBroadcaster","sourcePath":"NexusReader.Web.Client/Program.cs","sourceLine":94},{"id":"flow_type_nexusreader_web_client_program_cs_webplatformservice_18","kind":"dependency","label":"WebPlatformService","sourcePath":"NexusReader.Web.Client/Program.cs","sourceLine":18},{"id":"flow_type_nexusreader_web_client_program_cs_nexusauthenticationstateprovider_33","kind":"dependency","label":"NexusAuthenticationStateProvider","sourcePath":"NexusReader.Web.Client/Program.cs","sourceLine":33},{"id":"flow_type_nexusreader_web_client_program_cs_wasmknowledgeservice_38","kind":"dependency","label":"WasmKnowledgeService","sourcePath":"NexusReader.Web.Client/Program.cs","sourceLine":38},{"id":"flow_type_nexusreader_web_client_program_cs_configured_httpclient_40","kind":"dependency","label":"configured HttpClient","sourcePath":"NexusReader.Web.Client/Program.cs","sourceLine":40},{"id":"flow_type_nexusreader_web_client_program_cs_throwingdbcontextfactory_49","kind":"dependency","label":"ThrowingDbContextFactory","sourcePath":"NexusReader.Web.Client/Program.cs","sourceLine":49},{"id":"flow_type_nexusreader_web_client_program_cs_n_a_55","kind":"dependency","label":"N/A","sourcePath":"NexusReader.Web.Client/Program.cs","sourceLine":55},{"id":"flow_type_nexusreader_web_client_program_cs_wasmepubreader_56","kind":"dependency","label":"WasmEpubReader","sourcePath":"NexusReader.Web.Client/Program.cs","sourceLine":56},{"id":"flow_method_nexusreader_web_client_program_cs_run_wasm_host_59","kind":"method","label":"Run WASM Host","sourcePath":"NexusReader.Web.Client/Program.cs","sourceLine":59}]}</script> <script type="application/json" data-ai-mermaid-metadata="3" data-ai-mermaid-diagram-id="control_flow_flow_1_nexusreader_web_client_program_cs">{"edges":[{"id":"edge_flow_action_nexusreader_application_commands_ai_verifygroundednesscommand_cs_handle_return_20_20_flow_method_nexusreader_application_abstractions_services_iknowledgeservice_cs_verifygroundednessasync_13_uses_service_20","from":"flow_action_nexusreader_application_commands_ai_verifygroundednesscommand_cs_handle_return_20_20","to":"flow_method_nexusreader_application_abstractions_services_iknowledgeservice_cs_verifygroundednessasync_13","relation":"uses","semanticLabel":"VerifyGroundednessAsync","payload":{"outputSummary":"request.Answer, request.Context, request.TenantId, cancellationToken","expandedLabel":"uses-service"}},{"id":"edge_flow_file_nexusreader_application_abstractions_services_iplatformservice_cs_file_1_flow_method_nexusreader_application_abstractions_services_iplatformservice_cs_vibratesuccessasync_7_invokes_7","from":"flow_file_nexusreader_application_abstractions_services_iplatformservice_cs_file_1","to":"flow_method_nexusreader_application_abstractions_services_iplatformservice_cs_vibratesuccessasync_7","relation":"calls","semanticLabel":"VibrateSuccessAsync","payload":{"outputSummary":"Requests a short platform-specific 'success' vibration; returns a Result indicating success/failure.","expandedLabel":"invokes"}},{"id":"edge_flow_file_nexusreader_application_abstractions_services_iplatformservice_cs_file_1_flow_method_nexusreader_application_abstractions_services_iplatformservice_cs_vibrateerrorasync_8_invokes_8","from":"flow_file_nexusreader_application_abstractions_services_iplatformservice_cs_file_1","to":"flow_method_nexusreader_application_abstractions_services_iplatformservice_cs_vibrateerrorasync_8","relation":"calls","semanticLabel":"VibrateErrorAsync","payload":{"outputSummary":"Requests a short platform-specific 'error' vibration; returns a Result indicating success/failure.","expandedLabel":"invokes"}},{"id":"edge_flow_file_nexusreader_application_abstractions_services_iplatformservice_cs_file_1_flow_method_nexusreader_application_abstractions_services_iplatformservice_cs_vibrateasync_9_invokes_9","from":"flow_file_nexusreader_application_abstractions_services_iplatformservice_cs_file_1","to":"flow_method_nexusreader_application_abstractions_services_iplatformservice_cs_vibrateasync_9","relation":"calls","semanticLabel":"VibrateAsync","payload":{"outputSummary":"Requests a platform vibration for the specified duration in milliseconds; returns a Result indicating success/failure.","expandedLabel":"invokes"}},{"id":"edge_flow_file_nexusreader_application_abstractions_services_iplatformservice_cs_file_1_flow_method_nexusreader_application_abstractions_services_iplatformservice_cs_getdevicecontext_10_invokes_10","from":"flow_file_nexusreader_application_abstractions_services_iplatformservice_cs_file_1","to":"flow_method_nexusreader_application_abstractions_services_iplatformservice_cs_getdevicecontext_10","relation":"calls","semanticLabel":"GetDeviceContext","payload":{"outputSummary":"Retrieves current device characteristics (model, manufacturer, type, orientation) wrapped in a Result.","expandedLabel":"invokes"}},{"id":"edge_flow_action_nexusreader_application_queries_library_asklibraryquestionquery_cs_handle_return_30_30_flow_method_nexusreader_application_abstractions_services_iknowledgeservice_cs_askquestionasync_15_uses_service_30","from":"flow_action_nexusreader_application_queries_library_asklibraryquestionquery_cs_handle_return_30_30","to":"flow_method_nexusreader_application_abstractions_services_iknowledgeservice_cs_askquestionasync_15","relation":"uses","semanticLabel":"AskQuestionAsync","payload":{"outputSummary":"request.Question, request.TenantId, request.EbookId, request.Limit, cancellationToken","expandedLabel":"uses-service"}},{"id":"edge_flow_method_nexusreader_web_client_program_cs_getservice_71_flow_action_nexusreader_web_client_program_cs_getservice_return_71_71_returns_71","from":"flow_method_nexusreader_web_client_program_cs_getservice_71","to":"flow_action_nexusreader_web_client_program_cs_getservice_return_71_71","relation":"returns","semanticLabel":"returns null","payload":{"outputSummary":"public object? GetService(...) => null","expandedLabel":"returns"}},{"id":"edge_flow_method_nexusreader_web_client_program_cs_findauthorbynameasync_88_flow_action_nexusreader_web_client_program_cs_findauthorbynameasync_repository_read_88_88_invokes_88","from":"flow_method_nexusreader_web_client_program_cs_findauthorbynameasync_88","to":"flow_action_nexusreader_web_client_program_cs_findauthorbynameasync_repository_read_88_88","relation":"calls","semanticLabel":"Reads repository or persistence state","payload":{"outputSummary":"public Task FindAuthorByNameAsync(string name, CancellationToken cancellationToken = default) => throw new NotSupportedException(ErrorMessage);","expandedLabel":"invokes"}}],"nodes":[{"id":"flow_action_nexusreader_application_commands_ai_verifygroundednesscommand_cs_handle_return_20_20","kind":"return","label":"Returns result","sourcePath":"NexusReader.Application/Commands/AI/VerifyGroundednessCommand.cs","sourceLine":20},{"id":"flow_method_nexusreader_application_abstractions_services_iknowledgeservice_cs_verifygroundednessasync_13","kind":"method","label":"VerifyGroundednessAsync","sourcePath":"NexusReader.Application/Abstractions/Services/IKnowledgeService.cs","sourceLine":13},{"id":"flow_file_nexusreader_application_abstractions_services_iplatformservice_cs_file_1","kind":"service","label":"IPlatformService","sourcePath":"NexusReader.Application/Abstractions/Services/IPlatformService.cs","sourceLine":1},{"id":"flow_method_nexusreader_application_abstractions_services_iplatformservice_cs_vibratesuccessasync_7","kind":"method","label":"VibrateSuccessAsync","sourcePath":"NexusReader.Application/Abstractions/Services/IPlatformService.cs","sourceLine":7},{"id":"flow_method_nexusreader_application_abstractions_services_iplatformservice_cs_vibrateerrorasync_8","kind":"method","label":"VibrateErrorAsync","sourcePath":"NexusReader.Application/Abstractions/Services/IPlatformService.cs","sourceLine":8},{"id":"flow_method_nexusreader_application_abstractions_services_iplatformservice_cs_vibrateasync_9","kind":"method","label":"VibrateAsync","sourcePath":"NexusReader.Application/Abstractions/Services/IPlatformService.cs","sourceLine":9},{"id":"flow_method_nexusreader_application_abstractions_services_iplatformservice_cs_getdevicecontext_10","kind":"method","label":"GetDeviceContext","sourcePath":"NexusReader.Application/Abstractions/Services/IPlatformService.cs","sourceLine":10},{"id":"flow_action_nexusreader_application_queries_library_asklibraryquestionquery_cs_handle_return_30_30","kind":"return","label":"Returns result","sourcePath":"NexusReader.Application/Queries/Library/AskLibraryQuestionQuery.cs","sourceLine":30},{"id":"flow_method_nexusreader_application_abstractions_services_iknowledgeservice_cs_askquestionasync_15","kind":"method","label":"AskQuestionAsync","sourcePath":"NexusReader.Application/Abstractions/Services/IKnowledgeService.cs","sourceLine":15},{"id":"flow_file_nexusreader_web_client_program_cs_file_1","kind":"service","label":"Program.cs","sourcePath":"NexusReader.Web.Client/Program.cs","sourceLine":1},{"id":"flow_method_nexusreader_web_client_program_cs_program_top_level_startup_15","kind":"method","label":"Program (top-level startup)","sourcePath":"NexusReader.Web.Client/Program.cs","sourceLine":15},{"id":"flow_method_nexusreader_web_client_program_cs_getservice_71","kind":"method","label":"GetService","sourcePath":"NexusReader.Web.Client/Program.cs","sourceLine":71},{"id":"flow_action_nexusreader_web_client_program_cs_getservice_return_71_71","kind":"return","label":"returns null","sourcePath":"NexusReader.Web.Client/Program.cs","sourceLine":71},{"id":"flow_method_nexusreader_web_client_program_cs_findauthorbynameasync_88","kind":"method","label":"FindAuthorByNameAsync","sourcePath":"NexusReader.Web.Client/Program.cs","sourceLine":88},{"id":"flow_action_nexusreader_web_client_program_cs_findauthorbynameasync_repository_read_88_88","kind":"step","label":"Reads repository or persistence state","sourcePath":"NexusReader.Web.Client/Program.cs","sourceLine":88},{"id":"flow_method_nexusreader_web_client_program_cs_run_wasm_host_59","kind":"method","label":"Run WASM Host","sourcePath":"NexusReader.Web.Client/Program.cs","sourceLine":59}]}</script> <script type="application/json" data-ai-mermaid-metadata="4" data-ai-mermaid-diagram-id="contracts_flow_1_nexusreader_web_client_program_cs">{"edges":[{"id":"edge_flow_file_nexusreader_application_abstractions_services_iknowledgeservice_cs_file_1_flow_type_nexusreader_application_abstractions_services_iknowledgeservice_cs_groundednessresult_19_maps_dto_19","from":"flow_file_nexusreader_application_abstractions_services_iknowledgeservice_cs_file_1","to":"flow_type_nexusreader_application_abstractions_services_iknowledgeservice_cs_groundednessresult_19","relation":"transforms","semanticLabel":"dto GroundednessResult","payload":{"outputSummary":"Represents the result of a groundedness check: score, textual rationale, and a boolean grounded flag.","expandedLabel":"maps-dto"}},{"id":"edge_flow_file_nexusreader_application_abstractions_services_iplatformservice_cs_file_1_flow_type_nexusreader_application_abstractions_services_iplatformservice_cs_devicecontext_13_maps_dto_13","from":"flow_file_nexusreader_application_abstractions_services_iplatformservice_cs_file_1","to":"flow_type_nexusreader_application_abstractions_services_iplatformservice_cs_devicecontext_13","relation":"transforms","semanticLabel":"dto DeviceContext","payload":{"outputSummary":"Represents device metadata (model, manufacturer, device type, display orientation) for platform-aware logic.","expandedLabel":"maps-dto"}},{"id":"edge_flow_file_nexusreader_application_abstractions_services_iplatformservice_cs_file_1_flow_type_nexusreader_application_abstractions_services_iplatformservice_cs_devicetype_20_defines_type_20","from":"flow_file_nexusreader_application_abstractions_services_iplatformservice_cs_file_1","to":"flow_type_nexusreader_application_abstractions_services_iplatformservice_cs_devicetype_20","relation":"transforms","semanticLabel":"enum DeviceType","payload":{"outputSummary":"Enumerates device categories used to adapt UI/behavior.","expandedLabel":"defines-type"}},{"id":"edge_flow_file_nexusreader_application_abstractions_services_iplatformservice_cs_file_1_flow_type_nexusreader_application_abstractions_services_iplatformservice_cs_displayorientation_28_defines_type_28","from":"flow_file_nexusreader_application_abstractions_services_iplatformservice_cs_file_1","to":"flow_type_nexusreader_application_abstractions_services_iplatformservice_cs_displayorientation_28","relation":"transforms","semanticLabel":"enum DisplayOrientation","payload":{"outputSummary":"Enumerates possible screen orientations to allow layout/behavior adjustments.","expandedLabel":"defines-type"}},{"id":"edge_flow_file_nexusreader_web_client_program_cs_file_1_flow_type_nexusreader_web_client_program_cs_throwingdbcontextfactory_61_defines_type_61","from":"flow_file_nexusreader_web_client_program_cs_file_1","to":"flow_type_nexusreader_web_client_program_cs_throwingdbcontextfactory_61","relation":"transforms","semanticLabel":"model ThrowingDbContextFactory","payload":{"outputSummary":"IDbContextFactory implementation that prevents use of EF DbContext in WASM by throwing on creation.","expandedLabel":"defines-type"}},{"id":"edge_flow_file_nexusreader_web_client_program_cs_file_1_flow_type_nexusreader_web_client_program_cs_throwingembeddinggenerator_66_defines_type_66","from":"flow_file_nexusreader_web_client_program_cs_file_1","to":"flow_type_nexusreader_web_client_program_cs_throwingembeddinggenerator_66","relation":"transforms","semanticLabel":"model ThrowingEmbeddingGenerator","payload":{"outputSummary":"IEmbeddingGenerator implementation that disables local embedding generation in WASM (throws on GenerateAsync).","expandedLabel":"defines-type"}},{"id":"edge_flow_file_nexusreader_web_client_program_cs_file_1_flow_type_nexusreader_web_client_program_cs_throwingbookstorageservice_74_defines_type_74","from":"flow_file_nexusreader_web_client_program_cs_file_1","to":"flow_type_nexusreader_web_client_program_cs_throwingbookstorageservice_74","relation":"transforms","semanticLabel":"model ThrowingBookStorageService","payload":{"outputSummary":"IBookStorageService implementation that throws for all file storage operations in WASM.","expandedLabel":"defines-type"}},{"id":"edge_flow_file_nexusreader_web_client_program_cs_file_1_flow_type_nexusreader_web_client_program_cs_throwingebookrepository_84_defines_type_84","from":"flow_file_nexusreader_web_client_program_cs_file_1","to":"flow_type_nexusreader_web_client_program_cs_throwingebookrepository_84","relation":"transforms","semanticLabel":"model ThrowingEbookRepository","payload":{"outputSummary":"IEbookRepository implementation that throws for all repository operations in WASM.","expandedLabel":"defines-type"}},{"id":"edge_flow_file_nexusreader_web_client_program_cs_file_1_flow_type_nexusreader_web_client_program_cs_throwingsyncbroadcaster_94_defines_type_94","from":"flow_file_nexusreader_web_client_program_cs_file_1","to":"flow_type_nexusreader_web_client_program_cs_throwingsyncbroadcaster_94","relation":"transforms","semanticLabel":"model ThrowingSyncBroadcaster","payload":{"outputSummary":"ISyncBroadcaster implementation that throws because real-time broadcasting must run on the server.","expandedLabel":"defines-type"}}],"nodes":[{"id":"flow_file_nexusreader_application_abstractions_services_iknowledgeservice_cs_file_1","kind":"service","label":"IKnowledgeService","sourcePath":"NexusReader.Application/Abstractions/Services/IKnowledgeService.cs","sourceLine":1},{"id":"flow_type_nexusreader_application_abstractions_services_iknowledgeservice_cs_groundednessresult_19","kind":"dependency","label":"GroundednessResult","sourcePath":"NexusReader.Application/Abstractions/Services/IKnowledgeService.cs","sourceLine":19},{"id":"flow_file_nexusreader_application_abstractions_services_iplatformservice_cs_file_1","kind":"service","label":"IPlatformService","sourcePath":"NexusReader.Application/Abstractions/Services/IPlatformService.cs","sourceLine":1},{"id":"flow_type_nexusreader_application_abstractions_services_iplatformservice_cs_devicecontext_13","kind":"dependency","label":"DeviceContext","sourcePath":"NexusReader.Application/Abstractions/Services/IPlatformService.cs","sourceLine":13},{"id":"flow_type_nexusreader_application_abstractions_services_iplatformservice_cs_devicetype_20","kind":"dependency","label":"DeviceType","sourcePath":"NexusReader.Application/Abstractions/Services/IPlatformService.cs","sourceLine":20},{"id":"flow_type_nexusreader_application_abstractions_services_iplatformservice_cs_displayorientation_28","kind":"dependency","label":"DisplayOrientation","sourcePath":"NexusReader.Application/Abstractions/Services/IPlatformService.cs","sourceLine":28},{"id":"flow_file_nexusreader_web_client_program_cs_file_1","kind":"service","label":"Program.cs","sourcePath":"NexusReader.Web.Client/Program.cs","sourceLine":1},{"id":"flow_type_nexusreader_web_client_program_cs_throwingdbcontextfactory_61","kind":"dependency","label":"ThrowingDbContextFactory","sourcePath":"NexusReader.Web.Client/Program.cs","sourceLine":61},{"id":"flow_type_nexusreader_web_client_program_cs_throwingembeddinggenerator_66","kind":"dependency","label":"ThrowingEmbeddingGenerator","sourcePath":"NexusReader.Web.Client/Program.cs","sourceLine":66},{"id":"flow_type_nexusreader_web_client_program_cs_throwingbookstorageservice_74","kind":"dependency","label":"ThrowingBookStorageService","sourcePath":"NexusReader.Web.Client/Program.cs","sourceLine":74},{"id":"flow_type_nexusreader_web_client_program_cs_throwingebookrepository_84","kind":"dependency","label":"ThrowingEbookRepository","sourcePath":"NexusReader.Web.Client/Program.cs","sourceLine":84},{"id":"flow_type_nexusreader_web_client_program_cs_throwingsyncbroadcaster_94","kind":"dependency","label":"ThrowingSyncBroadcaster","sourcePath":"NexusReader.Web.Client/Program.cs","sourceLine":94},{"id":"flow_type_nexusreader_web_client_program_cs_webplatformservice_18","kind":"dependency","label":"WebPlatformService","sourcePath":"NexusReader.Web.Client/Program.cs","sourceLine":18},{"id":"flow_type_nexusreader_web_client_program_cs_nexusauthenticationstateprovider_33","kind":"dependency","label":"NexusAuthenticationStateProvider","sourcePath":"NexusReader.Web.Client/Program.cs","sourceLine":33},{"id":"flow_type_nexusreader_web_client_program_cs_wasmknowledgeservice_38","kind":"dependency","label":"WasmKnowledgeService","sourcePath":"NexusReader.Web.Client/Program.cs","sourceLine":38},{"id":"flow_type_nexusreader_web_client_program_cs_configured_httpclient_40","kind":"dependency","label":"configured HttpClient","sourcePath":"NexusReader.Web.Client/Program.cs","sourceLine":40},{"id":"flow_type_nexusreader_web_client_program_cs_throwingdbcontextfactory_49","kind":"dependency","label":"ThrowingDbContextFactory","sourcePath":"NexusReader.Web.Client/Program.cs","sourceLine":49},{"id":"flow_type_nexusreader_web_client_program_cs_n_a_55","kind":"dependency","label":"N/A","sourcePath":"NexusReader.Web.Client/Program.cs","sourceLine":55},{"id":"flow_type_nexusreader_web_client_program_cs_wasmepubreader_56","kind":"dependency","label":"WasmEpubReader","sourcePath":"NexusReader.Web.Client/Program.cs","sourceLine":56}]}</script> <script type="application/json" data-ai-mermaid-metadata="5" data-ai-mermaid-diagram-id="layer_flow_1_nexusreader_web_client_program_cs">{"edges":[{"id":"edge_flow_file_nexusreader_application_abstractions_services_iknowledgeservice_cs_file_1_flow_type_nexusreader_application_abstractions_services_iknowledgeservice_cs_groundednessresult_19_maps_dto_19","from":"flow_file_nexusreader_application_abstractions_services_iknowledgeservice_cs_file_1","to":"flow_type_nexusreader_application_abstractions_services_iknowledgeservice_cs_groundednessresult_19","relation":"transforms","semanticLabel":"dto GroundednessResult","payload":{"outputSummary":"Represents the result of a groundedness check: score, textual rationale, and a boolean grounded flag.","expandedLabel":"maps-dto"}},{"id":"edge_flow_file_nexusreader_web_client_program_cs_file_1_flow_type_nexusreader_web_client_program_cs_throwingdbcontextfactory_61_defines_type_61","from":"flow_file_nexusreader_web_client_program_cs_file_1","to":"flow_type_nexusreader_web_client_program_cs_throwingdbcontextfactory_61","relation":"transforms","semanticLabel":"model ThrowingDbContextFactory","payload":{"outputSummary":"IDbContextFactory implementation that prevents use of EF DbContext in WASM by throwing on creation.","expandedLabel":"defines-type"}},{"id":"edge_flow_file_nexusreader_web_client_program_cs_file_1_flow_type_nexusreader_web_client_program_cs_throwingembeddinggenerator_66_defines_type_66","from":"flow_file_nexusreader_web_client_program_cs_file_1","to":"flow_type_nexusreader_web_client_program_cs_throwingembeddinggenerator_66","relation":"transforms","semanticLabel":"model ThrowingEmbeddingGenerator","payload":{"outputSummary":"IEmbeddingGenerator implementation that disables local embedding generation in WASM (throws on GenerateAsync).","expandedLabel":"defines-type"}},{"id":"edge_flow_file_nexusreader_web_client_program_cs_file_1_flow_type_nexusreader_web_client_program_cs_throwingbookstorageservice_74_defines_type_74","from":"flow_file_nexusreader_web_client_program_cs_file_1","to":"flow_type_nexusreader_web_client_program_cs_throwingbookstorageservice_74","relation":"transforms","semanticLabel":"model ThrowingBookStorageService","payload":{"outputSummary":"IBookStorageService implementation that throws for all file storage operations in WASM.","expandedLabel":"defines-type"}},{"id":"edge_flow_file_nexusreader_web_client_program_cs_file_1_flow_type_nexusreader_web_client_program_cs_throwingebookrepository_84_defines_type_84","from":"flow_file_nexusreader_web_client_program_cs_file_1","to":"flow_type_nexusreader_web_client_program_cs_throwingebookrepository_84","relation":"transforms","semanticLabel":"model ThrowingEbookRepository","payload":{"outputSummary":"IEbookRepository implementation that throws for all repository operations in WASM.","expandedLabel":"defines-type"}},{"id":"edge_flow_file_nexusreader_web_client_program_cs_file_1_flow_type_nexusreader_web_client_program_cs_throwingsyncbroadcaster_94_defines_type_94","from":"flow_file_nexusreader_web_client_program_cs_file_1","to":"flow_type_nexusreader_web_client_program_cs_throwingsyncbroadcaster_94","relation":"transforms","semanticLabel":"model ThrowingSyncBroadcaster","payload":{"outputSummary":"ISyncBroadcaster implementation that throws because real-time broadcasting must run on the server.","expandedLabel":"defines-type"}},{"id":"edge_flow_file_nexusreader_web_client_program_cs_file_1_flow_type_nexusreader_web_client_program_cs_webplatformservice_18_registers_service_18","from":"flow_file_nexusreader_web_client_program_cs_file_1","to":"flow_type_nexusreader_web_client_program_cs_webplatformservice_18","relation":"uses","semanticLabel":"IPlatformService","payload":{"outputSummary":"Registers platform abstraction for browser.","expandedLabel":"registers-service"}},{"id":"edge_flow_file_nexusreader_web_client_program_cs_file_1_flow_type_nexusreader_web_client_program_cs_nexusauthenticationstateprovider_33_registers_service_33","from":"flow_file_nexusreader_web_client_program_cs_file_1","to":"flow_type_nexusreader_web_client_program_cs_nexusauthenticationstateprovider_33","relation":"uses","semanticLabel":"NexusAuthenticationStateProvider","payload":{"outputSummary":"Authentication state provider and wiring to AuthenticationStateProvider.","expandedLabel":"registers-service"}},{"id":"edge_flow_file_nexusreader_web_client_program_cs_file_1_flow_type_nexusreader_web_client_program_cs_wasmknowledgeservice_38_registers_service_38","from":"flow_file_nexusreader_web_client_program_cs_file_1","to":"flow_type_nexusreader_web_client_program_cs_wasmknowledgeservice_38","relation":"uses","semanticLabel":"IKnowledgeService","payload":{"outputSummary":"Registers a WASM-specific knowledge service implementation.","expandedLabel":"registers-service"}},{"id":"edge_flow_file_nexusreader_web_client_program_cs_file_1_flow_type_nexusreader_web_client_program_cs_configured_httpclient_40_registers_service_40","from":"flow_file_nexusreader_web_client_program_cs_file_1","to":"flow_type_nexusreader_web_client_program_cs_configured_httpclient_40","relation":"uses","semanticLabel":"HttpClient (named 'NexusAPI')","payload":{"outputSummary":"Adds named HTTP client with base address and authentication header handler.","expandedLabel":"registers-service"}},{"id":"edge_flow_file_nexusreader_web_client_program_cs_file_1_flow_type_nexusreader_web_client_program_cs_throwingdbcontextfactory_49_registers_service_49","from":"flow_file_nexusreader_web_client_program_cs_file_1","to":"flow_type_nexusreader_web_client_program_cs_throwingdbcontextfactory_49","relation":"uses","semanticLabel":"IDbContextFactory","payload":{"outputSummary":"Registers throw-only stub to avoid using DbContext in WASM.","expandedLabel":"registers-service"}}],"nodes":[{"id":"flow_file_nexusreader_application_abstractions_services_iknowledgeservice_cs_file_1","kind":"service","label":"IKnowledgeService","sourcePath":"NexusReader.Application/Abstractions/Services/IKnowledgeService.cs","sourceLine":1},{"id":"flow_type_nexusreader_application_abstractions_services_iknowledgeservice_cs_groundednessresult_19","kind":"dependency","label":"GroundednessResult","sourcePath":"NexusReader.Application/Abstractions/Services/IKnowledgeService.cs","sourceLine":19},{"id":"flow_method_nexusreader_application_abstractions_services_iknowledgeservice_cs_verifygroundednessasync_13","kind":"method","label":"VerifyGroundednessAsync","sourcePath":"NexusReader.Application/Abstractions/Services/IKnowledgeService.cs","sourceLine":13},{"id":"flow_file_nexusreader_application_abstractions_services_iplatformservice_cs_file_1","kind":"service","label":"IPlatformService","sourcePath":"NexusReader.Application/Abstractions/Services/IPlatformService.cs","sourceLine":1},{"id":"flow_method_nexusreader_application_abstractions_services_iknowledgeservice_cs_askquestionasync_15","kind":"method","label":"AskQuestionAsync","sourcePath":"NexusReader.Application/Abstractions/Services/IKnowledgeService.cs","sourceLine":15},{"id":"flow_file_nexusreader_web_client_program_cs_file_1","kind":"service","label":"Program.cs","sourcePath":"NexusReader.Web.Client/Program.cs","sourceLine":1},{"id":"flow_action_nexusreader_web_client_program_cs_getservice_return_71_71","kind":"return","label":"returns null","sourcePath":"NexusReader.Web.Client/Program.cs","sourceLine":71},{"id":"flow_action_nexusreader_web_client_program_cs_findauthorbynameasync_repository_read_88_88","kind":"step","label":"Reads repository or persistence state","sourcePath":"NexusReader.Web.Client/Program.cs","sourceLine":88},{"id":"flow_type_nexusreader_web_client_program_cs_throwingdbcontextfactory_61","kind":"dependency","label":"ThrowingDbContextFactory","sourcePath":"NexusReader.Web.Client/Program.cs","sourceLine":61},{"id":"flow_type_nexusreader_web_client_program_cs_throwingembeddinggenerator_66","kind":"dependency","label":"ThrowingEmbeddingGenerator","sourcePath":"NexusReader.Web.Client/Program.cs","sourceLine":66},{"id":"flow_type_nexusreader_web_client_program_cs_throwingbookstorageservice_74","kind":"dependency","label":"ThrowingBookStorageService","sourcePath":"NexusReader.Web.Client/Program.cs","sourceLine":74},{"id":"flow_type_nexusreader_web_client_program_cs_throwingebookrepository_84","kind":"dependency","label":"ThrowingEbookRepository","sourcePath":"NexusReader.Web.Client/Program.cs","sourceLine":84},{"id":"flow_type_nexusreader_web_client_program_cs_throwingsyncbroadcaster_94","kind":"dependency","label":"ThrowingSyncBroadcaster","sourcePath":"NexusReader.Web.Client/Program.cs","sourceLine":94},{"id":"flow_type_nexusreader_web_client_program_cs_webplatformservice_18","kind":"dependency","label":"WebPlatformService","sourcePath":"NexusReader.Web.Client/Program.cs","sourceLine":18},{"id":"flow_type_nexusreader_web_client_program_cs_nexusauthenticationstateprovider_33","kind":"dependency","label":"NexusAuthenticationStateProvider","sourcePath":"NexusReader.Web.Client/Program.cs","sourceLine":33},{"id":"flow_type_nexusreader_web_client_program_cs_wasmknowledgeservice_38","kind":"dependency","label":"WasmKnowledgeService","sourcePath":"NexusReader.Web.Client/Program.cs","sourceLine":38},{"id":"flow_type_nexusreader_web_client_program_cs_configured_httpclient_40","kind":"dependency","label":"configured HttpClient","sourcePath":"NexusReader.Web.Client/Program.cs","sourceLine":40},{"id":"flow_type_nexusreader_web_client_program_cs_throwingdbcontextfactory_49","kind":"dependency","label":"ThrowingDbContextFactory","sourcePath":"NexusReader.Web.Client/Program.cs","sourceLine":49}]}</script> <script type="application/json" data-ai-mermaid-metadata="6" data-ai-mermaid-diagram-id="method_flows_graph">{"edges":[{"id":"edge_flow_action_nexusreader_infrastructure_services_knowledgeservice_cs_getknowledgeinternalasync_guard_clause_83_83_flow_method_nexusreader_infrastructure_helpers_contenthasher_cs_computehash_9_uses_service_87","from":"flow_action_nexusreader_infrastructure_services_knowledgeservice_cs_getknowledgeinternalasync_guard_clause_83_83","to":"flow_method_nexusreader_infrastructure_helpers_contenthasher_cs_computehash_9","relation":"uses","semanticLabel":"ContentHasher.ComputeHash","payload":{"outputSummary":"normalizedText","expandedLabel":"uses-service"}},{"id":"edge_flow_action_nexusreader_infrastructure_services_knowledgeservice_cs_executeairequestandcacheasync_guard_clause_167_167_flow_method_nexusreader_infrastructure_helpers_jsonrepairhelper_cs_repair_8_uses_service_171","from":"flow_action_nexusreader_infrastructure_services_knowledgeservice_cs_executeairequestandcacheasync_guard_clause_167_167","to":"flow_method_nexusreader_infrastructure_helpers_jsonrepairhelper_cs_repair_8","relation":"uses","semanticLabel":"JsonRepairHelper.Repair","payload":{"outputSummary":"jsonResponse","expandedLabel":"uses-service"}},{"id":"edge_flow_action_nexusreader_infrastructure_services_knowledgeservice_cs_askquestionasync_repository_read_717_717_flow_method_nexusreader_infrastructure_helpers_jsonrepairhelper_cs_repair_8_uses_service_749","from":"flow_action_nexusreader_infrastructure_services_knowledgeservice_cs_askquestionasync_repository_read_717_717","to":"flow_method_nexusreader_infrastructure_helpers_jsonrepairhelper_cs_repair_8","relation":"uses","semanticLabel":"JsonRepairHelper.Repair","payload":{"outputSummary":"rawJson","expandedLabel":"uses-service"}},{"id":"edge_flow_file_nexusreader_infrastructure_helpers_contenthasher_cs_file_1_flow_method_nexusreader_infrastructure_helpers_contenthasher_cs_computehash_9_invokes_9","from":"flow_file_nexusreader_infrastructure_helpers_contenthasher_cs_file_1","to":"flow_method_nexusreader_infrastructure_helpers_contenthasher_cs_computehash_9","relation":"calls","semanticLabel":"ComputeHash","payload":{"outputSummary":"Normalizes input text, computes a SHA-256 hash of the UTF-8 bytes, and returns the lowercase hex string.","expandedLabel":"invokes"}},{"id":"edge_flow_method_nexusreader_infrastructure_helpers_contenthasher_cs_computehash_9_flow_action_nexusreader_infrastructure_helpers_contenthasher_cs_computehash_branch_11_11_evaluates_condition_11","from":"flow_method_nexusreader_infrastructure_helpers_contenthasher_cs_computehash_9","to":"flow_action_nexusreader_infrastructure_helpers_contenthasher_cs_computehash_branch_11_11","relation":"calls","semanticLabel":"true / false","payload":{"outputSummary":"if (string.IsNullOrWhiteSpace(input))","expandedLabel":"evaluates-condition"}},{"id":"edge_flow_file_nexusreader_infrastructure_helpers_jsonrepairhelper_cs_file_1_flow_method_nexusreader_infrastructure_helpers_jsonrepairhelper_cs_repair_8_invokes_8","from":"flow_file_nexusreader_infrastructure_helpers_jsonrepairhelper_cs_file_1","to":"flow_method_nexusreader_infrastructure_helpers_jsonrepairhelper_cs_repair_8","relation":"calls","semanticLabel":"Repair","payload":{"outputSummary":"Detects truncated/garbled JSON, prunes trailing garbage, and auto-closes open strings/brackets/braces to return a best-effort valid JSON string.","expandedLabel":"invokes"}},{"id":"edge_flow_method_nexusreader_infrastructure_helpers_jsonrepairhelper_cs_repair_8_flow_action_nexusreader_infrastructure_helpers_jsonrepairhelper_cs_repair_guard_clause_10_10_evaluates_condition_10","from":"flow_method_nexusreader_infrastructure_helpers_jsonrepairhelper_cs_repair_8","to":"flow_action_nexusreader_infrastructure_helpers_jsonrepairhelper_cs_repair_guard_clause_10_10","relation":"calls","semanticLabel":"exit / continue","payload":{"outputSummary":"if (string.IsNullOrWhiteSpace(json)) return json;","expandedLabel":"evaluates-condition"}},{"id":"edge_flow_file_nexusreader_infrastructure_realtime_synchub_cs_file_1_flow_method_nexusreader_infrastructure_realtime_synchub_cs_updateprogress_19_invokes_19","from":"flow_file_nexusreader_infrastructure_realtime_synchub_cs_file_1","to":"flow_method_nexusreader_infrastructure_realtime_synchub_cs_updateprogress_19","relation":"calls","semanticLabel":"UpdateProgress","payload":{"outputSummary":"Receives client progress updates, obtains the calling user id and forwards an UpdateReadingProgressCommand via MediatR when user is present.","expandedLabel":"handles-route"}},{"id":"edge_flow_method_nexusreader_infrastructure_realtime_synchub_cs_updateprogress_19_flow_action_nexusreader_infrastructure_realtime_synchub_cs_updateprogress_repository_read_21_21_invokes_21","from":"flow_method_nexusreader_infrastructure_realtime_synchub_cs_updateprogress_19","to":"flow_action_nexusreader_infrastructure_realtime_synchub_cs_updateprogress_repository_read_21_21","relation":"calls","semanticLabel":"Reads repository or persistence state","payload":{"outputSummary":"var userId = Context.User?.FindFirst(ClaimTypes.NameIdentifier)?.Value;","expandedLabel":"invokes"}},{"id":"edge_flow_file_nexusreader_infrastructure_realtime_synchub_cs_file_1_flow_method_nexusreader_infrastructure_realtime_synchub_cs_onconnectedasync_28_invokes_28","from":"flow_file_nexusreader_infrastructure_realtime_synchub_cs_file_1","to":"flow_method_nexusreader_infrastructure_realtime_synchub_cs_onconnectedasync_28","relation":"calls","semanticLabel":"OnConnectedAsync","payload":{"outputSummary":"When a client connects, adds their connection to a per-user SignalR group (User_{userId}) and calls base connection logic.","expandedLabel":"handles-route"}},{"id":"edge_flow_method_nexusreader_infrastructure_realtime_synchub_cs_onconnectedasync_28_flow_action_nexusreader_infrastructure_realtime_synchub_cs_onconnectedasync_repository_read_30_30_invokes_30","from":"flow_method_nexusreader_infrastructure_realtime_synchub_cs_onconnectedasync_28","to":"flow_action_nexusreader_infrastructure_realtime_synchub_cs_onconnectedasync_repository_read_30_30","relation":"calls","semanticLabel":"Reads repository or persistence state","payload":{"outputSummary":"var userId = Context.UserIdentifier;","expandedLabel":"invokes"}},{"id":"edge_flow_file_nexusreader_infrastructure_realtime_synchub_cs_file_1_flow_method_nexusreader_infrastructure_realtime_synchub_cs_ondisconnectedasync_38_invokes_38","from":"flow_file_nexusreader_infrastructure_realtime_synchub_cs_file_1","to":"flow_method_nexusreader_infrastructure_realtime_synchub_cs_ondisconnectedasync_38","relation":"calls","semanticLabel":"OnDisconnectedAsync","payload":{"outputSummary":"When a client disconnects, removes their connection from the per-user SignalR group and invokes base disconnect logic.","expandedLabel":"handles-route"}},{"id":"edge_flow_method_nexusreader_infrastructure_realtime_synchub_cs_ondisconnectedasync_38_flow_action_nexusreader_infrastructure_realtime_synchub_cs_ondisconnectedasync_repository_read_40_40_invokes_40","from":"flow_method_nexusreader_infrastructure_realtime_synchub_cs_ondisconnectedasync_38","to":"flow_action_nexusreader_infrastructure_realtime_synchub_cs_ondisconnectedasync_repository_read_40_40","relation":"calls","semanticLabel":"Reads repository or persistence state","payload":{"outputSummary":"var userId = Context.UserIdentifier;","expandedLabel":"invokes"}},{"id":"edge_flow_action_nexusreader_web_program_cs_program_top_level_branch_237_237_flow_method_nexusreader_infrastructure_realtime_synchub_cs_synchub_14_uses_service_247","from":"flow_action_nexusreader_web_program_cs_program_top_level_branch_237_237","to":"flow_method_nexusreader_infrastructure_realtime_synchub_cs_synchub_14","relation":"uses","semanticLabel":"SyncHub","payload":{"outputSummary":"Hub mapping for realtime sync","expandedLabel":"uses-service"}}],"nodes":[{"id":"flow_action_nexusreader_infrastructure_services_knowledgeservice_cs_getknowledgeinternalasync_guard_clause_83_83","kind":"step","label":"Guards early exit or rejection path","sourcePath":"NexusReader.Infrastructure/Services/KnowledgeService.cs","sourceLine":83},{"id":"flow_file_nexusreader_infrastructure_helpers_contenthasher_cs_file_1","kind":"service","label":"ContentHasher","sourcePath":"NexusReader.Infrastructure/Helpers/ContentHasher.cs","sourceLine":1},{"id":"flow_method_nexusreader_infrastructure_helpers_contenthasher_cs_computehash_9","kind":"method","label":"ComputeHash","sourcePath":"NexusReader.Infrastructure/Helpers/ContentHasher.cs","sourceLine":9},{"id":"flow_action_nexusreader_infrastructure_services_knowledgeservice_cs_executeairequestandcacheasync_guard_clause_167_167","kind":"step","label":"Guards early exit or rejection path","sourcePath":"NexusReader.Infrastructure/Services/KnowledgeService.cs","sourceLine":167},{"id":"flow_file_nexusreader_infrastructure_helpers_jsonrepairhelper_cs_file_1","kind":"service","label":"JsonRepairHelper","sourcePath":"NexusReader.Infrastructure/Helpers/JsonRepairHelper.cs","sourceLine":1},{"id":"flow_method_nexusreader_infrastructure_helpers_jsonrepairhelper_cs_repair_8","kind":"method","label":"Repair","sourcePath":"NexusReader.Infrastructure/Helpers/JsonRepairHelper.cs","sourceLine":8},{"id":"flow_action_nexusreader_infrastructure_services_knowledgeservice_cs_askquestionasync_repository_read_717_717","kind":"step","label":"Reads repository or persistence state","sourcePath":"NexusReader.Infrastructure/Services/KnowledgeService.cs","sourceLine":717},{"id":"flow_action_nexusreader_infrastructure_helpers_contenthasher_cs_computehash_branch_11_11","kind":"step","label":"Evaluates branch condition","sourcePath":"NexusReader.Infrastructure/Helpers/ContentHasher.cs","sourceLine":11},{"id":"flow_action_nexusreader_infrastructure_helpers_jsonrepairhelper_cs_repair_guard_clause_10_10","kind":"step","label":"Guards early exit or rejection path","sourcePath":"NexusReader.Infrastructure/Helpers/JsonRepairHelper.cs","sourceLine":10},{"id":"flow_file_nexusreader_infrastructure_realtime_synchub_cs_file_1","kind":"dependency","label":"SyncHub","sourcePath":"NexusReader.Infrastructure/RealTime/SyncHub.cs","sourceLine":1},{"id":"flow_method_nexusreader_infrastructure_realtime_synchub_cs_updateprogress_19","kind":"method","label":"UpdateProgress","sourcePath":"NexusReader.Infrastructure/RealTime/SyncHub.cs","sourceLine":19},{"id":"flow_action_nexusreader_infrastructure_realtime_synchub_cs_updateprogress_repository_read_21_21","kind":"step","label":"Reads repository or persistence state","sourcePath":"NexusReader.Infrastructure/RealTime/SyncHub.cs","sourceLine":21},{"id":"flow_method_nexusreader_infrastructure_realtime_synchub_cs_onconnectedasync_28","kind":"method","label":"OnConnectedAsync","sourcePath":"NexusReader.Infrastructure/RealTime/SyncHub.cs","sourceLine":28},{"id":"flow_action_nexusreader_infrastructure_realtime_synchub_cs_onconnectedasync_repository_read_30_30","kind":"step","label":"Reads repository or persistence state","sourcePath":"NexusReader.Infrastructure/RealTime/SyncHub.cs","sourceLine":30},{"id":"flow_method_nexusreader_infrastructure_realtime_synchub_cs_ondisconnectedasync_38","kind":"method","label":"OnDisconnectedAsync","sourcePath":"NexusReader.Infrastructure/RealTime/SyncHub.cs","sourceLine":38},{"id":"flow_action_nexusreader_infrastructure_realtime_synchub_cs_ondisconnectedasync_repository_read_40_40","kind":"step","label":"Reads repository or persistence state","sourcePath":"NexusReader.Infrastructure/RealTime/SyncHub.cs","sourceLine":40},{"id":"flow_action_nexusreader_web_program_cs_program_top_level_branch_237_237","kind":"step","label":"Evaluates branch condition","sourcePath":"NexusReader.Web/Program.cs","sourceLine":237},{"id":"flow_method_nexusreader_infrastructure_realtime_synchub_cs_synchub_14","kind":"method","label":"SyncHub","sourcePath":"NexusReader.Infrastructure/RealTime/SyncHub.cs","sourceLine":14}]}</script>

See Also