Skip to content

Commit 3f47058

Browse files
committed
fix: add missing api changes
1 parent 3628a99 commit 3f47058

2 files changed

Lines changed: 29 additions & 7 deletions

File tree

src/cli/operations/dev/web-ui/README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,13 @@ Response:
209209
{ "success": true, "spans": [...] }
210210
```
211211

212-
### `GET /api/memory?memoryName=xxx&namespace=yyy[&strategyId=zzz]`
212+
### `GET /api/memory?memoryName=xxx&(namespace=yyy|namespacePath=yyy)[&strategyId=zzz]`
213213

214214
Lists memory records for a given memory and namespace. Requires a deployed memory with `onListMemoryRecords` handler.
215215

216+
Exactly one of `namespace` (exact match) or `namespacePath` (hierarchical path prefix) must be provided. Supplying both
217+
returns HTTP 400.
218+
216219
Response:
217220

218221
```json
@@ -223,10 +226,18 @@ Response:
223226

224227
Performs semantic search across memory records. Requires a deployed memory with `onRetrieveMemoryRecords` handler.
225228

229+
Exactly one of `namespace` or `namespacePath` must be provided in the request body.
230+
226231
Request:
227232

228233
```json
229-
{ "memoryName": "MyMemory", "namespace": "/users/123/facts", "searchQuery": "preferences", "strategyId": "optional" }
234+
{ "memoryName": "MyMemory", "namespacePath": "/users/123/", "searchQuery": "preferences", "strategyId": "optional" }
235+
```
236+
237+
Or with exact-match semantics:
238+
239+
```json
240+
{ "memoryName": "MyMemory", "namespace": "/users/123/facts", "searchQuery": "preferences" }
230241
```
231242

232243
Response:

src/cli/operations/dev/web-ui/api-types.ts

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -314,9 +314,18 @@ export interface GetCloudWatchTraceResponse {
314314
export type { CloudWatchTraceRecord, CloudWatchSpanRecord } from '../../traces/types';
315315

316316
// ---------------------------------------------------------------------------
317-
// GET /api/memory?memoryName=xxx&namespace=yyy[&strategyId=zzz]
317+
// GET /api/memory?memoryName=xxx&(namespace=yyy|namespacePath=yyy)[&strategyId=zzz]
318318
// ---------------------------------------------------------------------------
319319

320+
/**
321+
* Query parameters for GET /api/memory. Exactly one of `namespace` (exact match) or
322+
* `namespacePath` (hierarchical path prefix) must be provided.
323+
*/
324+
export type ListMemoryRecordsQuery = {
325+
memoryName: string;
326+
strategyId?: string;
327+
} & ({ namespace: string; namespacePath?: never } | { namespace?: never; namespacePath: string });
328+
320329
/** Response shape for GET /api/memory */
321330
export interface ListMemoryRecordsResponse {
322331
success: boolean;
@@ -340,13 +349,15 @@ export interface MemoryRecordResponse {
340349
// POST /api/memory/search
341350
// ---------------------------------------------------------------------------
342351

343-
/** Request body for POST /api/memory/search */
344-
export interface RetrieveMemoryRecordsRequest {
352+
/**
353+
* Request body for POST /api/memory/search. Exactly one of `namespace` (exact match) or
354+
* `namespacePath` (hierarchical path prefix) must be provided.
355+
*/
356+
export type RetrieveMemoryRecordsRequest = {
345357
memoryName: string;
346-
namespace: string;
347358
searchQuery: string;
348359
strategyId?: string;
349-
}
360+
} & ({ namespace: string; namespacePath?: never } | { namespace?: never; namespacePath: string });
350361

351362
/** Response shape for POST /api/memory/search */
352363
export interface RetrieveMemoryRecordsResponse {

0 commit comments

Comments
 (0)