oh-langfuse 0.1.51 → 0.1.52
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
CHANGED
|
@@ -830,6 +830,7 @@ async function main() {
|
|
|
830
830
|
noSetEnv: !!args["no-set-env"],
|
|
831
831
|
skipPluginInstall: !!(args["skip-plugin-install"] || args.skipNpmInstall),
|
|
832
832
|
skipCheck: !!args["skip-check"],
|
|
833
|
+
startupStatus: !!(args["startup-status"] || args.startupStatus),
|
|
833
834
|
cmd: args.cmd || "",
|
|
834
835
|
configOverrides: {
|
|
835
836
|
baseUrl: args.langfuseBaseUrl || args.langfuseHost || args.host || "",
|
|
@@ -870,6 +871,7 @@ async function main() {
|
|
|
870
871
|
...(hasValue(options.npmRegistry) ? [`--npmRegistry=${options.npmRegistry}`] : []),
|
|
871
872
|
...(hasValue(options.pipIndexUrl) ? [`--pipIndexUrl=${options.pipIndexUrl}`] : []),
|
|
872
873
|
...(options.skipCheck ? ["--skip-check"] : []),
|
|
874
|
+
...(options.startupStatus ? ["--startup-status"] : []),
|
|
873
875
|
...(options.yes ? ["--yes"] : []),
|
|
874
876
|
], { ...options, quiet: true });
|
|
875
877
|
}
|
package/package.json
CHANGED
|
@@ -93,6 +93,16 @@ function printUpdateCommand(target, updateCommand) {
|
|
|
93
93
|
console.log(`${paint("[CMD]", t.bold, t.cyan)} ${updateCommand}`);
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
+
function shouldPrintStartupStatus(args, env = process.env) {
|
|
97
|
+
const raw = String(env.OH_LANGFUSE_AUTO_UPDATE_STATUS || "").trim().toLowerCase();
|
|
98
|
+
return !!(args["startup-status"] || args.startupStatus || /^(1|true|yes|on)$/i.test(raw));
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function printAlreadyCurrent(target, version) {
|
|
102
|
+
const label = targetLabel(target);
|
|
103
|
+
console.log(paint(`[OK] ${label} Langfuse \u5df2\u662f\u6700\u65b0\uff1a${packageJson.name}@${version}`, t.bold, t.green));
|
|
104
|
+
}
|
|
105
|
+
|
|
96
106
|
function runUpdate(target, args) {
|
|
97
107
|
const updateArgs = ["-y", "oh-langfuse@latest", "update", target];
|
|
98
108
|
if (args["skip-check"]) updateArgs.push("--skip-check");
|
|
@@ -134,8 +144,10 @@ async function main() {
|
|
|
134
144
|
const record = getRuntimeInstallRecord(target);
|
|
135
145
|
const installedVersion = record?.packageVersion || record?.version || "";
|
|
136
146
|
const needsUpdate = installedVersion ? isNewerVersion(latest, installedVersion) : isNewerVersion(latest, packageJson.version);
|
|
137
|
-
if (!needsUpdate
|
|
138
|
-
|
|
147
|
+
if (!needsUpdate) {
|
|
148
|
+
if (shouldPrintStartupStatus(args)) printAlreadyCurrent(target, installedVersion || packageJson.version);
|
|
149
|
+
return 0;
|
|
150
|
+
}
|
|
139
151
|
|
|
140
152
|
const message = installedVersion
|
|
141
153
|
? `oh-langfuse ${target} runtime update available: ${installedVersion} -> ${latest}.`
|
|
@@ -89,7 +89,7 @@ function writeAutoUpdateHelper(target) {
|
|
|
89
89
|
const helperDir = autoUpdateHelperDir();
|
|
90
90
|
ensureDir(helperDir);
|
|
91
91
|
const runtimePath = autoUpdateRuntimePath();
|
|
92
|
-
const fallbackArgs = ["-y", "oh-langfuse@latest", "auto-update", target, "--skip-check"];
|
|
92
|
+
const fallbackArgs = ["-y", "oh-langfuse@latest", "auto-update", target, "--skip-check", "--startup-status"];
|
|
93
93
|
|
|
94
94
|
if (process.platform === "win32") {
|
|
95
95
|
const helper = path.join(helperDir, `oh-langfuse-auto-update-${target}.cmd`);
|
|
@@ -97,7 +97,7 @@ function writeAutoUpdateHelper(target) {
|
|
|
97
97
|
"@echo off",
|
|
98
98
|
"REM Auto-generated by scripts/codex-langfuse-setup.mjs",
|
|
99
99
|
`if exist ${cmdQuote(runtimePath)} (`,
|
|
100
|
-
` call ${cmdQuote(process.execPath)} ${cmdQuote(runtimePath)} ${target} --skip-check %*`,
|
|
100
|
+
` call ${cmdQuote(process.execPath)} ${cmdQuote(runtimePath)} ${target} --skip-check --startup-status %*`,
|
|
101
101
|
") else (",
|
|
102
102
|
` call npx.cmd ${fallbackArgs.map(cmdQuote).join(" ")} %*`,
|
|
103
103
|
")",
|
|
@@ -114,7 +114,7 @@ function writeAutoUpdateHelper(target) {
|
|
|
114
114
|
"# Auto-generated by scripts/codex-langfuse-setup.mjs",
|
|
115
115
|
"set +e",
|
|
116
116
|
`if [ -f ${shQuote(runtimePath)} ]; then`,
|
|
117
|
-
` ${shQuote(process.execPath)} ${shQuote(runtimePath)} ${shQuote(target)} --skip-check "$@"`,
|
|
117
|
+
` ${shQuote(process.execPath)} ${shQuote(runtimePath)} ${shQuote(target)} --skip-check --startup-status "$@"`,
|
|
118
118
|
"else",
|
|
119
119
|
` npx ${fallbackArgs.map(shQuote).join(" ")} "$@"`,
|
|
120
120
|
"fi",
|
|
@@ -161,7 +161,7 @@ function writeAutoUpdateHelper(target) {
|
|
|
161
161
|
const helperDir = autoUpdateHelperDir();
|
|
162
162
|
ensureDir(helperDir);
|
|
163
163
|
const runtimePath = autoUpdateRuntimePath();
|
|
164
|
-
const fallbackArgs = ["-y", "oh-langfuse@latest", "auto-update", target, "--skip-check"];
|
|
164
|
+
const fallbackArgs = ["-y", "oh-langfuse@latest", "auto-update", target, "--skip-check", "--startup-status"];
|
|
165
165
|
|
|
166
166
|
if (process.platform === "win32") {
|
|
167
167
|
const helper = path.join(helperDir, `oh-langfuse-auto-update-${target}.cmd`);
|
|
@@ -169,7 +169,7 @@ function writeAutoUpdateHelper(target) {
|
|
|
169
169
|
"@echo off",
|
|
170
170
|
"REM Auto-generated by scripts/langfuse-setup.mjs",
|
|
171
171
|
`if exist ${cmdQuote(runtimePath)} (`,
|
|
172
|
-
` call ${cmdQuote(process.execPath)} ${cmdQuote(runtimePath)} ${target} --skip-check %*`,
|
|
172
|
+
` call ${cmdQuote(process.execPath)} ${cmdQuote(runtimePath)} ${target} --skip-check --startup-status %*`,
|
|
173
173
|
") else (",
|
|
174
174
|
` call npx.cmd ${fallbackArgs.map(cmdQuote).join(" ")} %*`,
|
|
175
175
|
")",
|
|
@@ -186,7 +186,7 @@ function writeAutoUpdateHelper(target) {
|
|
|
186
186
|
"# Auto-generated by scripts/langfuse-setup.mjs",
|
|
187
187
|
"set +e",
|
|
188
188
|
`if [ -f ${shQuote(runtimePath)} ]; then`,
|
|
189
|
-
` ${shQuote(process.execPath)} ${shQuote(runtimePath)} ${shQuote(target)} --skip-check "$@"`,
|
|
189
|
+
` ${shQuote(process.execPath)} ${shQuote(runtimePath)} ${shQuote(target)} --skip-check --startup-status "$@"`,
|
|
190
190
|
"else",
|
|
191
191
|
` npx ${fallbackArgs.map(shQuote).join(" ")} "$@"`,
|
|
192
192
|
"fi",
|
|
@@ -708,7 +708,7 @@ function writeAutoUpdateHelper(target) {
|
|
|
708
708
|
const helperDir = autoUpdateHelperDir();
|
|
709
709
|
ensureDir(helperDir);
|
|
710
710
|
const runtimePath = autoUpdateRuntimePath();
|
|
711
|
-
const fallbackArgs = ["-y", "oh-langfuse@latest", "auto-update", target, "--skip-check"];
|
|
711
|
+
const fallbackArgs = ["-y", "oh-langfuse@latest", "auto-update", target, "--skip-check", "--startup-status"];
|
|
712
712
|
|
|
713
713
|
if (process.platform === "win32") {
|
|
714
714
|
const helper = path.join(helperDir, `oh-langfuse-auto-update-${target}.cmd`);
|
|
@@ -716,7 +716,7 @@ function writeAutoUpdateHelper(target) {
|
|
|
716
716
|
"@echo off",
|
|
717
717
|
"REM Auto-generated by scripts/opencode-langfuse-setup.mjs",
|
|
718
718
|
`if exist ${cmdQuote(runtimePath)} (`,
|
|
719
|
-
` call ${cmdQuote(process.execPath)} ${cmdQuote(runtimePath)} ${target} --skip-check %*`,
|
|
719
|
+
` call ${cmdQuote(process.execPath)} ${cmdQuote(runtimePath)} ${target} --skip-check --startup-status %*`,
|
|
720
720
|
") else (",
|
|
721
721
|
` call npx.cmd ${fallbackArgs.map(cmdQuote).join(" ")} %*`,
|
|
722
722
|
")",
|
|
@@ -733,7 +733,7 @@ function writeAutoUpdateHelper(target) {
|
|
|
733
733
|
"# Auto-generated by scripts/opencode-langfuse-setup.mjs",
|
|
734
734
|
"set +e",
|
|
735
735
|
`if [ -f ${shQuote(runtimePath)} ]; then`,
|
|
736
|
-
` ${shQuote(process.execPath)} ${shQuote(runtimePath)} ${shQuote(target)} --skip-check "$@"`,
|
|
736
|
+
` ${shQuote(process.execPath)} ${shQuote(runtimePath)} ${shQuote(target)} --skip-check --startup-status "$@"`,
|
|
737
737
|
"else",
|
|
738
738
|
` npx ${fallbackArgs.map(shQuote).join(" ")} "$@"`,
|
|
739
739
|
"fi",
|