@probelabs/probe-chat 0.6.0-rc175 → 0.6.0-rc176

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/appTracer.js +21 -0
  2. package/package.json +1 -1
package/appTracer.js CHANGED
@@ -895,6 +895,27 @@ class AppTracer {
895
895
  return span;
896
896
  }
897
897
 
898
+ /**
899
+ * Record a generic event (used by completionPrompt and other features)
900
+ * This provides compatibility with SimpleAppTracer interface
901
+ * Adds an event to the existing session span rather than creating a new span
902
+ */
903
+ // visor-disable: Events are added to existing spans per OpenTelemetry convention - recordEvent semantically means adding an event, not creating a span. Both SimpleAppTracer and AppTracer now consistently add events.
904
+ recordEvent(name, attributes = {}) {
905
+ const sessionId = attributes['session.id'] || 'unknown';
906
+ const sessionSpan = this.sessionSpans.get(sessionId);
907
+
908
+ if (sessionSpan) {
909
+ // Add event to the existing session span
910
+ sessionSpan.addEvent(name, {
911
+ 'app.event.timestamp': Date.now(),
912
+ ...attributes
913
+ });
914
+ } else if (process.env.DEBUG_CHAT === '1') {
915
+ console.log(`[DEBUG] AppTracer: recordEvent called but no session span for ${sessionId}`);
916
+ }
917
+ }
918
+
898
919
  /**
899
920
  * Clean up any remaining active spans for a session
900
921
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@probelabs/probe-chat",
3
- "version": "0.6.0-rc175",
3
+ "version": "0.6.0-rc176",
4
4
  "description": "CLI and web interface for Probe code search (formerly @probelabs/probe-web and @probelabs/probe-chat)",
5
5
  "main": "index.js",
6
6
  "type": "module",