@aigne/afs-history 1.1.3 → 1.2.0-beta.2

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
@@ -6,6 +6,44 @@
6
6
  * dependencies
7
7
  * @aigne/afs bumped to 1.2.0
8
8
 
9
+ ## [1.2.0-beta.2](https://github.com/AIGNE-io/aigne-framework/compare/afs-history-v1.2.0-beta.1...afs-history-v1.2.0-beta.2) (2025-12-19)
10
+
11
+
12
+ ### Dependencies
13
+
14
+ * The following workspace dependencies were updated
15
+ * dependencies
16
+ * @aigne/afs bumped to 1.4.0-beta.2
17
+
18
+ ## [1.2.0-beta.1](https://github.com/AIGNE-io/aigne-framework/compare/afs-history-v1.2.0-beta...afs-history-v1.2.0-beta.1) (2025-12-17)
19
+
20
+
21
+ ### Bug Fixes
22
+
23
+ * bump version ([70d217c](https://github.com/AIGNE-io/aigne-framework/commit/70d217c8360dd0dda7f5f17011c4e92ec836e801))
24
+
25
+
26
+ ### Dependencies
27
+
28
+ * The following workspace dependencies were updated
29
+ * dependencies
30
+ * @aigne/afs bumped to 1.4.0-beta.1
31
+ * @aigne/sqlite bumped to 0.4.9-beta
32
+
33
+ ## [1.2.0-beta](https://github.com/AIGNE-io/aigne-framework/compare/afs-history-v1.1.3...afs-history-v1.2.0-beta) (2025-12-17)
34
+
35
+
36
+ ### Features
37
+
38
+ * **afs:** support expand context into prompt template by call `$afs.xxx` ([#830](https://github.com/AIGNE-io/aigne-framework/issues/830)) ([5616acd](https://github.com/AIGNE-io/aigne-framework/commit/5616acd6ea257c91aa0b766608f45c5ce17f0345))
39
+
40
+
41
+ ### Dependencies
42
+
43
+ * The following workspace dependencies were updated
44
+ * dependencies
45
+ * @aigne/afs bumped to 1.4.0-beta
46
+
9
47
  ## [1.1.3](https://github.com/AIGNE-io/aigne-framework/compare/afs-history-v1.1.3-beta.3...afs-history-v1.1.3) (2025-12-12)
10
48
 
11
49
 
@@ -1,4 +1,4 @@
1
- import type { AFSEntry, AFSListOptions, AFSModule, AFSRoot, AFSWriteEntryPayload } from "@aigne/afs";
1
+ import type { AFSListOptions, AFSListResult, AFSModule, AFSReadResult, AFSRoot, AFSWriteEntryPayload, AFSWriteResult } from "@aigne/afs";
2
2
  import { SharedAFSStorage, type SharedAFSStorageOptions } from "./storage/index.js";
3
3
  export * from "./storage/index.js";
4
4
  export interface AFSHistoryOptions {
@@ -9,15 +9,7 @@ export declare class AFSHistory implements AFSModule {
9
9
  private storage;
10
10
  readonly name: string;
11
11
  onMount(afs: AFSRoot): void;
12
- list(path: string, options?: AFSListOptions): Promise<{
13
- list: AFSEntry[];
14
- }>;
15
- read(path: string): Promise<{
16
- result: AFSEntry | undefined;
17
- message?: string;
18
- }>;
19
- write(path: string, content: AFSWriteEntryPayload): Promise<{
20
- result: AFSEntry;
21
- message?: string;
22
- }>;
12
+ list(path: string, options?: AFSListOptions): Promise<AFSListResult>;
13
+ read(path: string): Promise<AFSReadResult>;
14
+ write(path: string, content: AFSWriteEntryPayload): Promise<AFSWriteResult>;
23
15
  }
package/lib/cjs/index.js CHANGED
@@ -45,16 +45,16 @@ class AFSHistory {
45
45
  }
46
46
  async list(path, options) {
47
47
  if (path !== "/")
48
- return { list: [] };
48
+ return { data: [] };
49
49
  return await this.storage.list(options);
50
50
  }
51
51
  async read(path) {
52
- const result = await this.storage.read(path);
53
- return { result };
52
+ const data = await this.storage.read(path);
53
+ return { data };
54
54
  }
55
55
  async write(path, content) {
56
- const result = await this.storage.create({ ...content, path });
57
- return { result };
56
+ const data = await this.storage.create({ ...content, path });
57
+ return { data };
58
58
  }
59
59
  }
60
60
  exports.AFSHistory = AFSHistory;
@@ -18,7 +18,7 @@ export declare class AFSStorageWithModule implements AFSStorage {
18
18
  private table;
19
19
  constructor(db: ReturnType<typeof initDatabase>, table: Promise<ReturnType<typeof entriesTable>>);
20
20
  list(options?: AFSStorageListOptions): Promise<{
21
- list: AFSEntry[];
21
+ data: AFSEntry[];
22
22
  }>;
23
23
  read(path: string): Promise<AFSEntry | undefined>;
24
24
  create(entry: AFSStorageCreatePayload): Promise<AFSEntry>;
@@ -46,14 +46,14 @@ class AFSStorageWithModule {
46
46
  const { filter, limit = DEFAULT_AFS_STORAGE_LIST_LIMIT } = options;
47
47
  const db = await this.db;
48
48
  const table = await this.table;
49
- const list = await db
49
+ const data = await db
50
50
  .select()
51
51
  .from(table)
52
52
  .where((0, sqlite_1.and)(filter?.userId ? (0, sqlite_1.eq)(table.userId, filter.userId) : undefined, filter?.sessionId ? (0, sqlite_1.eq)(table.sessionId, filter.sessionId) : undefined))
53
53
  .orderBy(...(options.orderBy ?? []).map((item) => (item[1] === "asc" ? sqlite_1.asc : sqlite_1.desc)(sqlite_1.sql.identifier(item[0]))))
54
54
  .limit(limit)
55
55
  .execute();
56
- return { list };
56
+ return { data };
57
57
  }
58
58
  async read(path) {
59
59
  const db = await this.db;
@@ -13,7 +13,7 @@ export interface AFSStorageListOptions {
13
13
  export interface AFSStorage {
14
14
  create(entry: AFSStorageCreatePayload): Promise<AFSEntry>;
15
15
  list(options?: AFSStorageListOptions): Promise<{
16
- list: AFSEntry[];
16
+ data: AFSEntry[];
17
17
  }>;
18
18
  read(path: string): Promise<AFSEntry | undefined>;
19
19
  }
@@ -1,4 +1,4 @@
1
- import type { AFSEntry, AFSListOptions, AFSModule, AFSRoot, AFSWriteEntryPayload } from "@aigne/afs";
1
+ import type { AFSListOptions, AFSListResult, AFSModule, AFSReadResult, AFSRoot, AFSWriteEntryPayload, AFSWriteResult } from "@aigne/afs";
2
2
  import { SharedAFSStorage, type SharedAFSStorageOptions } from "./storage/index.js";
3
3
  export * from "./storage/index.js";
4
4
  export interface AFSHistoryOptions {
@@ -9,15 +9,7 @@ export declare class AFSHistory implements AFSModule {
9
9
  private storage;
10
10
  readonly name: string;
11
11
  onMount(afs: AFSRoot): void;
12
- list(path: string, options?: AFSListOptions): Promise<{
13
- list: AFSEntry[];
14
- }>;
15
- read(path: string): Promise<{
16
- result: AFSEntry | undefined;
17
- message?: string;
18
- }>;
19
- write(path: string, content: AFSWriteEntryPayload): Promise<{
20
- result: AFSEntry;
21
- message?: string;
22
- }>;
12
+ list(path: string, options?: AFSListOptions): Promise<AFSListResult>;
13
+ read(path: string): Promise<AFSReadResult>;
14
+ write(path: string, content: AFSWriteEntryPayload): Promise<AFSWriteResult>;
23
15
  }
@@ -20,7 +20,7 @@ export declare class AFSStorageWithModule implements AFSStorage {
20
20
  private table;
21
21
  constructor(db: ReturnType<typeof initDatabase>, table: Promise<ReturnType<typeof entriesTable>>);
22
22
  list(options?: AFSStorageListOptions): Promise<{
23
- list: AFSEntry[];
23
+ data: AFSEntry[];
24
24
  }>;
25
25
  read(path: string): Promise<AFSEntry | undefined>;
26
26
  create(entry: AFSStorageCreatePayload): Promise<AFSEntry>;
@@ -13,7 +13,7 @@ export interface AFSStorageListOptions {
13
13
  export interface AFSStorage {
14
14
  create(entry: AFSStorageCreatePayload): Promise<AFSEntry>;
15
15
  list(options?: AFSStorageListOptions): Promise<{
16
- list: AFSEntry[];
16
+ data: AFSEntry[];
17
17
  }>;
18
18
  read(path: string): Promise<AFSEntry | undefined>;
19
19
  }
@@ -1,4 +1,4 @@
1
- import type { AFSEntry, AFSListOptions, AFSModule, AFSRoot, AFSWriteEntryPayload } from "@aigne/afs";
1
+ import type { AFSListOptions, AFSListResult, AFSModule, AFSReadResult, AFSRoot, AFSWriteEntryPayload, AFSWriteResult } from "@aigne/afs";
2
2
  import { SharedAFSStorage, type SharedAFSStorageOptions } from "./storage/index.js";
3
3
  export * from "./storage/index.js";
4
4
  export interface AFSHistoryOptions {
@@ -9,15 +9,7 @@ export declare class AFSHistory implements AFSModule {
9
9
  private storage;
10
10
  readonly name: string;
11
11
  onMount(afs: AFSRoot): void;
12
- list(path: string, options?: AFSListOptions): Promise<{
13
- list: AFSEntry[];
14
- }>;
15
- read(path: string): Promise<{
16
- result: AFSEntry | undefined;
17
- message?: string;
18
- }>;
19
- write(path: string, content: AFSWriteEntryPayload): Promise<{
20
- result: AFSEntry;
21
- message?: string;
22
- }>;
12
+ list(path: string, options?: AFSListOptions): Promise<AFSListResult>;
13
+ read(path: string): Promise<AFSReadResult>;
14
+ write(path: string, content: AFSWriteEntryPayload): Promise<AFSWriteResult>;
23
15
  }
package/lib/esm/index.js CHANGED
@@ -28,15 +28,15 @@ export class AFSHistory {
28
28
  }
29
29
  async list(path, options) {
30
30
  if (path !== "/")
31
- return { list: [] };
31
+ return { data: [] };
32
32
  return await this.storage.list(options);
33
33
  }
34
34
  async read(path) {
35
- const result = await this.storage.read(path);
36
- return { result };
35
+ const data = await this.storage.read(path);
36
+ return { data };
37
37
  }
38
38
  async write(path, content) {
39
- const result = await this.storage.create({ ...content, path });
40
- return { result };
39
+ const data = await this.storage.create({ ...content, path });
40
+ return { data };
41
41
  }
42
42
  }
@@ -20,7 +20,7 @@ export declare class AFSStorageWithModule implements AFSStorage {
20
20
  private table;
21
21
  constructor(db: ReturnType<typeof initDatabase>, table: Promise<ReturnType<typeof entriesTable>>);
22
22
  list(options?: AFSStorageListOptions): Promise<{
23
- list: AFSEntry[];
23
+ data: AFSEntry[];
24
24
  }>;
25
25
  read(path: string): Promise<AFSEntry | undefined>;
26
26
  create(entry: AFSStorageCreatePayload): Promise<AFSEntry>;
@@ -28,14 +28,14 @@ export class AFSStorageWithModule {
28
28
  const { filter, limit = DEFAULT_AFS_STORAGE_LIST_LIMIT } = options;
29
29
  const db = await this.db;
30
30
  const table = await this.table;
31
- const list = await db
31
+ const data = await db
32
32
  .select()
33
33
  .from(table)
34
34
  .where(and(filter?.userId ? eq(table.userId, filter.userId) : undefined, filter?.sessionId ? eq(table.sessionId, filter.sessionId) : undefined))
35
35
  .orderBy(...(options.orderBy ?? []).map((item) => (item[1] === "asc" ? asc : desc)(sql.identifier(item[0]))))
36
36
  .limit(limit)
37
37
  .execute();
38
- return { list };
38
+ return { data };
39
39
  }
40
40
  async read(path) {
41
41
  const db = await this.db;
@@ -13,7 +13,7 @@ export interface AFSStorageListOptions {
13
13
  export interface AFSStorage {
14
14
  create(entry: AFSStorageCreatePayload): Promise<AFSEntry>;
15
15
  list(options?: AFSStorageListOptions): Promise<{
16
- list: AFSEntry[];
16
+ data: AFSEntry[];
17
17
  }>;
18
18
  read(path: string): Promise<AFSEntry | undefined>;
19
19
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aigne/afs-history",
3
- "version": "1.1.3",
3
+ "version": "1.2.0-beta.2",
4
4
  "description": "AIGNE AFS module for managing chat history",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -49,8 +49,8 @@
49
49
  "dependencies": {
50
50
  "@aigne/uuid": "^13.0.1",
51
51
  "ufo": "^1.6.1",
52
- "@aigne/afs": "^1.3.0",
53
- "@aigne/sqlite": "^0.4.8"
52
+ "@aigne/afs": "^1.4.0-beta.2",
53
+ "@aigne/sqlite": "^0.4.9-beta"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@types/bun": "^1.2.22",