Add pi-langfuse extension (Langfuse LLM observability for pi) — vendored from npm 1.5.8

This commit is contained in:
2026-08-03 20:09:58 +10:00
parent 0603c29216
commit bc91a15905
27 changed files with 9219 additions and 0 deletions

View File

@@ -0,0 +1,49 @@
declare module "@opentelemetry/sdk-trace-base" {
export class BasicTracerProvider {
constructor(options?: { spanProcessors?: unknown[] });
forceFlush?(): Promise<void>;
shutdown?(): Promise<void>;
}
}
declare module "@langfuse/otel" {
export class LangfuseSpanProcessor {
constructor(options: {
publicKey: string;
secretKey: string;
baseUrl: string;
});
forceFlush?(): Promise<void>;
shutdown?(): Promise<void>;
}
}
declare module "@langfuse/tracing" {
export function setLangfuseTracerProvider(provider: unknown): void;
export function startObservation(
name: string,
body?: Record<string, unknown>,
options?: { asType?: string },
): unknown;
export function propagateAttributes<T>(
params: {
sessionId?: string;
traceName?: string;
metadata?: Record<string, string>;
tags?: string[];
},
fn: () => T,
): T;
}
declare module "@langfuse/client" {
export class LangfuseClient {
constructor(options: {
publicKey: string;
secretKey: string;
baseUrl: string;
});
}
}

View File

@@ -0,0 +1,29 @@
declare module "node:fs" {
export function mkdirSync(path: string, options?: { recursive?: boolean }): void;
export function readFileSync(path: string, encoding: string): string;
export function existsSync(path: string): boolean;
export function writeFileSync(path: string, data: string, encoding: string): void;
}
declare module "node:crypto" {
export function randomUUID(): string;
}
declare module "node:os" {
export function homedir(): string;
}
declare module "node:path" {
export function resolve(...paths: string[]): string;
export function dirname(path: string): string;
export function basename(path: string, suffix?: string): string;
}
declare module "node:url" {
export function fileURLToPath(url: string | URL): string;
}
declare const process: {
cwd(): string;
env: Record<string, string | undefined>;
};

View File

@@ -0,0 +1,9 @@
declare module "@earendil-works/pi-coding-agent" {
export interface ExtensionAPI {
on(event: string, handler: (event: any, ctx: any) => unknown): void;
registerCommand(
name: string,
options: { description?: string; handler: (args: string, ctx: any) => unknown },
): void;
}
}