import type { IncomingMessage, ServerResponse } from 'node:http'; import type { DKGAgent, OpWalletsConfig } from '@origintrail-official/dkg-agent'; import type { ExtractionPipelineRegistry } from '@origintrail-official/dkg-core'; import { type AllowedHttpAuthentication } from '../../auth.js'; import type { ChatMemoryManager, DashboardDB, OperationTracker } from '@origintrail-official/dkg-node-ui'; import type { DkgConfig, Rfc64CatalogNormalizedActivationState, ResolvedRfc64CatalogActivationConfig, ResolvedRfc64PublicCatalogActivationConfig, loadNetworkConfig } from '../../config.js'; import type { VmPublisherControl } from '@origintrail-official/dkg-publisher'; import type { PublisherState } from '../../publisher-runner.js'; import type { ExtractionStatusRecord } from '../../extraction-status.js'; import type { FileStore } from '../../file-store.js'; import type { VectorStore, EmbeddingProvider } from '../../vector-store.js'; import type { CatchupTracker } from '../types.js'; import type { RoutePlugin } from '../plugin-api.js'; import type { AdmissionStatsView } from '../http-utils.js'; import type { EventLoopDelayView } from '../event-loop-delay-monitor.js'; import type { DaemonLocalLlmService } from '../local-llm-service.js'; import type { DaemonRouteRpcTransport } from '../rpc-runtime.js'; export type MemoryGraphLayer = 'wm' | 'swm' | 'vm'; export interface MemoryGraphChangedEvent { contextGraphId: string; layers: MemoryGraphLayer[]; subGraphName?: string; operation: string; source?: string; counts?: { triples?: number; roots?: number; }; clearSharedMemoryAfter?: boolean; dataSynced?: unknown; sharedMemorySynced?: unknown; status?: string; } /** * Generic notifications-pane refresh signal (A5). Broadcast once per scoped * notification write (join_request/approved/rejected + assertion_activity) so * the bell pane re-fetches via a SINGLE SSE listener instead of one per type. * Payload is intentionally minimal — the client always re-reads the scoped * feed, so it only needs to know "something for this CG of kind X happened". */ export interface NotificationSseEvent { contextGraphId: string; type: string; } declare const REQUEST_ACTOR_BRAND: unique symbol; declare const REQUEST_CONTEXT_BRAND: unique symbol; /** * The identity and authority used by one routed request. Constructed once by `handleRequest` so * routes cannot combine authentication from one credential with an operational identity derived * from another. */ export interface RequestActor { readonly [REQUEST_ACTOR_BRAND]: true; readonly authentication: AllowedHttpAuthentication; readonly authenticatedAgentAddress: string | undefined; readonly effectiveAgentAddress: string; } export declare function createRequestActor(authentication: AllowedHttpAuthentication, resolveEffectiveAgentAddress: (acceptedToken: string | undefined) => string): RequestActor; /** * Compatibility boundary for isolated route-handler embedders created before `RequestActor`. * Real daemon requests always take the first branch. In the fallback, credential identity still * wins over the legacy effective-address projection, so contradictory agent authority cannot be * assembled even by an untyped older caller. */ export declare function actorFromRequestContext(ctx: RequestContext): RequestActor; export interface RequestContext { /** Opaque: daemon request contexts are assembled only by the dispatch boundary. */ readonly [REQUEST_CONTEXT_BRAND]: true; req: IncomingMessage; res: ServerResponse; agent: DKGAgent; publisherControl: VmPublisherControl; /** Lifecycle-owned runtime and readiness as one correlated state. */ publisherState: PublisherState; config: DkgConfig; /** Immutable RFC-64 activation resolved once during daemon startup. */ rfc64Catalog?: ResolvedRfc64CatalogActivationConfig; /** Canonical activation precedence and execution fallback for this boot. */ rfc64CatalogActivationState: Rfc64CatalogNormalizedActivationState; /** Compatibility projection for the selected-public operator surface. */ rfc64PublicCatalog: ResolvedRfc64PublicCatalogActivationConfig; startedAt: number; dashDb: DashboardDB; opWallets: OpWalletsConfig; network: Awaited>; tracker: OperationTracker; memoryManager: ChatMemoryManager; bridgeAuthToken: string | undefined; nodeVersion: string; nodeCommit: string; catchupTracker: CatchupTracker; extractionRegistry: ExtractionPipelineRegistry; fileStore: FileStore; extractionStatus: Map; assertionImportLocks: Map>; vectorStore: VectorStore; embeddingProvider: EmbeddingProvider | null; validTokens: Set; apiHost: string; apiPortRef: { value: number; }; routePlugins: RoutePlugin[]; admission: AdmissionStatsView; /** Daemon-owned event-loop delay gauge (read-only); `/api/status` reports it. */ eventLoopDelay?: EventLoopDelayView; /** Daemon-owned, read-only local LLM session used by the Node UI. */ localLlm?: DaemonLocalLlmService; /** Daemon-owned admission + accounting shared by every direct route provider. */ routeRpcTransport?: DaemonRouteRpcTransport; url: URL; path: string; actor: RequestActor; /** @deprecated Built-in routes should use `actor.authentication`. Runtime getter only. */ readonly authentication: AllowedHttpAuthentication; /** @deprecated Built-in routes should use `actor.effectiveAgentAddress`. Runtime getter only. */ readonly requestAgentAddress: string; emitMemoryGraphChanged?: (event: MemoryGraphChangedEvent) => void; /** A5: broadcast a generic `notification` SSE refresh for the bell pane. */ emitNotification?: (event: NotificationSseEvent) => void; } /** Unbranded input fields accepted only by the daemon's request-context factory. */ export type RequestContextInputFields = Omit; export {}; //# sourceMappingURL=context.d.ts.map