@papr/memory 1.8.2 → 1.9.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.
Files changed (54) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +17 -15
  3. package/client.d.mts +2 -2
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +2 -2
  6. package/client.d.ts.map +1 -1
  7. package/client.js +1 -1
  8. package/client.js.map +1 -1
  9. package/client.mjs +1 -1
  10. package/client.mjs.map +1 -1
  11. package/index.d.mts +1 -0
  12. package/index.d.ts +1 -0
  13. package/index.js +2 -0
  14. package/index.js.map +1 -1
  15. package/index.mjs +1 -0
  16. package/internal/types.d.mts +8 -6
  17. package/internal/types.d.mts.map +1 -1
  18. package/internal/types.d.ts +8 -6
  19. package/internal/types.d.ts.map +1 -1
  20. package/internal/utils/log.js +1 -1
  21. package/internal/utils/log.js.map +1 -1
  22. package/internal/utils/log.mjs +1 -1
  23. package/internal/utils/log.mjs.map +1 -1
  24. package/package.json +1 -1
  25. package/resources/index.d.mts +1 -1
  26. package/resources/index.d.mts.map +1 -1
  27. package/resources/index.d.ts +1 -1
  28. package/resources/index.d.ts.map +1 -1
  29. package/resources/index.js.map +1 -1
  30. package/resources/index.mjs.map +1 -1
  31. package/resources/memory.d.mts +27 -4
  32. package/resources/memory.d.mts.map +1 -1
  33. package/resources/memory.d.ts +27 -4
  34. package/resources/memory.d.ts.map +1 -1
  35. package/resources/user.d.mts +84 -12
  36. package/resources/user.d.mts.map +1 -1
  37. package/resources/user.d.ts +84 -12
  38. package/resources/user.d.ts.map +1 -1
  39. package/resources/user.js +56 -17
  40. package/resources/user.js.map +1 -1
  41. package/resources/user.mjs +56 -17
  42. package/resources/user.mjs.map +1 -1
  43. package/src/client.ts +3 -1
  44. package/src/index.ts +2 -0
  45. package/src/internal/types.ts +9 -6
  46. package/src/internal/utils/log.ts +1 -1
  47. package/src/resources/index.ts +1 -0
  48. package/src/resources/memory.ts +34 -6
  49. package/src/resources/user.ts +126 -25
  50. package/src/version.ts +1 -1
  51. package/version.d.mts +1 -1
  52. package/version.d.ts +1 -1
  53. package/version.js +1 -1
  54. package/version.mjs +1 -1
@@ -282,6 +282,8 @@ export interface ContextItem {
282
282
  * Metadata for memory request
283
283
  */
284
284
  export interface MemoryMetadata {
285
+ assistantMessage?: string | null;
286
+
285
287
  conversationId?: string | null;
286
288
 
287
289
  /**
@@ -293,7 +295,7 @@ export interface MemoryMetadata {
293
295
  * Optional object for arbitrary custom metadata fields. Only string, number,
294
296
  * boolean, or list of strings allowed. Nested dicts are not allowed.
295
297
  */
296
- customMetadata?: Record<string, string | number | boolean | Array<string>> | null;
298
+ customMetadata?: { [key: string]: string | number | boolean | Array<string> } | null;
297
299
 
298
300
  'emoji tags'?: Array<string> | null;
299
301
 
@@ -305,6 +307,8 @@ export interface MemoryMetadata {
305
307
 
306
308
  external_user_write_access?: Array<string> | null;
307
309
 
310
+ goalClassificationScores?: Array<number> | null;
311
+
308
312
  /**
309
313
  * Hierarchical structures to enable navigation from broad topics to specific ones
310
314
  */
@@ -314,22 +318,38 @@ export interface MemoryMetadata {
314
318
 
315
319
  pageId?: string | null;
316
320
 
321
+ post?: string | null;
322
+
323
+ relatedGoals?: Array<string> | null;
324
+
325
+ relatedSteps?: Array<string> | null;
326
+
327
+ relatedUseCases?: Array<string> | null;
328
+
317
329
  role_read_access?: Array<string> | null;
318
330
 
319
331
  role_write_access?: Array<string> | null;
320
332
 
333
+ sessionId?: string | null;
334
+
321
335
  sourceType?: string | null;
322
336
 
323
337
  sourceUrl?: string | null;
324
338
 
339
+ stepClassificationScores?: Array<number> | null;
340
+
325
341
  topics?: Array<string> | null;
326
342
 
343
+ useCaseClassificationScores?: Array<number> | null;
344
+
327
345
  user_id?: string | null;
328
346
 
329
347
  user_read_access?: Array<string> | null;
330
348
 
331
349
  user_write_access?: Array<string> | null;
332
350
 
351
+ userMessage?: string | null;
352
+
333
353
  workspace_id?: string | null;
334
354
 
335
355
  workspace_read_access?: Array<string> | null;
@@ -348,13 +368,21 @@ export type MemoryType = 'text' | 'code_snippet' | 'document';
348
368
  * Relationship item for memory request
349
369
  */
350
370
  export interface RelationshipItem {
351
- related_item_id: 'TextMemoryItem' | 'previous_memory_item_id';
352
-
353
- related_item_type: 'TextMemoryItem';
354
-
355
371
  relation_type: string;
356
372
 
357
373
  metadata?: unknown;
374
+
375
+ related_item_id?: string | null;
376
+
377
+ /**
378
+ * Legacy field - not used in processing
379
+ */
380
+ related_item_type?: string | null;
381
+
382
+ /**
383
+ * Enum for relationship types
384
+ */
385
+ relationship_type?: 'previous_memory_item_id' | 'all_previous_memory_items' | null;
358
386
  }
359
387
 
360
388
  export interface SearchResponse {
@@ -401,7 +429,7 @@ export namespace SearchResponse {
401
429
  export interface Memory {
402
430
  id: string;
403
431
 
404
- acl: Record<string, Record<string, boolean>>;
432
+ acl: { [key: string]: { [key: string]: boolean } };
405
433
 
406
434
  content: string;
407
435
 
@@ -3,6 +3,7 @@
3
3
  import { APIResource } from '../core/resource';
4
4
  import * as UserAPI from './user';
5
5
  import { APIPromise } from '../core/api-promise';
6
+ import { buildHeaders } from '../internal/headers';
6
7
  import { RequestOptions } from '../internal/request-options';
7
8
  import { path } from '../internal/utils/path';
8
9
 
@@ -14,11 +15,17 @@ export class User extends APIResource {
14
15
  * ```ts
15
16
  * const userResponse = await client.user.create({
16
17
  * external_id: 'user123',
18
+ * 'X-API-Key': 'X-API-Key',
17
19
  * });
18
20
  * ```
19
21
  */
20
- create(body: UserCreateParams, options?: RequestOptions): APIPromise<UserResponse> {
21
- return this._client.post('/v1/user', { body, ...options });
22
+ create(params: UserCreateParams, options?: RequestOptions): APIPromise<UserResponse> {
23
+ const { 'X-API-Key': xAPIKey, ...body } = params;
24
+ return this._client.post('/v1/user', {
25
+ body,
26
+ ...options,
27
+ headers: buildHeaders([{ 'X-API-Key': xAPIKey }, options?.headers]),
28
+ });
22
29
  }
23
30
 
24
31
  /**
@@ -26,11 +33,18 @@ export class User extends APIResource {
26
33
  *
27
34
  * @example
28
35
  * ```ts
29
- * const userResponse = await client.user.update('user_id');
36
+ * const userResponse = await client.user.update('user_id', {
37
+ * 'X-API-Key': 'X-API-Key',
38
+ * });
30
39
  * ```
31
40
  */
32
- update(userID: string, body: UserUpdateParams, options?: RequestOptions): APIPromise<UserResponse> {
33
- return this._client.put(path`/v1/user/${userID}`, { body, ...options });
41
+ update(userID: string, params: UserUpdateParams, options?: RequestOptions): APIPromise<UserResponse> {
42
+ const { 'X-API-Key': xAPIKey, ...body } = params;
43
+ return this._client.put(path`/v1/user/${userID}`, {
44
+ body,
45
+ ...options,
46
+ headers: buildHeaders([{ 'X-API-Key': xAPIKey }, options?.headers]),
47
+ });
34
48
  }
35
49
 
36
50
  /**
@@ -38,14 +52,18 @@ export class User extends APIResource {
38
52
  *
39
53
  * @example
40
54
  * ```ts
41
- * const users = await client.user.list();
55
+ * const users = await client.user.list({
56
+ * 'X-API-Key': 'X-API-Key',
57
+ * });
42
58
  * ```
43
59
  */
44
- list(
45
- query: UserListParams | null | undefined = {},
46
- options?: RequestOptions,
47
- ): APIPromise<UserListResponse> {
48
- return this._client.get('/v1/user', { query, ...options });
60
+ list(params: UserListParams, options?: RequestOptions): APIPromise<UserListResponse> {
61
+ const { 'X-API-Key': xAPIKey, ...query } = params;
62
+ return this._client.get('/v1/user', {
63
+ query,
64
+ ...options,
65
+ headers: buildHeaders([{ 'X-API-Key': xAPIKey }, options?.headers]),
66
+ });
49
67
  }
50
68
 
51
69
  /**
@@ -54,16 +72,18 @@ export class User extends APIResource {
54
72
  *
55
73
  * @example
56
74
  * ```ts
57
- * const user = await client.user.delete('user_id');
75
+ * const user = await client.user.delete('user_id', {
76
+ * 'X-API-Key': 'X-API-Key',
77
+ * });
58
78
  * ```
59
79
  */
60
- delete(
61
- userID: string,
62
- params: UserDeleteParams | null | undefined = {},
63
- options?: RequestOptions,
64
- ): APIPromise<UserDeleteResponse> {
65
- const { is_external } = params ?? {};
66
- return this._client.delete(path`/v1/user/${userID}`, { query: { is_external }, ...options });
80
+ delete(userID: string, params: UserDeleteParams, options?: RequestOptions): APIPromise<UserDeleteResponse> {
81
+ const { 'X-API-Key': xAPIKey, is_external } = params;
82
+ return this._client.delete(path`/v1/user/${userID}`, {
83
+ query: { is_external },
84
+ ...options,
85
+ headers: buildHeaders([{ 'X-API-Key': xAPIKey }, options?.headers]),
86
+ });
67
87
  }
68
88
 
69
89
  /**
@@ -74,11 +94,17 @@ export class User extends APIResource {
74
94
  * ```ts
75
95
  * const response = await client.user.createBatch({
76
96
  * users: [{ external_id: 'user123' }],
97
+ * 'X-API-Key': 'X-API-Key',
77
98
  * });
78
99
  * ```
79
100
  */
80
- createBatch(body: UserCreateBatchParams, options?: RequestOptions): APIPromise<UserCreateBatchResponse> {
81
- return this._client.post('/v1/user/batch', { body, ...options });
101
+ createBatch(params: UserCreateBatchParams, options?: RequestOptions): APIPromise<UserCreateBatchResponse> {
102
+ const { 'X-API-Key': xAPIKey, ...body } = params;
103
+ return this._client.post('/v1/user/batch', {
104
+ body,
105
+ ...options,
106
+ headers: buildHeaders([{ 'X-API-Key': xAPIKey }, options?.headers]),
107
+ });
82
108
  }
83
109
 
84
110
  /**
@@ -86,11 +112,17 @@ export class User extends APIResource {
86
112
  *
87
113
  * @example
88
114
  * ```ts
89
- * const userResponse = await client.user.get('user_id');
115
+ * const userResponse = await client.user.get('user_id', {
116
+ * 'X-API-Key': 'X-API-Key',
117
+ * });
90
118
  * ```
91
119
  */
92
- get(userID: string, options?: RequestOptions): APIPromise<UserResponse> {
93
- return this._client.get(path`/v1/user/${userID}`, options);
120
+ get(userID: string, params: UserGetParams, options?: RequestOptions): APIPromise<UserResponse> {
121
+ const { 'X-API-Key': xAPIKey } = params;
122
+ return this._client.get(path`/v1/user/${userID}`, {
123
+ ...options,
124
+ headers: buildHeaders([{ 'X-API-Key': xAPIKey }, options?.headers]),
125
+ });
94
126
  }
95
127
  }
96
128
 
@@ -208,44 +240,108 @@ export interface UserCreateBatchResponse {
208
240
  }
209
241
 
210
242
  export interface UserCreateParams {
243
+ /**
244
+ * Body param:
245
+ */
211
246
  external_id: string;
212
247
 
248
+ /**
249
+ * Header param:
250
+ */
251
+ 'X-API-Key': string;
252
+
253
+ /**
254
+ * Body param:
255
+ */
213
256
  email?: string | null;
214
257
 
258
+ /**
259
+ * Body param:
260
+ */
215
261
  metadata?: unknown | null;
216
262
 
263
+ /**
264
+ * Body param:
265
+ */
217
266
  type?: UserType;
218
267
  }
219
268
 
220
269
  export interface UserUpdateParams {
270
+ /**
271
+ * Header param:
272
+ */
273
+ 'X-API-Key': string;
274
+
275
+ /**
276
+ * Body param:
277
+ */
221
278
  email?: string | null;
222
279
 
280
+ /**
281
+ * Body param:
282
+ */
223
283
  external_id?: string | null;
224
284
 
285
+ /**
286
+ * Body param:
287
+ */
225
288
  metadata?: unknown | null;
226
289
 
290
+ /**
291
+ * Body param:
292
+ */
227
293
  type?: UserType | null;
228
294
  }
229
295
 
230
296
  export interface UserListParams {
297
+ /**
298
+ * Header param:
299
+ */
300
+ 'X-API-Key': string;
301
+
302
+ /**
303
+ * Query param:
304
+ */
231
305
  email?: string | null;
232
306
 
307
+ /**
308
+ * Query param:
309
+ */
233
310
  external_id?: string | null;
234
311
 
312
+ /**
313
+ * Query param:
314
+ */
235
315
  page?: number;
236
316
 
317
+ /**
318
+ * Query param:
319
+ */
237
320
  page_size?: number;
238
321
  }
239
322
 
240
323
  export interface UserDeleteParams {
241
324
  /**
242
- * Is this an external user ID?
325
+ * Header param:
326
+ */
327
+ 'X-API-Key': string;
328
+
329
+ /**
330
+ * Query param: Is this an external user ID?
243
331
  */
244
332
  is_external?: boolean;
245
333
  }
246
334
 
247
335
  export interface UserCreateBatchParams {
336
+ /**
337
+ * Body param:
338
+ */
248
339
  users: Array<UserCreateBatchParams.User>;
340
+
341
+ /**
342
+ * Header param:
343
+ */
344
+ 'X-API-Key': string;
249
345
  }
250
346
 
251
347
  export namespace UserCreateBatchParams {
@@ -263,6 +359,10 @@ export namespace UserCreateBatchParams {
263
359
  }
264
360
  }
265
361
 
362
+ export interface UserGetParams {
363
+ 'X-API-Key': string;
364
+ }
365
+
266
366
  export declare namespace User {
267
367
  export {
268
368
  type UserResponse as UserResponse,
@@ -275,5 +375,6 @@ export declare namespace User {
275
375
  type UserListParams as UserListParams,
276
376
  type UserDeleteParams as UserDeleteParams,
277
377
  type UserCreateBatchParams as UserCreateBatchParams,
378
+ type UserGetParams as UserGetParams,
278
379
  };
279
380
  }
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '1.8.2'; // x-release-please-version
1
+ export const VERSION = '1.9.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.8.2";
1
+ export declare const VERSION = "1.9.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.8.2";
1
+ export declare const VERSION = "1.9.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '1.8.2'; // x-release-please-version
4
+ exports.VERSION = '1.9.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '1.8.2'; // x-release-please-version
1
+ export const VERSION = '1.9.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map