oh-langfuse 0.1.79 → 0.1.80
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/SELF_VERIFY.md +25 -25
- package/bin/cli.js +41 -41
- package/codex_langfuse_notify.py +162 -2
- package/langfuse_hook.py +165 -2
- package/package.json +2 -1
- package/scripts/auto-update-runtime.mjs +14 -14
- package/scripts/cli-detection-utils.mjs +114 -114
- package/scripts/codex-langfuse-check.mjs +65 -65
- package/scripts/codex-langfuse-setup.mjs +140 -140
- package/scripts/json-utils.mjs +99 -99
- package/scripts/langfuse-check.mjs +50 -50
- package/scripts/langfuse-setup.mjs +154 -154
- package/scripts/opencode-langfuse-check.mjs +208 -199
- package/scripts/opencode-langfuse-run.mjs +21 -21
- package/scripts/opencode-langfuse-setup.mjs +106 -50
- package/scripts/opencode-skills-discover.mjs +125 -0
- package/scripts/real-self-verify.mjs +103 -103
- package/scripts/resolve-opencode-cli.mjs +53 -53
- package/scripts/update-langfuse-runtime.mjs +49 -49
- package/setup-langfuse.bat +19 -19
- package/setup-langfuse.sh +19 -19
|
@@ -1,199 +1,208 @@
|
|
|
1
|
-
import fs from "node:fs";
|
|
2
|
-
import path from "node:path";
|
|
3
|
-
import os from "node:os";
|
|
4
|
-
import { parseJsonRelaxed, stripBom } from "./json-utils.mjs";
|
|
5
|
-
|
|
6
|
-
function parseArgs(argv) {
|
|
7
|
-
const args = {};
|
|
8
|
-
for (const raw of argv) {
|
|
9
|
-
if (!raw.startsWith("--")) continue;
|
|
10
|
-
const eq = raw.indexOf("=");
|
|
11
|
-
if (eq === -1) args[raw.slice(2)] = true;
|
|
12
|
-
else args[raw.slice(2, eq)] = raw.slice(eq + 1);
|
|
13
|
-
}
|
|
14
|
-
return args;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
function readTextIfExists(p) {
|
|
18
|
-
if (!fs.existsSync(p)) return "";
|
|
19
|
-
return stripBom(fs.readFileSync(p, "utf8"));
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
function readJsonIfExists(p) {
|
|
23
|
-
const txt = readTextIfExists(p);
|
|
24
|
-
if (!txt.trim()) return null;
|
|
25
|
-
return parseJsonRelaxed(txt, p);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
function hasPlugin(pluginField, name) {
|
|
29
|
-
if (Array.isArray(pluginField)) return pluginField.includes(name);
|
|
30
|
-
if (typeof pluginField === "string") return pluginField === name;
|
|
31
|
-
return false;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function shellConfigPath() {
|
|
35
|
-
const shell = process.env.SHELL || "/bin/bash";
|
|
36
|
-
return path.join(os.homedir(), shell.includes("zsh") ? ".zshrc" : ".bashrc");
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
function isPatchedPlugin(distIndexPath) {
|
|
40
|
-
const code = readTextIfExists(distIndexPath);
|
|
41
|
-
return (
|
|
42
|
-
code.includes("LangfuseSpanProcessor") &&
|
|
43
|
-
code.includes("LANGFUSE_PUBLIC_KEY") &&
|
|
44
|
-
code.includes("createUserIdSpanProcessor")
|
|
45
|
-
);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function addResult(results, item, ok, detail, fix = "") {
|
|
49
|
-
results.push({ item, ok, detail, fix });
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
function main() {
|
|
53
|
-
const home = os.homedir();
|
|
54
|
-
const opencodeDir = path.join(home, ".config", "opencode");
|
|
55
|
-
const pkgDir = path.join(opencodeDir, "node_modules", "opencode-plugin-langfuse");
|
|
56
|
-
const pluginDest = path.join(opencodeDir, "plugins", "opencode-plugin-langfuse");
|
|
57
|
-
const langfusePluginPath = "./plugins/opencode-plugin-langfuse";
|
|
58
|
-
const opencodeJsonPath = path.join(opencodeDir, "opencode.json");
|
|
59
|
-
const pluginDistIndex = path.join(pluginDest, "dist", "index.js");
|
|
60
|
-
const nodeModulesDistIndex = path.join(pkgDir, "dist", "index.js");
|
|
61
|
-
const userConfigPath = path.join(home, ".config", "opencode-plugin-langfuse", "config.json");
|
|
62
|
-
const windowsLauncherPath = path.join(opencodeDir, "launch-opencode-langfuse.cmd");
|
|
63
|
-
const unixLauncherPath = path.join(opencodeDir, "launch-opencode-langfuse.sh");
|
|
64
|
-
const opencodeCommandShimPath = path.join(opencodeDir, "bin", process.platform === "win32" ? "opencode.cmd" : "opencode");
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
opencodeDir,
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
otOk
|
|
85
|
-
"
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
pkgDir,
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
pluginDest,
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
pluginDistIndex,
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
nodeModulesDistIndex,
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
opencodeCommandShimPath,
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
"
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import os from "node:os";
|
|
4
|
+
import { parseJsonRelaxed, stripBom } from "./json-utils.mjs";
|
|
5
|
+
|
|
6
|
+
function parseArgs(argv) {
|
|
7
|
+
const args = {};
|
|
8
|
+
for (const raw of argv) {
|
|
9
|
+
if (!raw.startsWith("--")) continue;
|
|
10
|
+
const eq = raw.indexOf("=");
|
|
11
|
+
if (eq === -1) args[raw.slice(2)] = true;
|
|
12
|
+
else args[raw.slice(2, eq)] = raw.slice(eq + 1);
|
|
13
|
+
}
|
|
14
|
+
return args;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function readTextIfExists(p) {
|
|
18
|
+
if (!fs.existsSync(p)) return "";
|
|
19
|
+
return stripBom(fs.readFileSync(p, "utf8"));
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function readJsonIfExists(p) {
|
|
23
|
+
const txt = readTextIfExists(p);
|
|
24
|
+
if (!txt.trim()) return null;
|
|
25
|
+
return parseJsonRelaxed(txt, p);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function hasPlugin(pluginField, name) {
|
|
29
|
+
if (Array.isArray(pluginField)) return pluginField.includes(name);
|
|
30
|
+
if (typeof pluginField === "string") return pluginField === name;
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function shellConfigPath() {
|
|
35
|
+
const shell = process.env.SHELL || "/bin/bash";
|
|
36
|
+
return path.join(os.homedir(), shell.includes("zsh") ? ".zshrc" : ".bashrc");
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function isPatchedPlugin(distIndexPath) {
|
|
40
|
+
const code = readTextIfExists(distIndexPath);
|
|
41
|
+
return (
|
|
42
|
+
code.includes("LangfuseSpanProcessor") &&
|
|
43
|
+
code.includes("LANGFUSE_PUBLIC_KEY") &&
|
|
44
|
+
code.includes("createUserIdSpanProcessor")
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function addResult(results, item, ok, detail, fix = "") {
|
|
49
|
+
results.push({ item, ok, detail, fix });
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function main() {
|
|
53
|
+
const home = os.homedir();
|
|
54
|
+
const opencodeDir = path.join(home, ".config", "opencode");
|
|
55
|
+
const pkgDir = path.join(opencodeDir, "node_modules", "opencode-plugin-langfuse");
|
|
56
|
+
const pluginDest = path.join(opencodeDir, "plugins", "opencode-plugin-langfuse");
|
|
57
|
+
const langfusePluginPath = "./plugins/opencode-plugin-langfuse";
|
|
58
|
+
const opencodeJsonPath = path.join(opencodeDir, "opencode.json");
|
|
59
|
+
const pluginDistIndex = path.join(pluginDest, "dist", "index.js");
|
|
60
|
+
const nodeModulesDistIndex = path.join(pkgDir, "dist", "index.js");
|
|
61
|
+
const userConfigPath = path.join(home, ".config", "opencode-plugin-langfuse", "config.json");
|
|
62
|
+
const windowsLauncherPath = path.join(opencodeDir, "launch-opencode-langfuse.cmd");
|
|
63
|
+
const unixLauncherPath = path.join(opencodeDir, "launch-opencode-langfuse.sh");
|
|
64
|
+
const opencodeCommandShimPath = path.join(opencodeDir, "bin", process.platform === "win32" ? "opencode.cmd" : "opencode");
|
|
65
|
+
const skillsDiscoverPath = path.join(home, ".config", "oh-langfuse", "opencode-skills-discover.mjs");
|
|
66
|
+
|
|
67
|
+
const results = [];
|
|
68
|
+
|
|
69
|
+
addResult(
|
|
70
|
+
results,
|
|
71
|
+
"OpenCode config dir",
|
|
72
|
+
fs.existsSync(opencodeDir),
|
|
73
|
+
opencodeDir,
|
|
74
|
+
"Run: npx oh-langfuse@latest setup opencode"
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
const settings = readJsonIfExists(opencodeJsonPath);
|
|
78
|
+
addResult(results, "opencode.json", !!settings, opencodeJsonPath, "Run setup again to create OpenCode config.");
|
|
79
|
+
|
|
80
|
+
const otOk = !!(settings?.experimental?.openTelemetry === true);
|
|
81
|
+
addResult(
|
|
82
|
+
results,
|
|
83
|
+
"experimental.openTelemetry",
|
|
84
|
+
otOk,
|
|
85
|
+
otOk ? "true" : String(settings?.experimental?.openTelemetry ?? "missing"),
|
|
86
|
+
"Run: npx oh-langfuse@latest setup opencode"
|
|
87
|
+
);
|
|
88
|
+
|
|
89
|
+
const plOk = hasPlugin(settings?.plugin, langfusePluginPath);
|
|
90
|
+
addResult(
|
|
91
|
+
results,
|
|
92
|
+
`plugin contains ${langfusePluginPath}`,
|
|
93
|
+
plOk,
|
|
94
|
+
JSON.stringify(settings?.plugin ?? null),
|
|
95
|
+
"Run setup again so opencode.json points at the local plugin copy."
|
|
96
|
+
);
|
|
97
|
+
|
|
98
|
+
addResult(
|
|
99
|
+
results,
|
|
100
|
+
"npm package",
|
|
101
|
+
fs.existsSync(path.join(pkgDir, "package.json")),
|
|
102
|
+
pkgDir,
|
|
103
|
+
"Install may have failed. Try: npx oh-langfuse@latest setup opencode --npmRegistry=https://registry.npmmirror.com"
|
|
104
|
+
);
|
|
105
|
+
|
|
106
|
+
addResult(
|
|
107
|
+
results,
|
|
108
|
+
"local plugin copy",
|
|
109
|
+
fs.existsSync(path.join(pluginDest, "package.json")),
|
|
110
|
+
pluginDest,
|
|
111
|
+
"Run setup again; OpenCode loads ./plugins/opencode-plugin-langfuse from opencode.json."
|
|
112
|
+
);
|
|
113
|
+
|
|
114
|
+
addResult(
|
|
115
|
+
results,
|
|
116
|
+
"local plugin patch",
|
|
117
|
+
isPatchedPlugin(pluginDistIndex),
|
|
118
|
+
pluginDistIndex,
|
|
119
|
+
"Run setup again to patch Langfuse credentials/userId injection into the plugin."
|
|
120
|
+
);
|
|
121
|
+
|
|
122
|
+
addResult(
|
|
123
|
+
results,
|
|
124
|
+
"node_modules plugin patch",
|
|
125
|
+
isPatchedPlugin(nodeModulesDistIndex),
|
|
126
|
+
nodeModulesDistIndex,
|
|
127
|
+
"Run setup again to patch the installed npm package before copying it."
|
|
128
|
+
);
|
|
129
|
+
|
|
130
|
+
const userConfig = readJsonIfExists(userConfigPath);
|
|
131
|
+
addResult(
|
|
132
|
+
results,
|
|
133
|
+
"OpenCode Langfuse user config",
|
|
134
|
+
!!(userConfig?.userId || userConfig?.usrid),
|
|
135
|
+
userConfigPath,
|
|
136
|
+
"Run setup again and enter userId when prompted."
|
|
137
|
+
);
|
|
138
|
+
|
|
139
|
+
addResult(
|
|
140
|
+
results,
|
|
141
|
+
"opencode command shim",
|
|
142
|
+
fs.existsSync(opencodeCommandShimPath),
|
|
143
|
+
opencodeCommandShimPath,
|
|
144
|
+
"Run setup again after installing OpenCode so the direct opencode command can load Langfuse and auto-update checks."
|
|
145
|
+
);
|
|
146
|
+
|
|
147
|
+
addResult(
|
|
148
|
+
results,
|
|
149
|
+
"skills discover helper",
|
|
150
|
+
fs.existsSync(skillsDiscoverPath),
|
|
151
|
+
skillsDiscoverPath,
|
|
152
|
+
"Run setup again to install the skills-discover helper that registers nearby skill repos."
|
|
153
|
+
);
|
|
154
|
+
|
|
155
|
+
if (process.platform === "win32") {
|
|
156
|
+
addResult(
|
|
157
|
+
results,
|
|
158
|
+
"launcher cmd",
|
|
159
|
+
fs.existsSync(windowsLauncherPath),
|
|
160
|
+
windowsLauncherPath,
|
|
161
|
+
"Run setup again to create a launcher with LANGFUSE_* variables."
|
|
162
|
+
);
|
|
163
|
+
} else {
|
|
164
|
+
const shellRc = shellConfigPath();
|
|
165
|
+
const shellRcText = readTextIfExists(shellRc);
|
|
166
|
+
addResult(
|
|
167
|
+
results,
|
|
168
|
+
"shell rc LANGFUSE_* block",
|
|
169
|
+
shellRcText.includes("# === Langfuse OpenCode Setup ===") && shellRcText.includes("LANGFUSE_PUBLIC_KEY"),
|
|
170
|
+
shellRc,
|
|
171
|
+
"Run setup again, then open a new terminal or source the shown shell rc file."
|
|
172
|
+
);
|
|
173
|
+
addResult(
|
|
174
|
+
results,
|
|
175
|
+
"launcher sh",
|
|
176
|
+
fs.existsSync(unixLauncherPath),
|
|
177
|
+
unixLauncherPath,
|
|
178
|
+
"Run setup again to create a launcher with LANGFUSE_* variables."
|
|
179
|
+
);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
const w = Math.max(...results.map((r) => r.item.length)) + 2;
|
|
183
|
+
const failed = [];
|
|
184
|
+
for (const r of results) {
|
|
185
|
+
const status = r.ok ? "OK " : "BAD";
|
|
186
|
+
const pad = (s, n) => (s.length >= n ? s : s + " ".repeat(n - s.length));
|
|
187
|
+
console.log(`${status} ${pad(r.item, w)} ${r.detail}`);
|
|
188
|
+
if (!r.ok) failed.push(r);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
if (failed.length) {
|
|
192
|
+
console.log("");
|
|
193
|
+
console.log("Fix suggestions:");
|
|
194
|
+
for (const r of failed) {
|
|
195
|
+
if (r.fix) console.log(`- ${r.item}: ${r.fix}`);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
process.exit(failed.length ? 2 : 0);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
try {
|
|
203
|
+
parseArgs(process.argv.slice(2));
|
|
204
|
+
main();
|
|
205
|
+
} catch (e) {
|
|
206
|
+
console.error(e?.message || String(e));
|
|
207
|
+
process.exit(1);
|
|
208
|
+
}
|
|
@@ -3,22 +3,22 @@ import { fileURLToPath } from "node:url";
|
|
|
3
3
|
import { spawnSync } from "node:child_process";
|
|
4
4
|
import { resolveOpencodeCli } from "./resolve-opencode-cli.mjs";
|
|
5
5
|
|
|
6
|
-
const USER_ID_PATTERN = /^[a-z](?:\d{8}|wx\d{7})$/;
|
|
7
|
-
const USER_ID_PATTERN_TEXT = "^[a-z](?:\\d{8}|wx\\d{7})$";
|
|
8
|
-
const DEFAULT_LANGFUSE_BASE_URL = "https://metrics.openharmonyinsight.cn";
|
|
9
|
-
const LEGACY_LANGFUSE_BASE_URLS = new Set([
|
|
10
|
-
"http://120.46.221.227:3000",
|
|
11
|
-
"https://120.46.221.227:3000",
|
|
12
|
-
]);
|
|
13
|
-
|
|
14
|
-
function normalizeLegacyBaseUrl(baseUrl) {
|
|
15
|
-
const value = String(baseUrl || "").trim().replace(/\/+$/, "");
|
|
16
|
-
return LEGACY_LANGFUSE_BASE_URLS.has(value) ? DEFAULT_LANGFUSE_BASE_URL : baseUrl;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function normalizeUserId(v) {
|
|
20
|
-
return String(v || "").trim();
|
|
21
|
-
}
|
|
6
|
+
const USER_ID_PATTERN = /^[a-z](?:\d{8}|wx\d{7})$/;
|
|
7
|
+
const USER_ID_PATTERN_TEXT = "^[a-z](?:\\d{8}|wx\\d{7})$";
|
|
8
|
+
const DEFAULT_LANGFUSE_BASE_URL = "https://metrics.openharmonyinsight.cn";
|
|
9
|
+
const LEGACY_LANGFUSE_BASE_URLS = new Set([
|
|
10
|
+
"http://120.46.221.227:3000",
|
|
11
|
+
"https://120.46.221.227:3000",
|
|
12
|
+
]);
|
|
13
|
+
|
|
14
|
+
function normalizeLegacyBaseUrl(baseUrl) {
|
|
15
|
+
const value = String(baseUrl || "").trim().replace(/\/+$/, "");
|
|
16
|
+
return LEGACY_LANGFUSE_BASE_URLS.has(value) ? DEFAULT_LANGFUSE_BASE_URL : baseUrl;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function normalizeUserId(v) {
|
|
20
|
+
return String(v || "").trim();
|
|
21
|
+
}
|
|
22
22
|
|
|
23
23
|
function assertValidUserId(userId) {
|
|
24
24
|
if (!USER_ID_PATTERN.test(normalizeUserId(userId))) {
|
|
@@ -52,7 +52,7 @@ function main() {
|
|
|
52
52
|
args.publicKey || process.env.LANGFUSE_PUBLIC_KEY || "pk-lf-da0c90a7-6e93-4eb7-bb86-c1047c8d187d";
|
|
53
53
|
const secretKey =
|
|
54
54
|
args.secretKey || process.env.LANGFUSE_SECRET_KEY || "sk-lf-0269b85d-bfdc-442c-bfa3-e737954e3315";
|
|
55
|
-
const baseUrl = normalizeLegacyBaseUrl(args.langfuseBaseUrl || process.env.LANGFUSE_BASEURL || DEFAULT_LANGFUSE_BASE_URL);
|
|
55
|
+
const baseUrl = normalizeLegacyBaseUrl(args.langfuseBaseUrl || process.env.LANGFUSE_BASEURL || DEFAULT_LANGFUSE_BASE_URL);
|
|
56
56
|
const userId = normalizeUserId(args.userId || args.userid || "");
|
|
57
57
|
if (!userId) {
|
|
58
58
|
throw new Error("Missing userId. Run with --userId=your-id.");
|
|
@@ -64,10 +64,10 @@ function main() {
|
|
|
64
64
|
const setupPath = path.join(scriptsDir, "opencode-langfuse-setup.mjs");
|
|
65
65
|
const setupExtra = [];
|
|
66
66
|
if (args["no-set-env"]) setupExtra.push("--no-set-env");
|
|
67
|
-
if (args["skip-plugin-install"]) setupExtra.push("--skip-plugin-install");
|
|
68
|
-
if (userId) setupExtra.push(`--userId=${userId}`);
|
|
69
|
-
setupExtra.push(`--langfuseBaseUrl=${baseUrl}`);
|
|
70
|
-
runNodeScript(setupPath, setupExtra);
|
|
67
|
+
if (args["skip-plugin-install"]) setupExtra.push("--skip-plugin-install");
|
|
68
|
+
if (userId) setupExtra.push(`--userId=${userId}`);
|
|
69
|
+
setupExtra.push(`--langfuseBaseUrl=${baseUrl}`);
|
|
70
|
+
runNodeScript(setupPath, setupExtra);
|
|
71
71
|
|
|
72
72
|
// 2) 直接带环境变量启动 opencode(本进程内有效)
|
|
73
73
|
const cmdArg = args.cmd || "opencode";
|