@jeik/dingtalk-connector 0.8.21-fix7 → 0.8.21-fix8
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.
|
@@ -294,16 +294,14 @@ function saveCredentials(clientId, clientSecret, { isLocal = false, pluginInstal
|
|
|
294
294
|
|
|
295
295
|
// ── plugin install ─────────────────────────────────────────────
|
|
296
296
|
function getInstallSpec() {
|
|
297
|
-
//
|
|
297
|
+
// 永远钉住"本包自己的精确版本",让 openclaw 内部装的版本 == 你 npx 实际下到的版本。
|
|
298
|
+
// npx @fix / @0.8.21-fix7 / @latest / 不带 → 各自下到对应包 → 这里读到的就是那个版本。
|
|
299
|
+
// 不带版本号会让 openclaw 装 latest,导致"跑 fix 向导却装了正式版"那个坑。
|
|
298
300
|
try {
|
|
299
|
-
const
|
|
300
|
-
|
|
301
|
-
// 任何预发布版(含 -)都钉精确版本,否则 openclaw 会装 latest(如 -fix6 被当稳定版误装成 0.8.21)
|
|
302
|
-
if (version && version.includes('-')) {
|
|
303
|
-
return `${PKG_NAME}@${version}`;
|
|
304
|
-
}
|
|
301
|
+
const { version } = createRequire(import.meta.url)('../package.json');
|
|
302
|
+
if (version) return `${PKG_NAME}@${version}`;
|
|
305
303
|
} catch {}
|
|
306
|
-
return PKG_NAME;
|
|
304
|
+
return PKG_NAME; // 兜底:读不到版本才退回不带版本(极少见)
|
|
307
305
|
}
|
|
308
306
|
|
|
309
307
|
// 在 plugins.load.paths 扫描范围内找会"遮蔽"npm 版的本地 dingtalk 插件副本。
|
|
@@ -665,14 +663,21 @@ async function ensureDwsCli() {
|
|
|
665
663
|
const versionDisplay = installedVersion ? `v${installedVersion}` : 'unknown version';
|
|
666
664
|
|
|
667
665
|
if (!targetVersion) {
|
|
668
|
-
// @latest
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
console.log(
|
|
666
|
+
// @latest 模式:已安装则询问是否跳过更新(默认跳过,保留当前版本)
|
|
667
|
+
const ans = await askUserConfirmation(
|
|
668
|
+
` 检测到 dws CLI 已安装 (${versionDisplay}),是否跳过更新?(skip dws update?) [Y/n] `,
|
|
669
|
+
);
|
|
670
|
+
if (ans === 'n' || ans === 'no') {
|
|
671
|
+
console.log(dim(` 正在更新 dws CLI 到最新版...`) + '\n');
|
|
672
|
+
const ok = installDwsCli();
|
|
673
|
+
if (ok) {
|
|
674
|
+
const nv = getInstalledDwsVersion();
|
|
675
|
+
console.log(green(` ✔ dws CLI is now ${nv ? 'v' + nv : 'latest'}`) + '\n');
|
|
676
|
+
} else {
|
|
677
|
+
console.log(red(' ⚠ Update failed. Continuing with current version.') + '\n');
|
|
678
|
+
}
|
|
674
679
|
} else {
|
|
675
|
-
console.log(
|
|
680
|
+
console.log(dim(` 已跳过更新,保留当前版本 ${versionDisplay}。`) + '\n');
|
|
676
681
|
}
|
|
677
682
|
// 鉴权状态检查(与下方同逻辑)
|
|
678
683
|
if (isDwsAuthenticated()) {
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as initDingtalkPluginConfigSchema, i as dingtalkPlugin, n as setDingtalkRuntime } from "./runtime-
|
|
1
|
+
import { a as initDingtalkPluginConfigSchema, i as dingtalkPlugin, n as setDingtalkRuntime } from "./runtime-vdFNy2P8.mjs";
|
|
2
2
|
import { t as registerGatewayMethods } from "./gateway-methods-DM8lWI4F.mjs";
|
|
3
3
|
//#region index.ts
|
|
4
4
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { u as uploadMediaToDingTalk } from "./media-cz72EVS3.mjs";
|
|
2
2
|
import { a as resolveDingtalkAccount } from "./accounts-BAzdqkAV.mjs";
|
|
3
|
-
import { r as CHANNEL_ID, t as getDingtalkRuntime } from "./runtime-
|
|
3
|
+
import { r as CHANNEL_ID, t as getDingtalkRuntime } from "./runtime-vdFNy2P8.mjs";
|
|
4
4
|
import { n as createLoggerFromConfig } from "./logger-mZ9OSbmD.mjs";
|
|
5
5
|
import { t as dingtalkHttp } from "./http-client-DFWZgO1n.mjs";
|
|
6
6
|
import { i as getOapiAccessToken } from "./utils-CIfI_3Jh.mjs";
|
|
@@ -485,7 +485,6 @@ function createDingtalkReplyDispatcher(params) {
|
|
|
485
485
|
processMarkerLogged = false;
|
|
486
486
|
finalMarkerLogged = false;
|
|
487
487
|
markerSystemActive = false;
|
|
488
|
-
if (streamingEnabled) startStreaming();
|
|
489
488
|
typingCallbacks.onActive?.();
|
|
490
489
|
},
|
|
491
490
|
deliver: async (payload, info) => {
|
|
@@ -919,7 +919,7 @@ async function monitorDingtalkProvider(opts = {}) {
|
|
|
919
919
|
const log = createLogger(cfg.channels?.["dingtalk-connector"]?.debug ?? false);
|
|
920
920
|
const [accountsModule, monitorAccountModule, monitorSingleModule] = await Promise.all([
|
|
921
921
|
import("./accounts-BQptOmgB.mjs"),
|
|
922
|
-
import("./message-handler-
|
|
922
|
+
import("./message-handler-BSpEBVN0.mjs"),
|
|
923
923
|
import("./connection-DHHFFNQJ.mjs")
|
|
924
924
|
]);
|
|
925
925
|
const { resolveDingtalkAccount, listEnabledDingtalkAccounts } = accountsModule;
|
package/package.json
CHANGED
package/src/reply-dispatcher.ts
CHANGED
|
@@ -556,10 +556,9 @@ export function createDingtalkReplyDispatcher(params: CreateDingtalkReplyDispatc
|
|
|
556
556
|
processMarkerLogged = false;
|
|
557
557
|
finalMarkerLogged = false;
|
|
558
558
|
markerSystemActive = false;
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
}
|
|
559
|
+
// 延迟建卡:不在 onReplyStart 抢先建卡,改由第一段真正的对话内容(onPartialReply /
|
|
560
|
+
// deliver block/final)按需创建。否则纯 message 工具轮次(无对话回复,deliver 计数全 0)
|
|
561
|
+
// 会留下一张没人喂的孤儿卡,收尾兜底成"无文本输出"。
|
|
563
562
|
typingCallbacks.onActive?.();
|
|
564
563
|
},
|
|
565
564
|
deliver: async (payload, info) => {
|