/** * Read-only Mongo helpers to verify that activity documents were persisted. * Uses the same URI / database resolution as Activix wiring. Callers must pass * **`collection`** in options (package-owned name in source). */ export interface ActivixActivityDiagnosticSummary { /** Primary key value (stringified if non-string). */ activityId?: string; /** From `runContext.jobId` when present. */ jobId?: string; status?: unknown; /** Prefer top-level `metadata`, then `config`, then `outer.metadata`. */ provider?: unknown; /** Prefer `metadata.modelUsed` / `metadata.model`, then `config.model`, then `outer.metadata.model`. */ model?: unknown; /** From merged `config` / `outer.metadata` (`maxTokens` or `max_tokens`). */ maxTokens?: unknown; /** True when token usage is present on `outer.output.usage` (including partial failure payloads). */ hasUsage: boolean; /** Total tokens when derivable from usage (e.g. `total_tokens`). */ usageTotalTokens?: number; /** USD cost when a valid cost object exists on the row (including `outer.metadata.cost`). */ costUsd?: number; /** True when `outer.output` is not `null` / `undefined`. */ hasResponse: boolean; startTime?: unknown; endTime?: unknown; } export interface ActivixPersistenceTarget { mongoUri: string; dbName: string; collectionName: string; runContextField: string; primaryKeyField: string; purgeAtField: string; } export interface ActivixPersistenceVerificationOptions { /** @see resolveActivixMongoUriFromEnv */ mongoUri?: string; /** @see resolveActivixLogsDatabaseName */ mongoDb?: string; /** Package-owned MongoDB collection name (required; no environment fallback). */ collection: string; /** Matches collection config `runContextField` (default `runContext`). */ runContextField?: string; /** Matches collection config `primaryKey` (default `activityId`). */ primaryKeyField?: string; /** Soft-purge / tombstone field; set `false` to include tombstoned rows. @default purgedAt */ purgeAtField?: string | false; /** * How long to wait for server selection on connect (ms). * @default 5000 */ serverSelectionTimeoutMS?: number; } /** * Resolves Mongo URI, logs database name, and a diagnostics collection name. * `collection` must be passed explicitly (package-owned name in source). */ export declare function resolveActivixPersistenceTarget(options: ActivixPersistenceVerificationOptions): ActivixPersistenceTarget; export declare function summarizeActivixActivityForDiagnostics(doc: Record, options?: Pick): ActivixActivityDiagnosticSummary; export interface ActivixActivityPersistenceSnapshot { count: number; latest: ActivixActivityDiagnosticSummary[]; } /** * One Mongo connection: visible activity count plus the latest summaries (by `startTime` desc). */ export declare function getActivixActivityPersistenceSnapshotInMongo(latestLimit: number, options: ActivixPersistenceVerificationOptions): Promise; /** * Count documents in the configured activities collection. * By default excludes rows with a non-null soft-purge field (`purgedAt`), matching typical Activix visibility. */ export declare function countActivixActivitiesInMongo(options: ActivixPersistenceVerificationOptions): Promise; /** * Load the latest N activities by `startTime` descending and return diagnostic summaries. */ export declare function getActivixLatestActivitySummariesInMongo(limit: number, options: ActivixPersistenceVerificationOptions): Promise; //# sourceMappingURL=activityPersistenceVerification.d.ts.map