liangzimixin 0.3.93 → 0.3.94
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.cjs
CHANGED
|
@@ -31618,7 +31618,9 @@ var InboundPipeline = class {
|
|
|
31618
31618
|
async handle(msg) {
|
|
31619
31619
|
const startMs = Date.now();
|
|
31620
31620
|
const semaphore = this.deps.messagePipe.semaphore;
|
|
31621
|
+
const semaphoreStartMs = Date.now();
|
|
31621
31622
|
const acquireResult = await semaphore.acquire();
|
|
31623
|
+
metrics.recordLatency("inbound.semaphore_wait", Date.now() - semaphoreStartMs);
|
|
31622
31624
|
if (acquireResult === "rejected") {
|
|
31623
31625
|
metrics.increment("inbound.semaphore_rejected");
|
|
31624
31626
|
log15.warn("\u{1F6AB} \u6D88\u606F\u88AB\u62D2\u7EDD (Semaphore \u6EA2\u51FA)", {
|
|
@@ -31778,6 +31780,7 @@ var InboundPipeline = class {
|
|
|
31778
31780
|
}).catch((err) => {
|
|
31779
31781
|
log15.warn("\u26A0\uFE0F \u5373\u65F6\u53CD\u9988\u53D1\u9001\u5931\u8D25", { error: err.message });
|
|
31780
31782
|
});
|
|
31783
|
+
const contentResolveStartMs = Date.now();
|
|
31781
31784
|
const resolvedContent = await resolveContent(context, {
|
|
31782
31785
|
tokenManager: this.deps.tokenManager,
|
|
31783
31786
|
fileServerUrl: this.deps.pluginConfig.file.fileServiceBaseUrl,
|
|
@@ -31788,6 +31791,7 @@ var InboundPipeline = class {
|
|
|
31788
31791
|
messagePipe: this.deps.messagePipe,
|
|
31789
31792
|
fileEncryptionMeta: msg.fileEncryptionMeta
|
|
31790
31793
|
});
|
|
31794
|
+
metrics.recordLatency("inbound.content_resolve", Date.now() - contentResolveStartMs);
|
|
31791
31795
|
const payload = buildInboundPayload(msg, resolvedContent, this.deps.pluginConfig);
|
|
31792
31796
|
const { sdkConfig } = this.deps;
|
|
31793
31797
|
const ctx = core.channel.reply.finalizeInboundContext(payload);
|
|
@@ -31815,6 +31819,7 @@ var InboundPipeline = class {
|
|
|
31815
31819
|
chatId: msg.chatId,
|
|
31816
31820
|
\u5185\u5BB9\u9884\u89C8: String(payload.Body ?? "").slice(0, 200)
|
|
31817
31821
|
});
|
|
31822
|
+
const aiStartMs = Date.now();
|
|
31818
31823
|
const { counts } = await core.channel.reply.dispatchReplyFromConfig({
|
|
31819
31824
|
ctx,
|
|
31820
31825
|
cfg: sdkConfig,
|
|
@@ -31824,12 +31829,16 @@ var InboundPipeline = class {
|
|
|
31824
31829
|
if (typeof dispatcher.waitForIdle === "function") {
|
|
31825
31830
|
await dispatcher.waitForIdle();
|
|
31826
31831
|
}
|
|
31832
|
+
metrics.recordLatency("inbound.ai_reply", Date.now() - aiStartMs);
|
|
31833
|
+
const aiDurationMs = Date.now() - aiStartMs;
|
|
31827
31834
|
const durationMs = Date.now() - startMs;
|
|
31828
31835
|
log15.info("\u2705 \u6D88\u606F\u5904\u7406\u5B8C\u6210", {
|
|
31829
31836
|
messageId: msg.messageId,
|
|
31830
31837
|
chatId: msg.chatId,
|
|
31831
31838
|
\u56DE\u590D\u6570: counts?.final ?? 0,
|
|
31832
|
-
\u8017\u65F6ms: durationMs
|
|
31839
|
+
\u8017\u65F6ms: durationMs,
|
|
31840
|
+
AI\u56DE\u590Dms: aiDurationMs,
|
|
31841
|
+
\u63D2\u4EF6\u5904\u7406ms: durationMs - aiDurationMs
|
|
31833
31842
|
});
|
|
31834
31843
|
clearInboundEncryptionStatus(msg.chatId, msg.messageId);
|
|
31835
31844
|
} catch (err) {
|
package/dist/package.json
CHANGED
package/dist/setup-entry.cjs
CHANGED
|
@@ -34060,7 +34060,9 @@ var InboundPipeline = class {
|
|
|
34060
34060
|
async handle(msg) {
|
|
34061
34061
|
const startMs = Date.now();
|
|
34062
34062
|
const semaphore = this.deps.messagePipe.semaphore;
|
|
34063
|
+
const semaphoreStartMs = Date.now();
|
|
34063
34064
|
const acquireResult = await semaphore.acquire();
|
|
34065
|
+
metrics.recordLatency("inbound.semaphore_wait", Date.now() - semaphoreStartMs);
|
|
34064
34066
|
if (acquireResult === "rejected") {
|
|
34065
34067
|
metrics.increment("inbound.semaphore_rejected");
|
|
34066
34068
|
log28.warn("\u{1F6AB} \u6D88\u606F\u88AB\u62D2\u7EDD (Semaphore \u6EA2\u51FA)", {
|
|
@@ -34220,6 +34222,7 @@ var InboundPipeline = class {
|
|
|
34220
34222
|
}).catch((err) => {
|
|
34221
34223
|
log28.warn("\u26A0\uFE0F \u5373\u65F6\u53CD\u9988\u53D1\u9001\u5931\u8D25", { error: err.message });
|
|
34222
34224
|
});
|
|
34225
|
+
const contentResolveStartMs = Date.now();
|
|
34223
34226
|
const resolvedContent = await resolveContent(context, {
|
|
34224
34227
|
tokenManager: this.deps.tokenManager,
|
|
34225
34228
|
fileServerUrl: this.deps.pluginConfig.file.fileServiceBaseUrl,
|
|
@@ -34230,6 +34233,7 @@ var InboundPipeline = class {
|
|
|
34230
34233
|
messagePipe: this.deps.messagePipe,
|
|
34231
34234
|
fileEncryptionMeta: msg.fileEncryptionMeta
|
|
34232
34235
|
});
|
|
34236
|
+
metrics.recordLatency("inbound.content_resolve", Date.now() - contentResolveStartMs);
|
|
34233
34237
|
const payload = buildInboundPayload(msg, resolvedContent, this.deps.pluginConfig);
|
|
34234
34238
|
const { sdkConfig } = this.deps;
|
|
34235
34239
|
const ctx = core.channel.reply.finalizeInboundContext(payload);
|
|
@@ -34257,6 +34261,7 @@ var InboundPipeline = class {
|
|
|
34257
34261
|
chatId: msg.chatId,
|
|
34258
34262
|
\u5185\u5BB9\u9884\u89C8: String(payload.Body ?? "").slice(0, 200)
|
|
34259
34263
|
});
|
|
34264
|
+
const aiStartMs = Date.now();
|
|
34260
34265
|
const { counts } = await core.channel.reply.dispatchReplyFromConfig({
|
|
34261
34266
|
ctx,
|
|
34262
34267
|
cfg: sdkConfig,
|
|
@@ -34266,12 +34271,16 @@ var InboundPipeline = class {
|
|
|
34266
34271
|
if (typeof dispatcher.waitForIdle === "function") {
|
|
34267
34272
|
await dispatcher.waitForIdle();
|
|
34268
34273
|
}
|
|
34274
|
+
metrics.recordLatency("inbound.ai_reply", Date.now() - aiStartMs);
|
|
34275
|
+
const aiDurationMs = Date.now() - aiStartMs;
|
|
34269
34276
|
const durationMs = Date.now() - startMs;
|
|
34270
34277
|
log28.info("\u2705 \u6D88\u606F\u5904\u7406\u5B8C\u6210", {
|
|
34271
34278
|
messageId: msg.messageId,
|
|
34272
34279
|
chatId: msg.chatId,
|
|
34273
34280
|
\u56DE\u590D\u6570: counts?.final ?? 0,
|
|
34274
|
-
\u8017\u65F6ms: durationMs
|
|
34281
|
+
\u8017\u65F6ms: durationMs,
|
|
34282
|
+
AI\u56DE\u590Dms: aiDurationMs,
|
|
34283
|
+
\u63D2\u4EF6\u5904\u7406ms: durationMs - aiDurationMs
|
|
34275
34284
|
});
|
|
34276
34285
|
clearInboundEncryptionStatus(msg.chatId, msg.messageId);
|
|
34277
34286
|
} catch (err) {
|
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@ REM liangzimixin install script (Windows)
|
|
|
18
18
|
REM Usage: liangzimixin_install.bat <appId> <appSecret> [quantumAccount]
|
|
19
19
|
REM ============================================================
|
|
20
20
|
|
|
21
|
-
set "SCRIPT_VERSION=0.3.
|
|
21
|
+
set "SCRIPT_VERSION=0.3.94"
|
|
22
22
|
set "NPM_PACKAGE=liangzimixin"
|
|
23
23
|
|
|
24
24
|
set "SKIP_SELF_UPDATE=0"
|
|
@@ -34,6 +34,8 @@ for %%a in (%*) do (
|
|
|
34
34
|
set "SKIP_SELF_UPDATE=1"
|
|
35
35
|
) else if "%%a"=="--beta" (
|
|
36
36
|
set "USE_BETA=1"
|
|
37
|
+
) else if "%%a"=="--internal-logged" (
|
|
38
|
+
REM skip internal flag
|
|
37
39
|
) else (
|
|
38
40
|
set /a IDX+=1
|
|
39
41
|
if !IDX!==1 set "APP_ID=%%a"
|
|
@@ -14,7 +14,7 @@ echo -e "\033[0;36m▸\033[0m Deployment log will be saved to $LOG_FILE"
|
|
|
14
14
|
# 用法: ./liangzimixin_install.sh <appId> <appSecret> [quantumAccount]
|
|
15
15
|
# ============================================================
|
|
16
16
|
|
|
17
|
-
SCRIPT_VERSION="0.3.
|
|
17
|
+
SCRIPT_VERSION="0.3.94"
|
|
18
18
|
NPM_PACKAGE="liangzimixin"
|
|
19
19
|
|
|
20
20
|
# ── 颜色 ──────────────────────────────────────────────────────
|