oh-langfuse 0.1.68 → 0.1.69

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oh-langfuse",
3
- "version": "0.1.68",
3
+ "version": "0.1.69",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Use npm scripts to configure Claude Code / OpenCode / Codex with Langfuse tracing.",
@@ -1004,11 +1004,27 @@ function writeOpencodeCommandShim(opencodeDir, { publicKey, secretKey, baseUrl,
1004
1004
  userId ? `export LANGFUSE_USER_ID=${shQuote(userId)}` : null,
1005
1005
  unixAutoUpdateCommand("opencode"),
1006
1006
  `OH_LANGFUSE_REAL_OPENCODE=${quotedRealOpencodeCli}`,
1007
- 'if [ -x "$OH_LANGFUSE_REAL_OPENCODE" ]; then exec "$OH_LANGFUSE_REAL_OPENCODE" "$@"; fi',
1008
- 'if [ -x "$HOME/.opencode/bin/opencode" ]; then exec "$HOME/.opencode/bin/opencode" "$@"; fi',
1007
+ "OH_LANGFUSE_BROKEN_OPENCODE=",
1008
+ "try_opencode_candidate() {",
1009
+ ' candidate="$1"',
1010
+ " shift",
1011
+ ' if [ -x "$candidate" ]; then',
1012
+ ' if "$candidate" --version >/dev/null 2>&1; then exec "$candidate" "$@"; fi',
1013
+ ' OH_LANGFUSE_BROKEN_OPENCODE="$candidate"',
1014
+ " fi",
1015
+ "}",
1016
+ 'try_opencode_candidate "$HOME/.opencode/bin/opencode" "$@"',
1017
+ 'try_opencode_candidate "$OH_LANGFUSE_REAL_OPENCODE" "$@"',
1009
1018
  'if command -v opencode >/dev/null 2>&1; then',
1010
1019
  ' resolved="$(command -v opencode)"',
1011
- ' if [ "$resolved" != "$0" ]; then exec "$resolved" "$@"; fi',
1020
+ ' if [ "$resolved" != "$0" ]; then try_opencode_candidate "$resolved" "$@"; fi',
1021
+ "fi",
1022
+ 'if [ -n "$OH_LANGFUSE_BROKEN_OPENCODE" ]; then',
1023
+ ' echo "[ERROR] OpenCode CLI was found but failed to start: $OH_LANGFUSE_BROKEN_OPENCODE" >&2',
1024
+ ' echo "Try: npm install -g opencode-linux-x64 --registry=https://registry.npmjs.org/" >&2',
1025
+ ' echo "If that package fails on your host, try opencode-linux-x64-baseline or opencode-linux-x64-musl." >&2',
1026
+ ' echo "Then run: npx --registry=https://registry.npmjs.org/ -y oh-langfuse@latest update opencode --npmRegistry=https://registry.npmjs.org/" >&2',
1027
+ " exit 127",
1012
1028
  "fi",
1013
1029
  'echo "[ERROR] OpenCode CLI not found. Install OpenCode CLI first." >&2',
1014
1030
  'echo "Try: npm install -g opencode-linux-x64" >&2',