@dakera-ai/dakera 0.9.2 → 0.9.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +184 -1
- package/dist/index.d.ts +184 -1
- package/dist/index.js +158 -0
- package/dist/index.mjs +158 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -493,6 +493,8 @@ interface ConsolidateRequest {
|
|
|
493
493
|
threshold?: number;
|
|
494
494
|
/** Dry run mode */
|
|
495
495
|
dry_run?: boolean;
|
|
496
|
+
/** Optional DBSCAN algorithm config (CE-6) */
|
|
497
|
+
config?: ConsolidationConfig;
|
|
496
498
|
}
|
|
497
499
|
/** Response from consolidation */
|
|
498
500
|
interface ConsolidateResponse {
|
|
@@ -502,6 +504,8 @@ interface ConsolidateResponse {
|
|
|
502
504
|
removed_count: number;
|
|
503
505
|
/** IDs of new consolidated memories */
|
|
504
506
|
new_memories: MemoryId[];
|
|
507
|
+
/** Step-by-step consolidation log (CE-6) */
|
|
508
|
+
log?: ConsolidationLogEntry[];
|
|
505
509
|
}
|
|
506
510
|
/** Request for memory feedback */
|
|
507
511
|
interface MemoryFeedbackRequest {
|
|
@@ -1467,6 +1471,81 @@ interface NamespaceKeyUsageResponse {
|
|
|
1467
1471
|
bytes_transferred: number;
|
|
1468
1472
|
avg_latency_ms: number;
|
|
1469
1473
|
}
|
|
1474
|
+
/** Algorithm config for DBSCAN adaptive consolidation (CE-6). */
|
|
1475
|
+
interface ConsolidationConfig {
|
|
1476
|
+
/** Clustering algorithm: `"dbscan"` (default) or `"greedy"`. */
|
|
1477
|
+
algorithm?: 'dbscan' | 'greedy';
|
|
1478
|
+
/** Minimum cluster samples for DBSCAN. */
|
|
1479
|
+
min_samples?: number;
|
|
1480
|
+
/** Epsilon distance parameter for DBSCAN. */
|
|
1481
|
+
eps?: number;
|
|
1482
|
+
}
|
|
1483
|
+
/** One step in the consolidation execution log (CE-6). */
|
|
1484
|
+
interface ConsolidationLogEntry {
|
|
1485
|
+
step: string;
|
|
1486
|
+
memories_before: number;
|
|
1487
|
+
memories_after: number;
|
|
1488
|
+
duration_ms: number;
|
|
1489
|
+
}
|
|
1490
|
+
/** Response from POST /v1/import (DX-1). */
|
|
1491
|
+
interface MemoryImportResponse {
|
|
1492
|
+
imported_count: number;
|
|
1493
|
+
skipped_count: number;
|
|
1494
|
+
errors: string[];
|
|
1495
|
+
}
|
|
1496
|
+
/** Response from GET /v1/export (DX-1). */
|
|
1497
|
+
interface MemoryExportResponse {
|
|
1498
|
+
data: Record<string, unknown>[];
|
|
1499
|
+
format: string;
|
|
1500
|
+
count: number;
|
|
1501
|
+
}
|
|
1502
|
+
/** A single business-event entry from the audit log (OBS-1). */
|
|
1503
|
+
interface AuditEvent {
|
|
1504
|
+
id: string;
|
|
1505
|
+
event_type: string;
|
|
1506
|
+
agent_id?: string;
|
|
1507
|
+
namespace?: string;
|
|
1508
|
+
timestamp: number;
|
|
1509
|
+
details: Record<string, unknown>;
|
|
1510
|
+
}
|
|
1511
|
+
/** Response from GET /v1/audit (OBS-1). */
|
|
1512
|
+
interface AuditListResponse {
|
|
1513
|
+
events: AuditEvent[];
|
|
1514
|
+
total: number;
|
|
1515
|
+
cursor?: string;
|
|
1516
|
+
}
|
|
1517
|
+
/** Response from POST /v1/audit/export (OBS-1). */
|
|
1518
|
+
interface AuditExportResponse {
|
|
1519
|
+
data: string;
|
|
1520
|
+
format: string;
|
|
1521
|
+
count: number;
|
|
1522
|
+
}
|
|
1523
|
+
/** Result from POST /v1/extract (EXT-1). */
|
|
1524
|
+
interface ExtractionResult {
|
|
1525
|
+
entities: Record<string, unknown>[];
|
|
1526
|
+
provider: string;
|
|
1527
|
+
model?: string;
|
|
1528
|
+
duration_ms: number;
|
|
1529
|
+
}
|
|
1530
|
+
/** Metadata for an available extraction provider (EXT-1). */
|
|
1531
|
+
interface ExtractionProviderInfo {
|
|
1532
|
+
name: string;
|
|
1533
|
+
available: boolean;
|
|
1534
|
+
models: string[];
|
|
1535
|
+
}
|
|
1536
|
+
/** Request body for POST /v1/admin/encryption/rotate-key (SEC-3). */
|
|
1537
|
+
interface RotateEncryptionKeyRequest {
|
|
1538
|
+
/** New passphrase or 64-char hex key to rotate to. */
|
|
1539
|
+
new_key: string;
|
|
1540
|
+
/** If set, rotate only memories in this namespace. Omit to rotate all. */
|
|
1541
|
+
namespace?: string;
|
|
1542
|
+
}
|
|
1543
|
+
/** Response from POST /v1/admin/encryption/rotate-key (SEC-3). */
|
|
1544
|
+
interface RotateEncryptionKeyResponse {
|
|
1545
|
+
rotated: number;
|
|
1546
|
+
skipped: number;
|
|
1547
|
+
namespaces: string[];
|
|
1548
|
+
}
|
|
1470
1549
|
|
|
1471
1550
|
/**
|
|
1472
1551
|
* Dakera Client
|
|
@@ -2215,6 +2294,10 @@ declare class DakeraClient {
|
|
|
2215
2294
|
/** Get server stats (version, total_vectors, namespace_count, uptime_seconds, timestamp).
|
|
2216
2295
|
* Requires Read scope — works with read-only API keys, unlike clusterStatus. */
|
|
2217
2296
|
opsStats(): Promise<OpsStats>;
|
|
2297
|
+
/** Get Prometheus metrics in text exposition format (INFRA-3).
|
|
2298
|
+
* Requires Admin scope. Returns the raw Prometheus text exposition
|
|
2299
|
+
* format string suitable for scraping by a Prometheus server. */
|
|
2300
|
+
opsMetrics(): Promise<string>;
|
|
2218
2301
|
/** Get cluster status */
|
|
2219
2302
|
clusterStatus(): Promise<ClusterStatus>;
|
|
2220
2303
|
/** Get cluster nodes */
|
|
@@ -2278,6 +2361,17 @@ declare class DakeraClient {
|
|
|
2278
2361
|
decayUpdateConfig(request: DecayConfigUpdateRequest): Promise<DecayConfigUpdateResponse>;
|
|
2279
2362
|
/** Get decay activity counters and last-cycle snapshot (DECAY-2). Requires Admin scope. */
|
|
2280
2363
|
decayStats(): Promise<DecayStatsResponse>;
|
|
2364
|
+
/**
|
|
2365
|
+
* Re-encrypt all memory content blobs with a new AES-256-GCM key (SEC-3).
|
|
2366
|
+
*
|
|
2367
|
+
* After this call the new key is active in the running process.
|
|
2368
|
+
* The operator must update `DAKERA_ENCRYPTION_KEY` and restart to make the
|
|
2369
|
+
* rotation durable across restarts. Requires Admin scope.
|
|
2370
|
+
*
|
|
2371
|
+
* @param newKey - New passphrase or 64-char hex key.
|
|
2372
|
+
* @param namespace - Rotate only this namespace. Omit to rotate all.
|
|
2373
|
+
*/
|
|
2374
|
+
rotateEncryptionKey(newKey: string, namespace?: string): Promise<RotateEncryptionKeyResponse>;
|
|
2281
2375
|
/** Create a new API key */
|
|
2282
2376
|
createKey(request: CreateKeyRequest): Promise<ApiKey>;
|
|
2283
2377
|
/** List all API keys */
|
|
@@ -2433,6 +2527,95 @@ declare class DakeraClient {
|
|
|
2433
2527
|
* @param keyId The key whose usage to retrieve.
|
|
2434
2528
|
*/
|
|
2435
2529
|
getNamespaceKeyUsage(namespace: string, keyId: string): Promise<NamespaceKeyUsageResponse>;
|
|
2530
|
+
/**
|
|
2531
|
+
* Import memories from an external format (DX-1).
|
|
2532
|
+
*
|
|
2533
|
+
* @param data Serialised memories (list of objects for jsonl/mem0/zep, or a CSV string).
|
|
2534
|
+
* @param format One of `"jsonl"`, `"mem0"`, `"zep"`, `"csv"`. Defaults to `"jsonl"`.
|
|
2535
|
+
* @param agentId Assign all imported memories to this agent.
|
|
2536
|
+
* @param namespace Target namespace (defaults to the client's configured namespace).
|
|
2537
|
+
*/
|
|
2538
|
+
importMemories(data: unknown, format?: 'jsonl' | 'mem0' | 'zep' | 'csv', agentId?: string, namespace?: string): Promise<MemoryImportResponse>;
|
|
2539
|
+
/**
|
|
2540
|
+
* Export memories in a portable format (DX-1).
|
|
2541
|
+
*
|
|
2542
|
+
* @param format One of `"jsonl"`, `"mem0"`, `"zep"`, `"csv"`. Defaults to `"jsonl"`.
|
|
2543
|
+
* @param agentId Export only memories for this agent.
|
|
2544
|
+
* @param namespace Source namespace (defaults to client namespace).
|
|
2545
|
+
* @param limit Maximum number of memories to export.
|
|
2546
|
+
*/
|
|
2547
|
+
exportMemories(format?: 'jsonl' | 'mem0' | 'zep' | 'csv', agentId?: string, namespace?: string, limit?: number): Promise<MemoryExportResponse>;
|
|
2548
|
+
/**
|
|
2549
|
+
* List paginated audit log entries (OBS-1).
|
|
2550
|
+
*
|
|
2551
|
+
* @param agentId Filter to events from this agent.
|
|
2552
|
+
* @param eventType Filter to a specific event type string.
|
|
2553
|
+
* @param fromTs Unix timestamp lower bound (inclusive).
|
|
2554
|
+
* @param toTs Unix timestamp upper bound (exclusive).
|
|
2555
|
+
* @param limit Maximum number of events to return.
|
|
2556
|
+
* @param cursor Pagination cursor from a previous response.
|
|
2557
|
+
*/
|
|
2558
|
+
listAuditEvents(opts?: {
|
|
2559
|
+
agentId?: string;
|
|
2560
|
+
eventType?: string;
|
|
2561
|
+
fromTs?: number;
|
|
2562
|
+
toTs?: number;
|
|
2563
|
+
limit?: number;
|
|
2564
|
+
cursor?: string;
|
|
2565
|
+
}): Promise<AuditListResponse>;
|
|
2566
|
+
/**
|
|
2567
|
+
* Stream live audit events via SSE (OBS-1).
|
|
2568
|
+
*
|
|
2569
|
+
* Opens a long-lived connection to `GET /v1/audit/stream` and yields
|
|
2570
|
+
* {@link DakeraEvent} objects as they arrive.
|
|
2571
|
+
*
|
|
2572
|
+
* @param agentId Scope the stream to a specific agent.
|
|
2573
|
+
* @param eventType Scope the stream to a specific event type.
|
|
2574
|
+
*/
|
|
2575
|
+
streamAuditEvents(opts?: {
|
|
2576
|
+
agentId?: string;
|
|
2577
|
+
eventType?: string;
|
|
2578
|
+
}): AsyncGenerator<DakeraEvent>;
|
|
2579
|
+
/**
|
|
2580
|
+
* Bulk-export audit log entries (OBS-1).
|
|
2581
|
+
*
|
|
2582
|
+
* @param format `"jsonl"` (default) or `"csv"`.
|
|
2583
|
+
* @param agentId Filter to a specific agent.
|
|
2584
|
+
* @param eventType Filter to a specific event type.
|
|
2585
|
+
* @param fromTs Unix timestamp lower bound.
|
|
2586
|
+
* @param toTs Unix timestamp upper bound.
|
|
2587
|
+
*/
|
|
2588
|
+
exportAudit(opts?: {
|
|
2589
|
+
format?: 'jsonl' | 'csv';
|
|
2590
|
+
agentId?: string;
|
|
2591
|
+
eventType?: string;
|
|
2592
|
+
fromTs?: number;
|
|
2593
|
+
toTs?: number;
|
|
2594
|
+
}): Promise<AuditExportResponse>;
|
|
2595
|
+
/**
|
|
2596
|
+
* Extract entities from text using a pluggable provider (EXT-1).
|
|
2597
|
+
*
|
|
2598
|
+
* Provider hierarchy: per-request override > namespace default > GLiNER (bundled).
|
|
2599
|
+
*
|
|
2600
|
+
* @param text Input text to extract from.
|
|
2601
|
+
* @param namespace Namespace whose default extractor to inherit.
|
|
2602
|
+
* @param provider Override provider: `"gliner"`, `"openai"`, `"anthropic"`,
|
|
2603
|
+
* `"openrouter"`, or `"ollama"`.
|
|
2604
|
+
* @param model Override model within the chosen provider.
|
|
2605
|
+
*/
|
|
2606
|
+
extractText(text: string, namespace?: string, provider?: 'gliner' | 'openai' | 'anthropic' | 'openrouter' | 'ollama', model?: string): Promise<ExtractionResult>;
|
|
2607
|
+
/**
|
|
2608
|
+
* List available extraction providers and their supported models (EXT-1).
|
|
2609
|
+
*/
|
|
2610
|
+
listExtractProviders(): Promise<ExtractionProviderInfo[]>;
|
|
2611
|
+
/**
|
|
2612
|
+
* Set the default extraction provider for a namespace (EXT-1).
|
|
2613
|
+
*
|
|
2614
|
+
* @param namespace The namespace to configure.
|
|
2615
|
+
* @param provider Default provider.
|
|
2616
|
+
* @param model Default model within the provider (optional).
|
|
2617
|
+
*/
|
|
2618
|
+
configureNamespaceExtractor(namespace: string, provider: 'gliner' | 'openai' | 'anthropic' | 'openrouter' | 'ollama', model?: string): Promise<Record<string, unknown>>;
|
|
2436
2619
|
}
|
|
2437
2620
|
|
|
2438
2621
|
/**
|
|
@@ -2497,4 +2680,4 @@ declare class TimeoutError extends DakeraError {
|
|
|
2497
2680
|
constructor(message: string);
|
|
2498
2681
|
}
|
|
2499
2682
|
|
|
2500
|
-
export { type AccessPatternHint, type AgentFeedbackSummary, type AgentId, type AgentNetworkEdge, type AgentNetworkInfo, type AgentNetworkNode, type AgentNetworkStats, type AgentStats, type AgentSummary, type AggregationGroup, type AggregationRequest, type AggregationResponse, type AnalyticsOptions, type AnalyticsOverview, type ApiKey, AuthenticationError, AuthorizationError, type AutoPilotConfig, type AutoPilotConfigRequest, type AutoPilotConfigResponse, type AutoPilotConsolidationResult, type AutoPilotDedupResult, type AutoPilotStatusResponse, type AutoPilotTriggerAction, type AutoPilotTriggerResponse, type BackupInfo, type BatchForgetRequest, type BatchForgetResponse, type BatchMemoryFilter, type BatchQuerySpec, type BatchRecallRequest, type BatchRecallResponse, type BatchTextQueryOptions, type BatchTextQueryResponse, type Branded, type CacheStats, type ClientOptions, type ClusterNode, type ClusterStatus, type ColumnUpsertRequest, type ConfigureNamespaceRequest, type ConfigureNamespaceResponse, ConnectionError, type ConsolidateRequest, type ConsolidateResponse, type ConsolidationResultSnapshot, type CreateKeyRequest, type CreateNamespaceKeyResponse, type CrossAgentNetworkRequest, type CrossAgentNetworkResponse, DakeraClient, DakeraError, type DakeraEvent, type DecayConfigResponse, type DecayConfigUpdateRequest, type DecayConfigUpdateResponse, type DecayStatsResponse, type DedupResultSnapshot, type DeduplicateRequest, type DeduplicateResponse, type DeleteOptions, type DeleteResponse, type DistanceMetric, type Document, type DocumentInput, type EdgeType, type EmbeddingModel, type EntityExtractionResponse, ErrorCode, type ExportRequest, type ExportResponse, type ExportedVector, type ExtractedEntity, type FeedbackHealthResponse, type FeedbackHistoryEntry, type FeedbackHistoryResponse, type FeedbackResponse, type FeedbackSignal, type FilterExpression, type FilterOperators, type FullKnowledgeGraphRequest, type FullTextSearchResult, type GraphEdge, type GraphExport, type GraphLinkResponse, type GraphNode, type GraphPath, type HealthResponse, type HybridSearchResult, type IndexStats, type JobProgressEvent, type KeyUsage, type KnowledgeEdge, type KnowledgeGraphRequest, type KnowledgeGraphResponse, type KnowledgeNode, type LastDecayCycleStats, type LatencyAnalytics, type ListNamespaceKeysResponse, type ListSessionsOptions, type Memory, type MemoryEntitiesResponse, type MemoryEvent, type MemoryFeedbackBodyRequest, type MemoryFeedbackRequest, type MemoryFeedbackResponse, type MemoryGraph, type MemoryGraphOptions, type MemoryId, type MemoryImportancePatchRequest, type MemoryType, type MultiVectorSearchRequest, type MultiVectorSearchResponse, type MultiVectorSearchResult, type NamespaceCreatedEvent, type NamespaceDeletedEvent, type NamespaceInfo, type NamespaceKeyInfo, type NamespaceKeyUsageResponse, type NamespaceNerConfig, NotFoundError, type OpStatus, type OperationProgressEvent, type OpsStats, type QueryExplainRequest, type QueryExplainResponse, type QueryOptions, type QueryResult, RateLimitError, type RateLimitHeaders, type ReadConsistency, type RecallRequest, type RecalledMemory, type RetryConfig, type SearchResult, ServerError, type Session, type SessionId, type SlowQuery, type StalenessConfig, type StartSessionRequest, type StorageAnalytics, type StoreMemoryRequest, type StoreMemoryResponse, type StreamLaggedEvent, type SummarizeRequest, type SummarizeResponse, type TextDocument, type TextQueryOptions, type TextQueryResponse, type TextSearchResult, type TextUpsertOptions, type TextUpsertResponse, type ThroughputAnalytics, TimeoutError, type TtlConfig, type UnifiedQueryRequest, type UnifiedQueryResponse, type UnifiedSearchResult, type UpdateImportanceRequest, type UpdateMemoryRequest, type UpsertOptions, type UpsertResponse, ValidationError, type Vector, type VectorId, type VectorInput, type VectorMutationOp, type VectorsMutatedEvent, type WarmCacheRequest, type WarmCacheResponse, type WarmingPriority, type WarmingTargetTier, agentId, memoryId, sessionId, vectorId };
|
|
2683
|
+
export { type AccessPatternHint, type AgentFeedbackSummary, type AgentId, type AgentNetworkEdge, type AgentNetworkInfo, type AgentNetworkNode, type AgentNetworkStats, type AgentStats, type AgentSummary, type AggregationGroup, type AggregationRequest, type AggregationResponse, type AnalyticsOptions, type AnalyticsOverview, type ApiKey, type AuditEvent, type AuditExportResponse, type AuditListResponse, AuthenticationError, AuthorizationError, type AutoPilotConfig, type AutoPilotConfigRequest, type AutoPilotConfigResponse, type AutoPilotConsolidationResult, type AutoPilotDedupResult, type AutoPilotStatusResponse, type AutoPilotTriggerAction, type AutoPilotTriggerResponse, type BackupInfo, type BatchForgetRequest, type BatchForgetResponse, type BatchMemoryFilter, type BatchQuerySpec, type BatchRecallRequest, type BatchRecallResponse, type BatchTextQueryOptions, type BatchTextQueryResponse, type Branded, type CacheStats, type ClientOptions, type ClusterNode, type ClusterStatus, type ColumnUpsertRequest, type ConfigureNamespaceRequest, type ConfigureNamespaceResponse, ConnectionError, type ConsolidateRequest, type ConsolidateResponse, type ConsolidationConfig, type ConsolidationLogEntry, type ConsolidationResultSnapshot, type CreateKeyRequest, type CreateNamespaceKeyResponse, type CrossAgentNetworkRequest, type CrossAgentNetworkResponse, DakeraClient, DakeraError, type DakeraEvent, type DecayConfigResponse, type DecayConfigUpdateRequest, type DecayConfigUpdateResponse, type DecayStatsResponse, type DedupResultSnapshot, type DeduplicateRequest, type DeduplicateResponse, type DeleteOptions, type DeleteResponse, type DistanceMetric, type Document, type DocumentInput, type EdgeType, type EmbeddingModel, type EntityExtractionResponse, ErrorCode, type ExportRequest, type ExportResponse, type ExportedVector, type ExtractedEntity, type ExtractionProviderInfo, type ExtractionResult, type FeedbackHealthResponse, type FeedbackHistoryEntry, type FeedbackHistoryResponse, type FeedbackResponse, type FeedbackSignal, type FilterExpression, type FilterOperators, type FullKnowledgeGraphRequest, type FullTextSearchResult, type GraphEdge, type GraphExport, type GraphLinkResponse, type GraphNode, type GraphPath, type HealthResponse, type HybridSearchResult, type IndexStats, type JobProgressEvent, type KeyUsage, type KnowledgeEdge, type KnowledgeGraphRequest, type KnowledgeGraphResponse, type KnowledgeNode, type LastDecayCycleStats, type LatencyAnalytics, type ListNamespaceKeysResponse, type ListSessionsOptions, type Memory, type MemoryEntitiesResponse, type MemoryEvent, type MemoryExportResponse, type MemoryFeedbackBodyRequest, type MemoryFeedbackRequest, type MemoryFeedbackResponse, type MemoryGraph, type MemoryGraphOptions, type MemoryId, type MemoryImportResponse, type MemoryImportancePatchRequest, type MemoryType, type MultiVectorSearchRequest, type MultiVectorSearchResponse, type MultiVectorSearchResult, type NamespaceCreatedEvent, type NamespaceDeletedEvent, type NamespaceInfo, type NamespaceKeyInfo, type NamespaceKeyUsageResponse, type NamespaceNerConfig, NotFoundError, type OpStatus, type OperationProgressEvent, type OpsStats, type QueryExplainRequest, type QueryExplainResponse, type QueryOptions, type QueryResult, RateLimitError, type RateLimitHeaders, type ReadConsistency, type RecallRequest, type RecalledMemory, type RetryConfig, type RotateEncryptionKeyRequest, type RotateEncryptionKeyResponse, type SearchResult, ServerError, type Session, type SessionId, type SlowQuery, type StalenessConfig, type StartSessionRequest, type StorageAnalytics, type StoreMemoryRequest, type StoreMemoryResponse, type StreamLaggedEvent, type SummarizeRequest, type SummarizeResponse, type TextDocument, type TextQueryOptions, type TextQueryResponse, type TextSearchResult, type TextUpsertOptions, type TextUpsertResponse, type ThroughputAnalytics, TimeoutError, type TtlConfig, type UnifiedQueryRequest, type UnifiedQueryResponse, type UnifiedSearchResult, type UpdateImportanceRequest, type UpdateMemoryRequest, type UpsertOptions, type UpsertResponse, ValidationError, type Vector, type VectorId, type VectorInput, type VectorMutationOp, type VectorsMutatedEvent, type WarmCacheRequest, type WarmCacheResponse, type WarmingPriority, type WarmingTargetTier, agentId, memoryId, sessionId, vectorId };
|
package/dist/index.d.ts
CHANGED
|
@@ -493,6 +493,8 @@ interface ConsolidateRequest {
|
|
|
493
493
|
threshold?: number;
|
|
494
494
|
/** Dry run mode */
|
|
495
495
|
dry_run?: boolean;
|
|
496
|
+
/** Optional DBSCAN algorithm config (CE-6) */
|
|
497
|
+
config?: ConsolidationConfig;
|
|
496
498
|
}
|
|
497
499
|
/** Response from consolidation */
|
|
498
500
|
interface ConsolidateResponse {
|
|
@@ -502,6 +504,8 @@ interface ConsolidateResponse {
|
|
|
502
504
|
removed_count: number;
|
|
503
505
|
/** IDs of new consolidated memories */
|
|
504
506
|
new_memories: MemoryId[];
|
|
507
|
+
/** Step-by-step consolidation log (CE-6) */
|
|
508
|
+
log?: ConsolidationLogEntry[];
|
|
505
509
|
}
|
|
506
510
|
/** Request for memory feedback */
|
|
507
511
|
interface MemoryFeedbackRequest {
|
|
@@ -1467,6 +1471,81 @@ interface NamespaceKeyUsageResponse {
|
|
|
1467
1471
|
bytes_transferred: number;
|
|
1468
1472
|
avg_latency_ms: number;
|
|
1469
1473
|
}
|
|
1474
|
+
/** Algorithm config for DBSCAN adaptive consolidation (CE-6). */
|
|
1475
|
+
interface ConsolidationConfig {
|
|
1476
|
+
/** Clustering algorithm: `"dbscan"` (default) or `"greedy"`. */
|
|
1477
|
+
algorithm?: 'dbscan' | 'greedy';
|
|
1478
|
+
/** Minimum cluster samples for DBSCAN. */
|
|
1479
|
+
min_samples?: number;
|
|
1480
|
+
/** Epsilon distance parameter for DBSCAN. */
|
|
1481
|
+
eps?: number;
|
|
1482
|
+
}
|
|
1483
|
+
/** One step in the consolidation execution log (CE-6). */
|
|
1484
|
+
interface ConsolidationLogEntry {
|
|
1485
|
+
step: string;
|
|
1486
|
+
memories_before: number;
|
|
1487
|
+
memories_after: number;
|
|
1488
|
+
duration_ms: number;
|
|
1489
|
+
}
|
|
1490
|
+
/** Response from POST /v1/import (DX-1). */
|
|
1491
|
+
interface MemoryImportResponse {
|
|
1492
|
+
imported_count: number;
|
|
1493
|
+
skipped_count: number;
|
|
1494
|
+
errors: string[];
|
|
1495
|
+
}
|
|
1496
|
+
/** Response from GET /v1/export (DX-1). */
|
|
1497
|
+
interface MemoryExportResponse {
|
|
1498
|
+
data: Record<string, unknown>[];
|
|
1499
|
+
format: string;
|
|
1500
|
+
count: number;
|
|
1501
|
+
}
|
|
1502
|
+
/** A single business-event entry from the audit log (OBS-1). */
|
|
1503
|
+
interface AuditEvent {
|
|
1504
|
+
id: string;
|
|
1505
|
+
event_type: string;
|
|
1506
|
+
agent_id?: string;
|
|
1507
|
+
namespace?: string;
|
|
1508
|
+
timestamp: number;
|
|
1509
|
+
details: Record<string, unknown>;
|
|
1510
|
+
}
|
|
1511
|
+
/** Response from GET /v1/audit (OBS-1). */
|
|
1512
|
+
interface AuditListResponse {
|
|
1513
|
+
events: AuditEvent[];
|
|
1514
|
+
total: number;
|
|
1515
|
+
cursor?: string;
|
|
1516
|
+
}
|
|
1517
|
+
/** Response from POST /v1/audit/export (OBS-1). */
|
|
1518
|
+
interface AuditExportResponse {
|
|
1519
|
+
data: string;
|
|
1520
|
+
format: string;
|
|
1521
|
+
count: number;
|
|
1522
|
+
}
|
|
1523
|
+
/** Result from POST /v1/extract (EXT-1). */
|
|
1524
|
+
interface ExtractionResult {
|
|
1525
|
+
entities: Record<string, unknown>[];
|
|
1526
|
+
provider: string;
|
|
1527
|
+
model?: string;
|
|
1528
|
+
duration_ms: number;
|
|
1529
|
+
}
|
|
1530
|
+
/** Metadata for an available extraction provider (EXT-1). */
|
|
1531
|
+
interface ExtractionProviderInfo {
|
|
1532
|
+
name: string;
|
|
1533
|
+
available: boolean;
|
|
1534
|
+
models: string[];
|
|
1535
|
+
}
|
|
1536
|
+
/** Request body for POST /v1/admin/encryption/rotate-key (SEC-3). */
|
|
1537
|
+
interface RotateEncryptionKeyRequest {
|
|
1538
|
+
/** New passphrase or 64-char hex key to rotate to. */
|
|
1539
|
+
new_key: string;
|
|
1540
|
+
/** If set, rotate only memories in this namespace. Omit to rotate all. */
|
|
1541
|
+
namespace?: string;
|
|
1542
|
+
}
|
|
1543
|
+
/** Response from POST /v1/admin/encryption/rotate-key (SEC-3). */
|
|
1544
|
+
interface RotateEncryptionKeyResponse {
|
|
1545
|
+
rotated: number;
|
|
1546
|
+
skipped: number;
|
|
1547
|
+
namespaces: string[];
|
|
1548
|
+
}
|
|
1470
1549
|
|
|
1471
1550
|
/**
|
|
1472
1551
|
* Dakera Client
|
|
@@ -2215,6 +2294,10 @@ declare class DakeraClient {
|
|
|
2215
2294
|
/** Get server stats (version, total_vectors, namespace_count, uptime_seconds, timestamp).
|
|
2216
2295
|
* Requires Read scope — works with read-only API keys, unlike clusterStatus. */
|
|
2217
2296
|
opsStats(): Promise<OpsStats>;
|
|
2297
|
+
/** Get Prometheus metrics in text exposition format (INFRA-3).
|
|
2298
|
+
* Requires Admin scope. Returns the raw Prometheus text exposition
|
|
2299
|
+
* format string suitable for scraping by a Prometheus server. */
|
|
2300
|
+
opsMetrics(): Promise<string>;
|
|
2218
2301
|
/** Get cluster status */
|
|
2219
2302
|
clusterStatus(): Promise<ClusterStatus>;
|
|
2220
2303
|
/** Get cluster nodes */
|
|
@@ -2278,6 +2361,17 @@ declare class DakeraClient {
|
|
|
2278
2361
|
decayUpdateConfig(request: DecayConfigUpdateRequest): Promise<DecayConfigUpdateResponse>;
|
|
2279
2362
|
/** Get decay activity counters and last-cycle snapshot (DECAY-2). Requires Admin scope. */
|
|
2280
2363
|
decayStats(): Promise<DecayStatsResponse>;
|
|
2364
|
+
/**
|
|
2365
|
+
* Re-encrypt all memory content blobs with a new AES-256-GCM key (SEC-3).
|
|
2366
|
+
*
|
|
2367
|
+
* After this call the new key is active in the running process.
|
|
2368
|
+
* The operator must update `DAKERA_ENCRYPTION_KEY` and restart to make the
|
|
2369
|
+
* rotation durable across restarts. Requires Admin scope.
|
|
2370
|
+
*
|
|
2371
|
+
* @param newKey - New passphrase or 64-char hex key.
|
|
2372
|
+
* @param namespace - Rotate only this namespace. Omit to rotate all.
|
|
2373
|
+
*/
|
|
2374
|
+
rotateEncryptionKey(newKey: string, namespace?: string): Promise<RotateEncryptionKeyResponse>;
|
|
2281
2375
|
/** Create a new API key */
|
|
2282
2376
|
createKey(request: CreateKeyRequest): Promise<ApiKey>;
|
|
2283
2377
|
/** List all API keys */
|
|
@@ -2433,6 +2527,95 @@ declare class DakeraClient {
|
|
|
2433
2527
|
* @param keyId The key whose usage to retrieve.
|
|
2434
2528
|
*/
|
|
2435
2529
|
getNamespaceKeyUsage(namespace: string, keyId: string): Promise<NamespaceKeyUsageResponse>;
|
|
2530
|
+
/**
|
|
2531
|
+
* Import memories from an external format (DX-1).
|
|
2532
|
+
*
|
|
2533
|
+
* @param data Serialised memories (list of objects for jsonl/mem0/zep, or a CSV string).
|
|
2534
|
+
* @param format One of `"jsonl"`, `"mem0"`, `"zep"`, `"csv"`. Defaults to `"jsonl"`.
|
|
2535
|
+
* @param agentId Assign all imported memories to this agent.
|
|
2536
|
+
* @param namespace Target namespace (defaults to the client's configured namespace).
|
|
2537
|
+
*/
|
|
2538
|
+
importMemories(data: unknown, format?: 'jsonl' | 'mem0' | 'zep' | 'csv', agentId?: string, namespace?: string): Promise<MemoryImportResponse>;
|
|
2539
|
+
/**
|
|
2540
|
+
* Export memories in a portable format (DX-1).
|
|
2541
|
+
*
|
|
2542
|
+
* @param format One of `"jsonl"`, `"mem0"`, `"zep"`, `"csv"`. Defaults to `"jsonl"`.
|
|
2543
|
+
* @param agentId Export only memories for this agent.
|
|
2544
|
+
* @param namespace Source namespace (defaults to client namespace).
|
|
2545
|
+
* @param limit Maximum number of memories to export.
|
|
2546
|
+
*/
|
|
2547
|
+
exportMemories(format?: 'jsonl' | 'mem0' | 'zep' | 'csv', agentId?: string, namespace?: string, limit?: number): Promise<MemoryExportResponse>;
|
|
2548
|
+
/**
|
|
2549
|
+
* List paginated audit log entries (OBS-1).
|
|
2550
|
+
*
|
|
2551
|
+
* @param agentId Filter to events from this agent.
|
|
2552
|
+
* @param eventType Filter to a specific event type string.
|
|
2553
|
+
* @param fromTs Unix timestamp lower bound (inclusive).
|
|
2554
|
+
* @param toTs Unix timestamp upper bound (exclusive).
|
|
2555
|
+
* @param limit Maximum number of events to return.
|
|
2556
|
+
* @param cursor Pagination cursor from a previous response.
|
|
2557
|
+
*/
|
|
2558
|
+
listAuditEvents(opts?: {
|
|
2559
|
+
agentId?: string;
|
|
2560
|
+
eventType?: string;
|
|
2561
|
+
fromTs?: number;
|
|
2562
|
+
toTs?: number;
|
|
2563
|
+
limit?: number;
|
|
2564
|
+
cursor?: string;
|
|
2565
|
+
}): Promise<AuditListResponse>;
|
|
2566
|
+
/**
|
|
2567
|
+
* Stream live audit events via SSE (OBS-1).
|
|
2568
|
+
*
|
|
2569
|
+
* Opens a long-lived connection to `GET /v1/audit/stream` and yields
|
|
2570
|
+
* {@link DakeraEvent} objects as they arrive.
|
|
2571
|
+
*
|
|
2572
|
+
* @param agentId Scope the stream to a specific agent.
|
|
2573
|
+
* @param eventType Scope the stream to a specific event type.
|
|
2574
|
+
*/
|
|
2575
|
+
streamAuditEvents(opts?: {
|
|
2576
|
+
agentId?: string;
|
|
2577
|
+
eventType?: string;
|
|
2578
|
+
}): AsyncGenerator<DakeraEvent>;
|
|
2579
|
+
/**
|
|
2580
|
+
* Bulk-export audit log entries (OBS-1).
|
|
2581
|
+
*
|
|
2582
|
+
* @param format `"jsonl"` (default) or `"csv"`.
|
|
2583
|
+
* @param agentId Filter to a specific agent.
|
|
2584
|
+
* @param eventType Filter to a specific event type.
|
|
2585
|
+
* @param fromTs Unix timestamp lower bound.
|
|
2586
|
+
* @param toTs Unix timestamp upper bound.
|
|
2587
|
+
*/
|
|
2588
|
+
exportAudit(opts?: {
|
|
2589
|
+
format?: 'jsonl' | 'csv';
|
|
2590
|
+
agentId?: string;
|
|
2591
|
+
eventType?: string;
|
|
2592
|
+
fromTs?: number;
|
|
2593
|
+
toTs?: number;
|
|
2594
|
+
}): Promise<AuditExportResponse>;
|
|
2595
|
+
/**
|
|
2596
|
+
* Extract entities from text using a pluggable provider (EXT-1).
|
|
2597
|
+
*
|
|
2598
|
+
* Provider hierarchy: per-request override > namespace default > GLiNER (bundled).
|
|
2599
|
+
*
|
|
2600
|
+
* @param text Input text to extract from.
|
|
2601
|
+
* @param namespace Namespace whose default extractor to inherit.
|
|
2602
|
+
* @param provider Override provider: `"gliner"`, `"openai"`, `"anthropic"`,
|
|
2603
|
+
* `"openrouter"`, or `"ollama"`.
|
|
2604
|
+
* @param model Override model within the chosen provider.
|
|
2605
|
+
*/
|
|
2606
|
+
extractText(text: string, namespace?: string, provider?: 'gliner' | 'openai' | 'anthropic' | 'openrouter' | 'ollama', model?: string): Promise<ExtractionResult>;
|
|
2607
|
+
/**
|
|
2608
|
+
* List available extraction providers and their supported models (EXT-1).
|
|
2609
|
+
*/
|
|
2610
|
+
listExtractProviders(): Promise<ExtractionProviderInfo[]>;
|
|
2611
|
+
/**
|
|
2612
|
+
* Set the default extraction provider for a namespace (EXT-1).
|
|
2613
|
+
*
|
|
2614
|
+
* @param namespace The namespace to configure.
|
|
2615
|
+
* @param provider Default provider.
|
|
2616
|
+
* @param model Default model within the provider (optional).
|
|
2617
|
+
*/
|
|
2618
|
+
configureNamespaceExtractor(namespace: string, provider: 'gliner' | 'openai' | 'anthropic' | 'openrouter' | 'ollama', model?: string): Promise<Record<string, unknown>>;
|
|
2436
2619
|
}
|
|
2437
2620
|
|
|
2438
2621
|
/**
|
|
@@ -2497,4 +2680,4 @@ declare class TimeoutError extends DakeraError {
|
|
|
2497
2680
|
constructor(message: string);
|
|
2498
2681
|
}
|
|
2499
2682
|
|
|
2500
|
-
export { type AccessPatternHint, type AgentFeedbackSummary, type AgentId, type AgentNetworkEdge, type AgentNetworkInfo, type AgentNetworkNode, type AgentNetworkStats, type AgentStats, type AgentSummary, type AggregationGroup, type AggregationRequest, type AggregationResponse, type AnalyticsOptions, type AnalyticsOverview, type ApiKey, AuthenticationError, AuthorizationError, type AutoPilotConfig, type AutoPilotConfigRequest, type AutoPilotConfigResponse, type AutoPilotConsolidationResult, type AutoPilotDedupResult, type AutoPilotStatusResponse, type AutoPilotTriggerAction, type AutoPilotTriggerResponse, type BackupInfo, type BatchForgetRequest, type BatchForgetResponse, type BatchMemoryFilter, type BatchQuerySpec, type BatchRecallRequest, type BatchRecallResponse, type BatchTextQueryOptions, type BatchTextQueryResponse, type Branded, type CacheStats, type ClientOptions, type ClusterNode, type ClusterStatus, type ColumnUpsertRequest, type ConfigureNamespaceRequest, type ConfigureNamespaceResponse, ConnectionError, type ConsolidateRequest, type ConsolidateResponse, type ConsolidationResultSnapshot, type CreateKeyRequest, type CreateNamespaceKeyResponse, type CrossAgentNetworkRequest, type CrossAgentNetworkResponse, DakeraClient, DakeraError, type DakeraEvent, type DecayConfigResponse, type DecayConfigUpdateRequest, type DecayConfigUpdateResponse, type DecayStatsResponse, type DedupResultSnapshot, type DeduplicateRequest, type DeduplicateResponse, type DeleteOptions, type DeleteResponse, type DistanceMetric, type Document, type DocumentInput, type EdgeType, type EmbeddingModel, type EntityExtractionResponse, ErrorCode, type ExportRequest, type ExportResponse, type ExportedVector, type ExtractedEntity, type FeedbackHealthResponse, type FeedbackHistoryEntry, type FeedbackHistoryResponse, type FeedbackResponse, type FeedbackSignal, type FilterExpression, type FilterOperators, type FullKnowledgeGraphRequest, type FullTextSearchResult, type GraphEdge, type GraphExport, type GraphLinkResponse, type GraphNode, type GraphPath, type HealthResponse, type HybridSearchResult, type IndexStats, type JobProgressEvent, type KeyUsage, type KnowledgeEdge, type KnowledgeGraphRequest, type KnowledgeGraphResponse, type KnowledgeNode, type LastDecayCycleStats, type LatencyAnalytics, type ListNamespaceKeysResponse, type ListSessionsOptions, type Memory, type MemoryEntitiesResponse, type MemoryEvent, type MemoryFeedbackBodyRequest, type MemoryFeedbackRequest, type MemoryFeedbackResponse, type MemoryGraph, type MemoryGraphOptions, type MemoryId, type MemoryImportancePatchRequest, type MemoryType, type MultiVectorSearchRequest, type MultiVectorSearchResponse, type MultiVectorSearchResult, type NamespaceCreatedEvent, type NamespaceDeletedEvent, type NamespaceInfo, type NamespaceKeyInfo, type NamespaceKeyUsageResponse, type NamespaceNerConfig, NotFoundError, type OpStatus, type OperationProgressEvent, type OpsStats, type QueryExplainRequest, type QueryExplainResponse, type QueryOptions, type QueryResult, RateLimitError, type RateLimitHeaders, type ReadConsistency, type RecallRequest, type RecalledMemory, type RetryConfig, type SearchResult, ServerError, type Session, type SessionId, type SlowQuery, type StalenessConfig, type StartSessionRequest, type StorageAnalytics, type StoreMemoryRequest, type StoreMemoryResponse, type StreamLaggedEvent, type SummarizeRequest, type SummarizeResponse, type TextDocument, type TextQueryOptions, type TextQueryResponse, type TextSearchResult, type TextUpsertOptions, type TextUpsertResponse, type ThroughputAnalytics, TimeoutError, type TtlConfig, type UnifiedQueryRequest, type UnifiedQueryResponse, type UnifiedSearchResult, type UpdateImportanceRequest, type UpdateMemoryRequest, type UpsertOptions, type UpsertResponse, ValidationError, type Vector, type VectorId, type VectorInput, type VectorMutationOp, type VectorsMutatedEvent, type WarmCacheRequest, type WarmCacheResponse, type WarmingPriority, type WarmingTargetTier, agentId, memoryId, sessionId, vectorId };
|
|
2683
|
+
export { type AccessPatternHint, type AgentFeedbackSummary, type AgentId, type AgentNetworkEdge, type AgentNetworkInfo, type AgentNetworkNode, type AgentNetworkStats, type AgentStats, type AgentSummary, type AggregationGroup, type AggregationRequest, type AggregationResponse, type AnalyticsOptions, type AnalyticsOverview, type ApiKey, type AuditEvent, type AuditExportResponse, type AuditListResponse, AuthenticationError, AuthorizationError, type AutoPilotConfig, type AutoPilotConfigRequest, type AutoPilotConfigResponse, type AutoPilotConsolidationResult, type AutoPilotDedupResult, type AutoPilotStatusResponse, type AutoPilotTriggerAction, type AutoPilotTriggerResponse, type BackupInfo, type BatchForgetRequest, type BatchForgetResponse, type BatchMemoryFilter, type BatchQuerySpec, type BatchRecallRequest, type BatchRecallResponse, type BatchTextQueryOptions, type BatchTextQueryResponse, type Branded, type CacheStats, type ClientOptions, type ClusterNode, type ClusterStatus, type ColumnUpsertRequest, type ConfigureNamespaceRequest, type ConfigureNamespaceResponse, ConnectionError, type ConsolidateRequest, type ConsolidateResponse, type ConsolidationConfig, type ConsolidationLogEntry, type ConsolidationResultSnapshot, type CreateKeyRequest, type CreateNamespaceKeyResponse, type CrossAgentNetworkRequest, type CrossAgentNetworkResponse, DakeraClient, DakeraError, type DakeraEvent, type DecayConfigResponse, type DecayConfigUpdateRequest, type DecayConfigUpdateResponse, type DecayStatsResponse, type DedupResultSnapshot, type DeduplicateRequest, type DeduplicateResponse, type DeleteOptions, type DeleteResponse, type DistanceMetric, type Document, type DocumentInput, type EdgeType, type EmbeddingModel, type EntityExtractionResponse, ErrorCode, type ExportRequest, type ExportResponse, type ExportedVector, type ExtractedEntity, type ExtractionProviderInfo, type ExtractionResult, type FeedbackHealthResponse, type FeedbackHistoryEntry, type FeedbackHistoryResponse, type FeedbackResponse, type FeedbackSignal, type FilterExpression, type FilterOperators, type FullKnowledgeGraphRequest, type FullTextSearchResult, type GraphEdge, type GraphExport, type GraphLinkResponse, type GraphNode, type GraphPath, type HealthResponse, type HybridSearchResult, type IndexStats, type JobProgressEvent, type KeyUsage, type KnowledgeEdge, type KnowledgeGraphRequest, type KnowledgeGraphResponse, type KnowledgeNode, type LastDecayCycleStats, type LatencyAnalytics, type ListNamespaceKeysResponse, type ListSessionsOptions, type Memory, type MemoryEntitiesResponse, type MemoryEvent, type MemoryExportResponse, type MemoryFeedbackBodyRequest, type MemoryFeedbackRequest, type MemoryFeedbackResponse, type MemoryGraph, type MemoryGraphOptions, type MemoryId, type MemoryImportResponse, type MemoryImportancePatchRequest, type MemoryType, type MultiVectorSearchRequest, type MultiVectorSearchResponse, type MultiVectorSearchResult, type NamespaceCreatedEvent, type NamespaceDeletedEvent, type NamespaceInfo, type NamespaceKeyInfo, type NamespaceKeyUsageResponse, type NamespaceNerConfig, NotFoundError, type OpStatus, type OperationProgressEvent, type OpsStats, type QueryExplainRequest, type QueryExplainResponse, type QueryOptions, type QueryResult, RateLimitError, type RateLimitHeaders, type ReadConsistency, type RecallRequest, type RecalledMemory, type RetryConfig, type RotateEncryptionKeyRequest, type RotateEncryptionKeyResponse, type SearchResult, ServerError, type Session, type SessionId, type SlowQuery, type StalenessConfig, type StartSessionRequest, type StorageAnalytics, type StoreMemoryRequest, type StoreMemoryResponse, type StreamLaggedEvent, type SummarizeRequest, type SummarizeResponse, type TextDocument, type TextQueryOptions, type TextQueryResponse, type TextSearchResult, type TextUpsertOptions, type TextUpsertResponse, type ThroughputAnalytics, TimeoutError, type TtlConfig, type UnifiedQueryRequest, type UnifiedQueryResponse, type UnifiedSearchResult, type UpdateImportanceRequest, type UpdateMemoryRequest, type UpsertOptions, type UpsertResponse, ValidationError, type Vector, type VectorId, type VectorInput, type VectorMutationOp, type VectorsMutatedEvent, type WarmCacheRequest, type WarmCacheResponse, type WarmingPriority, type WarmingTargetTier, agentId, memoryId, sessionId, vectorId };
|
package/dist/index.js
CHANGED
|
@@ -1435,6 +1435,12 @@ var DakeraClient = class {
|
|
|
1435
1435
|
async opsStats() {
|
|
1436
1436
|
return this.request("GET", "/v1/ops/stats");
|
|
1437
1437
|
}
|
|
1438
|
+
/** Get Prometheus metrics in text exposition format (INFRA-3).
|
|
1439
|
+
* Requires Admin scope. Returns the raw Prometheus text exposition
|
|
1440
|
+
* format string suitable for scraping by a Prometheus server. */
|
|
1441
|
+
async opsMetrics() {
|
|
1442
|
+
return this.request("GET", "/v1/ops/metrics");
|
|
1443
|
+
}
|
|
1438
1444
|
/** Get cluster status */
|
|
1439
1445
|
async clusterStatus() {
|
|
1440
1446
|
return this.request("GET", "/v1/admin/cluster/status");
|
|
@@ -1538,6 +1544,25 @@ var DakeraClient = class {
|
|
|
1538
1544
|
async decayStats() {
|
|
1539
1545
|
return this.request("GET", "/v1/admin/decay/stats");
|
|
1540
1546
|
}
|
|
1547
|
+
/**
|
|
1548
|
+
* Re-encrypt all memory content blobs with a new AES-256-GCM key (SEC-3).
|
|
1549
|
+
*
|
|
1550
|
+
* After this call the new key is active in the running process.
|
|
1551
|
+
* The operator must update `DAKERA_ENCRYPTION_KEY` and restart to make the
|
|
1552
|
+
* rotation durable across restarts. Requires Admin scope.
|
|
1553
|
+
*
|
|
1554
|
+
* @param newKey - New passphrase or 64-char hex key.
|
|
1555
|
+
* @param namespace - Rotate only this namespace. Omit to rotate all.
|
|
1556
|
+
*/
|
|
1557
|
+
async rotateEncryptionKey(newKey, namespace) {
|
|
1558
|
+
const body = { new_key: newKey };
|
|
1559
|
+
if (namespace !== void 0) body.namespace = namespace;
|
|
1560
|
+
return this.request(
|
|
1561
|
+
"POST",
|
|
1562
|
+
"/v1/admin/encryption/rotate-key",
|
|
1563
|
+
body
|
|
1564
|
+
);
|
|
1565
|
+
}
|
|
1541
1566
|
// ===========================================================================
|
|
1542
1567
|
// API Key Operations
|
|
1543
1568
|
// ===========================================================================
|
|
@@ -1848,6 +1873,139 @@ var DakeraClient = class {
|
|
|
1848
1873
|
async getNamespaceKeyUsage(namespace, keyId) {
|
|
1849
1874
|
return this.request("GET", `/v1/namespaces/${namespace}/keys/${keyId}/usage`);
|
|
1850
1875
|
}
|
|
1876
|
+
// ===========================================================================
|
|
1877
|
+
// DX-1: Memory Import / Export
|
|
1878
|
+
// ===========================================================================
|
|
1879
|
+
/**
|
|
1880
|
+
* Import memories from an external format (DX-1).
|
|
1881
|
+
*
|
|
1882
|
+
* @param data Serialised memories (list of objects for jsonl/mem0/zep, or a CSV string).
|
|
1883
|
+
* @param format One of `"jsonl"`, `"mem0"`, `"zep"`, `"csv"`. Defaults to `"jsonl"`.
|
|
1884
|
+
* @param agentId Assign all imported memories to this agent.
|
|
1885
|
+
* @param namespace Target namespace (defaults to the client's configured namespace).
|
|
1886
|
+
*/
|
|
1887
|
+
async importMemories(data, format = "jsonl", agentId2, namespace) {
|
|
1888
|
+
const body = { data, format };
|
|
1889
|
+
if (agentId2 !== void 0) body.agent_id = agentId2;
|
|
1890
|
+
if (namespace !== void 0) body.namespace = namespace;
|
|
1891
|
+
return this.request("POST", "/v1/import", body);
|
|
1892
|
+
}
|
|
1893
|
+
/**
|
|
1894
|
+
* Export memories in a portable format (DX-1).
|
|
1895
|
+
*
|
|
1896
|
+
* @param format One of `"jsonl"`, `"mem0"`, `"zep"`, `"csv"`. Defaults to `"jsonl"`.
|
|
1897
|
+
* @param agentId Export only memories for this agent.
|
|
1898
|
+
* @param namespace Source namespace (defaults to client namespace).
|
|
1899
|
+
* @param limit Maximum number of memories to export.
|
|
1900
|
+
*/
|
|
1901
|
+
async exportMemories(format = "jsonl", agentId2, namespace, limit) {
|
|
1902
|
+
const params = new URLSearchParams({ format });
|
|
1903
|
+
if (agentId2 !== void 0) params.set("agent_id", agentId2);
|
|
1904
|
+
if (namespace !== void 0) params.set("namespace", namespace);
|
|
1905
|
+
if (limit !== void 0) params.set("limit", String(limit));
|
|
1906
|
+
return this.request("GET", `/v1/export?${params}`);
|
|
1907
|
+
}
|
|
1908
|
+
// ===========================================================================
|
|
1909
|
+
// OBS-1: Business-Event Audit Log
|
|
1910
|
+
// ===========================================================================
|
|
1911
|
+
/**
|
|
1912
|
+
* List paginated audit log entries (OBS-1).
|
|
1913
|
+
*
|
|
1914
|
+
* @param agentId Filter to events from this agent.
|
|
1915
|
+
* @param eventType Filter to a specific event type string.
|
|
1916
|
+
* @param fromTs Unix timestamp lower bound (inclusive).
|
|
1917
|
+
* @param toTs Unix timestamp upper bound (exclusive).
|
|
1918
|
+
* @param limit Maximum number of events to return.
|
|
1919
|
+
* @param cursor Pagination cursor from a previous response.
|
|
1920
|
+
*/
|
|
1921
|
+
async listAuditEvents(opts) {
|
|
1922
|
+
const params = new URLSearchParams();
|
|
1923
|
+
if (opts?.agentId) params.set("agent_id", opts.agentId);
|
|
1924
|
+
if (opts?.eventType) params.set("event_type", opts.eventType);
|
|
1925
|
+
if (opts?.fromTs !== void 0) params.set("from", String(opts.fromTs));
|
|
1926
|
+
if (opts?.toTs !== void 0) params.set("to", String(opts.toTs));
|
|
1927
|
+
if (opts?.limit !== void 0) params.set("limit", String(opts.limit));
|
|
1928
|
+
if (opts?.cursor) params.set("cursor", opts.cursor);
|
|
1929
|
+
const qs = params.toString();
|
|
1930
|
+
return this.request("GET", qs ? `/v1/audit?${qs}` : "/v1/audit");
|
|
1931
|
+
}
|
|
1932
|
+
/**
|
|
1933
|
+
* Stream live audit events via SSE (OBS-1).
|
|
1934
|
+
*
|
|
1935
|
+
* Opens a long-lived connection to `GET /v1/audit/stream` and yields
|
|
1936
|
+
* {@link DakeraEvent} objects as they arrive.
|
|
1937
|
+
*
|
|
1938
|
+
* @param agentId Scope the stream to a specific agent.
|
|
1939
|
+
* @param eventType Scope the stream to a specific event type.
|
|
1940
|
+
*/
|
|
1941
|
+
async *streamAuditEvents(opts) {
|
|
1942
|
+
const params = new URLSearchParams();
|
|
1943
|
+
if (opts?.agentId) params.set("agent_id", opts.agentId);
|
|
1944
|
+
if (opts?.eventType) params.set("event_type", opts.eventType);
|
|
1945
|
+
const qs = params.toString();
|
|
1946
|
+
const url = `${this.baseUrl}/v1/audit/stream${qs ? `?${qs}` : ""}`;
|
|
1947
|
+
yield* this._streamSse(url);
|
|
1948
|
+
}
|
|
1949
|
+
/**
|
|
1950
|
+
* Bulk-export audit log entries (OBS-1).
|
|
1951
|
+
*
|
|
1952
|
+
* @param format `"jsonl"` (default) or `"csv"`.
|
|
1953
|
+
* @param agentId Filter to a specific agent.
|
|
1954
|
+
* @param eventType Filter to a specific event type.
|
|
1955
|
+
* @param fromTs Unix timestamp lower bound.
|
|
1956
|
+
* @param toTs Unix timestamp upper bound.
|
|
1957
|
+
*/
|
|
1958
|
+
async exportAudit(opts) {
|
|
1959
|
+
const body = { format: opts?.format ?? "jsonl" };
|
|
1960
|
+
if (opts?.agentId) body.agent_id = opts.agentId;
|
|
1961
|
+
if (opts?.eventType) body.event_type = opts.eventType;
|
|
1962
|
+
if (opts?.fromTs !== void 0) body.from = opts.fromTs;
|
|
1963
|
+
if (opts?.toTs !== void 0) body.to = opts.toTs;
|
|
1964
|
+
return this.request("POST", "/v1/audit/export", body);
|
|
1965
|
+
}
|
|
1966
|
+
// ===========================================================================
|
|
1967
|
+
// EXT-1: External Extraction Providers
|
|
1968
|
+
// ===========================================================================
|
|
1969
|
+
/**
|
|
1970
|
+
* Extract entities from text using a pluggable provider (EXT-1).
|
|
1971
|
+
*
|
|
1972
|
+
* Provider hierarchy: per-request override > namespace default > GLiNER (bundled).
|
|
1973
|
+
*
|
|
1974
|
+
* @param text Input text to extract from.
|
|
1975
|
+
* @param namespace Namespace whose default extractor to inherit.
|
|
1976
|
+
* @param provider Override provider: `"gliner"`, `"openai"`, `"anthropic"`,
|
|
1977
|
+
* `"openrouter"`, or `"ollama"`.
|
|
1978
|
+
* @param model Override model within the chosen provider.
|
|
1979
|
+
*/
|
|
1980
|
+
async extractText(text, namespace, provider, model) {
|
|
1981
|
+
const body = { text };
|
|
1982
|
+
if (namespace !== void 0) body.namespace = namespace;
|
|
1983
|
+
if (provider !== void 0) body.provider = provider;
|
|
1984
|
+
if (model !== void 0) body.model = model;
|
|
1985
|
+
return this.request("POST", "/v1/extract", body);
|
|
1986
|
+
}
|
|
1987
|
+
/**
|
|
1988
|
+
* List available extraction providers and their supported models (EXT-1).
|
|
1989
|
+
*/
|
|
1990
|
+
async listExtractProviders() {
|
|
1991
|
+
const result = await this.request(
|
|
1992
|
+
"GET",
|
|
1993
|
+
"/v1/extract/providers"
|
|
1994
|
+
);
|
|
1995
|
+
return Array.isArray(result) ? result : result.providers;
|
|
1996
|
+
}
|
|
1997
|
+
/**
|
|
1998
|
+
* Set the default extraction provider for a namespace (EXT-1).
|
|
1999
|
+
*
|
|
2000
|
+
* @param namespace The namespace to configure.
|
|
2001
|
+
* @param provider Default provider.
|
|
2002
|
+
* @param model Default model within the provider (optional).
|
|
2003
|
+
*/
|
|
2004
|
+
async configureNamespaceExtractor(namespace, provider, model) {
|
|
2005
|
+
const body = { provider };
|
|
2006
|
+
if (model !== void 0) body.model = model;
|
|
2007
|
+
return this.request("PATCH", `/v1/namespaces/${encodeURIComponent(namespace)}/extractor`, body);
|
|
2008
|
+
}
|
|
1851
2009
|
};
|
|
1852
2010
|
|
|
1853
2011
|
// src/types.ts
|
package/dist/index.mjs
CHANGED
|
@@ -1395,6 +1395,12 @@ var DakeraClient = class {
|
|
|
1395
1395
|
async opsStats() {
|
|
1396
1396
|
return this.request("GET", "/v1/ops/stats");
|
|
1397
1397
|
}
|
|
1398
|
+
/** Get Prometheus metrics in text exposition format (INFRA-3).
|
|
1399
|
+
* Requires Admin scope. Returns the raw Prometheus text exposition
|
|
1400
|
+
* format string suitable for scraping by a Prometheus server. */
|
|
1401
|
+
async opsMetrics() {
|
|
1402
|
+
return this.request("GET", "/v1/ops/metrics");
|
|
1403
|
+
}
|
|
1398
1404
|
/** Get cluster status */
|
|
1399
1405
|
async clusterStatus() {
|
|
1400
1406
|
return this.request("GET", "/v1/admin/cluster/status");
|
|
@@ -1498,6 +1504,25 @@ var DakeraClient = class {
|
|
|
1498
1504
|
async decayStats() {
|
|
1499
1505
|
return this.request("GET", "/v1/admin/decay/stats");
|
|
1500
1506
|
}
|
|
1507
|
+
/**
|
|
1508
|
+
* Re-encrypt all memory content blobs with a new AES-256-GCM key (SEC-3).
|
|
1509
|
+
*
|
|
1510
|
+
* After this call the new key is active in the running process.
|
|
1511
|
+
* The operator must update `DAKERA_ENCRYPTION_KEY` and restart to make the
|
|
1512
|
+
* rotation durable across restarts. Requires Admin scope.
|
|
1513
|
+
*
|
|
1514
|
+
* @param newKey - New passphrase or 64-char hex key.
|
|
1515
|
+
* @param namespace - Rotate only this namespace. Omit to rotate all.
|
|
1516
|
+
*/
|
|
1517
|
+
async rotateEncryptionKey(newKey, namespace) {
|
|
1518
|
+
const body = { new_key: newKey };
|
|
1519
|
+
if (namespace !== void 0) body.namespace = namespace;
|
|
1520
|
+
return this.request(
|
|
1521
|
+
"POST",
|
|
1522
|
+
"/v1/admin/encryption/rotate-key",
|
|
1523
|
+
body
|
|
1524
|
+
);
|
|
1525
|
+
}
|
|
1501
1526
|
// ===========================================================================
|
|
1502
1527
|
// API Key Operations
|
|
1503
1528
|
// ===========================================================================
|
|
@@ -1808,6 +1833,139 @@ var DakeraClient = class {
|
|
|
1808
1833
|
async getNamespaceKeyUsage(namespace, keyId) {
|
|
1809
1834
|
return this.request("GET", `/v1/namespaces/${namespace}/keys/${keyId}/usage`);
|
|
1810
1835
|
}
|
|
1836
|
+
// ===========================================================================
|
|
1837
|
+
// DX-1: Memory Import / Export
|
|
1838
|
+
// ===========================================================================
|
|
1839
|
+
/**
|
|
1840
|
+
* Import memories from an external format (DX-1).
|
|
1841
|
+
*
|
|
1842
|
+
* @param data Serialised memories (list of objects for jsonl/mem0/zep, or a CSV string).
|
|
1843
|
+
* @param format One of `"jsonl"`, `"mem0"`, `"zep"`, `"csv"`. Defaults to `"jsonl"`.
|
|
1844
|
+
* @param agentId Assign all imported memories to this agent.
|
|
1845
|
+
* @param namespace Target namespace (defaults to the client's configured namespace).
|
|
1846
|
+
*/
|
|
1847
|
+
async importMemories(data, format = "jsonl", agentId2, namespace) {
|
|
1848
|
+
const body = { data, format };
|
|
1849
|
+
if (agentId2 !== void 0) body.agent_id = agentId2;
|
|
1850
|
+
if (namespace !== void 0) body.namespace = namespace;
|
|
1851
|
+
return this.request("POST", "/v1/import", body);
|
|
1852
|
+
}
|
|
1853
|
+
/**
|
|
1854
|
+
* Export memories in a portable format (DX-1).
|
|
1855
|
+
*
|
|
1856
|
+
* @param format One of `"jsonl"`, `"mem0"`, `"zep"`, `"csv"`. Defaults to `"jsonl"`.
|
|
1857
|
+
* @param agentId Export only memories for this agent.
|
|
1858
|
+
* @param namespace Source namespace (defaults to client namespace).
|
|
1859
|
+
* @param limit Maximum number of memories to export.
|
|
1860
|
+
*/
|
|
1861
|
+
async exportMemories(format = "jsonl", agentId2, namespace, limit) {
|
|
1862
|
+
const params = new URLSearchParams({ format });
|
|
1863
|
+
if (agentId2 !== void 0) params.set("agent_id", agentId2);
|
|
1864
|
+
if (namespace !== void 0) params.set("namespace", namespace);
|
|
1865
|
+
if (limit !== void 0) params.set("limit", String(limit));
|
|
1866
|
+
return this.request("GET", `/v1/export?${params}`);
|
|
1867
|
+
}
|
|
1868
|
+
// ===========================================================================
|
|
1869
|
+
// OBS-1: Business-Event Audit Log
|
|
1870
|
+
// ===========================================================================
|
|
1871
|
+
/**
|
|
1872
|
+
* List paginated audit log entries (OBS-1).
|
|
1873
|
+
*
|
|
1874
|
+
* @param agentId Filter to events from this agent.
|
|
1875
|
+
* @param eventType Filter to a specific event type string.
|
|
1876
|
+
* @param fromTs Unix timestamp lower bound (inclusive).
|
|
1877
|
+
* @param toTs Unix timestamp upper bound (exclusive).
|
|
1878
|
+
* @param limit Maximum number of events to return.
|
|
1879
|
+
* @param cursor Pagination cursor from a previous response.
|
|
1880
|
+
*/
|
|
1881
|
+
async listAuditEvents(opts) {
|
|
1882
|
+
const params = new URLSearchParams();
|
|
1883
|
+
if (opts?.agentId) params.set("agent_id", opts.agentId);
|
|
1884
|
+
if (opts?.eventType) params.set("event_type", opts.eventType);
|
|
1885
|
+
if (opts?.fromTs !== void 0) params.set("from", String(opts.fromTs));
|
|
1886
|
+
if (opts?.toTs !== void 0) params.set("to", String(opts.toTs));
|
|
1887
|
+
if (opts?.limit !== void 0) params.set("limit", String(opts.limit));
|
|
1888
|
+
if (opts?.cursor) params.set("cursor", opts.cursor);
|
|
1889
|
+
const qs = params.toString();
|
|
1890
|
+
return this.request("GET", qs ? `/v1/audit?${qs}` : "/v1/audit");
|
|
1891
|
+
}
|
|
1892
|
+
/**
|
|
1893
|
+
* Stream live audit events via SSE (OBS-1).
|
|
1894
|
+
*
|
|
1895
|
+
* Opens a long-lived connection to `GET /v1/audit/stream` and yields
|
|
1896
|
+
* {@link DakeraEvent} objects as they arrive.
|
|
1897
|
+
*
|
|
1898
|
+
* @param agentId Scope the stream to a specific agent.
|
|
1899
|
+
* @param eventType Scope the stream to a specific event type.
|
|
1900
|
+
*/
|
|
1901
|
+
async *streamAuditEvents(opts) {
|
|
1902
|
+
const params = new URLSearchParams();
|
|
1903
|
+
if (opts?.agentId) params.set("agent_id", opts.agentId);
|
|
1904
|
+
if (opts?.eventType) params.set("event_type", opts.eventType);
|
|
1905
|
+
const qs = params.toString();
|
|
1906
|
+
const url = `${this.baseUrl}/v1/audit/stream${qs ? `?${qs}` : ""}`;
|
|
1907
|
+
yield* this._streamSse(url);
|
|
1908
|
+
}
|
|
1909
|
+
/**
|
|
1910
|
+
* Bulk-export audit log entries (OBS-1).
|
|
1911
|
+
*
|
|
1912
|
+
* @param format `"jsonl"` (default) or `"csv"`.
|
|
1913
|
+
* @param agentId Filter to a specific agent.
|
|
1914
|
+
* @param eventType Filter to a specific event type.
|
|
1915
|
+
* @param fromTs Unix timestamp lower bound.
|
|
1916
|
+
* @param toTs Unix timestamp upper bound.
|
|
1917
|
+
*/
|
|
1918
|
+
async exportAudit(opts) {
|
|
1919
|
+
const body = { format: opts?.format ?? "jsonl" };
|
|
1920
|
+
if (opts?.agentId) body.agent_id = opts.agentId;
|
|
1921
|
+
if (opts?.eventType) body.event_type = opts.eventType;
|
|
1922
|
+
if (opts?.fromTs !== void 0) body.from = opts.fromTs;
|
|
1923
|
+
if (opts?.toTs !== void 0) body.to = opts.toTs;
|
|
1924
|
+
return this.request("POST", "/v1/audit/export", body);
|
|
1925
|
+
}
|
|
1926
|
+
// ===========================================================================
|
|
1927
|
+
// EXT-1: External Extraction Providers
|
|
1928
|
+
// ===========================================================================
|
|
1929
|
+
/**
|
|
1930
|
+
* Extract entities from text using a pluggable provider (EXT-1).
|
|
1931
|
+
*
|
|
1932
|
+
* Provider hierarchy: per-request override > namespace default > GLiNER (bundled).
|
|
1933
|
+
*
|
|
1934
|
+
* @param text Input text to extract from.
|
|
1935
|
+
* @param namespace Namespace whose default extractor to inherit.
|
|
1936
|
+
* @param provider Override provider: `"gliner"`, `"openai"`, `"anthropic"`,
|
|
1937
|
+
* `"openrouter"`, or `"ollama"`.
|
|
1938
|
+
* @param model Override model within the chosen provider.
|
|
1939
|
+
*/
|
|
1940
|
+
async extractText(text, namespace, provider, model) {
|
|
1941
|
+
const body = { text };
|
|
1942
|
+
if (namespace !== void 0) body.namespace = namespace;
|
|
1943
|
+
if (provider !== void 0) body.provider = provider;
|
|
1944
|
+
if (model !== void 0) body.model = model;
|
|
1945
|
+
return this.request("POST", "/v1/extract", body);
|
|
1946
|
+
}
|
|
1947
|
+
/**
|
|
1948
|
+
* List available extraction providers and their supported models (EXT-1).
|
|
1949
|
+
*/
|
|
1950
|
+
async listExtractProviders() {
|
|
1951
|
+
const result = await this.request(
|
|
1952
|
+
"GET",
|
|
1953
|
+
"/v1/extract/providers"
|
|
1954
|
+
);
|
|
1955
|
+
return Array.isArray(result) ? result : result.providers;
|
|
1956
|
+
}
|
|
1957
|
+
/**
|
|
1958
|
+
* Set the default extraction provider for a namespace (EXT-1).
|
|
1959
|
+
*
|
|
1960
|
+
* @param namespace The namespace to configure.
|
|
1961
|
+
* @param provider Default provider.
|
|
1962
|
+
* @param model Default model within the provider (optional).
|
|
1963
|
+
*/
|
|
1964
|
+
async configureNamespaceExtractor(namespace, provider, model) {
|
|
1965
|
+
const body = { provider };
|
|
1966
|
+
if (model !== void 0) body.model = model;
|
|
1967
|
+
return this.request("PATCH", `/v1/namespaces/${encodeURIComponent(namespace)}/extractor`, body);
|
|
1968
|
+
}
|
|
1811
1969
|
};
|
|
1812
1970
|
|
|
1813
1971
|
// src/types.ts
|