@legioncodeinc/honeycomb 0.1.7 → 0.1.8
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/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/bundle/cli.js +87 -2
- package/daemon/dashboard-app.js +10 -10
- package/daemon/index.js +1139 -52
- package/embeddings/embed-daemon.js +1 -1
- package/harnesses/claude-code/.claude-plugin/plugin.json +1 -1
- package/harnesses/claude-code/bundle/capture.js +56 -3
- package/harnesses/claude-code/bundle/index.js +56 -3
- package/harnesses/claude-code/bundle/pre-tool-use.js +56 -3
- package/harnesses/claude-code/bundle/session-end.js +56 -3
- package/harnesses/claude-code/bundle/session-start.js +56 -3
- package/harnesses/codex/bundle/capture.js +22 -2
- package/harnesses/codex/bundle/index.js +22 -2
- package/harnesses/codex/bundle/pre-tool-use.js +22 -2
- package/harnesses/codex/bundle/session-start.js +22 -2
- package/harnesses/codex/package.json +1 -1
- package/harnesses/cursor/bundle/capture.js +22 -2
- package/harnesses/cursor/bundle/index.js +22 -2
- package/harnesses/cursor/bundle/pre-tool-use.js +22 -2
- package/harnesses/cursor/bundle/session-end.js +22 -2
- package/harnesses/cursor/bundle/session-start.js +22 -2
- package/harnesses/openclaw/dist/index.js +1 -1
- package/harnesses/openclaw/openclaw.plugin.json +1 -1
- package/harnesses/openclaw/package.json +1 -1
- package/mcp/bundle/server.js +1 -1
- package/package.json +1 -1
|
@@ -92,8 +92,61 @@ function nestedString(raw, a, b) {
|
|
|
92
92
|
function userMessageData(text) {
|
|
93
93
|
return { kind: "user_message", text };
|
|
94
94
|
}
|
|
95
|
-
function assistantMessageData(text) {
|
|
96
|
-
|
|
95
|
+
function assistantMessageData(text, usage) {
|
|
96
|
+
const normalized = usage !== void 0 ? compactUsage(usage) : void 0;
|
|
97
|
+
return {
|
|
98
|
+
kind: "assistant_message",
|
|
99
|
+
text,
|
|
100
|
+
...normalized !== void 0 ? { usage: normalized } : {}
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
function compactUsage(usage) {
|
|
104
|
+
const out = {};
|
|
105
|
+
if (isCount(usage.input))
|
|
106
|
+
out.input = usage.input;
|
|
107
|
+
if (isCount(usage.output))
|
|
108
|
+
out.output = usage.output;
|
|
109
|
+
if (isCount(usage.cacheRead))
|
|
110
|
+
out.cacheRead = usage.cacheRead;
|
|
111
|
+
if (isCount(usage.cacheCreation))
|
|
112
|
+
out.cacheCreation = usage.cacheCreation;
|
|
113
|
+
return Object.keys(out).length > 0 ? out : void 0;
|
|
114
|
+
}
|
|
115
|
+
function isCount(n) {
|
|
116
|
+
return typeof n === "number" && Number.isInteger(n) && n >= 0;
|
|
117
|
+
}
|
|
118
|
+
function extractTurnUsage(raw) {
|
|
119
|
+
const block = usageBlock(raw);
|
|
120
|
+
if (block === void 0)
|
|
121
|
+
return void 0;
|
|
122
|
+
const usage = {
|
|
123
|
+
...readCount(block, "input_tokens") !== void 0 ? { input: readCount(block, "input_tokens") } : {},
|
|
124
|
+
...readCount(block, "output_tokens") !== void 0 ? { output: readCount(block, "output_tokens") } : {},
|
|
125
|
+
...readCount(block, "cache_read_input_tokens") !== void 0 ? { cacheRead: readCount(block, "cache_read_input_tokens") } : {},
|
|
126
|
+
...readCount(block, "cache_creation_input_tokens") !== void 0 ? { cacheCreation: readCount(block, "cache_creation_input_tokens") } : {}
|
|
127
|
+
};
|
|
128
|
+
return compactUsage(usage);
|
|
129
|
+
}
|
|
130
|
+
function usageBlock(raw) {
|
|
131
|
+
const top = nested(raw, "usage");
|
|
132
|
+
if (top !== null && typeof top === "object")
|
|
133
|
+
return top;
|
|
134
|
+
const inner = nestedRecord(nested(raw, "message"), "usage");
|
|
135
|
+
return inner;
|
|
136
|
+
}
|
|
137
|
+
function nestedRecord(obj, key) {
|
|
138
|
+
if (obj !== null && typeof obj === "object") {
|
|
139
|
+
const value = obj[key];
|
|
140
|
+
if (value !== null && typeof value === "object")
|
|
141
|
+
return value;
|
|
142
|
+
}
|
|
143
|
+
return void 0;
|
|
144
|
+
}
|
|
145
|
+
function readCount(block, key) {
|
|
146
|
+
const value = block[key];
|
|
147
|
+
if (typeof value !== "number" || !Number.isInteger(value) || value < 0)
|
|
148
|
+
return void 0;
|
|
149
|
+
return value;
|
|
97
150
|
}
|
|
98
151
|
function toolCallData(tool, input, response) {
|
|
99
152
|
return { kind: "tool_call", tool, input, response };
|
|
@@ -143,7 +196,7 @@ function claudeCodeExtractData(raw, logical) {
|
|
|
143
196
|
case "tool_call":
|
|
144
197
|
return toolCallData(pickString(raw, "tool_name", "tool"), nested(raw, "tool_input"), nested(raw, "tool_response"));
|
|
145
198
|
case "assistant_message":
|
|
146
|
-
return assistantMessageData(pickString(raw, "text", "message"));
|
|
199
|
+
return assistantMessageData(pickString(raw, "text", "message"), extractTurnUsage(raw));
|
|
147
200
|
case "session-end":
|
|
148
201
|
return sessionEndData(pickString(raw, "reason") || "Stop");
|
|
149
202
|
default:
|
|
@@ -92,8 +92,61 @@ function nestedString(raw, a, b) {
|
|
|
92
92
|
function userMessageData(text) {
|
|
93
93
|
return { kind: "user_message", text };
|
|
94
94
|
}
|
|
95
|
-
function assistantMessageData(text) {
|
|
96
|
-
|
|
95
|
+
function assistantMessageData(text, usage) {
|
|
96
|
+
const normalized = usage !== void 0 ? compactUsage(usage) : void 0;
|
|
97
|
+
return {
|
|
98
|
+
kind: "assistant_message",
|
|
99
|
+
text,
|
|
100
|
+
...normalized !== void 0 ? { usage: normalized } : {}
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
function compactUsage(usage) {
|
|
104
|
+
const out = {};
|
|
105
|
+
if (isCount(usage.input))
|
|
106
|
+
out.input = usage.input;
|
|
107
|
+
if (isCount(usage.output))
|
|
108
|
+
out.output = usage.output;
|
|
109
|
+
if (isCount(usage.cacheRead))
|
|
110
|
+
out.cacheRead = usage.cacheRead;
|
|
111
|
+
if (isCount(usage.cacheCreation))
|
|
112
|
+
out.cacheCreation = usage.cacheCreation;
|
|
113
|
+
return Object.keys(out).length > 0 ? out : void 0;
|
|
114
|
+
}
|
|
115
|
+
function isCount(n) {
|
|
116
|
+
return typeof n === "number" && Number.isInteger(n) && n >= 0;
|
|
117
|
+
}
|
|
118
|
+
function extractTurnUsage(raw) {
|
|
119
|
+
const block = usageBlock(raw);
|
|
120
|
+
if (block === void 0)
|
|
121
|
+
return void 0;
|
|
122
|
+
const usage = {
|
|
123
|
+
...readCount(block, "input_tokens") !== void 0 ? { input: readCount(block, "input_tokens") } : {},
|
|
124
|
+
...readCount(block, "output_tokens") !== void 0 ? { output: readCount(block, "output_tokens") } : {},
|
|
125
|
+
...readCount(block, "cache_read_input_tokens") !== void 0 ? { cacheRead: readCount(block, "cache_read_input_tokens") } : {},
|
|
126
|
+
...readCount(block, "cache_creation_input_tokens") !== void 0 ? { cacheCreation: readCount(block, "cache_creation_input_tokens") } : {}
|
|
127
|
+
};
|
|
128
|
+
return compactUsage(usage);
|
|
129
|
+
}
|
|
130
|
+
function usageBlock(raw) {
|
|
131
|
+
const top = nested(raw, "usage");
|
|
132
|
+
if (top !== null && typeof top === "object")
|
|
133
|
+
return top;
|
|
134
|
+
const inner = nestedRecord(nested(raw, "message"), "usage");
|
|
135
|
+
return inner;
|
|
136
|
+
}
|
|
137
|
+
function nestedRecord(obj, key) {
|
|
138
|
+
if (obj !== null && typeof obj === "object") {
|
|
139
|
+
const value = obj[key];
|
|
140
|
+
if (value !== null && typeof value === "object")
|
|
141
|
+
return value;
|
|
142
|
+
}
|
|
143
|
+
return void 0;
|
|
144
|
+
}
|
|
145
|
+
function readCount(block, key) {
|
|
146
|
+
const value = block[key];
|
|
147
|
+
if (typeof value !== "number" || !Number.isInteger(value) || value < 0)
|
|
148
|
+
return void 0;
|
|
149
|
+
return value;
|
|
97
150
|
}
|
|
98
151
|
function toolCallData(tool, input, response) {
|
|
99
152
|
return { kind: "tool_call", tool, input, response };
|
|
@@ -143,7 +196,7 @@ function claudeCodeExtractData(raw, logical) {
|
|
|
143
196
|
case "tool_call":
|
|
144
197
|
return toolCallData(pickString(raw, "tool_name", "tool"), nested(raw, "tool_input"), nested(raw, "tool_response"));
|
|
145
198
|
case "assistant_message":
|
|
146
|
-
return assistantMessageData(pickString(raw, "text", "message"));
|
|
199
|
+
return assistantMessageData(pickString(raw, "text", "message"), extractTurnUsage(raw));
|
|
147
200
|
case "session-end":
|
|
148
201
|
return sessionEndData(pickString(raw, "reason") || "Stop");
|
|
149
202
|
default:
|
|
@@ -92,8 +92,61 @@ function nestedString(raw, a, b) {
|
|
|
92
92
|
function userMessageData(text) {
|
|
93
93
|
return { kind: "user_message", text };
|
|
94
94
|
}
|
|
95
|
-
function assistantMessageData(text) {
|
|
96
|
-
|
|
95
|
+
function assistantMessageData(text, usage) {
|
|
96
|
+
const normalized = usage !== void 0 ? compactUsage(usage) : void 0;
|
|
97
|
+
return {
|
|
98
|
+
kind: "assistant_message",
|
|
99
|
+
text,
|
|
100
|
+
...normalized !== void 0 ? { usage: normalized } : {}
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
function compactUsage(usage) {
|
|
104
|
+
const out = {};
|
|
105
|
+
if (isCount(usage.input))
|
|
106
|
+
out.input = usage.input;
|
|
107
|
+
if (isCount(usage.output))
|
|
108
|
+
out.output = usage.output;
|
|
109
|
+
if (isCount(usage.cacheRead))
|
|
110
|
+
out.cacheRead = usage.cacheRead;
|
|
111
|
+
if (isCount(usage.cacheCreation))
|
|
112
|
+
out.cacheCreation = usage.cacheCreation;
|
|
113
|
+
return Object.keys(out).length > 0 ? out : void 0;
|
|
114
|
+
}
|
|
115
|
+
function isCount(n) {
|
|
116
|
+
return typeof n === "number" && Number.isInteger(n) && n >= 0;
|
|
117
|
+
}
|
|
118
|
+
function extractTurnUsage(raw) {
|
|
119
|
+
const block = usageBlock(raw);
|
|
120
|
+
if (block === void 0)
|
|
121
|
+
return void 0;
|
|
122
|
+
const usage = {
|
|
123
|
+
...readCount(block, "input_tokens") !== void 0 ? { input: readCount(block, "input_tokens") } : {},
|
|
124
|
+
...readCount(block, "output_tokens") !== void 0 ? { output: readCount(block, "output_tokens") } : {},
|
|
125
|
+
...readCount(block, "cache_read_input_tokens") !== void 0 ? { cacheRead: readCount(block, "cache_read_input_tokens") } : {},
|
|
126
|
+
...readCount(block, "cache_creation_input_tokens") !== void 0 ? { cacheCreation: readCount(block, "cache_creation_input_tokens") } : {}
|
|
127
|
+
};
|
|
128
|
+
return compactUsage(usage);
|
|
129
|
+
}
|
|
130
|
+
function usageBlock(raw) {
|
|
131
|
+
const top = nested(raw, "usage");
|
|
132
|
+
if (top !== null && typeof top === "object")
|
|
133
|
+
return top;
|
|
134
|
+
const inner = nestedRecord(nested(raw, "message"), "usage");
|
|
135
|
+
return inner;
|
|
136
|
+
}
|
|
137
|
+
function nestedRecord(obj, key) {
|
|
138
|
+
if (obj !== null && typeof obj === "object") {
|
|
139
|
+
const value = obj[key];
|
|
140
|
+
if (value !== null && typeof value === "object")
|
|
141
|
+
return value;
|
|
142
|
+
}
|
|
143
|
+
return void 0;
|
|
144
|
+
}
|
|
145
|
+
function readCount(block, key) {
|
|
146
|
+
const value = block[key];
|
|
147
|
+
if (typeof value !== "number" || !Number.isInteger(value) || value < 0)
|
|
148
|
+
return void 0;
|
|
149
|
+
return value;
|
|
97
150
|
}
|
|
98
151
|
function toolCallData(tool, input, response) {
|
|
99
152
|
return { kind: "tool_call", tool, input, response };
|
|
@@ -143,7 +196,7 @@ function claudeCodeExtractData(raw, logical) {
|
|
|
143
196
|
case "tool_call":
|
|
144
197
|
return toolCallData(pickString(raw, "tool_name", "tool"), nested(raw, "tool_input"), nested(raw, "tool_response"));
|
|
145
198
|
case "assistant_message":
|
|
146
|
-
return assistantMessageData(pickString(raw, "text", "message"));
|
|
199
|
+
return assistantMessageData(pickString(raw, "text", "message"), extractTurnUsage(raw));
|
|
147
200
|
case "session-end":
|
|
148
201
|
return sessionEndData(pickString(raw, "reason") || "Stop");
|
|
149
202
|
default:
|
|
@@ -92,8 +92,61 @@ function nestedString(raw, a, b) {
|
|
|
92
92
|
function userMessageData(text) {
|
|
93
93
|
return { kind: "user_message", text };
|
|
94
94
|
}
|
|
95
|
-
function assistantMessageData(text) {
|
|
96
|
-
|
|
95
|
+
function assistantMessageData(text, usage) {
|
|
96
|
+
const normalized = usage !== void 0 ? compactUsage(usage) : void 0;
|
|
97
|
+
return {
|
|
98
|
+
kind: "assistant_message",
|
|
99
|
+
text,
|
|
100
|
+
...normalized !== void 0 ? { usage: normalized } : {}
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
function compactUsage(usage) {
|
|
104
|
+
const out = {};
|
|
105
|
+
if (isCount(usage.input))
|
|
106
|
+
out.input = usage.input;
|
|
107
|
+
if (isCount(usage.output))
|
|
108
|
+
out.output = usage.output;
|
|
109
|
+
if (isCount(usage.cacheRead))
|
|
110
|
+
out.cacheRead = usage.cacheRead;
|
|
111
|
+
if (isCount(usage.cacheCreation))
|
|
112
|
+
out.cacheCreation = usage.cacheCreation;
|
|
113
|
+
return Object.keys(out).length > 0 ? out : void 0;
|
|
114
|
+
}
|
|
115
|
+
function isCount(n) {
|
|
116
|
+
return typeof n === "number" && Number.isInteger(n) && n >= 0;
|
|
117
|
+
}
|
|
118
|
+
function extractTurnUsage(raw) {
|
|
119
|
+
const block = usageBlock(raw);
|
|
120
|
+
if (block === void 0)
|
|
121
|
+
return void 0;
|
|
122
|
+
const usage = {
|
|
123
|
+
...readCount(block, "input_tokens") !== void 0 ? { input: readCount(block, "input_tokens") } : {},
|
|
124
|
+
...readCount(block, "output_tokens") !== void 0 ? { output: readCount(block, "output_tokens") } : {},
|
|
125
|
+
...readCount(block, "cache_read_input_tokens") !== void 0 ? { cacheRead: readCount(block, "cache_read_input_tokens") } : {},
|
|
126
|
+
...readCount(block, "cache_creation_input_tokens") !== void 0 ? { cacheCreation: readCount(block, "cache_creation_input_tokens") } : {}
|
|
127
|
+
};
|
|
128
|
+
return compactUsage(usage);
|
|
129
|
+
}
|
|
130
|
+
function usageBlock(raw) {
|
|
131
|
+
const top = nested(raw, "usage");
|
|
132
|
+
if (top !== null && typeof top === "object")
|
|
133
|
+
return top;
|
|
134
|
+
const inner = nestedRecord(nested(raw, "message"), "usage");
|
|
135
|
+
return inner;
|
|
136
|
+
}
|
|
137
|
+
function nestedRecord(obj, key) {
|
|
138
|
+
if (obj !== null && typeof obj === "object") {
|
|
139
|
+
const value = obj[key];
|
|
140
|
+
if (value !== null && typeof value === "object")
|
|
141
|
+
return value;
|
|
142
|
+
}
|
|
143
|
+
return void 0;
|
|
144
|
+
}
|
|
145
|
+
function readCount(block, key) {
|
|
146
|
+
const value = block[key];
|
|
147
|
+
if (typeof value !== "number" || !Number.isInteger(value) || value < 0)
|
|
148
|
+
return void 0;
|
|
149
|
+
return value;
|
|
97
150
|
}
|
|
98
151
|
function toolCallData(tool, input, response) {
|
|
99
152
|
return { kind: "tool_call", tool, input, response };
|
|
@@ -143,7 +196,7 @@ function claudeCodeExtractData(raw, logical) {
|
|
|
143
196
|
case "tool_call":
|
|
144
197
|
return toolCallData(pickString(raw, "tool_name", "tool"), nested(raw, "tool_input"), nested(raw, "tool_response"));
|
|
145
198
|
case "assistant_message":
|
|
146
|
-
return assistantMessageData(pickString(raw, "text", "message"));
|
|
199
|
+
return assistantMessageData(pickString(raw, "text", "message"), extractTurnUsage(raw));
|
|
147
200
|
case "session-end":
|
|
148
201
|
return sessionEndData(pickString(raw, "reason") || "Stop");
|
|
149
202
|
default:
|
|
@@ -92,8 +92,61 @@ function nestedString(raw, a, b) {
|
|
|
92
92
|
function userMessageData(text) {
|
|
93
93
|
return { kind: "user_message", text };
|
|
94
94
|
}
|
|
95
|
-
function assistantMessageData(text) {
|
|
96
|
-
|
|
95
|
+
function assistantMessageData(text, usage) {
|
|
96
|
+
const normalized = usage !== void 0 ? compactUsage(usage) : void 0;
|
|
97
|
+
return {
|
|
98
|
+
kind: "assistant_message",
|
|
99
|
+
text,
|
|
100
|
+
...normalized !== void 0 ? { usage: normalized } : {}
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
function compactUsage(usage) {
|
|
104
|
+
const out = {};
|
|
105
|
+
if (isCount(usage.input))
|
|
106
|
+
out.input = usage.input;
|
|
107
|
+
if (isCount(usage.output))
|
|
108
|
+
out.output = usage.output;
|
|
109
|
+
if (isCount(usage.cacheRead))
|
|
110
|
+
out.cacheRead = usage.cacheRead;
|
|
111
|
+
if (isCount(usage.cacheCreation))
|
|
112
|
+
out.cacheCreation = usage.cacheCreation;
|
|
113
|
+
return Object.keys(out).length > 0 ? out : void 0;
|
|
114
|
+
}
|
|
115
|
+
function isCount(n) {
|
|
116
|
+
return typeof n === "number" && Number.isInteger(n) && n >= 0;
|
|
117
|
+
}
|
|
118
|
+
function extractTurnUsage(raw) {
|
|
119
|
+
const block = usageBlock(raw);
|
|
120
|
+
if (block === void 0)
|
|
121
|
+
return void 0;
|
|
122
|
+
const usage = {
|
|
123
|
+
...readCount(block, "input_tokens") !== void 0 ? { input: readCount(block, "input_tokens") } : {},
|
|
124
|
+
...readCount(block, "output_tokens") !== void 0 ? { output: readCount(block, "output_tokens") } : {},
|
|
125
|
+
...readCount(block, "cache_read_input_tokens") !== void 0 ? { cacheRead: readCount(block, "cache_read_input_tokens") } : {},
|
|
126
|
+
...readCount(block, "cache_creation_input_tokens") !== void 0 ? { cacheCreation: readCount(block, "cache_creation_input_tokens") } : {}
|
|
127
|
+
};
|
|
128
|
+
return compactUsage(usage);
|
|
129
|
+
}
|
|
130
|
+
function usageBlock(raw) {
|
|
131
|
+
const top = nested(raw, "usage");
|
|
132
|
+
if (top !== null && typeof top === "object")
|
|
133
|
+
return top;
|
|
134
|
+
const inner = nestedRecord(nested(raw, "message"), "usage");
|
|
135
|
+
return inner;
|
|
136
|
+
}
|
|
137
|
+
function nestedRecord(obj, key) {
|
|
138
|
+
if (obj !== null && typeof obj === "object") {
|
|
139
|
+
const value = obj[key];
|
|
140
|
+
if (value !== null && typeof value === "object")
|
|
141
|
+
return value;
|
|
142
|
+
}
|
|
143
|
+
return void 0;
|
|
144
|
+
}
|
|
145
|
+
function readCount(block, key) {
|
|
146
|
+
const value = block[key];
|
|
147
|
+
if (typeof value !== "number" || !Number.isInteger(value) || value < 0)
|
|
148
|
+
return void 0;
|
|
149
|
+
return value;
|
|
97
150
|
}
|
|
98
151
|
function toolCallData(tool, input, response) {
|
|
99
152
|
return { kind: "tool_call", tool, input, response };
|
|
@@ -143,7 +196,7 @@ function claudeCodeExtractData(raw, logical) {
|
|
|
143
196
|
case "tool_call":
|
|
144
197
|
return toolCallData(pickString(raw, "tool_name", "tool"), nested(raw, "tool_input"), nested(raw, "tool_response"));
|
|
145
198
|
case "assistant_message":
|
|
146
|
-
return assistantMessageData(pickString(raw, "text", "message"));
|
|
199
|
+
return assistantMessageData(pickString(raw, "text", "message"), extractTurnUsage(raw));
|
|
147
200
|
case "session-end":
|
|
148
201
|
return sessionEndData(pickString(raw, "reason") || "Stop");
|
|
149
202
|
default:
|
|
@@ -83,8 +83,28 @@ function nested(raw, key) {
|
|
|
83
83
|
function userMessageData(text) {
|
|
84
84
|
return { kind: "user_message", text };
|
|
85
85
|
}
|
|
86
|
-
function assistantMessageData(text) {
|
|
87
|
-
|
|
86
|
+
function assistantMessageData(text, usage) {
|
|
87
|
+
const normalized = usage !== void 0 ? compactUsage(usage) : void 0;
|
|
88
|
+
return {
|
|
89
|
+
kind: "assistant_message",
|
|
90
|
+
text,
|
|
91
|
+
...normalized !== void 0 ? { usage: normalized } : {}
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
function compactUsage(usage) {
|
|
95
|
+
const out = {};
|
|
96
|
+
if (isCount(usage.input))
|
|
97
|
+
out.input = usage.input;
|
|
98
|
+
if (isCount(usage.output))
|
|
99
|
+
out.output = usage.output;
|
|
100
|
+
if (isCount(usage.cacheRead))
|
|
101
|
+
out.cacheRead = usage.cacheRead;
|
|
102
|
+
if (isCount(usage.cacheCreation))
|
|
103
|
+
out.cacheCreation = usage.cacheCreation;
|
|
104
|
+
return Object.keys(out).length > 0 ? out : void 0;
|
|
105
|
+
}
|
|
106
|
+
function isCount(n) {
|
|
107
|
+
return typeof n === "number" && Number.isInteger(n) && n >= 0;
|
|
88
108
|
}
|
|
89
109
|
function toolCallData(tool, input, response) {
|
|
90
110
|
return { kind: "tool_call", tool, input, response };
|
|
@@ -83,8 +83,28 @@ function nested(raw, key) {
|
|
|
83
83
|
function userMessageData(text) {
|
|
84
84
|
return { kind: "user_message", text };
|
|
85
85
|
}
|
|
86
|
-
function assistantMessageData(text) {
|
|
87
|
-
|
|
86
|
+
function assistantMessageData(text, usage) {
|
|
87
|
+
const normalized = usage !== void 0 ? compactUsage(usage) : void 0;
|
|
88
|
+
return {
|
|
89
|
+
kind: "assistant_message",
|
|
90
|
+
text,
|
|
91
|
+
...normalized !== void 0 ? { usage: normalized } : {}
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
function compactUsage(usage) {
|
|
95
|
+
const out = {};
|
|
96
|
+
if (isCount(usage.input))
|
|
97
|
+
out.input = usage.input;
|
|
98
|
+
if (isCount(usage.output))
|
|
99
|
+
out.output = usage.output;
|
|
100
|
+
if (isCount(usage.cacheRead))
|
|
101
|
+
out.cacheRead = usage.cacheRead;
|
|
102
|
+
if (isCount(usage.cacheCreation))
|
|
103
|
+
out.cacheCreation = usage.cacheCreation;
|
|
104
|
+
return Object.keys(out).length > 0 ? out : void 0;
|
|
105
|
+
}
|
|
106
|
+
function isCount(n) {
|
|
107
|
+
return typeof n === "number" && Number.isInteger(n) && n >= 0;
|
|
88
108
|
}
|
|
89
109
|
function toolCallData(tool, input, response) {
|
|
90
110
|
return { kind: "tool_call", tool, input, response };
|
|
@@ -83,8 +83,28 @@ function nested(raw, key) {
|
|
|
83
83
|
function userMessageData(text) {
|
|
84
84
|
return { kind: "user_message", text };
|
|
85
85
|
}
|
|
86
|
-
function assistantMessageData(text) {
|
|
87
|
-
|
|
86
|
+
function assistantMessageData(text, usage) {
|
|
87
|
+
const normalized = usage !== void 0 ? compactUsage(usage) : void 0;
|
|
88
|
+
return {
|
|
89
|
+
kind: "assistant_message",
|
|
90
|
+
text,
|
|
91
|
+
...normalized !== void 0 ? { usage: normalized } : {}
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
function compactUsage(usage) {
|
|
95
|
+
const out = {};
|
|
96
|
+
if (isCount(usage.input))
|
|
97
|
+
out.input = usage.input;
|
|
98
|
+
if (isCount(usage.output))
|
|
99
|
+
out.output = usage.output;
|
|
100
|
+
if (isCount(usage.cacheRead))
|
|
101
|
+
out.cacheRead = usage.cacheRead;
|
|
102
|
+
if (isCount(usage.cacheCreation))
|
|
103
|
+
out.cacheCreation = usage.cacheCreation;
|
|
104
|
+
return Object.keys(out).length > 0 ? out : void 0;
|
|
105
|
+
}
|
|
106
|
+
function isCount(n) {
|
|
107
|
+
return typeof n === "number" && Number.isInteger(n) && n >= 0;
|
|
88
108
|
}
|
|
89
109
|
function toolCallData(tool, input, response) {
|
|
90
110
|
return { kind: "tool_call", tool, input, response };
|
|
@@ -83,8 +83,28 @@ function nested(raw, key) {
|
|
|
83
83
|
function userMessageData(text) {
|
|
84
84
|
return { kind: "user_message", text };
|
|
85
85
|
}
|
|
86
|
-
function assistantMessageData(text) {
|
|
87
|
-
|
|
86
|
+
function assistantMessageData(text, usage) {
|
|
87
|
+
const normalized = usage !== void 0 ? compactUsage(usage) : void 0;
|
|
88
|
+
return {
|
|
89
|
+
kind: "assistant_message",
|
|
90
|
+
text,
|
|
91
|
+
...normalized !== void 0 ? { usage: normalized } : {}
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
function compactUsage(usage) {
|
|
95
|
+
const out = {};
|
|
96
|
+
if (isCount(usage.input))
|
|
97
|
+
out.input = usage.input;
|
|
98
|
+
if (isCount(usage.output))
|
|
99
|
+
out.output = usage.output;
|
|
100
|
+
if (isCount(usage.cacheRead))
|
|
101
|
+
out.cacheRead = usage.cacheRead;
|
|
102
|
+
if (isCount(usage.cacheCreation))
|
|
103
|
+
out.cacheCreation = usage.cacheCreation;
|
|
104
|
+
return Object.keys(out).length > 0 ? out : void 0;
|
|
105
|
+
}
|
|
106
|
+
function isCount(n) {
|
|
107
|
+
return typeof n === "number" && Number.isInteger(n) && n >= 0;
|
|
88
108
|
}
|
|
89
109
|
function toolCallData(tool, input, response) {
|
|
90
110
|
return { kind: "tool_call", tool, input, response };
|
|
@@ -83,8 +83,28 @@ function nested(raw, key) {
|
|
|
83
83
|
function userMessageData(text) {
|
|
84
84
|
return { kind: "user_message", text };
|
|
85
85
|
}
|
|
86
|
-
function assistantMessageData(text) {
|
|
87
|
-
|
|
86
|
+
function assistantMessageData(text, usage) {
|
|
87
|
+
const normalized = usage !== void 0 ? compactUsage(usage) : void 0;
|
|
88
|
+
return {
|
|
89
|
+
kind: "assistant_message",
|
|
90
|
+
text,
|
|
91
|
+
...normalized !== void 0 ? { usage: normalized } : {}
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
function compactUsage(usage) {
|
|
95
|
+
const out = {};
|
|
96
|
+
if (isCount(usage.input))
|
|
97
|
+
out.input = usage.input;
|
|
98
|
+
if (isCount(usage.output))
|
|
99
|
+
out.output = usage.output;
|
|
100
|
+
if (isCount(usage.cacheRead))
|
|
101
|
+
out.cacheRead = usage.cacheRead;
|
|
102
|
+
if (isCount(usage.cacheCreation))
|
|
103
|
+
out.cacheCreation = usage.cacheCreation;
|
|
104
|
+
return Object.keys(out).length > 0 ? out : void 0;
|
|
105
|
+
}
|
|
106
|
+
function isCount(n) {
|
|
107
|
+
return typeof n === "number" && Number.isInteger(n) && n >= 0;
|
|
88
108
|
}
|
|
89
109
|
function toolCallData(tool, input, response) {
|
|
90
110
|
return { kind: "tool_call", tool, input, response };
|
|
@@ -83,8 +83,28 @@ function nested(raw, key) {
|
|
|
83
83
|
function userMessageData(text) {
|
|
84
84
|
return { kind: "user_message", text };
|
|
85
85
|
}
|
|
86
|
-
function assistantMessageData(text) {
|
|
87
|
-
|
|
86
|
+
function assistantMessageData(text, usage) {
|
|
87
|
+
const normalized = usage !== void 0 ? compactUsage(usage) : void 0;
|
|
88
|
+
return {
|
|
89
|
+
kind: "assistant_message",
|
|
90
|
+
text,
|
|
91
|
+
...normalized !== void 0 ? { usage: normalized } : {}
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
function compactUsage(usage) {
|
|
95
|
+
const out = {};
|
|
96
|
+
if (isCount(usage.input))
|
|
97
|
+
out.input = usage.input;
|
|
98
|
+
if (isCount(usage.output))
|
|
99
|
+
out.output = usage.output;
|
|
100
|
+
if (isCount(usage.cacheRead))
|
|
101
|
+
out.cacheRead = usage.cacheRead;
|
|
102
|
+
if (isCount(usage.cacheCreation))
|
|
103
|
+
out.cacheCreation = usage.cacheCreation;
|
|
104
|
+
return Object.keys(out).length > 0 ? out : void 0;
|
|
105
|
+
}
|
|
106
|
+
function isCount(n) {
|
|
107
|
+
return typeof n === "number" && Number.isInteger(n) && n >= 0;
|
|
88
108
|
}
|
|
89
109
|
function toolCallData(tool, input, response) {
|
|
90
110
|
return { kind: "tool_call", tool, input, response };
|
|
@@ -83,8 +83,28 @@ function nested(raw, key) {
|
|
|
83
83
|
function userMessageData(text) {
|
|
84
84
|
return { kind: "user_message", text };
|
|
85
85
|
}
|
|
86
|
-
function assistantMessageData(text) {
|
|
87
|
-
|
|
86
|
+
function assistantMessageData(text, usage) {
|
|
87
|
+
const normalized = usage !== void 0 ? compactUsage(usage) : void 0;
|
|
88
|
+
return {
|
|
89
|
+
kind: "assistant_message",
|
|
90
|
+
text,
|
|
91
|
+
...normalized !== void 0 ? { usage: normalized } : {}
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
function compactUsage(usage) {
|
|
95
|
+
const out = {};
|
|
96
|
+
if (isCount(usage.input))
|
|
97
|
+
out.input = usage.input;
|
|
98
|
+
if (isCount(usage.output))
|
|
99
|
+
out.output = usage.output;
|
|
100
|
+
if (isCount(usage.cacheRead))
|
|
101
|
+
out.cacheRead = usage.cacheRead;
|
|
102
|
+
if (isCount(usage.cacheCreation))
|
|
103
|
+
out.cacheCreation = usage.cacheCreation;
|
|
104
|
+
return Object.keys(out).length > 0 ? out : void 0;
|
|
105
|
+
}
|
|
106
|
+
function isCount(n) {
|
|
107
|
+
return typeof n === "number" && Number.isInteger(n) && n >= 0;
|
|
88
108
|
}
|
|
89
109
|
function toolCallData(tool, input, response) {
|
|
90
110
|
return { kind: "tool_call", tool, input, response };
|
|
@@ -83,8 +83,28 @@ function nested(raw, key) {
|
|
|
83
83
|
function userMessageData(text) {
|
|
84
84
|
return { kind: "user_message", text };
|
|
85
85
|
}
|
|
86
|
-
function assistantMessageData(text) {
|
|
87
|
-
|
|
86
|
+
function assistantMessageData(text, usage) {
|
|
87
|
+
const normalized = usage !== void 0 ? compactUsage(usage) : void 0;
|
|
88
|
+
return {
|
|
89
|
+
kind: "assistant_message",
|
|
90
|
+
text,
|
|
91
|
+
...normalized !== void 0 ? { usage: normalized } : {}
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
function compactUsage(usage) {
|
|
95
|
+
const out = {};
|
|
96
|
+
if (isCount(usage.input))
|
|
97
|
+
out.input = usage.input;
|
|
98
|
+
if (isCount(usage.output))
|
|
99
|
+
out.output = usage.output;
|
|
100
|
+
if (isCount(usage.cacheRead))
|
|
101
|
+
out.cacheRead = usage.cacheRead;
|
|
102
|
+
if (isCount(usage.cacheCreation))
|
|
103
|
+
out.cacheCreation = usage.cacheCreation;
|
|
104
|
+
return Object.keys(out).length > 0 ? out : void 0;
|
|
105
|
+
}
|
|
106
|
+
function isCount(n) {
|
|
107
|
+
return typeof n === "number" && Number.isInteger(n) && n >= 0;
|
|
88
108
|
}
|
|
89
109
|
function toolCallData(tool, input, response) {
|
|
90
110
|
return { kind: "tool_call", tool, input, response };
|