@aigne/afs-user-profile-memory 1.3.0-beta.1 → 1.3.0-beta.10

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/CHANGELOG.md CHANGED
@@ -1,5 +1,105 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.3.0-beta.10](https://github.com/AIGNE-io/aigne-framework/compare/afs-user-profile-memory-v1.3.0-beta.9...afs-user-profile-memory-v1.3.0-beta.10) (2026-01-06)
4
+
5
+
6
+ ### Features
7
+
8
+ * **core:** add cross session user memory support ([#873](https://github.com/AIGNE-io/aigne-framework/issues/873)) ([f377aa1](https://github.com/AIGNE-io/aigne-framework/commit/f377aa17f2cf8004fd3225ade4a37fd90af1292f))
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * The following workspace dependencies were updated
14
+ * dependencies
15
+ * @aigne/afs-history bumped to 1.2.0-beta.6
16
+ * @aigne/core bumped to 1.72.0-beta.10
17
+
18
+ ## [1.3.0-beta.9](https://github.com/AIGNE-io/aigne-framework/compare/afs-user-profile-memory-v1.3.0-beta.8...afs-user-profile-memory-v1.3.0-beta.9) (2026-01-02)
19
+
20
+
21
+ ### Dependencies
22
+
23
+ * The following workspace dependencies were updated
24
+ * dependencies
25
+ * @aigne/core bumped to 1.72.0-beta.9
26
+
27
+ ## [1.3.0-beta.8](https://github.com/AIGNE-io/aigne-framework/compare/afs-user-profile-memory-v1.3.0-beta.7...afs-user-profile-memory-v1.3.0-beta.8) (2025-12-31)
28
+
29
+
30
+ ### Features
31
+
32
+ * add session compact support for AIAgent ([#863](https://github.com/AIGNE-io/aigne-framework/issues/863)) ([9010918](https://github.com/AIGNE-io/aigne-framework/commit/9010918cd3f18b02b5c60ddc9ed5c34b568d0b28))
33
+
34
+
35
+ ### Dependencies
36
+
37
+ * The following workspace dependencies were updated
38
+ * dependencies
39
+ * @aigne/afs bumped to 1.4.0-beta.5
40
+ * @aigne/afs-history bumped to 1.2.0-beta.5
41
+ * @aigne/core bumped to 1.72.0-beta.8
42
+
43
+ ## [1.3.0-beta.7](https://github.com/AIGNE-io/aigne-framework/compare/afs-user-profile-memory-v1.3.0-beta.6...afs-user-profile-memory-v1.3.0-beta.7) (2025-12-26)
44
+
45
+
46
+ ### Dependencies
47
+
48
+ * The following workspace dependencies were updated
49
+ * dependencies
50
+ * @aigne/afs bumped to 1.4.0-beta.4
51
+ * @aigne/afs-history bumped to 1.2.0-beta.4
52
+ * @aigne/core bumped to 1.72.0-beta.7
53
+
54
+ ## [1.3.0-beta.6](https://github.com/AIGNE-io/aigne-framework/compare/afs-user-profile-memory-v1.3.0-beta.5...afs-user-profile-memory-v1.3.0-beta.6) (2025-12-25)
55
+
56
+
57
+ ### Dependencies
58
+
59
+ * The following workspace dependencies were updated
60
+ * dependencies
61
+ * @aigne/core bumped to 1.72.0-beta.6
62
+
63
+ ## [1.3.0-beta.5](https://github.com/AIGNE-io/aigne-framework/compare/afs-user-profile-memory-v1.3.0-beta.4...afs-user-profile-memory-v1.3.0-beta.5) (2025-12-25)
64
+
65
+
66
+ ### Dependencies
67
+
68
+ * The following workspace dependencies were updated
69
+ * dependencies
70
+ * @aigne/core bumped to 1.72.0-beta.5
71
+
72
+ ## [1.3.0-beta.4](https://github.com/AIGNE-io/aigne-framework/compare/afs-user-profile-memory-v1.3.0-beta.3...afs-user-profile-memory-v1.3.0-beta.4) (2025-12-24)
73
+
74
+
75
+ ### Dependencies
76
+
77
+ * The following workspace dependencies were updated
78
+ * dependencies
79
+ * @aigne/afs bumped to 1.4.0-beta.3
80
+ * @aigne/afs-history bumped to 1.2.0-beta.3
81
+ * @aigne/core bumped to 1.72.0-beta.4
82
+
83
+ ## [1.3.0-beta.3](https://github.com/AIGNE-io/aigne-framework/compare/afs-user-profile-memory-v1.3.0-beta.2...afs-user-profile-memory-v1.3.0-beta.3) (2025-12-19)
84
+
85
+
86
+ ### Dependencies
87
+
88
+ * The following workspace dependencies were updated
89
+ * dependencies
90
+ * @aigne/core bumped to 1.72.0-beta.3
91
+
92
+ ## [1.3.0-beta.2](https://github.com/AIGNE-io/aigne-framework/compare/afs-user-profile-memory-v1.3.0-beta.1...afs-user-profile-memory-v1.3.0-beta.2) (2025-12-19)
93
+
94
+
95
+ ### Dependencies
96
+
97
+ * The following workspace dependencies were updated
98
+ * dependencies
99
+ * @aigne/afs bumped to 1.4.0-beta.2
100
+ * @aigne/afs-history bumped to 1.2.0-beta.2
101
+ * @aigne/core bumped to 1.72.0-beta.2
102
+
3
103
  ## [1.3.0-beta.1](https://github.com/AIGNE-io/aigne-framework/compare/afs-user-profile-memory-v1.3.0-beta...afs-user-profile-memory-v1.3.0-beta.1) (2025-12-17)
4
104
 
5
105
 
package/lib/cjs/index.js CHANGED
@@ -4,6 +4,7 @@ exports.UserProfileMemory = void 0;
4
4
  const afs_history_1 = require("@aigne/afs-history");
5
5
  const core_1 = require("@aigne/core");
6
6
  const logger_js_1 = require("@aigne/core/utils/logger.js");
7
+ const uuid_1 = require("@aigne/uuid");
7
8
  const fast_json_patch_1 = require("fast-json-patch");
8
9
  const zod_to_json_schema_1 = require("zod-to-json-schema");
9
10
  const prompt_js_1 = require("./prompt.js");
@@ -60,13 +61,24 @@ class UserProfileMemory {
60
61
  return { data: profile ? [profile] : [] };
61
62
  }
62
63
  async read(path) {
63
- const data = await this.storage.read(path);
64
+ if (path !== "/")
65
+ return {};
66
+ const data = (await this.storage.list({
67
+ orderBy: [["createdAt", "desc"]],
68
+ limit: 1,
69
+ })).data.at(0);
64
70
  if (data)
65
71
  data.description = this.description;
66
72
  return { data };
67
73
  }
68
74
  async write(path, entry) {
69
- const data = await this.storage.create({ ...entry, path });
75
+ const { data: previous } = await this.read("/");
76
+ const data = await this.storage.create({
77
+ ...previous,
78
+ ...entry,
79
+ id: previous?.id || (0, uuid_1.v7)(),
80
+ path,
81
+ });
70
82
  if (data)
71
83
  data.description = this.description;
72
84
  return { data };
package/lib/esm/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { SharedAFSStorage, } from "@aigne/afs-history";
2
2
  import { AIAgent } from "@aigne/core";
3
3
  import { logger } from "@aigne/core/utils/logger.js";
4
+ import { v7 } from "@aigne/uuid";
4
5
  import { applyPatch } from "fast-json-patch";
5
6
  import { zodToJsonSchema } from "zod-to-json-schema";
6
7
  import { USER_PROFILE_MEMORY_EXTRACTOR_PROMPT } from "./prompt.js";
@@ -57,13 +58,24 @@ export class UserProfileMemory {
57
58
  return { data: profile ? [profile] : [] };
58
59
  }
59
60
  async read(path) {
60
- const data = await this.storage.read(path);
61
+ if (path !== "/")
62
+ return {};
63
+ const data = (await this.storage.list({
64
+ orderBy: [["createdAt", "desc"]],
65
+ limit: 1,
66
+ })).data.at(0);
61
67
  if (data)
62
68
  data.description = this.description;
63
69
  return { data };
64
70
  }
65
71
  async write(path, entry) {
66
- const data = await this.storage.create({ ...entry, path });
72
+ const { data: previous } = await this.read("/");
73
+ const data = await this.storage.create({
74
+ ...previous,
75
+ ...entry,
76
+ id: previous?.id || v7(),
77
+ path,
78
+ });
67
79
  if (data)
68
80
  data.description = this.description;
69
81
  return { data };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aigne/afs-user-profile-memory",
3
- "version": "1.3.0-beta.1",
3
+ "version": "1.3.0-beta.10",
4
4
  "description": "AIGNE AFS module for user profile memory",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -47,12 +47,13 @@
47
47
  }
48
48
  },
49
49
  "dependencies": {
50
+ "@aigne/uuid": "^13.0.1",
50
51
  "fast-json-patch": "^3.1.1",
51
52
  "zod": "^3.25.67",
52
53
  "zod-to-json-schema": "^3.24.6",
53
- "@aigne/afs": "^1.4.0-beta.1",
54
- "@aigne/afs-history": "^1.2.0-beta.1",
55
- "@aigne/core": "^1.72.0-beta.1"
54
+ "@aigne/afs": "^1.4.0-beta.5",
55
+ "@aigne/afs-history": "^1.2.0-beta.6",
56
+ "@aigne/core": "^1.72.0-beta.10"
56
57
  },
57
58
  "devDependencies": {
58
59
  "@types/bun": "^1.2.22",