@ai-setting/roy-agent-core 1.7.77 → 1.7.88
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/config-protection.d.ts +89 -0
- package/dist/config/index.d.ts +1 -0
- package/dist/config/index.js +23 -7
- package/dist/env/agent/agent-component.d.ts +43 -22
- package/dist/env/agent/agent-component.js +13 -12
- package/dist/env/agent/index.js +13 -12
- package/dist/env/agent/types.d.ts +46 -12
- 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.d.ts +6 -0
- package/dist/env/error-reply.js +1 -1
- package/dist/env/event-source/bounty-im-handler.d.ts +8 -0
- package/dist/env/event-source/es-command.d.ts +39 -0
- package/dist/env/event-source/es-plugins.d.ts +68 -0
- package/dist/env/event-source/event-source-component.d.ts +15 -0
- package/dist/env/event-source/event-source-handlers.d.ts +84 -0
- package/dist/env/event-source/event-source-handlers.js +40 -23
- package/dist/env/event-source/event-store.js +2 -2
- package/dist/env/event-source/index.d.ts +5 -1
- package/dist/env/event-source/index.js +75 -23
- package/dist/env/event-source/timer-handler.d.ts +98 -0
- package/dist/env/event-source/types.d.ts +154 -2
- package/dist/env/event-source/wecom-card-action-handler.d.ts +373 -0
- package/dist/env/event-source/wecom-card-builder.d.ts +426 -0
- package/dist/env/event-source/wecom-cli-handler.d.ts +291 -0
- package/dist/env/event-source/wecom-cli-sender.d.ts +88 -0
- package/dist/env/event-source/wecom-media.d.ts +130 -0
- package/dist/env/event-source/wecom-respond-registry.d.ts +151 -0
- package/dist/env/event-source/wecom-respond-registry.js +33 -0
- 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/event-source/wecom-ws-bridge.d.ts +213 -0
- package/dist/env/hook/index.js +5 -5
- package/dist/env/index.js +51 -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/delegate/delegate-channel-hint.d.ts +39 -0
- package/dist/env/task/delegate/delegate-tool.d.ts +132 -7
- package/dist/env/task/delegate/delegate-tool.js +13 -9
- package/dist/env/task/delegate/index.js +8 -8
- package/dist/env/task/index.js +18 -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.d.ts +2 -0
- package/dist/env/task/plugins/index.js +39 -16
- package/dist/env/task/plugins/lark-card-action-handler.d.ts +261 -6
- package/dist/env/task/plugins/lark-card-patch-notifier.d.ts +542 -2
- 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 +61 -0
- package/dist/env/task/plugins/sub-session-activity.d.ts +415 -0
- package/dist/env/task/plugins/wecom-card-state-store.d.ts +121 -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 +264 -0
- package/dist/env/task/storage/index.js +3 -3
- package/dist/env/task/tools/index.js +4 -4
- package/dist/env/tool/built-in/index.d.ts +2 -0
- package/dist/env/tool/built-in/index.js +9 -2
- package/dist/env/tool/index.js +14 -9
- 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 +118 -62
- 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-aa2j7bk9.js → roy-agent-core-0sbmdz8d.js} +171 -36
- 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-2stt4rp5.js +134 -0
- 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-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-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-ezvpreqz.js → roy-agent-core-6k8mb7zx.js} +1 -1
- 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-7kvpc0w5.js +177 -0
- 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-6cy43nss.js → roy-agent-core-9c565frx.js} +49 -9
- 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-ew6qb5yx.js → roy-agent-core-an35dzbf.js} +6 -6
- package/dist/shared/@ai-setting/{roy-agent-core-mww0mnd9.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-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-rhtdspx6.js → roy-agent-core-fan8g0z1.js} +10 -10
- 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-99nwgj84.js → roy-agent-core-fzw9xzm1.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-3gpygqcx.js → roy-agent-core-gr5h1dyr.js} +2753 -358
- package/dist/shared/@ai-setting/roy-agent-core-h1e1fm9b.js +380 -0
- 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-8ez6mccb.js → roy-agent-core-k3gcvybs.js} +5 -1
- 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-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-v85n42ve.js → roy-agent-core-mx855td4.js} +17 -38
- package/dist/shared/@ai-setting/{roy-agent-core-v87njmq7.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-vffccgf6.js → roy-agent-core-qwd2dq5q.js} +10 -3
- package/dist/shared/@ai-setting/{roy-agent-core-rsn44n9y.js → roy-agent-core-ra66sf50.js} +2526 -942
- 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-w0qjeq2v.js → roy-agent-core-shb1qsyg.js} +1041 -18
- 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-9vhq7fvv.js → roy-agent-core-tpm1dd1g.js} +34 -88
- 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-q813vafd.js → roy-agent-core-vpcxv1ty.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-bxkjk7zx.js → roy-agent-core-vx8zc847.js} +4 -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-hd3n57zs.js → roy-agent-core-wr1qexzq.js} +5 -5
- 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-0v27y99n.js → roy-agent-core-yh68z1bg.js} +65 -4
- package/package.json +18 -1
- /package/dist/shared/@ai-setting/{roy-agent-core-b4x6x4k2.js → roy-agent-core-m1fgtnrc.js} +0 -0
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
import {
|
|
2
|
+
buildWecomSendCardFrame
|
|
3
|
+
} from "./roy-agent-core-c4ec7k0p.js";
|
|
4
|
+
import {
|
|
5
|
+
getEnvContextOrEmpty,
|
|
6
|
+
init_env_context
|
|
7
|
+
} from "./roy-agent-core-p31ftgq9.js";
|
|
8
|
+
|
|
9
|
+
// src/env/event-source/wecom-respond-registry.ts
|
|
10
|
+
init_env_context();
|
|
11
|
+
import { z } from "zod";
|
|
12
|
+
|
|
13
|
+
// src/env/event-source/wecom-cli-sender.ts
|
|
14
|
+
import { spawn } from "child_process";
|
|
15
|
+
var WECOM_CLI_SEND_TIMEOUT_MS = 15000;
|
|
16
|
+
var WECOM_CLI_RESOLVE_TIMEOUT_MS = 15000;
|
|
17
|
+
function resolveWecomCliBinary() {
|
|
18
|
+
const fromEnv = process.env.WECOM_CLI_BIN;
|
|
19
|
+
if (typeof fromEnv === "string" && fromEnv.trim().length > 0) {
|
|
20
|
+
return fromEnv.trim();
|
|
21
|
+
}
|
|
22
|
+
return "wecom-cli";
|
|
23
|
+
}
|
|
24
|
+
function buildWecomCliSendArgs(input) {
|
|
25
|
+
return [
|
|
26
|
+
"message",
|
|
27
|
+
"aibot",
|
|
28
|
+
"send",
|
|
29
|
+
"--chat-id",
|
|
30
|
+
input.chatId,
|
|
31
|
+
"--msg-type",
|
|
32
|
+
"markdown",
|
|
33
|
+
"--markdown",
|
|
34
|
+
JSON.stringify({ content: input.content })
|
|
35
|
+
];
|
|
36
|
+
}
|
|
37
|
+
function buildWecomCliResolveArgs(keywords) {
|
|
38
|
+
return ["contact", "users", "search", "--set", `keywords=${keywords}`];
|
|
39
|
+
}
|
|
40
|
+
function parseWecomCliResult(stdout) {
|
|
41
|
+
const text = (stdout ?? "").trim();
|
|
42
|
+
if (!text)
|
|
43
|
+
return { ok: false, error: "empty stdout" };
|
|
44
|
+
const start = text.indexOf("{");
|
|
45
|
+
const jsonText = start >= 0 ? text.slice(start) : text;
|
|
46
|
+
let parsed;
|
|
47
|
+
try {
|
|
48
|
+
parsed = JSON.parse(jsonText);
|
|
49
|
+
} catch {
|
|
50
|
+
return { ok: false, error: `non-JSON stdout: ${text.slice(0, 200)}` };
|
|
51
|
+
}
|
|
52
|
+
const obj = parsed;
|
|
53
|
+
if (obj?.error) {
|
|
54
|
+
const code = obj.error.code ?? "?";
|
|
55
|
+
const message = obj.error.message ?? obj.error.type ?? "unknown error";
|
|
56
|
+
return { ok: false, error: `[code=${code}] ${message}` };
|
|
57
|
+
}
|
|
58
|
+
if (obj?.success === true)
|
|
59
|
+
return { ok: true };
|
|
60
|
+
return { ok: true };
|
|
61
|
+
}
|
|
62
|
+
function parseWecomCliUserSearch(stdout, fallback) {
|
|
63
|
+
const text = (stdout ?? "").trim();
|
|
64
|
+
const start = text.indexOf("{");
|
|
65
|
+
if (start < 0)
|
|
66
|
+
return fallback;
|
|
67
|
+
try {
|
|
68
|
+
const parsed = JSON.parse(text.slice(start));
|
|
69
|
+
const userid = parsed?.users?.[0]?.userid;
|
|
70
|
+
return typeof userid === "string" && userid.length > 0 ? userid : fallback;
|
|
71
|
+
} catch {
|
|
72
|
+
return fallback;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
function runCli(args, timeoutMs) {
|
|
76
|
+
return new Promise((resolve) => {
|
|
77
|
+
let settled = false;
|
|
78
|
+
let stdout = "";
|
|
79
|
+
let stderr = "";
|
|
80
|
+
const finish = (code) => {
|
|
81
|
+
if (settled)
|
|
82
|
+
return;
|
|
83
|
+
settled = true;
|
|
84
|
+
clearTimeout(timer);
|
|
85
|
+
resolve({ stdout, stderr, code });
|
|
86
|
+
};
|
|
87
|
+
let proc;
|
|
88
|
+
try {
|
|
89
|
+
proc = spawn(resolveWecomCliBinary(), args, {
|
|
90
|
+
shell: false,
|
|
91
|
+
stdio: ["ignore", "pipe", "pipe"]
|
|
92
|
+
});
|
|
93
|
+
} catch (err) {
|
|
94
|
+
resolve({
|
|
95
|
+
stdout: "",
|
|
96
|
+
stderr: err instanceof Error ? err.message : String(err),
|
|
97
|
+
code: null
|
|
98
|
+
});
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
const timer = setTimeout(() => {
|
|
102
|
+
try {
|
|
103
|
+
proc.kill("SIGKILL");
|
|
104
|
+
} catch {}
|
|
105
|
+
finish(null);
|
|
106
|
+
}, timeoutMs);
|
|
107
|
+
timer.unref?.();
|
|
108
|
+
proc.stdout?.on("data", (d) => {
|
|
109
|
+
stdout += d.toString();
|
|
110
|
+
});
|
|
111
|
+
proc.stderr?.on("data", (d) => {
|
|
112
|
+
stderr += d.toString();
|
|
113
|
+
});
|
|
114
|
+
proc.on("error", (err) => {
|
|
115
|
+
stderr += err.message;
|
|
116
|
+
finish(null);
|
|
117
|
+
});
|
|
118
|
+
proc.on("close", (code) => finish(code));
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
var cliChatIdCache = new Map;
|
|
122
|
+
async function resolveWecomCliChatId(userId) {
|
|
123
|
+
const key = userId.trim();
|
|
124
|
+
if (!key)
|
|
125
|
+
return key;
|
|
126
|
+
const cached = cliChatIdCache.get(key);
|
|
127
|
+
if (cached)
|
|
128
|
+
return cached;
|
|
129
|
+
const { stdout } = await runCli(buildWecomCliResolveArgs(key), WECOM_CLI_RESOLVE_TIMEOUT_MS);
|
|
130
|
+
const resolved = parseWecomCliUserSearch(stdout, key);
|
|
131
|
+
if (resolved !== key)
|
|
132
|
+
cliChatIdCache.set(key, resolved);
|
|
133
|
+
return resolved;
|
|
134
|
+
}
|
|
135
|
+
async function sendWecomCliMarkdown(input) {
|
|
136
|
+
const content = input.content ?? "";
|
|
137
|
+
if (!input.chatId || content.trim().length === 0) {
|
|
138
|
+
return { ok: false, error: "empty chatId or content" };
|
|
139
|
+
}
|
|
140
|
+
const { stdout, stderr, code } = await runCli(buildWecomCliSendArgs({ chatId: input.chatId, content }), input.timeoutMs ?? WECOM_CLI_SEND_TIMEOUT_MS);
|
|
141
|
+
const parsed = parseWecomCliResult(stdout);
|
|
142
|
+
if (parsed.ok)
|
|
143
|
+
return parsed;
|
|
144
|
+
const detail = stderr.trim() ? `${parsed.error} | stderr: ${stderr.trim().slice(0, 200)}` : parsed.error;
|
|
145
|
+
return { ok: false, error: `${detail} (exit=${code ?? "null"})` };
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// src/env/event-source/wecom-respond-registry.ts
|
|
149
|
+
var registry = new Map;
|
|
150
|
+
function registerWecomRespondTarget(sourceId, target) {
|
|
151
|
+
registry.set(sourceId, target);
|
|
152
|
+
}
|
|
153
|
+
function unregisterWecomRespondTarget(sourceId) {
|
|
154
|
+
registry.delete(sourceId);
|
|
155
|
+
}
|
|
156
|
+
function getWecomRespondTarget(sourceId) {
|
|
157
|
+
return registry.get(sourceId);
|
|
158
|
+
}
|
|
159
|
+
function __resetWecomRespondRegistryForTest() {
|
|
160
|
+
registry.clear();
|
|
161
|
+
}
|
|
162
|
+
async function sendWecomReply(input) {
|
|
163
|
+
const content = input.content ?? "";
|
|
164
|
+
if (content.trim().length === 0) {
|
|
165
|
+
return { ok: false, error: "empty content" };
|
|
166
|
+
}
|
|
167
|
+
const errors = [];
|
|
168
|
+
if (input.reqId) {
|
|
169
|
+
const target = getWecomRespondTarget(input.sourceId);
|
|
170
|
+
if (target) {
|
|
171
|
+
const wsErr = target.respond(input.reqId, {
|
|
172
|
+
msgtype: "markdown",
|
|
173
|
+
markdown: { content }
|
|
174
|
+
});
|
|
175
|
+
if (!wsErr)
|
|
176
|
+
return { ok: true, channel: "ws" };
|
|
177
|
+
errors.push(`ws: ${wsErr.message}`);
|
|
178
|
+
} else {
|
|
179
|
+
errors.push(`ws: no instance registered for sourceId=${input.sourceId}`);
|
|
180
|
+
}
|
|
181
|
+
} else {
|
|
182
|
+
errors.push("ws: no req_id");
|
|
183
|
+
}
|
|
184
|
+
if (input.rawChatId) {
|
|
185
|
+
try {
|
|
186
|
+
const chatId = await resolveWecomCliChatId(input.rawChatId);
|
|
187
|
+
const cliResult = await sendWecomCliMarkdown({ chatId, content });
|
|
188
|
+
if (cliResult.ok)
|
|
189
|
+
return { ok: true, channel: "cli" };
|
|
190
|
+
errors.push(`cli: ${cliResult.error}`);
|
|
191
|
+
} catch (err) {
|
|
192
|
+
errors.push(`cli: ${err instanceof Error ? err.message : String(err)}`);
|
|
193
|
+
}
|
|
194
|
+
} else {
|
|
195
|
+
errors.push("cli: no chatId");
|
|
196
|
+
}
|
|
197
|
+
return { ok: false, error: errors.join(" | ") };
|
|
198
|
+
}
|
|
199
|
+
async function sendWecomTemplateCard(input) {
|
|
200
|
+
if (!input.chatId) {
|
|
201
|
+
return { ok: false, error: "no chatId" };
|
|
202
|
+
}
|
|
203
|
+
const target = getWecomRespondTarget(input.sourceId);
|
|
204
|
+
if (!target) {
|
|
205
|
+
return {
|
|
206
|
+
ok: false,
|
|
207
|
+
error: `no instance registered for sourceId=${input.sourceId}`
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
if (typeof target.sendCmd !== "function") {
|
|
211
|
+
return {
|
|
212
|
+
ok: false,
|
|
213
|
+
error: `registered instance has no sendCmd (old bridge?)`
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
const frame = buildWecomSendCardFrame({
|
|
217
|
+
chatId: input.chatId,
|
|
218
|
+
chatType: input.chatType,
|
|
219
|
+
card: input.card
|
|
220
|
+
});
|
|
221
|
+
try {
|
|
222
|
+
const err = target.sendCmd(frame.cmd, frame.body);
|
|
223
|
+
if (err)
|
|
224
|
+
return { ok: false, error: err.message };
|
|
225
|
+
return { ok: true, channel: "ws" };
|
|
226
|
+
} catch (err) {
|
|
227
|
+
return {
|
|
228
|
+
ok: false,
|
|
229
|
+
error: err instanceof Error ? err.message : String(err)
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
var wecomRespondTool = {
|
|
234
|
+
name: "wecom_respond",
|
|
235
|
+
description: "Reply to the WeCom (企业微信) user. Primary path is the official wecom-cli " + "(message aibot send, markdown); WS long-connection frame is used as fallback. " + "This is the ONLY outbound channel for WeCom messages.",
|
|
236
|
+
parameters: z.object({
|
|
237
|
+
content: z.string().describe("Reply content (markdown supported)"),
|
|
238
|
+
chat_id: z.string().optional().describe("Target chat id (single chat = peer userid, group = chatid). " + "Defaults to the current event's chatId/senderId."),
|
|
239
|
+
req_id: z.string().optional().describe("Original message frame req_id (optional; used for WS fallback only). " + "Defaults to the current event metadata.reqId.")
|
|
240
|
+
}),
|
|
241
|
+
metadata: {
|
|
242
|
+
category: "messaging",
|
|
243
|
+
tags: ["wecom", "reply", "im"],
|
|
244
|
+
version: "2.0.0",
|
|
245
|
+
channelOnly: true
|
|
246
|
+
},
|
|
247
|
+
execute: async (args, _ctx) => {
|
|
248
|
+
const { content } = args;
|
|
249
|
+
let sourceId;
|
|
250
|
+
let eventChatId;
|
|
251
|
+
let eventReqId;
|
|
252
|
+
try {
|
|
253
|
+
const ctx = getEnvContextOrEmpty();
|
|
254
|
+
sourceId = typeof ctx.sourceId === "string" ? ctx.sourceId : undefined;
|
|
255
|
+
const meta = ctx.envEvent?.metadata;
|
|
256
|
+
const cid = meta?.chatId;
|
|
257
|
+
if (typeof cid === "string" && cid.length > 0)
|
|
258
|
+
eventChatId = cid;
|
|
259
|
+
const rid = meta?.reqId;
|
|
260
|
+
if (typeof rid === "string" && rid.length > 0)
|
|
261
|
+
eventReqId = rid;
|
|
262
|
+
if (!eventChatId) {
|
|
263
|
+
const rcChatId = ctx.replyChannel?.chatId;
|
|
264
|
+
if (typeof rcChatId === "string" && rcChatId.length > 0) {
|
|
265
|
+
eventChatId = rcChatId;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
const rc = meta?.replyChannel;
|
|
269
|
+
if (!eventChatId && typeof rc?.chatId === "string" && rc.chatId) {
|
|
270
|
+
eventChatId = rc.chatId;
|
|
271
|
+
}
|
|
272
|
+
const rcParamsList = [
|
|
273
|
+
rc?.params,
|
|
274
|
+
ctx.replyChannel?.params
|
|
275
|
+
];
|
|
276
|
+
for (const rcParams of rcParamsList) {
|
|
277
|
+
if (!rcParams)
|
|
278
|
+
continue;
|
|
279
|
+
if (!eventReqId) {
|
|
280
|
+
const prid = rcParams.reqId;
|
|
281
|
+
if (typeof prid === "string" && prid.length > 0)
|
|
282
|
+
eventReqId = prid;
|
|
283
|
+
}
|
|
284
|
+
if (!sourceId) {
|
|
285
|
+
const psid = rcParams.sourceId;
|
|
286
|
+
if (typeof psid === "string" && psid.length > 0)
|
|
287
|
+
sourceId = psid;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
if (!sourceId && typeof ctx?.sourceId === "string" && ctx.sourceId) {
|
|
291
|
+
sourceId = ctx.sourceId;
|
|
292
|
+
}
|
|
293
|
+
} catch {}
|
|
294
|
+
const chatId = args.chat_id?.trim() || eventChatId;
|
|
295
|
+
const reqId = args.req_id?.trim() || eventReqId;
|
|
296
|
+
if (!chatId) {
|
|
297
|
+
return {
|
|
298
|
+
success: false,
|
|
299
|
+
output: "",
|
|
300
|
+
error: "wecom_respond: cannot resolve chat_id (no explicit chat_id and no EnvContext event chatId)."
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
if (!sourceId) {
|
|
304
|
+
sourceId = "unknown";
|
|
305
|
+
}
|
|
306
|
+
const startedAt = Date.now();
|
|
307
|
+
const result = await sendWecomReply({
|
|
308
|
+
sourceId,
|
|
309
|
+
rawChatId: chatId,
|
|
310
|
+
reqId,
|
|
311
|
+
content
|
|
312
|
+
});
|
|
313
|
+
if (!result.ok) {
|
|
314
|
+
return {
|
|
315
|
+
success: false,
|
|
316
|
+
output: "",
|
|
317
|
+
error: `wecom_respond: send failed: ${result.error ?? "unknown"}`
|
|
318
|
+
};
|
|
319
|
+
}
|
|
320
|
+
markWecomReplySent();
|
|
321
|
+
return {
|
|
322
|
+
success: true,
|
|
323
|
+
output: `Reply sent to WeCom via ${result.channel} ` + `(chat_id=${chatId}, ${content.length} chars)`,
|
|
324
|
+
metadata: {
|
|
325
|
+
execution_time_ms: Date.now() - startedAt,
|
|
326
|
+
channel: result.channel,
|
|
327
|
+
chat_id: chatId
|
|
328
|
+
}
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
};
|
|
332
|
+
var REPLY_SENT_KEY = "__wecomReplySent";
|
|
333
|
+
function replySentBag(explicit) {
|
|
334
|
+
if (explicit)
|
|
335
|
+
return explicit;
|
|
336
|
+
try {
|
|
337
|
+
const ctx = getEnvContextOrEmpty();
|
|
338
|
+
return ctx.agentContext ??= {};
|
|
339
|
+
} catch {
|
|
340
|
+
return {};
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
function markWecomReplySent(explicitBag) {
|
|
344
|
+
replySentBag(explicitBag)[REPLY_SENT_KEY] = true;
|
|
345
|
+
}
|
|
346
|
+
function wasWecomReplySent(explicitBag) {
|
|
347
|
+
return replySentBag(explicitBag)[REPLY_SENT_KEY] === true;
|
|
348
|
+
}
|
|
349
|
+
function __resetWecomReplySentForTest(explicitBag) {
|
|
350
|
+
delete replySentBag(explicitBag)[REPLY_SENT_KEY];
|
|
351
|
+
}
|
|
352
|
+
var WECOM_EVENT_TYPE = "event-source.event.wecom-cli";
|
|
353
|
+
async function autoReplyWecomTurn(envEvent, finalText) {
|
|
354
|
+
const evt = envEvent;
|
|
355
|
+
if (evt?.type !== WECOM_EVENT_TYPE) {
|
|
356
|
+
return { skipped: true, reason: "not a wecom event" };
|
|
357
|
+
}
|
|
358
|
+
const text = (finalText ?? "").trim();
|
|
359
|
+
if (!text)
|
|
360
|
+
return { skipped: true, reason: "empty final text" };
|
|
361
|
+
if (wasWecomReplySent()) {
|
|
362
|
+
return { skipped: true, reason: "already replied via tool" };
|
|
363
|
+
}
|
|
364
|
+
const meta = evt.metadata ?? {};
|
|
365
|
+
const chatId = typeof meta.chatId === "string" && meta.chatId || typeof meta.senderId === "string" && meta.senderId || "";
|
|
366
|
+
const sourceId = typeof meta.sourceId === "string" && meta.sourceId || "unknown";
|
|
367
|
+
const reqId = typeof meta.reqId === "string" ? meta.reqId : undefined;
|
|
368
|
+
if (!chatId) {
|
|
369
|
+
return { skipped: true, reason: "no chatId in event metadata" };
|
|
370
|
+
}
|
|
371
|
+
const r = await sendWecomReply({
|
|
372
|
+
sourceId,
|
|
373
|
+
rawChatId: chatId,
|
|
374
|
+
reqId,
|
|
375
|
+
content: text
|
|
376
|
+
});
|
|
377
|
+
return { skipped: false, ok: r.ok, channel: r.channel, error: r.error };
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
export { sendWecomCliMarkdown, registerWecomRespondTarget, unregisterWecomRespondTarget, getWecomRespondTarget, __resetWecomRespondRegistryForTest, sendWecomReply, sendWecomTemplateCard, wecomRespondTool, markWecomReplySent, wasWecomReplySent, __resetWecomReplySentForTest, autoReplyWecomTurn };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
init_hook
|
|
3
|
-
} from "./roy-agent-core-
|
|
3
|
+
} from "./roy-agent-core-smf94h73.js";
|
|
4
4
|
import {
|
|
5
5
|
globalHookManager
|
|
6
|
-
} from "./roy-agent-core-
|
|
6
|
+
} from "./roy-agent-core-yet36q5k.js";
|
|
7
7
|
import {
|
|
8
8
|
__esm
|
|
9
9
|
} from "./roy-agent-core-fs0mn2jk.js";
|
|
@@ -9,13 +9,16 @@ import {
|
|
|
9
9
|
getCurrentProcessRegistry,
|
|
10
10
|
killProcessTree
|
|
11
11
|
} from "./roy-agent-core-fttgm52a.js";
|
|
12
|
+
import {
|
|
13
|
+
wecomRespondTool
|
|
14
|
+
} from "./roy-agent-core-h1e1fm9b.js";
|
|
12
15
|
import {
|
|
13
16
|
init_decorator,
|
|
14
17
|
init_trace_filters,
|
|
15
18
|
toolExecResultFilter,
|
|
16
19
|
toolInvokeParamFilter,
|
|
17
20
|
wrapFunction
|
|
18
|
-
} from "./roy-agent-core-
|
|
21
|
+
} from "./roy-agent-core-5s2t8z00.js";
|
|
19
22
|
import {
|
|
20
23
|
createLogger,
|
|
21
24
|
exports_tracer_provider,
|
|
@@ -940,6 +943,7 @@ function getAllBuiltInTools() {
|
|
|
940
943
|
editFileTool,
|
|
941
944
|
grepTool,
|
|
942
945
|
understandImageTool,
|
|
946
|
+
wecomRespondTool,
|
|
943
947
|
queryBackgroundProcessTool,
|
|
944
948
|
compactSessionTool
|
|
945
949
|
];
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createHook,
|
|
3
3
|
init_hook
|
|
4
|
-
} from "./roy-agent-core-
|
|
4
|
+
} from "./roy-agent-core-smf94h73.js";
|
|
5
5
|
import {
|
|
6
6
|
HookManager
|
|
7
|
-
} from "./roy-agent-core-
|
|
7
|
+
} from "./roy-agent-core-yet36q5k.js";
|
|
8
8
|
|
|
9
9
|
// src/env/component.ts
|
|
10
10
|
init_hook();
|
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
} from "./roy-agent-core-7hh0brvs.js";
|
|
4
4
|
import {
|
|
5
5
|
BaseComponent
|
|
6
|
-
} from "./roy-agent-core-
|
|
6
|
+
} from "./roy-agent-core-m39v7qpx.js";
|
|
7
7
|
import {
|
|
8
8
|
init_decorator,
|
|
9
9
|
init_trace_filters
|
|
10
|
-
} from "./roy-agent-core-
|
|
10
|
+
} from "./roy-agent-core-5s2t8z00.js";
|
|
11
11
|
import {
|
|
12
12
|
createLogger,
|
|
13
13
|
getTracerProvider,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TagRepository
|
|
3
|
-
} from "./roy-agent-core-
|
|
4
|
-
import"./roy-agent-core-
|
|
3
|
+
} from "./roy-agent-core-vf9sp6s3.js";
|
|
4
|
+
import"./roy-agent-core-5s2t8z00.js";
|
|
5
5
|
import"./roy-agent-core-7f7t9wwp.js";
|
|
6
6
|
import"./roy-agent-core-85xyctnb.js";
|
|
7
7
|
import"./roy-agent-core-fs0mn2jk.js";
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TempFileManager
|
|
3
3
|
} from "./roy-agent-core-jvv2h3d6.js";
|
|
4
|
+
import {
|
|
5
|
+
ToolValidator,
|
|
6
|
+
setToolReasonConfigComponent
|
|
7
|
+
} from "./roy-agent-core-wxrkcb17.js";
|
|
4
8
|
import {
|
|
5
9
|
AskUserError,
|
|
6
10
|
init_workflow_hil
|
|
@@ -11,23 +15,23 @@ import {
|
|
|
11
15
|
} from "./roy-agent-core-7hh0brvs.js";
|
|
12
16
|
import {
|
|
13
17
|
BaseComponent
|
|
14
|
-
} from "./roy-agent-core-
|
|
18
|
+
} from "./roy-agent-core-m39v7qpx.js";
|
|
15
19
|
import {
|
|
16
20
|
ToolHookPoints,
|
|
17
21
|
globalHookManager,
|
|
18
22
|
init_global_hook_manager
|
|
19
|
-
} from "./roy-agent-core-
|
|
23
|
+
} from "./roy-agent-core-yet36q5k.js";
|
|
20
24
|
import {
|
|
21
25
|
getCurrentTaskId,
|
|
22
26
|
init_env_context
|
|
23
|
-
} from "./roy-agent-core-
|
|
27
|
+
} from "./roy-agent-core-p31ftgq9.js";
|
|
24
28
|
import {
|
|
25
29
|
TracedAs,
|
|
26
30
|
init_decorator,
|
|
27
31
|
init_trace_filters,
|
|
28
32
|
toolExecResultFilter,
|
|
29
33
|
toolInvokeParamFilter
|
|
30
|
-
} from "./roy-agent-core-
|
|
34
|
+
} from "./roy-agent-core-5s2t8z00.js";
|
|
31
35
|
import {
|
|
32
36
|
createLogger,
|
|
33
37
|
init_logger
|
|
@@ -131,36 +135,6 @@ class ToolRegistry {
|
|
|
131
135
|
}
|
|
132
136
|
}
|
|
133
137
|
|
|
134
|
-
// src/env/tool/validator.ts
|
|
135
|
-
import { ZodError } from "zod";
|
|
136
|
-
|
|
137
|
-
class ToolValidator {
|
|
138
|
-
async validate(tool, args) {
|
|
139
|
-
try {
|
|
140
|
-
const parsed = await tool.parameters.parseAsync(args);
|
|
141
|
-
return {
|
|
142
|
-
success: true,
|
|
143
|
-
data: parsed
|
|
144
|
-
};
|
|
145
|
-
} catch (error) {
|
|
146
|
-
if (error instanceof ZodError) {
|
|
147
|
-
const errorMessage = tool.formatValidationError ? tool.formatValidationError(error) : this.formatError(error);
|
|
148
|
-
return {
|
|
149
|
-
success: false,
|
|
150
|
-
error: `Invalid arguments for tool '${tool.name}': ${errorMessage}`
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
|
-
return {
|
|
154
|
-
success: false,
|
|
155
|
-
error: `Validation error: ${error}`
|
|
156
|
-
};
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
formatError(error) {
|
|
160
|
-
return error.errors.map((e) => `${e.path.join(".")}: ${e.message}`).join("; ");
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
|
|
164
138
|
// src/env/constants.ts
|
|
165
139
|
var TOOL_UNAVAILABLE_ERROR_RE = /^Tool (?:not found|disabled):/;
|
|
166
140
|
function isToolUnavailableError(message) {
|
|
@@ -183,7 +157,8 @@ var TOOL_DEFAULTS = {
|
|
|
183
157
|
"tool.sandbox.type": "native",
|
|
184
158
|
"tool.execution.timeout": 30000,
|
|
185
159
|
"tool.execution.maxConcurrency": 5,
|
|
186
|
-
"tool.execution.maxOutputSize": 5120
|
|
160
|
+
"tool.execution.maxOutputSize": 5120,
|
|
161
|
+
"tool.reason.required": true
|
|
187
162
|
};
|
|
188
163
|
var TOOL_CONFIG_REGISTRATION = {
|
|
189
164
|
name: "tool",
|
|
@@ -198,7 +173,8 @@ var TOOL_CONFIG_REGISTRATION = {
|
|
|
198
173
|
{ key: "tool.sandbox.type", sources: ["env", "file"] },
|
|
199
174
|
{ key: "tool.execution.timeout", sources: ["env", "file"] },
|
|
200
175
|
{ key: "tool.execution.maxConcurrency", sources: ["env", "file"] },
|
|
201
|
-
{ key: "tool.execution.maxOutputSize", sources: ["env", "file"] }
|
|
176
|
+
{ key: "tool.execution.maxOutputSize", sources: ["env", "file"] },
|
|
177
|
+
{ key: "tool.reason.required", sources: ["env", "file"] }
|
|
202
178
|
]
|
|
203
179
|
};
|
|
204
180
|
|
|
@@ -307,6 +283,7 @@ class ToolComponent extends BaseComponent {
|
|
|
307
283
|
}
|
|
308
284
|
this.configComponent = options.configComponent;
|
|
309
285
|
setToolConfigComponent(options.configComponent);
|
|
286
|
+
setToolReasonConfigComponent(options.configComponent);
|
|
310
287
|
await this.registerConfig(options);
|
|
311
288
|
if (this.config?.builtInTools?.enabled !== false) {
|
|
312
289
|
await this.loadBuiltInTools();
|
|
@@ -338,7 +315,8 @@ class ToolComponent extends BaseComponent {
|
|
|
338
315
|
"tool.sandbox.type",
|
|
339
316
|
"tool.sandbox.defaultConfig",
|
|
340
317
|
"tool.execution.timeout",
|
|
341
|
-
"tool.execution.maxConcurrency"
|
|
318
|
+
"tool.execution.maxConcurrency",
|
|
319
|
+
"tool.reason.required"
|
|
342
320
|
];
|
|
343
321
|
for (const key of toolKeys) {
|
|
344
322
|
const envKey = toEnvKey(key, prefix);
|
|
@@ -417,6 +395,7 @@ class ToolComponent extends BaseComponent {
|
|
|
417
395
|
async onStop() {
|
|
418
396
|
this.configWatcher?.();
|
|
419
397
|
this.configWatcher = undefined;
|
|
398
|
+
setToolReasonConfigComponent(null);
|
|
420
399
|
this.setStatus("stopped");
|
|
421
400
|
}
|
|
422
401
|
register(tool, source = "dynamic") {
|
|
@@ -614,4 +593,4 @@ var ToolComponentConfigSchema = z.object({
|
|
|
614
593
|
}).default({})
|
|
615
594
|
});
|
|
616
595
|
|
|
617
|
-
export { ToolRegistry,
|
|
596
|
+
export { ToolRegistry, isToolUnavailableError, setToolConfigComponent, getMaxOutputSize, truncateOutputInline, ToolComponent };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
exports_node_registry_helper,
|
|
3
3
|
init_node_registry_helper
|
|
4
|
-
} from "./roy-agent-core-
|
|
4
|
+
} from "./roy-agent-core-wqs6yypq.js";
|
|
5
5
|
import {
|
|
6
6
|
askUserTool,
|
|
7
7
|
createRunWorkflowTool,
|
|
@@ -13,18 +13,18 @@ import {
|
|
|
13
13
|
createWorkflowSearchTool,
|
|
14
14
|
createWorkflowTagListTool,
|
|
15
15
|
createWorkflowValidateTool
|
|
16
|
-
} from "./roy-agent-core-
|
|
16
|
+
} from "./roy-agent-core-azyz78ky.js";
|
|
17
17
|
import {
|
|
18
18
|
WorkflowService
|
|
19
|
-
} from "./roy-agent-core-
|
|
19
|
+
} from "./roy-agent-core-e69qxdyy.js";
|
|
20
20
|
import {
|
|
21
21
|
WorkflowEngine,
|
|
22
22
|
exports_engine,
|
|
23
23
|
init_engine
|
|
24
|
-
} from "./roy-agent-core-
|
|
24
|
+
} from "./roy-agent-core-6gj1hc5z.js";
|
|
25
25
|
import {
|
|
26
26
|
BaseComponent
|
|
27
|
-
} from "./roy-agent-core-
|
|
27
|
+
} from "./roy-agent-core-m39v7qpx.js";
|
|
28
28
|
import {
|
|
29
29
|
createLogger,
|
|
30
30
|
init_logger
|
|
@@ -104,7 +104,7 @@ class WorkflowComponent extends BaseComponent {
|
|
|
104
104
|
return;
|
|
105
105
|
try {
|
|
106
106
|
const { NodeRegistry } = await import("../../env/workflow/engine/index.js");
|
|
107
|
-
const { registerDecoratorNodeType: registerDecoratorNodeType2 } = await import("./roy-agent-core-
|
|
107
|
+
const { registerDecoratorNodeType: registerDecoratorNodeType2 } = await import("./roy-agent-core-fepm835e.js");
|
|
108
108
|
this.nodeRegistry = new NodeRegistry;
|
|
109
109
|
registerDecoratorNodeType2(this.nodeRegistry);
|
|
110
110
|
this.decoratorsRegistered = true;
|
|
@@ -134,14 +134,14 @@ class WorkflowComponent extends BaseComponent {
|
|
|
134
134
|
}
|
|
135
135
|
async runWorkflow(definition, input, options) {
|
|
136
136
|
const { NodeRegistry } = await import("../../env/workflow/engine/index.js");
|
|
137
|
-
const { registerDecoratorNodeType: registerDecoratorNodeType2 } = await import("./roy-agent-core-
|
|
137
|
+
const { registerDecoratorNodeType: registerDecoratorNodeType2 } = await import("./roy-agent-core-fepm835e.js");
|
|
138
138
|
const toolComponent = this.toolComponent || this._workflowEnv?.getComponent("tool");
|
|
139
139
|
const skillComponent = this._workflowEnv?.getComponent("skill");
|
|
140
140
|
let agentRunner = this.agentRunner;
|
|
141
141
|
if (!agentRunner && this._workflowEnv) {
|
|
142
142
|
const agentComponent = this._workflowEnv.getComponent("agent");
|
|
143
143
|
if (agentComponent) {
|
|
144
|
-
const { AgentComponentAdapter } = await import("./roy-agent-core-
|
|
144
|
+
const { AgentComponentAdapter } = await import("./roy-agent-core-yfpnkc4z.js");
|
|
145
145
|
agentRunner = new AgentComponentAdapter(agentComponent, {}, this.sessionComponent);
|
|
146
146
|
}
|
|
147
147
|
}
|
|
@@ -163,7 +163,7 @@ class WorkflowComponent extends BaseComponent {
|
|
|
163
163
|
if (this.workflowService) {
|
|
164
164
|
this.workflowService = null;
|
|
165
165
|
try {
|
|
166
|
-
const { closeDatabase } = await import("./roy-agent-core-
|
|
166
|
+
const { closeDatabase } = await import("./roy-agent-core-0crmsc12.js");
|
|
167
167
|
closeDatabase();
|
|
168
168
|
componentLogger.info("[WorkflowComponent] SQLite database closed");
|
|
169
169
|
} catch (error) {
|
|
@@ -241,9 +241,9 @@ class WorkflowComponent extends BaseComponent {
|
|
|
241
241
|
}
|
|
242
242
|
async initSqliteService() {
|
|
243
243
|
try {
|
|
244
|
-
const { getDatabase, initializeTables } = await import("./roy-agent-core-
|
|
245
|
-
const { WorkflowRepository } = await import("./roy-agent-core-
|
|
246
|
-
const { TagRepository } = await import("./roy-agent-core-
|
|
244
|
+
const { getDatabase, initializeTables } = await import("./roy-agent-core-0crmsc12.js");
|
|
245
|
+
const { WorkflowRepository } = await import("./roy-agent-core-w9ryeg2p.js");
|
|
246
|
+
const { TagRepository } = await import("./roy-agent-core-mvh0td7p.js");
|
|
247
247
|
const db = getDatabase();
|
|
248
248
|
initializeTables();
|
|
249
249
|
const workflowRepository = new WorkflowRepository(db);
|
|
@@ -309,7 +309,7 @@ class WorkflowComponent extends BaseComponent {
|
|
|
309
309
|
this.workflowService = null;
|
|
310
310
|
this.nodeRegistry = null;
|
|
311
311
|
try {
|
|
312
|
-
const { closeDatabase } = await import("./roy-agent-core-
|
|
312
|
+
const { closeDatabase } = await import("./roy-agent-core-0crmsc12.js");
|
|
313
313
|
closeDatabase();
|
|
314
314
|
} catch {}
|
|
315
315
|
this._status = "stopped";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
builtInPrompts
|
|
3
|
-
} from "./roy-agent-core-
|
|
3
|
+
} from "./roy-agent-core-y7fqtzk2.js";
|
|
4
4
|
import {
|
|
5
5
|
getXDGPath
|
|
6
6
|
} from "./roy-agent-core-qxnbvgwe.js";
|
|
@@ -10,14 +10,14 @@ import {
|
|
|
10
10
|
} from "./roy-agent-core-7hh0brvs.js";
|
|
11
11
|
import {
|
|
12
12
|
BaseComponent
|
|
13
|
-
} from "./roy-agent-core-
|
|
13
|
+
} from "./roy-agent-core-m39v7qpx.js";
|
|
14
14
|
import {
|
|
15
15
|
createHook
|
|
16
|
-
} from "./roy-agent-core-
|
|
16
|
+
} from "./roy-agent-core-smf94h73.js";
|
|
17
17
|
import {
|
|
18
18
|
globalHookManager,
|
|
19
19
|
init_global_hook_manager
|
|
20
|
-
} from "./roy-agent-core-
|
|
20
|
+
} from "./roy-agent-core-yet36q5k.js";
|
|
21
21
|
import {
|
|
22
22
|
createLogger,
|
|
23
23
|
init_logger
|