ramarivera-pi-langfuse

内容来源:README.md(说明文档) · 原始地址 · 查看安装指南

原始内容

@ramarivera/pi-langfuse

Pi extension that exports full Pi session traces, tool activity, token usage, and costs to Langfuse via OpenTelemetry.

By default it sends OTLP traces to:

https://langfuse.ai.roxasroot.net/otel/v1/traces

Override with PI_LANGFUSE_OTLP_ENDPOINT when testing against another collector.

Install

pi install npm:@ramarivera/pi-langfuse@0.1.1

Local Development

This checkout is live-enabled for Pi through:

.pi/extensions/langfuse/index.ts

That shim imports the package entrypoint in src/index.ts, which imports the extension factory from src/extension.ts. Tests use the same symbol so local behavior, package behavior, and manual Pi behavior do not drift.

npm install
npm run check
npm test
npm run test:e2e
npm pack --dry-run

Publishing

Publishing uses GitHub Actions trusted publishing in .github/workflows/publish.yml.

Before the first publish, configure npm trusted publishing:

  • owner/repo: ramarivera/pi-langfuse
  • workflow: .github/workflows/publish.yml
  • environment: blank unless the workflow is changed to require one

No NPM_TOKEN is required for trusted publishing.