@pentatonic-ai/ai-agent-sdk 0.10.0 → 0.10.1

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.cjs CHANGED
@@ -878,7 +878,7 @@ function fireAndForgetEmit(clientConfig, sessionOpts, messages, result, model) {
878
878
  }
879
879
 
880
880
  // src/telemetry.js
881
- var VERSION = "0.10.0";
881
+ var VERSION = "0.10.1";
882
882
  var TELEMETRY_URL = "https://sdk-telemetry.philip-134.workers.dev";
883
883
  function machineId() {
884
884
  const raw = typeof process !== "undefined" ? `${process.env?.USER || process.env?.USERNAME || "u"}:${process.platform || "x"}:${process.arch || "x"}` : "browser";
package/dist/index.js CHANGED
@@ -847,7 +847,7 @@ function fireAndForgetEmit(clientConfig, sessionOpts, messages, result, model) {
847
847
  }
848
848
 
849
849
  // src/telemetry.js
850
- var VERSION = "0.10.0";
850
+ var VERSION = "0.10.1";
851
851
  var TELEMETRY_URL = "https://sdk-telemetry.philip-134.workers.dev";
852
852
  function machineId() {
853
853
  const raw = typeof process !== "undefined" ? `${process.env?.USER || process.env?.USERNAME || "u"}:${process.platform || "x"}:${process.arch || "x"}` : "browser";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pentatonic-ai/ai-agent-sdk",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
4
4
  "description": "TES SDK — LLM observability and lifecycle tracking via Pentatonic Thing Event System. Track token usage, tool calls, and conversations. Manage things through event-sourced lifecycle stages with AI enrichment and vector search.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -496,6 +496,16 @@ def upsert_relationships(
496
496
  # env so we can revisit per-source value over time.
497
497
  #
498
498
  # Skip rules:
499
+ # - source_kind == 'agent'. These events are an AGENT'S OWN output — a
500
+ # coding-assistant transcript, an orchestrator/triage run, a briefing the
501
+ # agent wrote. Distilling them turns the assistant's chatter into "facts"
502
+ # ("the user wants a summary", "PR #228 merged", "high priority"), which
503
+ # then pollute every per-user/tenant arena the agent later READS — a
504
+ # feedback loop (live evidence 2026-06-02: a Claude-Code SDK that writes
505
+ # its transcript back into memory surfaced its own messages as graph
506
+ # facts). Agent output is not knowledge ABOUT the world; never distil it.
507
+ # This is by source_kind (not an enumerated source list) so any new agent
508
+ # producer is covered automatically. Tunable off via env for back-compat.
499
509
  # - source attribute matches a known code-only ingest (pip-code-ingest
500
510
  # and friends). Code chunks generate noisy entities — class names,
501
511
  # file paths, variables — that pollute the graph and don't surface
@@ -503,6 +513,9 @@ def upsert_relationships(
503
513
  # - received_at older than DISTILL_MAX_AGE_DAYS. Stale events have low
504
514
  # facet value and burn LLM budget. Forward-only + 90-day window is
505
515
  # the right default; old events stay vector-searchable.
516
+ SKIP_AGENT_SOURCE_KIND = os.environ.get(
517
+ "DISTILL_SKIP_AGENT_SOURCE_KIND", "true"
518
+ ).strip().lower() not in ("false", "0", "no", "off")
506
519
  SKIP_ATTRIBUTE_SOURCES = set(
507
520
  s.strip()
508
521
  for s in os.environ.get(
@@ -518,13 +531,30 @@ def claim_next_batch(conn: psycopg.Connection) -> list[dict[str, Any]]:
518
531
  concurrent workers never race.
519
532
 
520
533
  Filters at claim time:
534
+ - Events whose source_kind is 'agent' (the agent's own output) when
535
+ SKIP_AGENT_SOURCE_KIND is set — never distil assistant chatter.
521
536
  - Events from skip-sources (attributes.source in SKIP_ATTRIBUTE_SOURCES)
522
537
  are marked done with `filtered:<source>` rather than claimed.
523
538
  - Events older than DISTILL_MAX_AGE_DAYS are similarly skipped.
524
- Both pre-passes run BEFORE the claim so the worker never wastes an
539
+ All pre-passes run BEFORE the claim so the worker never wastes an
525
540
  LLM call on filtered events. They're cheap UPDATE statements scoped
526
541
  to the current pending set."""
527
542
  with conn.cursor() as cur:
543
+ # Pre-filter: agent's-own-output events (by source_kind). Covers any
544
+ # agent producer without enumerating its source label.
545
+ if SKIP_AGENT_SOURCE_KIND:
546
+ cur.execute(
547
+ """
548
+ UPDATE distillation_queue dq SET
549
+ status = 'done',
550
+ completed_at = NOW(),
551
+ last_error = 'filtered: source_kind=agent'
552
+ FROM events e
553
+ WHERE dq.event_id = e.id
554
+ AND dq.status = 'pending'
555
+ AND e.source_kind = 'agent'
556
+ """
557
+ )
528
558
  # Pre-filter: skip-source events.
529
559
  if SKIP_ATTRIBUTE_SOURCES:
530
560
  cur.execute(