koishi-plugin-chatluna-affinity 0.2.5 → 0.3.0-alpha.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.
Files changed (117) hide show
  1. package/client/constants.ts +44 -54
  2. package/client/types.ts +57 -52
  3. package/dist/index.js +39 -51
  4. package/lib/index.d.ts +1765 -13
  5. package/lib/index.js +2669 -7090
  6. package/package.json +6 -15
  7. package/readme.md +418 -101
  8. package/lib/commands/adjust.d.ts +0 -6
  9. package/lib/commands/blacklist.d.ts +0 -12
  10. package/lib/commands/block.d.ts +0 -10
  11. package/lib/commands/clear-all.d.ts +0 -6
  12. package/lib/commands/enabled.d.ts +0 -6
  13. package/lib/commands/group-list.d.ts +0 -6
  14. package/lib/commands/index.d.ts +0 -15
  15. package/lib/commands/inspect.d.ts +0 -6
  16. package/lib/commands/rank.d.ts +0 -6
  17. package/lib/commands/schedule.d.ts +0 -15
  18. package/lib/commands/temp-block.d.ts +0 -10
  19. package/lib/commands/types.d.ts +0 -55
  20. package/lib/constants/defaults.d.ts +0 -70
  21. package/lib/constants/index.d.ts +0 -7
  22. package/lib/constants/mappings.d.ts +0 -9
  23. package/lib/constants/prompts.d.ts +0 -7
  24. package/lib/helpers/index.d.ts +0 -8
  25. package/lib/helpers/logger.d.ts +0 -11
  26. package/lib/helpers/member.d.ts +0 -49
  27. package/lib/helpers/role-mapper.d.ts +0 -44
  28. package/lib/helpers/session.d.ts +0 -36
  29. package/lib/integrations/chatluna/index.d.ts +0 -6
  30. package/lib/integrations/chatluna/tools/affinity.d.ts +0 -35
  31. package/lib/integrations/chatluna/tools/blacklist.d.ts +0 -47
  32. package/lib/integrations/chatluna/tools/index.d.ts +0 -10
  33. package/lib/integrations/chatluna/tools/relationship.d.ts +0 -35
  34. package/lib/integrations/chatluna/tools/schedule.d.ts +0 -31
  35. package/lib/integrations/chatluna/tools/types.d.ts +0 -29
  36. package/lib/integrations/chatluna/tools/weather.d.ts +0 -34
  37. package/lib/integrations/chatluna/variables/affinity.d.ts +0 -20
  38. package/lib/integrations/chatluna/variables/bot-info.d.ts +0 -17
  39. package/lib/integrations/chatluna/variables/context-affinity.d.ts +0 -19
  40. package/lib/integrations/chatluna/variables/group-info.d.ts +0 -17
  41. package/lib/integrations/chatluna/variables/index.d.ts +0 -15
  42. package/lib/integrations/chatluna/variables/outfit.d.ts +0 -18
  43. package/lib/integrations/chatluna/variables/random.d.ts +0 -10
  44. package/lib/integrations/chatluna/variables/relationship-level.d.ts +0 -20
  45. package/lib/integrations/chatluna/variables/relationship.d.ts +0 -18
  46. package/lib/integrations/chatluna/variables/schedule.d.ts +0 -18
  47. package/lib/integrations/chatluna/variables/user-info.d.ts +0 -19
  48. package/lib/integrations/chatluna/variables/weather.d.ts +0 -15
  49. package/lib/integrations/index.d.ts +0 -6
  50. package/lib/integrations/onebot/api.d.ts +0 -16
  51. package/lib/integrations/onebot/index.d.ts +0 -5
  52. package/lib/integrations/onebot/tools/delete-msg.d.ts +0 -18
  53. package/lib/integrations/onebot/tools/index.d.ts +0 -9
  54. package/lib/integrations/onebot/tools/poke.d.ts +0 -47
  55. package/lib/integrations/onebot/tools/profile.d.ts +0 -43
  56. package/lib/integrations/onebot/tools/send-fake-msg.d.ts +0 -147
  57. package/lib/integrations/onebot/tools/send-forward-msg.d.ts +0 -39
  58. package/lib/integrations/onebot/tools/set-group-card.d.ts +0 -41
  59. package/lib/integrations/onebot/tools/set-msg-emoji.d.ts +0 -22
  60. package/lib/models/affinity.d.ts +0 -13
  61. package/lib/models/index.d.ts +0 -9
  62. package/lib/plugin.d.ts +0 -7
  63. package/lib/renders/base.d.ts +0 -35
  64. package/lib/renders/blacklist.d.ts +0 -19
  65. package/lib/renders/group-list.d.ts +0 -14
  66. package/lib/renders/index.d.ts +0 -27
  67. package/lib/renders/inspect.d.ts +0 -23
  68. package/lib/renders/rank-list.d.ts +0 -15
  69. package/lib/renders/schedule.d.ts +0 -15
  70. package/lib/renders/styles/common.d.ts +0 -5
  71. package/lib/renders/styles/index.d.ts +0 -4
  72. package/lib/renders/table.d.ts +0 -12
  73. package/lib/schema/affinity.d.ts +0 -220
  74. package/lib/schema/blacklist.d.ts +0 -122
  75. package/lib/schema/index.d.ts +0 -397
  76. package/lib/schema/relationship.d.ts +0 -56
  77. package/lib/schema/schedule.d.ts +0 -74
  78. package/lib/schema/tools.d.ts +0 -115
  79. package/lib/schema/variables.d.ts +0 -76
  80. package/lib/schema/weather.d.ts +0 -38
  81. package/lib/services/affinity/apply-delta.d.ts +0 -54
  82. package/lib/services/affinity/cache.d.ts +0 -6
  83. package/lib/services/affinity/calculator.d.ts +0 -18
  84. package/lib/services/affinity/index.d.ts +0 -8
  85. package/lib/services/affinity/store.d.ts +0 -25
  86. package/lib/services/blacklist/guard.d.ts +0 -19
  87. package/lib/services/blacklist/index.d.ts +0 -7
  88. package/lib/services/blacklist/permanent.d.ts +0 -17
  89. package/lib/services/blacklist/temporary.d.ts +0 -24
  90. package/lib/services/index.d.ts +0 -9
  91. package/lib/services/message/history.d.ts +0 -24
  92. package/lib/services/message/index.d.ts +0 -6
  93. package/lib/services/message/store.d.ts +0 -27
  94. package/lib/services/relationship/index.d.ts +0 -6
  95. package/lib/services/relationship/level-resolver.d.ts +0 -10
  96. package/lib/services/relationship/manual-config.d.ts +0 -19
  97. package/lib/services/schedule/cache.d.ts +0 -13
  98. package/lib/services/schedule/generator.d.ts +0 -22
  99. package/lib/services/schedule/index.d.ts +0 -8
  100. package/lib/services/schedule/manager.d.ts +0 -25
  101. package/lib/services/schedule/time-utils.d.ts +0 -15
  102. package/lib/services/weather/api.d.ts +0 -33
  103. package/lib/services/weather/index.d.ts +0 -5
  104. package/lib/types/affinity.d.ts +0 -110
  105. package/lib/types/blacklist.d.ts +0 -60
  106. package/lib/types/common.d.ts +0 -16
  107. package/lib/types/config.d.ts +0 -165
  108. package/lib/types/index.d.ts +0 -12
  109. package/lib/types/member.d.ts +0 -85
  110. package/lib/types/schedule-config.d.ts +0 -22
  111. package/lib/types/schedule.d.ts +0 -53
  112. package/lib/types/weather.d.ts +0 -27
  113. package/lib/utils/index.d.ts +0 -8
  114. package/lib/utils/math.d.ts +0 -8
  115. package/lib/utils/string.d.ts +0 -9
  116. package/lib/utils/template.d.ts +0 -5
  117. package/lib/utils/time.d.ts +0 -13
@@ -4,72 +4,62 @@
4
4
  */
5
5
 
6
6
  export interface NavSection {
7
- title: string
8
- key: string
7
+ title: string;
8
+ key: string;
9
9
  }
10
10
 
11
11
  export interface ToolItem {
12
- name: string
13
- enableKey: string
14
- enabled: boolean
12
+ name: string;
13
+ enableKey: string;
14
+ enabled: boolean;
15
15
  }
16
16
 
17
17
  export interface VariableItem {
18
- name: string
19
- key: string
20
- enabled: boolean
18
+ name: string;
19
+ key: string;
20
+ enabled: boolean;
21
21
  }
22
22
 
23
23
  export const NAV_SECTIONS: NavSection[] = [
24
- { title: '好感度设置', key: 'affinity' },
25
- { title: '黑名单设置', key: 'blacklist' },
26
- { title: '关系设置', key: 'relationship' },
27
- { title: '日程设置', key: 'schedule' },
28
- { title: '天气设置', key: 'weather' },
29
- { title: '原生工具', key: 'nativeTools' },
30
- { title: 'XML 工具', key: 'xmlTools' },
31
- { title: '其他变量', key: 'otherVariables' },
32
- { title: '其他指令', key: 'otherCommands' },
33
- { title: '其他设置', key: 'otherSettings' }
34
- ]
24
+ { title: "好感度设置", key: "affinity" },
25
+ { title: "黑名单设置", key: "blacklist" },
26
+ { title: "关系设置", key: "relationship" },
27
+ { title: "变量设置", key: "variables" },
28
+ { title: "XML 工具设置", key: "xmlTools" },
29
+ { title: "其他设置", key: "otherSettings" },
30
+ ];
35
31
 
36
32
  export const TITLE_TO_KEY: Record<string, string> = {
37
- '好感度设置': 'affinity',
38
- '黑名单设置': 'blacklist',
39
- '关系设置': 'relationship',
40
- '日程设置': 'schedule',
41
- '天气设置': 'weather',
42
- 原生工具: 'nativeTools',
43
- 'XML 工具': 'xmlTools',
44
- '其他变量': 'otherVariables',
45
- '其他指令': 'otherCommands',
46
- '其他设置': 'otherSettings'
47
- }
33
+ 好感度设置: "affinity",
34
+ 黑名单设置: "blacklist",
35
+ 关系设置: "relationship",
36
+ 变量设置: "variables",
37
+ "XML 工具设置": "xmlTools",
38
+ 其他设置: "otherSettings",
39
+ };
48
40
 
49
41
  export const KEY_TO_TITLE: Record<string, string> = {
50
- affinity: '好感度设置',
51
- blacklist: '黑名单设置',
52
- relationship: '关系设置',
53
- schedule: '日程设置',
54
- weather: '天气设置',
55
- nativeTools: '原生工具',
56
- xmlTools: 'XML 工具',
57
- otherVariables: '其他变量',
58
- otherCommands: '其他指令',
59
- otherSettings: '其他设置'
60
- }
42
+ affinity: "好感度设置",
43
+ blacklist: "黑名单设置",
44
+ relationship: "关系设置",
45
+ variables: "变量设置",
46
+ xmlTools: "XML 工具设置",
47
+ otherSettings: "其他设置",
48
+ };
61
49
 
62
- export const VARIABLE_CONFIG: Record<string, { section: string; searchKey: string | string[] }> = {
63
- affinity: { section: '好感度设置', searchKey: 'affinityVariableName' },
64
- contextAffinity: { section: '好感度设置', searchKey: ['contextAffinityOverview', '上下文好感度变量'] },
65
- relationship: { section: '关系设置', searchKey: 'relationshipVariableName' },
66
- schedule: { section: '日程设置', searchKey: ['今日日程变量名称', 'variableName'] },
67
- currentSchedule: { section: '日程设置', searchKey: ['当前日程变量名称', 'currentVariableName'] },
68
- weather: { section: '天气设置', searchKey: ['天气变量名称', 'variableName'] },
69
- userInfo: { section: '其他变量', searchKey: 'userInfo' },
70
- botInfo: { section: '其他变量', searchKey: 'botInfo' },
71
- groupInfo: { section: '其他变量', searchKey: 'groupInfo' },
72
- random: { section: '其他变量', searchKey: 'random' }
73
- }
50
+ export const VARIABLE_CONFIG: Record<
51
+ string,
52
+ { section: string; searchKey: string | string[] }
53
+ > = {
54
+ affinity: { section: "变量设置", searchKey: "affinityVariableName" },
55
+ relationshipLevel: {
56
+ section: "变量设置",
57
+ searchKey: "relationshipLevelVariableName",
58
+ },
59
+ blacklistList: {
60
+ section: "变量设置",
61
+ searchKey: "blacklistListVariableName",
62
+ },
63
+ };
74
64
 
75
- export const PLUGIN_NAME = 'koishi-plugin-chatluna-affinity'
65
+ export const PLUGIN_NAME = "koishi-plugin-chatluna-affinity";
package/client/types.ts CHANGED
@@ -3,56 +3,61 @@
3
3
  * 包含配置接口和组件 Props 类型
4
4
  */
5
5
 
6
- export interface Config {
7
- enableAffinityAnalysis?: boolean
8
- affinityVariableName?: string
9
- contextAffinityOverview?: {
10
- variableName?: string
11
- }
12
- registerAffinityTool?: boolean
13
- affinityToolName?: string
14
- registerBlacklistTool?: boolean
15
- blacklistToolName?: string
16
- relationshipVariableName?: string
17
- registerRelationshipTool?: boolean
18
- relationshipToolName?: string
19
- schedule?: {
20
- enabled?: boolean
21
- model?: string
22
- personaSource?: 'none' | 'chatluna' | 'custom'
23
- personaChatlunaPreset?: string
24
- personaCustomPreset?: string
25
- variableName?: string
26
- currentVariableName?: string
27
- registerTool?: boolean
28
- toolName?: string
29
- }
30
- weather?: {
31
- enabled?: boolean
32
- registerTool?: boolean
33
- toolName?: string
34
- }
35
- inspectShowImpression?: boolean
36
- userInfo?: { enabled?: boolean; variableName?: string }
37
- botInfo?: { enabled?: boolean; variableName?: string }
38
- groupInfo?: { enabled?: boolean; variableName?: string }
39
- otherVariables?: {
40
- userInfo?: { enabled?: boolean; variableName?: string }
41
- botInfo?: { enabled?: boolean; variableName?: string }
42
- groupInfo?: { enabled?: boolean; variableName?: string }
43
- random?: { enabled?: boolean; variableName?: string }
44
- }
45
- enablePokeTool?: boolean
46
- pokeToolName?: string
47
- enableSetSelfProfileTool?: boolean
48
- setSelfProfileToolName?: string
49
- enableSetGroupCardTool?: boolean
50
- setGroupCardToolName?: string
51
- enableDeleteMessageTool?: boolean
52
- deleteMessageToolName?: string
53
- enableDeleteXmlTool?: boolean
54
- panSouTool?: {
55
- enablePanSouTool?: boolean
56
- panSouToolName?: string
57
- }
6
+ export interface BlacklistEntry {
7
+ userId: string;
8
+ nickname: string;
9
+ blockedAt: string;
10
+ note: string;
11
+ platform: string;
12
+ }
13
+
14
+ export interface TemporaryBlacklistEntry {
15
+ userId: string;
16
+ nickname: string;
17
+ blockedAt: string;
18
+ expiresAt: string;
19
+ durationHours: string;
20
+ penalty: string;
21
+ note: string;
22
+ platform: string;
23
+ }
24
+
25
+ export interface VariableSettings {
26
+ affinityVariableName?: string;
27
+ relationshipLevelVariableName?: string;
28
+ blacklistListVariableName?: string;
29
+ }
30
+
31
+ export interface XmlToolSettings {
32
+ enableAffinityXmlToolCall?: boolean;
33
+ enableBlacklistXmlToolCall?: boolean;
34
+ enableRelationshipXmlToolCall?: boolean;
35
+ enableUserAliasXmlToolCall?: boolean;
36
+ characterPromptTemplate?: string;
37
+ }
38
+
39
+ export interface FrontendConfigSubset {
40
+ scopeId?: string;
41
+ botSelfIds?: string[];
42
+ affinityEnabled?: boolean;
43
+ affinityDisplayRange?: number;
44
+ rankRenderAsImage?: boolean;
45
+ rankDefaultLimit?: number;
46
+
47
+ blacklistLogInterception?: boolean;
48
+ unblockPermanentInitialAffinity?: number;
49
+ blacklistDefaultLimit?: number;
50
+ blacklistRenderAsImage?: boolean;
51
+ shortTermBlacklistRenderAsImage?: boolean;
52
+
53
+ inspectRenderAsImage?: boolean;
54
+ inspectShowImpression?: boolean;
55
+ debugLogging?: boolean;
56
+
57
+ variableSettings?: VariableSettings;
58
+ xmlToolSettings?: XmlToolSettings;
59
+
60
+ affinityVariableName?: string;
61
+ relationshipLevelVariableName?: string;
62
+ blacklistListVariableName?: string;
58
63
  }
package/dist/index.js CHANGED
@@ -1,24 +1,24 @@
1
- import { createElementBlock as f, openBlock as p, createElementVNode as _, defineComponent as k, Fragment as L, renderList as D, normalizeClass as m, toDisplayString as X, reactive as N, computed as $, onUnmounted as x, ref as C, onMounted as Y, normalizeStyle as z, unref as w, createVNode as v, withModifiers as S, inject as I, createBlock as R, createCommentVNode as V } from "vue";
2
- const y = (c, e) => {
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";
2
+ const v = (c, e) => {
3
3
  const t = c.__vccOpts || c;
4
4
  for (const [n, l] of e)
5
5
  t[n] = l;
6
6
  return t;
7
- }, A = {}, B = {
7
+ }, B = {}, O = {
8
8
  viewBox: "0 0 1024 1024",
9
9
  xmlns: "http://www.w3.org/2000/svg",
10
10
  width: "20",
11
11
  height: "20"
12
12
  };
13
- function O(c, e) {
14
- return p(), f("svg", B, [...e[0] || (e[0] = [
13
+ function K(c, e) {
14
+ return p(), f("svg", O, [...e[0] || (e[0] = [
15
15
  _("path", {
16
16
  d: "M288 224c0-35.3 28.7-64 64-64s64 28.7 64 64-28.7 64-64 64-64-28.7-64-64zm320 0c0-35.3 28.7-64 64-64s64 28.7 64 64-28.7 64-64 64-64-28.7-64-64zM288 512c0-35.3 28.7-64 64-64s64 28.7 64 64-28.7 64-64 64-64-28.7-64-64zm320 0c0-35.3 28.7-64 64-64s64 28.7 64 64-28.7 64-64 64-64-28.7-64-64zM352 864c-35.3 0-64-28.7-64-64s28.7-64 64-64 64 28.7 64 64-28.7 64-64 64zm320 0c-35.3 0-64-28.7-64-64s28.7-64 64-64 64 28.7 64 64-28.7 64-64 64z",
17
17
  fill: "currentColor"
18
18
  }, null, -1)
19
19
  ])]);
20
20
  }
21
- const K = /* @__PURE__ */ y(A, [["render", O]]), q = {}, W = {
21
+ const V = /* @__PURE__ */ v(B, [["render", K]]), q = {}, W = {
22
22
  viewBox: "0 0 1024 1024",
23
23
  xmlns: "http://www.w3.org/2000/svg",
24
24
  width: "20",
@@ -32,7 +32,7 @@ function j(c, e) {
32
32
  }, null, -1)
33
33
  ])]);
34
34
  }
35
- const P = /* @__PURE__ */ y(q, [["render", j]]), U = ["onClick"], F = /* @__PURE__ */ k({
35
+ const P = /* @__PURE__ */ v(q, [["render", j]]), U = ["onClick"], F = /* @__PURE__ */ k({
36
36
  __name: "NavSection",
37
37
  props: {
38
38
  sections: {},
@@ -40,7 +40,7 @@ const P = /* @__PURE__ */ y(q, [["render", j]]), U = ["onClick"], F = /* @__PURE
40
40
  },
41
41
  emits: ["select"],
42
42
  setup(c) {
43
- return (e, t) => (p(!0), f(L, null, D(c.sections, (n) => (p(), f("div", {
43
+ return (e, t) => (p(!0), f(C, null, D(c.sections, (n) => (p(), f("div", {
44
44
  key: n.key,
45
45
  class: m([e.$style.item, c.activeKey === n.key ? e.$style.active : ""]),
46
46
  onClick: (l) => e.$emit("select", n)
@@ -51,7 +51,7 @@ const P = /* @__PURE__ */ y(q, [["render", j]]), U = ["onClick"], F = /* @__PURE
51
51
  active: H
52
52
  }, Q = {
53
53
  $style: J
54
- }, Z = /* @__PURE__ */ y(F, [["__cssModules", Q]]);
54
+ }, Z = /* @__PURE__ */ v(F, [["__cssModules", Q]]);
55
55
  function tt(c = 100, e = 20) {
56
56
  const t = N({
57
57
  isDragging: !1,
@@ -70,13 +70,13 @@ function tt(c = 100, e = 20) {
70
70
  var E;
71
71
  if (!t.isDragging) return;
72
72
  const a = s instanceof TouchEvent ? s.touches[0].clientX : s.clientX, o = s instanceof TouchEvent ? s.touches[0].clientY : s.clientY;
73
- let i = t.startTop + (o - t.startY), h = t.startRight - (a - t.startX);
73
+ let i = t.startTop + (o - t.startY), u = t.startRight - (a - t.startX);
74
74
  const r = (E = document.querySelector(".plugin-view")) == null ? void 0 : E.getBoundingClientRect();
75
- let u = 0, M = window.innerHeight - t.height, T = 0, b = window.innerWidth - t.width;
76
- r && (u = r.top, M = r.bottom - t.height, T = window.innerWidth - r.right, b = window.innerWidth - r.left - t.width), t.top = Math.max(u, Math.min(M, i)), t.right = Math.max(T, Math.min(b, h));
75
+ let h = 0, M = window.innerHeight - t.height, T = 0, b = window.innerWidth - t.width;
76
+ r && (h = r.top, M = r.bottom - t.height, T = window.innerWidth - r.right, b = window.innerWidth - r.left - t.width), t.top = Math.max(h, Math.min(M, i)), t.right = Math.max(T, Math.min(b, u));
77
77
  }, g = (s, a) => {
78
- const o = s instanceof TouchEvent ? s.touches[0].clientX : s.clientX, i = s instanceof TouchEvent ? s.touches[0].clientY : s.clientY, r = s.target.closest(`.${a}`), u = r == null ? void 0 : r.getBoundingClientRect();
79
- u && (t.width = u.width, t.height = u.height), t.startTop = t.top, t.startRight = t.right, t.startX = o, t.startY = i, t.isDragging = !0;
78
+ const o = s instanceof TouchEvent ? s.touches[0].clientX : s.clientX, i = s instanceof TouchEvent ? s.touches[0].clientY : s.clientY, r = s.target.closest(`.${a}`), h = r == null ? void 0 : r.getBoundingClientRect();
79
+ h && (t.width = h.width, t.height = h.height), t.startTop = t.top, t.startRight = t.right, t.startX = o, t.startY = i, t.isDragging = !0;
80
80
  }, d = () => {
81
81
  t.isDragging = !1;
82
82
  };
@@ -90,7 +90,7 @@ function tt(c = 100, e = 20) {
90
90
  };
91
91
  }
92
92
  function et(c, e = {}) {
93
- const t = C("");
93
+ const t = L("");
94
94
  let n = null;
95
95
  const l = /* @__PURE__ */ new Map(), g = () => {
96
96
  n && (n.disconnect(), l.clear()), n = new IntersectionObserver(
@@ -108,9 +108,9 @@ function et(c, e = {}) {
108
108
  }
109
109
  ), document.querySelectorAll(".k-schema-header").forEach((a) => {
110
110
  const o = a.textContent || "";
111
- for (const [i, h] of Object.entries(c))
111
+ for (const [i, u] of Object.entries(c))
112
112
  if (o.includes(i)) {
113
- n == null || n.observe(a), l.set(a, h);
113
+ n == null || n.observe(a), l.set(a, u);
114
114
  break;
115
115
  }
116
116
  });
@@ -130,47 +130,35 @@ const ot = [
130
130
  { title: "好感度设置", key: "affinity" },
131
131
  { title: "黑名单设置", key: "blacklist" },
132
132
  { title: "关系设置", key: "relationship" },
133
- { title: "日程设置", key: "schedule" },
134
- { title: "天气设置", key: "weather" },
135
- { title: "原生工具", key: "nativeTools" },
136
- { title: "XML 工具", key: "xmlTools" },
137
- { title: "其他变量", key: "otherVariables" },
138
- { title: "其他指令", key: "otherCommands" },
133
+ { title: "变量设置", key: "variables" },
134
+ { title: "XML 工具设置", key: "xmlTools" },
139
135
  { title: "其他设置", key: "otherSettings" }
140
136
  ], nt = {
141
137
  好感度设置: "affinity",
142
138
  黑名单设置: "blacklist",
143
139
  关系设置: "relationship",
144
- 日程设置: "schedule",
145
- 天气设置: "weather",
146
- 原生工具: "nativeTools",
147
- "XML 工具": "xmlTools",
148
- 其他变量: "otherVariables",
149
- 其他指令: "otherCommands",
140
+ 变量设置: "variables",
141
+ "XML 工具设置": "xmlTools",
150
142
  其他设置: "otherSettings"
151
143
  }, st = {
152
144
  affinity: "好感度设置",
153
145
  blacklist: "黑名单设置",
154
146
  relationship: "关系设置",
155
- schedule: "日程设置",
156
- weather: "天气设置",
157
- nativeTools: "原生工具",
158
- xmlTools: "XML 工具",
159
- otherVariables: "其他变量",
160
- otherCommands: "其他指令",
147
+ variables: "变量设置",
148
+ xmlTools: "XML 工具设置",
161
149
  otherSettings: "其他设置"
162
150
  }, it = "koishi-plugin-chatluna-affinity", ct = /* @__PURE__ */ k({
163
151
  __name: "AffinityNav",
164
152
  setup(c) {
165
- const e = C(!1), t = (o) => {
153
+ const e = L(!1), t = (o) => {
166
154
  o.stopPropagation(), e.value = !e.value;
167
155
  }, { position: n, startDrag: l } = tt(100, 20), g = (o) => {
168
156
  l(o, "container");
169
157
  }, d = ot, { activeSection: s } = et(nt), a = (o) => {
170
158
  s.value = o.key;
171
159
  const i = document.querySelectorAll(".k-schema-header");
172
- for (let h = 0; h < i.length; h++) {
173
- const r = i[h];
160
+ for (let u = 0; u < i.length; u++) {
161
+ const r = i[u];
174
162
  if ((r.textContent || "").includes(st[o.key])) {
175
163
  r.scrollIntoView({ behavior: "smooth", block: "start" });
176
164
  return;
@@ -179,14 +167,14 @@ const ot = [
179
167
  };
180
168
  return (o, i) => (p(), f("div", {
181
169
  class: m([o.$style.container, e.value ? o.$style.collapsed : ""]),
182
- style: z(w(n))
170
+ style: z(y(n))
183
171
  }, [
184
172
  _("div", {
185
173
  class: m(o.$style.header),
186
174
  onMousedown: g,
187
175
  onTouchstart: g
188
176
  }, [
189
- v(K, {
177
+ w(V, {
190
178
  class: m(o.$style.move)
191
179
  }, null, 8, ["class"]),
192
180
  _("div", {
@@ -197,36 +185,36 @@ const ot = [
197
185
  onTouchstart: i[1] || (i[1] = S(() => {
198
186
  }, ["stop"]))
199
187
  }, [
200
- v(P)
188
+ w(P)
201
189
  ], 34)
202
190
  ], 34),
203
191
  _("div", {
204
192
  class: m(o.$style.body)
205
193
  }, [
206
- v(Z, {
207
- sections: w(d),
208
- "active-key": w(s),
194
+ w(Z, {
195
+ sections: y(d),
196
+ "active-key": y(s),
209
197
  onSelect: a
210
198
  }, null, 8, ["sections", "active-key"])
211
199
  ], 2)
212
200
  ], 6));
213
201
  }
214
- }), lt = "_container_pbgsl_2", rt = "_header_pbgsl_21", at = "_move_pbgsl_36", dt = "_toggle_pbgsl_45", ht = "_body_pbgsl_56", ut = "_collapsed_pbgsl_67", gt = {
202
+ }), lt = "_container_pbgsl_2", rt = "_header_pbgsl_21", at = "_move_pbgsl_36", dt = "_toggle_pbgsl_45", ut = "_body_pbgsl_56", ht = "_collapsed_pbgsl_67", gt = {
215
203
  container: lt,
216
204
  header: rt,
217
205
  move: at,
218
206
  toggle: dt,
219
- body: ht,
220
- collapsed: ut
207
+ body: ut,
208
+ collapsed: ht
221
209
  }, mt = {
222
210
  $style: gt
223
- }, pt = /* @__PURE__ */ y(ct, [["__cssModules", mt]]), _t = /* @__PURE__ */ k({
211
+ }, pt = /* @__PURE__ */ v(ct, [["__cssModules", mt]]), _t = /* @__PURE__ */ k({
224
212
  __name: "AffinityDetailsLoader",
225
213
  setup(c) {
226
214
  const e = I("plugin:name"), t = $(() => (e == null ? void 0 : e.value) === it);
227
- return (n, l) => t.value ? (p(), R(pt, { key: 0 })) : V("", !0);
215
+ return (n, l) => t.value ? (p(), R(pt, { key: 0 })) : A("", !0);
228
216
  }
229
- }), yt = (c) => {
217
+ }), vt = (c) => {
230
218
  c.slot({
231
219
  type: "plugin-details",
232
220
  component: _t,
@@ -234,5 +222,5 @@ const ot = [
234
222
  });
235
223
  };
236
224
  export {
237
- yt as default
225
+ vt as default
238
226
  };