@dakera-ai/dakera 0.9.0 → 0.9.2

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 CHANGED
@@ -1364,6 +1364,109 @@ interface MemoryEntitiesResponse {
1364
1364
  memory_id: string;
1365
1365
  entities: ExtractedEntity[];
1366
1366
  }
1367
+ /**
1368
+ * Feedback signal for memory active learning (INT-1).
1369
+ *
1370
+ * - `upvote`: Boost importance ×1.15, capped at 1.0.
1371
+ * - `downvote`: Penalise importance ×0.85, floor 0.0.
1372
+ * - `flag`: Mark as irrelevant — sets `decay_flag=true`, no immediate importance change.
1373
+ * - `positive`: Backward-compatible alias for `upvote`.
1374
+ * - `negative`: Backward-compatible alias for `downvote`.
1375
+ */
1376
+ type FeedbackSignal = 'upvote' | 'downvote' | 'flag' | 'positive' | 'negative';
1377
+ /** A single recorded feedback event stored in memory metadata (INT-1). */
1378
+ interface FeedbackHistoryEntry {
1379
+ /** Feedback signal that was applied. */
1380
+ signal: FeedbackSignal;
1381
+ /** Unix timestamp (seconds) when feedback was submitted. */
1382
+ timestamp: number;
1383
+ /** Memory importance before this feedback was applied. */
1384
+ old_importance: number;
1385
+ /** Memory importance after this feedback was applied. */
1386
+ new_importance: number;
1387
+ }
1388
+ /** Request body for POST /v1/memories/:id/feedback (INT-1). */
1389
+ interface MemoryFeedbackBodyRequest {
1390
+ agent_id: string;
1391
+ signal: FeedbackSignal;
1392
+ }
1393
+ /** Request body for PATCH /v1/memories/:id/importance (INT-1). */
1394
+ interface MemoryImportancePatchRequest {
1395
+ agent_id: string;
1396
+ importance: number;
1397
+ }
1398
+ /** Response from POST /v1/memories/:id/feedback and PATCH /v1/memories/:id/importance (INT-1). */
1399
+ interface FeedbackResponse {
1400
+ /** ID of the memory that was updated. */
1401
+ memory_id: string;
1402
+ /** New importance score after the feedback was applied (0.0–1.0). */
1403
+ new_importance: number;
1404
+ /** The feedback signal that was recorded. */
1405
+ signal: FeedbackSignal;
1406
+ }
1407
+ /** Response from GET /v1/memories/:id/feedback (INT-1). */
1408
+ interface FeedbackHistoryResponse {
1409
+ memory_id: string;
1410
+ /** Ordered list of feedback events (oldest first, capped at 100). */
1411
+ entries: FeedbackHistoryEntry[];
1412
+ }
1413
+ /** Response from GET /v1/agents/:id/feedback/summary (INT-1). */
1414
+ interface AgentFeedbackSummary {
1415
+ agent_id: string;
1416
+ upvotes: number;
1417
+ downvotes: number;
1418
+ flags: number;
1419
+ total_feedback: number;
1420
+ /** Weighted-average importance across all non-expired memories (0.0–1.0). */
1421
+ health_score: number;
1422
+ }
1423
+ /** Response from GET /v1/feedback/health (INT-1). */
1424
+ interface FeedbackHealthResponse {
1425
+ agent_id: string;
1426
+ /** Mean importance of all non-expired memories (0.0–1.0). Higher = healthier. */
1427
+ health_score: number;
1428
+ memory_count: number;
1429
+ avg_importance: number;
1430
+ }
1431
+ /** Namespace-scoped API key metadata (no secret). Returned by listNamespaceKeys (SEC-1). */
1432
+ interface NamespaceKeyInfo {
1433
+ key_id: string;
1434
+ name: string;
1435
+ namespace: string;
1436
+ created_at: number;
1437
+ active: boolean;
1438
+ expires_at?: number;
1439
+ }
1440
+ /**
1441
+ * Response from POST /v1/namespaces/:namespace/keys (SEC-1).
1442
+ * The `key` field is shown **only once** — store it securely.
1443
+ */
1444
+ interface CreateNamespaceKeyResponse {
1445
+ key_id: string;
1446
+ /** The raw API key. Shown only on creation — cannot be retrieved again. */
1447
+ key: string;
1448
+ name: string;
1449
+ namespace: string;
1450
+ created_at: number;
1451
+ expires_at?: number;
1452
+ warning: string;
1453
+ }
1454
+ /** Response from GET /v1/namespaces/:namespace/keys (SEC-1). */
1455
+ interface ListNamespaceKeysResponse {
1456
+ namespace: string;
1457
+ keys: NamespaceKeyInfo[];
1458
+ total: number;
1459
+ }
1460
+ /** Response from GET /v1/namespaces/:namespace/keys/:key_id/usage (SEC-1). */
1461
+ interface NamespaceKeyUsageResponse {
1462
+ key_id: string;
1463
+ namespace: string;
1464
+ total_requests: number;
1465
+ successful_requests: number;
1466
+ failed_requests: number;
1467
+ bytes_transferred: number;
1468
+ avg_latency_ms: number;
1469
+ }
1367
1470
 
1368
1471
  /**
1369
1472
  * Dakera Client
@@ -1940,6 +2043,47 @@ declare class DakeraClient {
1940
2043
  consolidate(agentId: string, request?: ConsolidateRequest): Promise<ConsolidateResponse>;
1941
2044
  /** Submit feedback on a memory recall */
1942
2045
  memoryFeedback(agentId: string, request: MemoryFeedbackRequest): Promise<MemoryFeedbackResponse>;
2046
+ /**
2047
+ * Submit upvote/downvote/flag feedback on a memory (INT-1).
2048
+ *
2049
+ * - `upvote`: boosts importance ×1.15 (capped at 1.0).
2050
+ * - `downvote`: penalises importance ×0.85 (floor 0.0).
2051
+ * - `flag`: marks as irrelevant — accelerates decay on next cycle.
2052
+ *
2053
+ * @param memoryId The memory to give feedback on.
2054
+ * @param agentId The agent that owns the memory.
2055
+ * @param signal Feedback signal.
2056
+ */
2057
+ feedbackMemory(memoryId: string, agentId: string, signal: FeedbackSignal): Promise<FeedbackResponse>;
2058
+ /**
2059
+ * Get the full feedback history for a memory (INT-1).
2060
+ *
2061
+ * @param memoryId The memory whose feedback history to retrieve.
2062
+ */
2063
+ getMemoryFeedbackHistory(memoryId: string): Promise<FeedbackHistoryResponse>;
2064
+ /**
2065
+ * Get aggregate feedback counts and health score for an agent (INT-1).
2066
+ *
2067
+ * @param agentId The agent to summarise feedback for.
2068
+ */
2069
+ getAgentFeedbackSummary(agentId: string): Promise<AgentFeedbackSummary>;
2070
+ /**
2071
+ * Directly override a memory's importance score (INT-1).
2072
+ *
2073
+ * @param memoryId The memory to update.
2074
+ * @param agentId The agent that owns the memory.
2075
+ * @param importance New importance value (0.0–1.0).
2076
+ */
2077
+ patchMemoryImportance(memoryId: string, agentId: string, importance: number): Promise<FeedbackResponse>;
2078
+ /**
2079
+ * Get overall feedback health score for an agent (INT-1).
2080
+ *
2081
+ * The health score is the mean importance of all non-expired memories (0.0–1.0).
2082
+ * A higher score indicates a healthier, more relevant memory store.
2083
+ *
2084
+ * @param agentId The agent to get health score for.
2085
+ */
2086
+ getFeedbackHealth(agentId: string): Promise<FeedbackHealthResponse>;
1943
2087
  /**
1944
2088
  * Traverse the knowledge graph from a memory node.
1945
2089
  *
@@ -2256,6 +2400,39 @@ declare class DakeraClient {
2256
2400
  private _streamSseMemory;
2257
2401
  /** Parse a single SSE event block into a {@link MemoryEvent}. */
2258
2402
  private _parseSseMemoryBlock;
2403
+ /**
2404
+ * Create a namespace-scoped API key (SEC-1).
2405
+ *
2406
+ * The `key` field in the response is shown **only once** — store it securely.
2407
+ *
2408
+ * @param namespace The namespace to scope this key to.
2409
+ * @param name Human-readable label for the key.
2410
+ * @param expiresInDays Optional expiry in days from now.
2411
+ */
2412
+ createNamespaceKey(namespace: string, name: string, expiresInDays?: number): Promise<CreateNamespaceKeyResponse>;
2413
+ /**
2414
+ * List all API keys scoped to a namespace (SEC-1).
2415
+ *
2416
+ * @param namespace The namespace whose keys to list.
2417
+ */
2418
+ listNamespaceKeys(namespace: string): Promise<ListNamespaceKeysResponse>;
2419
+ /**
2420
+ * Revoke a namespace-scoped API key (SEC-1).
2421
+ *
2422
+ * @param namespace The namespace the key belongs to.
2423
+ * @param keyId The key to revoke.
2424
+ */
2425
+ deleteNamespaceKey(namespace: string, keyId: string): Promise<{
2426
+ success: boolean;
2427
+ message: string;
2428
+ }>;
2429
+ /**
2430
+ * Get usage statistics for a namespace-scoped API key (SEC-1).
2431
+ *
2432
+ * @param namespace The namespace the key belongs to.
2433
+ * @param keyId The key whose usage to retrieve.
2434
+ */
2435
+ getNamespaceKeyUsage(namespace: string, keyId: string): Promise<NamespaceKeyUsageResponse>;
2259
2436
  }
2260
2437
 
2261
2438
  /**
@@ -2320,4 +2497,4 @@ declare class TimeoutError extends DakeraError {
2320
2497
  constructor(message: string);
2321
2498
  }
2322
2499
 
2323
- export { type AccessPatternHint, 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 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 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 ListSessionsOptions, type Memory, type MemoryEntitiesResponse, type MemoryEvent, type MemoryFeedbackRequest, type MemoryFeedbackResponse, type MemoryGraph, type MemoryGraphOptions, type MemoryId, type MemoryType, type MultiVectorSearchRequest, type MultiVectorSearchResponse, type MultiVectorSearchResult, type NamespaceCreatedEvent, type NamespaceDeletedEvent, type NamespaceInfo, 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 };
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 };
package/dist/index.d.ts CHANGED
@@ -1364,6 +1364,109 @@ interface MemoryEntitiesResponse {
1364
1364
  memory_id: string;
1365
1365
  entities: ExtractedEntity[];
1366
1366
  }
1367
+ /**
1368
+ * Feedback signal for memory active learning (INT-1).
1369
+ *
1370
+ * - `upvote`: Boost importance ×1.15, capped at 1.0.
1371
+ * - `downvote`: Penalise importance ×0.85, floor 0.0.
1372
+ * - `flag`: Mark as irrelevant — sets `decay_flag=true`, no immediate importance change.
1373
+ * - `positive`: Backward-compatible alias for `upvote`.
1374
+ * - `negative`: Backward-compatible alias for `downvote`.
1375
+ */
1376
+ type FeedbackSignal = 'upvote' | 'downvote' | 'flag' | 'positive' | 'negative';
1377
+ /** A single recorded feedback event stored in memory metadata (INT-1). */
1378
+ interface FeedbackHistoryEntry {
1379
+ /** Feedback signal that was applied. */
1380
+ signal: FeedbackSignal;
1381
+ /** Unix timestamp (seconds) when feedback was submitted. */
1382
+ timestamp: number;
1383
+ /** Memory importance before this feedback was applied. */
1384
+ old_importance: number;
1385
+ /** Memory importance after this feedback was applied. */
1386
+ new_importance: number;
1387
+ }
1388
+ /** Request body for POST /v1/memories/:id/feedback (INT-1). */
1389
+ interface MemoryFeedbackBodyRequest {
1390
+ agent_id: string;
1391
+ signal: FeedbackSignal;
1392
+ }
1393
+ /** Request body for PATCH /v1/memories/:id/importance (INT-1). */
1394
+ interface MemoryImportancePatchRequest {
1395
+ agent_id: string;
1396
+ importance: number;
1397
+ }
1398
+ /** Response from POST /v1/memories/:id/feedback and PATCH /v1/memories/:id/importance (INT-1). */
1399
+ interface FeedbackResponse {
1400
+ /** ID of the memory that was updated. */
1401
+ memory_id: string;
1402
+ /** New importance score after the feedback was applied (0.0–1.0). */
1403
+ new_importance: number;
1404
+ /** The feedback signal that was recorded. */
1405
+ signal: FeedbackSignal;
1406
+ }
1407
+ /** Response from GET /v1/memories/:id/feedback (INT-1). */
1408
+ interface FeedbackHistoryResponse {
1409
+ memory_id: string;
1410
+ /** Ordered list of feedback events (oldest first, capped at 100). */
1411
+ entries: FeedbackHistoryEntry[];
1412
+ }
1413
+ /** Response from GET /v1/agents/:id/feedback/summary (INT-1). */
1414
+ interface AgentFeedbackSummary {
1415
+ agent_id: string;
1416
+ upvotes: number;
1417
+ downvotes: number;
1418
+ flags: number;
1419
+ total_feedback: number;
1420
+ /** Weighted-average importance across all non-expired memories (0.0–1.0). */
1421
+ health_score: number;
1422
+ }
1423
+ /** Response from GET /v1/feedback/health (INT-1). */
1424
+ interface FeedbackHealthResponse {
1425
+ agent_id: string;
1426
+ /** Mean importance of all non-expired memories (0.0–1.0). Higher = healthier. */
1427
+ health_score: number;
1428
+ memory_count: number;
1429
+ avg_importance: number;
1430
+ }
1431
+ /** Namespace-scoped API key metadata (no secret). Returned by listNamespaceKeys (SEC-1). */
1432
+ interface NamespaceKeyInfo {
1433
+ key_id: string;
1434
+ name: string;
1435
+ namespace: string;
1436
+ created_at: number;
1437
+ active: boolean;
1438
+ expires_at?: number;
1439
+ }
1440
+ /**
1441
+ * Response from POST /v1/namespaces/:namespace/keys (SEC-1).
1442
+ * The `key` field is shown **only once** — store it securely.
1443
+ */
1444
+ interface CreateNamespaceKeyResponse {
1445
+ key_id: string;
1446
+ /** The raw API key. Shown only on creation — cannot be retrieved again. */
1447
+ key: string;
1448
+ name: string;
1449
+ namespace: string;
1450
+ created_at: number;
1451
+ expires_at?: number;
1452
+ warning: string;
1453
+ }
1454
+ /** Response from GET /v1/namespaces/:namespace/keys (SEC-1). */
1455
+ interface ListNamespaceKeysResponse {
1456
+ namespace: string;
1457
+ keys: NamespaceKeyInfo[];
1458
+ total: number;
1459
+ }
1460
+ /** Response from GET /v1/namespaces/:namespace/keys/:key_id/usage (SEC-1). */
1461
+ interface NamespaceKeyUsageResponse {
1462
+ key_id: string;
1463
+ namespace: string;
1464
+ total_requests: number;
1465
+ successful_requests: number;
1466
+ failed_requests: number;
1467
+ bytes_transferred: number;
1468
+ avg_latency_ms: number;
1469
+ }
1367
1470
 
1368
1471
  /**
1369
1472
  * Dakera Client
@@ -1940,6 +2043,47 @@ declare class DakeraClient {
1940
2043
  consolidate(agentId: string, request?: ConsolidateRequest): Promise<ConsolidateResponse>;
1941
2044
  /** Submit feedback on a memory recall */
1942
2045
  memoryFeedback(agentId: string, request: MemoryFeedbackRequest): Promise<MemoryFeedbackResponse>;
2046
+ /**
2047
+ * Submit upvote/downvote/flag feedback on a memory (INT-1).
2048
+ *
2049
+ * - `upvote`: boosts importance ×1.15 (capped at 1.0).
2050
+ * - `downvote`: penalises importance ×0.85 (floor 0.0).
2051
+ * - `flag`: marks as irrelevant — accelerates decay on next cycle.
2052
+ *
2053
+ * @param memoryId The memory to give feedback on.
2054
+ * @param agentId The agent that owns the memory.
2055
+ * @param signal Feedback signal.
2056
+ */
2057
+ feedbackMemory(memoryId: string, agentId: string, signal: FeedbackSignal): Promise<FeedbackResponse>;
2058
+ /**
2059
+ * Get the full feedback history for a memory (INT-1).
2060
+ *
2061
+ * @param memoryId The memory whose feedback history to retrieve.
2062
+ */
2063
+ getMemoryFeedbackHistory(memoryId: string): Promise<FeedbackHistoryResponse>;
2064
+ /**
2065
+ * Get aggregate feedback counts and health score for an agent (INT-1).
2066
+ *
2067
+ * @param agentId The agent to summarise feedback for.
2068
+ */
2069
+ getAgentFeedbackSummary(agentId: string): Promise<AgentFeedbackSummary>;
2070
+ /**
2071
+ * Directly override a memory's importance score (INT-1).
2072
+ *
2073
+ * @param memoryId The memory to update.
2074
+ * @param agentId The agent that owns the memory.
2075
+ * @param importance New importance value (0.0–1.0).
2076
+ */
2077
+ patchMemoryImportance(memoryId: string, agentId: string, importance: number): Promise<FeedbackResponse>;
2078
+ /**
2079
+ * Get overall feedback health score for an agent (INT-1).
2080
+ *
2081
+ * The health score is the mean importance of all non-expired memories (0.0–1.0).
2082
+ * A higher score indicates a healthier, more relevant memory store.
2083
+ *
2084
+ * @param agentId The agent to get health score for.
2085
+ */
2086
+ getFeedbackHealth(agentId: string): Promise<FeedbackHealthResponse>;
1943
2087
  /**
1944
2088
  * Traverse the knowledge graph from a memory node.
1945
2089
  *
@@ -2256,6 +2400,39 @@ declare class DakeraClient {
2256
2400
  private _streamSseMemory;
2257
2401
  /** Parse a single SSE event block into a {@link MemoryEvent}. */
2258
2402
  private _parseSseMemoryBlock;
2403
+ /**
2404
+ * Create a namespace-scoped API key (SEC-1).
2405
+ *
2406
+ * The `key` field in the response is shown **only once** — store it securely.
2407
+ *
2408
+ * @param namespace The namespace to scope this key to.
2409
+ * @param name Human-readable label for the key.
2410
+ * @param expiresInDays Optional expiry in days from now.
2411
+ */
2412
+ createNamespaceKey(namespace: string, name: string, expiresInDays?: number): Promise<CreateNamespaceKeyResponse>;
2413
+ /**
2414
+ * List all API keys scoped to a namespace (SEC-1).
2415
+ *
2416
+ * @param namespace The namespace whose keys to list.
2417
+ */
2418
+ listNamespaceKeys(namespace: string): Promise<ListNamespaceKeysResponse>;
2419
+ /**
2420
+ * Revoke a namespace-scoped API key (SEC-1).
2421
+ *
2422
+ * @param namespace The namespace the key belongs to.
2423
+ * @param keyId The key to revoke.
2424
+ */
2425
+ deleteNamespaceKey(namespace: string, keyId: string): Promise<{
2426
+ success: boolean;
2427
+ message: string;
2428
+ }>;
2429
+ /**
2430
+ * Get usage statistics for a namespace-scoped API key (SEC-1).
2431
+ *
2432
+ * @param namespace The namespace the key belongs to.
2433
+ * @param keyId The key whose usage to retrieve.
2434
+ */
2435
+ getNamespaceKeyUsage(namespace: string, keyId: string): Promise<NamespaceKeyUsageResponse>;
2259
2436
  }
2260
2437
 
2261
2438
  /**
@@ -2320,4 +2497,4 @@ declare class TimeoutError extends DakeraError {
2320
2497
  constructor(message: string);
2321
2498
  }
2322
2499
 
2323
- export { type AccessPatternHint, 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 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 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 ListSessionsOptions, type Memory, type MemoryEntitiesResponse, type MemoryEvent, type MemoryFeedbackRequest, type MemoryFeedbackResponse, type MemoryGraph, type MemoryGraphOptions, type MemoryId, type MemoryType, type MultiVectorSearchRequest, type MultiVectorSearchResponse, type MultiVectorSearchResult, type NamespaceCreatedEvent, type NamespaceDeletedEvent, type NamespaceInfo, 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 };
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 };
package/dist/index.js CHANGED
@@ -1136,6 +1136,61 @@ var DakeraClient = class {
1136
1136
  return this.request("POST", `/v1/agents/${agentId2}/memories/feedback`, request);
1137
1137
  }
1138
1138
  // ===========================================================================
1139
+ // Memory Feedback Loop — INT-1
1140
+ // ===========================================================================
1141
+ /**
1142
+ * Submit upvote/downvote/flag feedback on a memory (INT-1).
1143
+ *
1144
+ * - `upvote`: boosts importance ×1.15 (capped at 1.0).
1145
+ * - `downvote`: penalises importance ×0.85 (floor 0.0).
1146
+ * - `flag`: marks as irrelevant — accelerates decay on next cycle.
1147
+ *
1148
+ * @param memoryId The memory to give feedback on.
1149
+ * @param agentId The agent that owns the memory.
1150
+ * @param signal Feedback signal.
1151
+ */
1152
+ async feedbackMemory(memoryId2, agentId2, signal) {
1153
+ return this.request("POST", `/v1/memories/${memoryId2}/feedback`, { agent_id: agentId2, signal });
1154
+ }
1155
+ /**
1156
+ * Get the full feedback history for a memory (INT-1).
1157
+ *
1158
+ * @param memoryId The memory whose feedback history to retrieve.
1159
+ */
1160
+ async getMemoryFeedbackHistory(memoryId2) {
1161
+ return this.request("GET", `/v1/memories/${memoryId2}/feedback`);
1162
+ }
1163
+ /**
1164
+ * Get aggregate feedback counts and health score for an agent (INT-1).
1165
+ *
1166
+ * @param agentId The agent to summarise feedback for.
1167
+ */
1168
+ async getAgentFeedbackSummary(agentId2) {
1169
+ return this.request("GET", `/v1/agents/${agentId2}/feedback/summary`);
1170
+ }
1171
+ /**
1172
+ * Directly override a memory's importance score (INT-1).
1173
+ *
1174
+ * @param memoryId The memory to update.
1175
+ * @param agentId The agent that owns the memory.
1176
+ * @param importance New importance value (0.0–1.0).
1177
+ */
1178
+ async patchMemoryImportance(memoryId2, agentId2, importance) {
1179
+ return this.request("PATCH", `/v1/memories/${memoryId2}/importance`, { agent_id: agentId2, importance });
1180
+ }
1181
+ /**
1182
+ * Get overall feedback health score for an agent (INT-1).
1183
+ *
1184
+ * The health score is the mean importance of all non-expired memories (0.0–1.0).
1185
+ * A higher score indicates a healthier, more relevant memory store.
1186
+ *
1187
+ * @param agentId The agent to get health score for.
1188
+ */
1189
+ async getFeedbackHealth(agentId2) {
1190
+ const params = new URLSearchParams({ agent_id: agentId2 });
1191
+ return this.request("GET", `/v1/feedback/health?${params}`);
1192
+ }
1193
+ // ===========================================================================
1139
1194
  // Memory Knowledge Graph Operations (CE-5 / SDK-9)
1140
1195
  // ===========================================================================
1141
1196
  /**
@@ -1750,6 +1805,49 @@ var DakeraClient = class {
1750
1805
  return null;
1751
1806
  }
1752
1807
  }
1808
+ // ===========================================================================
1809
+ // Namespace API Keys — SEC-1
1810
+ // ===========================================================================
1811
+ /**
1812
+ * Create a namespace-scoped API key (SEC-1).
1813
+ *
1814
+ * The `key` field in the response is shown **only once** — store it securely.
1815
+ *
1816
+ * @param namespace The namespace to scope this key to.
1817
+ * @param name Human-readable label for the key.
1818
+ * @param expiresInDays Optional expiry in days from now.
1819
+ */
1820
+ async createNamespaceKey(namespace, name, expiresInDays) {
1821
+ const body = { name };
1822
+ if (expiresInDays !== void 0) body.expires_in_days = expiresInDays;
1823
+ return this.request("POST", `/v1/namespaces/${namespace}/keys`, body);
1824
+ }
1825
+ /**
1826
+ * List all API keys scoped to a namespace (SEC-1).
1827
+ *
1828
+ * @param namespace The namespace whose keys to list.
1829
+ */
1830
+ async listNamespaceKeys(namespace) {
1831
+ return this.request("GET", `/v1/namespaces/${namespace}/keys`);
1832
+ }
1833
+ /**
1834
+ * Revoke a namespace-scoped API key (SEC-1).
1835
+ *
1836
+ * @param namespace The namespace the key belongs to.
1837
+ * @param keyId The key to revoke.
1838
+ */
1839
+ async deleteNamespaceKey(namespace, keyId) {
1840
+ return this.request("DELETE", `/v1/namespaces/${namespace}/keys/${keyId}`);
1841
+ }
1842
+ /**
1843
+ * Get usage statistics for a namespace-scoped API key (SEC-1).
1844
+ *
1845
+ * @param namespace The namespace the key belongs to.
1846
+ * @param keyId The key whose usage to retrieve.
1847
+ */
1848
+ async getNamespaceKeyUsage(namespace, keyId) {
1849
+ return this.request("GET", `/v1/namespaces/${namespace}/keys/${keyId}/usage`);
1850
+ }
1753
1851
  };
1754
1852
 
1755
1853
  // src/types.ts
package/dist/index.mjs CHANGED
@@ -1096,6 +1096,61 @@ var DakeraClient = class {
1096
1096
  return this.request("POST", `/v1/agents/${agentId2}/memories/feedback`, request);
1097
1097
  }
1098
1098
  // ===========================================================================
1099
+ // Memory Feedback Loop — INT-1
1100
+ // ===========================================================================
1101
+ /**
1102
+ * Submit upvote/downvote/flag feedback on a memory (INT-1).
1103
+ *
1104
+ * - `upvote`: boosts importance ×1.15 (capped at 1.0).
1105
+ * - `downvote`: penalises importance ×0.85 (floor 0.0).
1106
+ * - `flag`: marks as irrelevant — accelerates decay on next cycle.
1107
+ *
1108
+ * @param memoryId The memory to give feedback on.
1109
+ * @param agentId The agent that owns the memory.
1110
+ * @param signal Feedback signal.
1111
+ */
1112
+ async feedbackMemory(memoryId2, agentId2, signal) {
1113
+ return this.request("POST", `/v1/memories/${memoryId2}/feedback`, { agent_id: agentId2, signal });
1114
+ }
1115
+ /**
1116
+ * Get the full feedback history for a memory (INT-1).
1117
+ *
1118
+ * @param memoryId The memory whose feedback history to retrieve.
1119
+ */
1120
+ async getMemoryFeedbackHistory(memoryId2) {
1121
+ return this.request("GET", `/v1/memories/${memoryId2}/feedback`);
1122
+ }
1123
+ /**
1124
+ * Get aggregate feedback counts and health score for an agent (INT-1).
1125
+ *
1126
+ * @param agentId The agent to summarise feedback for.
1127
+ */
1128
+ async getAgentFeedbackSummary(agentId2) {
1129
+ return this.request("GET", `/v1/agents/${agentId2}/feedback/summary`);
1130
+ }
1131
+ /**
1132
+ * Directly override a memory's importance score (INT-1).
1133
+ *
1134
+ * @param memoryId The memory to update.
1135
+ * @param agentId The agent that owns the memory.
1136
+ * @param importance New importance value (0.0–1.0).
1137
+ */
1138
+ async patchMemoryImportance(memoryId2, agentId2, importance) {
1139
+ return this.request("PATCH", `/v1/memories/${memoryId2}/importance`, { agent_id: agentId2, importance });
1140
+ }
1141
+ /**
1142
+ * Get overall feedback health score for an agent (INT-1).
1143
+ *
1144
+ * The health score is the mean importance of all non-expired memories (0.0–1.0).
1145
+ * A higher score indicates a healthier, more relevant memory store.
1146
+ *
1147
+ * @param agentId The agent to get health score for.
1148
+ */
1149
+ async getFeedbackHealth(agentId2) {
1150
+ const params = new URLSearchParams({ agent_id: agentId2 });
1151
+ return this.request("GET", `/v1/feedback/health?${params}`);
1152
+ }
1153
+ // ===========================================================================
1099
1154
  // Memory Knowledge Graph Operations (CE-5 / SDK-9)
1100
1155
  // ===========================================================================
1101
1156
  /**
@@ -1710,6 +1765,49 @@ var DakeraClient = class {
1710
1765
  return null;
1711
1766
  }
1712
1767
  }
1768
+ // ===========================================================================
1769
+ // Namespace API Keys — SEC-1
1770
+ // ===========================================================================
1771
+ /**
1772
+ * Create a namespace-scoped API key (SEC-1).
1773
+ *
1774
+ * The `key` field in the response is shown **only once** — store it securely.
1775
+ *
1776
+ * @param namespace The namespace to scope this key to.
1777
+ * @param name Human-readable label for the key.
1778
+ * @param expiresInDays Optional expiry in days from now.
1779
+ */
1780
+ async createNamespaceKey(namespace, name, expiresInDays) {
1781
+ const body = { name };
1782
+ if (expiresInDays !== void 0) body.expires_in_days = expiresInDays;
1783
+ return this.request("POST", `/v1/namespaces/${namespace}/keys`, body);
1784
+ }
1785
+ /**
1786
+ * List all API keys scoped to a namespace (SEC-1).
1787
+ *
1788
+ * @param namespace The namespace whose keys to list.
1789
+ */
1790
+ async listNamespaceKeys(namespace) {
1791
+ return this.request("GET", `/v1/namespaces/${namespace}/keys`);
1792
+ }
1793
+ /**
1794
+ * Revoke a namespace-scoped API key (SEC-1).
1795
+ *
1796
+ * @param namespace The namespace the key belongs to.
1797
+ * @param keyId The key to revoke.
1798
+ */
1799
+ async deleteNamespaceKey(namespace, keyId) {
1800
+ return this.request("DELETE", `/v1/namespaces/${namespace}/keys/${keyId}`);
1801
+ }
1802
+ /**
1803
+ * Get usage statistics for a namespace-scoped API key (SEC-1).
1804
+ *
1805
+ * @param namespace The namespace the key belongs to.
1806
+ * @param keyId The key whose usage to retrieve.
1807
+ */
1808
+ async getNamespaceKeyUsage(namespace, keyId) {
1809
+ return this.request("GET", `/v1/namespaces/${namespace}/keys/${keyId}/usage`);
1810
+ }
1713
1811
  };
1714
1812
 
1715
1813
  // src/types.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dakera-ai/dakera",
3
- "version": "0.9.0",
3
+ "version": "0.9.2",
4
4
  "description": "TypeScript/JavaScript SDK for Dakera AI memory platform",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -51,7 +51,7 @@
51
51
  },
52
52
  "devDependencies": {
53
53
  "@types/node": "^20.10.0",
54
- "eslint": "^8.55.0",
54
+ "eslint": "^10.1.0",
55
55
  "tsup": "^8.0.1",
56
56
  "typescript": "^5.3.0",
57
57
  "vitest": "^4.1.0"