Add pi-langfuse extension (Langfuse LLM observability for pi) — vendored from npm 1.5.8
This commit is contained in:
49
extensions/pi-langfuse/types/langfuse-runtime-shims.d.ts
vendored
Normal file
49
extensions/pi-langfuse/types/langfuse-runtime-shims.d.ts
vendored
Normal 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;
|
||||
});
|
||||
}
|
||||
}
|
||||
29
extensions/pi-langfuse/types/node-shims.d.ts
vendored
Normal file
29
extensions/pi-langfuse/types/node-shims.d.ts
vendored
Normal 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>;
|
||||
};
|
||||
9
extensions/pi-langfuse/types/pi-coding-agent.d.ts
vendored
Normal file
9
extensions/pi-langfuse/types/pi-coding-agent.d.ts
vendored
Normal 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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user