@ai-setting/roy-agent-core 1.7.91 → 1.7.93
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 +11 -11
- package/dist/env/agent/agent-component.js +18 -18
- package/dist/env/agent/index.js +18 -18
- package/dist/env/commands/index.js +10 -10
- package/dist/env/context/index.js +6 -6
- package/dist/env/debug/formatters/index.js +1 -1
- package/dist/env/debug/index.js +10 -10
- package/dist/env/error-reply.js +4 -4
- package/dist/env/event-source/cli-command-handler.js +4 -4
- package/dist/env/event-source/event-source-handlers.js +28 -28
- package/dist/env/event-source/event-store.js +5 -5
- package/dist/env/event-source/idempotency-key.js +1 -1
- package/dist/env/event-source/index.js +29 -29
- package/dist/env/event-source/wecom-respond-registry.js +6 -6
- package/dist/env/event-source/wecom-session-card-sender.js +6 -6
- package/dist/env/hook/index.js +8 -8
- package/dist/env/index.js +64 -64
- package/dist/env/lark-mention-utils.js +1 -1
- package/dist/env/llm/index.js +11 -11
- package/dist/env/log-trace/index.js +10 -10
- package/dist/env/log-trace/logger.js +3 -3
- package/dist/env/mcp/index.js +11 -11
- package/dist/env/mcp/npm-prefix/index.js +1 -1
- package/dist/env/mcp/tool/index.js +4 -4
- package/dist/env/memory/built-in/index.js +1 -1
- 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 +11 -11
- package/dist/env/session/index.js +14 -14
- package/dist/env/session/storage/index.js +7 -7
- package/dist/env/skill/index.js +10 -10
- package/dist/env/skill/tool/index.js +1 -1
- package/dist/env/task/backend/index.js +6 -6
- package/dist/env/task/delegate/delegate-tool.js +12 -12
- package/dist/env/task/delegate/index.js +12 -12
- package/dist/env/task/events/index.js +1 -1
- package/dist/env/task/hooks/index.js +1 -1
- package/dist/env/task/index.js +21 -21
- package/dist/env/task/mcp/index.js +7 -7
- package/dist/env/task/plugins/index.js +17 -17
- package/dist/env/task/plugins/lark-card-patch-notifier.js +6 -6
- package/dist/env/task/plugins/wecom-session-card-store.js +6 -6
- package/dist/env/task/prompt/index.js +1 -1
- package/dist/env/task/storage/index.js +7 -7
- package/dist/env/task/tools/index.js +7 -7
- package/dist/env/task/tools/operation/index.js +1 -1
- package/dist/env/tool/built-in/index.js +9 -9
- package/dist/env/tool/index.js +16 -16
- package/dist/env/workflow/decorators/index.js +3 -3
- package/dist/env/workflow/engine/index.js +20 -20
- package/dist/env/workflow/hooks/index.js +10 -10
- package/dist/env/workflow/index.js +34 -34
- package/dist/env/workflow/nodes/index.js +5 -5
- package/dist/env/workflow/plugins/index.js +12 -12
- package/dist/env/workflow/service/index.js +5 -5
- package/dist/env/workflow/storage/index.js +7 -7
- package/dist/env/workflow/tools/index.js +22 -22
- package/dist/env/workflow/types/index.js +3 -3
- package/dist/env/workflow/utils/index.js +10 -10
- package/dist/index.js +75 -75
- package/dist/shared/@ai-setting/{roy-agent-core-yet36q5k.js → roy-agent-core-0b4gyx3x.js} +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-1ce3fqrk.js → roy-agent-core-0k9spnmd.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-mx855td4.js → roy-agent-core-0qsfkvkn.js} +8 -8
- package/dist/shared/@ai-setting/roy-agent-core-0wmswkj6.js +1005 -0
- package/dist/shared/@ai-setting/{roy-agent-core-0n1wwndq.js → roy-agent-core-0yzxapfa.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-azyz78ky.js → roy-agent-core-1gx70hsn.js} +10 -10
- package/dist/shared/@ai-setting/{roy-agent-core-6atd905e.js → roy-agent-core-1zat1mft.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-hw317z6f.js → roy-agent-core-33n84tf9.js} +15 -15
- package/dist/shared/@ai-setting/{roy-agent-core-7f7t9wwp.js → roy-agent-core-3c0zpmnq.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-6gj1hc5z.js → roy-agent-core-46z6m682.js} +17 -17
- package/dist/shared/@ai-setting/{roy-agent-core-1vv4fx15.js → roy-agent-core-4bc28g7r.js} +6 -6
- package/dist/shared/@ai-setting/{roy-agent-core-nm4xbs1d.js → roy-agent-core-4g9f3han.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-1db4vpc6.js → roy-agent-core-4y96ae48.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-h83zdsrq.js → roy-agent-core-5e9vmj5e.js} +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-05z35shp.js → roy-agent-core-5p3arx77.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-tjnabyvq.js → roy-agent-core-636w46em.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-e69qxdyy.js → roy-agent-core-64ke8s3t.js} +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-v0hf14bj.js → roy-agent-core-64py47c3.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-smf94h73.js → roy-agent-core-6bvn0kpf.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-qxnbvgwe.js → roy-agent-core-6qfz57w5.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-zhwcje5a.js → roy-agent-core-7sfz2n7t.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-1mhyh4c5.js → roy-agent-core-94wyp5sh.js} +6 -6
- package/dist/shared/@ai-setting/roy-agent-core-9kp88brd.js +18 -0
- package/dist/shared/@ai-setting/{roy-agent-core-3wrveh5p.js → roy-agent-core-a0tck2z9.js} +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-wqs6yypq.js → roy-agent-core-acbg6fg9.js} +5 -5
- package/dist/shared/@ai-setting/{roy-agent-core-49qcpqwg.js → roy-agent-core-aeh7qg1r.js} +11 -11
- package/dist/shared/@ai-setting/{roy-agent-core-fzw9xzm1.js → roy-agent-core-b122g2me.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-tpm1dd1g.js → roy-agent-core-bakbb15m.js} +14 -14
- package/dist/shared/@ai-setting/{roy-agent-core-9cen1jvg.js → roy-agent-core-bcv09vrt.js} +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-fs0mn2jk.js → roy-agent-core-bn8rs93c.js} +2 -1
- package/dist/shared/@ai-setting/{roy-agent-core-4t3yskp8.js → roy-agent-core-brw8wp2q.js} +12 -4
- package/dist/shared/@ai-setting/{roy-agent-core-9c565frx.js → roy-agent-core-bwyc2j0n.js} +2 -2
- package/dist/shared/@ai-setting/roy-agent-core-bz03g3n4.js +19 -0
- package/dist/shared/@ai-setting/{roy-agent-core-mkc3zshb.js → roy-agent-core-c57pkcx8.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-tkpp1ba0.js → roy-agent-core-cf3nysh5.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-ddwa0n6h.js → roy-agent-core-crcfqzcb.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-arx535cs.js → roy-agent-core-dc2bc221.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-rm7seqwb.js → roy-agent-core-ecap4nws.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-vx8zc847.js → roy-agent-core-ev110pkx.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-y6shd91r.js → roy-agent-core-ev1kvffn.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-ds6qzmf8.js → roy-agent-core-f18s4qgp.js} +14 -6
- package/dist/shared/@ai-setting/{roy-agent-core-krapd8x2.js → roy-agent-core-fkhdw7t8.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-cre2y2ct.js → roy-agent-core-h5v1xe9h.js} +6 -6
- package/dist/shared/@ai-setting/{roy-agent-core-4fkxy2gv.js → roy-agent-core-h89whnxz.js} +14 -6
- package/dist/shared/@ai-setting/{roy-agent-core-5kzhaap1.js → roy-agent-core-ha53k1f8.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-bjtc9d35.js → roy-agent-core-jm6bf1qq.js} +6 -6
- package/dist/shared/@ai-setting/{roy-agent-core-v6yshv0z.js → roy-agent-core-jmyv8v71.js} +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-2akfd64z.js → roy-agent-core-jzmk4kdh.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-mf5p38yf.js → roy-agent-core-kfspjx59.js} +5 -5
- package/dist/shared/@ai-setting/{roy-agent-core-jvv2h3d6.js → roy-agent-core-ksrq6paw.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-rvxg1wps.js → roy-agent-core-m3vmmvbc.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-0sbmdz8d.js → roy-agent-core-m4x47ne9.js} +9 -9
- package/dist/shared/@ai-setting/{roy-agent-core-age3qseb.js → roy-agent-core-mgmp2gfm.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-br9cdm8d.js → roy-agent-core-mj4szr1e.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-vsdar7tn.js → roy-agent-core-mp7sqfb5.js} +6 -6
- package/dist/shared/@ai-setting/{roy-agent-core-d6zdbgtc.js → roy-agent-core-msktt7y7.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-9710zwwz.js → roy-agent-core-nhr8pp3a.js} +2 -2
- package/dist/shared/@ai-setting/roy-agent-core-nn7a0kex.js +10 -0
- package/dist/shared/@ai-setting/{roy-agent-core-m39v7qpx.js → roy-agent-core-nrm2ejyt.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-h0x19xgn.js → roy-agent-core-p13a4x6r.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-fttgm52a.js → roy-agent-core-pd2hd3q9.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-6r970asj.js → roy-agent-core-px73ewzd.js} +14 -14
- package/dist/shared/@ai-setting/{roy-agent-core-m66ysky0.js → roy-agent-core-pxqz1d1m.js} +7 -4
- package/dist/shared/@ai-setting/{roy-agent-core-7yh5wps0.js → roy-agent-core-qt3j44j7.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-n197medr.js → roy-agent-core-qtb41z61.js} +15 -15
- package/dist/shared/@ai-setting/{roy-agent-core-q96qynhb.js → roy-agent-core-qwfdbepg.js} +1 -1
- package/dist/shared/@ai-setting/roy-agent-core-qxnfdjqj.js +16 -0
- package/dist/shared/@ai-setting/{roy-agent-core-nqkfkpf4.js → roy-agent-core-r84dcepd.js} +5 -5
- package/dist/shared/@ai-setting/{roy-agent-core-aa8kv18f.js → roy-agent-core-s69x33zx.js} +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-7f10p7m2.js → roy-agent-core-ss6mghdr.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-h1e1fm9b.js → roy-agent-core-th8fq714.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-k3gcvybs.js → roy-agent-core-trgqgwab.js} +6 -6
- package/dist/shared/@ai-setting/{roy-agent-core-5dhvfgaw.js → roy-agent-core-v3wm8gyj.js} +7 -7
- package/dist/shared/@ai-setting/{roy-agent-core-3e040tc5.js → roy-agent-core-v7qsnh2g.js} +2 -2
- package/dist/shared/@ai-setting/roy-agent-core-vhgwfmp7.js +22 -0
- package/dist/shared/@ai-setting/{roy-agent-core-g8yr733d.js → roy-agent-core-vmbyaqqr.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-xwyq7ffz.js → roy-agent-core-vz886vr8.js} +8 -8
- package/dist/shared/@ai-setting/{roy-agent-core-b7h39vrc.js → roy-agent-core-y37f7fw2.js} +6 -6
- package/dist/shared/@ai-setting/{roy-agent-core-er070zjq.js → roy-agent-core-y7bqmfe2.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-e08bvpaq.js → roy-agent-core-ydgx8vyj.js} +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-p31ftgq9.js → roy-agent-core-yj9w6a39.js} +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-v1n0106v.js → roy-agent-core-ynry88mx.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-vf9sp6s3.js → roy-agent-core-yqwwebhr.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-5s2t8z00.js → roy-agent-core-yshw2fvj.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-fhg03v43.js → roy-agent-core-zwckbxtq.js} +3 -3
- package/dist/test-utils/child-process-mock.js +1 -1
- package/dist/utils/temp-file-manager/index.js +4 -4
- package/package.json +4 -2
- package/dist/shared/@ai-setting/roy-agent-core-0crmsc12.js +0 -22
- package/dist/shared/@ai-setting/roy-agent-core-85xyctnb.js +0 -239
- package/dist/shared/@ai-setting/roy-agent-core-fepm835e.js +0 -19
- package/dist/shared/@ai-setting/roy-agent-core-mvh0td7p.js +0 -10
- package/dist/shared/@ai-setting/roy-agent-core-w9ryeg2p.js +0 -16
- package/dist/shared/@ai-setting/roy-agent-core-yfpnkc4z.js +0 -18
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
PiAiAdapter,
|
|
7
7
|
invoke,
|
|
8
8
|
invokeNonStream
|
|
9
|
-
} from "./roy-agent-core-
|
|
9
|
+
} from "./roy-agent-core-s69x33zx.js";
|
|
10
10
|
import {
|
|
11
11
|
ContextError,
|
|
12
12
|
ErrorCodes
|
|
@@ -17,12 +17,12 @@ import {
|
|
|
17
17
|
} from "./roy-agent-core-7hh0brvs.js";
|
|
18
18
|
import {
|
|
19
19
|
BaseComponent
|
|
20
|
-
} from "./roy-agent-core-
|
|
20
|
+
} from "./roy-agent-core-nrm2ejyt.js";
|
|
21
21
|
import {
|
|
22
22
|
LLMHookPoints,
|
|
23
23
|
globalHookManager,
|
|
24
24
|
init_global_hook_manager
|
|
25
|
-
} from "./roy-agent-core-
|
|
25
|
+
} from "./roy-agent-core-0b4gyx3x.js";
|
|
26
26
|
import {
|
|
27
27
|
TracedAs,
|
|
28
28
|
embedParamFilter,
|
|
@@ -32,15 +32,15 @@ import {
|
|
|
32
32
|
llmInvokeParamFilter,
|
|
33
33
|
llmInvokeResultFilter,
|
|
34
34
|
wrapFunction
|
|
35
|
-
} from "./roy-agent-core-
|
|
35
|
+
} from "./roy-agent-core-yshw2fvj.js";
|
|
36
36
|
import {
|
|
37
37
|
createLogger,
|
|
38
38
|
init_logger
|
|
39
|
-
} from "./roy-agent-core-
|
|
39
|
+
} from "./roy-agent-core-3c0zpmnq.js";
|
|
40
40
|
import {
|
|
41
41
|
__legacyDecorateClassTS,
|
|
42
42
|
__require
|
|
43
|
-
} from "./roy-agent-core-
|
|
43
|
+
} from "./roy-agent-core-bn8rs93c.js";
|
|
44
44
|
|
|
45
45
|
// src/env/llm/adapter.ts
|
|
46
46
|
var ADAPTER_NAMES = ["pi-ai", "ai-sdk"];
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AskUserError,
|
|
3
3
|
init_workflow_hil
|
|
4
|
-
} from "./roy-agent-core-
|
|
4
|
+
} from "./roy-agent-core-c57pkcx8.js";
|
|
5
5
|
import {
|
|
6
6
|
__esm,
|
|
7
7
|
__require
|
|
8
|
-
} from "./roy-agent-core-
|
|
8
|
+
} from "./roy-agent-core-bn8rs93c.js";
|
|
9
9
|
|
|
10
10
|
// src/env/workflow/types/edge.ts
|
|
11
11
|
import { z } from "zod";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
LoopGuardConfigSchema,
|
|
3
3
|
init_types
|
|
4
|
-
} from "./roy-agent-core-
|
|
4
|
+
} from "./roy-agent-core-y7bqmfe2.js";
|
|
5
5
|
import {
|
|
6
6
|
TracedAs,
|
|
7
7
|
init_decorator
|
|
8
|
-
} from "./roy-agent-core-
|
|
8
|
+
} from "./roy-agent-core-yshw2fvj.js";
|
|
9
9
|
import {
|
|
10
10
|
__esm,
|
|
11
11
|
__legacyDecorateClassTS
|
|
12
|
-
} from "./roy-agent-core-
|
|
12
|
+
} from "./roy-agent-core-bn8rs93c.js";
|
|
13
13
|
|
|
14
14
|
// src/env/workflow/engine/dag-manager.ts
|
|
15
15
|
var DAGManager;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
init_decorator,
|
|
3
3
|
wrapFunction
|
|
4
|
-
} from "./roy-agent-core-
|
|
4
|
+
} from "./roy-agent-core-yshw2fvj.js";
|
|
5
5
|
import {
|
|
6
6
|
createLogger,
|
|
7
7
|
init_logger
|
|
8
|
-
} from "./roy-agent-core-
|
|
8
|
+
} from "./roy-agent-core-3c0zpmnq.js";
|
|
9
9
|
import {
|
|
10
10
|
__esm
|
|
11
|
-
} from "./roy-agent-core-
|
|
11
|
+
} from "./roy-agent-core-bn8rs93c.js";
|
|
12
12
|
|
|
13
13
|
// src/env/context/env-event.ts
|
|
14
14
|
function isLarkEvent(event) {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getXDGPath
|
|
3
|
-
} from "./roy-agent-core-
|
|
3
|
+
} from "./roy-agent-core-6qfz57w5.js";
|
|
4
4
|
import {
|
|
5
5
|
TracedAs,
|
|
6
6
|
init_decorator
|
|
7
|
-
} from "./roy-agent-core-
|
|
7
|
+
} from "./roy-agent-core-yshw2fvj.js";
|
|
8
8
|
import {
|
|
9
9
|
createLogger,
|
|
10
10
|
init_logger
|
|
11
|
-
} from "./roy-agent-core-
|
|
11
|
+
} from "./roy-agent-core-3c0zpmnq.js";
|
|
12
12
|
import {
|
|
13
13
|
__legacyDecorateClassTS
|
|
14
|
-
} from "./roy-agent-core-
|
|
14
|
+
} from "./roy-agent-core-bn8rs93c.js";
|
|
15
15
|
|
|
16
16
|
// src/env/agent/agent-registry.ts
|
|
17
17
|
import * as realFsPromises from "fs/promises";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TracedAs,
|
|
3
3
|
init_decorator
|
|
4
|
-
} from "./roy-agent-core-
|
|
4
|
+
} from "./roy-agent-core-yshw2fvj.js";
|
|
5
5
|
import {
|
|
6
6
|
__legacyDecorateClassTS
|
|
7
|
-
} from "./roy-agent-core-
|
|
7
|
+
} from "./roy-agent-core-bn8rs93c.js";
|
|
8
8
|
|
|
9
9
|
// src/env/workflow/storage/tag-repo.ts
|
|
10
10
|
init_decorator();
|
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
init_logger,
|
|
6
6
|
init_tracer_provider,
|
|
7
7
|
simplifyFilePath
|
|
8
|
-
} from "./roy-agent-core-
|
|
8
|
+
} from "./roy-agent-core-3c0zpmnq.js";
|
|
9
9
|
import {
|
|
10
10
|
__esm
|
|
11
|
-
} from "./roy-agent-core-
|
|
11
|
+
} from "./roy-agent-core-bn8rs93c.js";
|
|
12
12
|
|
|
13
13
|
// src/env/log-trace/trace-filters.ts
|
|
14
14
|
function resetTraceFullModeCache() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
adaptMcpTool
|
|
3
|
-
} from "./roy-agent-core-
|
|
3
|
+
} from "./roy-agent-core-qwfdbepg.js";
|
|
4
4
|
import {
|
|
5
5
|
ComponentError,
|
|
6
6
|
ErrorCodes
|
|
@@ -10,11 +10,11 @@ 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-nrm2ejyt.js";
|
|
14
14
|
import {
|
|
15
15
|
createLogger,
|
|
16
16
|
init_logger
|
|
17
|
-
} from "./roy-agent-core-
|
|
17
|
+
} from "./roy-agent-core-3c0zpmnq.js";
|
|
18
18
|
import {
|
|
19
19
|
ensureFallbackNpmPrefix,
|
|
20
20
|
isUsableNpmPrefix
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__require
|
|
3
|
-
} from "../shared/@ai-setting/roy-agent-core-
|
|
3
|
+
} from "../shared/@ai-setting/roy-agent-core-bn8rs93c.js";
|
|
4
4
|
|
|
5
5
|
// src/test-utils/child-process-mock.ts
|
|
6
6
|
var CHILD_PROCESS_EXPORT_NAMES = Object.keys(__require("node:child_process")).filter((name) => name !== "default");
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TempFileManager
|
|
3
|
-
} from "../../shared/@ai-setting/roy-agent-core-
|
|
4
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
5
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
6
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
3
|
+
} from "../../shared/@ai-setting/roy-agent-core-ksrq6paw.js";
|
|
4
|
+
import"../../shared/@ai-setting/roy-agent-core-3c0zpmnq.js";
|
|
5
|
+
import"../../shared/@ai-setting/roy-agent-core-0wmswkj6.js";
|
|
6
|
+
import"../../shared/@ai-setting/roy-agent-core-bn8rs93c.js";
|
|
7
7
|
export {
|
|
8
8
|
TempFileManager
|
|
9
9
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-setting/roy-agent-core",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.93",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Core SDK for roy-agent - Environment, Components, Tools, Sessions, Tasks",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -144,7 +144,6 @@
|
|
|
144
144
|
"@effect/platform-node": "^0.106.0",
|
|
145
145
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
146
146
|
"ai": "^6.0.0",
|
|
147
|
-
"better-sqlite3": "^11.10.0",
|
|
148
147
|
"effect": "^3.21.2",
|
|
149
148
|
"glob": "^13.0.6",
|
|
150
149
|
"jsonc-parser": "^3.2.0",
|
|
@@ -155,6 +154,9 @@
|
|
|
155
154
|
"zod": "^3.25.0",
|
|
156
155
|
"zod-to-json-schema": "^3.25.0"
|
|
157
156
|
},
|
|
157
|
+
"optionalDependencies": {
|
|
158
|
+
"better-sqlite3": "^11.10.0"
|
|
159
|
+
},
|
|
158
160
|
"devDependencies": {
|
|
159
161
|
"@types/node": "^20.0.0",
|
|
160
162
|
"@types/ws": "^8.5.10",
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
closeDatabase,
|
|
3
|
-
getDatabase,
|
|
4
|
-
getDatabasePath,
|
|
5
|
-
initDatabase,
|
|
6
|
-
initializeTables,
|
|
7
|
-
resetDatabase
|
|
8
|
-
} from "./roy-agent-core-4fkxy2gv.js";
|
|
9
|
-
import"./roy-agent-core-vf9sp6s3.js";
|
|
10
|
-
import"./roy-agent-core-rvxg1wps.js";
|
|
11
|
-
import"./roy-agent-core-5s2t8z00.js";
|
|
12
|
-
import"./roy-agent-core-7f7t9wwp.js";
|
|
13
|
-
import"./roy-agent-core-85xyctnb.js";
|
|
14
|
-
import"./roy-agent-core-fs0mn2jk.js";
|
|
15
|
-
export {
|
|
16
|
-
resetDatabase,
|
|
17
|
-
initializeTables,
|
|
18
|
-
initDatabase,
|
|
19
|
-
getDatabasePath,
|
|
20
|
-
getDatabase,
|
|
21
|
-
closeDatabase
|
|
22
|
-
};
|
|
@@ -1,239 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
__esm,
|
|
3
|
-
__require
|
|
4
|
-
} from "./roy-agent-core-fs0mn2jk.js";
|
|
5
|
-
|
|
6
|
-
// src/env/log-trace/span-storage.ts
|
|
7
|
-
function isSpanStorageDebugEnabled() {
|
|
8
|
-
return process.env.ROY_TRACE_DEBUG_STORAGE === "1" || process.env.ROY_TRACE_DEBUG === "1";
|
|
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
|
-
}
|
|
39
|
-
function getDatabaseClass() {
|
|
40
|
-
if (typeof Bun !== "undefined") {
|
|
41
|
-
const { Database } = __require("bun:sqlite");
|
|
42
|
-
return Database;
|
|
43
|
-
}
|
|
44
|
-
try {
|
|
45
|
-
const { DatabaseSync } = __require("node:sqlite");
|
|
46
|
-
if (typeof DatabaseSync === "function") {
|
|
47
|
-
return DatabaseSync;
|
|
48
|
-
}
|
|
49
|
-
} catch {}
|
|
50
|
-
return __require("better-sqlite3");
|
|
51
|
-
}
|
|
52
|
-
function createCompatibleDatabase(path) {
|
|
53
|
-
const Database = getDatabaseClass();
|
|
54
|
-
const db = new Database(path);
|
|
55
|
-
if (typeof db.run !== "function") {
|
|
56
|
-
db.run = function(sql, ...params) {
|
|
57
|
-
if (params.length > 0) {
|
|
58
|
-
return this.prepare(sql).run(...params);
|
|
59
|
-
} else {
|
|
60
|
-
return this.exec(sql);
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
return db;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
class SQLiteSpanStorage {
|
|
68
|
-
db = null;
|
|
69
|
-
dbPath;
|
|
70
|
-
initialized = false;
|
|
71
|
-
constructor(dbPath) {
|
|
72
|
-
if (!dbPath) {
|
|
73
|
-
throw new Error("SQLiteSpanStorage requires a valid dbPath parameter");
|
|
74
|
-
}
|
|
75
|
-
if (dbPath === ":memory:") {
|
|
76
|
-
throw new Error("SQLiteSpanStorage does not support :memory: mode. Use a file path instead.");
|
|
77
|
-
}
|
|
78
|
-
this.dbPath = dbPath;
|
|
79
|
-
}
|
|
80
|
-
async initialize() {
|
|
81
|
-
if (this.initialized)
|
|
82
|
-
return;
|
|
83
|
-
const fs = __require("fs");
|
|
84
|
-
const path = __require("path");
|
|
85
|
-
const dir = path.dirname(this.dbPath);
|
|
86
|
-
if (!fs.existsSync(dir)) {
|
|
87
|
-
fs.mkdirSync(dir, { recursive: true });
|
|
88
|
-
}
|
|
89
|
-
this.db = createCompatibleDatabase(this.dbPath);
|
|
90
|
-
this.db.run("PRAGMA journal_mode=WAL");
|
|
91
|
-
this.db.run("PRAGMA busy_timeout=5000");
|
|
92
|
-
this.db.run("PRAGMA synchronous=NORMAL");
|
|
93
|
-
this.db.run(`
|
|
94
|
-
CREATE TABLE IF NOT EXISTS span (
|
|
95
|
-
span_id TEXT PRIMARY KEY,
|
|
96
|
-
trace_id TEXT NOT NULL,
|
|
97
|
-
parent_span_id TEXT,
|
|
98
|
-
name TEXT NOT NULL,
|
|
99
|
-
kind TEXT NOT NULL,
|
|
100
|
-
status TEXT NOT NULL,
|
|
101
|
-
start_time INTEGER NOT NULL,
|
|
102
|
-
end_time INTEGER,
|
|
103
|
-
attributes TEXT,
|
|
104
|
-
result TEXT,
|
|
105
|
-
error TEXT,
|
|
106
|
-
time_created INTEGER NOT NULL
|
|
107
|
-
)
|
|
108
|
-
`);
|
|
109
|
-
this.db.run("CREATE INDEX IF NOT EXISTS idx_span_trace ON span(trace_id)");
|
|
110
|
-
this.db.run("CREATE INDEX IF NOT EXISTS idx_span_parent ON span(parent_span_id)");
|
|
111
|
-
this.initialized = true;
|
|
112
|
-
}
|
|
113
|
-
save(span) {
|
|
114
|
-
if (!this.db) {
|
|
115
|
-
if (isSpanStorageDebugEnabled()) {
|
|
116
|
-
console.log(`[SpanStorage] save() skipped: db not initialized for span "${span.name}" traceId=${span.traceId}`);
|
|
117
|
-
}
|
|
118
|
-
return;
|
|
119
|
-
}
|
|
120
|
-
const stmt = this.db.prepare(`
|
|
121
|
-
INSERT OR REPLACE INTO span
|
|
122
|
-
(span_id, trace_id, parent_span_id, name, kind, status, start_time, end_time, attributes, result, error, time_created)
|
|
123
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
124
|
-
`);
|
|
125
|
-
const resultValue = span.result !== undefined && span.result !== null ? typeof span.result === "string" ? span.result : safeStringify(span.result) : null;
|
|
126
|
-
if (isSpanStorageDebugEnabled()) {
|
|
127
|
-
console.log(`[SpanStorage] Saving to "${this.dbPath}": name="${span.name}" traceId=${span.traceId} spanId=${span.spanId} status=${span.status}`);
|
|
128
|
-
}
|
|
129
|
-
try {
|
|
130
|
-
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());
|
|
131
|
-
if (isSpanStorageDebugEnabled()) {
|
|
132
|
-
console.log(`[SpanStorage] Save result: changes=${result?.changes}, lastInsertRowid=${result?.lastInsertRowid}`);
|
|
133
|
-
}
|
|
134
|
-
} catch (err) {
|
|
135
|
-
console.error(`[SpanStorage] Save ERROR:`, err);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
saveBatch(spans) {
|
|
139
|
-
for (const span of spans) {
|
|
140
|
-
this.save(span);
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
findByTraceId(traceId) {
|
|
144
|
-
if (!this.db)
|
|
145
|
-
return [];
|
|
146
|
-
const rows = this.db.prepare("SELECT * FROM span WHERE trace_id = ?").all(traceId);
|
|
147
|
-
return this.buildTree(rows.map(this.rowToSpan));
|
|
148
|
-
}
|
|
149
|
-
findBySpanId(spanId) {
|
|
150
|
-
if (!this.db)
|
|
151
|
-
return;
|
|
152
|
-
const row = this.db.prepare("SELECT * FROM span WHERE span_id = ?").get(spanId);
|
|
153
|
-
return row ? this.rowToSpan(row) : undefined;
|
|
154
|
-
}
|
|
155
|
-
listTraces(limit = 10) {
|
|
156
|
-
if (!this.db)
|
|
157
|
-
return [];
|
|
158
|
-
const rows = this.db.prepare(`
|
|
159
|
-
SELECT trace_id,
|
|
160
|
-
MIN(start_time) as start_time,
|
|
161
|
-
MAX(end_time) as end_time,
|
|
162
|
-
COUNT(*) as span_count,
|
|
163
|
-
SUM(CASE WHEN status = 'error' THEN 1 ELSE 0 END) as error_count,
|
|
164
|
-
(SELECT name FROM span s2
|
|
165
|
-
WHERE s2.trace_id = span.trace_id
|
|
166
|
-
ORDER BY (s2.parent_span_id IS NULL OR s2.parent_span_id = '') DESC,
|
|
167
|
-
s2.start_time ASC
|
|
168
|
-
LIMIT 1) as root_name
|
|
169
|
-
FROM span
|
|
170
|
-
GROUP BY trace_id
|
|
171
|
-
ORDER BY start_time DESC
|
|
172
|
-
LIMIT ?
|
|
173
|
-
`).all(limit);
|
|
174
|
-
return rows.map((row) => {
|
|
175
|
-
const spanCount = Number(row.span_count) || 0;
|
|
176
|
-
const errorCount = Number(row.error_count) || 0;
|
|
177
|
-
const endTime = row.end_time ?? undefined;
|
|
178
|
-
const status = errorCount === 0 ? "ok" : errorCount >= spanCount ? "error" : "mixed";
|
|
179
|
-
return {
|
|
180
|
-
traceId: row.trace_id,
|
|
181
|
-
rootSpanName: row.root_name ?? "unknown",
|
|
182
|
-
startTime: row.start_time,
|
|
183
|
-
endTime,
|
|
184
|
-
duration: endTime !== undefined ? endTime - row.start_time : undefined,
|
|
185
|
-
spanCount,
|
|
186
|
-
status
|
|
187
|
-
};
|
|
188
|
-
});
|
|
189
|
-
}
|
|
190
|
-
deleteByTraceId(traceId) {
|
|
191
|
-
if (this.db) {
|
|
192
|
-
this.db.prepare("DELETE FROM span WHERE trace_id = ?").run(traceId);
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
close() {
|
|
196
|
-
if (this.db) {
|
|
197
|
-
this.db.close();
|
|
198
|
-
this.db = null;
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
rowToSpan(row) {
|
|
202
|
-
return {
|
|
203
|
-
traceId: row.trace_id,
|
|
204
|
-
spanId: row.span_id,
|
|
205
|
-
parentSpanId: row.parent_span_id,
|
|
206
|
-
name: row.name,
|
|
207
|
-
kind: row.kind,
|
|
208
|
-
status: row.status,
|
|
209
|
-
startTime: row.start_time,
|
|
210
|
-
endTime: row.end_time,
|
|
211
|
-
attributes: row.attributes ? JSON.parse(row.attributes) : {},
|
|
212
|
-
result: row.result || undefined,
|
|
213
|
-
error: row.error || undefined
|
|
214
|
-
};
|
|
215
|
-
}
|
|
216
|
-
buildTree(spans) {
|
|
217
|
-
const spanMap = new Map;
|
|
218
|
-
const roots = [];
|
|
219
|
-
for (const span of spans) {
|
|
220
|
-
spanMap.set(span.spanId, { ...span, children: [] });
|
|
221
|
-
}
|
|
222
|
-
for (const span of spanMap.values()) {
|
|
223
|
-
if (span.parentSpanId) {
|
|
224
|
-
const parent = spanMap.get(span.parentSpanId);
|
|
225
|
-
if (parent) {
|
|
226
|
-
parent.children.push(span);
|
|
227
|
-
} else {
|
|
228
|
-
roots.push(span);
|
|
229
|
-
}
|
|
230
|
-
} else {
|
|
231
|
-
roots.push(span);
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
return roots;
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
var init_span_storage = () => {};
|
|
238
|
-
|
|
239
|
-
export { SQLiteSpanStorage, init_span_storage };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getDecoratorNodes,
|
|
3
|
-
hasDecoratorNodes,
|
|
4
|
-
init_node_registry_helper,
|
|
5
|
-
registerDecoratorNodeType
|
|
6
|
-
} from "./roy-agent-core-wqs6yypq.js";
|
|
7
|
-
import"./roy-agent-core-1ce3fqrk.js";
|
|
8
|
-
import"./roy-agent-core-ddwa0n6h.js";
|
|
9
|
-
import"./roy-agent-core-5s2t8z00.js";
|
|
10
|
-
import"./roy-agent-core-7f7t9wwp.js";
|
|
11
|
-
import"./roy-agent-core-85xyctnb.js";
|
|
12
|
-
import"./roy-agent-core-fs0mn2jk.js";
|
|
13
|
-
init_node_registry_helper();
|
|
14
|
-
|
|
15
|
-
export {
|
|
16
|
-
registerDecoratorNodeType,
|
|
17
|
-
hasDecoratorNodes,
|
|
18
|
-
getDecoratorNodes
|
|
19
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
WorkflowRepository,
|
|
3
|
-
migrateEmptyTagsToDefault,
|
|
4
|
-
rowToWorkflow
|
|
5
|
-
} from "./roy-agent-core-4fkxy2gv.js";
|
|
6
|
-
import"./roy-agent-core-vf9sp6s3.js";
|
|
7
|
-
import"./roy-agent-core-rvxg1wps.js";
|
|
8
|
-
import"./roy-agent-core-5s2t8z00.js";
|
|
9
|
-
import"./roy-agent-core-7f7t9wwp.js";
|
|
10
|
-
import"./roy-agent-core-85xyctnb.js";
|
|
11
|
-
import"./roy-agent-core-fs0mn2jk.js";
|
|
12
|
-
export {
|
|
13
|
-
rowToWorkflow,
|
|
14
|
-
migrateEmptyTagsToDefault,
|
|
15
|
-
WorkflowRepository
|
|
16
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AgentComponentAdapter,
|
|
3
|
-
init_agent_component_adapter
|
|
4
|
-
} from "./roy-agent-core-bjtc9d35.js";
|
|
5
|
-
import"./roy-agent-core-1db4vpc6.js";
|
|
6
|
-
import"./roy-agent-core-mkc3zshb.js";
|
|
7
|
-
import"./roy-agent-core-yet36q5k.js";
|
|
8
|
-
import"./roy-agent-core-tkpp1ba0.js";
|
|
9
|
-
import"./roy-agent-core-p31ftgq9.js";
|
|
10
|
-
import"./roy-agent-core-5s2t8z00.js";
|
|
11
|
-
import"./roy-agent-core-7f7t9wwp.js";
|
|
12
|
-
import"./roy-agent-core-85xyctnb.js";
|
|
13
|
-
import"./roy-agent-core-fs0mn2jk.js";
|
|
14
|
-
init_agent_component_adapter();
|
|
15
|
-
|
|
16
|
-
export {
|
|
17
|
-
AgentComponentAdapter
|
|
18
|
-
};
|