@ydking0911/observr 0.4.8 → 0.5.0

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/dist/index.d.mts CHANGED
@@ -60,6 +60,22 @@ declare class ObservrClient {
60
60
  start(): void;
61
61
  /** Wrap an async function in a named span. */
62
62
  span(name: string, attributes?: Record<string, unknown>): Span;
63
+ /**
64
+ * Span for agent actions with standard attribute keys.
65
+ *
66
+ * Standard keys (omitted when undefined):
67
+ * agent.intent — goal the agent is working toward
68
+ * agent.trigger — what caused this action (user_message | tool_result | <span_id>)
69
+ * agent.model — LLM that made the decision
70
+ * agent.tool — tool being invoked
71
+ */
72
+ agentSpan(name: string, options?: {
73
+ intent?: string;
74
+ trigger?: string;
75
+ model?: string;
76
+ tool?: string;
77
+ [key: string]: unknown;
78
+ }): Span;
63
79
  shutdown(): Promise<void>;
64
80
  private _autoInstrument;
65
81
  private _instrumentExpress;
package/dist/index.d.ts CHANGED
@@ -60,6 +60,22 @@ declare class ObservrClient {
60
60
  start(): void;
61
61
  /** Wrap an async function in a named span. */
62
62
  span(name: string, attributes?: Record<string, unknown>): Span;
63
+ /**
64
+ * Span for agent actions with standard attribute keys.
65
+ *
66
+ * Standard keys (omitted when undefined):
67
+ * agent.intent — goal the agent is working toward
68
+ * agent.trigger — what caused this action (user_message | tool_result | <span_id>)
69
+ * agent.model — LLM that made the decision
70
+ * agent.tool — tool being invoked
71
+ */
72
+ agentSpan(name: string, options?: {
73
+ intent?: string;
74
+ trigger?: string;
75
+ model?: string;
76
+ tool?: string;
77
+ [key: string]: unknown;
78
+ }): Span;
63
79
  shutdown(): Promise<void>;
64
80
  private _autoInstrument;
65
81
  private _instrumentExpress;
package/dist/index.js CHANGED
@@ -366,6 +366,24 @@ var ObservrClient = class {
366
366
  span(name, attributes = {}) {
367
367
  return new Span(name, this.transport, attributes);
368
368
  }
369
+ /**
370
+ * Span for agent actions with standard attribute keys.
371
+ *
372
+ * Standard keys (omitted when undefined):
373
+ * agent.intent — goal the agent is working toward
374
+ * agent.trigger — what caused this action (user_message | tool_result | <span_id>)
375
+ * agent.model — LLM that made the decision
376
+ * agent.tool — tool being invoked
377
+ */
378
+ agentSpan(name, options = {}) {
379
+ const { intent, trigger, model, tool, ...extra } = options;
380
+ const attributes = { ...extra };
381
+ if (intent !== void 0) attributes["agent.intent"] = intent;
382
+ if (trigger !== void 0) attributes["agent.trigger"] = trigger;
383
+ if (model !== void 0) attributes["agent.model"] = model;
384
+ if (tool !== void 0) attributes["agent.tool"] = tool;
385
+ return new Span(name, this.transport, attributes);
386
+ }
369
387
  async shutdown() {
370
388
  unpatchConsole();
371
389
  await this.transport.shutdown();
package/dist/index.mjs CHANGED
@@ -345,6 +345,24 @@ var ObservrClient = class {
345
345
  span(name, attributes = {}) {
346
346
  return new Span(name, this.transport, attributes);
347
347
  }
348
+ /**
349
+ * Span for agent actions with standard attribute keys.
350
+ *
351
+ * Standard keys (omitted when undefined):
352
+ * agent.intent — goal the agent is working toward
353
+ * agent.trigger — what caused this action (user_message | tool_result | <span_id>)
354
+ * agent.model — LLM that made the decision
355
+ * agent.tool — tool being invoked
356
+ */
357
+ agentSpan(name, options = {}) {
358
+ const { intent, trigger, model, tool, ...extra } = options;
359
+ const attributes = { ...extra };
360
+ if (intent !== void 0) attributes["agent.intent"] = intent;
361
+ if (trigger !== void 0) attributes["agent.trigger"] = trigger;
362
+ if (model !== void 0) attributes["agent.model"] = model;
363
+ if (tool !== void 0) attributes["agent.tool"] = tool;
364
+ return new Span(name, this.transport, attributes);
365
+ }
348
366
  async shutdown() {
349
367
  unpatchConsole();
350
368
  await this.transport.shutdown();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ydking0911/observr",
3
- "version": "0.4.8",
3
+ "version": "0.5.0",
4
4
  "description": "Zero-config observability for AI agents and developers",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",