@dropout-ai/runtime 0.2.1 → 0.2.2
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/package.json +1 -1
- package/src/index.js +9 -1
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
|
+
import crypto from "crypto";
|
|
2
|
+
|
|
1
3
|
const originalFetch = global.fetch;
|
|
2
4
|
|
|
5
|
+
|
|
6
|
+
const sessionId =
|
|
7
|
+
global.__dropout_session_id__ ||
|
|
8
|
+
(global.__dropout_session_id__ = crypto.randomUUID());
|
|
9
|
+
|
|
3
10
|
// 4. Internal telemetry sender (Neutral naming)
|
|
4
11
|
async function safeSendTelemetry(payload) {
|
|
5
12
|
try {
|
|
@@ -120,7 +127,8 @@ async function safeSendTelemetry(payload) {
|
|
|
120
127
|
prompt,
|
|
121
128
|
output,
|
|
122
129
|
latency_ms: latency,
|
|
123
|
-
timestamp: Math.floor(Date.now() / 1000)
|
|
130
|
+
timestamp: Math.floor(Date.now() / 1000),
|
|
131
|
+
session_id: sessionId
|
|
124
132
|
};
|
|
125
133
|
|
|
126
134
|
// 9. Fire-and-forget
|