koishi-plugin-chatluna-long-memory 1.3.3 → 1.3.4

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
@@ -2073,7 +2073,7 @@ var STOP_WORDS = /* @__PURE__ */ new Set([
2073
2073
  ]);
2074
2074
  function format(items) {
2075
2075
  return items.map((item) => String(item).trim().replace(/\s+/g, " ")).filter(Boolean).map(
2076
- (item) => /^[\x00-\x7F]+$/.test(item) ? item.toLowerCase() : item
2076
+ (item) => Array.from(item).every((char) => char.charCodeAt(0) <= 127) ? item.toLowerCase() : item
2077
2077
  );
2078
2078
  }
2079
2079
  __name(format, "format");
@@ -2945,36 +2945,41 @@ function buildMemoryInfo(config) {
2945
2945
  }
2946
2946
  __name(buildMemoryInfo, "buildMemoryInfo");
2947
2947
  async function apply10(ctx, config, plugin) {
2948
+ const params = { embeddings: void 0 };
2948
2949
  plugin.registerTool("memory_search", {
2950
+ description: new MemorySearchTool(ctx, params).description,
2949
2951
  selector(history) {
2950
2952
  return true;
2951
2953
  },
2952
- createTool(params) {
2953
- return new MemorySearchTool(ctx, params);
2954
+ createTool(params2) {
2955
+ return new MemorySearchTool(ctx, params2);
2954
2956
  }
2955
2957
  });
2956
2958
  plugin.registerTool("memory_add", {
2959
+ description: new MemoryAddTool(ctx, params).description,
2957
2960
  selector(history) {
2958
2961
  return true;
2959
2962
  },
2960
- createTool(params) {
2961
- return new MemoryAddTool(ctx, params);
2963
+ createTool(params2) {
2964
+ return new MemoryAddTool(ctx, params2);
2962
2965
  }
2963
2966
  });
2964
2967
  plugin.registerTool("memory_delete", {
2968
+ description: new MemoryDeleteTool(ctx, params).description,
2965
2969
  selector(history) {
2966
2970
  return true;
2967
2971
  },
2968
- createTool(params) {
2969
- return new MemoryDeleteTool(ctx, params);
2972
+ createTool(params2) {
2973
+ return new MemoryDeleteTool(ctx, params2);
2970
2974
  }
2971
2975
  });
2972
2976
  plugin.registerTool("memory_update", {
2977
+ description: new MemoryUpdateTool(ctx, params).description,
2973
2978
  selector(history) {
2974
2979
  return true;
2975
2980
  },
2976
- createTool(params) {
2977
- return new MemoryUpdateTool(ctx, params);
2981
+ createTool(params2) {
2982
+ return new MemoryUpdateTool(ctx, params2);
2978
2983
  }
2979
2984
  });
2980
2985
  }
package/lib/index.mjs CHANGED
@@ -2036,7 +2036,7 @@ var STOP_WORDS = /* @__PURE__ */ new Set([
2036
2036
  ]);
2037
2037
  function format(items) {
2038
2038
  return items.map((item) => String(item).trim().replace(/\s+/g, " ")).filter(Boolean).map(
2039
- (item) => /^[\x00-\x7F]+$/.test(item) ? item.toLowerCase() : item
2039
+ (item) => Array.from(item).every((char) => char.charCodeAt(0) <= 127) ? item.toLowerCase() : item
2040
2040
  );
2041
2041
  }
2042
2042
  __name(format, "format");
@@ -2908,36 +2908,41 @@ function buildMemoryInfo(config) {
2908
2908
  }
2909
2909
  __name(buildMemoryInfo, "buildMemoryInfo");
2910
2910
  async function apply10(ctx, config, plugin) {
2911
+ const params = { embeddings: void 0 };
2911
2912
  plugin.registerTool("memory_search", {
2913
+ description: new MemorySearchTool(ctx, params).description,
2912
2914
  selector(history) {
2913
2915
  return true;
2914
2916
  },
2915
- createTool(params) {
2916
- return new MemorySearchTool(ctx, params);
2917
+ createTool(params2) {
2918
+ return new MemorySearchTool(ctx, params2);
2917
2919
  }
2918
2920
  });
2919
2921
  plugin.registerTool("memory_add", {
2922
+ description: new MemoryAddTool(ctx, params).description,
2920
2923
  selector(history) {
2921
2924
  return true;
2922
2925
  },
2923
- createTool(params) {
2924
- return new MemoryAddTool(ctx, params);
2926
+ createTool(params2) {
2927
+ return new MemoryAddTool(ctx, params2);
2925
2928
  }
2926
2929
  });
2927
2930
  plugin.registerTool("memory_delete", {
2931
+ description: new MemoryDeleteTool(ctx, params).description,
2928
2932
  selector(history) {
2929
2933
  return true;
2930
2934
  },
2931
- createTool(params) {
2932
- return new MemoryDeleteTool(ctx, params);
2935
+ createTool(params2) {
2936
+ return new MemoryDeleteTool(ctx, params2);
2933
2937
  }
2934
2938
  });
2935
2939
  plugin.registerTool("memory_update", {
2940
+ description: new MemoryUpdateTool(ctx, params).description,
2936
2941
  selector(history) {
2937
2942
  return true;
2938
2943
  },
2939
- createTool(params) {
2940
- return new MemoryUpdateTool(ctx, params);
2944
+ createTool(params2) {
2945
+ return new MemoryUpdateTool(ctx, params2);
2941
2946
  }
2942
2947
  });
2943
2948
  }
@@ -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
- content?: string;
39
38
  type?: MemoryType;
39
+ content?: string;
40
40
  importance?: number;
41
41
  }, {
42
- content?: string;
43
42
  type?: MemoryType;
43
+ content?: string;
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
48
  layer?: ("global" | "preset" | "user" | "guild")[];
49
49
  memories?: {
50
- content?: string;
51
50
  type?: MemoryType;
51
+ content?: string;
52
52
  importance?: number;
53
53
  }[];
54
54
  }, {
55
55
  layer?: ("global" | "preset" | "user" | "guild")[];
56
56
  memories?: {
57
- content?: string;
58
57
  type?: MemoryType;
58
+ content?: string;
59
59
  importance?: number;
60
60
  }[];
61
61
  }>;
@@ -94,12 +94,12 @@ export declare class MemoryUpdateTool extends StructuredTool {
94
94
  type: z.ZodNativeEnum<typeof MemoryType>;
95
95
  importance: z.ZodNumber;
96
96
  }, "strip", z.ZodTypeAny, {
97
- content?: string;
98
97
  type?: MemoryType;
98
+ content?: string;
99
99
  importance?: number;
100
100
  }, {
101
- content?: string;
102
101
  type?: MemoryType;
102
+ content?: string;
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">;
@@ -107,16 +107,16 @@ export declare class MemoryUpdateTool extends StructuredTool {
107
107
  layer?: ("global" | "preset" | "user" | "guild")[];
108
108
  memoryIds?: string[];
109
109
  newMemories?: {
110
- content?: string;
111
110
  type?: MemoryType;
111
+ content?: string;
112
112
  importance?: number;
113
113
  }[];
114
114
  }, {
115
115
  layer?: ("global" | "preset" | "user" | "guild")[];
116
116
  memoryIds?: string[];
117
117
  newMemories?: {
118
- content?: string;
119
118
  type?: MemoryType;
119
+ content?: string;
120
120
  importance?: number;
121
121
  }[];
122
122
  }>;
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.3",
4
+ "version": "1.3.4",
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.33"
65
+ "koishi-plugin-chatluna": "^1.3.34"
66
66
  },
67
67
  "resolutions": {
68
68
  "@langchain/core": "^0.3.80",