@memnexus-ai/sdk 1.68.7 → 1.69.0

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.cjs CHANGED
@@ -2796,6 +2796,23 @@ var Admin = class {
2796
2796
  body: options?.body
2797
2797
  });
2798
2798
  }
2799
+ /**
2800
+ * Re-encrypt existing plaintext-at-rest Memory and Entity rows (dry-run by default)
2801
+ * @param options — Optional parameters
2802
+ */
2803
+ async adminMigrateEncryptionBackfill(options) {
2804
+ const pathParams = {};
2805
+ const queryParams = {
2806
+ "apply": options?.apply
2807
+ };
2808
+ return this._http.request({
2809
+ method: "POST",
2810
+ path: "/api/admin/migrate/encryption-backfill",
2811
+ pathParams,
2812
+ queryParams,
2813
+ body: options?.body
2814
+ });
2815
+ }
2799
2816
  };
2800
2817
 
2801
2818
  // src/services/admin-alerts.ts
package/dist/index.d.cts CHANGED
@@ -745,6 +745,14 @@ interface SearchResult {
745
745
  contributingFactors?: string[];
746
746
  };
747
747
  }
748
+ interface BranchFailure {
749
+ /** Search branch name (fulltext, semantic, topic, digest, …) */
750
+ name: string;
751
+ /** How the branch failed */
752
+ status: 'timeout' | 'error';
753
+ /** Closed-vocabulary cause. Never free text — a raw message could leak internal hostnames, ports, or query text. */
754
+ reason: 'timeout' | 'connection' | 'query_error' | 'provider_error' | 'unknown';
755
+ }
748
756
  /** Temporal query metadata (present when temporal filters are used) */
749
757
  interface TemporalMetadata {
750
758
  /** Temporal query mode used */
@@ -780,6 +788,10 @@ interface SearchMeta {
780
788
  searchTime: number;
781
789
  /** Search method used for this query */
782
790
  searchMethod: string;
791
+ /** True when this result set is INCOMPLETE — at least one search branch timed out or errored, so absence of a memory does not mean it does not exist. ABSENT (not false) on the healthy path: a healthy response gains no new fields. */
792
+ degraded?: boolean;
793
+ /** The branches that did NOT complete, present only when degraded is true. Healthy branches are omitted, and the field is absent entirely on the healthy path. */
794
+ branchFailures?: BranchFailure[];
783
795
  /** Temporal query metadata (present when temporal filters are used) */
784
796
  temporalMetadata?: TemporalMetadata;
785
797
  }
@@ -847,6 +859,20 @@ interface SearchResponse {
847
859
  /** Clusters of related claims that may conflict. Only present when relevant groups exist. Claims within each group are sorted newest-first. */
848
860
  claim_groups?: ClaimGroup[];
849
861
  }
862
+ interface SearchFailureResponse {
863
+ /** Human-readable message. Worded so it never reads as 'no results exist'. */
864
+ error: string;
865
+ /** Top-level outcome the client switches on. all_branches_failed = every search branch failed, backend degraded (a retry may not help until it recovers); deadline_exceeded = the in-app request deadline was hit before a result could be produced (a retry may land inside budget); service_at_capacity = the request was shed by bounded admission/backpressure (retrying after retry_after_ms succeeds once load drops). */
866
+ reason?: 'all_branches_failed' | 'deadline_exceeded' | 'service_at_capacity';
867
+ /** Explicit signal that retrying is worthwhile. True for all typed honest-failure reasons. */
868
+ retryable?: boolean;
869
+ /** Advisory delay in milliseconds before retrying. Present only when reason is service_at_capacity. Carries server-side jitter (base ±25%) so clients shed together do not retry in lockstep and re-create the spike. */
870
+ retry_after_ms?: number;
871
+ /** True when the gather was incomplete — at least one search branch timed out or errored. */
872
+ degraded?: boolean;
873
+ /** The branches that did NOT complete. Healthy branches are omitted. */
874
+ branchFailures?: BranchFailure[];
875
+ }
850
876
  interface Fact {
851
877
  /** Unique identifier for the fact */
852
878
  id: string;
@@ -4154,6 +4180,49 @@ declare class Admin {
4154
4180
  toUpdate?: Record<string, unknown>[];
4155
4181
  toUpdateCount?: number;
4156
4182
  }>>;
4183
+ /**
4184
+ * Re-encrypt existing plaintext-at-rest Memory and Entity rows (dry-run by default)
4185
+ * @param options — Optional parameters
4186
+ */
4187
+ adminMigrateEncryptionBackfill(options?: {
4188
+ body?: {
4189
+ apply?: boolean;
4190
+ target?: 'memory' | 'entity' | 'both';
4191
+ maxRows?: number;
4192
+ };
4193
+ apply?: boolean;
4194
+ }): Promise<HttpResponse<{
4195
+ dryRun: boolean;
4196
+ target: 'memory' | 'entity' | 'both';
4197
+ encryptionConfigured: boolean;
4198
+ preflight?: {
4199
+ memory?: {
4200
+ mixedShape?: number;
4201
+ markerV2Plaintext?: number;
4202
+ };
4203
+ };
4204
+ memory: {
4205
+ scanned?: number;
4206
+ succeeded?: number;
4207
+ failed?: number;
4208
+ skipped?: number;
4209
+ remaining?: number;
4210
+ };
4211
+ entity: {
4212
+ scanned?: number;
4213
+ succeeded?: number;
4214
+ failed?: number;
4215
+ skipped?: number;
4216
+ remaining?: number;
4217
+ };
4218
+ errors: Array<{
4219
+ id?: string;
4220
+ reason?: 'dek_unavailable' | 'encrypt_failed' | 'not_wired' | 'unknown';
4221
+ }>;
4222
+ startedAt: string;
4223
+ completedAt: string;
4224
+ durationMs: number;
4225
+ }>>;
4157
4226
  }
4158
4227
 
4159
4228
  /**
@@ -4417,4 +4486,4 @@ declare class MemNexus {
4417
4486
  forget(memoryId: string): Promise<HttpResponse<unknown>>;
4418
4487
  }
4419
4488
 
4420
- export { type AddMemoryToNarrativeRequest, type ApiKey, type AppendNamedMemoryRequest, type Artifact, type BatchGetMemoriesMeta, type BatchGetMemoriesRequest, type BatchGetMemoriesResponse, type BillingOverview, type BuildContextActiveWork, type BuildContextActivity, type BuildContextFact, type BuildContextGotcha, type BuildContextMeta, type BuildContextPattern, type BuildContextRequest, type BuildContextResponse, type BulkDeleteRequest, type BulkDeleteResponse, type BulkTagRequest, type BulkTagResponse, type BulkUpdateRequest, type BulkUpdateResponse, type CheckoutSessionResponse, type ClaimGroup, type ClaimGroupClaim, type ClaimGroupSignals, type CodeContext, type Community, type CompileInstructionsRequest, type CompileInstructionsResponse, type Conversation, type CreateArtifactRequest, type CreateCheckoutSessionRequest, type CreateConversationRequest, type CreateFactRequest, type CreateMemoryRelationshipRequest, type CreateMemoryRequest, type CreateMemoryResponse, type CreateMemoryResponseMeta, type CreateNarrativeRequest, type CreatePortalSessionRequest, type CreateRecommendationRequest, type CreateSystemAlertRequest, type DigestEntity, type DigestKeyFact, type DigestMetadata, type DigestRequest, type DigestResponse, type DigestSource, type DigestTimeRange, type EffectiveStateBreakdown, type Entity, type EntityNode, type Error$1 as Error, type ExportRequest, type FacetEntry, type Facets, type Fact, type FactSearchRequest, type GetMemoryResponse, type GetNarrativeResponse, type GraphRAGQueryRequest, type GraphRAGQueryResponse, type HealthCheck, type HttpClientOptions, type HttpResponse, type Invoice, type ListInvoicesResponse, type ListNarrativesResponse, type ListPaymentMethodsResponse, type MatchRecommendationsRequest, MemNexus, type Memory, type MemoryRelationship, type MemoryRelationshipsResponse, type NamedMemoryHistoryResponse, type NarrativeMemory, type NarrativeThread, type NarrativeTimelineResponse, type Pagination, type Pattern, type PaymentMethod, type PortalSessionResponse, type PrecomputedMemoryFields, type Recommendation, type RelatedMemoryResult, SdkError, type SearchMeta, type SearchRequest, type SearchResponse, type SearchResult, type ServiceCheck, type Subscription, type SystemAlert, type TemporalMetadata, type Topic, type UpdateArtifactRequest, type UpdateFactRequest, type UpdateMemoryRequest, type UpdateNamedMemoryRequest, type UpdateNarrativeRequest, type UpdateSystemAlertRequest, type User, type UserUsage };
4489
+ export { type AddMemoryToNarrativeRequest, type ApiKey, type AppendNamedMemoryRequest, type Artifact, type BatchGetMemoriesMeta, type BatchGetMemoriesRequest, type BatchGetMemoriesResponse, type BillingOverview, type BranchFailure, type BuildContextActiveWork, type BuildContextActivity, type BuildContextFact, type BuildContextGotcha, type BuildContextMeta, type BuildContextPattern, type BuildContextRequest, type BuildContextResponse, type BulkDeleteRequest, type BulkDeleteResponse, type BulkTagRequest, type BulkTagResponse, type BulkUpdateRequest, type BulkUpdateResponse, type CheckoutSessionResponse, type ClaimGroup, type ClaimGroupClaim, type ClaimGroupSignals, type CodeContext, type Community, type CompileInstructionsRequest, type CompileInstructionsResponse, type Conversation, type CreateArtifactRequest, type CreateCheckoutSessionRequest, type CreateConversationRequest, type CreateFactRequest, type CreateMemoryRelationshipRequest, type CreateMemoryRequest, type CreateMemoryResponse, type CreateMemoryResponseMeta, type CreateNarrativeRequest, type CreatePortalSessionRequest, type CreateRecommendationRequest, type CreateSystemAlertRequest, type DigestEntity, type DigestKeyFact, type DigestMetadata, type DigestRequest, type DigestResponse, type DigestSource, type DigestTimeRange, type EffectiveStateBreakdown, type Entity, type EntityNode, type Error$1 as Error, type ExportRequest, type FacetEntry, type Facets, type Fact, type FactSearchRequest, type GetMemoryResponse, type GetNarrativeResponse, type GraphRAGQueryRequest, type GraphRAGQueryResponse, type HealthCheck, type HttpClientOptions, type HttpResponse, type Invoice, type ListInvoicesResponse, type ListNarrativesResponse, type ListPaymentMethodsResponse, type MatchRecommendationsRequest, MemNexus, type Memory, type MemoryRelationship, type MemoryRelationshipsResponse, type NamedMemoryHistoryResponse, type NarrativeMemory, type NarrativeThread, type NarrativeTimelineResponse, type Pagination, type Pattern, type PaymentMethod, type PortalSessionResponse, type PrecomputedMemoryFields, type Recommendation, type RelatedMemoryResult, SdkError, type SearchFailureResponse, type SearchMeta, type SearchRequest, type SearchResponse, type SearchResult, type ServiceCheck, type Subscription, type SystemAlert, type TemporalMetadata, type Topic, type UpdateArtifactRequest, type UpdateFactRequest, type UpdateMemoryRequest, type UpdateNamedMemoryRequest, type UpdateNarrativeRequest, type UpdateSystemAlertRequest, type User, type UserUsage };
package/dist/index.d.ts CHANGED
@@ -745,6 +745,14 @@ interface SearchResult {
745
745
  contributingFactors?: string[];
746
746
  };
747
747
  }
748
+ interface BranchFailure {
749
+ /** Search branch name (fulltext, semantic, topic, digest, …) */
750
+ name: string;
751
+ /** How the branch failed */
752
+ status: 'timeout' | 'error';
753
+ /** Closed-vocabulary cause. Never free text — a raw message could leak internal hostnames, ports, or query text. */
754
+ reason: 'timeout' | 'connection' | 'query_error' | 'provider_error' | 'unknown';
755
+ }
748
756
  /** Temporal query metadata (present when temporal filters are used) */
749
757
  interface TemporalMetadata {
750
758
  /** Temporal query mode used */
@@ -780,6 +788,10 @@ interface SearchMeta {
780
788
  searchTime: number;
781
789
  /** Search method used for this query */
782
790
  searchMethod: string;
791
+ /** True when this result set is INCOMPLETE — at least one search branch timed out or errored, so absence of a memory does not mean it does not exist. ABSENT (not false) on the healthy path: a healthy response gains no new fields. */
792
+ degraded?: boolean;
793
+ /** The branches that did NOT complete, present only when degraded is true. Healthy branches are omitted, and the field is absent entirely on the healthy path. */
794
+ branchFailures?: BranchFailure[];
783
795
  /** Temporal query metadata (present when temporal filters are used) */
784
796
  temporalMetadata?: TemporalMetadata;
785
797
  }
@@ -847,6 +859,20 @@ interface SearchResponse {
847
859
  /** Clusters of related claims that may conflict. Only present when relevant groups exist. Claims within each group are sorted newest-first. */
848
860
  claim_groups?: ClaimGroup[];
849
861
  }
862
+ interface SearchFailureResponse {
863
+ /** Human-readable message. Worded so it never reads as 'no results exist'. */
864
+ error: string;
865
+ /** Top-level outcome the client switches on. all_branches_failed = every search branch failed, backend degraded (a retry may not help until it recovers); deadline_exceeded = the in-app request deadline was hit before a result could be produced (a retry may land inside budget); service_at_capacity = the request was shed by bounded admission/backpressure (retrying after retry_after_ms succeeds once load drops). */
866
+ reason?: 'all_branches_failed' | 'deadline_exceeded' | 'service_at_capacity';
867
+ /** Explicit signal that retrying is worthwhile. True for all typed honest-failure reasons. */
868
+ retryable?: boolean;
869
+ /** Advisory delay in milliseconds before retrying. Present only when reason is service_at_capacity. Carries server-side jitter (base ±25%) so clients shed together do not retry in lockstep and re-create the spike. */
870
+ retry_after_ms?: number;
871
+ /** True when the gather was incomplete — at least one search branch timed out or errored. */
872
+ degraded?: boolean;
873
+ /** The branches that did NOT complete. Healthy branches are omitted. */
874
+ branchFailures?: BranchFailure[];
875
+ }
850
876
  interface Fact {
851
877
  /** Unique identifier for the fact */
852
878
  id: string;
@@ -4154,6 +4180,49 @@ declare class Admin {
4154
4180
  toUpdate?: Record<string, unknown>[];
4155
4181
  toUpdateCount?: number;
4156
4182
  }>>;
4183
+ /**
4184
+ * Re-encrypt existing plaintext-at-rest Memory and Entity rows (dry-run by default)
4185
+ * @param options — Optional parameters
4186
+ */
4187
+ adminMigrateEncryptionBackfill(options?: {
4188
+ body?: {
4189
+ apply?: boolean;
4190
+ target?: 'memory' | 'entity' | 'both';
4191
+ maxRows?: number;
4192
+ };
4193
+ apply?: boolean;
4194
+ }): Promise<HttpResponse<{
4195
+ dryRun: boolean;
4196
+ target: 'memory' | 'entity' | 'both';
4197
+ encryptionConfigured: boolean;
4198
+ preflight?: {
4199
+ memory?: {
4200
+ mixedShape?: number;
4201
+ markerV2Plaintext?: number;
4202
+ };
4203
+ };
4204
+ memory: {
4205
+ scanned?: number;
4206
+ succeeded?: number;
4207
+ failed?: number;
4208
+ skipped?: number;
4209
+ remaining?: number;
4210
+ };
4211
+ entity: {
4212
+ scanned?: number;
4213
+ succeeded?: number;
4214
+ failed?: number;
4215
+ skipped?: number;
4216
+ remaining?: number;
4217
+ };
4218
+ errors: Array<{
4219
+ id?: string;
4220
+ reason?: 'dek_unavailable' | 'encrypt_failed' | 'not_wired' | 'unknown';
4221
+ }>;
4222
+ startedAt: string;
4223
+ completedAt: string;
4224
+ durationMs: number;
4225
+ }>>;
4157
4226
  }
4158
4227
 
4159
4228
  /**
@@ -4417,4 +4486,4 @@ declare class MemNexus {
4417
4486
  forget(memoryId: string): Promise<HttpResponse<unknown>>;
4418
4487
  }
4419
4488
 
4420
- export { type AddMemoryToNarrativeRequest, type ApiKey, type AppendNamedMemoryRequest, type Artifact, type BatchGetMemoriesMeta, type BatchGetMemoriesRequest, type BatchGetMemoriesResponse, type BillingOverview, type BuildContextActiveWork, type BuildContextActivity, type BuildContextFact, type BuildContextGotcha, type BuildContextMeta, type BuildContextPattern, type BuildContextRequest, type BuildContextResponse, type BulkDeleteRequest, type BulkDeleteResponse, type BulkTagRequest, type BulkTagResponse, type BulkUpdateRequest, type BulkUpdateResponse, type CheckoutSessionResponse, type ClaimGroup, type ClaimGroupClaim, type ClaimGroupSignals, type CodeContext, type Community, type CompileInstructionsRequest, type CompileInstructionsResponse, type Conversation, type CreateArtifactRequest, type CreateCheckoutSessionRequest, type CreateConversationRequest, type CreateFactRequest, type CreateMemoryRelationshipRequest, type CreateMemoryRequest, type CreateMemoryResponse, type CreateMemoryResponseMeta, type CreateNarrativeRequest, type CreatePortalSessionRequest, type CreateRecommendationRequest, type CreateSystemAlertRequest, type DigestEntity, type DigestKeyFact, type DigestMetadata, type DigestRequest, type DigestResponse, type DigestSource, type DigestTimeRange, type EffectiveStateBreakdown, type Entity, type EntityNode, type Error$1 as Error, type ExportRequest, type FacetEntry, type Facets, type Fact, type FactSearchRequest, type GetMemoryResponse, type GetNarrativeResponse, type GraphRAGQueryRequest, type GraphRAGQueryResponse, type HealthCheck, type HttpClientOptions, type HttpResponse, type Invoice, type ListInvoicesResponse, type ListNarrativesResponse, type ListPaymentMethodsResponse, type MatchRecommendationsRequest, MemNexus, type Memory, type MemoryRelationship, type MemoryRelationshipsResponse, type NamedMemoryHistoryResponse, type NarrativeMemory, type NarrativeThread, type NarrativeTimelineResponse, type Pagination, type Pattern, type PaymentMethod, type PortalSessionResponse, type PrecomputedMemoryFields, type Recommendation, type RelatedMemoryResult, SdkError, type SearchMeta, type SearchRequest, type SearchResponse, type SearchResult, type ServiceCheck, type Subscription, type SystemAlert, type TemporalMetadata, type Topic, type UpdateArtifactRequest, type UpdateFactRequest, type UpdateMemoryRequest, type UpdateNamedMemoryRequest, type UpdateNarrativeRequest, type UpdateSystemAlertRequest, type User, type UserUsage };
4489
+ export { type AddMemoryToNarrativeRequest, type ApiKey, type AppendNamedMemoryRequest, type Artifact, type BatchGetMemoriesMeta, type BatchGetMemoriesRequest, type BatchGetMemoriesResponse, type BillingOverview, type BranchFailure, type BuildContextActiveWork, type BuildContextActivity, type BuildContextFact, type BuildContextGotcha, type BuildContextMeta, type BuildContextPattern, type BuildContextRequest, type BuildContextResponse, type BulkDeleteRequest, type BulkDeleteResponse, type BulkTagRequest, type BulkTagResponse, type BulkUpdateRequest, type BulkUpdateResponse, type CheckoutSessionResponse, type ClaimGroup, type ClaimGroupClaim, type ClaimGroupSignals, type CodeContext, type Community, type CompileInstructionsRequest, type CompileInstructionsResponse, type Conversation, type CreateArtifactRequest, type CreateCheckoutSessionRequest, type CreateConversationRequest, type CreateFactRequest, type CreateMemoryRelationshipRequest, type CreateMemoryRequest, type CreateMemoryResponse, type CreateMemoryResponseMeta, type CreateNarrativeRequest, type CreatePortalSessionRequest, type CreateRecommendationRequest, type CreateSystemAlertRequest, type DigestEntity, type DigestKeyFact, type DigestMetadata, type DigestRequest, type DigestResponse, type DigestSource, type DigestTimeRange, type EffectiveStateBreakdown, type Entity, type EntityNode, type Error$1 as Error, type ExportRequest, type FacetEntry, type Facets, type Fact, type FactSearchRequest, type GetMemoryResponse, type GetNarrativeResponse, type GraphRAGQueryRequest, type GraphRAGQueryResponse, type HealthCheck, type HttpClientOptions, type HttpResponse, type Invoice, type ListInvoicesResponse, type ListNarrativesResponse, type ListPaymentMethodsResponse, type MatchRecommendationsRequest, MemNexus, type Memory, type MemoryRelationship, type MemoryRelationshipsResponse, type NamedMemoryHistoryResponse, type NarrativeMemory, type NarrativeThread, type NarrativeTimelineResponse, type Pagination, type Pattern, type PaymentMethod, type PortalSessionResponse, type PrecomputedMemoryFields, type Recommendation, type RelatedMemoryResult, SdkError, type SearchFailureResponse, type SearchMeta, type SearchRequest, type SearchResponse, type SearchResult, type ServiceCheck, type Subscription, type SystemAlert, type TemporalMetadata, type Topic, type UpdateArtifactRequest, type UpdateFactRequest, type UpdateMemoryRequest, type UpdateNamedMemoryRequest, type UpdateNarrativeRequest, type UpdateSystemAlertRequest, type User, type UserUsage };
package/dist/index.js CHANGED
@@ -2769,6 +2769,23 @@ var Admin = class {
2769
2769
  body: options?.body
2770
2770
  });
2771
2771
  }
2772
+ /**
2773
+ * Re-encrypt existing plaintext-at-rest Memory and Entity rows (dry-run by default)
2774
+ * @param options — Optional parameters
2775
+ */
2776
+ async adminMigrateEncryptionBackfill(options) {
2777
+ const pathParams = {};
2778
+ const queryParams = {
2779
+ "apply": options?.apply
2780
+ };
2781
+ return this._http.request({
2782
+ method: "POST",
2783
+ path: "/api/admin/migrate/encryption-backfill",
2784
+ pathParams,
2785
+ queryParams,
2786
+ body: options?.body
2787
+ });
2788
+ }
2772
2789
  };
2773
2790
 
2774
2791
  // src/services/admin-alerts.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memnexus-ai/sdk",
3
- "version": "1.68.7",
3
+ "version": "1.69.0",
4
4
  "description": "Official Node.js SDK for the MemNexus API",
5
5
  "license": "Proprietary",
6
6
  "type": "module",