@probelabs/probe 0.6.0-rc312 → 0.6.0-rc313

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.
@@ -244,10 +244,28 @@ var SimpleTelemetry = class {
244
244
  }
245
245
  }
246
246
  };
247
- var SimpleAppTracer = class {
248
- constructor(telemetry, sessionId = null) {
247
+ var SimpleAppTracer = class _SimpleAppTracer {
248
+ constructor(telemetry, sessionId = null, options = {}) {
249
249
  this.telemetry = telemetry;
250
250
  this.sessionId = sessionId || this.generateSessionId();
251
+ this.parentSessionId = options.parentSessionId || null;
252
+ this.rootSessionId = options.rootSessionId || this.sessionId;
253
+ this.agentKind = options.agentKind || "main";
254
+ }
255
+ /**
256
+ * Create a child tracer for a delegated subagent.
257
+ * Inherits the same telemetry backend but scopes events to the child session.
258
+ * @param {string} childSessionId - The subagent's session ID
259
+ * @param {Object} [options] - Additional options
260
+ * @param {string} [options.agentKind='delegate'] - Kind of child agent
261
+ * @returns {SimpleAppTracer} A new tracer scoped to the child session
262
+ */
263
+ createChildTracer(childSessionId, options = {}) {
264
+ return new _SimpleAppTracer(this.telemetry, childSessionId, {
265
+ parentSessionId: this.sessionId,
266
+ rootSessionId: this.rootSessionId,
267
+ agentKind: options.agentKind || "delegate"
268
+ });
251
269
  }
252
270
  generateSessionId() {
253
271
  return Math.random().toString(36).substring(2, 15);