@dropout-ai/runtime 0.2.13 → 0.2.14

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +7 -18
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dropout-ai/runtime",
3
- "version": "0.2.13",
3
+ "version": "0.2.14",
4
4
  "description": "Invisible Node.js runtime for capturing AI interactions.",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
package/src/index.js CHANGED
@@ -8,7 +8,6 @@
8
8
  const crypto = require('crypto');
9
9
 
10
10
  // --- CONFIGURATION ---
11
- // Public ingestion endpoint (No keys required)
12
11
  const SUPABASE_FUNCTION_URL = "https://hipughmjlwmwjxzyxfzs.supabase.co/functions/v1/capture-sealed";
13
12
 
14
13
  // --- Identity & State ---
@@ -37,13 +36,10 @@ let config = {
37
36
  privacyMode: (typeof process !== 'undefined' && process.env.DROPOUT_PRIVACY_MODE) || 'full'
38
37
  };
39
38
 
40
- console.log("[Dropout Debug] Runtime Initializing...");
41
- console.log("[Dropout Debug] Session ID:", GLOBAL_OBJ.__dropout_session_id__ || "Not set");
42
39
  /**
43
40
  * Telemetry Emitter (Non-blocking, Fire-and-forget)
44
41
  */
45
42
  function emit(payload) {
46
- console.log("[Dropout Debug] emit() called with payload:", JSON.stringify(payload).slice(0, 100) + "...");
47
43
  const fetchFn = GLOBAL_OBJ.__dropout_original_fetch__ || GLOBAL_OBJ.fetch;
48
44
  if (typeof fetchFn !== 'function') return;
49
45
 
@@ -52,19 +48,10 @@ function emit(payload) {
52
48
  method: 'POST',
53
49
  headers: {
54
50
  'Content-Type': 'application/json'
55
- // No Authorization header needed since Enforce JWT is OFF
56
51
  },
57
52
  body: JSON.stringify(payload),
58
53
  keepalive: true
59
- }).then(res => {
60
- console.log(`[Dropout Debug] Supabase Response: ${res.status} ${res.statusText}`);
61
- if (!res.ok) {
62
- res.text().then(t => console.error("[Dropout Debug] Error Body:", t));
63
- }
64
- }).catch(() => {
65
- // Silent fail (Fire & Forget) to ensure no impact on host app
66
- console.error("[Dropout Debug] NETWORK ERROR:", err);
67
- });
54
+ }).catch(() => { });
68
55
  }, 0);
69
56
  }
70
57
 
@@ -188,7 +175,8 @@ if (typeof GLOBAL_OBJ.fetch === 'function' && !GLOBAL_OBJ.fetch.__dropout_patche
188
175
  turn_role: 'user',
189
176
  provider,
190
177
  model,
191
- content_raw: config.privacyMode === 'full' ? pText : null,
178
+ // FIX: Renamed 'content_raw' to 'content' to match Supabase expectations
179
+ content: config.privacyMode === 'full' ? pText : null,
192
180
  content_hash: pHash,
193
181
  metadata_flags: {
194
182
  retry_like: isRetry ? 1 : 0
@@ -229,7 +217,8 @@ if (typeof GLOBAL_OBJ.fetch === 'function' && !GLOBAL_OBJ.fetch.__dropout_patche
229
217
  latency_ms: latency,
230
218
  provider,
231
219
  model,
232
- content_raw: config.privacyMode === 'full' ? oText : null,
220
+ // FIX: Renamed 'content_raw' to 'content'
221
+ content: config.privacyMode === 'full' ? oText : null,
233
222
  content_hash: oHash,
234
223
  metadata_flags: {
235
224
  non_adaptive_response: isNonAdaptive ? 1 : 0,
@@ -286,7 +275,7 @@ async function capture(target, options = {}) {
286
275
  turn_role: 'user',
287
276
  provider: options.provider || 'manual',
288
277
  model: options.model || 'unknown',
289
- content_raw: mode === 'full' ? prompt : null,
278
+ content: mode === 'full' ? prompt : null, // FIX: content_raw -> content
290
279
  content_hash: pHash,
291
280
  metadata_flags: { retry_like: pHash === lastPromptHash ? 1 : 0 }
292
281
  });
@@ -300,7 +289,7 @@ async function capture(target, options = {}) {
300
289
  latency_ms,
301
290
  provider: options.provider || 'manual',
302
291
  model: options.model || 'unknown',
303
- content_raw: mode === 'full' ? output : null,
292
+ content: mode === 'full' ? output : null, // FIX: content_raw -> content
304
293
  content_hash: oHash,
305
294
  metadata_flags: { non_adaptive_response: oHash === lastResponseHash ? 1 : 0, turn_boundary_confirmed: 1 }
306
295
  });