@memnexus-ai/typescript-sdk 1.55.14 → 1.56.1

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.cts CHANGED
@@ -2145,6 +2145,8 @@ declare const getMemoryResponse: z.ZodLazy<z.ZodObject<{
2145
2145
  declare const updateNamedMemoryRequest: z.ZodObject<{
2146
2146
  /** New content for the named memory version */
2147
2147
  content: z.ZodString;
2148
+ /** Optimistic concurrency (compare-and-swap): if provided, the update only succeeds when the current head version's id matches this value. On mismatch the server returns 409 Conflict with the current head id, so the caller can re-read, re-merge, and retry. When omitted, the update is an unconditional replace (backward compatible). */
2149
+ expectedHeadId: z.ZodOptional<z.ZodString>;
2148
2150
  /** Type of memory (defaults to previous version's type) */
2149
2151
  memoryType: z.ZodOptional<z.ZodEnum<["episodic", "semantic", "procedural"]>>;
2150
2152
  /** Context or domain */
@@ -2202,6 +2204,7 @@ declare const updateNamedMemoryRequest: z.ZodObject<{
2202
2204
  extra?: z.objectOutputType<{}, z.ZodString, "strip"> | undefined;
2203
2205
  } | undefined;
2204
2206
  conversationId?: string | undefined;
2207
+ expectedHeadId?: string | undefined;
2205
2208
  supersedes?: string | undefined;
2206
2209
  }, {
2207
2210
  content: string;
@@ -2218,8 +2221,87 @@ declare const updateNamedMemoryRequest: z.ZodObject<{
2218
2221
  extra?: z.objectInputType<{}, z.ZodString, "strip"> | undefined;
2219
2222
  } | undefined;
2220
2223
  conversationId?: string | undefined;
2224
+ expectedHeadId?: string | undefined;
2221
2225
  supersedes?: string | undefined;
2222
2226
  }>;
2227
+ declare const appendNamedMemoryRequest: z.ZodObject<{
2228
+ /** Text block to append to the named memory's current content. The total (existing + separator + block) must not exceed the maximum content length or the request is rejected with 413. */
2229
+ block: z.ZodString;
2230
+ /** Separator inserted between the existing content and the appended block. Defaults to a blank line ("\n\n"). */
2231
+ separator: z.ZodOptional<z.ZodString>;
2232
+ /** Type of memory (defaults to previous version's type) */
2233
+ memoryType: z.ZodOptional<z.ZodEnum<["episodic", "semantic", "procedural"]>>;
2234
+ /** Context or domain */
2235
+ context: z.ZodOptional<z.ZodString>;
2236
+ /** Associated topics */
2237
+ topics: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2238
+ /** Conversation to group this version with (overrides previous version's conversation) */
2239
+ conversationId: z.ZodOptional<z.ZodString>;
2240
+ codeContext: z.ZodOptional<z.ZodObject<{
2241
+ /** Product name (e.g. 'memnexus', 'spearmint') */
2242
+ product: z.ZodOptional<z.ZodString>;
2243
+ /** Repository name, if different from product */
2244
+ repo: z.ZodOptional<z.ZodString>;
2245
+ /** Service or package name (e.g. 'core-api', 'mcp-server', 'cli') */
2246
+ service: z.ZodOptional<z.ZodString>;
2247
+ /** Subsystem or component (e.g. 'extraction-pipeline', 'search', 'billing') */
2248
+ component: z.ZodOptional<z.ZodString>;
2249
+ /** Team that produced this knowledge (e.g. 'extraction', 'mcp', 'platform') */
2250
+ team: z.ZodOptional<z.ZodString>;
2251
+ /** Agent role or persona (e.g. 'team-lead', 'implementer', 'reviewer') */
2252
+ role: z.ZodOptional<z.ZodString>;
2253
+ /** Additional project-specific scope tags */
2254
+ extra: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodString, z.objectOutputType<{}, z.ZodString, "strip">, z.objectInputType<{}, z.ZodString, "strip">>>;
2255
+ }, "strip", z.ZodTypeAny, {
2256
+ product?: string | undefined;
2257
+ repo?: string | undefined;
2258
+ service?: string | undefined;
2259
+ component?: string | undefined;
2260
+ team?: string | undefined;
2261
+ role?: string | undefined;
2262
+ extra?: z.objectOutputType<{}, z.ZodString, "strip"> | undefined;
2263
+ }, {
2264
+ product?: string | undefined;
2265
+ repo?: string | undefined;
2266
+ service?: string | undefined;
2267
+ component?: string | undefined;
2268
+ team?: string | undefined;
2269
+ role?: string | undefined;
2270
+ extra?: z.objectInputType<{}, z.ZodString, "strip"> | undefined;
2271
+ }>>;
2272
+ }, "strip", z.ZodTypeAny, {
2273
+ block: string;
2274
+ memoryType?: "episodic" | "semantic" | "procedural" | undefined;
2275
+ context?: string | undefined;
2276
+ topics?: string[] | undefined;
2277
+ codeContext?: {
2278
+ product?: string | undefined;
2279
+ repo?: string | undefined;
2280
+ service?: string | undefined;
2281
+ component?: string | undefined;
2282
+ team?: string | undefined;
2283
+ role?: string | undefined;
2284
+ extra?: z.objectOutputType<{}, z.ZodString, "strip"> | undefined;
2285
+ } | undefined;
2286
+ conversationId?: string | undefined;
2287
+ separator?: string | undefined;
2288
+ }, {
2289
+ block: string;
2290
+ memoryType?: "episodic" | "semantic" | "procedural" | undefined;
2291
+ context?: string | undefined;
2292
+ topics?: string[] | undefined;
2293
+ codeContext?: {
2294
+ product?: string | undefined;
2295
+ repo?: string | undefined;
2296
+ service?: string | undefined;
2297
+ component?: string | undefined;
2298
+ team?: string | undefined;
2299
+ role?: string | undefined;
2300
+ extra?: z.objectInputType<{}, z.ZodString, "strip"> | undefined;
2301
+ } | undefined;
2302
+ conversationId?: string | undefined;
2303
+ separator?: string | undefined;
2304
+ }>;
2223
2305
  declare const namedMemoryHistoryResponse: z.ZodObject<{
2224
2306
  /** Human-readable name for deterministic retrieval (kebab-case, 2-64 chars) */
2225
2307
  name: z.ZodString;
@@ -9040,6 +9122,7 @@ type RelatedMemoryResult = z.infer<typeof relatedMemoryResult>;
9040
9122
  */
9041
9123
  type GetMemoryResponse = z.infer<typeof getMemoryResponse>;
9042
9124
  type UpdateNamedMemoryRequest = z.infer<typeof updateNamedMemoryRequest>;
9125
+ type AppendNamedMemoryRequest = z.infer<typeof appendNamedMemoryRequest>;
9043
9126
  type NamedMemoryHistoryResponse = z.infer<typeof namedMemoryHistoryResponse>;
9044
9127
  type BatchGetMemoriesRequest = z.infer<typeof batchGetMemoriesRequest>;
9045
9128
  type BatchGetMemoriesMeta = z.infer<typeof batchGetMemoriesMeta>;
@@ -10448,6 +10531,7 @@ declare class MemoriesService extends BaseService {
10448
10531
  */
10449
10532
  updateNamedMemory(name: string, body: {
10450
10533
  content: string;
10534
+ expectedHeadId?: string;
10451
10535
  memoryType?: 'episodic' | 'semantic' | 'procedural';
10452
10536
  context?: string;
10453
10537
  topics?: string[];
@@ -10469,6 +10553,43 @@ declare class MemoriesService extends BaseService {
10469
10553
  version?: number;
10470
10554
  };
10471
10555
  }>>;
10556
+ /**
10557
+ * Atomically append a block to a named memory
10558
+ * Atomically appends a text block to a named memory, eliminating the
10559
+ read-modify-write clobber that concurrent full-content updates cause on
10560
+ shared named memories. The server reads the current head, concatenates
10561
+ `existing + separator + block`, and writes a new version under the
10562
+ NameLock with an internal compare-and-swap + bounded retry — so
10563
+ simultaneous appends all survive and the client needs no retry logic.
10564
+ Content is decrypted, assembled, size-checked, and re-encrypted
10565
+ server-side; plaintext is never returned to other callers.
10566
+
10567
+ * @param name - Memory name (kebab-case, 2-64 chars)
10568
+ * @param body - Request body
10569
+ */
10570
+ appendNamedMemory(name: string, body: {
10571
+ block: string;
10572
+ separator?: string;
10573
+ memoryType?: 'episodic' | 'semantic' | 'procedural';
10574
+ context?: string;
10575
+ topics?: string[];
10576
+ conversationId?: string;
10577
+ codeContext?: {
10578
+ product?: string;
10579
+ repo?: string;
10580
+ service?: string;
10581
+ component?: string;
10582
+ team?: string;
10583
+ role?: string;
10584
+ extra?: Record<string, unknown>;
10585
+ };
10586
+ }): Promise<HttpResponse<{
10587
+ data?: Memory;
10588
+ meta?: {
10589
+ previousVersionId?: string;
10590
+ version?: number;
10591
+ };
10592
+ }>>;
10472
10593
  /**
10473
10594
  * Bulk delete multiple memories
10474
10595
  * Soft-delete multiple memories at once. Requires confirmDeletion=true.
@@ -10862,11 +10983,18 @@ declare class HealthService extends BaseService {
10862
10983
  uptime?: number;
10863
10984
  }>>;
10864
10985
  /**
10865
- * API health check endpoint
10866
- * Returns the health status and uptime of the API service.
10867
- This endpoint is public and requires no authentication.
10868
- Use this endpoint for monitoring, health checks, and service availability verification.
10869
- Returns 200 when healthy, 503 when the database is unreachable.
10986
+ * API readiness check endpoint
10987
+ * Returns the readiness status of the API service, based on database
10988
+ connectivity. This endpoint is public and requires no authentication.
10989
+ Returns 200 when the database is reachable, 503 when it is not.
10990
+
10991
+ v2.35: the database status is served from a CACHE refreshed by a
10992
+ background loop every HEALTH_DB_CHECK_INTERVAL_MS — this endpoint does
10993
+ NOT query the database per request, so probe latency is decoupled from
10994
+ query latency (the 07-03 dual-pod ejection fix). If the cache is older
10995
+ than HEALTH_DB_STALENESS_CEILING_MS (the background checker is wedged,
10996
+ e.g. a hung query), readiness reports NOT-READY (503) — a genuinely
10997
+ dead/hung database is never masked by a stale "ok".
10870
10998
 
10871
10999
  */
10872
11000
  healthCheck(): Promise<HttpResponse<{
@@ -11823,4 +11951,4 @@ declare class Memnexus {
11823
11951
  setEnvironment(environment: Environment): void;
11824
11952
  }
11825
11953
 
11826
- export { type AddMemoryToNarrativeRequest, AdminAlertsService, AdminPipelineService, AdminService, AlertsService, type ApiKey, ApiKeysService, type Artifact, ArtifactsService, type BatchGetMemoriesMeta, type BatchGetMemoriesRequest, type BatchGetMemoriesResponse, BehaviorService, type BillingOverview, BillingService, 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, ContentType, type Conversation, ConversationsService, 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, EntitiesService, type Entity, type EntityNode, Environment, type Error$1 as Error, type ErrorDefinition, type ExportRequest, type FacetEntry, type Facets, type Fact, type FactSearchRequest, FactsService, type GetMemoryResponse, type GetNarrativeResponse, type GraphRAGQueryRequest, type GraphRAGQueryResponse, GraphragService, type HealthCheck, HealthService, type Hook, type HttpError, type HttpMetadata, type HttpMethod, type HttpRequest, type HttpResponse, InvitesService, type Invoice, type ListInvoicesResponse, type ListNarrativesResponse, type ListPaymentMethodsResponse, type MatchRecommendationsRequest, Memnexus, MemoriesService, type Memory, type MemoryRelationship, type MemoryRelationshipsResponse, MonitoringService, type NamedMemoryHistoryResponse, type NarrativeMemory, type NarrativeThread, type NarrativeTimelineResponse, NarrativesService, type Pagination, type Pattern, PatternsService, type PaymentMethod, type PortalSessionResponse, type PrecomputedMemoryFields, type Recommendation, RecommendationsService, type RelatedMemoryResult, type RequestParameter, type ResponseDefinition, type RetryOptions, type SdkConfig, SdkError, type SearchMeta, type SearchRequest, type SearchResponse, type SearchResult, SerializationStyle, type ServiceCheck, type Subscription, type SystemAlert, SystemService, type TemporalMetadata, type Topic, TopicsService, type UpdateArtifactRequest, type UpdateFactRequest, type UpdateMemoryRequest, type UpdateNamedMemoryRequest, type UpdateNarrativeRequest, type UpdateSystemAlertRequest, type User, type UserUsage, UsersService, type ValidationOptions, addMemoryToNarrativeRequest, apiKey, artifact, batchGetMemoriesMeta, batchGetMemoriesRequest, batchGetMemoriesResponse, billingOverview, buildContextActiveWork, buildContextActivity, buildContextFact, buildContextGotcha, buildContextMeta, buildContextPattern, buildContextRequest, buildContextResponse, bulkDeleteRequest, bulkDeleteResponse, bulkTagRequest, bulkTagResponse, bulkUpdateRequest, bulkUpdateResponse, checkoutSessionResponse, claimGroup, claimGroupClaim, claimGroupSignals, codeContext, community, compileInstructionsRequest, compileInstructionsResponse, conversation, createArtifactRequest, createCheckoutSessionRequest, createConversationRequest, createFactRequest, createMemoryRelationshipRequest, createMemoryRequest, createMemoryResponse, createMemoryResponseMeta, createNarrativeRequest, createPortalSessionRequest, createRecommendationRequest, createSystemAlertRequest, Memnexus as default, digestEntity, digestKeyFact, digestMetadata, digestRequest, digestResponse, digestSource, digestTimeRange, effectiveStateBreakdown, entity, entityNode, error, exportRequest, facetEntry, facets, fact, factSearchRequest, getMemoryResponse, getNarrativeResponse, graphRAGQueryRequest, graphRAGQueryResponse, healthCheck, invoice, listInvoicesResponse, listNarrativesResponse, listPaymentMethodsResponse, matchRecommendationsRequest, memory, memoryRelationship, memoryRelationshipsResponse, namedMemoryHistoryResponse, narrativeMemory, narrativeThread, narrativeTimelineResponse, pagination, pattern, paymentMethod, portalSessionResponse, precomputedMemoryFields, recommendation, relatedMemoryResult, searchMeta, searchRequest, searchResponse, searchResult, serviceCheck, subscription, systemAlert, temporalMetadata, topic, updateArtifactRequest, updateFactRequest, updateMemoryRequest, updateNamedMemoryRequest, updateNarrativeRequest, updateSystemAlertRequest, user, userUsage };
11954
+ export { type AddMemoryToNarrativeRequest, AdminAlertsService, AdminPipelineService, AdminService, AlertsService, type ApiKey, ApiKeysService, type AppendNamedMemoryRequest, type Artifact, ArtifactsService, type BatchGetMemoriesMeta, type BatchGetMemoriesRequest, type BatchGetMemoriesResponse, BehaviorService, type BillingOverview, BillingService, 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, ContentType, type Conversation, ConversationsService, 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, EntitiesService, type Entity, type EntityNode, Environment, type Error$1 as Error, type ErrorDefinition, type ExportRequest, type FacetEntry, type Facets, type Fact, type FactSearchRequest, FactsService, type GetMemoryResponse, type GetNarrativeResponse, type GraphRAGQueryRequest, type GraphRAGQueryResponse, GraphragService, type HealthCheck, HealthService, type Hook, type HttpError, type HttpMetadata, type HttpMethod, type HttpRequest, type HttpResponse, InvitesService, type Invoice, type ListInvoicesResponse, type ListNarrativesResponse, type ListPaymentMethodsResponse, type MatchRecommendationsRequest, Memnexus, MemoriesService, type Memory, type MemoryRelationship, type MemoryRelationshipsResponse, MonitoringService, type NamedMemoryHistoryResponse, type NarrativeMemory, type NarrativeThread, type NarrativeTimelineResponse, NarrativesService, type Pagination, type Pattern, PatternsService, type PaymentMethod, type PortalSessionResponse, type PrecomputedMemoryFields, type Recommendation, RecommendationsService, type RelatedMemoryResult, type RequestParameter, type ResponseDefinition, type RetryOptions, type SdkConfig, SdkError, type SearchMeta, type SearchRequest, type SearchResponse, type SearchResult, SerializationStyle, type ServiceCheck, type Subscription, type SystemAlert, SystemService, type TemporalMetadata, type Topic, TopicsService, type UpdateArtifactRequest, type UpdateFactRequest, type UpdateMemoryRequest, type UpdateNamedMemoryRequest, type UpdateNarrativeRequest, type UpdateSystemAlertRequest, type User, type UserUsage, UsersService, type ValidationOptions, addMemoryToNarrativeRequest, apiKey, appendNamedMemoryRequest, artifact, batchGetMemoriesMeta, batchGetMemoriesRequest, batchGetMemoriesResponse, billingOverview, buildContextActiveWork, buildContextActivity, buildContextFact, buildContextGotcha, buildContextMeta, buildContextPattern, buildContextRequest, buildContextResponse, bulkDeleteRequest, bulkDeleteResponse, bulkTagRequest, bulkTagResponse, bulkUpdateRequest, bulkUpdateResponse, checkoutSessionResponse, claimGroup, claimGroupClaim, claimGroupSignals, codeContext, community, compileInstructionsRequest, compileInstructionsResponse, conversation, createArtifactRequest, createCheckoutSessionRequest, createConversationRequest, createFactRequest, createMemoryRelationshipRequest, createMemoryRequest, createMemoryResponse, createMemoryResponseMeta, createNarrativeRequest, createPortalSessionRequest, createRecommendationRequest, createSystemAlertRequest, Memnexus as default, digestEntity, digestKeyFact, digestMetadata, digestRequest, digestResponse, digestSource, digestTimeRange, effectiveStateBreakdown, entity, entityNode, error, exportRequest, facetEntry, facets, fact, factSearchRequest, getMemoryResponse, getNarrativeResponse, graphRAGQueryRequest, graphRAGQueryResponse, healthCheck, invoice, listInvoicesResponse, listNarrativesResponse, listPaymentMethodsResponse, matchRecommendationsRequest, memory, memoryRelationship, memoryRelationshipsResponse, namedMemoryHistoryResponse, narrativeMemory, narrativeThread, narrativeTimelineResponse, pagination, pattern, paymentMethod, portalSessionResponse, precomputedMemoryFields, recommendation, relatedMemoryResult, searchMeta, searchRequest, searchResponse, searchResult, serviceCheck, subscription, systemAlert, temporalMetadata, topic, updateArtifactRequest, updateFactRequest, updateMemoryRequest, updateNamedMemoryRequest, updateNarrativeRequest, updateSystemAlertRequest, user, userUsage };
package/dist/index.d.ts CHANGED
@@ -2145,6 +2145,8 @@ declare const getMemoryResponse: z.ZodLazy<z.ZodObject<{
2145
2145
  declare const updateNamedMemoryRequest: z.ZodObject<{
2146
2146
  /** New content for the named memory version */
2147
2147
  content: z.ZodString;
2148
+ /** Optimistic concurrency (compare-and-swap): if provided, the update only succeeds when the current head version's id matches this value. On mismatch the server returns 409 Conflict with the current head id, so the caller can re-read, re-merge, and retry. When omitted, the update is an unconditional replace (backward compatible). */
2149
+ expectedHeadId: z.ZodOptional<z.ZodString>;
2148
2150
  /** Type of memory (defaults to previous version's type) */
2149
2151
  memoryType: z.ZodOptional<z.ZodEnum<["episodic", "semantic", "procedural"]>>;
2150
2152
  /** Context or domain */
@@ -2202,6 +2204,7 @@ declare const updateNamedMemoryRequest: z.ZodObject<{
2202
2204
  extra?: z.objectOutputType<{}, z.ZodString, "strip"> | undefined;
2203
2205
  } | undefined;
2204
2206
  conversationId?: string | undefined;
2207
+ expectedHeadId?: string | undefined;
2205
2208
  supersedes?: string | undefined;
2206
2209
  }, {
2207
2210
  content: string;
@@ -2218,8 +2221,87 @@ declare const updateNamedMemoryRequest: z.ZodObject<{
2218
2221
  extra?: z.objectInputType<{}, z.ZodString, "strip"> | undefined;
2219
2222
  } | undefined;
2220
2223
  conversationId?: string | undefined;
2224
+ expectedHeadId?: string | undefined;
2221
2225
  supersedes?: string | undefined;
2222
2226
  }>;
2227
+ declare const appendNamedMemoryRequest: z.ZodObject<{
2228
+ /** Text block to append to the named memory's current content. The total (existing + separator + block) must not exceed the maximum content length or the request is rejected with 413. */
2229
+ block: z.ZodString;
2230
+ /** Separator inserted between the existing content and the appended block. Defaults to a blank line ("\n\n"). */
2231
+ separator: z.ZodOptional<z.ZodString>;
2232
+ /** Type of memory (defaults to previous version's type) */
2233
+ memoryType: z.ZodOptional<z.ZodEnum<["episodic", "semantic", "procedural"]>>;
2234
+ /** Context or domain */
2235
+ context: z.ZodOptional<z.ZodString>;
2236
+ /** Associated topics */
2237
+ topics: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2238
+ /** Conversation to group this version with (overrides previous version's conversation) */
2239
+ conversationId: z.ZodOptional<z.ZodString>;
2240
+ codeContext: z.ZodOptional<z.ZodObject<{
2241
+ /** Product name (e.g. 'memnexus', 'spearmint') */
2242
+ product: z.ZodOptional<z.ZodString>;
2243
+ /** Repository name, if different from product */
2244
+ repo: z.ZodOptional<z.ZodString>;
2245
+ /** Service or package name (e.g. 'core-api', 'mcp-server', 'cli') */
2246
+ service: z.ZodOptional<z.ZodString>;
2247
+ /** Subsystem or component (e.g. 'extraction-pipeline', 'search', 'billing') */
2248
+ component: z.ZodOptional<z.ZodString>;
2249
+ /** Team that produced this knowledge (e.g. 'extraction', 'mcp', 'platform') */
2250
+ team: z.ZodOptional<z.ZodString>;
2251
+ /** Agent role or persona (e.g. 'team-lead', 'implementer', 'reviewer') */
2252
+ role: z.ZodOptional<z.ZodString>;
2253
+ /** Additional project-specific scope tags */
2254
+ extra: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodString, z.objectOutputType<{}, z.ZodString, "strip">, z.objectInputType<{}, z.ZodString, "strip">>>;
2255
+ }, "strip", z.ZodTypeAny, {
2256
+ product?: string | undefined;
2257
+ repo?: string | undefined;
2258
+ service?: string | undefined;
2259
+ component?: string | undefined;
2260
+ team?: string | undefined;
2261
+ role?: string | undefined;
2262
+ extra?: z.objectOutputType<{}, z.ZodString, "strip"> | undefined;
2263
+ }, {
2264
+ product?: string | undefined;
2265
+ repo?: string | undefined;
2266
+ service?: string | undefined;
2267
+ component?: string | undefined;
2268
+ team?: string | undefined;
2269
+ role?: string | undefined;
2270
+ extra?: z.objectInputType<{}, z.ZodString, "strip"> | undefined;
2271
+ }>>;
2272
+ }, "strip", z.ZodTypeAny, {
2273
+ block: string;
2274
+ memoryType?: "episodic" | "semantic" | "procedural" | undefined;
2275
+ context?: string | undefined;
2276
+ topics?: string[] | undefined;
2277
+ codeContext?: {
2278
+ product?: string | undefined;
2279
+ repo?: string | undefined;
2280
+ service?: string | undefined;
2281
+ component?: string | undefined;
2282
+ team?: string | undefined;
2283
+ role?: string | undefined;
2284
+ extra?: z.objectOutputType<{}, z.ZodString, "strip"> | undefined;
2285
+ } | undefined;
2286
+ conversationId?: string | undefined;
2287
+ separator?: string | undefined;
2288
+ }, {
2289
+ block: string;
2290
+ memoryType?: "episodic" | "semantic" | "procedural" | undefined;
2291
+ context?: string | undefined;
2292
+ topics?: string[] | undefined;
2293
+ codeContext?: {
2294
+ product?: string | undefined;
2295
+ repo?: string | undefined;
2296
+ service?: string | undefined;
2297
+ component?: string | undefined;
2298
+ team?: string | undefined;
2299
+ role?: string | undefined;
2300
+ extra?: z.objectInputType<{}, z.ZodString, "strip"> | undefined;
2301
+ } | undefined;
2302
+ conversationId?: string | undefined;
2303
+ separator?: string | undefined;
2304
+ }>;
2223
2305
  declare const namedMemoryHistoryResponse: z.ZodObject<{
2224
2306
  /** Human-readable name for deterministic retrieval (kebab-case, 2-64 chars) */
2225
2307
  name: z.ZodString;
@@ -9040,6 +9122,7 @@ type RelatedMemoryResult = z.infer<typeof relatedMemoryResult>;
9040
9122
  */
9041
9123
  type GetMemoryResponse = z.infer<typeof getMemoryResponse>;
9042
9124
  type UpdateNamedMemoryRequest = z.infer<typeof updateNamedMemoryRequest>;
9125
+ type AppendNamedMemoryRequest = z.infer<typeof appendNamedMemoryRequest>;
9043
9126
  type NamedMemoryHistoryResponse = z.infer<typeof namedMemoryHistoryResponse>;
9044
9127
  type BatchGetMemoriesRequest = z.infer<typeof batchGetMemoriesRequest>;
9045
9128
  type BatchGetMemoriesMeta = z.infer<typeof batchGetMemoriesMeta>;
@@ -10448,6 +10531,7 @@ declare class MemoriesService extends BaseService {
10448
10531
  */
10449
10532
  updateNamedMemory(name: string, body: {
10450
10533
  content: string;
10534
+ expectedHeadId?: string;
10451
10535
  memoryType?: 'episodic' | 'semantic' | 'procedural';
10452
10536
  context?: string;
10453
10537
  topics?: string[];
@@ -10469,6 +10553,43 @@ declare class MemoriesService extends BaseService {
10469
10553
  version?: number;
10470
10554
  };
10471
10555
  }>>;
10556
+ /**
10557
+ * Atomically append a block to a named memory
10558
+ * Atomically appends a text block to a named memory, eliminating the
10559
+ read-modify-write clobber that concurrent full-content updates cause on
10560
+ shared named memories. The server reads the current head, concatenates
10561
+ `existing + separator + block`, and writes a new version under the
10562
+ NameLock with an internal compare-and-swap + bounded retry — so
10563
+ simultaneous appends all survive and the client needs no retry logic.
10564
+ Content is decrypted, assembled, size-checked, and re-encrypted
10565
+ server-side; plaintext is never returned to other callers.
10566
+
10567
+ * @param name - Memory name (kebab-case, 2-64 chars)
10568
+ * @param body - Request body
10569
+ */
10570
+ appendNamedMemory(name: string, body: {
10571
+ block: string;
10572
+ separator?: string;
10573
+ memoryType?: 'episodic' | 'semantic' | 'procedural';
10574
+ context?: string;
10575
+ topics?: string[];
10576
+ conversationId?: string;
10577
+ codeContext?: {
10578
+ product?: string;
10579
+ repo?: string;
10580
+ service?: string;
10581
+ component?: string;
10582
+ team?: string;
10583
+ role?: string;
10584
+ extra?: Record<string, unknown>;
10585
+ };
10586
+ }): Promise<HttpResponse<{
10587
+ data?: Memory;
10588
+ meta?: {
10589
+ previousVersionId?: string;
10590
+ version?: number;
10591
+ };
10592
+ }>>;
10472
10593
  /**
10473
10594
  * Bulk delete multiple memories
10474
10595
  * Soft-delete multiple memories at once. Requires confirmDeletion=true.
@@ -10862,11 +10983,18 @@ declare class HealthService extends BaseService {
10862
10983
  uptime?: number;
10863
10984
  }>>;
10864
10985
  /**
10865
- * API health check endpoint
10866
- * Returns the health status and uptime of the API service.
10867
- This endpoint is public and requires no authentication.
10868
- Use this endpoint for monitoring, health checks, and service availability verification.
10869
- Returns 200 when healthy, 503 when the database is unreachable.
10986
+ * API readiness check endpoint
10987
+ * Returns the readiness status of the API service, based on database
10988
+ connectivity. This endpoint is public and requires no authentication.
10989
+ Returns 200 when the database is reachable, 503 when it is not.
10990
+
10991
+ v2.35: the database status is served from a CACHE refreshed by a
10992
+ background loop every HEALTH_DB_CHECK_INTERVAL_MS — this endpoint does
10993
+ NOT query the database per request, so probe latency is decoupled from
10994
+ query latency (the 07-03 dual-pod ejection fix). If the cache is older
10995
+ than HEALTH_DB_STALENESS_CEILING_MS (the background checker is wedged,
10996
+ e.g. a hung query), readiness reports NOT-READY (503) — a genuinely
10997
+ dead/hung database is never masked by a stale "ok".
10870
10998
 
10871
10999
  */
10872
11000
  healthCheck(): Promise<HttpResponse<{
@@ -11823,4 +11951,4 @@ declare class Memnexus {
11823
11951
  setEnvironment(environment: Environment): void;
11824
11952
  }
11825
11953
 
11826
- export { type AddMemoryToNarrativeRequest, AdminAlertsService, AdminPipelineService, AdminService, AlertsService, type ApiKey, ApiKeysService, type Artifact, ArtifactsService, type BatchGetMemoriesMeta, type BatchGetMemoriesRequest, type BatchGetMemoriesResponse, BehaviorService, type BillingOverview, BillingService, 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, ContentType, type Conversation, ConversationsService, 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, EntitiesService, type Entity, type EntityNode, Environment, type Error$1 as Error, type ErrorDefinition, type ExportRequest, type FacetEntry, type Facets, type Fact, type FactSearchRequest, FactsService, type GetMemoryResponse, type GetNarrativeResponse, type GraphRAGQueryRequest, type GraphRAGQueryResponse, GraphragService, type HealthCheck, HealthService, type Hook, type HttpError, type HttpMetadata, type HttpMethod, type HttpRequest, type HttpResponse, InvitesService, type Invoice, type ListInvoicesResponse, type ListNarrativesResponse, type ListPaymentMethodsResponse, type MatchRecommendationsRequest, Memnexus, MemoriesService, type Memory, type MemoryRelationship, type MemoryRelationshipsResponse, MonitoringService, type NamedMemoryHistoryResponse, type NarrativeMemory, type NarrativeThread, type NarrativeTimelineResponse, NarrativesService, type Pagination, type Pattern, PatternsService, type PaymentMethod, type PortalSessionResponse, type PrecomputedMemoryFields, type Recommendation, RecommendationsService, type RelatedMemoryResult, type RequestParameter, type ResponseDefinition, type RetryOptions, type SdkConfig, SdkError, type SearchMeta, type SearchRequest, type SearchResponse, type SearchResult, SerializationStyle, type ServiceCheck, type Subscription, type SystemAlert, SystemService, type TemporalMetadata, type Topic, TopicsService, type UpdateArtifactRequest, type UpdateFactRequest, type UpdateMemoryRequest, type UpdateNamedMemoryRequest, type UpdateNarrativeRequest, type UpdateSystemAlertRequest, type User, type UserUsage, UsersService, type ValidationOptions, addMemoryToNarrativeRequest, apiKey, artifact, batchGetMemoriesMeta, batchGetMemoriesRequest, batchGetMemoriesResponse, billingOverview, buildContextActiveWork, buildContextActivity, buildContextFact, buildContextGotcha, buildContextMeta, buildContextPattern, buildContextRequest, buildContextResponse, bulkDeleteRequest, bulkDeleteResponse, bulkTagRequest, bulkTagResponse, bulkUpdateRequest, bulkUpdateResponse, checkoutSessionResponse, claimGroup, claimGroupClaim, claimGroupSignals, codeContext, community, compileInstructionsRequest, compileInstructionsResponse, conversation, createArtifactRequest, createCheckoutSessionRequest, createConversationRequest, createFactRequest, createMemoryRelationshipRequest, createMemoryRequest, createMemoryResponse, createMemoryResponseMeta, createNarrativeRequest, createPortalSessionRequest, createRecommendationRequest, createSystemAlertRequest, Memnexus as default, digestEntity, digestKeyFact, digestMetadata, digestRequest, digestResponse, digestSource, digestTimeRange, effectiveStateBreakdown, entity, entityNode, error, exportRequest, facetEntry, facets, fact, factSearchRequest, getMemoryResponse, getNarrativeResponse, graphRAGQueryRequest, graphRAGQueryResponse, healthCheck, invoice, listInvoicesResponse, listNarrativesResponse, listPaymentMethodsResponse, matchRecommendationsRequest, memory, memoryRelationship, memoryRelationshipsResponse, namedMemoryHistoryResponse, narrativeMemory, narrativeThread, narrativeTimelineResponse, pagination, pattern, paymentMethod, portalSessionResponse, precomputedMemoryFields, recommendation, relatedMemoryResult, searchMeta, searchRequest, searchResponse, searchResult, serviceCheck, subscription, systemAlert, temporalMetadata, topic, updateArtifactRequest, updateFactRequest, updateMemoryRequest, updateNamedMemoryRequest, updateNarrativeRequest, updateSystemAlertRequest, user, userUsage };
11954
+ export { type AddMemoryToNarrativeRequest, AdminAlertsService, AdminPipelineService, AdminService, AlertsService, type ApiKey, ApiKeysService, type AppendNamedMemoryRequest, type Artifact, ArtifactsService, type BatchGetMemoriesMeta, type BatchGetMemoriesRequest, type BatchGetMemoriesResponse, BehaviorService, type BillingOverview, BillingService, 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, ContentType, type Conversation, ConversationsService, 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, EntitiesService, type Entity, type EntityNode, Environment, type Error$1 as Error, type ErrorDefinition, type ExportRequest, type FacetEntry, type Facets, type Fact, type FactSearchRequest, FactsService, type GetMemoryResponse, type GetNarrativeResponse, type GraphRAGQueryRequest, type GraphRAGQueryResponse, GraphragService, type HealthCheck, HealthService, type Hook, type HttpError, type HttpMetadata, type HttpMethod, type HttpRequest, type HttpResponse, InvitesService, type Invoice, type ListInvoicesResponse, type ListNarrativesResponse, type ListPaymentMethodsResponse, type MatchRecommendationsRequest, Memnexus, MemoriesService, type Memory, type MemoryRelationship, type MemoryRelationshipsResponse, MonitoringService, type NamedMemoryHistoryResponse, type NarrativeMemory, type NarrativeThread, type NarrativeTimelineResponse, NarrativesService, type Pagination, type Pattern, PatternsService, type PaymentMethod, type PortalSessionResponse, type PrecomputedMemoryFields, type Recommendation, RecommendationsService, type RelatedMemoryResult, type RequestParameter, type ResponseDefinition, type RetryOptions, type SdkConfig, SdkError, type SearchMeta, type SearchRequest, type SearchResponse, type SearchResult, SerializationStyle, type ServiceCheck, type Subscription, type SystemAlert, SystemService, type TemporalMetadata, type Topic, TopicsService, type UpdateArtifactRequest, type UpdateFactRequest, type UpdateMemoryRequest, type UpdateNamedMemoryRequest, type UpdateNarrativeRequest, type UpdateSystemAlertRequest, type User, type UserUsage, UsersService, type ValidationOptions, addMemoryToNarrativeRequest, apiKey, appendNamedMemoryRequest, artifact, batchGetMemoriesMeta, batchGetMemoriesRequest, batchGetMemoriesResponse, billingOverview, buildContextActiveWork, buildContextActivity, buildContextFact, buildContextGotcha, buildContextMeta, buildContextPattern, buildContextRequest, buildContextResponse, bulkDeleteRequest, bulkDeleteResponse, bulkTagRequest, bulkTagResponse, bulkUpdateRequest, bulkUpdateResponse, checkoutSessionResponse, claimGroup, claimGroupClaim, claimGroupSignals, codeContext, community, compileInstructionsRequest, compileInstructionsResponse, conversation, createArtifactRequest, createCheckoutSessionRequest, createConversationRequest, createFactRequest, createMemoryRelationshipRequest, createMemoryRequest, createMemoryResponse, createMemoryResponseMeta, createNarrativeRequest, createPortalSessionRequest, createRecommendationRequest, createSystemAlertRequest, Memnexus as default, digestEntity, digestKeyFact, digestMetadata, digestRequest, digestResponse, digestSource, digestTimeRange, effectiveStateBreakdown, entity, entityNode, error, exportRequest, facetEntry, facets, fact, factSearchRequest, getMemoryResponse, getNarrativeResponse, graphRAGQueryRequest, graphRAGQueryResponse, healthCheck, invoice, listInvoicesResponse, listNarrativesResponse, listPaymentMethodsResponse, matchRecommendationsRequest, memory, memoryRelationship, memoryRelationshipsResponse, namedMemoryHistoryResponse, narrativeMemory, narrativeThread, narrativeTimelineResponse, pagination, pattern, paymentMethod, portalSessionResponse, precomputedMemoryFields, recommendation, relatedMemoryResult, searchMeta, searchRequest, searchResponse, searchResult, serviceCheck, subscription, systemAlert, temporalMetadata, topic, updateArtifactRequest, updateFactRequest, updateMemoryRequest, updateNamedMemoryRequest, updateNarrativeRequest, updateSystemAlertRequest, user, userUsage };
package/dist/index.js CHANGED
@@ -3340,6 +3340,49 @@ var MemoriesService = class extends BaseService {
3340
3340
  }
3341
3341
  return this.client.call(request);
3342
3342
  }
3343
+ /**
3344
+ * Atomically append a block to a named memory
3345
+ * Atomically appends a text block to a named memory, eliminating the
3346
+ read-modify-write clobber that concurrent full-content updates cause on
3347
+ shared named memories. The server reads the current head, concatenates
3348
+ `existing + separator + block`, and writes a new version under the
3349
+ NameLock with an internal compare-and-swap + bounded retry — so
3350
+ simultaneous appends all survive and the client needs no retry logic.
3351
+ Content is decrypted, assembled, size-checked, and re-encrypted
3352
+ server-side; plaintext is never returned to other callers.
3353
+
3354
+ * @param name - Memory name (kebab-case, 2-64 chars)
3355
+ * @param body - Request body
3356
+ */
3357
+ async appendNamedMemory(name, body) {
3358
+ const request = new Request({
3359
+ baseUrl: this.config.baseUrl || "http://localhost:3000",
3360
+ method: "POST",
3361
+ path: "/api/memories/named/{name}/append",
3362
+ config: this.config,
3363
+ retry: {
3364
+ attempts: 3,
3365
+ delayMs: 150,
3366
+ maxDelayMs: 5e3,
3367
+ jitterMs: 50,
3368
+ backoffFactor: 2
3369
+ }
3370
+ });
3371
+ request.addPathParam("name", {
3372
+ key: "name",
3373
+ value: name,
3374
+ explode: false,
3375
+ encode: true,
3376
+ style: "simple",
3377
+ isLimit: false,
3378
+ isOffset: false,
3379
+ isCursor: false
3380
+ });
3381
+ if (body !== void 0) {
3382
+ request.addBody(body);
3383
+ }
3384
+ return this.client.call(request);
3385
+ }
3343
3386
  /**
3344
3387
  * Bulk delete multiple memories
3345
3388
  * Soft-delete multiple memories at once. Requires confirmDeletion=true.
@@ -4006,11 +4049,18 @@ var HealthService = class extends BaseService {
4006
4049
  return this.client.call(request);
4007
4050
  }
4008
4051
  /**
4009
- * API health check endpoint
4010
- * Returns the health status and uptime of the API service.
4011
- This endpoint is public and requires no authentication.
4012
- Use this endpoint for monitoring, health checks, and service availability verification.
4013
- Returns 200 when healthy, 503 when the database is unreachable.
4052
+ * API readiness check endpoint
4053
+ * Returns the readiness status of the API service, based on database
4054
+ connectivity. This endpoint is public and requires no authentication.
4055
+ Returns 200 when the database is reachable, 503 when it is not.
4056
+
4057
+ v2.35: the database status is served from a CACHE refreshed by a
4058
+ background loop every HEALTH_DB_CHECK_INTERVAL_MS — this endpoint does
4059
+ NOT query the database per request, so probe latency is decoupled from
4060
+ query latency (the 07-03 dual-pod ejection fix). If the cache is older
4061
+ than HEALTH_DB_STALENESS_CEILING_MS (the background checker is wedged,
4062
+ e.g. a hung query), readiness reports NOT-READY (503) — a genuinely
4063
+ dead/hung database is never masked by a stale "ok".
4014
4064
 
4015
4065
  */
4016
4066
  async healthCheck() {
@@ -6264,6 +6314,8 @@ var getMemoryResponse = z.lazy(() => z.object({
6264
6314
  var updateNamedMemoryRequest = z.object({
6265
6315
  /** New content for the named memory version */
6266
6316
  content: z.string().min(1).max(5e4),
6317
+ /** Optimistic concurrency (compare-and-swap): if provided, the update only succeeds when the current head version's id matches this value. On mismatch the server returns 409 Conflict with the current head id, so the caller can re-read, re-merge, and retry. When omitted, the update is an unconditional replace (backward compatible). */
6318
+ expectedHeadId: z.string().uuid().optional(),
6267
6319
  /** Type of memory (defaults to previous version's type) */
6268
6320
  memoryType: z.enum(["episodic", "semantic", "procedural"]).optional(),
6269
6321
  /** Context or domain */
@@ -6291,6 +6343,36 @@ var updateNamedMemoryRequest = z.object({
6291
6343
  /** Additional memory ID that this version supersedes (beyond the implicit version chain) */
6292
6344
  supersedes: z.string().uuid().optional()
6293
6345
  });
6346
+ var appendNamedMemoryRequest = z.object({
6347
+ /** Text block to append to the named memory's current content. The total (existing + separator + block) must not exceed the maximum content length or the request is rejected with 413. */
6348
+ block: z.string().min(1).max(5e4),
6349
+ /** Separator inserted between the existing content and the appended block. Defaults to a blank line ("\n\n"). */
6350
+ separator: z.string().max(100).optional(),
6351
+ /** Type of memory (defaults to previous version's type) */
6352
+ memoryType: z.enum(["episodic", "semantic", "procedural"]).optional(),
6353
+ /** Context or domain */
6354
+ context: z.string().max(200).optional(),
6355
+ /** Associated topics */
6356
+ topics: z.array(z.string().max(100)).max(50).optional(),
6357
+ /** Conversation to group this version with (overrides previous version's conversation) */
6358
+ conversationId: z.string().max(200).optional(),
6359
+ codeContext: z.object({
6360
+ /** Product name (e.g. 'memnexus', 'spearmint') */
6361
+ product: z.string().max(200).optional(),
6362
+ /** Repository name, if different from product */
6363
+ repo: z.string().max(200).optional(),
6364
+ /** Service or package name (e.g. 'core-api', 'mcp-server', 'cli') */
6365
+ service: z.string().max(200).optional(),
6366
+ /** Subsystem or component (e.g. 'extraction-pipeline', 'search', 'billing') */
6367
+ component: z.string().max(200).optional(),
6368
+ /** Team that produced this knowledge (e.g. 'extraction', 'mcp', 'platform') */
6369
+ team: z.string().max(200).optional(),
6370
+ /** Agent role or persona (e.g. 'team-lead', 'implementer', 'reviewer') */
6371
+ role: z.string().max(200).optional(),
6372
+ /** Additional project-specific scope tags */
6373
+ extra: z.object({}).catchall(z.string().max(500)).optional()
6374
+ }).optional()
6375
+ });
6294
6376
  var namedMemoryHistoryResponse = z.object({
6295
6377
  /** Human-readable name for deterministic retrieval (kebab-case, 2-64 chars) */
6296
6378
  name: z.string().regex(/^[a-z0-9][a-z0-9-]{0,62}[a-z0-9]$/),
@@ -7775,6 +7857,7 @@ export {
7775
7857
  UsersService,
7776
7858
  addMemoryToNarrativeRequest,
7777
7859
  apiKey,
7860
+ appendNamedMemoryRequest,
7778
7861
  artifact,
7779
7862
  batchGetMemoriesMeta,
7780
7863
  batchGetMemoriesRequest,