@rulvar/cli 1.129.0 → 1.131.0
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/index.js +17 -5
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -940,6 +940,8 @@ async function toOtel(run, tracer, options = {}) {
|
|
|
940
940
|
let toolMint = 0;
|
|
941
941
|
const openToolPairs = /* @__PURE__ */ new Map();
|
|
942
942
|
const toolPairOf = (spanId, toolName) => `${spanId} ${toolName}`;
|
|
943
|
+
const openToolById = /* @__PURE__ */ new Map();
|
|
944
|
+
const toolIdOf = (spanId, toolCallId) => `${spanId} ${toolCallId}`;
|
|
943
945
|
const { contextApi, setSpan } = options;
|
|
944
946
|
const masker = options.patterns === void 0 ? void 0 : compileSecretMasker(options.patterns, "toOtel patterns");
|
|
945
947
|
const maskText = (text) => masker === void 0 ? maskSecrets(text) : masker.maskText(text);
|
|
@@ -1020,15 +1022,25 @@ async function toOtel(run, tracer, options = {}) {
|
|
|
1020
1022
|
case "tool:start": {
|
|
1021
1023
|
const key = `${event.spanId}#tool${String(toolMint)}`;
|
|
1022
1024
|
toolMint += 1;
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1025
|
+
if (typeof event.toolCallId === "string") openToolById.set(toolIdOf(event.spanId, event.toolCallId), key);
|
|
1026
|
+
else {
|
|
1027
|
+
const pair = toolPairOf(event.spanId, event.toolName);
|
|
1028
|
+
const fifo = openToolPairs.get(pair);
|
|
1029
|
+
if (fifo === void 0) openToolPairs.set(pair, [key]);
|
|
1030
|
+
else fifo.push(key);
|
|
1031
|
+
}
|
|
1027
1032
|
startSpan(event, key, event.spanId);
|
|
1033
|
+
if (typeof event.toolCallId === "string") openBySpanId.get(key)?.span.setAttribute("rulvar.tool.call_id", event.toolCallId);
|
|
1028
1034
|
break;
|
|
1029
1035
|
}
|
|
1030
1036
|
case "tool:end": {
|
|
1031
|
-
|
|
1037
|
+
let key;
|
|
1038
|
+
if (typeof event.toolCallId === "string") {
|
|
1039
|
+
const idKey = toolIdOf(event.spanId, event.toolCallId);
|
|
1040
|
+
key = openToolById.get(idKey);
|
|
1041
|
+
if (key !== void 0) openToolById.delete(idKey);
|
|
1042
|
+
}
|
|
1043
|
+
key ??= openToolPairs.get(toolPairOf(event.spanId, event.toolName))?.shift();
|
|
1032
1044
|
if (key === void 0) {
|
|
1033
1045
|
(openBySpanId.get(event.spanId) ?? stack[stack.length - 1])?.span.addEvent(event.type, { "rulvar.entry_seq": event.seq });
|
|
1034
1046
|
break;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rulvar/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.131.0",
|
|
4
4
|
"description": "Rulvar shell: run/resume/runs/inspect/plan/kb commands, TUI progress, createServer, createWorker, OTel exporter.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -22,17 +22,17 @@
|
|
|
22
22
|
"access": "public"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@rulvar/core": "1.
|
|
25
|
+
"@rulvar/core": "1.131.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/node": "^22.20.1",
|
|
29
29
|
"tsdown": "^0.22.14",
|
|
30
30
|
"typescript": "~6.0.3",
|
|
31
|
-
"@rulvar/testing": "1.
|
|
32
|
-
"@rulvar/
|
|
33
|
-
"@rulvar/
|
|
34
|
-
"@rulvar/
|
|
35
|
-
"@rulvar/evals": "1.
|
|
31
|
+
"@rulvar/testing": "1.131.0",
|
|
32
|
+
"@rulvar/planner": "1.131.0",
|
|
33
|
+
"@rulvar/plan": "1.131.0",
|
|
34
|
+
"@rulvar/store-sqlite": "1.131.0",
|
|
35
|
+
"@rulvar/evals": "1.131.0"
|
|
36
36
|
},
|
|
37
37
|
"bin": {
|
|
38
38
|
"rulvar": "./dist/cli.js"
|