oh-langfuse 0.1.26 → 0.1.28
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/bin/cli.js +6 -0
- package/package.json +1 -1
- package/scripts/langfuse-setup.mjs +11 -3
package/bin/cli.js
CHANGED
package/package.json
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import fsp from "node:fs/promises";
|
|
3
|
-
import path from "node:path";
|
|
4
|
-
import os from "node:os";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import os from "node:os";
|
|
5
5
|
import { execFileSync } from "node:child_process";
|
|
6
|
+
import { fileURLToPath } from "node:url";
|
|
7
|
+
|
|
8
|
+
const packageRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
|
6
9
|
|
|
7
10
|
const USER_ID_PATTERN = /^[a-z](?:\d{8}|wx\d{7})$/;
|
|
8
11
|
const USER_ID_PATTERN_TEXT = "^[a-z](?:\\d{8}|wx\\d{7})$";
|
|
@@ -235,7 +238,12 @@ async function main() {
|
|
|
235
238
|
process.env.CC_LANGFUSE_ZIP_URL ||
|
|
236
239
|
"https://gitcode.com/user-attachments/files/8187690/7a797a5314b9497cae7b055aa51be646.zip";
|
|
237
240
|
const zipPath = args.zipPath || args.zippath || process.env.CC_LANGFUSE_ZIP_PATH;
|
|
238
|
-
const
|
|
241
|
+
const bundledPyPath = path.join(packageRoot, "langfuse_hook.py");
|
|
242
|
+
const pyPathArg =
|
|
243
|
+
args.pyPath ||
|
|
244
|
+
args.pypath ||
|
|
245
|
+
process.env.CC_LANGFUSE_PY_PATH ||
|
|
246
|
+
(fs.existsSync(bundledPyPath) ? bundledPyPath : "");
|
|
239
247
|
|
|
240
248
|
const userHome = os.homedir();
|
|
241
249
|
const claudeDir = path.join(userHome, ".claude");
|