@ai-setting/roy-agent-core 1.6.13 → 1.6.15
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 +10 -10
- package/dist/env/agent/index.js +16 -16
- package/dist/env/commands/index.js +10 -10
- package/dist/env/context/index.js +27 -7
- package/dist/env/debug/index.js +10 -10
- package/dist/env/event-source/index.js +18 -14
- package/dist/env/hook/index.js +8 -8
- package/dist/env/index.js +41 -41
- package/dist/env/llm/index.js +12 -12
- package/dist/env/log-trace/index.js +10 -10
- package/dist/env/mcp/index.js +11 -11
- package/dist/env/mcp/tool/index.js +4 -4
- package/dist/env/memory/index.js +11 -11
- package/dist/env/memory/plugin/index.js +4 -4
- package/dist/env/plugin/index.js +10 -10
- package/dist/env/prompt/index.js +10 -10
- package/dist/env/session/index.js +13 -13
- package/dist/env/session/storage/index.js +6 -6
- package/dist/env/skill/index.js +10 -10
- package/dist/env/task/delegate/index.js +10 -10
- package/dist/env/task/index.js +15 -15
- package/dist/env/task/plugins/index.js +11 -9
- package/dist/env/task/storage/index.js +5 -5
- package/dist/env/task/tools/index.js +6 -6
- package/dist/env/tool/built-in/index.js +6 -6
- package/dist/env/tool/index.js +13 -13
- package/dist/env/workflow/engine/index.js +13 -13
- package/dist/env/workflow/index.js +27 -25
- package/dist/env/workflow/nodes/index.js +5 -5
- package/dist/env/workflow/service/index.js +5 -5
- package/dist/env/workflow/storage/index.js +6 -6
- package/dist/env/workflow/tools/index.js +18 -17
- package/dist/env/workflow/types/index.js +3 -1
- package/dist/env/workflow/utils/index.js +8 -8
- package/dist/index.js +54 -52
- package/dist/shared/@ai-setting/{roy-agent-core-r74v00c7.js → roy-agent-core-02aw62bv.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-6qbyfzsw.js → roy-agent-core-0rwymn7m.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-wpw37qqf.js → roy-agent-core-1380b0re.js} +29 -8
- package/dist/shared/@ai-setting/{roy-agent-core-deqpzcg7.js → roy-agent-core-1ecgh5ya.js} +81 -13
- package/dist/shared/@ai-setting/{roy-agent-core-wjve1qr5.js → roy-agent-core-1mrc9a1r.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-xxgazz27.js → roy-agent-core-1qjgwjjs.js} +5 -5
- package/dist/shared/@ai-setting/{roy-agent-core-rga3f0hm.js → roy-agent-core-2b0mw2h3.js} +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-ck0m8754.js → roy-agent-core-416rpxkp.js} +5 -5
- package/dist/shared/@ai-setting/{roy-agent-core-c6592r3c.js → roy-agent-core-4an1p9a1.js} +31 -2
- package/dist/shared/@ai-setting/{roy-agent-core-8cbsjkkx.js → roy-agent-core-4z7dzcgb.js} +5 -5
- package/dist/shared/@ai-setting/{roy-agent-core-txsswwhm.js → roy-agent-core-5pzegp1x.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-htjag2nr.js → roy-agent-core-77wfej1h.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-resnbd2j.js → roy-agent-core-7kw06e4b.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-yfhgxh5a.js → roy-agent-core-7r72622v.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-dcd1s7ct.js → roy-agent-core-8n0e62y4.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-fdm579b1.js → roy-agent-core-96mj6gvc.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-fwxqevpf.js → roy-agent-core-9jsfqc1m.js} +8 -8
- package/dist/shared/@ai-setting/{roy-agent-core-1mq9erp8.js → roy-agent-core-ajp566yv.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-j62bjagf.js → roy-agent-core-akb8mb9v.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-5h49ct1a.js → roy-agent-core-ataagh3a.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-606z25nw.js → roy-agent-core-atpchjdz.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-9nhwdq9r.js → roy-agent-core-b8wn8yhk.js} +6 -6
- package/dist/shared/@ai-setting/{roy-agent-core-vcjq65nz.js → roy-agent-core-bq1gskrf.js} +23 -1
- package/dist/shared/@ai-setting/{roy-agent-core-nw39k111.js → roy-agent-core-bqe4c9f2.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-1gsnq4p2.js → roy-agent-core-dh9rajdh.js} +1 -1
- package/dist/shared/@ai-setting/roy-agent-core-dtkbj8fk.js +206 -0
- package/dist/shared/@ai-setting/{roy-agent-core-8x4ngxcy.js → roy-agent-core-e0kaxcy1.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-nv4yfy3m.js → roy-agent-core-eaj0b1hm.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-3kbf53sh.js → roy-agent-core-ehpnd2be.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-w22tzjj5.js → roy-agent-core-ez91vxas.js} +94 -15
- package/dist/shared/@ai-setting/{roy-agent-core-jw0hbacv.js → roy-agent-core-fxembepv.js} +6 -6
- package/dist/shared/@ai-setting/{roy-agent-core-80bdhnwk.js → roy-agent-core-gc75v3px.js} +5 -5
- package/dist/shared/@ai-setting/{roy-agent-core-24rmf17n.js → roy-agent-core-gmnex23m.js} +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-qnrf2aw6.js → roy-agent-core-jrj30vq3.js} +33 -2
- package/dist/shared/@ai-setting/{roy-agent-core-atjd1tpt.js → roy-agent-core-keb51jag.js} +5 -5
- package/dist/shared/@ai-setting/{roy-agent-core-7z9b1fm8.js → roy-agent-core-m00kamqp.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-4w6rgxs4.js → roy-agent-core-mdp8y7ky.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-v5nknfh0.js → roy-agent-core-mmnac1s6.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-vyygk314.js → roy-agent-core-nna4s0qs.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-f79ee0aw.js → roy-agent-core-p4z6nxgz.js} +5 -5
- package/dist/shared/@ai-setting/{roy-agent-core-qbm5zy6s.js → roy-agent-core-pr4jekyy.js} +6 -6
- package/dist/shared/@ai-setting/{roy-agent-core-rpq0mcvv.js → roy-agent-core-r0t34bbh.js} +79 -4
- package/dist/shared/@ai-setting/{roy-agent-core-ywtmc0bh.js → roy-agent-core-r15sn7ve.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-fvkyv5j6.js → roy-agent-core-rmesvpff.js} +12 -12
- package/dist/shared/@ai-setting/{roy-agent-core-9hqqhye6.js → roy-agent-core-sqt96sam.js} +4 -2
- package/dist/shared/@ai-setting/{roy-agent-core-2yavqjsh.js → roy-agent-core-v20nxrs1.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-dbkkjmqz.js → roy-agent-core-vc7p80sd.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-x7fgze6s.js → roy-agent-core-vkesx61c.js} +4 -4
- package/dist/shared/@ai-setting/roy-agent-core-w6kj6nmj.js +11 -0
- package/dist/shared/@ai-setting/{roy-agent-core-2b4078kz.js → roy-agent-core-wq98qf5y.js} +28 -13
- package/dist/shared/@ai-setting/{roy-agent-core-wtbyj0q1.js → roy-agent-core-wr3pk3h3.js} +1 -1
- package/dist/shared/@ai-setting/roy-agent-core-wsqnf2za.js +19 -0
- package/dist/shared/@ai-setting/{roy-agent-core-v77pp20w.js → roy-agent-core-x36fsm47.js} +14 -14
- package/dist/shared/@ai-setting/{roy-agent-core-0pbmweh4.js → roy-agent-core-x7sc21ek.js} +6 -6
- package/dist/shared/@ai-setting/{roy-agent-core-w6wagmhw.js → roy-agent-core-xzc53mnk.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-0crh2g0m.js → roy-agent-core-yr3fp8tv.js} +13 -13
- package/dist/shared/@ai-setting/{roy-agent-core-m0wp34r4.js → roy-agent-core-z1hm09xp.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-9abv4ewh.js → roy-agent-core-zdzkzx5g.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-95bbd2jv.js → roy-agent-core-zs4f0tcy.js} +2 -2
- package/dist/utils/temp-file-manager/index.js +4 -4
- package/package.json +1 -1
- package/dist/shared/@ai-setting/roy-agent-core-6jqpdjr4.js +0 -19
- package/dist/shared/@ai-setting/roy-agent-core-endah27g.js +0 -81
- package/dist/shared/@ai-setting/roy-agent-core-qfdj8872.js +0 -11
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./roy-agent-core-az13yzmc.js";
|
|
4
4
|
import {
|
|
5
5
|
validateWorkflowDefinition
|
|
6
|
-
} from "./roy-agent-core-
|
|
6
|
+
} from "./roy-agent-core-1mrc9a1r.js";
|
|
7
7
|
import {
|
|
8
8
|
WORKFLOW_EXTRACT_PROMPT
|
|
9
9
|
} from "./roy-agent-core-apz6v22z.js";
|
|
@@ -12,19 +12,22 @@ import {
|
|
|
12
12
|
} from "./roy-agent-core-1pg0fepg.js";
|
|
13
13
|
import {
|
|
14
14
|
init_context
|
|
15
|
-
} from "./roy-agent-core-
|
|
15
|
+
} from "./roy-agent-core-sqt96sam.js";
|
|
16
16
|
import {
|
|
17
|
-
getEnvContextOrEmpty
|
|
18
|
-
|
|
17
|
+
getEnvContextOrEmpty,
|
|
18
|
+
getEventFromEnvContext,
|
|
19
|
+
getLarkMessageId,
|
|
20
|
+
isLarkEvent
|
|
21
|
+
} from "./roy-agent-core-dtkbj8fk.js";
|
|
19
22
|
import {
|
|
20
23
|
TracedAs,
|
|
21
24
|
init_decorator,
|
|
22
25
|
wrapFunction
|
|
23
|
-
} from "./roy-agent-core-
|
|
26
|
+
} from "./roy-agent-core-96mj6gvc.js";
|
|
24
27
|
import {
|
|
25
28
|
createLogger,
|
|
26
29
|
init_logger
|
|
27
|
-
} from "./roy-agent-core-
|
|
30
|
+
} from "./roy-agent-core-nna4s0qs.js";
|
|
28
31
|
import {
|
|
29
32
|
__legacyDecorateClassTS,
|
|
30
33
|
__require
|
|
@@ -289,11 +292,11 @@ ${prompt}`;
|
|
|
289
292
|
}
|
|
290
293
|
if (!this._workflowRepo) {
|
|
291
294
|
try {
|
|
292
|
-
const sqlite = await import("./roy-agent-core-
|
|
295
|
+
const sqlite = await import("./roy-agent-core-pr4jekyy.js");
|
|
293
296
|
this.ensureDataDir();
|
|
294
297
|
const db = sqlite.getDatabase();
|
|
295
298
|
sqlite.initializeTables();
|
|
296
|
-
const { WorkflowRepository } = await import("./roy-agent-core-
|
|
299
|
+
const { WorkflowRepository } = await import("./roy-agent-core-fxembepv.js");
|
|
297
300
|
this._workflowRepo = new WorkflowRepository(db);
|
|
298
301
|
return this._workflowRepo;
|
|
299
302
|
} catch {
|
|
@@ -378,6 +381,19 @@ var logger3 = createLogger("lark-cli:task-notify");
|
|
|
378
381
|
function isTaskNotifyDebugEnabled() {
|
|
379
382
|
return process.env.ROY_TASK_NOTIFY_DEBUG === "1" || process.env.ROY_TRACE_DEBUG === "1";
|
|
380
383
|
}
|
|
384
|
+
function extractLarkFields(env) {
|
|
385
|
+
const event = getEventFromEnvContext(env);
|
|
386
|
+
if (!isLarkEvent(event)) {
|
|
387
|
+
return { isLark: false };
|
|
388
|
+
}
|
|
389
|
+
return {
|
|
390
|
+
isLark: true,
|
|
391
|
+
source: event.source,
|
|
392
|
+
messageId: getLarkMessageId(event) ?? env.replyChannel?.messageId,
|
|
393
|
+
chatId: env.replyChannel?.chatId,
|
|
394
|
+
userId: env.replyChannel?.userId
|
|
395
|
+
};
|
|
396
|
+
}
|
|
381
397
|
var NotifyType;
|
|
382
398
|
((NotifyType2) => {
|
|
383
399
|
NotifyType2["TASK_CREATED"] = "task_created";
|
|
@@ -510,6 +526,11 @@ class LarkCliTaskNotifyHook {
|
|
|
510
526
|
if (!replyChannel && _hookContext?.metadata?.envContext) {
|
|
511
527
|
replyChannel = _hookContext.metadata.envContext.replyChannel;
|
|
512
528
|
}
|
|
529
|
+
const larkFields = extractLarkFields(env);
|
|
530
|
+
if (!larkFields.isLark && env.event) {
|
|
531
|
+
logger3.debug(`Skipping notification for non-lark event source: ${larkFields.source}`);
|
|
532
|
+
return;
|
|
533
|
+
}
|
|
513
534
|
const chatId = replyChannel?.chatId;
|
|
514
535
|
const messageId = replyChannel?.messageId;
|
|
515
536
|
if (!chatId && !messageId) {
|
|
@@ -593,11 +614,56 @@ ${content}`;
|
|
|
593
614
|
return text;
|
|
594
615
|
return text.substring(0, maxLen) + "...";
|
|
595
616
|
}
|
|
596
|
-
|
|
617
|
+
appendSpatiotemporalContextLines(lines, task, options = {}) {
|
|
597
618
|
if (task?.project_path) {
|
|
598
|
-
lines.push(`-
|
|
619
|
+
lines.push(`- \uD83D\uDCC2 项目路径: \`${task.project_path}\``);
|
|
620
|
+
}
|
|
621
|
+
const ctxStr = task?.context;
|
|
622
|
+
let parsedCtx = null;
|
|
623
|
+
if (typeof ctxStr === "string" && ctxStr.length > 0) {
|
|
624
|
+
try {
|
|
625
|
+
const obj = JSON.parse(ctxStr);
|
|
626
|
+
if (obj && typeof obj === "object" && !Array.isArray(obj)) {
|
|
627
|
+
parsedCtx = obj;
|
|
628
|
+
}
|
|
629
|
+
} catch {}
|
|
630
|
+
}
|
|
631
|
+
if (!parsedCtx) {
|
|
632
|
+
if (options.appendFullContext && typeof ctxStr === "string") {
|
|
633
|
+
lines.push(`- \uD83D\uDCCB 完整 context: \`${this.truncate(ctxStr, 200)}\``);
|
|
634
|
+
}
|
|
635
|
+
return;
|
|
636
|
+
}
|
|
637
|
+
if (parsedCtx.worktree_path && typeof parsedCtx.worktree_path === "string") {
|
|
638
|
+
lines.push(`- \uD83C\uDF3F Worktree: \`${parsedCtx.worktree_path}\``);
|
|
639
|
+
}
|
|
640
|
+
if (parsedCtx.created_at && typeof parsedCtx.created_at === "string") {
|
|
641
|
+
lines.push(`- ⏰ 时间上下文: ${parsedCtx.created_at}`);
|
|
642
|
+
}
|
|
643
|
+
if (parsedCtx.prior_context && typeof parsedCtx.prior_context === "object") {
|
|
644
|
+
const priorStr = this.formatPriorContext(parsedCtx.prior_context);
|
|
645
|
+
if (priorStr) {
|
|
646
|
+
lines.push(`- \uD83D\uDCDC 背景: ${priorStr}`);
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
if (options.appendFullContext) {
|
|
650
|
+
lines.push(`- \uD83D\uDCCB 完整 context: \`${this.truncate(JSON.stringify(parsedCtx), 300)}\``);
|
|
599
651
|
}
|
|
600
652
|
}
|
|
653
|
+
formatPriorContext(prior) {
|
|
654
|
+
if (!prior || typeof prior !== "object")
|
|
655
|
+
return "";
|
|
656
|
+
const entries = [];
|
|
657
|
+
for (const [k, v] of Object.entries(prior)) {
|
|
658
|
+
if (v === null || v === undefined)
|
|
659
|
+
continue;
|
|
660
|
+
const s = typeof v === "object" ? JSON.stringify(v) : String(v);
|
|
661
|
+
if (s === "" || s === "undefined")
|
|
662
|
+
continue;
|
|
663
|
+
entries.push(`${k}=${s}`);
|
|
664
|
+
}
|
|
665
|
+
return entries.join(", ");
|
|
666
|
+
}
|
|
601
667
|
shouldNotify(type) {
|
|
602
668
|
const { notifyTypes } = this.config;
|
|
603
669
|
if (notifyTypes && notifyTypes.length === 0)
|
|
@@ -636,7 +702,7 @@ ${content}`;
|
|
|
636
702
|
if (task.priority) {
|
|
637
703
|
lines.push(`- **优先级**: ${task.priority}`);
|
|
638
704
|
}
|
|
639
|
-
this.
|
|
705
|
+
this.appendSpatiotemporalContextLines(lines, task);
|
|
640
706
|
return lines.join(`
|
|
641
707
|
`);
|
|
642
708
|
}
|
|
@@ -655,7 +721,7 @@ ${content}`;
|
|
|
655
721
|
if (changes?.current_status) {
|
|
656
722
|
lines.push(`- **当前状态**: ${changes.current_status}`);
|
|
657
723
|
}
|
|
658
|
-
this.
|
|
724
|
+
this.appendSpatiotemporalContextLines(lines, task);
|
|
659
725
|
const changeKeys = Object.keys(changes || {}).filter((k) => !["status", "progress", "current_status"].includes(k));
|
|
660
726
|
if (changeKeys.length > 0) {
|
|
661
727
|
lines.push(`- **变更**: ${changeKeys.join(", ")}`);
|
|
@@ -699,7 +765,9 @@ ${content}`;
|
|
|
699
765
|
if (operation.processDescription) {
|
|
700
766
|
lines.push(`- **过程概要**: ${this.truncate(String(operation.processDescription), 200)}`);
|
|
701
767
|
}
|
|
702
|
-
this.
|
|
768
|
+
this.appendSpatiotemporalContextLines(lines, resolvedTask, {
|
|
769
|
+
appendFullContext: true
|
|
770
|
+
});
|
|
703
771
|
if (operation.sessionId) {
|
|
704
772
|
lines.push(`- **Session**: \`${operation.sessionId}\``);
|
|
705
773
|
}
|
|
@@ -3,27 +3,27 @@ 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-akb8mb9v.js";
|
|
7
7
|
import {
|
|
8
8
|
init_decorator
|
|
9
|
-
} from "./roy-agent-core-
|
|
9
|
+
} from "./roy-agent-core-96mj6gvc.js";
|
|
10
10
|
import {
|
|
11
11
|
createLogger,
|
|
12
12
|
init_logger,
|
|
13
13
|
setConfigComponent,
|
|
14
14
|
setQuietMode
|
|
15
|
-
} from "./roy-agent-core-
|
|
15
|
+
} from "./roy-agent-core-nna4s0qs.js";
|
|
16
16
|
import {
|
|
17
17
|
getTracerProvider,
|
|
18
18
|
init_propagation,
|
|
19
19
|
init_tracer_provider,
|
|
20
20
|
init_types,
|
|
21
21
|
propagation
|
|
22
|
-
} from "./roy-agent-core-
|
|
22
|
+
} from "./roy-agent-core-m00kamqp.js";
|
|
23
23
|
import {
|
|
24
24
|
SQLiteSpanStorage,
|
|
25
25
|
init_span_storage
|
|
26
|
-
} from "./roy-agent-core-
|
|
26
|
+
} from "./roy-agent-core-4an1p9a1.js";
|
|
27
27
|
import {
|
|
28
28
|
__require
|
|
29
29
|
} from "./roy-agent-core-fs0mn2jk.js";
|
|
@@ -8,17 +8,17 @@ import {
|
|
|
8
8
|
} from "./roy-agent-core-fnv3ev18.js";
|
|
9
9
|
import {
|
|
10
10
|
adaptMcpTool
|
|
11
|
-
} from "./roy-agent-core-
|
|
11
|
+
} from "./roy-agent-core-mdp8y7ky.js";
|
|
12
12
|
import {
|
|
13
13
|
toEnvKey
|
|
14
14
|
} from "./roy-agent-core-7hh0brvs.js";
|
|
15
15
|
import {
|
|
16
16
|
BaseComponent
|
|
17
|
-
} from "./roy-agent-core-
|
|
17
|
+
} from "./roy-agent-core-akb8mb9v.js";
|
|
18
18
|
import {
|
|
19
19
|
createLogger,
|
|
20
20
|
init_logger
|
|
21
|
-
} from "./roy-agent-core-
|
|
21
|
+
} from "./roy-agent-core-nna4s0qs.js";
|
|
22
22
|
|
|
23
23
|
// src/env/mcp/types.ts
|
|
24
24
|
import { z } from "zod";
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./roy-agent-core-y3g3ar7a.js";
|
|
4
4
|
import {
|
|
5
5
|
invoke
|
|
6
|
-
} from "./roy-agent-core-
|
|
6
|
+
} from "./roy-agent-core-8n0e62y4.js";
|
|
7
7
|
import {
|
|
8
8
|
ContextError,
|
|
9
9
|
ErrorCodes
|
|
@@ -14,20 +14,20 @@ import {
|
|
|
14
14
|
} from "./roy-agent-core-7hh0brvs.js";
|
|
15
15
|
import {
|
|
16
16
|
BaseComponent
|
|
17
|
-
} from "./roy-agent-core-
|
|
17
|
+
} from "./roy-agent-core-akb8mb9v.js";
|
|
18
18
|
import {
|
|
19
19
|
LLMHookPoints,
|
|
20
20
|
globalHookManager,
|
|
21
21
|
init_global_hook_manager
|
|
22
|
-
} from "./roy-agent-core-
|
|
22
|
+
} from "./roy-agent-core-vc7p80sd.js";
|
|
23
23
|
import {
|
|
24
24
|
TracedAs,
|
|
25
25
|
init_decorator
|
|
26
|
-
} from "./roy-agent-core-
|
|
26
|
+
} from "./roy-agent-core-96mj6gvc.js";
|
|
27
27
|
import {
|
|
28
28
|
createLogger,
|
|
29
29
|
init_logger
|
|
30
|
-
} from "./roy-agent-core-
|
|
30
|
+
} from "./roy-agent-core-nna4s0qs.js";
|
|
31
31
|
import {
|
|
32
32
|
__legacyDecorateClassTS
|
|
33
33
|
} from "./roy-agent-core-fs0mn2jk.js";
|
|
@@ -7,6 +7,35 @@ import {
|
|
|
7
7
|
function isSpanStorageDebugEnabled() {
|
|
8
8
|
return process.env.ROY_TRACE_DEBUG_STORAGE === "1" || process.env.ROY_TRACE_DEBUG === "1";
|
|
9
9
|
}
|
|
10
|
+
function safeStringify(obj) {
|
|
11
|
+
const seen = new WeakSet;
|
|
12
|
+
try {
|
|
13
|
+
return JSON.stringify(obj, (_key, value) => {
|
|
14
|
+
if (typeof value === "function")
|
|
15
|
+
return "[Function]";
|
|
16
|
+
if (value === undefined)
|
|
17
|
+
return "[undefined]";
|
|
18
|
+
if (value === null)
|
|
19
|
+
return null;
|
|
20
|
+
if (value instanceof Error) {
|
|
21
|
+
return `${value.name}: ${value.message}`;
|
|
22
|
+
}
|
|
23
|
+
if (typeof value === "object") {
|
|
24
|
+
if ("$typeof" in value || "type" in value && "props" in value && "key" in value) {
|
|
25
|
+
return "[ReactElement]";
|
|
26
|
+
}
|
|
27
|
+
if (seen.has(value))
|
|
28
|
+
return "[Circular]";
|
|
29
|
+
seen.add(value);
|
|
30
|
+
}
|
|
31
|
+
if (typeof value === "bigint")
|
|
32
|
+
return value.toString();
|
|
33
|
+
return value;
|
|
34
|
+
});
|
|
35
|
+
} catch (err) {
|
|
36
|
+
return `[Unserializable: ${err instanceof Error ? err.message : String(err)}]`;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
10
39
|
function getDatabaseClass() {
|
|
11
40
|
if (typeof Bun !== "undefined") {
|
|
12
41
|
const { Database } = __require("bun:sqlite");
|
|
@@ -88,12 +117,12 @@ class SQLiteSpanStorage {
|
|
|
88
117
|
(span_id, trace_id, parent_span_id, name, kind, status, start_time, end_time, attributes, result, error, time_created)
|
|
89
118
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
90
119
|
`);
|
|
91
|
-
const resultValue = span.result !== undefined && span.result !== null ? typeof span.result === "string" ? span.result :
|
|
120
|
+
const resultValue = span.result !== undefined && span.result !== null ? typeof span.result === "string" ? span.result : safeStringify(span.result) : null;
|
|
92
121
|
if (isSpanStorageDebugEnabled()) {
|
|
93
122
|
console.log(`[SpanStorage] Saving to "${this.dbPath}": name="${span.name}" traceId=${span.traceId} spanId=${span.spanId} status=${span.status}`);
|
|
94
123
|
}
|
|
95
124
|
try {
|
|
96
|
-
const result = stmt.run(span.spanId, span.traceId, span.parentSpanId || null, span.name, span.kind, span.status, span.startTime, span.endTime || null,
|
|
125
|
+
const result = stmt.run(span.spanId, span.traceId, span.parentSpanId || null, span.name, span.kind, span.status, span.startTime, span.endTime || null, safeStringify(span.attributes), resultValue, span.error || null, Date.now());
|
|
97
126
|
if (isSpanStorageDebugEnabled()) {
|
|
98
127
|
console.log(`[SpanStorage] Save result: changes=${result?.changes}, lastInsertRowid=${result?.lastInsertRowid}`);
|
|
99
128
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TAG_MAX_COUNT,
|
|
3
3
|
TAG_MIN_COUNT
|
|
4
|
-
} from "./roy-agent-core-
|
|
4
|
+
} from "./roy-agent-core-r15sn7ve.js";
|
|
5
5
|
import {
|
|
6
6
|
validateWorkflowDefinition
|
|
7
|
-
} from "./roy-agent-core-
|
|
7
|
+
} from "./roy-agent-core-1mrc9a1r.js";
|
|
8
8
|
import {
|
|
9
9
|
AskUserError,
|
|
10
10
|
init_workflow_hil
|
|
@@ -14,15 +14,15 @@ import {
|
|
|
14
14
|
} from "./roy-agent-core-c1v263jn.js";
|
|
15
15
|
import {
|
|
16
16
|
isValidSessionId
|
|
17
|
-
} from "./roy-agent-core-
|
|
17
|
+
} from "./roy-agent-core-bqe4c9f2.js";
|
|
18
18
|
import {
|
|
19
19
|
TracedAs,
|
|
20
20
|
init_decorator
|
|
21
|
-
} from "./roy-agent-core-
|
|
21
|
+
} from "./roy-agent-core-96mj6gvc.js";
|
|
22
22
|
import {
|
|
23
23
|
createLogger,
|
|
24
24
|
init_logger
|
|
25
|
-
} from "./roy-agent-core-
|
|
25
|
+
} from "./roy-agent-core-nna4s0qs.js";
|
|
26
26
|
import {
|
|
27
27
|
__legacyDecorateClassTS
|
|
28
28
|
} from "./roy-agent-core-fs0mn2jk.js";
|
|
@@ -6,11 +6,11 @@ import {
|
|
|
6
6
|
} from "./roy-agent-core-7hh0brvs.js";
|
|
7
7
|
import {
|
|
8
8
|
BaseComponent
|
|
9
|
-
} from "./roy-agent-core-
|
|
9
|
+
} from "./roy-agent-core-akb8mb9v.js";
|
|
10
10
|
import {
|
|
11
11
|
createLogger,
|
|
12
12
|
init_logger
|
|
13
|
-
} from "./roy-agent-core-
|
|
13
|
+
} from "./roy-agent-core-nna4s0qs.js";
|
|
14
14
|
|
|
15
15
|
// src/env/skill/skill-component.ts
|
|
16
16
|
init_logger();
|
|
@@ -9,11 +9,11 @@ import {
|
|
|
9
9
|
import {
|
|
10
10
|
TracedAs,
|
|
11
11
|
init_decorator
|
|
12
|
-
} from "./roy-agent-core-
|
|
12
|
+
} from "./roy-agent-core-96mj6gvc.js";
|
|
13
13
|
import {
|
|
14
14
|
createLogger,
|
|
15
15
|
init_logger
|
|
16
|
-
} from "./roy-agent-core-
|
|
16
|
+
} from "./roy-agent-core-nna4s0qs.js";
|
|
17
17
|
import {
|
|
18
18
|
__esm,
|
|
19
19
|
__export,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
safeParseToolArgs
|
|
3
|
-
} from "./roy-agent-core-
|
|
3
|
+
} from "./roy-agent-core-e0kaxcy1.js";
|
|
4
4
|
import {
|
|
5
5
|
createLogger,
|
|
6
6
|
init_logger
|
|
7
|
-
} from "./roy-agent-core-
|
|
7
|
+
} from "./roy-agent-core-nna4s0qs.js";
|
|
8
8
|
import {
|
|
9
9
|
__require
|
|
10
10
|
} from "./roy-agent-core-fs0mn2jk.js";
|
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
getMaxOutput,
|
|
4
4
|
init_logger,
|
|
5
5
|
simplifyFilePath
|
|
6
|
-
} from "./roy-agent-core-
|
|
6
|
+
} from "./roy-agent-core-nna4s0qs.js";
|
|
7
7
|
import {
|
|
8
8
|
getTracerProvider,
|
|
9
9
|
init_tracer_provider
|
|
10
|
-
} from "./roy-agent-core-
|
|
10
|
+
} from "./roy-agent-core-m00kamqp.js";
|
|
11
11
|
import {
|
|
12
12
|
__esm
|
|
13
13
|
} from "./roy-agent-core-fs0mn2jk.js";
|
|
@@ -8,11 +8,11 @@ import {
|
|
|
8
8
|
BackgroundTaskManager,
|
|
9
9
|
createDelegateTool,
|
|
10
10
|
createStopTool
|
|
11
|
-
} from "./roy-agent-core-
|
|
11
|
+
} from "./roy-agent-core-1380b0re.js";
|
|
12
12
|
import {
|
|
13
13
|
SQLiteTaskStore,
|
|
14
14
|
getDefaultTaskDbPath
|
|
15
|
-
} from "./roy-agent-core-
|
|
15
|
+
} from "./roy-agent-core-zdzkzx5g.js";
|
|
16
16
|
import {
|
|
17
17
|
batchArchiveTaskTool,
|
|
18
18
|
batchDeleteTaskTool,
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
searchTasksTool,
|
|
25
25
|
treeTasksTool,
|
|
26
26
|
updateTaskTool
|
|
27
|
-
} from "./roy-agent-core-
|
|
27
|
+
} from "./roy-agent-core-r0t34bbh.js";
|
|
28
28
|
import {
|
|
29
29
|
createOperationTool,
|
|
30
30
|
deleteOperationTool,
|
|
@@ -40,23 +40,23 @@ import {
|
|
|
40
40
|
} from "./roy-agent-core-7hh0brvs.js";
|
|
41
41
|
import {
|
|
42
42
|
BaseComponent
|
|
43
|
-
} from "./roy-agent-core-
|
|
43
|
+
} from "./roy-agent-core-akb8mb9v.js";
|
|
44
44
|
import {
|
|
45
45
|
globalHookManager,
|
|
46
46
|
init_global_hook_manager
|
|
47
|
-
} from "./roy-agent-core-
|
|
47
|
+
} from "./roy-agent-core-vc7p80sd.js";
|
|
48
48
|
import {
|
|
49
49
|
getEnvContextOrEmpty,
|
|
50
50
|
init_env_context
|
|
51
|
-
} from "./roy-agent-core-
|
|
51
|
+
} from "./roy-agent-core-dtkbj8fk.js";
|
|
52
52
|
import {
|
|
53
53
|
TracedAs,
|
|
54
54
|
init_decorator
|
|
55
|
-
} from "./roy-agent-core-
|
|
55
|
+
} from "./roy-agent-core-96mj6gvc.js";
|
|
56
56
|
import {
|
|
57
57
|
createLogger,
|
|
58
58
|
init_logger
|
|
59
|
-
} from "./roy-agent-core-
|
|
59
|
+
} from "./roy-agent-core-nna4s0qs.js";
|
|
60
60
|
import {
|
|
61
61
|
__legacyDecorateClassTS
|
|
62
62
|
} from "./roy-agent-core-fs0mn2jk.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TagRepository
|
|
3
|
-
} from "./roy-agent-core-
|
|
3
|
+
} from "./roy-agent-core-atpchjdz.js";
|
|
4
4
|
import {
|
|
5
5
|
exports_search_query_parser,
|
|
6
6
|
init_search_query_parser
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
import {
|
|
9
9
|
createLogger,
|
|
10
10
|
init_logger
|
|
11
|
-
} from "./roy-agent-core-
|
|
11
|
+
} from "./roy-agent-core-nna4s0qs.js";
|
|
12
12
|
import {
|
|
13
13
|
__require,
|
|
14
14
|
__toCommonJS
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createHook
|
|
3
|
-
} from "./roy-agent-core-
|
|
3
|
+
} from "./roy-agent-core-02aw62bv.js";
|
|
4
4
|
import {
|
|
5
5
|
HookManager
|
|
6
|
-
} from "./roy-agent-core-
|
|
6
|
+
} from "./roy-agent-core-vc7p80sd.js";
|
|
7
7
|
|
|
8
8
|
// src/env/component.ts
|
|
9
9
|
class BaseComponent {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TempFileManager
|
|
3
|
-
} from "./roy-agent-core-
|
|
3
|
+
} from "./roy-agent-core-ataagh3a.js";
|
|
4
4
|
import {
|
|
5
5
|
AskUserError,
|
|
6
6
|
init_workflow_hil
|
|
@@ -11,24 +11,24 @@ import {
|
|
|
11
11
|
} from "./roy-agent-core-7hh0brvs.js";
|
|
12
12
|
import {
|
|
13
13
|
BaseComponent
|
|
14
|
-
} from "./roy-agent-core-
|
|
14
|
+
} from "./roy-agent-core-akb8mb9v.js";
|
|
15
15
|
import {
|
|
16
16
|
ToolHookPoints,
|
|
17
17
|
globalHookManager,
|
|
18
18
|
init_global_hook_manager
|
|
19
|
-
} from "./roy-agent-core-
|
|
19
|
+
} from "./roy-agent-core-vc7p80sd.js";
|
|
20
20
|
import {
|
|
21
21
|
getCurrentTaskId,
|
|
22
22
|
init_env_context
|
|
23
|
-
} from "./roy-agent-core-
|
|
23
|
+
} from "./roy-agent-core-dtkbj8fk.js";
|
|
24
24
|
import {
|
|
25
25
|
TracedAs,
|
|
26
26
|
init_decorator
|
|
27
|
-
} from "./roy-agent-core-
|
|
27
|
+
} from "./roy-agent-core-96mj6gvc.js";
|
|
28
28
|
import {
|
|
29
29
|
createLogger,
|
|
30
30
|
init_logger
|
|
31
|
-
} from "./roy-agent-core-
|
|
31
|
+
} from "./roy-agent-core-nna4s0qs.js";
|
|
32
32
|
import {
|
|
33
33
|
__legacyDecorateClassTS,
|
|
34
34
|
__require
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
import {
|
|
2
|
+
LoopGuardConfigSchema,
|
|
3
|
+
init_types
|
|
4
|
+
} from "./roy-agent-core-jrj30vq3.js";
|
|
1
5
|
import {
|
|
2
6
|
TracedAs,
|
|
3
7
|
init_decorator
|
|
4
|
-
} from "./roy-agent-core-
|
|
8
|
+
} from "./roy-agent-core-96mj6gvc.js";
|
|
5
9
|
import {
|
|
6
10
|
__esm,
|
|
7
11
|
__legacyDecorateClassTS
|
|
@@ -10,6 +14,7 @@ import {
|
|
|
10
14
|
// src/env/workflow/engine/dag-manager.ts
|
|
11
15
|
var DAGManager;
|
|
12
16
|
var init_dag_manager = __esm(() => {
|
|
17
|
+
init_types();
|
|
13
18
|
init_decorator();
|
|
14
19
|
DAGManager = class DAGManager {
|
|
15
20
|
workflow;
|
|
@@ -403,6 +408,23 @@ var init_dag_manager = __esm(() => {
|
|
|
403
408
|
getNode(nodeId) {
|
|
404
409
|
return this.nodeMap.get(nodeId);
|
|
405
410
|
}
|
|
411
|
+
getLoopGuard(nodeId) {
|
|
412
|
+
const node = this.nodeMap.get(nodeId);
|
|
413
|
+
if (!node)
|
|
414
|
+
return;
|
|
415
|
+
const config = node.config ?? {};
|
|
416
|
+
if (!Object.prototype.hasOwnProperty.call(config, "loop_guard")) {
|
|
417
|
+
return;
|
|
418
|
+
}
|
|
419
|
+
const raw = config.loop_guard;
|
|
420
|
+
if (raw === null || raw === undefined)
|
|
421
|
+
return;
|
|
422
|
+
const parsed = LoopGuardConfigSchema.safeParse(raw);
|
|
423
|
+
if (!parsed.success) {
|
|
424
|
+
return;
|
|
425
|
+
}
|
|
426
|
+
return parsed.data;
|
|
427
|
+
}
|
|
406
428
|
getNodeIds() {
|
|
407
429
|
return Array.from(this.nodeMap.keys());
|
|
408
430
|
}
|
|
@@ -6,21 +6,21 @@ import {
|
|
|
6
6
|
import {
|
|
7
7
|
MemorySessionStore,
|
|
8
8
|
SQLiteSessionStore
|
|
9
|
-
} from "./roy-agent-core-
|
|
9
|
+
} from "./roy-agent-core-zs4f0tcy.js";
|
|
10
10
|
import {
|
|
11
11
|
envKeyToConfigKey
|
|
12
12
|
} from "./roy-agent-core-7hh0brvs.js";
|
|
13
13
|
import {
|
|
14
14
|
BaseComponent
|
|
15
|
-
} from "./roy-agent-core-
|
|
15
|
+
} from "./roy-agent-core-akb8mb9v.js";
|
|
16
16
|
import {
|
|
17
17
|
TracedAs,
|
|
18
18
|
init_decorator
|
|
19
|
-
} from "./roy-agent-core-
|
|
19
|
+
} from "./roy-agent-core-96mj6gvc.js";
|
|
20
20
|
import {
|
|
21
21
|
createLogger,
|
|
22
22
|
init_logger
|
|
23
|
-
} from "./roy-agent-core-
|
|
23
|
+
} from "./roy-agent-core-nna4s0qs.js";
|
|
24
24
|
import {
|
|
25
25
|
__legacyDecorateClassTS
|
|
26
26
|
} from "./roy-agent-core-fs0mn2jk.js";
|