@ai-setting/roy-agent-core 1.7.55 → 1.7.57
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 +8 -8
- package/dist/env/agent/agent-component.d.ts +41 -0
- package/dist/env/agent/index.js +15 -14
- package/dist/env/commands/index.js +8 -8
- package/dist/env/context/index.js +4 -4
- package/dist/env/debug/index.js +8 -8
- package/dist/env/environment.d.ts +7 -0
- package/dist/env/event-source/event-source-handlers.d.ts +28 -0
- package/dist/env/event-source/index.js +18 -17
- package/dist/env/hook/index.js +6 -6
- package/dist/env/index.js +45 -43
- package/dist/env/llm/adapter-ai-sdk.d.ts +6 -0
- package/dist/env/llm/adapter-pi-ai.d.ts +5 -0
- package/dist/env/llm/index.js +11 -11
- package/dist/env/llm/invoke.d.ts +33 -1
- package/dist/env/llm/llm.d.ts +13 -0
- package/dist/env/llm/outbound-defense.d.ts +140 -0
- package/dist/env/log-trace/decorator.d.ts +46 -3
- package/dist/env/log-trace/index.d.ts +1 -0
- package/dist/env/log-trace/index.js +34 -8
- package/dist/env/log-trace/opentelemetry/tracer-provider.d.ts +86 -1
- package/dist/env/log-trace/trace-filters.d.ts +127 -0
- package/dist/env/mcp/index.js +9 -9
- package/dist/env/mcp/tool/index.js +2 -2
- package/dist/env/memory/index.js +9 -9
- package/dist/env/memory/plugin/index.js +2 -2
- package/dist/env/plugin/index.js +8 -8
- package/dist/env/prompt/index.js +8 -8
- package/dist/env/session/index.js +12 -11
- package/dist/env/session/session-component.d.ts +4 -0
- package/dist/env/session/storage/index.js +6 -4
- package/dist/env/skill/index.js +8 -8
- package/dist/env/task/delegate/index.js +9 -9
- package/dist/env/task/index.js +18 -17
- package/dist/env/task/plugins/index.js +11 -10
- package/dist/env/task/plugins/lark-card-patch-notifier.d.ts +109 -2
- package/dist/env/task/plugins/lark-card-state-store.d.ts +137 -0
- package/dist/env/task/plugins/lark-cli-task-notify-plugin.d.ts +154 -2
- package/dist/env/task/storage/index.js +4 -3
- package/dist/env/task/tools/index.js +4 -4
- package/dist/env/tool/built-in/index.js +5 -5
- package/dist/env/tool/index.js +12 -12
- package/dist/env/workflow/engine/index.js +13 -13
- package/dist/env/workflow/hooks/index.js +8 -8
- package/dist/env/workflow/index.js +24 -23
- package/dist/env/workflow/nodes/index.js +3 -3
- package/dist/env/workflow/plugins/index.js +9 -9
- package/dist/env/workflow/service/index.js +3 -3
- package/dist/env/workflow/storage/index.js +4 -4
- package/dist/env/workflow/tools/index.js +16 -15
- package/dist/env/workflow/utils/index.js +6 -6
- package/dist/index.d.ts +1 -1
- package/dist/index.js +90 -63
- package/dist/shared/@ai-setting/{roy-agent-core-k25gv86p.js → roy-agent-core-029r8kdw.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-8s9jd2qy.js → roy-agent-core-08njdcpj.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-tdbv7ff4.js → roy-agent-core-0kn3zt1t.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-8eqngasy.js → roy-agent-core-0yn7a78e.js} +14 -14
- package/dist/shared/@ai-setting/{roy-agent-core-tbrn9wdm.js → roy-agent-core-14bq77wr.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-mxdc756a.js → roy-agent-core-1sfbs57v.js} +9 -9
- package/dist/shared/@ai-setting/{roy-agent-core-qamktze3.js → roy-agent-core-20m8je6e.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-yhsssn86.js → roy-agent-core-2ctyjy62.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-9jzysq50.js → roy-agent-core-2fk8c9ax.js} +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-2k4xffaa.js → roy-agent-core-4096f575.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-2gay3sjt.js → roy-agent-core-47s81t6g.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-w527pcpe.js → roy-agent-core-5f7myqnb.js} +45 -494
- package/dist/shared/@ai-setting/{roy-agent-core-zjttt2y4.js → roy-agent-core-7nb23tdd.js} +1 -1
- package/dist/shared/@ai-setting/roy-agent-core-7q4wdze2.js +7 -0
- package/dist/shared/@ai-setting/{roy-agent-core-cd62e9p1.js → roy-agent-core-84rs0c8d.js} +23 -10
- package/dist/shared/@ai-setting/{roy-agent-core-dwx9hjwx.js → roy-agent-core-84xtww7d.js} +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-a4vzsn0g.js → roy-agent-core-89sxsrc7.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-g36jevrk.js → roy-agent-core-8bngppw0.js} +580 -83
- package/dist/shared/@ai-setting/roy-agent-core-8p63s836.js +578 -0
- package/dist/shared/@ai-setting/{roy-agent-core-7evvpfwc.js → roy-agent-core-9zhkdg6w.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-ak4dc3kg.js → roy-agent-core-baaa4wtp.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-b5ew8t0k.js → roy-agent-core-c36335nw.js} +146 -8
- package/dist/shared/@ai-setting/{roy-agent-core-7qy3nffr.js → roy-agent-core-c7w2h47a.js} +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-j5c3chtn.js → roy-agent-core-cyefe8z5.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-2bscfrr1.js → roy-agent-core-d75t8gea.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-0hq21px2.js → roy-agent-core-e1w17tht.js} +632 -36
- package/dist/shared/@ai-setting/{roy-agent-core-ne2t1pay.js → roy-agent-core-e250355z.js} +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-ytr2w0vb.js → roy-agent-core-eanq305k.js} +69 -25
- package/dist/shared/@ai-setting/{roy-agent-core-12d2xap8.js → roy-agent-core-em4hks9t.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-6qxh4xrm.js → roy-agent-core-en2xqxs9.js} +7 -7
- package/dist/shared/@ai-setting/{roy-agent-core-e2z1etk4.js → roy-agent-core-ewcc5qdt.js} +11 -11
- package/dist/shared/@ai-setting/{roy-agent-core-qm9jda8p.js → roy-agent-core-fbjd7bt6.js} +3 -7
- package/dist/shared/@ai-setting/{roy-agent-core-fvs48d38.js → roy-agent-core-fw6k4w1h.js} +14 -9
- package/dist/shared/@ai-setting/{roy-agent-core-2b8jtv7m.js → roy-agent-core-ge87xbas.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-9csa89jx.js → roy-agent-core-geh6j7bw.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-dv714bqh.js → roy-agent-core-gksw1gjb.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-fs36xgcs.js → roy-agent-core-hefarcp0.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-t37wbysj.js → roy-agent-core-hs41gx9w.js} +5 -5
- package/dist/shared/@ai-setting/{roy-agent-core-1cv9j4dg.js → roy-agent-core-jjhw9am6.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-978b6wfx.js → roy-agent-core-jjxdmedn.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-j2nvedt6.js → roy-agent-core-jw5ar4p0.js} +33 -38
- package/dist/shared/@ai-setting/{roy-agent-core-zvemdfx5.js → roy-agent-core-kq9pz2a7.js} +13 -6
- package/dist/shared/@ai-setting/{roy-agent-core-8t7wny6v.js → roy-agent-core-m68z3pw1.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-k8b440n3.js → roy-agent-core-m97jn2ra.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-kzg1jwt8.js → roy-agent-core-n0p0hwgd.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-9h72sk1n.js → roy-agent-core-psg6f1v6.js} +6 -6
- package/dist/shared/@ai-setting/{roy-agent-core-athdr2m0.js → roy-agent-core-q4gdfypk.js} +12 -4
- package/dist/shared/@ai-setting/{roy-agent-core-nde5gzta.js → roy-agent-core-rcgvmtms.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-8seq65bp.js → roy-agent-core-rt115qfc.js} +44 -1
- package/dist/shared/@ai-setting/{roy-agent-core-5apmk4qw.js → roy-agent-core-syyw58p9.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-tjg71zqp.js → roy-agent-core-t4x089js.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-zd3ddm4k.js → roy-agent-core-t64nmayv.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-6167phd4.js → roy-agent-core-txwptxk1.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-rnwr39b0.js → roy-agent-core-tze5596n.js} +6 -4
- package/dist/shared/@ai-setting/{roy-agent-core-skzjs973.js → roy-agent-core-vath15kt.js} +6 -6
- package/dist/shared/@ai-setting/{roy-agent-core-vrsxhw9e.js → roy-agent-core-vgdhxbx3.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-7g03zkkb.js → roy-agent-core-vh0qzb24.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-aer5kw1j.js → roy-agent-core-w93z6a42.js} +17 -17
- package/dist/shared/@ai-setting/{roy-agent-core-rx16h2m1.js → roy-agent-core-ygn5tzt1.js} +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-4z3rq5gw.js → roy-agent-core-yphwdm9x.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-qcspfszy.js → roy-agent-core-ytd5eztz.js} +1 -1
- package/dist/utils/temp-file-manager/index.js +2 -2
- package/package.json +1 -1
- package/dist/shared/@ai-setting/roy-agent-core-dsevjbck.js +0 -245
|
@@ -7,17 +7,17 @@ import {
|
|
|
7
7
|
createPerTaskGroupChatPlugin,
|
|
8
8
|
extractPerTaskChatId,
|
|
9
9
|
extractPerTaskChatName
|
|
10
|
-
} from "./roy-agent-core-
|
|
10
|
+
} from "./roy-agent-core-8bngppw0.js";
|
|
11
11
|
import {
|
|
12
12
|
getSharedEventStore
|
|
13
|
-
} from "./roy-agent-core-
|
|
13
|
+
} from "./roy-agent-core-2ctyjy62.js";
|
|
14
14
|
import {
|
|
15
15
|
createLarkCliWorkflowNotifyHook
|
|
16
|
-
} from "./roy-agent-core-
|
|
16
|
+
} from "./roy-agent-core-psg6f1v6.js";
|
|
17
17
|
import {
|
|
18
18
|
LarkCardPatchNotifier,
|
|
19
19
|
buildTaskCard
|
|
20
|
-
} from "./roy-agent-core-
|
|
20
|
+
} from "./roy-agent-core-c36335nw.js";
|
|
21
21
|
import {
|
|
22
22
|
normalizeLarkAtMentions
|
|
23
23
|
} from "./roy-agent-core-64f22h1g.js";
|
|
@@ -26,29 +26,29 @@ import {
|
|
|
26
26
|
} from "./roy-agent-core-7hh0brvs.js";
|
|
27
27
|
import {
|
|
28
28
|
BaseComponent
|
|
29
|
-
} from "./roy-agent-core-
|
|
29
|
+
} from "./roy-agent-core-0kn3zt1t.js";
|
|
30
30
|
import {
|
|
31
31
|
globalHookManager,
|
|
32
32
|
init_global_hook_manager
|
|
33
|
-
} from "./roy-agent-core-
|
|
33
|
+
} from "./roy-agent-core-yphwdm9x.js";
|
|
34
34
|
import {
|
|
35
35
|
init_context
|
|
36
|
-
} from "./roy-agent-core-
|
|
36
|
+
} from "./roy-agent-core-m97jn2ra.js";
|
|
37
37
|
import {
|
|
38
38
|
createEnvContext,
|
|
39
39
|
normalizeParentTaskId,
|
|
40
40
|
runWithEnvContext
|
|
41
|
-
} from "./roy-agent-core-
|
|
41
|
+
} from "./roy-agent-core-syyw58p9.js";
|
|
42
42
|
import {
|
|
43
43
|
TracedAs,
|
|
44
44
|
init_decorator,
|
|
45
45
|
wrapFunction
|
|
46
|
-
} from "./roy-agent-core-
|
|
46
|
+
} from "./roy-agent-core-8p63s836.js";
|
|
47
47
|
import {
|
|
48
48
|
createLogger,
|
|
49
49
|
getTracerProvider,
|
|
50
50
|
init_logger
|
|
51
|
-
} from "./roy-agent-core-
|
|
51
|
+
} from "./roy-agent-core-rt115qfc.js";
|
|
52
52
|
import {
|
|
53
53
|
__legacyDecorateClassTS,
|
|
54
54
|
__require
|
|
@@ -1501,14 +1501,6 @@ var BUILT_IN_PLUGIN_FACTORIES = {
|
|
|
1501
1501
|
PerTaskGroupChatPlugin: (cfg) => createPerTaskGroupChatPlugin(cfg),
|
|
1502
1502
|
"task-tag": () => new TaskTagPlugin
|
|
1503
1503
|
};
|
|
1504
|
-
function generateTraceId() {
|
|
1505
|
-
const chars = "0123456789abcdef";
|
|
1506
|
-
let traceId = "";
|
|
1507
|
-
for (let i = 0;i < 32; i++) {
|
|
1508
|
-
traceId += chars[Math.floor(Math.random() * chars.length)];
|
|
1509
|
-
}
|
|
1510
|
-
return traceId;
|
|
1511
|
-
}
|
|
1512
1504
|
function matchEventType(eventType, patterns) {
|
|
1513
1505
|
for (const pattern of patterns) {
|
|
1514
1506
|
if (pattern === "*")
|
|
@@ -2025,7 +2017,8 @@ class LarkCliInstance {
|
|
|
2025
2017
|
"task:after.create",
|
|
2026
2018
|
"task:after.update",
|
|
2027
2019
|
"task:operation:after.create",
|
|
2028
|
-
"task:after.complete"
|
|
2020
|
+
"task:after.complete",
|
|
2021
|
+
"task:after.delete"
|
|
2029
2022
|
];
|
|
2030
2023
|
}
|
|
2031
2024
|
return [];
|
|
@@ -2238,10 +2231,16 @@ class LarkCliInstance {
|
|
|
2238
2231
|
this.dispatchLines(selected);
|
|
2239
2232
|
}
|
|
2240
2233
|
dispatchLines(lines) {
|
|
2234
|
+
const provider = getTracerProvider();
|
|
2241
2235
|
for (const line of lines) {
|
|
2242
|
-
if (line.trim())
|
|
2243
|
-
|
|
2244
|
-
|
|
2236
|
+
if (!line.trim())
|
|
2237
|
+
continue;
|
|
2238
|
+
provider.runInGlobalContextSync(undefined, () => {
|
|
2239
|
+
provider.clearAllTracerCurrentContexts();
|
|
2240
|
+
return this.handleEvent(line);
|
|
2241
|
+
}).catch((err) => {
|
|
2242
|
+
console.error(`[LarkCliInstance] handleEvent rejected: ${err}`);
|
|
2243
|
+
});
|
|
2245
2244
|
}
|
|
2246
2245
|
}
|
|
2247
2246
|
async handleEvent(rawData) {
|
|
@@ -2284,18 +2283,15 @@ class LarkCliInstance {
|
|
|
2284
2283
|
}
|
|
2285
2284
|
const provider = getTracerProvider();
|
|
2286
2285
|
const tracer = provider.getTracer("roy-tracer");
|
|
2287
|
-
const
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
attributes: { rawData: rawData.substring(0, 500) }
|
|
2297
|
-
});
|
|
2298
|
-
provider.setGlobalContext(rootSpan.spanContext);
|
|
2286
|
+
const decoratorContext = tracer.getCurrentContext();
|
|
2287
|
+
let eventTraceContext;
|
|
2288
|
+
if (decoratorContext) {
|
|
2289
|
+
eventTraceContext = decoratorContext;
|
|
2290
|
+
} else {
|
|
2291
|
+
const fallbackSpan = tracer.startSpan("lark-cli.handleEvent", { parent: undefined });
|
|
2292
|
+
eventTraceContext = fallbackSpan.spanContext;
|
|
2293
|
+
fallbackSpan.end();
|
|
2294
|
+
}
|
|
2299
2295
|
let failureReplyChannel;
|
|
2300
2296
|
try {
|
|
2301
2297
|
let rawEvent;
|
|
@@ -2378,7 +2374,8 @@ class LarkCliInstance {
|
|
|
2378
2374
|
replyChannel,
|
|
2379
2375
|
agent,
|
|
2380
2376
|
parentTaskId: parentTaskId ?? undefined,
|
|
2381
|
-
...triggerEventId ? { triggerEventId } : {}
|
|
2377
|
+
...triggerEventId ? { triggerEventId } : {},
|
|
2378
|
+
traceContext: eventTraceContext
|
|
2382
2379
|
},
|
|
2383
2380
|
payload: {
|
|
2384
2381
|
sourceId: this.config.id,
|
|
@@ -2427,13 +2424,11 @@ class LarkCliInstance {
|
|
|
2427
2424
|
});
|
|
2428
2425
|
} catch (error) {
|
|
2429
2426
|
console.error(`[LarkCliInstance] Error handling event: ${error}`);
|
|
2430
|
-
rootSpan.setAttribute("error", String(error));
|
|
2431
2427
|
notifyReactFailure({
|
|
2432
2428
|
error,
|
|
2433
2429
|
replyChannel: failureReplyChannel
|
|
2434
2430
|
}).catch(() => {});
|
|
2435
|
-
|
|
2436
|
-
rootSpan.end();
|
|
2431
|
+
throw error;
|
|
2437
2432
|
}
|
|
2438
2433
|
}
|
|
2439
2434
|
async handleCardActionEvent(rawEvent, profile) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MemorySessionStore,
|
|
3
3
|
SQLiteSessionStore
|
|
4
|
-
} from "./roy-agent-core-
|
|
4
|
+
} from "./roy-agent-core-c7w2h47a.js";
|
|
5
5
|
import {
|
|
6
6
|
init_loose_json,
|
|
7
7
|
tryParseJsonFromText
|
|
@@ -16,15 +16,17 @@ import {
|
|
|
16
16
|
} from "./roy-agent-core-7hh0brvs.js";
|
|
17
17
|
import {
|
|
18
18
|
BaseComponent
|
|
19
|
-
} from "./roy-agent-core-
|
|
19
|
+
} from "./roy-agent-core-0kn3zt1t.js";
|
|
20
20
|
import {
|
|
21
21
|
TracedAs,
|
|
22
|
-
init_decorator
|
|
23
|
-
|
|
22
|
+
init_decorator,
|
|
23
|
+
init_trace_filters,
|
|
24
|
+
messagesParamFilter
|
|
25
|
+
} from "./roy-agent-core-8p63s836.js";
|
|
24
26
|
import {
|
|
25
27
|
createLogger,
|
|
26
28
|
init_logger
|
|
27
|
-
} from "./roy-agent-core-
|
|
29
|
+
} from "./roy-agent-core-rt115qfc.js";
|
|
28
30
|
import {
|
|
29
31
|
__legacyDecorateClassTS
|
|
30
32
|
} from "./roy-agent-core-fs0mn2jk.js";
|
|
@@ -32,6 +34,7 @@ import {
|
|
|
32
34
|
// src/env/session/session-component.ts
|
|
33
35
|
init_logger();
|
|
34
36
|
init_decorator();
|
|
37
|
+
init_trace_filters();
|
|
35
38
|
|
|
36
39
|
// src/env/session/session-config-registration.ts
|
|
37
40
|
var SESSION_DEFAULTS = {
|
|
@@ -1070,7 +1073,11 @@ __legacyDecorateClassTS([
|
|
|
1070
1073
|
TracedAs("session.compact", { recordParams: true, recordResult: true })
|
|
1071
1074
|
], SessionComponent.prototype, "compact", null);
|
|
1072
1075
|
__legacyDecorateClassTS([
|
|
1073
|
-
TracedAs("session.extractRecentMessages"
|
|
1076
|
+
TracedAs("session.extractRecentMessages", {
|
|
1077
|
+
paramFilter: messagesParamFilter,
|
|
1078
|
+
recordResult: false,
|
|
1079
|
+
logResult: true
|
|
1080
|
+
})
|
|
1074
1081
|
], SessionComponent.prototype, "extractRecentMessages", null);
|
|
1075
1082
|
// src/env/session/session-id.ts
|
|
1076
1083
|
var MIN_SESSION_ID_LENGTH = 8;
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import {
|
|
2
2
|
LarkCardPatchNotifier,
|
|
3
3
|
formatDurationMs
|
|
4
|
-
} from "./roy-agent-core-
|
|
4
|
+
} from "./roy-agent-core-c36335nw.js";
|
|
5
5
|
import {
|
|
6
6
|
WorkflowHookPoints,
|
|
7
7
|
init_workflow_hook_points
|
|
8
|
-
} from "./roy-agent-core-
|
|
8
|
+
} from "./roy-agent-core-geh6j7bw.js";
|
|
9
9
|
import {
|
|
10
10
|
init_context
|
|
11
|
-
} from "./roy-agent-core-
|
|
11
|
+
} from "./roy-agent-core-m97jn2ra.js";
|
|
12
12
|
import {
|
|
13
13
|
getEnvContextOrEmpty
|
|
14
|
-
} from "./roy-agent-core-
|
|
14
|
+
} from "./roy-agent-core-syyw58p9.js";
|
|
15
15
|
import {
|
|
16
16
|
TracedAs,
|
|
17
17
|
init_decorator
|
|
18
|
-
} from "./roy-agent-core-
|
|
18
|
+
} from "./roy-agent-core-8p63s836.js";
|
|
19
19
|
import {
|
|
20
20
|
createLogger,
|
|
21
21
|
init_logger
|
|
22
|
-
} from "./roy-agent-core-
|
|
22
|
+
} from "./roy-agent-core-rt115qfc.js";
|
|
23
23
|
import {
|
|
24
24
|
__legacyDecorateClassTS
|
|
25
25
|
} from "./roy-agent-core-fs0mn2jk.js";
|
|
@@ -7,11 +7,14 @@ import {
|
|
|
7
7
|
import {
|
|
8
8
|
getCurrentProcessRegistry,
|
|
9
9
|
killProcessTree
|
|
10
|
-
} from "./roy-agent-core-
|
|
10
|
+
} from "./roy-agent-core-14bq77wr.js";
|
|
11
11
|
import {
|
|
12
12
|
init_decorator,
|
|
13
|
+
init_trace_filters,
|
|
14
|
+
toolExecResultFilter,
|
|
15
|
+
toolInvokeParamFilter,
|
|
13
16
|
wrapFunction
|
|
14
|
-
} from "./roy-agent-core-
|
|
17
|
+
} from "./roy-agent-core-8p63s836.js";
|
|
15
18
|
import {
|
|
16
19
|
createLogger,
|
|
17
20
|
exports_tracer_provider,
|
|
@@ -19,7 +22,7 @@ import {
|
|
|
19
22
|
init_propagation,
|
|
20
23
|
init_tracer_provider,
|
|
21
24
|
propagation
|
|
22
|
-
} from "./roy-agent-core-
|
|
25
|
+
} from "./roy-agent-core-rt115qfc.js";
|
|
23
26
|
import {
|
|
24
27
|
__toCommonJS
|
|
25
28
|
} from "./roy-agent-core-fs0mn2jk.js";
|
|
@@ -27,6 +30,7 @@ import {
|
|
|
27
30
|
// src/env/tool/built-in/bash.ts
|
|
28
31
|
init_propagation();
|
|
29
32
|
init_decorator();
|
|
33
|
+
init_trace_filters();
|
|
30
34
|
import { z } from "zod";
|
|
31
35
|
import { Effect as Effect2 } from "effect";
|
|
32
36
|
|
|
@@ -334,7 +338,11 @@ var bashTool = {
|
|
|
334
338
|
}
|
|
335
339
|
};
|
|
336
340
|
}
|
|
337
|
-
}, "tool.bash.execute", {
|
|
341
|
+
}, "tool.bash.execute", {
|
|
342
|
+
paramFilter: toolInvokeParamFilter,
|
|
343
|
+
resultFilter: toolExecResultFilter,
|
|
344
|
+
logResult: true
|
|
345
|
+
})
|
|
338
346
|
};
|
|
339
347
|
|
|
340
348
|
// src/env/tool/built-in/echo.ts
|
|
@@ -385,6 +385,7 @@ __export(exports_tracer_provider, {
|
|
|
385
385
|
getTracerProvider: () => getTracerProvider,
|
|
386
386
|
OTelTracerProvider: () => OTelTracerProvider
|
|
387
387
|
});
|
|
388
|
+
import { AsyncLocalStorage } from "async_hooks";
|
|
388
389
|
function getOtelLogger() {
|
|
389
390
|
if (!_otelLogger) {
|
|
390
391
|
_otelLogger = createLogger("otel-tracer");
|
|
@@ -479,7 +480,12 @@ class OTelTracerImpl {
|
|
|
479
480
|
name;
|
|
480
481
|
version;
|
|
481
482
|
storage;
|
|
482
|
-
currentContext
|
|
483
|
+
get currentContext() {
|
|
484
|
+
return this.provider.getTracerCurrentContext(this.instanceId);
|
|
485
|
+
}
|
|
486
|
+
set currentContext(context) {
|
|
487
|
+
this.provider.setTracerCurrentContext(this.instanceId, context);
|
|
488
|
+
}
|
|
483
489
|
activeSpans = new Map;
|
|
484
490
|
onSpanEndCallback;
|
|
485
491
|
provider;
|
|
@@ -673,6 +679,9 @@ class OTelTracerProvider {
|
|
|
673
679
|
storage;
|
|
674
680
|
initialized = false;
|
|
675
681
|
globalContext;
|
|
682
|
+
globalContextScope = new AsyncLocalStorage;
|
|
683
|
+
tracerContexts = new Map;
|
|
684
|
+
tracerContextScope = new AsyncLocalStorage;
|
|
676
685
|
instanceId;
|
|
677
686
|
constructor(storage, dbPath) {
|
|
678
687
|
providerCounter++;
|
|
@@ -689,11 +698,45 @@ class OTelTracerProvider {
|
|
|
689
698
|
return this.initialized;
|
|
690
699
|
}
|
|
691
700
|
getGlobalContext() {
|
|
701
|
+
const scoped = this.globalContextScope.getStore();
|
|
702
|
+
if (scoped)
|
|
703
|
+
return scoped.value;
|
|
692
704
|
return this.globalContext;
|
|
693
705
|
}
|
|
694
706
|
setGlobalContext(context) {
|
|
695
707
|
this.globalContext = context;
|
|
696
708
|
}
|
|
709
|
+
withGlobalContext(context, fn) {
|
|
710
|
+
const seeded = new Map(this.tracerContexts);
|
|
711
|
+
return this.globalContextScope.run({ value: context }, () => this.tracerContextScope.run({ contexts: seeded }, fn));
|
|
712
|
+
}
|
|
713
|
+
runInGlobalContextSync(context, fn) {
|
|
714
|
+
const seeded = new Map(this.tracerContexts);
|
|
715
|
+
return this.globalContextScope.run({ value: context }, () => this.tracerContextScope.run({ contexts: seeded }, fn));
|
|
716
|
+
}
|
|
717
|
+
getTracerCurrentContext(instanceId) {
|
|
718
|
+
const scoped = this.tracerContextScope.getStore();
|
|
719
|
+
if (scoped) {
|
|
720
|
+
return scoped.contexts.get(instanceId);
|
|
721
|
+
}
|
|
722
|
+
return this.tracerContexts.get(instanceId);
|
|
723
|
+
}
|
|
724
|
+
setTracerCurrentContext(instanceId, context) {
|
|
725
|
+
const scoped = this.tracerContextScope.getStore();
|
|
726
|
+
if (scoped) {
|
|
727
|
+
scoped.contexts.set(instanceId, context);
|
|
728
|
+
return;
|
|
729
|
+
}
|
|
730
|
+
this.tracerContexts.set(instanceId, context);
|
|
731
|
+
}
|
|
732
|
+
clearAllTracerCurrentContexts() {
|
|
733
|
+
const scoped = this.tracerContextScope.getStore();
|
|
734
|
+
if (scoped) {
|
|
735
|
+
scoped.contexts.clear();
|
|
736
|
+
return;
|
|
737
|
+
}
|
|
738
|
+
this.tracerContexts.clear();
|
|
739
|
+
}
|
|
697
740
|
getTracer(name, version) {
|
|
698
741
|
const key = `${name}@${version || "0.0.0"}`;
|
|
699
742
|
let tracer = this.tracers.get(key);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
init_decorator,
|
|
3
3
|
wrapFunction
|
|
4
|
-
} from "./roy-agent-core-
|
|
4
|
+
} from "./roy-agent-core-8p63s836.js";
|
|
5
5
|
import {
|
|
6
6
|
createLogger,
|
|
7
7
|
init_logger
|
|
8
|
-
} from "./roy-agent-core-
|
|
8
|
+
} from "./roy-agent-core-rt115qfc.js";
|
|
9
9
|
import {
|
|
10
10
|
__esm
|
|
11
11
|
} from "./roy-agent-core-fs0mn2jk.js";
|
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
} from "./roy-agent-core-7hh0brvs.js";
|
|
5
5
|
import {
|
|
6
6
|
BaseComponent
|
|
7
|
-
} from "./roy-agent-core-
|
|
7
|
+
} from "./roy-agent-core-0kn3zt1t.js";
|
|
8
8
|
import {
|
|
9
9
|
createLogger,
|
|
10
10
|
init_logger
|
|
11
|
-
} from "./roy-agent-core-
|
|
11
|
+
} from "./roy-agent-core-rt115qfc.js";
|
|
12
12
|
|
|
13
13
|
// src/env/commands/commands-component.ts
|
|
14
14
|
import path2 from "path";
|
|
@@ -12,16 +12,16 @@ import {
|
|
|
12
12
|
import {
|
|
13
13
|
globalHookManager,
|
|
14
14
|
init_global_hook_manager
|
|
15
|
-
} from "./roy-agent-core-
|
|
15
|
+
} from "./roy-agent-core-yphwdm9x.js";
|
|
16
16
|
import {
|
|
17
17
|
TracedAs,
|
|
18
18
|
init_decorator,
|
|
19
19
|
wrapFunction
|
|
20
|
-
} from "./roy-agent-core-
|
|
20
|
+
} from "./roy-agent-core-8p63s836.js";
|
|
21
21
|
import {
|
|
22
22
|
createLogger,
|
|
23
23
|
init_logger
|
|
24
|
-
} from "./roy-agent-core-
|
|
24
|
+
} from "./roy-agent-core-rt115qfc.js";
|
|
25
25
|
import {
|
|
26
26
|
__esm,
|
|
27
27
|
__legacyDecorateClassTS
|
|
@@ -444,7 +444,7 @@ var init_agent_component_adapter = __esm(() => {
|
|
|
444
444
|
agentSessionPrefixes = new Map;
|
|
445
445
|
};
|
|
446
446
|
__legacyDecorateClassTS([
|
|
447
|
-
TracedAs("workflow.agent_adapter.run", { recordParams: true, recordResult:
|
|
447
|
+
TracedAs("workflow.agent_adapter.run", { recordParams: true, recordResult: false, log: true })
|
|
448
448
|
], AgentComponentAdapter.prototype, "run", null);
|
|
449
449
|
});
|
|
450
450
|
|
|
@@ -3,10 +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-0kn3zt1t.js";
|
|
7
7
|
import {
|
|
8
|
-
init_decorator
|
|
9
|
-
|
|
8
|
+
init_decorator,
|
|
9
|
+
init_trace_filters
|
|
10
|
+
} from "./roy-agent-core-8p63s836.js";
|
|
10
11
|
import {
|
|
11
12
|
createLogger,
|
|
12
13
|
getTracerProvider,
|
|
@@ -17,7 +18,7 @@ import {
|
|
|
17
18
|
propagation,
|
|
18
19
|
setConfigComponent,
|
|
19
20
|
setQuietMode
|
|
20
|
-
} from "./roy-agent-core-
|
|
21
|
+
} from "./roy-agent-core-rt115qfc.js";
|
|
21
22
|
import {
|
|
22
23
|
SQLiteSpanStorage,
|
|
23
24
|
init_span_storage
|
|
@@ -417,5 +418,6 @@ function getTraceparentHeader() {
|
|
|
417
418
|
// src/env/log-trace/index.ts
|
|
418
419
|
init_logger();
|
|
419
420
|
init_decorator();
|
|
421
|
+
init_trace_filters();
|
|
420
422
|
|
|
421
423
|
export { getDefaultLogDir, getDefaultSpanDbPath, LogTraceConfigSchema, LogTraceComponent, injectToEnv, injectToEnvWithContext, injectToEnvFromCarrier, getTraceparentHeader };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AgentComponentAdapter,
|
|
3
3
|
init_agent_component_adapter
|
|
4
|
-
} from "./roy-agent-core-
|
|
4
|
+
} from "./roy-agent-core-txwptxk1.js";
|
|
5
5
|
import"./roy-agent-core-1db4vpc6.js";
|
|
6
6
|
import"./roy-agent-core-ze068vc9.js";
|
|
7
7
|
import"./roy-agent-core-e25xkv53.js";
|
|
8
|
-
import"./roy-agent-core-
|
|
9
|
-
import"./roy-agent-core-
|
|
10
|
-
import"./roy-agent-core-
|
|
11
|
-
import"./roy-agent-core-
|
|
12
|
-
import"./roy-agent-core-
|
|
8
|
+
import"./roy-agent-core-yphwdm9x.js";
|
|
9
|
+
import"./roy-agent-core-m97jn2ra.js";
|
|
10
|
+
import"./roy-agent-core-syyw58p9.js";
|
|
11
|
+
import"./roy-agent-core-8p63s836.js";
|
|
12
|
+
import"./roy-agent-core-rt115qfc.js";
|
|
13
13
|
import"./roy-agent-core-jnszp0jq.js";
|
|
14
14
|
import"./roy-agent-core-fs0mn2jk.js";
|
|
15
15
|
init_agent_component_adapter();
|
|
@@ -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-8p63s836.js";
|
|
13
13
|
import {
|
|
14
14
|
createLogger,
|
|
15
15
|
init_logger
|
|
16
|
-
} from "./roy-agent-core-
|
|
16
|
+
} from "./roy-agent-core-rt115qfc.js";
|
|
17
17
|
import {
|
|
18
18
|
__esm,
|
|
19
19
|
__export,
|
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
getEnvContextOrEmpty,
|
|
3
3
|
init_env_context,
|
|
4
4
|
setCurrentTaskId
|
|
5
|
-
} from "./roy-agent-core-
|
|
5
|
+
} from "./roy-agent-core-syyw58p9.js";
|
|
6
6
|
import {
|
|
7
7
|
createLogger,
|
|
8
8
|
init_logger
|
|
9
|
-
} from "./roy-agent-core-
|
|
9
|
+
} from "./roy-agent-core-rt115qfc.js";
|
|
10
10
|
|
|
11
11
|
// src/env/task/tools/task-types.ts
|
|
12
12
|
import { z } from "zod";
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
import {
|
|
8
8
|
AgentComponentAdapter,
|
|
9
9
|
init_agent_component_adapter
|
|
10
|
-
} from "./roy-agent-core-
|
|
10
|
+
} from "./roy-agent-core-txwptxk1.js";
|
|
11
11
|
import {
|
|
12
12
|
PythonCallNode,
|
|
13
13
|
SkillNode,
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
init_skill_node,
|
|
18
18
|
init_tool_node,
|
|
19
19
|
init_workflow_node
|
|
20
|
-
} from "./roy-agent-core-
|
|
20
|
+
} from "./roy-agent-core-d75t8gea.js";
|
|
21
21
|
import {
|
|
22
22
|
WORKFLOW_SUBMIT_OUTPUT_TOOL_NAME,
|
|
23
23
|
init_json_schema_to_zod,
|
|
@@ -28,20 +28,20 @@ import {
|
|
|
28
28
|
} from "./roy-agent-core-1db4vpc6.js";
|
|
29
29
|
import {
|
|
30
30
|
init_hooks
|
|
31
|
-
} from "./roy-agent-core-
|
|
31
|
+
} from "./roy-agent-core-hefarcp0.js";
|
|
32
32
|
import {
|
|
33
33
|
WorkflowHookPoints,
|
|
34
34
|
emitWorkflowNodeHook,
|
|
35
35
|
emitWorkflowRunHook
|
|
36
|
-
} from "./roy-agent-core-
|
|
36
|
+
} from "./roy-agent-core-geh6j7bw.js";
|
|
37
37
|
import {
|
|
38
38
|
TemplateResolver,
|
|
39
39
|
init_template_resolver
|
|
40
|
-
} from "./roy-agent-core-
|
|
40
|
+
} from "./roy-agent-core-t4x089js.js";
|
|
41
41
|
import {
|
|
42
42
|
DAGManager,
|
|
43
43
|
init_dag_manager
|
|
44
|
-
} from "./roy-agent-core-
|
|
44
|
+
} from "./roy-agent-core-08njdcpj.js";
|
|
45
45
|
import {
|
|
46
46
|
WorkflowError,
|
|
47
47
|
createWorkflowEvent,
|
|
@@ -57,11 +57,11 @@ import {
|
|
|
57
57
|
import {
|
|
58
58
|
TracedAs,
|
|
59
59
|
init_decorator
|
|
60
|
-
} from "./roy-agent-core-
|
|
60
|
+
} from "./roy-agent-core-8p63s836.js";
|
|
61
61
|
import {
|
|
62
62
|
createLogger,
|
|
63
63
|
init_logger
|
|
64
|
-
} from "./roy-agent-core-
|
|
64
|
+
} from "./roy-agent-core-rt115qfc.js";
|
|
65
65
|
import {
|
|
66
66
|
__esm,
|
|
67
67
|
__export,
|
|
@@ -801,13 +801,13 @@ var init_executor = __esm(() => {
|
|
|
801
801
|
}
|
|
802
802
|
};
|
|
803
803
|
__legacyDecorateClassTS([
|
|
804
|
-
TracedAs("workflow.executor.executeNode", { recordParams: true, recordResult:
|
|
804
|
+
TracedAs("workflow.executor.executeNode", { recordParams: true, recordResult: false })
|
|
805
805
|
], Executor.prototype, "executeNode", null);
|
|
806
806
|
__legacyDecorateClassTS([
|
|
807
|
-
TracedAs("workflow.executor.executeWithTimeout", { recordParams: true, recordResult:
|
|
807
|
+
TracedAs("workflow.executor.executeWithTimeout", { recordParams: true, recordResult: false })
|
|
808
808
|
], Executor.prototype, "executeWithTimeout", null);
|
|
809
809
|
__legacyDecorateClassTS([
|
|
810
|
-
TracedAs("workflow.executor.executeWithRetry", { recordParams: true, recordResult:
|
|
810
|
+
TracedAs("workflow.executor.executeWithRetry", { recordParams: true, recordResult: false })
|
|
811
811
|
], Executor.prototype, "executeWithRetry", null);
|
|
812
812
|
__legacyDecorateClassTS([
|
|
813
813
|
TracedAs("workflow.executor.cancelNode", { recordParams: true, recordResult: false })
|
|
@@ -1289,7 +1289,7 @@ ${promptInjection}`;
|
|
|
1289
1289
|
}
|
|
1290
1290
|
};
|
|
1291
1291
|
__legacyDecorateClassTS([
|
|
1292
|
-
TracedAs("workflow.agent.execute")
|
|
1292
|
+
TracedAs("workflow.agent.execute", { recordResult: false })
|
|
1293
1293
|
], AgentNode.prototype, "execute", null);
|
|
1294
1294
|
__legacyDecorateClassTS([
|
|
1295
1295
|
TracedAs("workflow.agent.applyPromptInjection", { recordParams: true, recordResult: false })
|
|
@@ -2914,16 +2914,16 @@ var init_engine = __esm(() => {
|
|
|
2914
2914
|
TracedAs("workflow.engine.createSession", { recordParams: true, recordResult: true, log: true })
|
|
2915
2915
|
], WorkflowEngine.prototype, "createSession", null);
|
|
2916
2916
|
__legacyDecorateClassTS([
|
|
2917
|
-
TracedAs("workflow.engine.run", { recordParams: true, recordResult:
|
|
2917
|
+
TracedAs("workflow.engine.run", { recordParams: true, recordResult: false, log: true })
|
|
2918
2918
|
], WorkflowEngine.prototype, "run", null);
|
|
2919
2919
|
__legacyDecorateClassTS([
|
|
2920
|
-
TracedAs("workflow.engine.initializeSessionState", { recordParams: true, recordResult:
|
|
2920
|
+
TracedAs("workflow.engine.initializeSessionState", { recordParams: true, recordResult: false })
|
|
2921
2921
|
], WorkflowEngine.prototype, "initializeSessionState", null);
|
|
2922
2922
|
__legacyDecorateClassTS([
|
|
2923
|
-
TracedAs("workflow.engine.runWithResume", { recordParams: true, recordResult:
|
|
2923
|
+
TracedAs("workflow.engine.runWithResume", { recordParams: true, recordResult: false })
|
|
2924
2924
|
], WorkflowEngine.prototype, "runWithResume", null);
|
|
2925
2925
|
__legacyDecorateClassTS([
|
|
2926
|
-
TracedAs("workflow.engine.runWorkflow", { recordParams: true, recordResult:
|
|
2926
|
+
TracedAs("workflow.engine.runWorkflow", { recordParams: true, recordResult: false, log: true })
|
|
2927
2927
|
], WorkflowEngine.prototype, "runWorkflow", null);
|
|
2928
2928
|
__legacyDecorateClassTS([
|
|
2929
2929
|
TracedAs("workflow.engine.pause", { recordParams: true, recordResult: true, log: true })
|
|
@@ -2973,7 +2973,7 @@ var init_engine = __esm(() => {
|
|
|
2973
2973
|
__legacyDecorateClassTS([
|
|
2974
2974
|
TracedAs("workflow.engine.waitForCompletion", {
|
|
2975
2975
|
recordParams: true,
|
|
2976
|
-
recordResult:
|
|
2976
|
+
recordResult: false
|
|
2977
2977
|
})
|
|
2978
2978
|
], WorkflowEngine.prototype, "waitForCompletion", null);
|
|
2979
2979
|
});
|