Skip to content

Commit e1b1c24

Browse files
feat(api): api update
1 parent 091fd8b commit e1b1c24

8 files changed

Lines changed: 117 additions & 25 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 26
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-new-5d883c307659b317ca9a27ffd4e98855210c7030167bc79f4727412266c8e53b.yml
3-
openapi_spec_hash: 4e5b35c97838082939b19a24d9472ffd
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-new-f09b91ede978d3fd05810d3750fcc837f8baa6430fa1be9208ba3088ecaef7f4.yml
3+
openapi_spec_hash: 957d1e254f2f5933d0c22f3b310122e9
44
config_hash: cde97ef3188581c5f4924c633ec33ddb

packages/mcp-server/src/local-docs-search.ts

Lines changed: 32 additions & 23 deletions
Large diffs are not rendered by default.

src/resources/documents.ts

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,8 @@ export namespace DocumentListResponse {
194194
*/
195195
customId: string | null;
196196

197+
filepath: string | null;
198+
197199
/**
198200
* Optional metadata for the document. This is used to store additional information
199201
* about the document. You can use this to store any additional information you
@@ -394,6 +396,8 @@ export interface DocumentGetResponse {
394396
*/
395397
customId: string | null;
396398

399+
filepath: string | null;
400+
397401
/**
398402
* Optional metadata for the document. This is used to store additional information
399403
* about the document. You can use this to store any additional information you
@@ -600,6 +604,12 @@ export interface DocumentUpdateParams {
600604
*/
601605
customId?: string;
602606

607+
/**
608+
* Optional file path for the document (e.g., '/documents/reports/file.pdf'). Used
609+
* by supermemoryfs to map documents to filesystem paths.
610+
*/
611+
filepath?: string;
612+
603613
/**
604614
* Optional metadata for the document. This is used to store additional information
605615
* about the document. You can use this to store any additional information you
@@ -624,6 +634,12 @@ export interface DocumentListParams {
624634
*/
625635
containerTags?: Array<string>;
626636

637+
/**
638+
* Filter documents by filepath. Exact match for full paths, prefix match if ending
639+
* with /
640+
*/
641+
filepath?: string;
642+
627643
/**
628644
* Optional filters to apply to the search. Can be a JSON string or Query object.
629645
*/
@@ -4090,6 +4106,12 @@ export interface DocumentAddParams {
40904106
*/
40914107
entityContext?: string;
40924108

4109+
/**
4110+
* Optional file path for the document. Used by supermemoryfs to store the full
4111+
* path of the file.
4112+
*/
4113+
filepath?: string;
4114+
40934115
/**
40944116
* Optional metadata for the document.
40954117
*/
@@ -4121,6 +4143,12 @@ export interface DocumentBatchAddParams {
41214143

41224144
content?: null;
41234145

4146+
/**
4147+
* Optional file path for the document (e.g., '/documents/reports/file.pdf'). Used
4148+
* by supermemoryfs to map documents to filesystem paths.
4149+
*/
4150+
filepath?: string;
4151+
41244152
/**
41254153
* Optional metadata for the document. This is used to store additional information
41264154
* about the document. You can use this to store any additional information you
@@ -4171,6 +4199,12 @@ export namespace DocumentBatchAddParams {
41714199
*/
41724200
customId?: string;
41734201

4202+
/**
4203+
* Optional file path for the document (e.g., '/documents/reports/file.pdf'). Used
4204+
* by supermemoryfs to map documents to filesystem paths.
4205+
*/
4206+
filepath?: string;
4207+
41744208
/**
41754209
* Optional metadata for the document. This is used to store additional information
41764210
* about the document. You can use this to store any additional information you
@@ -4195,6 +4229,12 @@ export interface DocumentDeleteBulkParams {
41954229
*/
41964230
containerTags?: Array<string>;
41974231

4232+
/**
4233+
* Delete documents matching this filepath. Exact match for full paths, prefix
4234+
* match if ending with /
4235+
*/
4236+
filepath?: string;
4237+
41984238
/**
41994239
* Array of document IDs to delete (max 100 at once)
42004240
*/
@@ -4219,6 +4259,12 @@ export interface DocumentUploadFileParams {
42194259
*/
42204260
containerTags?: string;
42214261

4262+
/**
4263+
* Optional file path for the uploaded file (e.g., '/documents/reports/file.pdf').
4264+
* Used by supermemoryfs to map documents to filesystem paths.
4265+
*/
4266+
filepath?: string;
4267+
42224268
/**
42234269
* Optional file type override to force specific processing behavior. Valid values:
42244270
* text, pdf, tweet, google_doc, google_slide, google_sheet, image, video,

src/resources/search.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,11 @@ export namespace SearchMemoriesResponse {
280280
*/
281281
documents?: Array<Result.Document>;
282282

283+
/**
284+
* Filepath of the source document this memory or chunk came from
285+
*/
286+
filepath?: string | null;
287+
283288
/**
284289
* Indicates if this memory was created by aggregating multiple source memories
285290
*/
@@ -466,6 +471,12 @@ export interface SearchDocumentsParams {
466471
*/
467472
documentThreshold?: number;
468473

474+
/**
475+
* Filter search results by filepath. Exact match for full paths, prefix match if
476+
* ending with /
477+
*/
478+
filepath?: string;
479+
469480
/**
470481
* Optional filters to apply to the search. Can be a JSON string or Query object.
471482
*/
@@ -3953,6 +3964,12 @@ export interface SearchExecuteParams {
39533964
*/
39543965
documentThreshold?: number;
39553966

3967+
/**
3968+
* Filter search results by filepath. Exact match for full paths, prefix match if
3969+
* ending with /
3970+
*/
3971+
filepath?: string;
3972+
39563973
/**
39573974
* Optional filters to apply to the search. Can be a JSON string or Query object.
39583975
*/
@@ -7418,6 +7435,12 @@ export interface SearchMemoriesParams {
74187435
*/
74197436
containerTag?: string;
74207437

7438+
/**
7439+
* Filter search results by filepath. Exact match for full paths, prefix match if
7440+
* ending with /
7441+
*/
7442+
filepath?: string;
7443+
74217444
/**
74227445
* Optional filters to apply to the search. Can be a JSON string or Query object.
74237446
*/

src/resources/top-level.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,12 @@ export interface AddParams {
8585
*/
8686
entityContext?: string;
8787

88+
/**
89+
* Optional file path for the document. Used by supermemoryfs to store the full
90+
* path of the file.
91+
*/
92+
filepath?: string;
93+
8894
/**
8995
* Optional metadata for the document.
9096
*/

tests/api-resources/documents.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ describe('resource documents', () => {
6464
containerTags: ['string'],
6565
customId: 'customId',
6666
entityContext: 'entityContext',
67+
filepath: 'filepath',
6768
metadata: { foo: 'string' },
6869
taskType: 'memory',
6970
});
@@ -92,6 +93,7 @@ describe('resource documents', () => {
9293
containerTag: 'user_123',
9394
containerTags: ['user_123', 'project_123'],
9495
customId: 'mem_abc123',
96+
filepath: '/documents/reports/file.pdf',
9597
metadata: {
9698
category: 'technology',
9799
isPublic: true,
@@ -106,6 +108,7 @@ describe('resource documents', () => {
106108
containerTag: 'user_123',
107109
containerTags: ['user_123', 'project_123'],
108110
content: null,
111+
filepath: '/documents/reports/file.pdf',
109112
metadata: {
110113
category: 'technology',
111114
isPublic: true,
@@ -174,6 +177,7 @@ describe('resource documents', () => {
174177
file: await toFile(Buffer.from('Example data'), 'README.md'),
175178
containerTag: 'user',
176179
containerTags: '["user_123", "project_123"]',
180+
filepath: '/documents/reports/file.pdf',
177181
fileType: 'image',
178182
metadata: '{"category": "technology", "isPublic": true, "readingTime": 5}',
179183
mimeType: 'mimeType',

tests/api-resources/search.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ describe('resource search', () => {
3030
containerTags: ['user_123'],
3131
docId: 'docId',
3232
documentThreshold: 0,
33+
filepath: '/docs/',
3334
filters: {
3435
OR: [
3536
{
@@ -73,6 +74,7 @@ describe('resource search', () => {
7374
containerTags: ['user_123'],
7475
docId: 'docId',
7576
documentThreshold: 0,
77+
filepath: '/docs/',
7678
filters: {
7779
OR: [
7880
{
@@ -112,6 +114,7 @@ describe('resource search', () => {
112114
q: 'machine learning concepts',
113115
aggregate: false,
114116
containerTag: 'user_123',
117+
filepath: '/docs/',
115118
filters: {
116119
OR: [
117120
{

tests/api-resources/top-level.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ describe('top level methods', () => {
2828
containerTags: ['string'],
2929
customId: 'customId',
3030
entityContext: 'entityContext',
31+
filepath: 'filepath',
3132
metadata: { foo: 'string' },
3233
taskType: 'memory',
3334
});

0 commit comments

Comments
 (0)