oh-langfuse 0.1.62 → 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.62",
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.",
@@ -147,7 +147,7 @@ function writeAutoUpdateHelper(target) {
147
147
  "exit /b 0",
148
148
  ""
149
149
  ];
150
- fs.writeFileSync(helper, "\ufeff" + lines.join(os.EOL), "utf8");
150
+ fs.writeFileSync(helper, lines.join(os.EOL), "utf8");
151
151
  return helper;
152
152
  }
153
153
 
@@ -301,7 +301,7 @@ function writeAgentCommandShim({ baseDir, target, executable, realCli, publicKey
301
301
  "exit /b %ERRORLEVEL%",
302
302
  ""
303
303
  ].filter(Boolean).join(os.EOL);
304
- fs.writeFileSync(shim, "\ufeff" + content, "utf8");
304
+ fs.writeFileSync(shim, content, "utf8");
305
305
  return { shim, shimDir };
306
306
  }
307
307
 
@@ -333,7 +333,7 @@ function createAgentLauncher({ baseDir, target, executable }) {
333
333
  `${executable} %*`,
334
334
  ""
335
335
  ].join(os.EOL);
336
- fs.writeFileSync(launcher, "\ufeff" + content, "utf8");
336
+ fs.writeFileSync(launcher, content, "utf8");
337
337
  return launcher;
338
338
  }
339
339
 
@@ -176,7 +176,7 @@ function writeAutoUpdateHelper(target) {
176
176
  "exit /b 0",
177
177
  ""
178
178
  ];
179
- fs.writeFileSync(helper, "\ufeff" + lines.join(os.EOL), "utf8");
179
+ fs.writeFileSync(helper, lines.join(os.EOL), "utf8");
180
180
  return helper;
181
181
  }
182
182
 
@@ -294,7 +294,7 @@ function writeAgentCommandShim({ baseDir, target, executable, realCli, publicKey
294
294
  "exit /b %ERRORLEVEL%",
295
295
  ""
296
296
  ].filter(Boolean).join(os.EOL);
297
- fs.writeFileSync(shim, "\ufeff" + content, "utf8");
297
+ fs.writeFileSync(shim, content, "utf8");
298
298
  return { shim, shimDir };
299
299
  }
300
300
 
@@ -326,7 +326,7 @@ function createAgentLauncher({ baseDir, target, executable }) {
326
326
  `${executable} %*`,
327
327
  ""
328
328
  ].join(os.EOL);
329
- fs.writeFileSync(launcher, "\ufeff" + content, "utf8");
329
+ fs.writeFileSync(launcher, content, "utf8");
330
330
  return launcher;
331
331
  }
332
332
 
@@ -398,7 +398,7 @@ async function createHookLauncher({ hooksDir, hookPython, pyPath }) {
398
398
  `${cmdQuote(hookPython)} ${cmdQuote(pyPath)}`,
399
399
  ""
400
400
  ].join(os.EOL);
401
- await fsp.writeFile(launcher, "\ufeff" + content, "utf8");
401
+ await fsp.writeFile(launcher, content, "utf8");
402
402
  return launcher;
403
403
  }
404
404
 
@@ -719,7 +719,7 @@ function writeWindowsLauncherCmd(opencodeDir, { publicKey, secretKey, baseUrl, u
719
719
  cmd.push(" exit /b %ERRORLEVEL%");
720
720
  cmd.push(")");
721
721
  cmd.push("opencode %*");
722
- fs.writeFileSync(p, "\ufeff" + cmd.join("\r\n") + "\r\n", "utf8");
722
+ fs.writeFileSync(p, cmd.join("\r\n") + "\r\n", "utf8");
723
723
  return p;
724
724
  }
725
725
 
@@ -754,7 +754,7 @@ function writeAutoUpdateHelper(target) {
754
754
  "exit /b 0",
755
755
  ""
756
756
  ];
757
- fs.writeFileSync(helper, "\ufeff" + lines.join(os.EOL), "utf8");
757
+ fs.writeFileSync(helper, lines.join(os.EOL), "utf8");
758
758
  return helper;
759
759
  }
760
760
 
@@ -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,11 +828,12 @@ 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
- fs.writeFileSync(shim, "\ufeff" + cmd.join("\r\n") + "\r\n", "utf8");
836
+ fs.writeFileSync(shim, cmd.join("\r\n") + "\r\n", "utf8");
824
837
  return { shim, shimDir };
825
838
  }
826
839