@ai-setting/roy-agent-core 1.7.85 → 1.7.89
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/config/index.js +7 -7
- package/dist/env/agent/agent-component.d.ts +1 -1
- package/dist/env/agent/agent-component.js +13 -12
- package/dist/env/agent/index.js +13 -12
- package/dist/env/agent/types.d.ts +14 -0
- package/dist/env/commands/index.js +7 -7
- package/dist/env/context/index.js +3 -3
- package/dist/env/debug/index.js +7 -7
- package/dist/env/error-reply.js +1 -1
- package/dist/env/event-source/event-source-handlers.d.ts +18 -2
- package/dist/env/event-source/event-source-handlers.js +26 -21
- package/dist/env/event-source/event-store.js +2 -2
- package/dist/env/event-source/index.js +25 -22
- package/dist/env/event-source/timer-handler.d.ts +98 -0
- package/dist/env/event-source/types.d.ts +53 -1
- package/dist/env/event-source/wecom-card-action-handler.d.ts +235 -3
- package/dist/env/event-source/wecom-card-builder.d.ts +207 -1
- package/dist/env/event-source/wecom-cli-handler.d.ts +25 -0
- package/dist/{shared/@ai-setting/roy-agent-core-vyr6svt6.js → env/event-source/wecom-respond-registry.js} +8 -6
- package/dist/env/event-source/wecom-session-card-sender.d.ts +135 -0
- package/dist/env/event-source/wecom-session-card-sender.js +153 -0
- package/dist/env/hook/index.js +5 -5
- package/dist/env/index.js +50 -45
- package/dist/env/llm/index.js +9 -8
- package/dist/env/log-trace/index.js +7 -7
- package/dist/env/log-trace/trace-filters.d.ts +6 -1
- package/dist/env/mcp/index.js +7 -7
- package/dist/env/memory/index.js +7 -7
- package/dist/env/plugin/index.js +7 -7
- package/dist/env/prompt/index.js +8 -8
- package/dist/env/prompt/prompts-index.d.ts +1 -1
- package/dist/env/session/group-session-link.d.ts +99 -0
- package/dist/env/session/index.js +11 -10
- package/dist/env/session/session-component.d.ts +89 -0
- package/dist/env/session/storage/index.js +5 -4
- package/dist/env/session/types.d.ts +10 -0
- package/dist/env/skill/index.js +7 -7
- package/dist/env/task/backend/index.d.ts +3 -0
- package/dist/env/task/backend/index.js +151 -3
- package/dist/env/task/backend/remote-task-port.d.ts +85 -0
- package/dist/env/task/backend/types.d.ts +5 -0
- package/dist/env/task/delegate/delegate-channel-hint.d.ts +39 -0
- package/dist/env/task/delegate/delegate-tool.d.ts +71 -6
- package/dist/env/task/delegate/delegate-tool.js +11 -9
- package/dist/env/task/delegate/index.js +8 -8
- package/dist/env/task/index.d.ts +1 -1
- package/dist/env/task/index.js +34 -18
- package/dist/env/task/mcp/index.js +4 -4
- package/dist/env/task/plugins/card-subject.d.ts +117 -0
- package/dist/env/task/plugins/index.js +19 -17
- package/dist/env/task/plugins/lark-card-action-handler.d.ts +261 -6
- package/dist/env/task/plugins/lark-card-patch-notifier.d.ts +501 -0
- package/dist/env/task/plugins/lark-card-patch-notifier.js +12 -2
- package/dist/env/task/plugins/lark-card-state-store.d.ts +60 -0
- package/dist/env/task/plugins/lark-cli-task-notify-plugin.d.ts +45 -0
- package/dist/env/task/plugins/sub-session-activity.d.ts +415 -0
- package/dist/env/task/plugins/wecom-session-card-store.d.ts +134 -0
- package/dist/env/task/plugins/wecom-session-card-store.js +23 -0
- package/dist/env/task/plugins/wecom-task-notify-plugin.d.ts +40 -0
- package/dist/env/task/storage/index.d.ts +1 -0
- package/dist/env/task/storage/index.js +24 -4
- package/dist/env/task/storage/migrations/006_add_task_owner.d.ts +24 -0
- package/dist/env/task/storage/remote-task-store.d.ts +186 -0
- package/dist/env/task/task-component.d.ts +7 -0
- package/dist/env/task/tools/index.js +4 -4
- package/dist/env/task/tools/task-types.d.ts +7 -0
- package/dist/env/task/types.d.ts +17 -0
- package/dist/env/tool/built-in/index.js +6 -4
- package/dist/env/tool/index.js +14 -10
- package/dist/env/tool/types.d.ts +25 -0
- package/dist/env/tool/validator.d.ts +8 -0
- package/dist/env/workflow/engine/index.js +12 -12
- package/dist/env/workflow/hooks/index.js +7 -7
- package/dist/env/workflow/index.js +24 -23
- package/dist/env/workflow/nodes/index.js +2 -2
- package/dist/env/workflow/plugins/index.js +10 -8
- package/dist/env/workflow/service/index.js +2 -2
- package/dist/env/workflow/storage/index.js +3 -3
- package/dist/env/workflow/tools/index.js +16 -15
- package/dist/env/workflow/utils/index.js +4 -4
- package/dist/index.d.ts +1 -1
- package/dist/index.js +71 -60
- package/dist/shared/@ai-setting/{roy-agent-core-q813vafd.js → roy-agent-core-05z35shp.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-dc9zq75z.js → roy-agent-core-0crmsc12.js} +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-7dd0s3xb.js → roy-agent-core-0n1wwndq.js} +1027 -14
- package/dist/shared/@ai-setting/{roy-agent-core-cha0jc7n.js → roy-agent-core-0sbmdz8d.js} +137 -16
- package/dist/shared/@ai-setting/{roy-agent-core-87942bw4.js → roy-agent-core-1mhyh4c5.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-v6vr6za7.js → roy-agent-core-1vv4fx15.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-nwbfepba.js → roy-agent-core-3e040tc5.js} +1 -1
- package/dist/shared/@ai-setting/roy-agent-core-418zc9ha.js +288 -0
- package/dist/shared/@ai-setting/{roy-agent-core-qk9hd89p.js → roy-agent-core-49qcpqwg.js} +54 -19
- package/dist/shared/@ai-setting/{roy-agent-core-xf6z96qy.js → roy-agent-core-4b38m749.js} +818 -346
- package/dist/shared/@ai-setting/{roy-agent-core-r5wt1h3c.js → roy-agent-core-4fkxy2gv.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-na18zwj0.js → roy-agent-core-4t3yskp8.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-d1n4jbza.js → roy-agent-core-5dhvfgaw.js} +5 -5
- package/dist/shared/@ai-setting/{roy-agent-core-5pr4zp88.js → roy-agent-core-5kzhaap1.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-qq96p0tj.js → roy-agent-core-5s2t8z00.js} +22 -1
- package/dist/shared/@ai-setting/{roy-agent-core-6rh8k6ba.js → roy-agent-core-6gj1hc5z.js} +7 -7
- package/dist/shared/@ai-setting/{roy-agent-core-g8htfwxj.js → roy-agent-core-7f10p7m2.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-h21gngxf.js → roy-agent-core-7yh5wps0.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-efkjyh69.js → roy-agent-core-9710zwwz.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-rykf7c04.js → roy-agent-core-9c565frx.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-vffccgf6.js → roy-agent-core-9cen1jvg.js} +18 -7
- package/dist/shared/@ai-setting/{roy-agent-core-fghc2m8z.js → roy-agent-core-aa8kv18f.js} +34 -2
- package/dist/shared/@ai-setting/roy-agent-core-age3qseb.js +177 -0
- package/dist/shared/@ai-setting/{roy-agent-core-7bpj859q.js → roy-agent-core-azyz78ky.js} +7 -7
- package/dist/shared/@ai-setting/{roy-agent-core-264qexac.js → roy-agent-core-b7h39vrc.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-dqxec05w.js → roy-agent-core-bjtc9d35.js} +2 -2
- package/dist/shared/@ai-setting/roy-agent-core-c4ec7k0p.js +426 -0
- package/dist/shared/@ai-setting/{roy-agent-core-ddyk1rc0.js → roy-agent-core-cre2y2ct.js} +160 -4
- package/dist/shared/@ai-setting/{roy-agent-core-tr3ep81v.js → roy-agent-core-d6zdbgtc.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-0qyrk5k0.js → roy-agent-core-ds6qzmf8.js} +14 -5
- package/dist/shared/@ai-setting/{roy-agent-core-p6ks90tb.js → roy-agent-core-dvec4nn2.js} +6 -6
- package/dist/shared/@ai-setting/{roy-agent-core-cgtq6427.js → roy-agent-core-e08bvpaq.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-12n08pg5.js → roy-agent-core-e69qxdyy.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-xcp8vwax.js → roy-agent-core-fepm835e.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-6j02sbee.js → roy-agent-core-fhg03v43.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-dvtg4sn0.js → roy-agent-core-g8yr733d.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-m3vjepzz.js → roy-agent-core-h1e1fm9b.js} +38 -202
- package/dist/shared/@ai-setting/{roy-agent-core-c2gbt68e.js → roy-agent-core-h83zdsrq.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-tk98f92b.js → roy-agent-core-k3gcvybs.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-b31v3qpv.js → roy-agent-core-k3h8t4q1.js} +992 -212
- package/dist/shared/@ai-setting/{roy-agent-core-pgvcf91v.js → roy-agent-core-m39v7qpx.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-ezvpreqz.js → roy-agent-core-m66ysky0.js} +54 -6
- package/dist/shared/@ai-setting/{roy-agent-core-begm7ytz.js → roy-agent-core-m7d1t3db.js} +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-tm1mxttk.js → roy-agent-core-mf5p38yf.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-83bewqx8.js → roy-agent-core-mvh0td7p.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-ze5cqpf2.js → roy-agent-core-mx855td4.js} +17 -38
- package/dist/shared/@ai-setting/{roy-agent-core-0dh8npnz.js → roy-agent-core-n197medr.js} +13 -13
- package/dist/shared/@ai-setting/{roy-agent-core-cmprygrp.js → roy-agent-core-nqkfkpf4.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-7cbpmk4q.js → roy-agent-core-p31ftgq9.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-1v4g0d4x.js → roy-agent-core-rm7seqwb.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-ax9e9szb.js → roy-agent-core-smf94h73.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-acj8ag08.js → roy-agent-core-tjnabyvq.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-qqaak24r.js → roy-agent-core-tkpp1ba0.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-dkrvmjsh.js → roy-agent-core-tpm1dd1g.js} +23 -15
- package/dist/shared/@ai-setting/{roy-agent-core-ed233k5z.js → roy-agent-core-v1n0106v.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-zxz5fkwj.js → roy-agent-core-v6yshv0z.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-mcy5apay.js → roy-agent-core-vf9sp6s3.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-xvt7kf7p.js → roy-agent-core-w9ryeg2p.js} +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-es203w7p.js → roy-agent-core-wqs6yypq.js} +1 -1
- package/dist/shared/@ai-setting/roy-agent-core-wxrkcb17.js +56 -0
- package/dist/shared/@ai-setting/{roy-agent-core-0snm5hc5.js → roy-agent-core-y6shd91r.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-9vxh6f8h.js → roy-agent-core-y7fqtzk2.js} +7 -7
- package/dist/shared/@ai-setting/{roy-agent-core-cpcd24n2.js → roy-agent-core-yet36q5k.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-3fh1f7s7.js → roy-agent-core-yfpnkc4z.js} +5 -5
- package/dist/shared/@ai-setting/roy-agent-core-zhwcje5a.js +352 -0
- package/package.json +9 -1
|
@@ -79,6 +79,17 @@ export interface WecomTaskNotifyConfig {
|
|
|
79
79
|
maxTimelineEntries?: number;
|
|
80
80
|
/** 通知类型过滤(空数组 = 全开) */
|
|
81
81
|
notifyTypes?: WecomNotifyType[];
|
|
82
|
+
/**
|
|
83
|
+
* ★ Task #5360(补充需求):ES 配置的 `statusNotifications` 透传。
|
|
84
|
+
*
|
|
85
|
+
* - `false` / 缺省(默认):只发卡片(#5255 单卡语义)
|
|
86
|
+
* - `true`:发卡成功后**额外**再发一条 markdown 状态文本
|
|
87
|
+
*
|
|
88
|
+
* 为什么由工厂注入而不是插件自己读 `event-sources.json`:
|
|
89
|
+
* 插件不持有 ES 配置句柄,且同一进程可能有多个 wecom 源 ——
|
|
90
|
+
* 由 `es-plugins` 工厂把**该源自己的**配置值传进来,语义最准确。
|
|
91
|
+
*/
|
|
92
|
+
statusNotifications?: boolean;
|
|
82
93
|
/**
|
|
83
94
|
* 出站 sender(测试注入;不传用 sendWecomReply)
|
|
84
95
|
*/
|
|
@@ -150,6 +161,13 @@ export declare class WecomTaskNotifyHook implements Hook {
|
|
|
150
161
|
private readonly sender;
|
|
151
162
|
/** 持久化 store(taskId → chatId/status/timeline) */
|
|
152
163
|
private readonly cardStateStore;
|
|
164
|
+
/**
|
|
165
|
+
* ★ Task #5360(补充需求):状态通知文本开关(严格 `=== true`)。
|
|
166
|
+
*
|
|
167
|
+
* 构造时快照一次(配置热更新靠重建插件实例,与 `enabled` / `priority` 一致),
|
|
168
|
+
* 避免每次 deliver 都读 config 对象。
|
|
169
|
+
*/
|
|
170
|
+
private readonly esStatusNotifications;
|
|
153
171
|
/** 操作记录节流状态:key `op:${taskId}` → 上次发送时间戳 */
|
|
154
172
|
private lastNotifyTimestamps;
|
|
155
173
|
constructor(config?: WecomTaskNotifyConfig);
|
|
@@ -185,6 +203,28 @@ export declare class WecomTaskNotifyHook implements Hook {
|
|
|
185
203
|
* @returns 是否成功(失败时调用方决定是否落库)
|
|
186
204
|
*/
|
|
187
205
|
private deliver;
|
|
206
|
+
/**
|
|
207
|
+
* ★ Task #5360(补充需求):读 ES 配置的 `statusNotifications`。
|
|
208
|
+
*
|
|
209
|
+
* ## 为什么读实时配置而不是快照
|
|
210
|
+
*
|
|
211
|
+
* lark 侧走 `EventHandler`(事件驱动,用 delegate 时刻的快照);
|
|
212
|
+
* 企微插件是**直接挂在 hook 上**(`task:after.create/update/complete`),
|
|
213
|
+
* 拿不到"任务诞生时的快照",所以只能读事件源当前配置。
|
|
214
|
+
*
|
|
215
|
+
* 语义差异可接受:企微侧开关变化对**下一次**任务状态变化生效(毫秒级),
|
|
216
|
+
* 而 lark 侧对已派生任务保持口径一致。两边各自的取舍都有文档说明。
|
|
217
|
+
*
|
|
218
|
+
* 严格 `=== true`(手改 JSON 的 "true"/1/null 一律当 false)。
|
|
219
|
+
*/
|
|
220
|
+
private statusNotificationsEnabled;
|
|
221
|
+
/**
|
|
222
|
+
* ★ Task #5360(补充需求):`statusNotifications: true` 时额外发的 markdown 状态文本。
|
|
223
|
+
*
|
|
224
|
+
* 内容 = 现有 `buildWecomTaskCard` 的 markdown 形态(#5193 的文本可读性),
|
|
225
|
+
* 与卡片正文同源,避免两套文案漂移。
|
|
226
|
+
*/
|
|
227
|
+
private sendStatusMarkdown;
|
|
188
228
|
/**
|
|
189
229
|
* ★ Task #5203:经 WS 直发 template_card。
|
|
190
230
|
*
|
|
@@ -3,3 +3,4 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export { SQLiteTaskStore, type TaskStore } from "./sqlite-task-store";
|
|
5
5
|
export { getDefaultTaskDbPath, getDefaultDataDir } from "./sqlite-task-store";
|
|
6
|
+
export { RemoteTaskStore, createRemoteTaskStore, RemoteTaskStoreError, RemoteAuthError, RemoteBatchBusyError, RemoteIdempotencyConflictError, RemoteProtocolError, REMOTE_PROTOCOL_MAJOR, REMOTE_TASK_STORE_METHODS, type RemoteTaskStoreOptions, type RemoteLogger, type RemoteTaskStoreStats, } from "./remote-task-store";
|
|
@@ -1,15 +1,35 @@
|
|
|
1
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
1
|
+
import"../../../shared/@ai-setting/roy-agent-core-05z35shp.js";
|
|
2
|
+
import {
|
|
3
|
+
REMOTE_PROTOCOL_MAJOR,
|
|
4
|
+
REMOTE_TASK_STORE_METHODS,
|
|
5
|
+
RemoteAuthError,
|
|
6
|
+
RemoteBatchBusyError,
|
|
7
|
+
RemoteIdempotencyConflictError,
|
|
8
|
+
RemoteProtocolError,
|
|
9
|
+
RemoteTaskStore,
|
|
10
|
+
RemoteTaskStoreError,
|
|
11
|
+
createRemoteTaskStore
|
|
12
|
+
} from "../../../shared/@ai-setting/roy-agent-core-zhwcje5a.js";
|
|
2
13
|
import {
|
|
3
14
|
SQLiteTaskStore,
|
|
4
15
|
getDefaultDataDir,
|
|
5
16
|
getDefaultTaskDbPath
|
|
6
|
-
} from "../../../shared/@ai-setting/roy-agent-core-
|
|
7
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
17
|
+
} from "../../../shared/@ai-setting/roy-agent-core-m66ysky0.js";
|
|
18
|
+
import"../../../shared/@ai-setting/roy-agent-core-5s2t8z00.js";
|
|
8
19
|
import"../../../shared/@ai-setting/roy-agent-core-7f7t9wwp.js";
|
|
9
20
|
import"../../../shared/@ai-setting/roy-agent-core-85xyctnb.js";
|
|
10
21
|
import"../../../shared/@ai-setting/roy-agent-core-fs0mn2jk.js";
|
|
11
22
|
export {
|
|
12
23
|
getDefaultTaskDbPath,
|
|
13
24
|
getDefaultDataDir,
|
|
14
|
-
|
|
25
|
+
createRemoteTaskStore,
|
|
26
|
+
SQLiteTaskStore,
|
|
27
|
+
RemoteTaskStoreError,
|
|
28
|
+
RemoteTaskStore,
|
|
29
|
+
RemoteProtocolError,
|
|
30
|
+
RemoteIdempotencyConflictError,
|
|
31
|
+
RemoteBatchBusyError,
|
|
32
|
+
RemoteAuthError,
|
|
33
|
+
REMOTE_TASK_STORE_METHODS,
|
|
34
|
+
REMOTE_PROTOCOL_MAJOR
|
|
15
35
|
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Task Migration 006: Add owner column
|
|
3
|
+
*
|
|
4
|
+
* Migration ID: 006_add_task_owner
|
|
5
|
+
* Description: 给 task 表加 `owner` 列(负责人,可空)。
|
|
6
|
+
* Task #5440 —— roy-agent 接入 task-service 时,service 后端
|
|
7
|
+
* (Task #5443)已扩展 owner 字段,core 侧必须同源,
|
|
8
|
+
* 否则 remote 模式的 owner 写不进去、读不回来。
|
|
9
|
+
*
|
|
10
|
+
* 语义:
|
|
11
|
+
* - `owner TEXT`(NULL 表示未指派)—— 刻意**不**加 NOT NULL DEFAULT '',
|
|
12
|
+
* 因为「未指派」与「指派给空字符串」在业务上是两件事,null 更准确。
|
|
13
|
+
* - 加索引 `idx_task_owner`(按负责人筛任务是主要用法)。
|
|
14
|
+
*
|
|
15
|
+
* 幂等:重复执行安全(列已存在则跳过)。
|
|
16
|
+
*
|
|
17
|
+
* Date: 2026-11-13
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* Run migration 006 on the given database file.
|
|
21
|
+
*
|
|
22
|
+
* @param dbPath SQLite database file path
|
|
23
|
+
*/
|
|
24
|
+
export declare function runMigration(dbPath: string): void;
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview RemoteTaskStore — 把 `TaskStore` 做成一个 HTTP 客户端
|
|
3
|
+
*
|
|
4
|
+
* Task #5440(方案 v3 §4.2 / M2)。roy-agent 的 task 存储除了本地 SQLite,
|
|
5
|
+
* 还可以指向常驻的 **task-service**(`/home/dzk/work/codework/personal/roy_world/roy-task-service`)。
|
|
6
|
+
*
|
|
7
|
+
* ## 契约
|
|
8
|
+
*
|
|
9
|
+
* - 服务端 `POST /store/<method>`:`TaskStore` 方法 **1:1 映射**,body 为
|
|
10
|
+
* `{ "args": [...] }`(多参方法按位置透传),响应体就是方法的返回值。
|
|
11
|
+
* - 鉴权:`Authorization: Bearer <token>`。
|
|
12
|
+
* - 幂等:**写方法**带 `Idempotency-Key`。同一逻辑调用重试时**复用同一个 key**
|
|
13
|
+
* (服务端重放缓存,避免重试造成重复写入);不同调用必须用不同 key。
|
|
14
|
+
* - 握手:首次调用前 `GET /version` 校验 `protocol.major`,不匹配即明确报错
|
|
15
|
+
* (不静默降级 —— 方案 §1.3 非目标:**无本地 fallback**)。
|
|
16
|
+
*
|
|
17
|
+
* ## 故障语义(方案 §5.3)
|
|
18
|
+
*
|
|
19
|
+
* | 情况 | 处理 |
|
|
20
|
+
* |---|---|
|
|
21
|
+
* | 401 | `RemoteAuthError`,**不重试**(token 错,重试无用) |
|
|
22
|
+
* | 409 IDEMPOTENCY_CONFLICT | `RemoteIdempotencyConflictError`,**不重试** |
|
|
23
|
+
* | 400 VALIDATION | 明确报错(payload 错) |
|
|
24
|
+
* | 404 METHOD_NOT_FOUND | `RemoteProtocolError`(服务端版本过旧) |
|
|
25
|
+
* | 503 BUSY | sqlite 单连接 batch 事务占用 → 有界重试,超限 `RemoteBatchBusyError` |
|
|
26
|
+
* | 5xx / 超时 / 网络错 | 有界重试(写方法靠幂等 key 保证重放安全) |
|
|
27
|
+
*
|
|
28
|
+
* 所有错误信息都带 endpoint 与排障指引,绝不悄悄退回本地库。
|
|
29
|
+
*/
|
|
30
|
+
import type { TaskStore } from "./sqlite-task-store";
|
|
31
|
+
import type { ListTagsOptions, SearchTagsOptions } from "../tag-service";
|
|
32
|
+
import type { CreateOperationOptions, CreateTaskOptions, ListOperationsOptions, ListTasksOptions, SearchTasksOptions, Task, TaskListResult, TaskOperation, TaskTag, UpdateTaskOptions } from "../types";
|
|
33
|
+
/** 远端 task-service 的基础错误(带 endpoint,便于排障)。 */
|
|
34
|
+
export declare class RemoteTaskStoreError extends Error {
|
|
35
|
+
readonly endpoint: string;
|
|
36
|
+
readonly cause?: unknown | undefined;
|
|
37
|
+
constructor(message: string, endpoint: string, cause?: unknown | undefined);
|
|
38
|
+
}
|
|
39
|
+
/** Bearer token 缺失/失效(401)。**不重试**。 */
|
|
40
|
+
export declare class RemoteAuthError extends RemoteTaskStoreError {
|
|
41
|
+
}
|
|
42
|
+
/** 幂等 key 被不同 payload 复用(409 IDEMPOTENCY_CONFLICT)。**不重试**。 */
|
|
43
|
+
export declare class RemoteIdempotencyConflictError extends RemoteTaskStoreError {
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* sqlite 后端的 batch 事务独占单连接,期间普通请求被拒(503 BUSY)。
|
|
47
|
+
*
|
|
48
|
+
* 重试后仍失败才抛这个 —— 调用方可以据此选择「稍后再试」还是报错。
|
|
49
|
+
*/
|
|
50
|
+
export declare class RemoteBatchBusyError extends RemoteTaskStoreError {
|
|
51
|
+
}
|
|
52
|
+
/** 协议不兼容(major 版本不一致 / 服务端不认识该方法)。**不重试**。 */
|
|
53
|
+
export declare class RemoteProtocolError extends RemoteTaskStoreError {
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* 服务端 `TASK_STORE_METHODS` 白名单的**本地副本**。
|
|
57
|
+
*
|
|
58
|
+
* 用途:握手时对齐协议面(服务端白名单变化 = 协议变化),以及让
|
|
59
|
+
* `RemoteTaskStore` 的方法集有单一可断言的来源(测试可对照)。
|
|
60
|
+
* ⚠️ 与 roy-task-service `packages/backend/src/types.ts` 的
|
|
61
|
+
* `TASK_STORE_METHODS` 必须保持一致。
|
|
62
|
+
*/
|
|
63
|
+
export declare const REMOTE_TASK_STORE_METHODS: readonly ["createTask", "getTask", "updateTask", "deleteTask", "listTasks", "getTaskIdBySessionId", "getTaskIdsBySessionId", "createOperation", "getOperation", "updateOperation", "deleteOperation", "listOperations", "listOperationsFresh", "invalidateOperationsCache", "createTag", "getTag", "getTagByName", "listTags", "searchTags", "deleteTag", "addTagsToTask", "removeTagsFromTask", "getTagsForTask", "getTaskIdsByTags", "updateTaskTags", "searchTasksByKeywords", "findSimilarTasksByKeywords", "getTaskTree", "getChildTasks", "findSimilarTasks", "searchTasks", "findTasksByContextValue"];
|
|
64
|
+
/** 本 client 支持的协议 major(与服务端 `PROTOCOL_VERSION.major` 对齐)。 */
|
|
65
|
+
export declare const REMOTE_PROTOCOL_MAJOR = 1;
|
|
66
|
+
/**
|
|
67
|
+
* 裁掉参数数组**尾部**的 `null` / `undefined`。
|
|
68
|
+
*
|
|
69
|
+
* 为什么只裁尾部:位置参数中间的空位有语义(`updateTask(7, null)` 的 null 是
|
|
70
|
+
* 「要改的那个值」),只有尾部才是「调用方没传」的表达。裁掉后服务端才会
|
|
71
|
+
* 用它自己的默认参数。
|
|
72
|
+
*
|
|
73
|
+
* ⚠️ 不能按 falsy 裁:`limit: 0` / `offset: 0` / `""` 都是调用方的显式意图。
|
|
74
|
+
*/
|
|
75
|
+
export declare function trimTrailingNullish(args: unknown[]): unknown[];
|
|
76
|
+
/** 只用到 warning/debug 两档(避免把整个 logger 类型泄漏到公开 API)。 */
|
|
77
|
+
export interface RemoteLogger {
|
|
78
|
+
warn?(message: string): void;
|
|
79
|
+
debug?(message: string): void;
|
|
80
|
+
}
|
|
81
|
+
export interface RemoteTaskStoreOptions {
|
|
82
|
+
/** service 地址,如 `http://127.0.0.1:7820`(末尾斜杠可有可无)。 */
|
|
83
|
+
endpoint: string;
|
|
84
|
+
/** Bearer token;service 未配置 token 时留空。 */
|
|
85
|
+
authToken?: string;
|
|
86
|
+
/** 单请求超时(毫秒),默认 5000。 */
|
|
87
|
+
timeoutMs?: number;
|
|
88
|
+
/** 可重试失败的最大**重试**次数(不含首次),默认 3。 */
|
|
89
|
+
maxRetries?: number;
|
|
90
|
+
/** 重试退避基数(毫秒),第 n 次重试等 `base * 2^n`,默认 200。 */
|
|
91
|
+
retryBaseDelayMs?: number;
|
|
92
|
+
/** 注入 fetch(测试/自定义传输)。 */
|
|
93
|
+
fetchImpl?: typeof fetch;
|
|
94
|
+
/** 注入 logger(默认用 core logger)。 */
|
|
95
|
+
log?: RemoteLogger;
|
|
96
|
+
}
|
|
97
|
+
export interface RemoteTaskStoreStats {
|
|
98
|
+
/** /version 握手次数(正常为 1;重连后可增加)。 */
|
|
99
|
+
handshakes: number;
|
|
100
|
+
/** 累计请求数(含重试)。 */
|
|
101
|
+
requests: number;
|
|
102
|
+
/** 累计重试次数。 */
|
|
103
|
+
retries: number;
|
|
104
|
+
}
|
|
105
|
+
export declare class RemoteTaskStore implements TaskStore {
|
|
106
|
+
private readonly endpoint;
|
|
107
|
+
private readonly authToken?;
|
|
108
|
+
private readonly timeoutMs;
|
|
109
|
+
private readonly maxRetries;
|
|
110
|
+
private readonly retryBaseDelayMs;
|
|
111
|
+
private readonly fetchImpl;
|
|
112
|
+
private readonly log;
|
|
113
|
+
private readonly stats;
|
|
114
|
+
private handshake?;
|
|
115
|
+
private closed;
|
|
116
|
+
constructor(options: RemoteTaskStoreOptions);
|
|
117
|
+
/** 诊断用统计(联调/健康检查)。 */
|
|
118
|
+
getStats(): Readonly<RemoteTaskStoreStats>;
|
|
119
|
+
private ensureOpen;
|
|
120
|
+
/** `/version` 握手(只做一次;失败则下次调用重试)。 */
|
|
121
|
+
private ensureHandshake;
|
|
122
|
+
private doHandshake;
|
|
123
|
+
private fetchWithTimeout;
|
|
124
|
+
/** 分类:该错误值得重试吗? */
|
|
125
|
+
private isRetryableStatus;
|
|
126
|
+
/**
|
|
127
|
+
* 一次逻辑调用 = 一次 `POST /store/<method>`,内含**有界重试**。
|
|
128
|
+
*
|
|
129
|
+
* @param method TaskStore 方法名
|
|
130
|
+
* @param args 按位置透传的实参
|
|
131
|
+
*/
|
|
132
|
+
private call;
|
|
133
|
+
createTask(options: CreateTaskOptions): Promise<Task>;
|
|
134
|
+
getTask(id: number): Promise<Task | undefined>;
|
|
135
|
+
updateTask(id: number, options: UpdateTaskOptions): Promise<Task | undefined>;
|
|
136
|
+
deleteTask(id: number): Promise<boolean>;
|
|
137
|
+
listTasks(options?: ListTasksOptions): Promise<TaskListResult>;
|
|
138
|
+
getTaskIdBySessionId(sessionId: string): Promise<number | undefined>;
|
|
139
|
+
getTaskIdsBySessionId(sessionId: string): Promise<number[]>;
|
|
140
|
+
createOperation(options: CreateOperationOptions): Promise<TaskOperation>;
|
|
141
|
+
getOperation(id: number): Promise<TaskOperation | undefined>;
|
|
142
|
+
updateOperation(id: number, updates: Parameters<TaskStore["updateOperation"]>[1]): Promise<TaskOperation | undefined>;
|
|
143
|
+
deleteOperation(id: number): Promise<boolean>;
|
|
144
|
+
listOperations(options: ListOperationsOptions): Promise<TaskOperation[]>;
|
|
145
|
+
/** optional — 绕过缓存直读(跨进程写入可见)。 */
|
|
146
|
+
listOperationsFresh(options: ListOperationsOptions): Promise<TaskOperation[]>;
|
|
147
|
+
/**
|
|
148
|
+
* optional — 失效 operations 缓存。
|
|
149
|
+
*
|
|
150
|
+
* 接口签名是**同步 void**,而远端失效必然是一次网络调用:这里
|
|
151
|
+
* fire-and-forget(不阻塞调用方,失败仅 WARN)。服务端缓存只在 service
|
|
152
|
+
* 进程内,失效语义"尽力而为"即可 —— 真正需要新鲜数据时用
|
|
153
|
+
* `listOperationsFresh`。
|
|
154
|
+
*/
|
|
155
|
+
invalidateOperationsCache(taskId: number): void;
|
|
156
|
+
createTag(name: string): Promise<TaskTag>;
|
|
157
|
+
getTag(id: number): Promise<TaskTag | undefined>;
|
|
158
|
+
getTagByName(name: string): Promise<TaskTag | undefined>;
|
|
159
|
+
listTags(options?: ListTagsOptions): Promise<TaskTag[]>;
|
|
160
|
+
searchTags(options: SearchTagsOptions): Promise<TaskTag[]>;
|
|
161
|
+
deleteTag(id: number): Promise<boolean>;
|
|
162
|
+
addTagsToTask(taskId: number, tagIds: number[]): Promise<void>;
|
|
163
|
+
removeTagsFromTask(taskId: number, tagIds: number[]): Promise<void>;
|
|
164
|
+
getTagsForTask(taskId: number): Promise<TaskTag[]>;
|
|
165
|
+
getTaskIdsByTags(tagNames: string[]): Promise<number[]>;
|
|
166
|
+
updateTaskTags(taskId: number, tagNames: string[]): Promise<void>;
|
|
167
|
+
searchTasksByKeywords(keywords: string[], options?: SearchTasksOptions): Promise<TaskListResult>;
|
|
168
|
+
findSimilarTasksByKeywords(keywords: string[], options?: {
|
|
169
|
+
limit?: number;
|
|
170
|
+
excludeTaskId?: number;
|
|
171
|
+
}): Promise<Task[]>;
|
|
172
|
+
getTaskTree(taskId: number, depth?: number): Promise<Task[]>;
|
|
173
|
+
getChildTasks(taskId: number, options?: ListTasksOptions): Promise<TaskListResult>;
|
|
174
|
+
findSimilarTasks(taskId: number, limit?: number): Promise<Task[]>;
|
|
175
|
+
searchTasks(query: string, limit?: number): Promise<Task[]>;
|
|
176
|
+
findTasksByContextValue(value: string, limit?: number): Promise<Task[]>;
|
|
177
|
+
/**
|
|
178
|
+
* 关闭 client(幂等)。
|
|
179
|
+
*
|
|
180
|
+
* 与本地 store 不同:**没有连接需要释放**,只是把实例标记为已关闭,
|
|
181
|
+
* 后续调用立即报错(避免组件被 dispose 后仍有请求飞出去)。
|
|
182
|
+
*/
|
|
183
|
+
close(): void;
|
|
184
|
+
}
|
|
185
|
+
/** 便捷工厂(与 `createSQLiteTaskPort` 对称)。 */
|
|
186
|
+
export declare function createRemoteTaskStore(options: RemoteTaskStoreOptions): RemoteTaskStore;
|
|
@@ -115,6 +115,13 @@ export declare class TaskComponent extends BaseComponent {
|
|
|
115
115
|
* 根据配置初始化 store
|
|
116
116
|
*/
|
|
117
117
|
private initStore;
|
|
118
|
+
/**
|
|
119
|
+
* 按配置**构造**(不安装)一个 store。
|
|
120
|
+
*
|
|
121
|
+
* 单独抽出来是为了让 `initStore` 能「先构造后安装」——构造失败时旧 store
|
|
122
|
+
* 保持原样(CV MAJOR-2)。
|
|
123
|
+
*/
|
|
124
|
+
private buildStore;
|
|
118
125
|
/**
|
|
119
126
|
* 将配置对象展平为点号路径
|
|
120
127
|
*/
|
|
@@ -11,12 +11,12 @@ import {
|
|
|
11
11
|
searchTasksTool,
|
|
12
12
|
treeTasksTool,
|
|
13
13
|
updateTaskTool
|
|
14
|
-
} from "../../../shared/@ai-setting/roy-agent-core-
|
|
15
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
14
|
+
} from "../../../shared/@ai-setting/roy-agent-core-9cen1jvg.js";
|
|
15
|
+
import"../../../shared/@ai-setting/roy-agent-core-d6zdbgtc.js";
|
|
16
16
|
import"../../../shared/@ai-setting/roy-agent-core-m46fe3x4.js";
|
|
17
17
|
import"../../../shared/@ai-setting/roy-agent-core-4rtg69cn.js";
|
|
18
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
19
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
18
|
+
import"../../../shared/@ai-setting/roy-agent-core-p31ftgq9.js";
|
|
19
|
+
import"../../../shared/@ai-setting/roy-agent-core-5s2t8z00.js";
|
|
20
20
|
import"../../../shared/@ai-setting/roy-agent-core-7f7t9wwp.js";
|
|
21
21
|
import"../../../shared/@ai-setting/roy-agent-core-85xyctnb.js";
|
|
22
22
|
import"../../../shared/@ai-setting/roy-agent-core-fs0mn2jk.js";
|
|
@@ -29,6 +29,7 @@ export declare const CreateTaskToolSchema: z.ZodObject<{
|
|
|
29
29
|
project_path: z.ZodDefault<z.ZodString>;
|
|
30
30
|
parent_task_id: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodNull]>>;
|
|
31
31
|
context: z.ZodDefault<z.ZodString>;
|
|
32
|
+
owner: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
|
|
32
33
|
}, "strip", z.ZodTypeAny, {
|
|
33
34
|
type: "normal" | "cycle" | "longterm";
|
|
34
35
|
title: string;
|
|
@@ -40,6 +41,7 @@ export declare const CreateTaskToolSchema: z.ZodObject<{
|
|
|
40
41
|
goals_and_expected_deliverables?: string | undefined;
|
|
41
42
|
due_date?: string | undefined;
|
|
42
43
|
parent_task_id?: number | null | undefined;
|
|
44
|
+
owner?: string | null | undefined;
|
|
43
45
|
}, {
|
|
44
46
|
title: string;
|
|
45
47
|
type?: "normal" | "cycle" | "longterm" | undefined;
|
|
@@ -51,6 +53,7 @@ export declare const CreateTaskToolSchema: z.ZodObject<{
|
|
|
51
53
|
project_path?: string | undefined;
|
|
52
54
|
parent_task_id?: number | null | undefined;
|
|
53
55
|
context?: string | undefined;
|
|
56
|
+
owner?: string | null | undefined;
|
|
54
57
|
}>;
|
|
55
58
|
export type CreateTaskToolParams = z.infer<typeof CreateTaskToolSchema>;
|
|
56
59
|
/**
|
|
@@ -166,6 +169,7 @@ export declare const UpdateTaskToolSchema: z.ZodEffects<z.ZodObject<{
|
|
|
166
169
|
project_path: z.ZodOptional<z.ZodString>;
|
|
167
170
|
context: z.ZodOptional<z.ZodString>;
|
|
168
171
|
parent_task_id: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodNull]>>;
|
|
172
|
+
owner: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
|
|
169
173
|
}, "strip", z.ZodTypeAny, {
|
|
170
174
|
task_id: number;
|
|
171
175
|
type?: "normal" | "cycle" | "longterm" | undefined;
|
|
@@ -180,6 +184,7 @@ export declare const UpdateTaskToolSchema: z.ZodEffects<z.ZodObject<{
|
|
|
180
184
|
project_path?: string | undefined;
|
|
181
185
|
parent_task_id?: number | null | undefined;
|
|
182
186
|
context?: string | undefined;
|
|
187
|
+
owner?: string | null | undefined;
|
|
183
188
|
current_status?: string | undefined;
|
|
184
189
|
}, {
|
|
185
190
|
task_id: number;
|
|
@@ -195,6 +200,7 @@ export declare const UpdateTaskToolSchema: z.ZodEffects<z.ZodObject<{
|
|
|
195
200
|
project_path?: string | undefined;
|
|
196
201
|
parent_task_id?: number | null | undefined;
|
|
197
202
|
context?: string | undefined;
|
|
203
|
+
owner?: string | null | undefined;
|
|
198
204
|
current_status?: string | undefined;
|
|
199
205
|
}>, {
|
|
200
206
|
task_id: number;
|
|
@@ -210,6 +216,7 @@ export declare const UpdateTaskToolSchema: z.ZodEffects<z.ZodObject<{
|
|
|
210
216
|
project_path?: string | undefined;
|
|
211
217
|
parent_task_id?: number | null | undefined;
|
|
212
218
|
context?: string | undefined;
|
|
219
|
+
owner?: string | null | undefined;
|
|
213
220
|
current_status?: string | undefined;
|
|
214
221
|
}, unknown>;
|
|
215
222
|
export type UpdateTaskToolParams = z.infer<typeof UpdateTaskToolSchema>;
|
package/dist/env/task/types.d.ts
CHANGED
|
@@ -59,6 +59,16 @@ export interface Task {
|
|
|
59
59
|
project_path: string;
|
|
60
60
|
/** JSON string with time-space positioning info (worktree, branch, etc.) */
|
|
61
61
|
context: string;
|
|
62
|
+
/**
|
|
63
|
+
* 负责人(Task #5440)。
|
|
64
|
+
*
|
|
65
|
+
* 语义:这个任务的**人**(open_id / 用户名 / 邮箱,字符串,core 不解释格式)。
|
|
66
|
+
* - 可空:`null` 表示未指派(新建任务的默认值)
|
|
67
|
+
* - 多人协作场景下用来区分「谁在负责推进」,与 `sessionId`(谁在操作)
|
|
68
|
+
* 和 `project_path`(在哪个项目)正交
|
|
69
|
+
* - 与 task-service 后端的 `owner` 列同源,remote 模式下原样落库
|
|
70
|
+
*/
|
|
71
|
+
owner?: string | null;
|
|
62
72
|
}
|
|
63
73
|
/**
|
|
64
74
|
* TaskOperation entity — 双维度操作记录(Task #2211 重构后版本)
|
|
@@ -171,6 +181,8 @@ export interface CreateTaskOptions {
|
|
|
171
181
|
* Must be a valid JSON string.
|
|
172
182
|
*/
|
|
173
183
|
context: string;
|
|
184
|
+
/** 负责人(可选,不传即 null;参见 Task.owner)。 */
|
|
185
|
+
owner?: string | null;
|
|
174
186
|
}
|
|
175
187
|
export interface UpdateTaskOptions {
|
|
176
188
|
title?: string;
|
|
@@ -187,6 +199,11 @@ export interface UpdateTaskOptions {
|
|
|
187
199
|
project_path?: string;
|
|
188
200
|
/** 任务上下文信息,用于存储额外上下文 */
|
|
189
201
|
context?: string;
|
|
202
|
+
/**
|
|
203
|
+
* 负责人(可选)。传 `null` 或 `""` 表示清空;传字符串表示改为该负责人;
|
|
204
|
+
* **字段省略**表示不改(与 status/progress 等字段语义一致)。
|
|
205
|
+
*/
|
|
206
|
+
owner?: string | null;
|
|
190
207
|
/** 父任务 ID,null = 设为根任务(无父任务) */
|
|
191
208
|
parent_task_id?: number | null;
|
|
192
209
|
}
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
grepTool,
|
|
9
9
|
readFileTool,
|
|
10
10
|
writeFileTool
|
|
11
|
-
} from "../../../shared/@ai-setting/roy-agent-core-
|
|
11
|
+
} from "../../../shared/@ai-setting/roy-agent-core-k3gcvybs.js";
|
|
12
12
|
import {
|
|
13
13
|
getUnderstandImageLLMProvider,
|
|
14
14
|
resetUnderstandImageLLMProvider,
|
|
@@ -24,10 +24,12 @@ import {
|
|
|
24
24
|
import"../../../shared/@ai-setting/roy-agent-core-fttgm52a.js";
|
|
25
25
|
import {
|
|
26
26
|
wecomRespondTool
|
|
27
|
-
} from "../../../shared/@ai-setting/roy-agent-core-
|
|
27
|
+
} from "../../../shared/@ai-setting/roy-agent-core-h1e1fm9b.js";
|
|
28
|
+
import"../../../shared/@ai-setting/roy-agent-core-c4ec7k0p.js";
|
|
29
|
+
import"../../../shared/@ai-setting/roy-agent-core-418zc9ha.js";
|
|
28
30
|
import"../../../shared/@ai-setting/roy-agent-core-zjdzk1gg.js";
|
|
29
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
30
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
31
|
+
import"../../../shared/@ai-setting/roy-agent-core-p31ftgq9.js";
|
|
32
|
+
import"../../../shared/@ai-setting/roy-agent-core-5s2t8z00.js";
|
|
31
33
|
import"../../../shared/@ai-setting/roy-agent-core-7f7t9wwp.js";
|
|
32
34
|
import"../../../shared/@ai-setting/roy-agent-core-85xyctnb.js";
|
|
33
35
|
import"../../../shared/@ai-setting/roy-agent-core-fs0mn2jk.js";
|
package/dist/env/tool/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
grepTool,
|
|
11
11
|
readFileTool,
|
|
12
12
|
writeFileTool
|
|
13
|
-
} from "../../shared/@ai-setting/roy-agent-core-
|
|
13
|
+
} from "../../shared/@ai-setting/roy-agent-core-k3gcvybs.js";
|
|
14
14
|
import {
|
|
15
15
|
getUnderstandImageLLMProvider,
|
|
16
16
|
resetUnderstandImageLLMProvider,
|
|
@@ -19,24 +19,28 @@ import {
|
|
|
19
19
|
} from "../../shared/@ai-setting/roy-agent-core-xwm8zavb.js";
|
|
20
20
|
import"../../shared/@ai-setting/roy-agent-core-2akfd64z.js";
|
|
21
21
|
import"../../shared/@ai-setting/roy-agent-core-fttgm52a.js";
|
|
22
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
22
|
+
import"../../shared/@ai-setting/roy-agent-core-h1e1fm9b.js";
|
|
23
|
+
import"../../shared/@ai-setting/roy-agent-core-c4ec7k0p.js";
|
|
24
|
+
import"../../shared/@ai-setting/roy-agent-core-418zc9ha.js";
|
|
23
25
|
import {
|
|
24
26
|
ToolComponent,
|
|
25
27
|
ToolRegistry,
|
|
26
|
-
ToolValidator,
|
|
27
28
|
getMaxOutputSize,
|
|
28
29
|
setToolConfigComponent
|
|
29
|
-
} from "../../shared/@ai-setting/roy-agent-core-
|
|
30
|
+
} from "../../shared/@ai-setting/roy-agent-core-mx855td4.js";
|
|
30
31
|
import"../../shared/@ai-setting/roy-agent-core-jvv2h3d6.js";
|
|
32
|
+
import {
|
|
33
|
+
ToolValidator
|
|
34
|
+
} from "../../shared/@ai-setting/roy-agent-core-wxrkcb17.js";
|
|
31
35
|
import"../../shared/@ai-setting/roy-agent-core-zjdzk1gg.js";
|
|
32
36
|
import"../../shared/@ai-setting/roy-agent-core-mkc3zshb.js";
|
|
33
37
|
import"../../shared/@ai-setting/roy-agent-core-7hh0brvs.js";
|
|
34
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
35
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
36
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
37
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
38
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
39
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
38
|
+
import"../../shared/@ai-setting/roy-agent-core-m39v7qpx.js";
|
|
39
|
+
import"../../shared/@ai-setting/roy-agent-core-smf94h73.js";
|
|
40
|
+
import"../../shared/@ai-setting/roy-agent-core-yet36q5k.js";
|
|
41
|
+
import"../../shared/@ai-setting/roy-agent-core-tkpp1ba0.js";
|
|
42
|
+
import"../../shared/@ai-setting/roy-agent-core-p31ftgq9.js";
|
|
43
|
+
import"../../shared/@ai-setting/roy-agent-core-5s2t8z00.js";
|
|
40
44
|
import"../../shared/@ai-setting/roy-agent-core-7f7t9wwp.js";
|
|
41
45
|
import"../../shared/@ai-setting/roy-agent-core-85xyctnb.js";
|
|
42
46
|
import"../../shared/@ai-setting/roy-agent-core-fs0mn2jk.js";
|
package/dist/env/tool/types.d.ts
CHANGED
|
@@ -163,6 +163,31 @@ export interface ToolMetadata {
|
|
|
163
163
|
* 3. ToolComponent.listTools({ allowedAgent }) 一次过滤;agent-component 再做 allowedTools/deniedTools 二次过滤
|
|
164
164
|
*/
|
|
165
165
|
allowedAgentTypes?: string[];
|
|
166
|
+
/**
|
|
167
|
+
* ★ Task #5333 — 渠道专用工具标记(channel-only tool)。
|
|
168
|
+
*
|
|
169
|
+
* `true` = 该工具**只对特定事件源渠道**有意义,默认对所有 agent 不可见;
|
|
170
|
+
* 只有当前会话的 `AgentContext.extendTools` 显式列出该工具名时才可见。
|
|
171
|
+
*
|
|
172
|
+
* 典型用例:`wecom_respond`(企微出站唯一通道)——
|
|
173
|
+
* 在飞书会话 / 交互式 CLI 里调用必然失败(无企微 chatId,无 wecom 注册表实例),
|
|
174
|
+
* 但它原先在 `getAllBuiltInTools()` 全局注册且无可见性声明 →
|
|
175
|
+
* 所有 agent(含 default 接待员)都被注入了它,LLM 会误调。
|
|
176
|
+
*
|
|
177
|
+
* 与 `allowedAgentTypes` 的区别:
|
|
178
|
+
* - `allowedAgentTypes` 按 **agent 身份** 过滤(谁可见)
|
|
179
|
+
* - `channelOnly` 按 **会话渠道上下文** 过滤(哪个事件源驱动的这一轮可见)
|
|
180
|
+
*
|
|
181
|
+
* 两者正交,都满足才可见。实际判定顺序见 `filterToolsByAgent`:
|
|
182
|
+
* **先 channelOnly**(渠道上下文),**再 allowedAgentTypes**(agent 身份)。
|
|
183
|
+
*
|
|
184
|
+
* ⚠️ 可见性只在 `AgentComponent.getAvailableTools` 一处收敛
|
|
185
|
+
* (`filterToolsByAgent`)。`ToolRegistry.listTools()` 是**存储目录**
|
|
186
|
+
* (`roy-agent tools list` / 调试用),不做 channelOnly 过滤 ——
|
|
187
|
+
* 否则"无 filter 全量返回、有 filter 却隐藏"会造成同一工具在不同
|
|
188
|
+
* 查询路径下存在性不一致。
|
|
189
|
+
*/
|
|
190
|
+
channelOnly?: boolean;
|
|
166
191
|
/**
|
|
167
192
|
* Whether this tool explicitly opts out of string output truncation.
|
|
168
193
|
*
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import type { Tool, ValidationResult } from "./types";
|
|
2
|
+
/** 接线 ConfigComponent(由 ToolComponent.init 调用,支持热更新) */
|
|
3
|
+
export declare function setToolReasonConfigComponent(component: {
|
|
4
|
+
get(key: string): unknown;
|
|
5
|
+
} | null): void;
|
|
6
|
+
/** 测试 / 无 ConfigComponent 场景的模块级开关 */
|
|
7
|
+
export declare function setToolReasonRequired(required: boolean): void;
|
|
8
|
+
/** 当前是否要求 reason(逃生开关读取,实时) */
|
|
9
|
+
export declare function isToolReasonRequired(): boolean;
|
|
2
10
|
/**
|
|
3
11
|
* 工具参数验证器
|
|
4
12
|
*/
|
|
@@ -5,25 +5,25 @@ import {
|
|
|
5
5
|
Scheduler,
|
|
6
6
|
WorkflowEngine,
|
|
7
7
|
init_engine
|
|
8
|
-
} from "../../../shared/@ai-setting/roy-agent-core-
|
|
8
|
+
} from "../../../shared/@ai-setting/roy-agent-core-6gj1hc5z.js";
|
|
9
9
|
import"../../../shared/@ai-setting/roy-agent-core-6atd905e.js";
|
|
10
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
11
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
10
|
+
import"../../../shared/@ai-setting/roy-agent-core-bjtc9d35.js";
|
|
11
|
+
import"../../../shared/@ai-setting/roy-agent-core-9710zwwz.js";
|
|
12
12
|
import"../../../shared/@ai-setting/roy-agent-core-1db4vpc6.js";
|
|
13
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
14
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
15
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
13
|
+
import"../../../shared/@ai-setting/roy-agent-core-g8yr733d.js";
|
|
14
|
+
import"../../../shared/@ai-setting/roy-agent-core-h83zdsrq.js";
|
|
15
|
+
import"../../../shared/@ai-setting/roy-agent-core-tjnabyvq.js";
|
|
16
16
|
import"../../../shared/@ai-setting/roy-agent-core-ddwa0n6h.js";
|
|
17
17
|
import {
|
|
18
18
|
DAGManager
|
|
19
|
-
} from "../../../shared/@ai-setting/roy-agent-core-
|
|
19
|
+
} from "../../../shared/@ai-setting/roy-agent-core-e08bvpaq.js";
|
|
20
20
|
import"../../../shared/@ai-setting/roy-agent-core-er070zjq.js";
|
|
21
21
|
import"../../../shared/@ai-setting/roy-agent-core-mkc3zshb.js";
|
|
22
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
23
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
24
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
25
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
26
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
22
|
+
import"../../../shared/@ai-setting/roy-agent-core-smf94h73.js";
|
|
23
|
+
import"../../../shared/@ai-setting/roy-agent-core-yet36q5k.js";
|
|
24
|
+
import"../../../shared/@ai-setting/roy-agent-core-tkpp1ba0.js";
|
|
25
|
+
import"../../../shared/@ai-setting/roy-agent-core-p31ftgq9.js";
|
|
26
|
+
import"../../../shared/@ai-setting/roy-agent-core-5s2t8z00.js";
|
|
27
27
|
import"../../../shared/@ai-setting/roy-agent-core-7f7t9wwp.js";
|
|
28
28
|
import"../../../shared/@ai-setting/roy-agent-core-85xyctnb.js";
|
|
29
29
|
import"../../../shared/@ai-setting/roy-agent-core-fs0mn2jk.js";
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
init_hooks
|
|
3
|
-
} from "../../../shared/@ai-setting/roy-agent-core-
|
|
3
|
+
} from "../../../shared/@ai-setting/roy-agent-core-g8yr733d.js";
|
|
4
4
|
import {
|
|
5
5
|
WorkflowHookPoints,
|
|
6
6
|
emitWorkflowNodeHook,
|
|
7
7
|
emitWorkflowRunHook,
|
|
8
8
|
getRegisteredWorkflowHookPoints
|
|
9
|
-
} from "../../../shared/@ai-setting/roy-agent-core-
|
|
10
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
11
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
12
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
13
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
14
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
9
|
+
} from "../../../shared/@ai-setting/roy-agent-core-h83zdsrq.js";
|
|
10
|
+
import"../../../shared/@ai-setting/roy-agent-core-smf94h73.js";
|
|
11
|
+
import"../../../shared/@ai-setting/roy-agent-core-yet36q5k.js";
|
|
12
|
+
import"../../../shared/@ai-setting/roy-agent-core-tkpp1ba0.js";
|
|
13
|
+
import"../../../shared/@ai-setting/roy-agent-core-p31ftgq9.js";
|
|
14
|
+
import"../../../shared/@ai-setting/roy-agent-core-5s2t8z00.js";
|
|
15
15
|
import"../../../shared/@ai-setting/roy-agent-core-7f7t9wwp.js";
|
|
16
16
|
import"../../../shared/@ai-setting/roy-agent-core-85xyctnb.js";
|
|
17
17
|
import"../../../shared/@ai-setting/roy-agent-core-fs0mn2jk.js";
|