koishi-plugin-chatluna-affinity 0.3.0 → 0.3.1

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.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import * as koishi from 'koishi';
1
+ import * as cosmokit from 'cosmokit';
2
2
  import { Schema, Session, Context } from 'koishi';
3
3
  import { CharacterServiceLike as CharacterServiceLike$1, TempLike, CompletionMessagesLike } from 'shared-chatluna-xmltools';
4
4
 
@@ -193,7 +193,7 @@ declare const RelationshipSchema: Schema<Schemastery.ObjectS<{
193
193
  userId?: string | null | undefined;
194
194
  relation?: string | null | undefined;
195
195
  note?: string | null | undefined;
196
- } & koishi.Dict)[], Schemastery.ObjectT<{
196
+ } & cosmokit.Dict)[], Schemastery.ObjectT<{
197
197
  userId: Schema<string, string>;
198
198
  relation: Schema<string, string>;
199
199
  note: Schema<string, string>;
@@ -203,7 +203,7 @@ declare const RelationshipSchema: Schema<Schemastery.ObjectS<{
203
203
  max?: number | null | undefined;
204
204
  relation?: string | null | undefined;
205
205
  note?: string | null | undefined;
206
- } & koishi.Dict)[], Schemastery.ObjectT<{
206
+ } & cosmokit.Dict)[], Schemastery.ObjectT<{
207
207
  min: Schema<number, number>;
208
208
  max: Schema<number, number>;
209
209
  relation: Schema<string, string>;
@@ -214,7 +214,7 @@ declare const RelationshipSchema: Schema<Schemastery.ObjectS<{
214
214
  userId?: string | null | undefined;
215
215
  relation?: string | null | undefined;
216
216
  note?: string | null | undefined;
217
- } & koishi.Dict)[], Schemastery.ObjectT<{
217
+ } & cosmokit.Dict)[], Schemastery.ObjectT<{
218
218
  userId: Schema<string, string>;
219
219
  relation: Schema<string, string>;
220
220
  note: Schema<string, string>;
@@ -224,7 +224,7 @@ declare const RelationshipSchema: Schema<Schemastery.ObjectS<{
224
224
  max?: number | null | undefined;
225
225
  relation?: string | null | undefined;
226
226
  note?: string | null | undefined;
227
- } & koishi.Dict)[], Schemastery.ObjectT<{
227
+ } & cosmokit.Dict)[], Schemastery.ObjectT<{
228
228
  min: Schema<number, number>;
229
229
  max: Schema<number, number>;
230
230
  relation: Schema<string, string>;
@@ -267,24 +267,24 @@ declare const ConfigSchema: Schema<{
267
267
  demoteThreshold?: number | null | undefined;
268
268
  longTermPromoteStep?: number | null | undefined;
269
269
  longTermDemoteStep?: number | null | undefined;
270
- } & koishi.Dict) | null | undefined;
270
+ } & cosmokit.Dict) | null | undefined;
271
271
  actionWindow?: ({
272
272
  windowHours?: number | null | undefined;
273
273
  increaseBonus?: number | null | undefined;
274
274
  decreaseBonus?: number | null | undefined;
275
275
  bonusChatThreshold?: number | null | undefined;
276
276
  maxEntries?: number | null | undefined;
277
- } & koishi.Dict) | null | undefined;
277
+ } & cosmokit.Dict) | null | undefined;
278
278
  coefficient?: ({
279
279
  base?: number | null | undefined;
280
280
  maxDrop?: number | null | undefined;
281
281
  maxBoost?: number | null | undefined;
282
282
  decayPerDay?: number | null | undefined;
283
283
  boostPerDay?: number | null | undefined;
284
- } & koishi.Dict) | null | undefined;
285
- } & koishi.Dict) | null | undefined;
284
+ } & cosmokit.Dict) | null | undefined;
285
+ } & cosmokit.Dict) | null | undefined;
286
286
  rankDefaultLimit?: number | null | undefined;
287
- } & koishi.Dict & {
287
+ } & cosmokit.Dict & {
288
288
  blacklistLogInterception?: boolean | null | undefined;
289
289
  shortTermBlacklistPenalty?: number | null | undefined;
290
290
  unblockPermanentInitialAffinity?: number | null | undefined;
@@ -294,13 +294,13 @@ declare const ConfigSchema: Schema<{
294
294
  userId?: string | null | undefined;
295
295
  relation?: string | null | undefined;
296
296
  note?: string | null | undefined;
297
- } & koishi.Dict)[] | null | undefined;
297
+ } & cosmokit.Dict)[] | null | undefined;
298
298
  relationshipAffinityLevels?: ({
299
299
  min?: number | null | undefined;
300
300
  max?: number | null | undefined;
301
301
  relation?: string | null | undefined;
302
302
  note?: string | null | undefined;
303
- } & koishi.Dict)[] | null | undefined;
303
+ } & cosmokit.Dict)[] | null | undefined;
304
304
  } & {
305
305
  scopeId?: string | null | undefined;
306
306
  botSelfIds?: string[] | null | undefined;
@@ -367,7 +367,7 @@ declare const ConfigSchema: Schema<{
367
367
  }>>;
368
368
  }>;
369
369
  rankDefaultLimit: number;
370
- } & koishi.Dict & {
370
+ } & cosmokit.Dict & {
371
371
  blacklistLogInterception: boolean;
372
372
  shortTermBlacklistPenalty: number;
373
373
  unblockPermanentInitialAffinity: number;
@@ -1808,6 +1808,6 @@ declare function callOneBotAPI(internal: OneBotInternal, action: string, params:
1808
1808
  * 导出插件元信息和 apply 函数
1809
1809
  */
1810
1810
 
1811
- declare const usage = "\n## \u66F4\u65B0\u65E5\u5FD7\n\n0.3.0\n\n### \u91CD\u6784\n- \u5F15\u5165 `scopeId` \u4F5C\u4E3A\u65B0\u7684\u6838\u5FC3\u4F5C\u7528\u57DF\u8BED\u4E49\uFF1B\u6570\u636E\u9694\u79BB\u4ECE\u65E7\u7248\u6309 bot / \u65E7\u4E3B\u952E\u5207\u6362\u4E3A\u6309 `scopeId` \u9694\u79BB\u3002\n- \u5355\u4E2A\u5B9E\u4F8B\u5185\u7684\u591A\u4E2A bot \u73B0\u5728\u5171\u4EAB\u540C\u4E00\u4EFD `scopeId` \u6570\u636E\uFF1B\u5171\u4EAB\u8303\u56F4\u8986\u76D6\u597D\u611F\u5EA6\u3001\u9ED1\u540D\u5355\u3001\u7279\u6B8A\u5173\u7CFB\u4E0E\u6635\u79F0\u3002\n- \u6570\u636E\u5E93\u6A21\u578B\u5347\u7EA7\u4E3A v2\uFF1A\n - `chatluna_affinity` -> `chatluna_affinity_v2`\n - `chatluna_blacklist` -> `chatluna_blacklist_v2`\n - `chatluna_user_alias` -> `chatluna_user_alias_v2`\n- \u65B0\u589E\u6570\u636E\u5E93\u8FC1\u79FB\u670D\u52A1\u4E0E\u8FC1\u79FB\u8BB0\u5F55\u8868\uFF0C\u542F\u52A8\u65F6\u4F1A\u81EA\u52A8\u5C06\u65E7\u8868\u8FC1\u79FB\u5230 v2 \u7ED3\u6784\u3002\n- \u597D\u611F\u5EA6\u3001\u9ED1\u540D\u5355\u4E0E\u6A21\u578B\u54CD\u5E94\u5904\u7406\u94FE\u8DEF\u91CD\u6784\u4E3A\u66F4\u6E05\u6670\u7684\u670D\u52A1\u5316\u7ED3\u6784\u3002\n\n### \u65B0\u589E\n- \u65B0\u589E `scopeId` \u914D\u7F6E\uFF1B\u5F53\u524D\u7248\u672C\u6309 `scopeId` \u533A\u5206\u6570\u636E\uFF0C\u4E0D\u540C\u5B9E\u4F8B\u4E4B\u95F4\u5B8C\u5168\u9694\u79BB\u3002\n- \u65B0\u589E `botSelfIds` \u914D\u7F6E\uFF0C\u7528\u4E8E\u58F0\u660E\u54EA\u4E9B bot \u5F52\u5C5E\u5F53\u524D `scopeId`\uFF1B\u540C\u4E00 `scopeId` \u4E0B\u591A\u4E2A bot \u5171\u4EAB\u6570\u636E\uFF0C\u7528\u4E8E\u9996\u6B21\u4E92\u52A8\u521D\u59CB\u5316\u597D\u611F\u5EA6\u3002\n- \u65B0\u589E\u4F5C\u7528\u57DF\u5316\u547D\u4EE4\u524D\u7F00\uFF0C\u547D\u4EE4\u7531\u56FA\u5B9A `affinity.*` \u6539\u4E3A `${scopeId}.*`\u3002\n- \u65B0\u589E\u6C38\u4E45\u9ED1\u540D\u5355\u89E3\u9664\u540E\u7684\u597D\u611F\u5EA6\u91CD\u7F6E\u903B\u8F91\uFF1B\u89E3\u9664\u540E\u4F1A\u540C\u65F6\u91CD\u7F6E\u597D\u611F\u5EA6\u76F8\u5173\u72B6\u6001\u3002\n- \u65B0\u589E\u4F5C\u7528\u57DF\u5316\u53D8\u91CF\u8C03\u7528\u8981\u6C42\uFF0C\u53D8\u91CF\u73B0\u5728\u9700\u8981\u663E\u5F0F\u4F20\u5165 `scopeId`\u3002\n- \u65B0\u589E `affinity` \u53D8\u91CF\u7684 `chatcount` \u8F93\u51FA\uFF0C\u9ED8\u8BA4\u663E\u793A\u7528\u6237\u5BF9\u8BDD\u6B21\u6570\uFF0C\u53EF\u5728\u53D8\u91CF\u8BBE\u7F6E\u4E2D\u5173\u95ED\u3002\n- \u65B0\u589E `injectXmlToolAsReplyTool` \u9009\u9879\uFF0C\u53EF\u5C06 XML \u5DE5\u5177\u6CE8\u5165\u5230 ChatLuna Character \u7684\u5B9E\u9A8C\u6027\u5DE5\u5177\u8C03\u7528\u56DE\u590D\u53C2\u6570\u4E2D\u3002\n\n### \u4FEE\u6539\n- \u597D\u611F\u5EA6\u3001\u9ED1\u540D\u5355\u3001\u6635\u79F0\u6570\u636E\u7684\u5199\u5165\u4E0E\u8BFB\u53D6\u4E3B\u952E\u8BED\u4E49\u6539\u4E3A\u4EE5 `scopeId` \u4E3A\u6838\u5FC3\uFF1A\n - \u597D\u611F\u5EA6\uFF1A`scopeId + userId`\n - \u9ED1\u540D\u5355\uFF1A`scopeId + userId + mode`\n - \u7528\u6237\u6635\u79F0\uFF1A`scopeId + userId`\n- \u591A bot \u5171\u4EAB\u65B9\u6848\u4ECE\u65E7\u7248\u5206\u7EC4\u914D\u7F6E\u6539\u4E3A\u7EDF\u4E00\u7684 `scopeId` \u8BED\u4E49\u3002\n- \u597D\u611F\u5EA6\u521D\u59CB\u5316\u65F6\u673A\u6539\u4E3A\u201C\u4E0E bot \u9996\u6B21\u6709\u6548\u4EA4\u4E92\u65F6\u5165\u5E93\u201D\uFF0C\u4E0D\u518D\u5728\u6536\u5230\u6D88\u606F\u65F6\u63D0\u524D\u521D\u59CB\u5316\u3002\n- \u968F\u673A\u521D\u59CB\u597D\u611F\u5EA6\u6539\u4E3A\u56FA\u5B9A\u521D\u59CB\u597D\u611F\u5EA6\uFF0C\u9ED8\u8BA4\u503C\u4E3A `30`\u3002\n- `userAlias` \u7684\u6635\u79F0\u4FE1\u606F\u5DF2\u878D\u5165 `affinity` \u53D8\u91CF\u8F93\u51FA\uFF1B\u5F53\u524D\u8F93\u51FA\u5F62\u6001\u4E3A `id name nickname affinity relationship chatcount`\u3002\n- \u5BF9\u4E8E\u5C1A\u672A\u4E0E bot \u4EA7\u751F\u6709\u6548\u4E92\u52A8\u7684\u7528\u6237\uFF0C`affinity` \u53D8\u91CF\u73B0\u5728\u4F1A\u76F4\u63A5\u663E\u793A\u9ED8\u8BA4\u597D\u611F\u5EA6\uFF0C\u4EE5\u53CA\u8BE5\u9ED8\u8BA4\u503C\u5BF9\u5E94\u7684\u5173\u7CFB\u3002\n- \u5173\u7CFB\u533A\u95F4\u53D8\u91CF\u540D\u7531 `relationshipAffinityLevel` \u7B80\u5316\u4E3A `relationshipLevel`\u3002\n- \u6240\u6709\u53D8\u91CF\u73B0\u5728\u90FD\u9700\u8981\u663E\u5F0F\u4F20\u5165 `scopeId`\uFF0C\u4F8B\u5982\uFF1A\n - `relationshipLevel(scopeId)`\n - `affinity(scopeId)`\n - `blacklistList(scopeId)`\n- XML \u5DE5\u5177\u8C03\u7528\u53C2\u6570\u6539\u4E3A\u663E\u5F0F\u4F5C\u7528\u57DF\u98CE\u683C\uFF0C\u6838\u5FC3\u5B57\u6BB5\u7EDF\u4E00\u4E3A `scopeId + userId`\u3002\n- `scopeId` \u4F1A\u76F4\u63A5\u4F5C\u4E3A\u6307\u4EE4\u524D\u7F00\uFF1B\u4E0D\u8981\u4F7F\u7528\u4E0E bot \u540D\u79F0\u76F8\u540C\u7684 `scopeId`\uFF0C\u5EFA\u8BAE\u4F18\u5148\u4F7F\u7528\u82F1\u6587\u3002\n- \u65E5\u7A0B\u3001\u5929\u6C14\u80FD\u529B\u62C6\u5206\u81F3 `koishi-plugin-chatluna-schedule`\u3002\n- \u66F4\u591A\u53D8\u91CF\u4E0E XML \u5DE5\u5177\u80FD\u529B\u62C6\u5206\u81F3 `koishi-plugin-chatluna-toolbox`\u3002\n\n### \u5220\u9664\n- \u5220\u9664 ChatLuna \u539F\u751F\u5DE5\u5177\u6CE8\u518C\u80FD\u529B\uFF0C\u5F53\u524D\u7248\u672C\u4E0D\u518D\u63D0\u4F9B\u539F\u751F\u5DE5\u5177\u3002\n- \u5220\u9664\u65E7\u7248 `affinityGroups` \u5171\u4EAB\u5206\u7EC4\u914D\u7F6E\u3002\n- \u5220\u9664\u56FA\u5B9A\u547D\u4EE4\u524D\u7F00 `affinity.*` \u7684\u547D\u540D\u65B9\u5F0F\u3002\n- \u5220\u9664 `relationshipAffinityLevel` \u65E7\u547D\u540D\u3002\n- \u5220\u9664\u4EE5\u4E0B\u52A8\u6001\u914D\u7F6E\u9879\uFF1A\n - \u5355\u6B21\u589E\u52A0\u7684\u77ED\u671F\u597D\u611F\u6700\u5927\u5E45\u5EA6\n - \u5355\u6B21\u51CF\u5C11\u7684\u77ED\u671F\u597D\u611F\u6700\u5927\u5E45\u5EA6\n - \u5141\u8BB8\u989D\u5916\u589E\u51CF\u7A81\u7834\u5355\u6B21\u4E0A\u9650\n- `userAlias` \u4E0D\u518D\u4F5C\u4E3A\u72EC\u7ACB\u53D8\u91CF\u66B4\u9732\uFF1B\u6635\u79F0\u80FD\u529B\u4FDD\u7559\u5728 XML \u4E0E `affinity` \u53D8\u91CF\u8F93\u51FA\u4E2D\u3002\n\n### \u517C\u5BB9\u6027\u63D0\u9192\n- \u8FD9\u662F\u4E00\u6B21\u5E26\u6709\u7834\u574F\u6027\u517C\u5BB9\u53D8\u66F4\u7684\u91CD\u6784\u5347\u7EA7\uFF1B\u65E7\u547D\u4EE4\u3001\u65E7 XML \u53C2\u6570\u548C\u65E7\u53D8\u91CF\u8C03\u7528\u65B9\u5F0F\u90FD\u9700\u8981\u540C\u6B65\u8C03\u6574\u3002\n- \u8FC1\u79FB\u4F1A\u628A\u65E7\u6570\u636E\u6574\u4F53\u5F52\u5165\u5F53\u524D\u5B9E\u4F8B\u7684 `scopeId`\uFF0C\u4E0D\u4F1A\u81EA\u52A8\u62C6\u5206\u4E3A\u591A\u4E2A\u4F5C\u7528\u57DF\u3002\n";
1811
+ declare const usage = "\n## \u4F7F\u7528\u8BF4\u660E\n\n\u9996\u6B21\u4F7F\u7528\u524D\u8BF7\u5148\u9605\u8BFB [readme.md](https://github.com/Sor85/AAAAACAT-chatluna-plugins/blob/main/plugins/chatluna-affinity/readme.md)\uFF0C\u6309\u6587\u6863\u5B8C\u6210\u4F9D\u8D56\u5B89\u88C5\u3001`scopeId` \u914D\u7F6E\u3001\u53D8\u91CF\u6CE8\u5165\u548C XML \u5DE5\u5177\u63A5\u5165\u3002\n\n\u5982\u679C\u4F60\u4E3B\u8981\u5728 ChatLuna Character \u4E2D\u4F7F\u7528\u672C\u63D2\u4EF6\uFF0C\u8BF7\u4F18\u5148\u67E5\u770B readme.md \u4E2D\u7684\u201C\u5FEB\u901F\u4E0A\u624B\u201D\u548C\u201C\u53D8\u91CF\u201D\u7AE0\u8282\u3002\n\n## \u66F4\u65B0\u65E5\u5FD7\n\n0.3.0\n\n### \u91CD\u6784\n- \u5F15\u5165 `scopeId` \u4F5C\u4E3A\u65B0\u7684\u6838\u5FC3\u4F5C\u7528\u57DF\u8BED\u4E49\uFF1B\u6570\u636E\u9694\u79BB\u4ECE\u65E7\u7248\u6309 bot / \u65E7\u4E3B\u952E\u5207\u6362\u4E3A\u6309 `scopeId` \u9694\u79BB\u3002\n- \u5355\u4E2A\u5B9E\u4F8B\u5185\u7684\u591A\u4E2A bot \u73B0\u5728\u5171\u4EAB\u540C\u4E00\u4EFD `scopeId` \u6570\u636E\uFF1B\u5171\u4EAB\u8303\u56F4\u8986\u76D6\u597D\u611F\u5EA6\u3001\u9ED1\u540D\u5355\u3001\u7279\u6B8A\u5173\u7CFB\u4E0E\u6635\u79F0\u3002\n- \u6570\u636E\u5E93\u6A21\u578B\u5347\u7EA7\u4E3A v2\uFF1A\n - `chatluna_affinity` -> `chatluna_affinity_v2`\n - `chatluna_blacklist` -> `chatluna_blacklist_v2`\n - `chatluna_user_alias` -> `chatluna_user_alias_v2`\n- \u65B0\u589E\u6570\u636E\u5E93\u8FC1\u79FB\u670D\u52A1\u4E0E\u8FC1\u79FB\u8BB0\u5F55\u8868\uFF0C\u542F\u52A8\u65F6\u4F1A\u81EA\u52A8\u5C06\u65E7\u8868\u8FC1\u79FB\u5230 v2 \u7ED3\u6784\u3002\n- \u597D\u611F\u5EA6\u3001\u9ED1\u540D\u5355\u4E0E\u6A21\u578B\u54CD\u5E94\u5904\u7406\u94FE\u8DEF\u91CD\u6784\u4E3A\u66F4\u6E05\u6670\u7684\u670D\u52A1\u5316\u7ED3\u6784\u3002\n\n### \u65B0\u589E\n- \u65B0\u589E `scopeId` \u914D\u7F6E\uFF1B\u5F53\u524D\u7248\u672C\u6309 `scopeId` \u533A\u5206\u6570\u636E\uFF0C\u4E0D\u540C\u5B9E\u4F8B\u4E4B\u95F4\u5B8C\u5168\u9694\u79BB\u3002\n- \u65B0\u589E `botSelfIds` \u914D\u7F6E\uFF0C\u7528\u4E8E\u58F0\u660E\u54EA\u4E9B bot \u5F52\u5C5E\u5F53\u524D `scopeId`\uFF1B\u540C\u4E00 `scopeId` \u4E0B\u591A\u4E2A bot \u5171\u4EAB\u6570\u636E\uFF0C\u7528\u4E8E\u9996\u6B21\u4E92\u52A8\u521D\u59CB\u5316\u597D\u611F\u5EA6\u3002\n- \u65B0\u589E\u4F5C\u7528\u57DF\u5316\u547D\u4EE4\u524D\u7F00\uFF0C\u547D\u4EE4\u7531\u56FA\u5B9A `affinity.*` \u6539\u4E3A `${scopeId}.*`\u3002\n- \u65B0\u589E\u6C38\u4E45\u9ED1\u540D\u5355\u89E3\u9664\u540E\u7684\u597D\u611F\u5EA6\u91CD\u7F6E\u903B\u8F91\uFF1B\u89E3\u9664\u540E\u4F1A\u540C\u65F6\u91CD\u7F6E\u597D\u611F\u5EA6\u76F8\u5173\u72B6\u6001\u3002\n- \u65B0\u589E\u4F5C\u7528\u57DF\u5316\u53D8\u91CF\u8C03\u7528\u8981\u6C42\uFF0C\u53D8\u91CF\u73B0\u5728\u9700\u8981\u663E\u5F0F\u4F20\u5165 `scopeId`\u3002\n- \u65B0\u589E `affinity` \u53D8\u91CF\u7684 `chatcount` \u8F93\u51FA\uFF0C\u9ED8\u8BA4\u663E\u793A\u7528\u6237\u5BF9\u8BDD\u6B21\u6570\uFF0C\u53EF\u5728\u53D8\u91CF\u8BBE\u7F6E\u4E2D\u5173\u95ED\u3002\n- \u65B0\u589E `injectXmlToolAsReplyTool` \u9009\u9879\uFF0C\u53EF\u5C06 XML \u5DE5\u5177\u6CE8\u5165\u5230 ChatLuna Character \u7684\u5B9E\u9A8C\u6027\u5DE5\u5177\u8C03\u7528\u56DE\u590D\u53C2\u6570\u4E2D\u3002\n\n### \u4FEE\u6539\n- \u597D\u611F\u5EA6\u3001\u9ED1\u540D\u5355\u3001\u6635\u79F0\u6570\u636E\u7684\u5199\u5165\u4E0E\u8BFB\u53D6\u4E3B\u952E\u8BED\u4E49\u6539\u4E3A\u4EE5 `scopeId` \u4E3A\u6838\u5FC3\uFF1A\n - \u597D\u611F\u5EA6\uFF1A`scopeId + userId`\n - \u9ED1\u540D\u5355\uFF1A`scopeId + userId + mode`\n - \u7528\u6237\u6635\u79F0\uFF1A`scopeId + userId`\n- \u591A bot \u5171\u4EAB\u65B9\u6848\u4ECE\u65E7\u7248\u5206\u7EC4\u914D\u7F6E\u6539\u4E3A\u7EDF\u4E00\u7684 `scopeId` \u8BED\u4E49\u3002\n- \u597D\u611F\u5EA6\u521D\u59CB\u5316\u65F6\u673A\u6539\u4E3A\u201C\u4E0E bot \u9996\u6B21\u6709\u6548\u4EA4\u4E92\u65F6\u5165\u5E93\u201D\uFF0C\u4E0D\u518D\u5728\u6536\u5230\u6D88\u606F\u65F6\u63D0\u524D\u521D\u59CB\u5316\u3002\n- \u968F\u673A\u521D\u59CB\u597D\u611F\u5EA6\u6539\u4E3A\u56FA\u5B9A\u521D\u59CB\u597D\u611F\u5EA6\uFF0C\u9ED8\u8BA4\u503C\u4E3A `30`\u3002\n- `userAlias` \u7684\u6635\u79F0\u4FE1\u606F\u5DF2\u878D\u5165 `affinity` \u53D8\u91CF\u8F93\u51FA\uFF1B\u5F53\u524D\u8F93\u51FA\u5F62\u6001\u4E3A `id name nickname affinity relationship chatcount`\u3002\n- \u5BF9\u4E8E\u5C1A\u672A\u4E0E bot \u4EA7\u751F\u6709\u6548\u4E92\u52A8\u7684\u7528\u6237\uFF0C`affinity` \u53D8\u91CF\u73B0\u5728\u4F1A\u76F4\u63A5\u663E\u793A\u9ED8\u8BA4\u597D\u611F\u5EA6\uFF0C\u4EE5\u53CA\u8BE5\u9ED8\u8BA4\u503C\u5BF9\u5E94\u7684\u5173\u7CFB\u3002\n- \u5173\u7CFB\u533A\u95F4\u53D8\u91CF\u540D\u7531 `relationshipAffinityLevel` \u7B80\u5316\u4E3A `relationshipLevel`\u3002\n- \u6240\u6709\u53D8\u91CF\u73B0\u5728\u90FD\u9700\u8981\u663E\u5F0F\u4F20\u5165 `scopeId`\uFF0C\u4F8B\u5982\uFF1A\n - `relationshipLevel(scopeId)`\n - `affinity(scopeId)`\n - `blacklistList(scopeId)`\n- XML \u5DE5\u5177\u8C03\u7528\u53C2\u6570\u6539\u4E3A\u663E\u5F0F\u4F5C\u7528\u57DF\u98CE\u683C\uFF0C\u6838\u5FC3\u5B57\u6BB5\u7EDF\u4E00\u4E3A `scopeId + userId`\u3002\n- `scopeId` \u4F1A\u76F4\u63A5\u4F5C\u4E3A\u6307\u4EE4\u524D\u7F00\uFF1B\u4E0D\u8981\u4F7F\u7528\u4E0E bot \u540D\u79F0\u76F8\u540C\u7684 `scopeId`\uFF0C\u5EFA\u8BAE\u4F18\u5148\u4F7F\u7528\u82F1\u6587\u3002\n- \u65E5\u7A0B\u3001\u5929\u6C14\u80FD\u529B\u62C6\u5206\u81F3 `koishi-plugin-chatluna-schedule`\u3002\n- \u66F4\u591A\u53D8\u91CF\u4E0E XML \u5DE5\u5177\u80FD\u529B\u62C6\u5206\u81F3 `koishi-plugin-chatluna-toolbox`\u3002\n\n### \u5220\u9664\n- \u5220\u9664 ChatLuna \u539F\u751F\u5DE5\u5177\u6CE8\u518C\u80FD\u529B\uFF0C\u5F53\u524D\u7248\u672C\u4E0D\u518D\u63D0\u4F9B\u539F\u751F\u5DE5\u5177\u3002\n- \u5220\u9664\u65E7\u7248 `affinityGroups` \u5171\u4EAB\u5206\u7EC4\u914D\u7F6E\u3002\n- \u5220\u9664\u56FA\u5B9A\u547D\u4EE4\u524D\u7F00 `affinity.*` \u7684\u547D\u540D\u65B9\u5F0F\u3002\n- \u5220\u9664 `relationshipAffinityLevel` \u65E7\u547D\u540D\u3002\n- \u5220\u9664\u4EE5\u4E0B\u52A8\u6001\u914D\u7F6E\u9879\uFF1A\n - \u5355\u6B21\u589E\u52A0\u7684\u77ED\u671F\u597D\u611F\u6700\u5927\u5E45\u5EA6\n - \u5355\u6B21\u51CF\u5C11\u7684\u77ED\u671F\u597D\u611F\u6700\u5927\u5E45\u5EA6\n - \u5141\u8BB8\u989D\u5916\u589E\u51CF\u7A81\u7834\u5355\u6B21\u4E0A\u9650\n- `userAlias` \u4E0D\u518D\u4F5C\u4E3A\u72EC\u7ACB\u53D8\u91CF\u66B4\u9732\uFF1B\u6635\u79F0\u80FD\u529B\u4FDD\u7559\u5728 XML \u4E0E `affinity` \u53D8\u91CF\u8F93\u51FA\u4E2D\u3002\n\n### \u517C\u5BB9\u6027\u63D0\u9192\n- \u8FD9\u662F\u4E00\u6B21\u5E26\u6709\u7834\u574F\u6027\u517C\u5BB9\u53D8\u66F4\u7684\u91CD\u6784\u5347\u7EA7\uFF1B\u65E7\u547D\u4EE4\u3001\u65E7 XML \u53C2\u6570\u548C\u65E7\u53D8\u91CF\u8C03\u7528\u65B9\u5F0F\u90FD\u9700\u8981\u540C\u6B65\u8C03\u6574\u3002\n- \u8FC1\u79FB\u4F1A\u628A\u65E7\u6570\u636E\u6574\u4F53\u5F52\u5165\u5F53\u524D\u5B9E\u4F8B\u7684 `scopeId`\uFF0C\u4E0D\u4F1A\u81EA\u52A8\u62C6\u5206\u4E3A\u591A\u4E2A\u4F5C\u7528\u57DF\u3002\n";
1812
1812
 
1813
1813
  export { ACTION_WINDOW_DEFAULTS, AFFINITY_DEFAULTS, AFFINITY_DYNAMICS_DEFAULTS, ALL_MEMBER_INFO_ITEMS, type ActionCounts, type ActionEntry, type ActionStats, type ActionType, type ActionWindowConfig, type AffinityCache, type AffinityDynamicsConfig, type AffinityProvider, type AffinityProviderDeps, type AffinityRecord, AffinitySchema, type AffinityState, type AffinityStore, type AffinityStoreOptions, type ApplyAffinityDeltaParams, type ApplyAffinityDeltaResult, BASE_AFFINITY_DEFAULTS, BLACKLIST_MODEL_NAME, BLACKLIST_MODEL_NAME_V2, BLACKLIST_REPLY_TEMPLATE, type BlacklistCommandDeps, type BlacklistDetail, type BlacklistEnrichedItem, type BlacklistEntry, type BlacklistGuard, type BlacklistGuardOptions, type BlacklistItem, type BlacklistListProvider, type BlacklistListProviderDeps, type BlacklistMode, type BlacklistRecord, type BlacklistRenderer, BlacklistSchema, type BlacklistService, type BlacklistServiceOptions, type BlockCommandDeps, CLOUD_TYPES, COEFFICIENT_DEFAULTS, COMMON_STYLE, type CharacterTempModelResponseRuntime, type CharacterTempModelResponseRuntimeParams, type ClampFn, type CoefficientConfig, type CoefficientResult, type CoefficientState, type CombinedState, type CommandDependencies, ConfigSchema as Config, ConfigSchema, DEFAULT_MEMBER_INFO_ITEMS, type Element, FETCH_CONSTANTS, type HistoryEntry, type InMemoryTemporaryEntry, type InitialRange, type InspectData, type InspectRenderer, type LegacyAffinityRecord, type LegacyBlacklistRecord, type LegacyUserAliasRecord, type LevelResolver, type LogFn, type LogLevel, MIGRATION_MODEL_NAME, MODEL_NAME, MODEL_NAME_V2, type ManualConfigOptions, type ManualRelationship, type ManualRelationshipManager, type MemberInfo, type MemberInfoField, type MessageHistory, type MessageHistoryOptions, type MessageStore, type MessageStoreOptions, type MigrationOptions, type MigrationRecord, type ModelResponseContext, type ModelResponseProcessorParams, type OneBotInternal, type OneBotProtocol, OtherSettingsSchema, type Page, type Puppeteer, RENDER_CONSTANTS, ROLE_MAPPING, type RankItem, type RankLineItem, type RankListRenderer, type RelationshipLevel, type RelationshipLevelProvider, type RelationshipLevelProviderDeps, RelationshipSchema, type RenderMemberInfoOptions, type RenderOptions, type RenderService, type RenderServiceOptions, type ResolvedActionWindowConfig, type ResolvedCoefficientConfig, type ResolvedShortTermConfig, type RoleMapping, type RoleTranslation, SHORT_TERM_DEFAULTS, type SaveExtra, type SessionSeed, type ShortTermConfig, type StoredMessage, type SummarizedActions, THRESHOLDS, TIME_CONSTANTS, TIMING_CONSTANTS, type TableRenderOptions, type TableRenderer, type TempBlockCommandDeps, type TemporaryBlacklistEntry, USER_ALIAS_MODEL_NAME, USER_ALIAS_MODEL_NAME_V2, type UnblockPermanentDeps, type UnblockPermanentInput, type UnblockPermanentResult, type UserAliasRecord, type UserAliasService, type UserAliasServiceOptions, type VariableSettings, type XmlToolSettings, appendActionEntry, apply, applyAffinityDelta, assertScopeId, buildScopedCommandName, callOneBotAPI, clamp, clampFloat, collectNicknameCandidates, collectRoleCandidates, composeState, computeCoefficientValue, computeDailyStreak, computeShortTermReset, createAffinityCache, createAffinityProvider, createAffinityStore, createBlacklistGuard, createBlacklistListProvider, createBlacklistRenderer, createBlacklistService, createCharacterTempModelResponseRuntime, createInspectRenderer, createLevelResolver, createLogger, createManualRelationshipManager, createMessageHistory, createMessageStore, createMigrationService, createModelResponseProcessor, createPermanentUnblockHandler, createRankListRenderer, createRelationshipLevelProvider, createRenderService, createTableRenderer, createUserAliasService, dayNumber, ensureOneBotSession, escapeHtml, escapeHtmlForRender, extendAffinityModel, extendBlacklistModel, extendMigrationModel, extendUserAliasModel, fetchGroupMemberIds, fetchMember, findMemberByName, formatActionCounts, formatBeijingTimestamp, formatDateOnly, formatDateTime, formatTimestamp, getChannelId, getDateString, getGuildId, getPlatform, getPuppeteer, getRoleDisplay, getSelfId, getTimeString, getUserId, hasReplyToolsEnabled, inject, isFiniteNumber, isValidScopeId, makeUserKey, name, normalizeScopeId, normalizeTimestamp, pickFirst, registerAdjustCommand, registerBlacklistCommand, registerBlockCommand, registerCharacterReplyTools, registerClearAllCommand, registerInspectCommand, registerModels, registerRankCommand, registerTempBlockCommand, renderHtml, renderInfoField, renderMemberInfo, renderTemplate, resolveActionWindowConfig, resolveBotInfo, resolveCoefficientConfig, resolveGroupId, resolveRoleLabel, resolveScopedVariableArgs, resolveShortTermConfig, resolveUserIdentity, resolveUserInfo, resolveXmlScopeId, roundTo, sanitizeChannel, stripAtPrefix, summarizeActionEntries, toDate, translateGender, translateRole, truncate, usage };
package/lib/index.js CHANGED
@@ -844,7 +844,7 @@ var XmlToolSettingsSchema = import_koishi4.Schema.object({
844
844
  <userAlias scopeId="{scopeId}" userId="123456" name="\u5C0F\u7965"/>
845
845
  </actions>
846
846
  \`\`\``
847
- ).description("\u6A21\u578B\u56DE\u590D XML \u53C2\u8003\u63D0\u793A\u8BCD\uFF0C\u5C06 {scopeId} \u66FF\u6362\u4E3A\u5B9E\u9645 scopeId\uFF0C\u5E76\u81EA\u884C\u5199\u5165\u63D0\u793A\u8BCD\u4E2D\uFF0C\u4E0D\u4F1A\u81EA\u52A8\u6CE8\u5165\uFF1B\u82E5\u5F00\u542F\u201C\u5C06 XML \u5DE5\u5177\u6539\u4E3A\u6CE8\u5165\u5B9E\u9A8C\u6027\u5DE5\u5177\u8C03\u7528\u56DE\u590D\u201D\uFF0C\u5219\u53EA\u9700\u5728\u63D0\u793A\u8BCD\u4E2D\u544A\u77E5 AI \u4F60\u7684 scopeId").collapse()
847
+ ).description("\u6A21\u578B\u56DE\u590D XML \u53C2\u8003\u63D0\u793A\u8BCD\u3002\u6B64\u5185\u5BB9\u4E0D\u4F1A\u81EA\u52A8\u6CE8\u5165\u5230\u89D2\u8272\u63D0\u793A\u8BCD\u4E2D\uFF1B\u8BF7\u5148\u5C06 {scopeId} \u66FF\u6362\u4E3A\u5B9E\u9645 scopeId\uFF0C\u518D\u624B\u52A8\u590D\u5236\u5230 ChatLuna Character \u7684\u89D2\u8272\u63D0\u793A\u8BCD\u91CC\u3002\u82E5\u5F00\u542F\u201C\u5C06 XML \u5DE5\u5177\u6539\u4E3A\u6CE8\u5165\u5B9E\u9A8C\u6027\u5DE5\u5177\u8C03\u7528\u56DE\u590D\u201D\uFF0C\u5219\u53EA\u9700\u5728\u63D0\u793A\u8BCD\u4E2D\u544A\u77E5 AI \u4F60\u7684 scopeId").collapse()
848
848
  }).description("XML \u5DE5\u5177\u8BBE\u7F6E");
849
849
  var VariableSettingsSchema = import_koishi4.Schema.object({
850
850
  affinityVariableName: import_koishi4.Schema.string().default("affinity").description(
@@ -5714,6 +5714,12 @@ async function callOneBotAPI(internal, action, params, fallbacks = []) {
5714
5714
 
5715
5715
  // src/index.ts
5716
5716
  var usage = `
5717
+ ## \u4F7F\u7528\u8BF4\u660E
5718
+
5719
+ \u9996\u6B21\u4F7F\u7528\u524D\u8BF7\u5148\u9605\u8BFB [readme.md](https://github.com/Sor85/AAAAACAT-chatluna-plugins/blob/main/plugins/chatluna-affinity/readme.md)\uFF0C\u6309\u6587\u6863\u5B8C\u6210\u4F9D\u8D56\u5B89\u88C5\u3001\`scopeId\` \u914D\u7F6E\u3001\u53D8\u91CF\u6CE8\u5165\u548C XML \u5DE5\u5177\u63A5\u5165\u3002
5720
+
5721
+ \u5982\u679C\u4F60\u4E3B\u8981\u5728 ChatLuna Character \u4E2D\u4F7F\u7528\u672C\u63D2\u4EF6\uFF0C\u8BF7\u4F18\u5148\u67E5\u770B readme.md \u4E2D\u7684\u201C\u5FEB\u901F\u4E0A\u624B\u201D\u548C\u201C\u53D8\u91CF\u201D\u7AE0\u8282\u3002
5722
+
5717
5723
  ## \u66F4\u65B0\u65E5\u5FD7
5718
5724
 
5719
5725
  0.3.0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-chatluna-affinity",
3
3
  "description": "ChatLuna Character 好感度系统,提供 {好感度}、{关系}、{黑名单} 变量与工具,并支持 XML 工具调用,仅支持 onebot 平台。",
4
- "version": "0.3.0",
4
+ "version": "0.3.1",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
7
7
  "files": [
@@ -10,6 +10,13 @@
10
10
  "client"
11
11
  ],
12
12
  "license": "MIT",
13
+ "scripts": {
14
+ "build": "tsup && vite build",
15
+ "watch": "tsup --watch",
16
+ "clean": "rimraf lib dist",
17
+ "typecheck": "yarn workspace shared-chatluna-xmltools build && tsc --noEmit",
18
+ "test": "node --import tsx --test --test-name-pattern='.*' $(find tests -name '*.test.ts' -print)"
19
+ },
13
20
  "keywords": [
14
21
  "chatbot",
15
22
  "koishi",
@@ -20,26 +27,25 @@
20
27
  "type": "git",
21
28
  "url": "https://github.com/Sor85/AAAAACAT-chatluna-plugins.git"
22
29
  },
23
- "dependencies": {},
24
30
  "peerDependencies": {
31
+ "@koishijs/plugin-console": "^5.30.0",
25
32
  "koishi": "^4.18.7",
26
33
  "koishi-plugin-chatluna": "*",
27
34
  "koishi-plugin-chatluna-character": "*",
28
- "@koishijs/plugin-console": "^5.30.0",
29
35
  "koishi-plugin-chatluna-group-analysis": "*"
30
36
  },
31
37
  "peerDependenciesMeta": {
32
- "koishi-plugin-chatluna-character": {
33
- "optional": true
34
- },
35
38
  "@koishijs/plugin-console": {
36
39
  "optional": true
37
40
  },
38
- "koishi-plugin-puppeteer": {
41
+ "koishi-plugin-chatluna-character": {
39
42
  "optional": true
40
43
  },
41
44
  "koishi-plugin-chatluna-group-analysis": {
42
45
  "optional": true
46
+ },
47
+ "koishi-plugin-puppeteer": {
48
+ "optional": true
43
49
  }
44
50
  },
45
51
  "devDependencies": {
@@ -48,17 +54,12 @@
48
54
  "@vitejs/plugin-vue": "^6.0.2",
49
55
  "rimraf": "^5.0.5",
50
56
  "sass": "^1.77.0",
57
+ "shared-chatluna-xmltools": "0.0.1",
58
+ "shared-nav": "0.0.1",
51
59
  "tsup": "^8.0.0",
60
+ "tsx": "^4.20.6",
52
61
  "typescript": "^5.7.2",
53
62
  "vite": "^6.0.0",
54
- "tsx": "^4.20.6",
55
- "shared-chatluna-xmltools": "0.0.1",
56
- "shared-nav": "0.0.1"
57
- },
58
- "scripts": {
59
- "build": "tsup && vite build",
60
- "watch": "tsup --watch",
61
- "clean": "rimraf lib dist",
62
- "test": "node --import tsx --test --test-name-pattern='.*' $(find src -name '*.test.ts' -print)"
63
+ "vue": "^3.5.21"
63
64
  }
64
65
  }
package/readme.md CHANGED
@@ -34,13 +34,15 @@
34
34
  ### 安装插件
35
35
 
36
36
  ```bash
37
- npm install koishi-plugin-chatluna-affinity
37
+ yarn add koishi-plugin-chatluna-affinity
38
38
  ```
39
39
 
40
40
  安装后,在 Koishi 中启用本插件并完成配置。
41
41
 
42
42
  ## 快速上手
43
43
 
44
+ 如果你主要是想在 ChatLuna Character 里使用本插件,建议先看这份伪装成接入指南的教程:[ChatLuna Character 接入指南](./character-prompt-guide.md)。它给出了角色提示词里应该放哪些变量,以及传统 XML 回复和实验性工具调用回复两种接入方式。
45
+
44
46
  ### 1. 先配置 `scopeId`
45
47
 
46
48
  这是最重要的配置项。
@@ -293,4 +295,4 @@ scopeId.指令名
293
295
 
294
296
  ## 许可证
295
297
 
296
- MIT © 2024-present chatluna-affinity contributors
298
+ MIT © 2024-present chatluna-affinity contributors