oh-langfuse 0.1.63 → 0.1.64

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.63",
3
+ "version": "0.1.64",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Use npm scripts to configure Claude Code / OpenCode / Codex with Langfuse tracing.",
@@ -776,18 +776,30 @@ function writeAutoUpdateHelper(target) {
776
776
  return helper;
777
777
  }
778
778
 
779
- function windowsAutoUpdateCommand(target) {
780
- return `call ${cmdQuote(writeAutoUpdateHelper(target))}`;
781
- }
782
-
783
- function unixAutoUpdateCommand(target) {
784
- return `${shQuote(writeAutoUpdateHelper(target))} || true`;
785
- }
786
-
787
- function writeWindowsUpdateCheckScript(dir) {
788
- if (process.platform !== "win32") return null;
789
- ensureDir(dir);
790
- const p = path.join(dir, "oh-langfuse-opencode-update-check.ps1");
779
+ function windowsAutoUpdateCommand(target) {
780
+ return `call ${cmdQuote(writeAutoUpdateHelper(target))}`;
781
+ }
782
+
783
+ function unixAutoUpdateCommand(target) {
784
+ return `${shQuote(writeAutoUpdateHelper(target))} || true`;
785
+ }
786
+
787
+ function windowsGitPathBootstrap() {
788
+ return [
789
+ "for /f \"delims=\" %%G in ('where.exe git.exe 2^>nul') do (",
790
+ " set \"OH_LANGFUSE_GIT_EXE=%%G\"",
791
+ " set \"npm_config_git=%%G\"",
792
+ " set \"PATH=%%~dpG;%PATH%\"",
793
+ " goto :oh_langfuse_git_ready",
794
+ ")",
795
+ ":oh_langfuse_git_ready"
796
+ ];
797
+ }
798
+
799
+ function writeWindowsUpdateCheckScript(dir) {
800
+ if (process.platform !== "win32") return null;
801
+ ensureDir(dir);
802
+ const p = path.join(dir, "oh-langfuse-opencode-update-check.ps1");
791
803
  const ps = [
792
804
  "$ErrorActionPreference = 'SilentlyContinue'",
793
805
  "$statePath = Join-Path $env:USERPROFILE '.config\\oh-langfuse\\runtime.json'",
@@ -816,9 +828,10 @@ function writeOpencodeCommandShim(opencodeDir, { publicKey, secretKey, baseUrl,
816
828
  cmd.push(`set LANGFUSE_PUBLIC_KEY=${publicKey}`);
817
829
  cmd.push(`set LANGFUSE_SECRET_KEY=${secretKey}`);
818
830
  cmd.push(`set LANGFUSE_BASEURL=${baseUrl}`);
819
- if (userId) cmd.push(`set LANGFUSE_USER_ID=${userId}`);
820
- cmd.push(windowsAutoUpdateCommand("opencode"));
821
- cmd.push(`call ${cmdQuote(realOpencodeCli)} %*`);
831
+ if (userId) cmd.push(`set LANGFUSE_USER_ID=${userId}`);
832
+ cmd.push(...windowsGitPathBootstrap());
833
+ cmd.push(windowsAutoUpdateCommand("opencode"));
834
+ cmd.push(`call ${cmdQuote(realOpencodeCli)} %*`);
822
835
  cmd.push("exit /b %ERRORLEVEL%");
823
836
  fs.writeFileSync(shim, cmd.join("\r\n") + "\r\n", "utf8");
824
837
  return { shim, shimDir };