koishi-plugin-chatluna 1.3.0-alpha.21 → 1.3.0-alpha.22

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
@@ -3398,7 +3398,6 @@ __name(mergeMessages, "mergeMessages");
3398
3398
  var import_koishi8 = require("koishi");
3399
3399
  var import_string2 = require("koishi-plugin-chatluna/utils/string");
3400
3400
  var import_types5 = require("koishi-plugin-chatluna/llm-core/platform/types");
3401
- var qface = __toESM(require("qface"), 1);
3402
3401
  function apply24(ctx, config, chain) {
3403
3402
  chain.middleware("read_chat_message", async (session, context) => {
3404
3403
  let message = context.command != null ? context.message : session.elements;
@@ -3457,19 +3456,18 @@ function apply24(ctx, config, chain) {
3457
3456
  ctx.chatluna.messageTransformer.intercept(
3458
3457
  "face",
3459
3458
  async (session, element, message) => {
3460
- const children = element.children?.[0];
3461
- if (children == null || children.type !== "image" || !(children.attrs["src"]?.includes(
3462
- "https://koishi.js.org/QFace"
3463
- ) ?? false)) {
3464
- return false;
3465
- }
3466
3459
  const originContent = message.content;
3467
- const face = qface.get(element.attrs["id"]);
3468
- const faceXml = `[face:${face.QSid}:${face.QDes}]`;
3460
+ const faceXml = `[face:${element.attrs.id}:${element.attrs.name}]`;
3469
3461
  if (typeof originContent === "string") {
3470
3462
  message.content = originContent + ` ${faceXml}`;
3471
3463
  } else {
3472
- ensureContentArray(message, faceXml);
3464
+ message.content = [
3465
+ ...originContent,
3466
+ {
3467
+ type: "text",
3468
+ text: ` ${faceXml}`
3469
+ }
3470
+ ];
3473
3471
  }
3474
3472
  return true;
3475
3473
  }
package/lib/index.mjs CHANGED
@@ -3395,7 +3395,6 @@ __name(mergeMessages, "mergeMessages");
3395
3395
  import { h as h4 } from "koishi";
3396
3396
  import { hashString } from "koishi-plugin-chatluna/utils/string";
3397
3397
  import { ModelCapabilities } from "koishi-plugin-chatluna/llm-core/platform/types";
3398
- import * as qface from "qface";
3399
3398
  function apply24(ctx, config, chain) {
3400
3399
  chain.middleware("read_chat_message", async (session, context) => {
3401
3400
  let message = context.command != null ? context.message : session.elements;
@@ -3454,19 +3453,18 @@ function apply24(ctx, config, chain) {
3454
3453
  ctx.chatluna.messageTransformer.intercept(
3455
3454
  "face",
3456
3455
  async (session, element, message) => {
3457
- const children = element.children?.[0];
3458
- if (children == null || children.type !== "image" || !(children.attrs["src"]?.includes(
3459
- "https://koishi.js.org/QFace"
3460
- ) ?? false)) {
3461
- return false;
3462
- }
3463
3456
  const originContent = message.content;
3464
- const face = qface.get(element.attrs["id"]);
3465
- const faceXml = `[face:${face.QSid}:${face.QDes}]`;
3457
+ const faceXml = `[face:${element.attrs.id}:${element.attrs.name}]`;
3466
3458
  if (typeof originContent === "string") {
3467
3459
  message.content = originContent + ` ${faceXml}`;
3468
3460
  } else {
3469
- ensureContentArray(message, faceXml);
3461
+ message.content = [
3462
+ ...originContent,
3463
+ {
3464
+ type: "text",
3465
+ text: ` ${faceXml}`
3466
+ }
3467
+ ];
3470
3468
  }
3471
3469
  return true;
3472
3470
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-chatluna",
3
3
  "description": "chatluna for koishi",
4
- "version": "1.3.0-alpha.21",
4
+ "version": "1.3.0-alpha.22",
5
5
  "main": "lib/index.cjs",
6
6
  "module": "lib/index.mjs",
7
7
  "typings": "lib/index.d.ts",
@@ -226,7 +226,6 @@
226
226
  "undici": "^6.21.2",
227
227
  "uuid": "^9.0.1",
228
228
  "ws": "^8.18.1",
229
- "qface": "^1.4.1",
230
229
  "zod": "^3.25.0-canary.20250211T214501",
231
230
  "zod-to-json-schema": "^3.24.5"
232
231
  },