koishi-plugin-chatluna-long-memory 1.3.4 → 1.3.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/lib/index.cjs CHANGED
@@ -2951,6 +2951,17 @@ async function apply10(ctx, config, plugin) {
2951
2951
  selector(history) {
2952
2952
  return true;
2953
2953
  },
2954
+ meta: {
2955
+ source: "extension",
2956
+ group: "long-memory",
2957
+ tags: ["long-memory", "search"],
2958
+ defaultAvailability: {
2959
+ enabled: true,
2960
+ main: true,
2961
+ chatluna: true,
2962
+ characterScope: "none"
2963
+ }
2964
+ },
2954
2965
  createTool(params2) {
2955
2966
  return new MemorySearchTool(ctx, params2);
2956
2967
  }
@@ -2960,6 +2971,17 @@ async function apply10(ctx, config, plugin) {
2960
2971
  selector(history) {
2961
2972
  return true;
2962
2973
  },
2974
+ meta: {
2975
+ source: "extension",
2976
+ group: "long-memory",
2977
+ tags: ["long-memory", "add"],
2978
+ defaultAvailability: {
2979
+ enabled: true,
2980
+ main: true,
2981
+ chatluna: true,
2982
+ characterScope: "all"
2983
+ }
2984
+ },
2963
2985
  createTool(params2) {
2964
2986
  return new MemoryAddTool(ctx, params2);
2965
2987
  }
@@ -2969,6 +2991,17 @@ async function apply10(ctx, config, plugin) {
2969
2991
  selector(history) {
2970
2992
  return true;
2971
2993
  },
2994
+ meta: {
2995
+ source: "extension",
2996
+ group: "long-memory",
2997
+ tags: ["long-memory", "delete"],
2998
+ defaultAvailability: {
2999
+ enabled: true,
3000
+ main: true,
3001
+ chatluna: true,
3002
+ characterScope: "all"
3003
+ }
3004
+ },
2972
3005
  createTool(params2) {
2973
3006
  return new MemoryDeleteTool(ctx, params2);
2974
3007
  }
@@ -2978,6 +3011,17 @@ async function apply10(ctx, config, plugin) {
2978
3011
  selector(history) {
2979
3012
  return true;
2980
3013
  },
3014
+ meta: {
3015
+ source: "extension",
3016
+ group: "long-memory",
3017
+ tags: ["long-memory", "update"],
3018
+ defaultAvailability: {
3019
+ enabled: true,
3020
+ main: true,
3021
+ chatluna: true,
3022
+ characterScope: "all"
3023
+ }
3024
+ },
2981
3025
  createTool(params2) {
2982
3026
  return new MemoryUpdateTool(ctx, params2);
2983
3027
  }
package/lib/index.mjs CHANGED
@@ -2914,6 +2914,17 @@ async function apply10(ctx, config, plugin) {
2914
2914
  selector(history) {
2915
2915
  return true;
2916
2916
  },
2917
+ meta: {
2918
+ source: "extension",
2919
+ group: "long-memory",
2920
+ tags: ["long-memory", "search"],
2921
+ defaultAvailability: {
2922
+ enabled: true,
2923
+ main: true,
2924
+ chatluna: true,
2925
+ characterScope: "none"
2926
+ }
2927
+ },
2917
2928
  createTool(params2) {
2918
2929
  return new MemorySearchTool(ctx, params2);
2919
2930
  }
@@ -2923,6 +2934,17 @@ async function apply10(ctx, config, plugin) {
2923
2934
  selector(history) {
2924
2935
  return true;
2925
2936
  },
2937
+ meta: {
2938
+ source: "extension",
2939
+ group: "long-memory",
2940
+ tags: ["long-memory", "add"],
2941
+ defaultAvailability: {
2942
+ enabled: true,
2943
+ main: true,
2944
+ chatluna: true,
2945
+ characterScope: "all"
2946
+ }
2947
+ },
2926
2948
  createTool(params2) {
2927
2949
  return new MemoryAddTool(ctx, params2);
2928
2950
  }
@@ -2932,6 +2954,17 @@ async function apply10(ctx, config, plugin) {
2932
2954
  selector(history) {
2933
2955
  return true;
2934
2956
  },
2957
+ meta: {
2958
+ source: "extension",
2959
+ group: "long-memory",
2960
+ tags: ["long-memory", "delete"],
2961
+ defaultAvailability: {
2962
+ enabled: true,
2963
+ main: true,
2964
+ chatluna: true,
2965
+ characterScope: "all"
2966
+ }
2967
+ },
2935
2968
  createTool(params2) {
2936
2969
  return new MemoryDeleteTool(ctx, params2);
2937
2970
  }
@@ -2941,6 +2974,17 @@ async function apply10(ctx, config, plugin) {
2941
2974
  selector(history) {
2942
2975
  return true;
2943
2976
  },
2977
+ meta: {
2978
+ source: "extension",
2979
+ group: "long-memory",
2980
+ tags: ["long-memory", "update"],
2981
+ defaultAvailability: {
2982
+ enabled: true,
2983
+ main: true,
2984
+ chatluna: true,
2985
+ characterScope: "all"
2986
+ }
2987
+ },
2944
2988
  createTool(params2) {
2945
2989
  return new MemoryUpdateTool(ctx, params2);
2946
2990
  }
@@ -15,10 +15,10 @@ export declare class MemorySearchTool extends StructuredTool {
15
15
  layer: z.ZodArray<z.ZodUnion<[z.ZodLiteral<"user">, z.ZodLiteral<"preset">, z.ZodLiteral<"guild">, z.ZodLiteral<"global">]>, "many">;
16
16
  }, "strip", z.ZodTypeAny, {
17
17
  content?: string;
18
- layer?: ("global" | "preset" | "user" | "guild")[];
18
+ layer?: ("user" | "preset" | "guild" | "global")[];
19
19
  }, {
20
20
  content?: string;
21
- layer?: ("global" | "preset" | "user" | "guild")[];
21
+ layer?: ("user" | "preset" | "guild" | "global")[];
22
22
  }>;
23
23
  constructor(ctx: Context, params: CreateToolParams);
24
24
  /** @ignore */
@@ -35,27 +35,27 @@ export declare class MemoryAddTool extends StructuredTool {
35
35
  type: z.ZodNativeEnum<typeof MemoryType>;
36
36
  importance: z.ZodNumber;
37
37
  }, "strip", z.ZodTypeAny, {
38
- type?: MemoryType;
39
38
  content?: string;
39
+ type?: MemoryType;
40
40
  importance?: number;
41
41
  }, {
42
- type?: MemoryType;
43
42
  content?: string;
43
+ type?: MemoryType;
44
44
  importance?: number;
45
45
  }>, "many">;
46
46
  layer: z.ZodArray<z.ZodUnion<[z.ZodLiteral<"user">, z.ZodLiteral<"preset">, z.ZodLiteral<"guild">, z.ZodLiteral<"global">]>, "many">;
47
47
  }, "strip", z.ZodTypeAny, {
48
- layer?: ("global" | "preset" | "user" | "guild")[];
48
+ layer?: ("user" | "preset" | "guild" | "global")[];
49
49
  memories?: {
50
- type?: MemoryType;
51
50
  content?: string;
51
+ type?: MemoryType;
52
52
  importance?: number;
53
53
  }[];
54
54
  }, {
55
- layer?: ("global" | "preset" | "user" | "guild")[];
55
+ layer?: ("user" | "preset" | "guild" | "global")[];
56
56
  memories?: {
57
- type?: MemoryType;
58
57
  content?: string;
58
+ type?: MemoryType;
59
59
  importance?: number;
60
60
  }[];
61
61
  }>;
@@ -72,10 +72,10 @@ export declare class MemoryDeleteTool extends StructuredTool {
72
72
  memoryIds: z.ZodArray<z.ZodString, "many">;
73
73
  layer: z.ZodArray<z.ZodUnion<[z.ZodLiteral<"user">, z.ZodLiteral<"preset">, z.ZodLiteral<"guild">, z.ZodLiteral<"global">]>, "many">;
74
74
  }, "strip", z.ZodTypeAny, {
75
- layer?: ("global" | "preset" | "user" | "guild")[];
75
+ layer?: ("user" | "preset" | "guild" | "global")[];
76
76
  memoryIds?: string[];
77
77
  }, {
78
- layer?: ("global" | "preset" | "user" | "guild")[];
78
+ layer?: ("user" | "preset" | "guild" | "global")[];
79
79
  memoryIds?: string[];
80
80
  }>;
81
81
  constructor(ctx: Context, params: CreateToolParams);
@@ -94,29 +94,29 @@ export declare class MemoryUpdateTool extends StructuredTool {
94
94
  type: z.ZodNativeEnum<typeof MemoryType>;
95
95
  importance: z.ZodNumber;
96
96
  }, "strip", z.ZodTypeAny, {
97
- type?: MemoryType;
98
97
  content?: string;
98
+ type?: MemoryType;
99
99
  importance?: number;
100
100
  }, {
101
- type?: MemoryType;
102
101
  content?: string;
102
+ type?: MemoryType;
103
103
  importance?: number;
104
104
  }>, "many">;
105
105
  layer: z.ZodArray<z.ZodUnion<[z.ZodLiteral<"user">, z.ZodLiteral<"preset">, z.ZodLiteral<"guild">, z.ZodLiteral<"global">]>, "many">;
106
106
  }, "strip", z.ZodTypeAny, {
107
- layer?: ("global" | "preset" | "user" | "guild")[];
107
+ layer?: ("user" | "preset" | "guild" | "global")[];
108
108
  memoryIds?: string[];
109
109
  newMemories?: {
110
- type?: MemoryType;
111
110
  content?: string;
111
+ type?: MemoryType;
112
112
  importance?: number;
113
113
  }[];
114
114
  }, {
115
- layer?: ("global" | "preset" | "user" | "guild")[];
115
+ layer?: ("user" | "preset" | "guild" | "global")[];
116
116
  memoryIds?: string[];
117
117
  newMemories?: {
118
- type?: MemoryType;
119
118
  content?: string;
119
+ type?: MemoryType;
120
120
  importance?: number;
121
121
  }[];
122
122
  }>;
@@ -0,0 +1,14 @@
1
+ import { Context, Session } from 'koishi';
2
+ export declare function getMemoryScope(ctx: Context, session: Session, options: {
3
+ conversationId?: string;
4
+ presetLane?: string;
5
+ type?: string;
6
+ }): Promise<{
7
+ conversation: Parameters<Context['chatluna']['clearCache']>[0];
8
+ preset: string;
9
+ info: {
10
+ presetId: string;
11
+ guildId: string;
12
+ userId: string;
13
+ };
14
+ } | null>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-chatluna-long-memory",
3
3
  "description": "long memory for chatluna",
4
- "version": "1.3.4",
4
+ "version": "1.3.5",
5
5
  "main": "lib/index.cjs",
6
6
  "module": "lib/index.mjs",
7
7
  "typings": "lib/index.d.ts",
@@ -62,7 +62,7 @@
62
62
  },
63
63
  "peerDependencies": {
64
64
  "koishi": "^4.18.9",
65
- "koishi-plugin-chatluna": "^1.3.34"
65
+ "koishi-plugin-chatluna": "^1.3.36"
66
66
  },
67
67
  "resolutions": {
68
68
  "@langchain/core": "^0.3.80",