@dakera-ai/dakera 0.9.0 → 0.9.3
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 +182 -1
- package/dist/index.d.ts +182 -1
- package/dist/index.js +104 -0
- package/dist/index.mjs +104 -0
- package/package.json +2 -2
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
|
*
|
|
@@ -2071,6 +2215,10 @@ declare class DakeraClient {
|
|
|
2071
2215
|
/** Get server stats (version, total_vectors, namespace_count, uptime_seconds, timestamp).
|
|
2072
2216
|
* Requires Read scope — works with read-only API keys, unlike clusterStatus. */
|
|
2073
2217
|
opsStats(): Promise<OpsStats>;
|
|
2218
|
+
/** Get Prometheus metrics in text exposition format (INFRA-3).
|
|
2219
|
+
* Requires Admin scope. Returns the raw Prometheus text exposition
|
|
2220
|
+
* format string suitable for scraping by a Prometheus server. */
|
|
2221
|
+
opsMetrics(): Promise<string>;
|
|
2074
2222
|
/** Get cluster status */
|
|
2075
2223
|
clusterStatus(): Promise<ClusterStatus>;
|
|
2076
2224
|
/** Get cluster nodes */
|
|
@@ -2256,6 +2404,39 @@ declare class DakeraClient {
|
|
|
2256
2404
|
private _streamSseMemory;
|
|
2257
2405
|
/** Parse a single SSE event block into a {@link MemoryEvent}. */
|
|
2258
2406
|
private _parseSseMemoryBlock;
|
|
2407
|
+
/**
|
|
2408
|
+
* Create a namespace-scoped API key (SEC-1).
|
|
2409
|
+
*
|
|
2410
|
+
* The `key` field in the response is shown **only once** — store it securely.
|
|
2411
|
+
*
|
|
2412
|
+
* @param namespace The namespace to scope this key to.
|
|
2413
|
+
* @param name Human-readable label for the key.
|
|
2414
|
+
* @param expiresInDays Optional expiry in days from now.
|
|
2415
|
+
*/
|
|
2416
|
+
createNamespaceKey(namespace: string, name: string, expiresInDays?: number): Promise<CreateNamespaceKeyResponse>;
|
|
2417
|
+
/**
|
|
2418
|
+
* List all API keys scoped to a namespace (SEC-1).
|
|
2419
|
+
*
|
|
2420
|
+
* @param namespace The namespace whose keys to list.
|
|
2421
|
+
*/
|
|
2422
|
+
listNamespaceKeys(namespace: string): Promise<ListNamespaceKeysResponse>;
|
|
2423
|
+
/**
|
|
2424
|
+
* Revoke a namespace-scoped API key (SEC-1).
|
|
2425
|
+
*
|
|
2426
|
+
* @param namespace The namespace the key belongs to.
|
|
2427
|
+
* @param keyId The key to revoke.
|
|
2428
|
+
*/
|
|
2429
|
+
deleteNamespaceKey(namespace: string, keyId: string): Promise<{
|
|
2430
|
+
success: boolean;
|
|
2431
|
+
message: string;
|
|
2432
|
+
}>;
|
|
2433
|
+
/**
|
|
2434
|
+
* Get usage statistics for a namespace-scoped API key (SEC-1).
|
|
2435
|
+
*
|
|
2436
|
+
* @param namespace The namespace the key belongs to.
|
|
2437
|
+
* @param keyId The key whose usage to retrieve.
|
|
2438
|
+
*/
|
|
2439
|
+
getNamespaceKeyUsage(namespace: string, keyId: string): Promise<NamespaceKeyUsageResponse>;
|
|
2259
2440
|
}
|
|
2260
2441
|
|
|
2261
2442
|
/**
|
|
@@ -2320,4 +2501,4 @@ declare class TimeoutError extends DakeraError {
|
|
|
2320
2501
|
constructor(message: string);
|
|
2321
2502
|
}
|
|
2322
2503
|
|
|
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 };
|
|
2504
|
+
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
|
*
|
|
@@ -2071,6 +2215,10 @@ declare class DakeraClient {
|
|
|
2071
2215
|
/** Get server stats (version, total_vectors, namespace_count, uptime_seconds, timestamp).
|
|
2072
2216
|
* Requires Read scope — works with read-only API keys, unlike clusterStatus. */
|
|
2073
2217
|
opsStats(): Promise<OpsStats>;
|
|
2218
|
+
/** Get Prometheus metrics in text exposition format (INFRA-3).
|
|
2219
|
+
* Requires Admin scope. Returns the raw Prometheus text exposition
|
|
2220
|
+
* format string suitable for scraping by a Prometheus server. */
|
|
2221
|
+
opsMetrics(): Promise<string>;
|
|
2074
2222
|
/** Get cluster status */
|
|
2075
2223
|
clusterStatus(): Promise<ClusterStatus>;
|
|
2076
2224
|
/** Get cluster nodes */
|
|
@@ -2256,6 +2404,39 @@ declare class DakeraClient {
|
|
|
2256
2404
|
private _streamSseMemory;
|
|
2257
2405
|
/** Parse a single SSE event block into a {@link MemoryEvent}. */
|
|
2258
2406
|
private _parseSseMemoryBlock;
|
|
2407
|
+
/**
|
|
2408
|
+
* Create a namespace-scoped API key (SEC-1).
|
|
2409
|
+
*
|
|
2410
|
+
* The `key` field in the response is shown **only once** — store it securely.
|
|
2411
|
+
*
|
|
2412
|
+
* @param namespace The namespace to scope this key to.
|
|
2413
|
+
* @param name Human-readable label for the key.
|
|
2414
|
+
* @param expiresInDays Optional expiry in days from now.
|
|
2415
|
+
*/
|
|
2416
|
+
createNamespaceKey(namespace: string, name: string, expiresInDays?: number): Promise<CreateNamespaceKeyResponse>;
|
|
2417
|
+
/**
|
|
2418
|
+
* List all API keys scoped to a namespace (SEC-1).
|
|
2419
|
+
*
|
|
2420
|
+
* @param namespace The namespace whose keys to list.
|
|
2421
|
+
*/
|
|
2422
|
+
listNamespaceKeys(namespace: string): Promise<ListNamespaceKeysResponse>;
|
|
2423
|
+
/**
|
|
2424
|
+
* Revoke a namespace-scoped API key (SEC-1).
|
|
2425
|
+
*
|
|
2426
|
+
* @param namespace The namespace the key belongs to.
|
|
2427
|
+
* @param keyId The key to revoke.
|
|
2428
|
+
*/
|
|
2429
|
+
deleteNamespaceKey(namespace: string, keyId: string): Promise<{
|
|
2430
|
+
success: boolean;
|
|
2431
|
+
message: string;
|
|
2432
|
+
}>;
|
|
2433
|
+
/**
|
|
2434
|
+
* Get usage statistics for a namespace-scoped API key (SEC-1).
|
|
2435
|
+
*
|
|
2436
|
+
* @param namespace The namespace the key belongs to.
|
|
2437
|
+
* @param keyId The key whose usage to retrieve.
|
|
2438
|
+
*/
|
|
2439
|
+
getNamespaceKeyUsage(namespace: string, keyId: string): Promise<NamespaceKeyUsageResponse>;
|
|
2259
2440
|
}
|
|
2260
2441
|
|
|
2261
2442
|
/**
|
|
@@ -2320,4 +2501,4 @@ declare class TimeoutError extends DakeraError {
|
|
|
2320
2501
|
constructor(message: string);
|
|
2321
2502
|
}
|
|
2322
2503
|
|
|
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 };
|
|
2504
|
+
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
|
/**
|
|
@@ -1380,6 +1435,12 @@ var DakeraClient = class {
|
|
|
1380
1435
|
async opsStats() {
|
|
1381
1436
|
return this.request("GET", "/v1/ops/stats");
|
|
1382
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
|
+
}
|
|
1383
1444
|
/** Get cluster status */
|
|
1384
1445
|
async clusterStatus() {
|
|
1385
1446
|
return this.request("GET", "/v1/admin/cluster/status");
|
|
@@ -1750,6 +1811,49 @@ var DakeraClient = class {
|
|
|
1750
1811
|
return null;
|
|
1751
1812
|
}
|
|
1752
1813
|
}
|
|
1814
|
+
// ===========================================================================
|
|
1815
|
+
// Namespace API Keys — SEC-1
|
|
1816
|
+
// ===========================================================================
|
|
1817
|
+
/**
|
|
1818
|
+
* Create a namespace-scoped API key (SEC-1).
|
|
1819
|
+
*
|
|
1820
|
+
* The `key` field in the response is shown **only once** — store it securely.
|
|
1821
|
+
*
|
|
1822
|
+
* @param namespace The namespace to scope this key to.
|
|
1823
|
+
* @param name Human-readable label for the key.
|
|
1824
|
+
* @param expiresInDays Optional expiry in days from now.
|
|
1825
|
+
*/
|
|
1826
|
+
async createNamespaceKey(namespace, name, expiresInDays) {
|
|
1827
|
+
const body = { name };
|
|
1828
|
+
if (expiresInDays !== void 0) body.expires_in_days = expiresInDays;
|
|
1829
|
+
return this.request("POST", `/v1/namespaces/${namespace}/keys`, body);
|
|
1830
|
+
}
|
|
1831
|
+
/**
|
|
1832
|
+
* List all API keys scoped to a namespace (SEC-1).
|
|
1833
|
+
*
|
|
1834
|
+
* @param namespace The namespace whose keys to list.
|
|
1835
|
+
*/
|
|
1836
|
+
async listNamespaceKeys(namespace) {
|
|
1837
|
+
return this.request("GET", `/v1/namespaces/${namespace}/keys`);
|
|
1838
|
+
}
|
|
1839
|
+
/**
|
|
1840
|
+
* Revoke a namespace-scoped API key (SEC-1).
|
|
1841
|
+
*
|
|
1842
|
+
* @param namespace The namespace the key belongs to.
|
|
1843
|
+
* @param keyId The key to revoke.
|
|
1844
|
+
*/
|
|
1845
|
+
async deleteNamespaceKey(namespace, keyId) {
|
|
1846
|
+
return this.request("DELETE", `/v1/namespaces/${namespace}/keys/${keyId}`);
|
|
1847
|
+
}
|
|
1848
|
+
/**
|
|
1849
|
+
* Get usage statistics for a namespace-scoped API key (SEC-1).
|
|
1850
|
+
*
|
|
1851
|
+
* @param namespace The namespace the key belongs to.
|
|
1852
|
+
* @param keyId The key whose usage to retrieve.
|
|
1853
|
+
*/
|
|
1854
|
+
async getNamespaceKeyUsage(namespace, keyId) {
|
|
1855
|
+
return this.request("GET", `/v1/namespaces/${namespace}/keys/${keyId}/usage`);
|
|
1856
|
+
}
|
|
1753
1857
|
};
|
|
1754
1858
|
|
|
1755
1859
|
// 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
|
/**
|
|
@@ -1340,6 +1395,12 @@ var DakeraClient = class {
|
|
|
1340
1395
|
async opsStats() {
|
|
1341
1396
|
return this.request("GET", "/v1/ops/stats");
|
|
1342
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
|
+
}
|
|
1343
1404
|
/** Get cluster status */
|
|
1344
1405
|
async clusterStatus() {
|
|
1345
1406
|
return this.request("GET", "/v1/admin/cluster/status");
|
|
@@ -1710,6 +1771,49 @@ var DakeraClient = class {
|
|
|
1710
1771
|
return null;
|
|
1711
1772
|
}
|
|
1712
1773
|
}
|
|
1774
|
+
// ===========================================================================
|
|
1775
|
+
// Namespace API Keys — SEC-1
|
|
1776
|
+
// ===========================================================================
|
|
1777
|
+
/**
|
|
1778
|
+
* Create a namespace-scoped API key (SEC-1).
|
|
1779
|
+
*
|
|
1780
|
+
* The `key` field in the response is shown **only once** — store it securely.
|
|
1781
|
+
*
|
|
1782
|
+
* @param namespace The namespace to scope this key to.
|
|
1783
|
+
* @param name Human-readable label for the key.
|
|
1784
|
+
* @param expiresInDays Optional expiry in days from now.
|
|
1785
|
+
*/
|
|
1786
|
+
async createNamespaceKey(namespace, name, expiresInDays) {
|
|
1787
|
+
const body = { name };
|
|
1788
|
+
if (expiresInDays !== void 0) body.expires_in_days = expiresInDays;
|
|
1789
|
+
return this.request("POST", `/v1/namespaces/${namespace}/keys`, body);
|
|
1790
|
+
}
|
|
1791
|
+
/**
|
|
1792
|
+
* List all API keys scoped to a namespace (SEC-1).
|
|
1793
|
+
*
|
|
1794
|
+
* @param namespace The namespace whose keys to list.
|
|
1795
|
+
*/
|
|
1796
|
+
async listNamespaceKeys(namespace) {
|
|
1797
|
+
return this.request("GET", `/v1/namespaces/${namespace}/keys`);
|
|
1798
|
+
}
|
|
1799
|
+
/**
|
|
1800
|
+
* Revoke a namespace-scoped API key (SEC-1).
|
|
1801
|
+
*
|
|
1802
|
+
* @param namespace The namespace the key belongs to.
|
|
1803
|
+
* @param keyId The key to revoke.
|
|
1804
|
+
*/
|
|
1805
|
+
async deleteNamespaceKey(namespace, keyId) {
|
|
1806
|
+
return this.request("DELETE", `/v1/namespaces/${namespace}/keys/${keyId}`);
|
|
1807
|
+
}
|
|
1808
|
+
/**
|
|
1809
|
+
* Get usage statistics for a namespace-scoped API key (SEC-1).
|
|
1810
|
+
*
|
|
1811
|
+
* @param namespace The namespace the key belongs to.
|
|
1812
|
+
* @param keyId The key whose usage to retrieve.
|
|
1813
|
+
*/
|
|
1814
|
+
async getNamespaceKeyUsage(namespace, keyId) {
|
|
1815
|
+
return this.request("GET", `/v1/namespaces/${namespace}/keys/${keyId}/usage`);
|
|
1816
|
+
}
|
|
1713
1817
|
};
|
|
1714
1818
|
|
|
1715
1819
|
// src/types.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dakera-ai/dakera",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.3",
|
|
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": "^
|
|
54
|
+
"eslint": "^10.1.0",
|
|
55
55
|
"tsup": "^8.0.1",
|
|
56
56
|
"typescript": "^5.3.0",
|
|
57
57
|
"vitest": "^4.1.0"
|