omp packages

@snissn/pi-treedb0.2.0

Pi coding agent extension for TreeDB: commit-pinned code search, AST symbols, GitHub history, code-linked agent memory with git drift warnings, and OpenTelemetry spans.

snissn Published 4 days ago MIT ~0 downloads/mo

Untested on omp

This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.

Did it work for you?

Result

One report per person. A new report replaces your old one.

Reports 0

No reports yet.

Readme

@snissn/pi-treedb

Pi coding-agent extension for treedb-repo-mcp — commit-pinned local code search, pure-Go AST symbol lookup, GitHub issue/PR search, code-linked persistent agent memory with automatic git drift warnings, and OpenTelemetry span instrumentation.

Prerequisites

Install the static treedb-repo-mcp binary (Linux/macOS, amd64/arm64):

curl -fsSL https://raw.githubusercontent.com/snissn/treedb-repo-mcp/main/scripts/install.sh | sh

Install in Pi

pi install npm:@snissn/pi-treedb

Or test locally from a checkout of this repository:

pi -e ./packages/pi-treedb

Features

  • Automatic HEAD commit pinning: Resolves git rev-parse HEAD in the active workspace and injects ref automatically on treedb_search, treedb_find_symbol, treedb_phrase_search, treedb_file_context, and treedb_memory_recall (fail-closed overlay verification; pass ref: "" or --treedb-no-auto-ref to opt out).
  • Prompt-cache-safe first-turn memory recall: Loads active project memories via memory_recall on the first turn of a session into a compact <treedb_memories> block, flags [STALE CODE] warnings when linked files changed since linked_commit_sha, keeps the block byte-identical across turns to preserve prompt caching, and refreshes automatically after session_compact or /treedb-refresh.
  • OpenTelemetry composition (pi-otel-compatible): Emits treedb.mcp.* client spans via @opentelemetry/api with gen_ai.tool.name, treedb.latency_ms, treedb.response_bytes, treedb.estimated_tokens, treedb.verified_commit, treedb.overlay_files, and treedb.stale_memories whenever a global OTel TracerProvider (such as pi-otel) is active.
  • Session telemetry & status commands: /treedb-stats, /treedb-status, and /treedb-refresh.

Configuration

Flag Environment Variable Purpose
--treedb-url TREEDB_MCP_URL Connect to a shared Streamable HTTP daemon (e.g. http://127.0.0.1:7337/mcp)
--treedb-config TREEDB_MCP_CONFIG Multi-repo repos.toml path (auto-detected at ~/.config/treedb-mcp/repos.toml if present)
--treedb-bin TREEDB_MCP_BIN Explicit path to treedb-repo-mcp binary
(none) TREEDB_MCP_REPO Default target repo name in multi-repo mode
--treedb-no-auto-ref TREEDB_PI_AUTO_PIN_REF=0 Disable automatic HEAD commit pinning
--treedb-no-auto-memory TREEDB_PI_AUTO_MEMORY=0 Disable automatic first-turn <treedb_memories> recall

Registered Tools

  • treedb_search — Unified BM25F/hybrid search across code, docs, and GitHub issues/PRs (defaults to compact passage mode)
  • treedb_find_symbol — Pure-Go AST symbol-definition lookup (defs_only: true by default)
  • treedb_phrase_search — Native Block-Max WAND exact phrase and proximity (slop) search
  • treedb_file_context — Targeted commit-pinned line-range or chunk reader
  • treedb_memory_recall — Code-linked memory recall with automatic git drift warnings
  • treedb_memory_retain — Persist code-linked memories (with fail-closed secret scanning and supersedes_id versioning)
  • treedb_memory_invalidate — Soft-invalidate outdated memories
  • treedb_status — Inspect repo commit lag, watcher health, and TreeDB storage stats