@zaofan/dsh-qqbot 1.13.26 → 1.13.29
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/client/qqbot-settings.js +289 -11
- package/dist/channel-tools.d.ts +33 -0
- package/dist/channel-tools.d.ts.map +1 -1
- package/dist/channel-tools.js +174 -36
- package/dist/channel-tools.js.map +1 -1
- package/dist/config.d.ts +93 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +45 -0
- package/dist/config.js.map +1 -1
- package/dist/features/image-path-surface.d.ts +38 -0
- package/dist/features/image-path-surface.d.ts.map +1 -0
- package/dist/features/image-path-surface.js +225 -0
- package/dist/features/image-path-surface.js.map +1 -0
- package/dist/features/qun-login.d.ts +21 -0
- package/dist/features/qun-login.d.ts.map +1 -1
- package/dist/features/qun-login.js +202 -59
- package/dist/features/qun-login.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +56 -1
- package/dist/index.js.map +1 -1
- package/dist/middleware/sticker-capture.d.ts +9 -0
- package/dist/middleware/sticker-capture.d.ts.map +1 -1
- package/dist/middleware/sticker-capture.js +56 -19
- package/dist/middleware/sticker-capture.js.map +1 -1
- package/dist/session/session-manager.d.ts.map +1 -1
- package/dist/session/session-manager.js +89 -5
- package/dist/session/session-manager.js.map +1 -1
- package/dist/transport/inbound.d.ts.map +1 -1
- package/dist/transport/inbound.js +58 -23
- package/dist/transport/inbound.js.map +1 -1
- package/examples/ext-tools/send_md3.mjs +406 -345
- package/package.json +4 -3
package/dist/channel-tools.js
CHANGED
|
@@ -615,6 +615,11 @@ function stickerStoreOf(exec) {
|
|
|
615
615
|
* 调用方(session-manager)知道自己是谁,必须把根传进来。
|
|
616
616
|
* @param opts.cwd 本实例的工作目录(扩展 runner 的 env.cwd)
|
|
617
617
|
*/
|
|
618
|
+
/**
|
|
619
|
+
* @param opts.config 当前插件配置(2026-11-26,issue #94 加)。
|
|
620
|
+
* 装载方 SessionManager 手里有 `this.config`,沿参数链传进来即可 ——
|
|
621
|
+
* 这样工具可见性判定能读到用户配置,不必去猜或读全局。
|
|
622
|
+
*/
|
|
618
623
|
export async function apply(ctx, opts) {
|
|
619
624
|
// ★★★ 2026-10-31:记住本插件的 apply ctx —— expose:'all' 的工具必须注册到**这个** ctx 上,
|
|
620
625
|
// 才能和普通扩展工具(下面的 `ctx.tools.register`)处在同一个作用域。
|
|
@@ -3014,47 +3019,83 @@ export async function apply(ctx, opts) {
|
|
|
3014
3019
|
// ✅ 全局注册统一交给 session-manager 的 pre-step 用**插件根 ctx** 做:
|
|
3015
3020
|
// `ensureContextToolsGlobal(this.ctx)` —— 它内部用 `ctx.get('tools')` 取服务,绕开 inject 限制。
|
|
3016
3021
|
// 这里只保留下面 ②段"QQ 群管理工具"的按会话注册(那本来就是会话级工具)。
|
|
3022
|
+
/**
|
|
3023
|
+
* 工具定义(2026-11-26,issue #94)。
|
|
3024
|
+
*
|
|
3025
|
+
* ★ `scope` 是**必填**的:它决定这个工具在「只要私聊」这类配置下会不会被注册。
|
|
3026
|
+
* 必填的意义 —— 新增工具时忘了标记,TypeScript 直接报错,而不是运行时静默漏掉,
|
|
3027
|
+
* 让用户再提一次「XX 工具关不掉」(这正是 issue #94 的成因)。
|
|
3028
|
+
* · group 纯群治理(没有群就是空壳)
|
|
3029
|
+
* · cross 跨会话投递(私聊用户也可能要)
|
|
3030
|
+
* · memo 人物记忆
|
|
3031
|
+
* · base 其余:媒体 / 表情 / 会话控制 / 定时
|
|
3032
|
+
*/
|
|
3017
3033
|
const toolDefs = [
|
|
3018
|
-
{ name: 'send_media', tool: sendMediaTool },
|
|
3019
|
-
{ name: 'recall_message', tool: recallTool },
|
|
3020
|
-
{ name: 'text_break', tool: textBreakTool },
|
|
3021
|
-
{ name: 'quote_view', tool: quoteViewTool },
|
|
3022
|
-
{ name: 'people_memo', tool: peopleMemoTool },
|
|
3034
|
+
{ name: 'send_media', tool: sendMediaTool, scope: 'base' },
|
|
3035
|
+
{ name: 'recall_message', tool: recallTool, scope: 'base' },
|
|
3036
|
+
{ name: 'text_break', tool: textBreakTool, scope: 'base' },
|
|
3037
|
+
{ name: 'quote_view', tool: quoteViewTool, scope: 'base' },
|
|
3038
|
+
{ name: 'people_memo', tool: peopleMemoTool, scope: 'memo' },
|
|
3023
3039
|
// 无上下文模式·智能判断专用(全局开关 config.contextlessSmart 开启时才出现)
|
|
3024
3040
|
...(getContextlessSmartGlobal() === true
|
|
3025
3041
|
? []
|
|
3026
3042
|
: []),
|
|
3027
|
-
{ name: 'tools_reload', tool: toolsReloadTool },
|
|
3028
|
-
{ name: 'reply_gate', tool: replyGateTool },
|
|
3029
|
-
{ name: 'outbound_mode', tool: outboundModeTool },
|
|
3030
|
-
{ name: 'group_join_requests', tool: listJoinRequestsTool },
|
|
3031
|
-
{ name: 'group_approve_join', tool: approveJoinTool },
|
|
3032
|
-
{ name: 'group_join_auto', tool: autoApproveJoinTool },
|
|
3033
|
-
{ name: 'group_mute_state', tool: muteStateTool },
|
|
3034
|
-
{ name: 'group_mute_member', tool: muteMemberTool },
|
|
3035
|
-
{ name: 'group_recall', tool: groupRecallTool },
|
|
3036
|
-
{ name: 'group_msg_search', tool: msgSearchTool },
|
|
3037
|
-
{ name: 'group_recall_batch', tool: recallBatchTool },
|
|
3038
|
-
{ name: 'recall_keywords', tool: recallKeywordsTool },
|
|
3039
|
-
{ name: 'group_kick', tool: kickMemberTool },
|
|
3040
|
-
{ name: 'qq_material', tool: materialTool },
|
|
3041
|
-
{ name: 'id_lookup', tool: idLookupTool },
|
|
3042
|
-
{ name: 'session_list', tool: sessionListTool },
|
|
3043
|
-
{ name: 'session_wake', tool: sessionWakeTool },
|
|
3044
|
-
{ name: 'broadcast_send', tool: broadcastSendTool },
|
|
3045
|
-
{ name: 'target_group', tool: targetGroupTool },
|
|
3046
|
-
{ name: 'list_stickers', tool: listStickersTool },
|
|
3047
|
-
{ name: 'sticker_tag', tool: tagStickerTool },
|
|
3048
|
-
{ name: 'sticker_delete', tool: deleteStickerTool },
|
|
3049
|
-
{ name: 'sticker_restore', tool: restoreStickerTool },
|
|
3050
|
-
{ name: 'sticker_stats', tool: statsStickerTool },
|
|
3051
|
-
{ name: 'sticker_untagged', tool: untaggedStickerTool },
|
|
3052
|
-
{ name: 'schedule_timer', tool: scheduleTimerTool },
|
|
3053
|
-
{ name: 'schedule_cancel', tool: scheduleCancelTool },
|
|
3043
|
+
{ name: 'tools_reload', tool: toolsReloadTool, scope: 'base' },
|
|
3044
|
+
{ name: 'reply_gate', tool: replyGateTool, scope: 'base' },
|
|
3045
|
+
{ name: 'outbound_mode', tool: outboundModeTool, scope: 'base' },
|
|
3046
|
+
{ name: 'group_join_requests', tool: listJoinRequestsTool, scope: 'group' },
|
|
3047
|
+
{ name: 'group_approve_join', tool: approveJoinTool, scope: 'group' },
|
|
3048
|
+
{ name: 'group_join_auto', tool: autoApproveJoinTool, scope: 'group' },
|
|
3049
|
+
{ name: 'group_mute_state', tool: muteStateTool, scope: 'group' },
|
|
3050
|
+
{ name: 'group_mute_member', tool: muteMemberTool, scope: 'group' },
|
|
3051
|
+
{ name: 'group_recall', tool: groupRecallTool, scope: 'group' },
|
|
3052
|
+
{ name: 'group_msg_search', tool: msgSearchTool, scope: 'group' },
|
|
3053
|
+
{ name: 'group_recall_batch', tool: recallBatchTool, scope: 'group' },
|
|
3054
|
+
{ name: 'recall_keywords', tool: recallKeywordsTool, scope: 'group' },
|
|
3055
|
+
{ name: 'group_kick', tool: kickMemberTool, scope: 'group' },
|
|
3056
|
+
{ name: 'qq_material', tool: materialTool, scope: 'base' },
|
|
3057
|
+
{ name: 'id_lookup', tool: idLookupTool, scope: 'cross' },
|
|
3058
|
+
{ name: 'session_list', tool: sessionListTool, scope: 'cross' },
|
|
3059
|
+
{ name: 'session_wake', tool: sessionWakeTool, scope: 'cross' },
|
|
3060
|
+
{ name: 'broadcast_send', tool: broadcastSendTool, scope: 'cross' },
|
|
3061
|
+
{ name: 'target_group', tool: targetGroupTool, scope: 'cross' },
|
|
3062
|
+
{ name: 'list_stickers', tool: listStickersTool, scope: 'base' },
|
|
3063
|
+
{ name: 'sticker_tag', tool: tagStickerTool, scope: 'base' },
|
|
3064
|
+
{ name: 'sticker_delete', tool: deleteStickerTool, scope: 'base' },
|
|
3065
|
+
{ name: 'sticker_restore', tool: restoreStickerTool, scope: 'base' },
|
|
3066
|
+
{ name: 'sticker_stats', tool: statsStickerTool, scope: 'base' },
|
|
3067
|
+
{ name: 'sticker_untagged', tool: untaggedStickerTool, scope: 'base' },
|
|
3068
|
+
{ name: 'schedule_timer', tool: scheduleTimerTool, scope: 'base' },
|
|
3069
|
+
{ name: 'schedule_cancel', tool: scheduleCancelTool, scope: 'base' },
|
|
3054
3070
|
];
|
|
3071
|
+
// ★ 2026-11-26(issue #94):内置工具终于也有「条件可见」了 ——
|
|
3072
|
+
// 照抄扩展工具那套 `enabled(env)` 的语义(见 extension-store.ts 的同名注释):
|
|
3073
|
+
// **注册前判定,返回 false 就 continue ⇒ AI 完全看不见**,
|
|
3074
|
+
// 而不是"看得见但报错"。这样它的 describe 也不再每轮占 context。
|
|
3075
|
+
// 判定为假时顺手回收旧句柄(若之前注册过),实现「关了就是真关」。
|
|
3076
|
+
const skipped = [];
|
|
3077
|
+
const myDisposers = disposerBucketOf(ctx); // ★ P0-4:按本 agent 分桶
|
|
3078
|
+
let okCount = 0; // ★ P1-4:真实注册成功数(原口径把失败也算进去了)
|
|
3055
3079
|
for (const t of toolDefs) {
|
|
3080
|
+
if (!toolVisible(t.name, t.scope, opts?.config)) {
|
|
3081
|
+
const stale = myDisposers.get(t.name);
|
|
3082
|
+
if (stale) {
|
|
3083
|
+
try {
|
|
3084
|
+
stale();
|
|
3085
|
+
}
|
|
3086
|
+
catch { /* 旧句柄已失效 */ }
|
|
3087
|
+
myDisposers.delete(t.name);
|
|
3088
|
+
}
|
|
3089
|
+
skipped.push(t.name);
|
|
3090
|
+
diag(`条件隐藏(配置关闭): ${t.name}`);
|
|
3091
|
+
continue;
|
|
3092
|
+
}
|
|
3056
3093
|
try {
|
|
3057
|
-
|
|
3094
|
+
// ★ 收下 disposer(original 是直接丢弃的,于是「热关闭」不可能 —— issue #94 的另一半)
|
|
3095
|
+
const dispose = ctx.tools.register(t.tool);
|
|
3096
|
+
if (typeof dispose === 'function')
|
|
3097
|
+
myDisposers.set(t.name, dispose);
|
|
3098
|
+
okCount += 1;
|
|
3058
3099
|
ctx.logger?.info?.(`[channel-tools] 已注册: ${t.name}`);
|
|
3059
3100
|
diag(`注册成功: ${t.name}`);
|
|
3060
3101
|
}
|
|
@@ -3069,6 +3110,22 @@ export async function apply(ctx, opts) {
|
|
|
3069
3110
|
diag(`注册失败: ${t.name} → ${msg}`);
|
|
3070
3111
|
}
|
|
3071
3112
|
}
|
|
3113
|
+
// 一行可验证的收尾日志(issue #94 的验收标准:从「能关」变成「能验证关了」)
|
|
3114
|
+
// ★ P1-3:ensureChannelTools 是**每条入站消息**调一次,全量打 info 会把日志淹掉。
|
|
3115
|
+
// 只在「本次有隐藏」或「隐藏集合变了」时打 info,其余降到 diag。
|
|
3116
|
+
const sig = skipped.join(',') || '(none)';
|
|
3117
|
+
if (sig !== lastVisibilitySig) {
|
|
3118
|
+
lastVisibilitySig = sig;
|
|
3119
|
+
if (skipped.length > 0) {
|
|
3120
|
+
ctx.logger?.info?.(`[channel-tools] 按配置隐藏 ${skipped.length} 个工具(${okCount}/${toolDefs.length} 已注册): ${skipped.join(', ')}`);
|
|
3121
|
+
}
|
|
3122
|
+
else {
|
|
3123
|
+
ctx.logger?.info?.(`[channel-tools] 全部 ${toolDefs.length} 个工具已注册(未配置隐藏)`);
|
|
3124
|
+
}
|
|
3125
|
+
}
|
|
3126
|
+
else {
|
|
3127
|
+
diag(`可见性未变: ${okCount}/${toolDefs.length} 已注册, 隐藏 ${skipped.length}`);
|
|
3128
|
+
}
|
|
3072
3129
|
// ══════════════════════════════════════════════════════════════════════════
|
|
3073
3130
|
// expose:'all' 支撑(2026-10-10 主人定)—— 扩展工具的"跨通道"能力
|
|
3074
3131
|
// ══════════════════════════════════════════════════════════════════════════
|
|
@@ -3820,6 +3877,68 @@ var contextDropTool = defineTool({
|
|
|
3820
3877
|
* 而"某个人到底是哪个 QQ"这种需求只有这条老网页版通道能满足。
|
|
3821
3878
|
* 所以 `group_kick`(官方 API)和它**并存**,各管一边,不要互相替代。
|
|
3822
3879
|
*/
|
|
3880
|
+
// ══════════════════════════════════════════════════════════════════════════
|
|
3881
|
+
// 工具可见性(2026-11-26,issue #94)
|
|
3882
|
+
// ══════════════════════════════════════════════════════════════════════════
|
|
3883
|
+
//
|
|
3884
|
+
// 语义与扩展工具的 `enabled(env)` 完全一致(见 extension-store.ts:211-221):
|
|
3885
|
+
// **注册前判定,false ⇒ 不注册**,AI 完全看不见,其 schema 也不再占 context。
|
|
3886
|
+
// 不配置 = 永远可见 ⇒ 存量用户行为逐字不变。
|
|
3887
|
+
//
|
|
3888
|
+
// 两层结构:类开关给默认值,单项 overrides 给它做例外。
|
|
3889
|
+
/**
|
|
3890
|
+
* 已注册内置工具的 disposer,用于「改配置后真的能撤销」(原来 register 的返回值被直接丢弃)。
|
|
3891
|
+
*
|
|
3892
|
+
* ⚠️ 2026-11-26(审核 P0-4):必须**按 agentCtx 分桶**。
|
|
3893
|
+
* `ctx.tools.register()` 是 per-agent 各注册一份,若只用工具名做 key(模块级 Map),
|
|
3894
|
+
* 会话 B 的 apply 会把会话 A 的句柄覆盖掉 ⇒ A 的那份永远撤不掉,还会出现
|
|
3895
|
+
* 「撤掉的是别的会话的工具」。
|
|
3896
|
+
* 用 WeakMap 查(不阻止 ctx 回收)+ Map 登记桶(需要枚举时用)。
|
|
3897
|
+
*/
|
|
3898
|
+
/** 上一次的隐藏集合签名(用于抑制重复 info 日志,见 P1-3) */
|
|
3899
|
+
let lastVisibilitySig = '';
|
|
3900
|
+
const builtinDisposerBuckets = new WeakMap();
|
|
3901
|
+
function disposerBucketOf(ctx) {
|
|
3902
|
+
const key = ctx;
|
|
3903
|
+
let m = builtinDisposerBuckets.get(key);
|
|
3904
|
+
if (!m) {
|
|
3905
|
+
m = new Map();
|
|
3906
|
+
builtinDisposerBuckets.set(key, m);
|
|
3907
|
+
}
|
|
3908
|
+
return m;
|
|
3909
|
+
}
|
|
3910
|
+
/**
|
|
3911
|
+
* 这个工具在**当前配置**下是否可见。
|
|
3912
|
+
*
|
|
3913
|
+
* 判定顺序:单项覆盖 → 类开关 → 默认可见。
|
|
3914
|
+
* `overrides` 优先是刻意的:用户先按类关掉 10 个群工具,再单独把 group_kick 勾回来,是可预期的。
|
|
3915
|
+
*/
|
|
3916
|
+
export function toolVisible(name, scope, config) {
|
|
3917
|
+
const vis = config?.visibility?.tools;
|
|
3918
|
+
const ov = vis?.overrides;
|
|
3919
|
+
if (ov && typeof ov[name] === 'boolean')
|
|
3920
|
+
return ov[name];
|
|
3921
|
+
const cls = vis?.classes;
|
|
3922
|
+
if (cls && typeof cls[scope] === 'boolean')
|
|
3923
|
+
return cls[scope];
|
|
3924
|
+
return true; // 未配置 ⇒ 可见(与旧版行为一致)
|
|
3925
|
+
}
|
|
3926
|
+
/**
|
|
3927
|
+
* dock 标签的可见性。语义基准:**client 的 dockOn() 必须与此逐行一致**
|
|
3928
|
+
* (overrides → classes → true,且都用 `typeof === 'boolean'` 严格判)。
|
|
3929
|
+
* client 是手写 bundle(不 import dist),两者是**双源同步**关系 ——
|
|
3930
|
+
* 改这里记得同步改 `client/qqbot-settings.js` 的 visOf()。
|
|
3931
|
+
*/
|
|
3932
|
+
export function dockTabVisible(key, cap, config) {
|
|
3933
|
+
const vis = config?.visibility?.dock;
|
|
3934
|
+
const ov = vis?.overrides;
|
|
3935
|
+
if (ov && typeof ov[key] === 'boolean')
|
|
3936
|
+
return ov[key];
|
|
3937
|
+
const cls = vis?.classes;
|
|
3938
|
+
if (cls && typeof cls[cap] === 'boolean')
|
|
3939
|
+
return cls[cap];
|
|
3940
|
+
return true;
|
|
3941
|
+
}
|
|
3823
3942
|
var qunAdminTool = defineTool({
|
|
3824
3943
|
name: 'qq_group_admin',
|
|
3825
3944
|
description: '【老网页版通道 · 唯一能看 QQ 号】用主人自己的 QQ 号管理群(我创建/我管理的群):登录、看群列表、查群成员、踢人。'
|
|
@@ -4062,6 +4181,11 @@ export function setCtxEnv(agentCtx, env) {
|
|
|
4062
4181
|
}
|
|
4063
4182
|
catch { /* ignore */ }
|
|
4064
4183
|
}
|
|
4184
|
+
/**
|
|
4185
|
+
* ⚠️ 2026-11-26:**已废弃**(全仓无调用点)。qq_group_admin 现在只经
|
|
4186
|
+
* `syncChannelScopedTools` 注册,可见性由那里的 `toolVisible` 判定。
|
|
4187
|
+
* 若将来要复活本函数,必须补上同样的 toolVisible 判定,否则 issue #94 的洞会重新打开。
|
|
4188
|
+
*/
|
|
4065
4189
|
export function syncContextTools(agentCtx, shouldHave, env, reminderText) {
|
|
4066
4190
|
void reminderText; // 保留签名(提示文本改由主 ctx 的 systemPrompt.context 提供,见 index.ts)
|
|
4067
4191
|
if (!agentCtx || typeof agentCtx !== 'object')
|
|
@@ -4777,6 +4901,11 @@ export function ensureExtToolsGlobal(globalCtx) {
|
|
|
4777
4901
|
}
|
|
4778
4902
|
})();
|
|
4779
4903
|
}
|
|
4904
|
+
/**
|
|
4905
|
+
* ⚠️ 2026-11-26:**已废弃**(全仓无调用点)。理由同 syncContextTools ——
|
|
4906
|
+
* 它内部 `for (const t of [...ctxToolsRef(), ...qunAdminRef()])` 是无条件注册,
|
|
4907
|
+
* 复活前必须先接 toolVisible。
|
|
4908
|
+
*/
|
|
4780
4909
|
export function ensureContextToolsGlobal(globalCtx) {
|
|
4781
4910
|
// 2026-10-21 修(trace 实证):restrict 报 "names unknown global tools" => 我们注册的层不是「全局层」。
|
|
4782
4911
|
// cordis 的 ctx.root 才是根作用域;拿不到就退回传入值(行为不变)。
|
|
@@ -4956,7 +5085,13 @@ export function syncChannelScopedTools(agentCtx, opts) {
|
|
|
4956
5085
|
if (opts.dataRoot) {
|
|
4957
5086
|
ctxEnvMap.set(key, { dataRoot: String(opts.dataRoot), sessionKey: String(opts.sessionKey ?? '') });
|
|
4958
5087
|
}
|
|
4959
|
-
|
|
5088
|
+
// ★ 2026-11-26(审核 R2 同类坑):sig 只有两位时,新增的判定维度改了它也不会变
|
|
5089
|
+
// ⇒ `if (st.sig === sig) return` 直接跳过 ⇒ 静默不生效。把可见性也并进来。
|
|
5090
|
+
// ★ 复审 A 的防御:**不影响 want 的维度不要进 sig**。
|
|
5091
|
+
// groupAdmin 关着时 want 本来就不含 qq_group_admin,此时若 qunVisible 仍随配置变化,
|
|
5092
|
+
// 任何一处漏传 config 的调用点都会算出不同 sig → 每 step 抖动。
|
|
5093
|
+
const qunVisible = opts.groupAdmin && !toolVisible('qq_group_admin', 'group', opts.config) ? '0' : '1';
|
|
5094
|
+
const sig = `${opts.ctxTools ? '1' : '0'}${opts.groupAdmin ? '1' : '0'}${qunVisible}`;
|
|
4960
5095
|
const st = ctxScopeState.get(key);
|
|
4961
5096
|
if (st && st.sig === sig)
|
|
4962
5097
|
return; // 状态一致 → 不动(这是"不抖"的关键)
|
|
@@ -4974,9 +5109,12 @@ export function syncChannelScopedTools(agentCtx, opts) {
|
|
|
4974
5109
|
}
|
|
4975
5110
|
catch { /* ignore */ }
|
|
4976
5111
|
}
|
|
5112
|
+
// ★ 2026-11-26(issue #94 / 审核 P1-2):qq_group_admin 是**最像群治理**的工具
|
|
5113
|
+
// (描述很长,每轮都占 context),以前只受 groupAdmin.enabled 管,
|
|
5114
|
+
// 用户把 visibility.tools.classes.group 关掉它还在。现在两者都要过。
|
|
4977
5115
|
const want = [
|
|
4978
5116
|
...(opts.ctxTools ? ctxToolsRef() : []),
|
|
4979
|
-
...(opts.groupAdmin ? qunAdminRef() : []),
|
|
5117
|
+
...(opts.groupAdmin && qunVisible === '1' ? qunAdminRef() : []),
|
|
4980
5118
|
];
|
|
4981
5119
|
const disposers = [];
|
|
4982
5120
|
for (const t of want) {
|
|
@@ -4990,7 +5128,7 @@ export function syncChannelScopedTools(agentCtx, opts) {
|
|
|
4990
5128
|
// 全成功才认这个 sig;否则标 __retry,下一 step 重来
|
|
4991
5129
|
const okAll = disposers.length === want.length;
|
|
4992
5130
|
ctxScopeState.set(key, { sig: okAll ? sig : `__retry-${sig}`, disposers });
|
|
4993
|
-
traceToolReg(`[scoped-tool] 按会话注册 ctx=${opts.ctxTools ? 1 : 0} groupAdmin=${opts.groupAdmin ? 1 : 0}`
|
|
5131
|
+
traceToolReg(`[scoped-tool] 按会话注册 ctx=${opts.ctxTools ? 1 : 0} groupAdmin=${opts.groupAdmin ? 1 : 0} qunVisible=${qunVisible}`
|
|
4994
5132
|
+ ` want=${want.length} ok=${disposers.length}`
|
|
4995
5133
|
+ ` dataRoot=${String(opts.dataRoot ?? '')} sk=${String(opts.sessionKey ?? '')}`);
|
|
4996
5134
|
}
|