First upload version 0.0.1

This commit is contained in:
Neyra
2026-02-05 15:27:49 +08:00
commit 8e9b7201ed
4182 changed files with 593136 additions and 0 deletions

37
node_modules/node-llama-cpp/dist/utils/withOra.js generated vendored Normal file
View File

@@ -0,0 +1,37 @@
import ora from "ora";
import { useCiLogs } from "../config.js";
import { getConsoleLogPrefix } from "./getConsoleLogPrefix.js";
import withStatusLogs from "./withStatusLogs.js";
export default async function withOra(message, callback) {
if (useCiLogs || (typeof message !== "string" && message.useStatusLogs))
return withStatusLogs(message, callback);
const spinner = ora({
prefixText: getConsoleLogPrefix(),
...(typeof message === "string"
? { text: message }
: { loading: message.loading, success: message.success, fail: message.fail })
});
spinner.start(typeof message === "string"
? message
: message.loading);
try {
const res = await callback();
if (typeof message !== "string") {
if (message.noSuccessLiveStatus)
spinner.stop();
else
spinner.succeed(message.success);
}
else
spinner.succeed(message);
return res;
}
catch (er) {
if (typeof message !== "string")
spinner.fail(message.fail);
else
spinner.fail(message);
throw er;
}
}
//# sourceMappingURL=withOra.js.map