@narumitw/pi-langfuse 0.46.0 → 0.49.0

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.
Files changed (2) hide show
  1. package/package.json +11 -8
  2. package/src/langfuse.ts +6 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@narumitw/pi-langfuse",
3
- "version": "0.46.0",
3
+ "version": "0.49.0",
4
4
  "description": "Pi extension that traces LLM generations and tool activity to Langfuse.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -28,21 +28,24 @@
28
28
  "format": "biome check --write .",
29
29
  "typecheck": "tsc --noEmit"
30
30
  },
31
+ "peerDependencies": {
32
+ "@earendil-works/pi-coding-agent": "*"
33
+ },
34
+ "devDependencies": {
35
+ "@biomejs/biome": "2.5.6",
36
+ "@earendil-works/pi-coding-agent": "0.83.0",
37
+ "@types/node": "26.1.2",
38
+ "typescript": "7.0.2"
39
+ },
31
40
  "dependencies": {
32
41
  "@langfuse/otel": "^5.10.0",
33
42
  "@langfuse/tracing": "^5.10.0",
34
- "@narumitw/pi-tui-kit": "^0.40.0",
43
+ "@narumitw/pi-tui-kit": "^0.46.0",
35
44
  "@opentelemetry/api": "^1.9.1",
36
45
  "@opentelemetry/exporter-trace-otlp-http": "^0.221.0",
37
46
  "@opentelemetry/sdk-trace-base": "^2.10.0",
38
47
  "@opentelemetry/sdk-trace-node": "^2.10.0"
39
48
  },
40
- "devDependencies": {
41
- "@biomejs/biome": "2.5.6",
42
- "@earendil-works/pi-coding-agent": "0.83.0",
43
- "@types/node": "26.1.2",
44
- "typescript": "7.0.2"
45
- },
46
49
  "repository": {
47
50
  "type": "git",
48
51
  "url": "https://github.com/narumiruna/pi-extensions",
package/src/langfuse.ts CHANGED
@@ -3,7 +3,6 @@ import type {
3
3
  ExtensionCommandContext,
4
4
  ExtensionContext,
5
5
  } from "@earendil-works/pi-coding-agent";
6
- import { defineMenu, runMenu } from "@narumitw/pi-tui-kit";
7
6
  import {
8
7
  DEFAULT_BASE_URL,
9
8
  type LangfuseConfig,
@@ -69,6 +68,10 @@ export function createLangfuseExtension(
69
68
  return;
70
69
  }
71
70
  const menuGeneration = sessionGeneration;
71
+ const menuSignal = menuController.signal;
72
+ const isCurrent = () => menuGeneration === sessionGeneration && !menuSignal.aborted;
73
+ const { defineMenu, runMenu } = await import("@narumitw/pi-tui-kit");
74
+ if (!isCurrent()) return;
72
75
  type Screen = "main";
73
76
  type Action = "flush" | "configure" | "help";
74
77
  const menu = defineMenu<undefined, Screen, Action>({
@@ -154,8 +157,8 @@ export function createLangfuseExtension(
154
157
  });
155
158
  await runMenu(ctx, menu, {
156
159
  getState: () => undefined,
157
- signal: menuController.signal,
158
- isCurrent: () => menuGeneration === sessionGeneration,
160
+ signal: menuSignal,
161
+ isCurrent,
159
162
  });
160
163
  }
161
164