@memnexus-ai/typescript-sdk 1.75.5 → 1.76.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.d.cts CHANGED
@@ -8946,14 +8946,22 @@ declare const buildContextRequest: z.ZodObject<{
8946
8946
  files: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
8947
8947
  /** How far back to look for recent activity (hours, default 24) */
8948
8948
  recentHours: z.ZodOptional<z.ZodNumber>;
8949
+ /** Comma-separated codeContext key:value pairs to filter by. Allowed keys: product, service, team, role. All pairs must match (AND), so each extra key can only shrink the result set — a key your memories do not consistently carry will silently empty the brief. Send the fewest keys that identify the project; product:<project> alone is the recommended default. An unknown key, or a string that yields no valid key:value pair at all, returns 400 rather than an unscoped brief. */
8950
+ scope: z.ZodOptional<z.ZodString>;
8951
+ /** When scope is set, whether to also return memories that carry no codeContext at all. Defaults to false when scope is set — a scoped request returns scoped content only. Send true to also include memories that carry no codeContext. Inert when scope is absent. */
8952
+ includeUnscoped: z.ZodOptional<z.ZodBoolean>;
8949
8953
  }, "strip", z.ZodTypeAny, {
8950
8954
  context: string;
8951
8955
  files?: string[] | undefined;
8952
8956
  recentHours?: number | undefined;
8957
+ scope?: string | undefined;
8958
+ includeUnscoped?: boolean | undefined;
8953
8959
  }, {
8954
8960
  context: string;
8955
8961
  files?: string[] | undefined;
8956
8962
  recentHours?: number | undefined;
8963
+ scope?: string | undefined;
8964
+ includeUnscoped?: boolean | undefined;
8957
8965
  }>;
8958
8966
  /**
8959
8967
  * Most relevant active conversation, or null if none found
@@ -9079,15 +9087,27 @@ declare const buildContextMeta: z.ZodObject<{
9079
9087
  contextTerms: z.ZodArray<z.ZodString, "many">;
9080
9088
  /** Hours window used for recent activity */
9081
9089
  recentHours: z.ZodNumber;
9090
+ /** The parsed codeContext scope the request was filtered by. Present only when the request sent a scope. */
9091
+ scope: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodString, z.objectOutputType<{}, z.ZodString, "strip">, z.objectInputType<{}, z.ZodString, "strip">>>;
9092
+ /** The RESOLVED includeUnscoped value the request ran with — false when the caller sent scope and omitted the field. Present only when the request sent a scope; without scope the flag is inert and is not echoed. */
9093
+ includeUnscoped: z.ZodOptional<z.ZodBoolean>;
9094
+ /** Sections the scope filter did not constrain, so a caller never has to assume a section was filtered when it was not. relatedPatterns cannot be scoped (Pattern nodes carry no codeContext and no path back to a source memory); commitContext is an account-wide adoption count by design. Present only when the request sent a scope. */
9095
+ unfilteredSections: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
9082
9096
  /** Sections whose backing query exceeded the per-branch timeout and were returned empty. Present only when at least one branch timed out, so an empty section can otherwise be read as 'no data'. */
9083
9097
  timedOutSections: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
9084
9098
  }, "strip", z.ZodTypeAny, {
9085
9099
  recentHours: number;
9086
9100
  contextTerms: string[];
9101
+ scope?: z.objectOutputType<{}, z.ZodString, "strip"> | undefined;
9102
+ includeUnscoped?: boolean | undefined;
9103
+ unfilteredSections?: string[] | undefined;
9087
9104
  timedOutSections?: string[] | undefined;
9088
9105
  }, {
9089
9106
  recentHours: number;
9090
9107
  contextTerms: string[];
9108
+ scope?: z.objectInputType<{}, z.ZodString, "strip"> | undefined;
9109
+ includeUnscoped?: boolean | undefined;
9110
+ unfilteredSections?: string[] | undefined;
9091
9111
  timedOutSections?: string[] | undefined;
9092
9112
  }>;
9093
9113
  declare const buildContextResponse: z.ZodLazy<z.ZodObject<{
@@ -9215,21 +9235,36 @@ declare const buildContextResponse: z.ZodLazy<z.ZodObject<{
9215
9235
  contextTerms: z.ZodArray<z.ZodString, "many">;
9216
9236
  /** Hours window used for recent activity */
9217
9237
  recentHours: z.ZodNumber;
9238
+ /** The parsed codeContext scope the request was filtered by. Present only when the request sent a scope. */
9239
+ scope: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodString, z.objectOutputType<{}, z.ZodString, "strip">, z.objectInputType<{}, z.ZodString, "strip">>>;
9240
+ /** The RESOLVED includeUnscoped value the request ran with — false when the caller sent scope and omitted the field. Present only when the request sent a scope; without scope the flag is inert and is not echoed. */
9241
+ includeUnscoped: z.ZodOptional<z.ZodBoolean>;
9242
+ /** Sections the scope filter did not constrain, so a caller never has to assume a section was filtered when it was not. relatedPatterns cannot be scoped (Pattern nodes carry no codeContext and no path back to a source memory); commitContext is an account-wide adoption count by design. Present only when the request sent a scope. */
9243
+ unfilteredSections: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
9218
9244
  /** Sections whose backing query exceeded the per-branch timeout and were returned empty. Present only when at least one branch timed out, so an empty section can otherwise be read as 'no data'. */
9219
9245
  timedOutSections: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
9220
9246
  }, "strip", z.ZodTypeAny, {
9221
9247
  recentHours: number;
9222
9248
  contextTerms: string[];
9249
+ scope?: z.objectOutputType<{}, z.ZodString, "strip"> | undefined;
9250
+ includeUnscoped?: boolean | undefined;
9251
+ unfilteredSections?: string[] | undefined;
9223
9252
  timedOutSections?: string[] | undefined;
9224
9253
  }, {
9225
9254
  recentHours: number;
9226
9255
  contextTerms: string[];
9256
+ scope?: z.objectInputType<{}, z.ZodString, "strip"> | undefined;
9257
+ includeUnscoped?: boolean | undefined;
9258
+ unfilteredSections?: string[] | undefined;
9227
9259
  timedOutSections?: string[] | undefined;
9228
9260
  }>;
9229
9261
  }, "strip", z.ZodTypeAny, {
9230
9262
  meta: {
9231
9263
  recentHours: number;
9232
9264
  contextTerms: string[];
9265
+ scope?: z.objectOutputType<{}, z.ZodString, "strip"> | undefined;
9266
+ includeUnscoped?: boolean | undefined;
9267
+ unfilteredSections?: string[] | undefined;
9233
9268
  timedOutSections?: string[] | undefined;
9234
9269
  };
9235
9270
  activeWork: {
@@ -9268,6 +9303,9 @@ declare const buildContextResponse: z.ZodLazy<z.ZodObject<{
9268
9303
  meta: {
9269
9304
  recentHours: number;
9270
9305
  contextTerms: string[];
9306
+ scope?: z.objectInputType<{}, z.ZodString, "strip"> | undefined;
9307
+ includeUnscoped?: boolean | undefined;
9308
+ unfilteredSections?: string[] | undefined;
9271
9309
  timedOutSections?: string[] | undefined;
9272
9310
  };
9273
9311
  activeWork: {
@@ -10453,7 +10491,7 @@ declare class MemoriesService extends BaseService {
10453
10491
  * @param topics - Comma-separated topic names. Memories must have at least one matching topic.
10454
10492
  * @param excludeTopics - Comma-separated topic names. Memories with any matching topic are excluded.
10455
10493
  * @param conversationId - Filter to memories belonging to the given conversation.
10456
- * @param scope - Filter by codeContext scope. Comma-separated key:value pairs (e.g. scope=product:memnexus,team:retrieval). Memories must match ALL specified scope pairs. Allowed keys, product, service, team, role — unknown keys return 400.
10494
+ * @param scope - Filter by codeContext scope. Comma-separated key:value pairs (e.g. scope=product:memnexus,team:retrieval). Memories must match ALL specified scope pairs. Allowed keys, product, service, team, role — unknown keys, or input that yields no valid pairs, return 400.
10457
10495
  */
10458
10496
  listMemories(options?: {
10459
10497
  idPrefix?: string;
@@ -10585,7 +10623,7 @@ declare class MemoriesService extends BaseService {
10585
10623
  * @param claimsWeight - Weight for claims vector branch in hybrid search
10586
10624
  * @param includeFacets - Include facet aggregation (topics, memoryType, effectiveState) in response
10587
10625
  * @param embeddingProvider - Which embedding provider to use for query-time embedding generation and vector index lookup. `voyage` is the canonical name for the secondary provider (Voyage voyage-3.5, 1024d); `openai` is accepted as a legacy alias and now also resolves to Voyage after v1.66 P0-EMBED-SWAP. Falls back to ollama when the secondary provider is unavailable.
10588
- * @param scope - Filter by codeContext scope. Comma-separated key:value pairs (e.g. scope=product:memnexus,service:core-api). Memories must match ALL specified scope pairs. Allowed keys, product, service, team, role — unknown keys return 400.
10626
+ * @param scope - Filter by codeContext scope. Comma-separated key:value pairs (e.g. scope=product:memnexus,service:core-api). Memories must match ALL specified scope pairs. Allowed keys, product, service, team, role — unknown keys, or input that yields no valid pairs, return 400.
10589
10627
  * @param taskId - Task-scoped retrieval: returns own-history first, fills remainder with cross-task results.
10590
10628
  * @param outcomeFilter - Filter by task outcome. Use 'resolved' to find successful approaches from past tasks.
10591
10629
  */
@@ -10794,12 +10832,35 @@ declare class MemoriesService extends BaseService {
10794
10832
  matching into a single call. Eliminates the 5+ round-trip pattern agents
10795
10833
  use today.
10796
10834
 
10835
+ **Project scoping (optional).** Send `scope` as comma-separated
10836
+ `key:value` pairs (allowed keys: `product`, `service`, `team`, `role`) —
10837
+ the same format the list and search endpoints accept — to restrict the
10838
+ briefing to one project. All pairs must match (AND), so each extra key
10839
+ can only shrink the result set; send the fewest keys that identify the
10840
+ project (`product:<project>` is the recommended default). An unknown
10841
+ key, or a `scope` string that yields no valid `key:value` pair at all,
10842
+ returns 400 — a scope request that cannot be honoured is never
10843
+ silently downgraded to an unscoped briefing.
10844
+
10845
+ When `scope` is set, memories that carry no `codeContext` at all are
10846
+ excluded by default: a scoped request returns scoped content only. Send
10847
+ `includeUnscoped: true` to also include unlabeled memories. Without
10848
+ `scope` the flag is inert — accepted, no filter runs, and neither field
10849
+ is echoed in `meta`. Omitting `scope` reproduces today's behavior exactly.
10850
+
10851
+ Two sections cannot be scope-filtered and are named in
10852
+ `meta.unfilteredSections` on any scoped request rather than being served
10853
+ as if they had been filtered: `relatedPatterns` (Pattern nodes carry no
10854
+ `codeContext`) and `commitContext` (an account-wide adoption count).
10855
+
10797
10856
  * @param body - Request body
10798
10857
  */
10799
10858
  buildContext(body: {
10800
10859
  context: string;
10801
10860
  files?: string[];
10802
10861
  recentHours?: number;
10862
+ scope?: string;
10863
+ includeUnscoped?: boolean;
10803
10864
  }): Promise<HttpResponse<{
10804
10865
  activeWork: BuildContextActiveWork;
10805
10866
  relevantFacts: BuildContextFact[];
package/dist/index.d.ts CHANGED
@@ -8946,14 +8946,22 @@ declare const buildContextRequest: z.ZodObject<{
8946
8946
  files: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
8947
8947
  /** How far back to look for recent activity (hours, default 24) */
8948
8948
  recentHours: z.ZodOptional<z.ZodNumber>;
8949
+ /** Comma-separated codeContext key:value pairs to filter by. Allowed keys: product, service, team, role. All pairs must match (AND), so each extra key can only shrink the result set — a key your memories do not consistently carry will silently empty the brief. Send the fewest keys that identify the project; product:<project> alone is the recommended default. An unknown key, or a string that yields no valid key:value pair at all, returns 400 rather than an unscoped brief. */
8950
+ scope: z.ZodOptional<z.ZodString>;
8951
+ /** When scope is set, whether to also return memories that carry no codeContext at all. Defaults to false when scope is set — a scoped request returns scoped content only. Send true to also include memories that carry no codeContext. Inert when scope is absent. */
8952
+ includeUnscoped: z.ZodOptional<z.ZodBoolean>;
8949
8953
  }, "strip", z.ZodTypeAny, {
8950
8954
  context: string;
8951
8955
  files?: string[] | undefined;
8952
8956
  recentHours?: number | undefined;
8957
+ scope?: string | undefined;
8958
+ includeUnscoped?: boolean | undefined;
8953
8959
  }, {
8954
8960
  context: string;
8955
8961
  files?: string[] | undefined;
8956
8962
  recentHours?: number | undefined;
8963
+ scope?: string | undefined;
8964
+ includeUnscoped?: boolean | undefined;
8957
8965
  }>;
8958
8966
  /**
8959
8967
  * Most relevant active conversation, or null if none found
@@ -9079,15 +9087,27 @@ declare const buildContextMeta: z.ZodObject<{
9079
9087
  contextTerms: z.ZodArray<z.ZodString, "many">;
9080
9088
  /** Hours window used for recent activity */
9081
9089
  recentHours: z.ZodNumber;
9090
+ /** The parsed codeContext scope the request was filtered by. Present only when the request sent a scope. */
9091
+ scope: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodString, z.objectOutputType<{}, z.ZodString, "strip">, z.objectInputType<{}, z.ZodString, "strip">>>;
9092
+ /** The RESOLVED includeUnscoped value the request ran with — false when the caller sent scope and omitted the field. Present only when the request sent a scope; without scope the flag is inert and is not echoed. */
9093
+ includeUnscoped: z.ZodOptional<z.ZodBoolean>;
9094
+ /** Sections the scope filter did not constrain, so a caller never has to assume a section was filtered when it was not. relatedPatterns cannot be scoped (Pattern nodes carry no codeContext and no path back to a source memory); commitContext is an account-wide adoption count by design. Present only when the request sent a scope. */
9095
+ unfilteredSections: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
9082
9096
  /** Sections whose backing query exceeded the per-branch timeout and were returned empty. Present only when at least one branch timed out, so an empty section can otherwise be read as 'no data'. */
9083
9097
  timedOutSections: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
9084
9098
  }, "strip", z.ZodTypeAny, {
9085
9099
  recentHours: number;
9086
9100
  contextTerms: string[];
9101
+ scope?: z.objectOutputType<{}, z.ZodString, "strip"> | undefined;
9102
+ includeUnscoped?: boolean | undefined;
9103
+ unfilteredSections?: string[] | undefined;
9087
9104
  timedOutSections?: string[] | undefined;
9088
9105
  }, {
9089
9106
  recentHours: number;
9090
9107
  contextTerms: string[];
9108
+ scope?: z.objectInputType<{}, z.ZodString, "strip"> | undefined;
9109
+ includeUnscoped?: boolean | undefined;
9110
+ unfilteredSections?: string[] | undefined;
9091
9111
  timedOutSections?: string[] | undefined;
9092
9112
  }>;
9093
9113
  declare const buildContextResponse: z.ZodLazy<z.ZodObject<{
@@ -9215,21 +9235,36 @@ declare const buildContextResponse: z.ZodLazy<z.ZodObject<{
9215
9235
  contextTerms: z.ZodArray<z.ZodString, "many">;
9216
9236
  /** Hours window used for recent activity */
9217
9237
  recentHours: z.ZodNumber;
9238
+ /** The parsed codeContext scope the request was filtered by. Present only when the request sent a scope. */
9239
+ scope: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodString, z.objectOutputType<{}, z.ZodString, "strip">, z.objectInputType<{}, z.ZodString, "strip">>>;
9240
+ /** The RESOLVED includeUnscoped value the request ran with — false when the caller sent scope and omitted the field. Present only when the request sent a scope; without scope the flag is inert and is not echoed. */
9241
+ includeUnscoped: z.ZodOptional<z.ZodBoolean>;
9242
+ /** Sections the scope filter did not constrain, so a caller never has to assume a section was filtered when it was not. relatedPatterns cannot be scoped (Pattern nodes carry no codeContext and no path back to a source memory); commitContext is an account-wide adoption count by design. Present only when the request sent a scope. */
9243
+ unfilteredSections: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
9218
9244
  /** Sections whose backing query exceeded the per-branch timeout and were returned empty. Present only when at least one branch timed out, so an empty section can otherwise be read as 'no data'. */
9219
9245
  timedOutSections: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
9220
9246
  }, "strip", z.ZodTypeAny, {
9221
9247
  recentHours: number;
9222
9248
  contextTerms: string[];
9249
+ scope?: z.objectOutputType<{}, z.ZodString, "strip"> | undefined;
9250
+ includeUnscoped?: boolean | undefined;
9251
+ unfilteredSections?: string[] | undefined;
9223
9252
  timedOutSections?: string[] | undefined;
9224
9253
  }, {
9225
9254
  recentHours: number;
9226
9255
  contextTerms: string[];
9256
+ scope?: z.objectInputType<{}, z.ZodString, "strip"> | undefined;
9257
+ includeUnscoped?: boolean | undefined;
9258
+ unfilteredSections?: string[] | undefined;
9227
9259
  timedOutSections?: string[] | undefined;
9228
9260
  }>;
9229
9261
  }, "strip", z.ZodTypeAny, {
9230
9262
  meta: {
9231
9263
  recentHours: number;
9232
9264
  contextTerms: string[];
9265
+ scope?: z.objectOutputType<{}, z.ZodString, "strip"> | undefined;
9266
+ includeUnscoped?: boolean | undefined;
9267
+ unfilteredSections?: string[] | undefined;
9233
9268
  timedOutSections?: string[] | undefined;
9234
9269
  };
9235
9270
  activeWork: {
@@ -9268,6 +9303,9 @@ declare const buildContextResponse: z.ZodLazy<z.ZodObject<{
9268
9303
  meta: {
9269
9304
  recentHours: number;
9270
9305
  contextTerms: string[];
9306
+ scope?: z.objectInputType<{}, z.ZodString, "strip"> | undefined;
9307
+ includeUnscoped?: boolean | undefined;
9308
+ unfilteredSections?: string[] | undefined;
9271
9309
  timedOutSections?: string[] | undefined;
9272
9310
  };
9273
9311
  activeWork: {
@@ -10453,7 +10491,7 @@ declare class MemoriesService extends BaseService {
10453
10491
  * @param topics - Comma-separated topic names. Memories must have at least one matching topic.
10454
10492
  * @param excludeTopics - Comma-separated topic names. Memories with any matching topic are excluded.
10455
10493
  * @param conversationId - Filter to memories belonging to the given conversation.
10456
- * @param scope - Filter by codeContext scope. Comma-separated key:value pairs (e.g. scope=product:memnexus,team:retrieval). Memories must match ALL specified scope pairs. Allowed keys, product, service, team, role — unknown keys return 400.
10494
+ * @param scope - Filter by codeContext scope. Comma-separated key:value pairs (e.g. scope=product:memnexus,team:retrieval). Memories must match ALL specified scope pairs. Allowed keys, product, service, team, role — unknown keys, or input that yields no valid pairs, return 400.
10457
10495
  */
10458
10496
  listMemories(options?: {
10459
10497
  idPrefix?: string;
@@ -10585,7 +10623,7 @@ declare class MemoriesService extends BaseService {
10585
10623
  * @param claimsWeight - Weight for claims vector branch in hybrid search
10586
10624
  * @param includeFacets - Include facet aggregation (topics, memoryType, effectiveState) in response
10587
10625
  * @param embeddingProvider - Which embedding provider to use for query-time embedding generation and vector index lookup. `voyage` is the canonical name for the secondary provider (Voyage voyage-3.5, 1024d); `openai` is accepted as a legacy alias and now also resolves to Voyage after v1.66 P0-EMBED-SWAP. Falls back to ollama when the secondary provider is unavailable.
10588
- * @param scope - Filter by codeContext scope. Comma-separated key:value pairs (e.g. scope=product:memnexus,service:core-api). Memories must match ALL specified scope pairs. Allowed keys, product, service, team, role — unknown keys return 400.
10626
+ * @param scope - Filter by codeContext scope. Comma-separated key:value pairs (e.g. scope=product:memnexus,service:core-api). Memories must match ALL specified scope pairs. Allowed keys, product, service, team, role — unknown keys, or input that yields no valid pairs, return 400.
10589
10627
  * @param taskId - Task-scoped retrieval: returns own-history first, fills remainder with cross-task results.
10590
10628
  * @param outcomeFilter - Filter by task outcome. Use 'resolved' to find successful approaches from past tasks.
10591
10629
  */
@@ -10794,12 +10832,35 @@ declare class MemoriesService extends BaseService {
10794
10832
  matching into a single call. Eliminates the 5+ round-trip pattern agents
10795
10833
  use today.
10796
10834
 
10835
+ **Project scoping (optional).** Send `scope` as comma-separated
10836
+ `key:value` pairs (allowed keys: `product`, `service`, `team`, `role`) —
10837
+ the same format the list and search endpoints accept — to restrict the
10838
+ briefing to one project. All pairs must match (AND), so each extra key
10839
+ can only shrink the result set; send the fewest keys that identify the
10840
+ project (`product:<project>` is the recommended default). An unknown
10841
+ key, or a `scope` string that yields no valid `key:value` pair at all,
10842
+ returns 400 — a scope request that cannot be honoured is never
10843
+ silently downgraded to an unscoped briefing.
10844
+
10845
+ When `scope` is set, memories that carry no `codeContext` at all are
10846
+ excluded by default: a scoped request returns scoped content only. Send
10847
+ `includeUnscoped: true` to also include unlabeled memories. Without
10848
+ `scope` the flag is inert — accepted, no filter runs, and neither field
10849
+ is echoed in `meta`. Omitting `scope` reproduces today's behavior exactly.
10850
+
10851
+ Two sections cannot be scope-filtered and are named in
10852
+ `meta.unfilteredSections` on any scoped request rather than being served
10853
+ as if they had been filtered: `relatedPatterns` (Pattern nodes carry no
10854
+ `codeContext`) and `commitContext` (an account-wide adoption count).
10855
+
10797
10856
  * @param body - Request body
10798
10857
  */
10799
10858
  buildContext(body: {
10800
10859
  context: string;
10801
10860
  files?: string[];
10802
10861
  recentHours?: number;
10862
+ scope?: string;
10863
+ includeUnscoped?: boolean;
10803
10864
  }): Promise<HttpResponse<{
10804
10865
  activeWork: BuildContextActiveWork;
10805
10866
  relevantFacts: BuildContextFact[];
package/dist/index.js CHANGED
@@ -2274,7 +2274,7 @@ var MemoriesService = class extends BaseService {
2274
2274
  * @param topics - Comma-separated topic names. Memories must have at least one matching topic.
2275
2275
  * @param excludeTopics - Comma-separated topic names. Memories with any matching topic are excluded.
2276
2276
  * @param conversationId - Filter to memories belonging to the given conversation.
2277
- * @param scope - Filter by codeContext scope. Comma-separated key:value pairs (e.g. scope=product:memnexus,team:retrieval). Memories must match ALL specified scope pairs. Allowed keys, product, service, team, role — unknown keys return 400.
2277
+ * @param scope - Filter by codeContext scope. Comma-separated key:value pairs (e.g. scope=product:memnexus,team:retrieval). Memories must match ALL specified scope pairs. Allowed keys, product, service, team, role — unknown keys, or input that yields no valid pairs, return 400.
2278
2278
  */
2279
2279
  async listMemories(options) {
2280
2280
  const request = new Request({
@@ -2542,7 +2542,7 @@ var MemoriesService = class extends BaseService {
2542
2542
  * @param claimsWeight - Weight for claims vector branch in hybrid search
2543
2543
  * @param includeFacets - Include facet aggregation (topics, memoryType, effectiveState) in response
2544
2544
  * @param embeddingProvider - Which embedding provider to use for query-time embedding generation and vector index lookup. `voyage` is the canonical name for the secondary provider (Voyage voyage-3.5, 1024d); `openai` is accepted as a legacy alias and now also resolves to Voyage after v1.66 P0-EMBED-SWAP. Falls back to ollama when the secondary provider is unavailable.
2545
- * @param scope - Filter by codeContext scope. Comma-separated key:value pairs (e.g. scope=product:memnexus,service:core-api). Memories must match ALL specified scope pairs. Allowed keys, product, service, team, role — unknown keys return 400.
2545
+ * @param scope - Filter by codeContext scope. Comma-separated key:value pairs (e.g. scope=product:memnexus,service:core-api). Memories must match ALL specified scope pairs. Allowed keys, product, service, team, role — unknown keys, or input that yields no valid pairs, return 400.
2546
2546
  * @param taskId - Task-scoped retrieval: returns own-history first, fills remainder with cross-task results.
2547
2547
  * @param outcomeFilter - Filter by task outcome. Use 'resolved' to find successful approaches from past tasks.
2548
2548
  */
@@ -3201,6 +3201,27 @@ var MemoriesService = class extends BaseService {
3201
3201
  matching into a single call. Eliminates the 5+ round-trip pattern agents
3202
3202
  use today.
3203
3203
 
3204
+ **Project scoping (optional).** Send `scope` as comma-separated
3205
+ `key:value` pairs (allowed keys: `product`, `service`, `team`, `role`) —
3206
+ the same format the list and search endpoints accept — to restrict the
3207
+ briefing to one project. All pairs must match (AND), so each extra key
3208
+ can only shrink the result set; send the fewest keys that identify the
3209
+ project (`product:<project>` is the recommended default). An unknown
3210
+ key, or a `scope` string that yields no valid `key:value` pair at all,
3211
+ returns 400 — a scope request that cannot be honoured is never
3212
+ silently downgraded to an unscoped briefing.
3213
+
3214
+ When `scope` is set, memories that carry no `codeContext` at all are
3215
+ excluded by default: a scoped request returns scoped content only. Send
3216
+ `includeUnscoped: true` to also include unlabeled memories. Without
3217
+ `scope` the flag is inert — accepted, no filter runs, and neither field
3218
+ is echoed in `meta`. Omitting `scope` reproduces today's behavior exactly.
3219
+
3220
+ Two sections cannot be scope-filtered and are named in
3221
+ `meta.unfilteredSections` on any scoped request rather than being served
3222
+ as if they had been filtered: `relatedPatterns` (Pattern nodes carry no
3223
+ `codeContext`) and `commitContext` (an account-wide adoption count).
3224
+
3204
3225
  * @param body - Request body
3205
3226
  */
3206
3227
  async buildContext(body) {
@@ -7738,7 +7759,11 @@ var buildContextRequest = z.object({
7738
7759
  /** File paths you will be touching */
7739
7760
  files: z.array(z.string()).optional(),
7740
7761
  /** How far back to look for recent activity (hours, default 24) */
7741
- recentHours: z.number().min(1).max(720).optional()
7762
+ recentHours: z.number().min(1).max(720).optional(),
7763
+ /** Comma-separated codeContext key:value pairs to filter by. Allowed keys: product, service, team, role. All pairs must match (AND), so each extra key can only shrink the result set — a key your memories do not consistently carry will silently empty the brief. Send the fewest keys that identify the project; product:<project> alone is the recommended default. An unknown key, or a string that yields no valid key:value pair at all, returns 400 rather than an unscoped brief. */
7764
+ scope: z.string().max(200).optional(),
7765
+ /** When scope is set, whether to also return memories that carry no codeContext at all. Defaults to false when scope is set — a scoped request returns scoped content only. Send true to also include memories that carry no codeContext. Inert when scope is absent. */
7766
+ includeUnscoped: z.boolean().optional()
7742
7767
  });
7743
7768
  var buildContextActiveWork = z.object({
7744
7769
  /** Conversation ID */
@@ -7798,6 +7823,12 @@ var buildContextMeta = z.object({
7798
7823
  contextTerms: z.array(z.string()),
7799
7824
  /** Hours window used for recent activity */
7800
7825
  recentHours: z.number(),
7826
+ /** The parsed codeContext scope the request was filtered by. Present only when the request sent a scope. */
7827
+ scope: z.object({}).catchall(z.string()).optional(),
7828
+ /** The RESOLVED includeUnscoped value the request ran with — false when the caller sent scope and omitted the field. Present only when the request sent a scope; without scope the flag is inert and is not echoed. */
7829
+ includeUnscoped: z.boolean().optional(),
7830
+ /** Sections the scope filter did not constrain, so a caller never has to assume a section was filtered when it was not. relatedPatterns cannot be scoped (Pattern nodes carry no codeContext and no path back to a source memory); commitContext is an account-wide adoption count by design. Present only when the request sent a scope. */
7831
+ unfilteredSections: z.array(z.string()).optional(),
7801
7832
  /** Sections whose backing query exceeded the per-branch timeout and were returned empty. Present only when at least one branch timed out, so an empty section can otherwise be read as 'no data'. */
7802
7833
  timedOutSections: z.array(z.string()).optional()
7803
7834
  });