@aigne/afs-history 1.2.0-beta.4 → 1.2.0-beta.5
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 +14 -0
- package/lib/cjs/index.d.ts +9 -3
- package/lib/cjs/index.js +195 -22
- package/lib/cjs/storage/index.d.ts +11 -5
- package/lib/cjs/storage/index.js +67 -18
- package/lib/cjs/storage/migrate.d.ts +1 -1
- package/lib/cjs/storage/migrate.js +6 -5
- package/lib/cjs/storage/migrations/003-add-compact-table.d.ts +2 -0
- package/lib/cjs/storage/migrations/003-add-compact-table.js +23 -0
- package/lib/cjs/storage/models/compact.d.ts +183 -0
- package/lib/cjs/storage/models/compact.js +27 -0
- package/lib/cjs/storage/type.d.ts +17 -2
- package/lib/dts/index.d.ts +9 -3
- package/lib/dts/storage/index.d.ts +11 -5
- package/lib/dts/storage/migrate.d.ts +1 -1
- package/lib/dts/storage/migrations/003-add-compact-table.d.ts +2 -0
- package/lib/dts/storage/models/compact.d.ts +183 -0
- package/lib/dts/storage/type.d.ts +17 -2
- package/lib/esm/index.d.ts +9 -3
- package/lib/esm/index.js +195 -22
- package/lib/esm/storage/index.d.ts +11 -5
- package/lib/esm/storage/index.js +68 -19
- package/lib/esm/storage/migrate.d.ts +1 -1
- package/lib/esm/storage/migrate.js +6 -5
- package/lib/esm/storage/migrations/003-add-compact-table.d.ts +2 -0
- package/lib/esm/storage/migrations/003-add-compact-table.js +20 -0
- package/lib/esm/storage/models/compact.d.ts +183 -0
- package/lib/esm/storage/models/compact.js +22 -0
- package/lib/esm/storage/type.d.ts +17 -2
- package/package.json +3 -2
|
@@ -1,22 +1,37 @@
|
|
|
1
1
|
import type { AFSEntry, AFSModule } from "@aigne/afs";
|
|
2
2
|
import type { SQL } from "@aigne/sqlite";
|
|
3
|
-
export interface AFSStorageCreatePayload extends
|
|
3
|
+
export interface AFSStorageCreatePayload extends AFSEntry {
|
|
4
4
|
}
|
|
5
5
|
export interface AFSStorageListOptions {
|
|
6
6
|
filter?: {
|
|
7
7
|
agentId?: string;
|
|
8
8
|
userId?: string;
|
|
9
9
|
sessionId?: string;
|
|
10
|
+
before?: Date | string;
|
|
11
|
+
after?: Date | string;
|
|
10
12
|
};
|
|
11
13
|
limit?: number;
|
|
12
14
|
orderBy?: [string, "asc" | "desc"][];
|
|
13
15
|
}
|
|
16
|
+
export interface AFSStorageReadOptions {
|
|
17
|
+
filter?: {
|
|
18
|
+
agentId?: string;
|
|
19
|
+
userId?: string;
|
|
20
|
+
sessionId?: string;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export type CompactType = "session" | "user" | "agent";
|
|
14
24
|
export interface AFSStorage {
|
|
15
25
|
create(entry: AFSStorageCreatePayload): Promise<AFSEntry>;
|
|
16
26
|
list(options?: AFSStorageListOptions): Promise<{
|
|
17
27
|
data: AFSEntry[];
|
|
18
28
|
}>;
|
|
19
|
-
read(
|
|
29
|
+
read(id: string, options?: AFSStorageReadOptions): Promise<AFSEntry | undefined>;
|
|
30
|
+
createCompact(type: CompactType, entry: AFSStorageCreatePayload): Promise<AFSEntry>;
|
|
31
|
+
listCompact(type: CompactType, options?: AFSStorageListOptions): Promise<{
|
|
32
|
+
data: AFSEntry[];
|
|
33
|
+
}>;
|
|
34
|
+
readCompact(type: CompactType, id: string, options?: AFSStorageReadOptions): Promise<AFSEntry | undefined>;
|
|
20
35
|
}
|
|
21
36
|
export type AFSStorageMigrations = {
|
|
22
37
|
hash: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aigne/afs-history",
|
|
3
|
-
"version": "1.2.0-beta.
|
|
3
|
+
"version": "1.2.0-beta.5",
|
|
4
4
|
"description": "AIGNE AFS module for managing chat history",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -48,8 +48,9 @@
|
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@aigne/uuid": "^13.0.1",
|
|
51
|
+
"radix3": "^1.1.2",
|
|
51
52
|
"ufo": "^1.6.1",
|
|
52
|
-
"@aigne/afs": "^1.4.0-beta.
|
|
53
|
+
"@aigne/afs": "^1.4.0-beta.5",
|
|
53
54
|
"@aigne/sqlite": "^0.4.9-beta"
|
|
54
55
|
},
|
|
55
56
|
"devDependencies": {
|