koishi-plugin-chatluna-affinity 0.3.0-beta.1 → 0.3.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/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { createElementBlock as f, openBlock as p, createElementVNode as _, defineComponent as k, Fragment as C, renderList as D, normalizeClass as m, toDisplayString as X, reactive as N, computed as $, onUnmounted as x, ref as L, onMounted as Y, normalizeStyle as z, unref as y, createVNode as w, withModifiers as S, inject as I, createBlock as R, createCommentVNode as A } from "vue";
1
+ import { openBlock as p, createElementBlock as f, createElementVNode as _, defineComponent as k, Fragment as C, renderList as D, normalizeClass as m, toDisplayString as X, reactive as N, computed as $, onUnmounted as x, ref as L, onMounted as Y, normalizeStyle as z, unref as y, createVNode as w, withModifiers as S, inject as I, createBlock as R, createCommentVNode as A } from "vue";
2
2
  const v = (c, e) => {
3
3
  const t = c.__vccOpts || c;
4
4
  for (const [n, l] of e)
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- @charset "UTF-8";._item_1m2kp_1{padding:8px 16px;font-size:13px;color:var(--k-text-normal);cursor:pointer;transition:all .2s ease;white-space:nowrap;border-radius:9999px;margin:4px 0;background:transparent}._item_1m2kp_1:hover{background:#0000000f;color:var(--k-text-active)}._item_1m2kp_1._active_1m2kp_16{color:#fff;background:var(--k-color-primary);font-weight:500}._container_pbgsl_2{position:absolute;z-index:1000;width:140px;max-width:90vw;max-height:70vh;background:transparent;display:flex;flex-direction:column;font-family:Helvetica Neue,Helvetica,PingFang SC,Hiragino Sans GB,Microsoft YaHei,微软雅黑,Arial,sans-serif;-webkit-user-select:none;user-select:none;overflow:visible}@media (max-width: 768px){._container_pbgsl_2{width:120px;max-height:50vh}}._container_pbgsl_2 ._header_pbgsl_21{padding:6px 10px;display:flex;justify-content:space-between;align-items:center;cursor:move;background:#ffffffd9;border-radius:20px;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);margin-bottom:8px;box-shadow:0 2px 8px #00000014}._container_pbgsl_2 ._header_pbgsl_21:hover{background:#fffffff2}._container_pbgsl_2 ._header_pbgsl_21 ._move_pbgsl_36{color:var(--k-text-light);cursor:grab;transition:color .2s}._container_pbgsl_2 ._header_pbgsl_21 ._move_pbgsl_36:active{cursor:grabbing;color:var(--k-color-primary)}._container_pbgsl_2 ._header_pbgsl_21 ._toggle_pbgsl_45{cursor:pointer;color:var(--k-text-light);transition:transform .3s ease,color .2s;display:flex;align-items:center;padding:2px}._container_pbgsl_2 ._header_pbgsl_21 ._toggle_pbgsl_45:hover{color:var(--k-color-primary)}._container_pbgsl_2 ._body_pbgsl_56{overflow-y:auto;padding:4px 0;transition:max-height .3s ease,opacity .3s ease;opacity:1;scrollbar-width:none;-ms-overflow-style:none}._container_pbgsl_2 ._body_pbgsl_56::-webkit-scrollbar{display:none}._container_pbgsl_2._collapsed_pbgsl_67{max-height:40px!important}._container_pbgsl_2._collapsed_pbgsl_67 ._body_pbgsl_56{max-height:0;padding:0;opacity:0;overflow:hidden}._container_pbgsl_2._collapsed_pbgsl_67 ._toggle_pbgsl_45{transform:rotate(180deg)}
1
+ @charset "UTF-8";._item_1m2kp_1{padding:8px 16px;font-size:13px;color:var(--k-text-normal);cursor:pointer;transition:all .2s ease;white-space:nowrap;border-radius:9999px;margin:4px 0;background:transparent}._item_1m2kp_1:hover{background:#0000000f;color:var(--k-text-active)}._item_1m2kp_1._active_1m2kp_16{color:#fff;background:var(--k-color-primary);font-weight:500}._container_pbgsl_2{position:absolute;z-index:1000;width:140px;max-width:90vw;max-height:70vh;background:transparent;display:flex;flex-direction:column;font-family:Helvetica Neue,Helvetica,PingFang SC,Hiragino Sans GB,Microsoft YaHei,微软雅黑,Arial,sans-serif;-webkit-user-select:none;user-select:none;overflow:visible}@media(max-width:768px){._container_pbgsl_2{width:120px;max-height:50vh}}._container_pbgsl_2 ._header_pbgsl_21{padding:6px 10px;display:flex;justify-content:space-between;align-items:center;cursor:move;background:#ffffffd9;border-radius:20px;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);margin-bottom:8px;box-shadow:0 2px 8px #00000014}._container_pbgsl_2 ._header_pbgsl_21:hover{background:#fffffff2}._container_pbgsl_2 ._header_pbgsl_21 ._move_pbgsl_36{color:var(--k-text-light);cursor:grab;transition:color .2s}._container_pbgsl_2 ._header_pbgsl_21 ._move_pbgsl_36:active{cursor:grabbing;color:var(--k-color-primary)}._container_pbgsl_2 ._header_pbgsl_21 ._toggle_pbgsl_45{cursor:pointer;color:var(--k-text-light);transition:transform .3s ease,color .2s;display:flex;align-items:center;padding:2px}._container_pbgsl_2 ._header_pbgsl_21 ._toggle_pbgsl_45:hover{color:var(--k-color-primary)}._container_pbgsl_2 ._body_pbgsl_56{overflow-y:auto;padding:4px 0;transition:max-height .3s ease,opacity .3s ease;opacity:1;scrollbar-width:none;-ms-overflow-style:none}._container_pbgsl_2 ._body_pbgsl_56::-webkit-scrollbar{display:none}._container_pbgsl_2._collapsed_pbgsl_67{max-height:40px!important}._container_pbgsl_2._collapsed_pbgsl_67 ._body_pbgsl_56{max-height:0;padding:0;opacity:0;overflow:hidden}._container_pbgsl_2._collapsed_pbgsl_67 ._toggle_pbgsl_45{transform:rotate(180deg)}
package/lib/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import * as cosmokit from 'cosmokit';
1
+ import * as koishi from 'koishi';
2
2
  import { Schema, Session, Context } from 'koishi';
3
3
 
4
4
  /**
@@ -192,7 +192,7 @@ declare const RelationshipSchema: Schema<Schemastery.ObjectS<{
192
192
  userId?: string | null | undefined;
193
193
  relation?: string | null | undefined;
194
194
  note?: string | null | undefined;
195
- } & cosmokit.Dict)[], Schemastery.ObjectT<{
195
+ } & koishi.Dict)[], Schemastery.ObjectT<{
196
196
  userId: Schema<string, string>;
197
197
  relation: Schema<string, string>;
198
198
  note: Schema<string, string>;
@@ -202,7 +202,7 @@ declare const RelationshipSchema: Schema<Schemastery.ObjectS<{
202
202
  max?: number | null | undefined;
203
203
  relation?: string | null | undefined;
204
204
  note?: string | null | undefined;
205
- } & cosmokit.Dict)[], Schemastery.ObjectT<{
205
+ } & koishi.Dict)[], Schemastery.ObjectT<{
206
206
  min: Schema<number, number>;
207
207
  max: Schema<number, number>;
208
208
  relation: Schema<string, string>;
@@ -213,7 +213,7 @@ declare const RelationshipSchema: Schema<Schemastery.ObjectS<{
213
213
  userId?: string | null | undefined;
214
214
  relation?: string | null | undefined;
215
215
  note?: string | null | undefined;
216
- } & cosmokit.Dict)[], Schemastery.ObjectT<{
216
+ } & koishi.Dict)[], Schemastery.ObjectT<{
217
217
  userId: Schema<string, string>;
218
218
  relation: Schema<string, string>;
219
219
  note: Schema<string, string>;
@@ -223,7 +223,7 @@ declare const RelationshipSchema: Schema<Schemastery.ObjectS<{
223
223
  max?: number | null | undefined;
224
224
  relation?: string | null | undefined;
225
225
  note?: string | null | undefined;
226
- } & cosmokit.Dict)[], Schemastery.ObjectT<{
226
+ } & koishi.Dict)[], Schemastery.ObjectT<{
227
227
  min: Schema<number, number>;
228
228
  max: Schema<number, number>;
229
229
  relation: Schema<string, string>;
@@ -266,24 +266,24 @@ declare const ConfigSchema: Schema<{
266
266
  demoteThreshold?: number | null | undefined;
267
267
  longTermPromoteStep?: number | null | undefined;
268
268
  longTermDemoteStep?: number | null | undefined;
269
- } & cosmokit.Dict) | null | undefined;
269
+ } & koishi.Dict) | null | undefined;
270
270
  actionWindow?: ({
271
271
  windowHours?: number | null | undefined;
272
272
  increaseBonus?: number | null | undefined;
273
273
  decreaseBonus?: number | null | undefined;
274
274
  bonusChatThreshold?: number | null | undefined;
275
275
  maxEntries?: number | null | undefined;
276
- } & cosmokit.Dict) | null | undefined;
276
+ } & koishi.Dict) | null | undefined;
277
277
  coefficient?: ({
278
278
  base?: number | null | undefined;
279
279
  maxDrop?: number | null | undefined;
280
280
  maxBoost?: number | null | undefined;
281
281
  decayPerDay?: number | null | undefined;
282
282
  boostPerDay?: number | null | undefined;
283
- } & cosmokit.Dict) | null | undefined;
284
- } & cosmokit.Dict) | null | undefined;
283
+ } & koishi.Dict) | null | undefined;
284
+ } & koishi.Dict) | null | undefined;
285
285
  rankDefaultLimit?: number | null | undefined;
286
- } & cosmokit.Dict & {
286
+ } & koishi.Dict & {
287
287
  blacklistLogInterception?: boolean | null | undefined;
288
288
  shortTermBlacklistPenalty?: number | null | undefined;
289
289
  unblockPermanentInitialAffinity?: number | null | undefined;
@@ -293,13 +293,13 @@ declare const ConfigSchema: Schema<{
293
293
  userId?: string | null | undefined;
294
294
  relation?: string | null | undefined;
295
295
  note?: string | null | undefined;
296
- } & cosmokit.Dict)[] | null | undefined;
296
+ } & koishi.Dict)[] | null | undefined;
297
297
  relationshipAffinityLevels?: ({
298
298
  min?: number | null | undefined;
299
299
  max?: number | null | undefined;
300
300
  relation?: string | null | undefined;
301
301
  note?: string | null | undefined;
302
- } & cosmokit.Dict)[] | null | undefined;
302
+ } & koishi.Dict)[] | null | undefined;
303
303
  } & {
304
304
  scopeId?: string | null | undefined;
305
305
  botSelfIds?: string[] | null | undefined;
@@ -364,7 +364,7 @@ declare const ConfigSchema: Schema<{
364
364
  }>>;
365
365
  }>;
366
366
  rankDefaultLimit: number;
367
- } & cosmokit.Dict & {
367
+ } & koishi.Dict & {
368
368
  blacklistLogInterception: boolean;
369
369
  shortTermBlacklistPenalty: number;
370
370
  unblockPermanentInitialAffinity: number;
@@ -1784,6 +1784,6 @@ declare function callOneBotAPI(internal: OneBotInternal, action: string, params:
1784
1784
  * 导出插件元信息和 apply 函数
1785
1785
  */
1786
1786
 
1787
- declare const usage = "\n## \u66F4\u65B0\u65E5\u5FD7\n\n0.3.0-beta.1\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\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`\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";
1787
+ declare const usage = "\n## \u66F4\u65B0\u65E5\u5FD7\n\n0.3.0-beta\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\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`\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";
1788
1788
 
1789
1789
  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, inject, isFiniteNumber, isValidScopeId, makeUserKey, name, normalizeScopeId, normalizeTimestamp, parseSelfClosingXmlTags, pickFirst, registerAdjustCommand, registerBlacklistCommand, registerBlockCommand, 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
@@ -5045,7 +5045,7 @@ async function callOneBotAPI(internal, action, params, fallbacks = []) {
5045
5045
  var usage = `
5046
5046
  ## \u66F4\u65B0\u65E5\u5FD7
5047
5047
 
5048
- 0.3.0-beta.1
5048
+ 0.3.0-beta
5049
5049
 
5050
5050
  ### \u91CD\u6784
5051
5051
  - \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
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-beta.1",
4
+ "version": "0.3.0-beta.2",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [
@@ -15,10 +15,10 @@
15
15
  "koishi",
16
16
  "plugin"
17
17
  ],
18
- "homepage": "https://github.com/Sor85/koishi-plugin-chatluna-affinity",
18
+ "homepage": "https://github.com/Sor85/koishi-plugins",
19
19
  "repository": {
20
20
  "type": "git",
21
- "url": "git+https://github.com/Sor85/koishi-plugin-chatluna-affinity.git"
21
+ "url": "https://github.com/Sor85/koishi-plugins.git"
22
22
  },
23
23
  "peerDependencies": {
24
24
  "koishi": "^4.18.7",
@@ -48,7 +48,8 @@
48
48
  "rimraf": "^5.0.5",
49
49
  "sass": "^1.77.0",
50
50
  "tsup": "^8.0.0",
51
- "typescript": "^5.3.3"
51
+ "typescript": "^5.3.3",
52
+ "vite": "^6.0.0"
52
53
  },
53
54
  "dependencies": {
54
55
  "koishi-plugin-chatluna": "*"
@@ -56,7 +57,6 @@
56
57
  "scripts": {
57
58
  "build": "tsup && vite build",
58
59
  "watch": "tsup --watch",
59
- "clean": "rimraf lib dist",
60
- "test": "npm run build && node --test test/**/*.test.js"
60
+ "clean": "rimraf lib dist"
61
61
  }
62
62
  }