oh-langfuse 0.1.35 → 0.1.36

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.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  `oh-langfuse` 是用于给 Claude Code、OpenCode 和 Codex 配置 Langfuse 追踪的命令行工具。它提供交互式安装向导,也支持 `setup` / `check` 直接命令,方便在用户机器上安装、修复和校验配置。
4
4
 
5
- 当前 npm 版本:`0.1.35`
5
+ 当前 npm 版本:`0.1.36`
6
6
 
7
7
  ## 能做什么
8
8
 
@@ -40,7 +40,7 @@ npx oh-langfuse@latest check codex
40
40
 
41
41
  OpenCode 生成的 `launch-opencode-langfuse.*` 会在启动 agent 前执行一次更新检测:如果 npm 上的 `oh-langfuse@latest` 高于本机 runtime 版本,会提示是否更新;用户确认后才会运行 `npx oh-langfuse@latest update opencode`。Claude Code 和 Codex 也会生成对应 launcher:
42
42
 
43
- OpenCode setup 还会生成 `~/.config/opencode/bin/opencode` / `opencode.cmd` 命令包装器,并把该目录写入用户 PATH。新开终端后直接运行 `opencode`,也会先检测 `oh-langfuse` runtime 是否需要更新,再转发到真实 OpenCode CLI
43
+ OpenCode setup 还会生成 `~/.config/opencode/bin/opencode` / `opencode.cmd` 命令包装器,并把该目录写入用户 PATH。新开终端后直接运行 `opencode`,会先检测 `oh-langfuse` runtime 是否需要更新,再转发到真实 OpenCode CLI。为了避免 Windows 下在 agent 启动链路里嵌套运行 npm installer 导致启动崩溃,`opencode` 命令只做检测和提示;需要更新时请关闭 agent 后运行提示中的 `npx oh-langfuse@latest update opencode`。
44
44
 
45
45
  - `~/.claude/launch-claude-langfuse.cmd` / `~/.claude/launch-claude-langfuse.sh`
46
46
  - `~/.codex/launch-codex-langfuse.cmd` / `~/.codex/launch-codex-langfuse.sh`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oh-langfuse",
3
- "version": "0.1.35",
3
+ "version": "0.1.36",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Use npm scripts to configure Claude Code / OpenCode / Codex with Langfuse tracing.",
@@ -86,6 +86,13 @@ async function main() {
86
86
  const message = installedVersion
87
87
  ? `oh-langfuse ${target} runtime update available: ${installedVersion} -> ${latest}.`
88
88
  : `oh-langfuse ${target} runtime may need update. Latest package: ${latest}.`;
89
+ const updateCommand = `npx oh-langfuse@latest update ${target}`;
90
+
91
+ if (args["notify-only"] || args.notifyOnly) {
92
+ console.log(`[INFO] ${message}`);
93
+ console.log(`[INFO] To update safely, close the agent and run: ${updateCommand}`);
94
+ return 0;
95
+ }
89
96
 
90
97
  if (args.yes || args.y) {
91
98
  console.log(`[INFO] ${message}`);
@@ -94,7 +101,7 @@ async function main() {
94
101
  }
95
102
 
96
103
  if (!process.stdin.isTTY || !process.stdout.isTTY) {
97
- console.log(`[INFO] ${message} Run: npx oh-langfuse@latest update ${target}`);
104
+ console.log(`[INFO] ${message} Run: ${updateCommand}`);
98
105
  return 0;
99
106
  }
100
107
 
@@ -595,7 +595,7 @@ function writeWindowsLauncherCmd(opencodeDir, { publicKey, secretKey, baseUrl, u
595
595
  if (userId) cmd.push(`set LANGFUSE_USER_ID=${userId}`);
596
596
  cmd.push("where npx >nul 2>nul");
597
597
  cmd.push("if %ERRORLEVEL% EQU 0 (");
598
- cmd.push(" call npx -y oh-langfuse@latest auto-update opencode --skip-check");
598
+ cmd.push(" call npx -y oh-langfuse@latest auto-update opencode --skip-check --notify-only");
599
599
  cmd.push(")");
600
600
  cmd.push('if exist "%USERPROFILE%\\.opencode\\bin\\opencode.exe" (');
601
601
  cmd.push(' "%USERPROFILE%\\.opencode\\bin\\opencode.exe" %*');
@@ -623,7 +623,7 @@ function writeOpencodeCommandShim(opencodeDir, { publicKey, secretKey, baseUrl,
623
623
  if (userId) cmd.push(`set LANGFUSE_USER_ID=${userId}`);
624
624
  cmd.push("where npx >nul 2>nul");
625
625
  cmd.push("if %ERRORLEVEL% EQU 0 (");
626
- cmd.push(" call npx -y oh-langfuse@latest auto-update opencode --skip-check");
626
+ cmd.push(" call npx -y oh-langfuse@latest auto-update opencode --skip-check --notify-only");
627
627
  cmd.push(")");
628
628
  cmd.push(`call ${cmdQuote(realOpencodeCli)} %*`);
629
629
  cmd.push("exit /b %ERRORLEVEL%");
@@ -642,7 +642,7 @@ function writeOpencodeCommandShim(opencodeDir, { publicKey, secretKey, baseUrl,
642
642
  `export LANGFUSE_BASEURL=${shQuote(baseUrl)}`,
643
643
  userId ? `export LANGFUSE_USER_ID=${shQuote(userId)}` : null,
644
644
  'if command -v npx >/dev/null 2>&1; then',
645
- ' npx -y oh-langfuse@latest auto-update opencode --skip-check || true',
645
+ ' npx -y oh-langfuse@latest auto-update opencode --skip-check --notify-only || true',
646
646
  "fi",
647
647
  `exec ${shQuote(realOpencodeCli)} "$@"`,
648
648
  ""
@@ -664,7 +664,7 @@ function writeUnixLauncherSh(opencodeDir, { publicKey, secretKey, baseUrl, userI
664
664
  `export LANGFUSE_BASEURL=${shQuote(baseUrl)}`,
665
665
  userId ? `export LANGFUSE_USER_ID=${shQuote(userId)}` : null,
666
666
  'if command -v npx >/dev/null 2>&1; then',
667
- ' npx -y oh-langfuse@latest auto-update opencode --skip-check || true',
667
+ ' npx -y oh-langfuse@latest auto-update opencode --skip-check --notify-only || true',
668
668
  "fi",
669
669
  'if [ -x "$HOME/.opencode/bin/opencode" ]; then',
670
670
  ' exec "$HOME/.opencode/bin/opencode" "$@"',