@uipath/llm-gateway-tool 1.206.0-preview.311 → 1.206.0-preview.323
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/dist/tool.js +73 -11
- package/package.json +2 -2
package/dist/tool.js
CHANGED
|
@@ -2082,7 +2082,7 @@ var package_default = {
|
|
|
2082
2082
|
name: "@uipath/llm-gateway-tool",
|
|
2083
2083
|
author: "UiPath",
|
|
2084
2084
|
license: "SEE LICENSE IN LICENSE.txt",
|
|
2085
|
-
version: "1.206.0-preview.
|
|
2085
|
+
version: "1.206.0-preview.323",
|
|
2086
2086
|
description: "CLI plugin for UiPath LLM Gateway model discovery.",
|
|
2087
2087
|
private: false,
|
|
2088
2088
|
repository: {
|
|
@@ -2170,12 +2170,26 @@ class NodeFileSystem {
|
|
|
2170
2170
|
throw error;
|
|
2171
2171
|
}
|
|
2172
2172
|
}
|
|
2173
|
-
async writeFile(filePath, data) {
|
|
2173
|
+
async writeFile(filePath, data, options) {
|
|
2174
2174
|
const dir = path.dirname(filePath);
|
|
2175
2175
|
if (dir) {
|
|
2176
2176
|
await fs.mkdir(dir, { recursive: true });
|
|
2177
2177
|
}
|
|
2178
|
-
|
|
2178
|
+
if (options?.mode === undefined || process.platform === "win32") {
|
|
2179
|
+
if (options?.exclusive) {
|
|
2180
|
+
await fs.writeFile(filePath, data, { flag: "wx" });
|
|
2181
|
+
} else {
|
|
2182
|
+
await fs.writeFile(filePath, data);
|
|
2183
|
+
}
|
|
2184
|
+
return;
|
|
2185
|
+
}
|
|
2186
|
+
const handle = await fs.open(filePath, options.exclusive ? "wx" : "w", options.mode);
|
|
2187
|
+
try {
|
|
2188
|
+
await handle.chmod(options.mode);
|
|
2189
|
+
await handle.writeFile(data);
|
|
2190
|
+
} finally {
|
|
2191
|
+
await handle.close();
|
|
2192
|
+
}
|
|
2179
2193
|
}
|
|
2180
2194
|
async appendFile(filePath, data) {
|
|
2181
2195
|
const dir = path.dirname(filePath);
|
|
@@ -2210,7 +2224,8 @@ class NodeFileSystem {
|
|
|
2210
2224
|
isDirectory: () => stats.isDirectory(),
|
|
2211
2225
|
size: stats.size,
|
|
2212
2226
|
mtimeMs: stats.mtimeMs,
|
|
2213
|
-
ctimeMs: stats.ctimeMs
|
|
2227
|
+
ctimeMs: stats.ctimeMs,
|
|
2228
|
+
mode: stats.mode
|
|
2214
2229
|
};
|
|
2215
2230
|
} catch (error) {
|
|
2216
2231
|
if (this.isEnoent(error))
|
|
@@ -2221,8 +2236,13 @@ class NodeFileSystem {
|
|
|
2221
2236
|
async exists(filePath) {
|
|
2222
2237
|
return existsSync(filePath);
|
|
2223
2238
|
}
|
|
2224
|
-
async mkdir(dirPath) {
|
|
2225
|
-
await fs.mkdir(dirPath, { recursive: true });
|
|
2239
|
+
async mkdir(dirPath, options) {
|
|
2240
|
+
await fs.mkdir(dirPath, { recursive: true, mode: options?.mode });
|
|
2241
|
+
}
|
|
2242
|
+
async chmod(targetPath, mode) {
|
|
2243
|
+
if (process.platform === "win32")
|
|
2244
|
+
return;
|
|
2245
|
+
await fs.chmod(targetPath, mode);
|
|
2226
2246
|
}
|
|
2227
2247
|
async acquireLock(lockPath) {
|
|
2228
2248
|
const canonicalPath = await this.canonicalizeLockTarget(lockPath);
|
|
@@ -6934,6 +6954,8 @@ function settlePromiseLike2(thenable) {
|
|
|
6934
6954
|
// ../../auth/src/constants.ts
|
|
6935
6955
|
var UIPATH_HOME_DIR = ".uipath";
|
|
6936
6956
|
var AUTH_FILENAME = ".auth";
|
|
6957
|
+
var AUTH_FILE_MODE = 384;
|
|
6958
|
+
var AUTH_DIR_MODE = 448;
|
|
6937
6959
|
var DEFAULT_BASE_URL = "https://cloud.uipath.com";
|
|
6938
6960
|
var DEFAULT_AUTH_TIMEOUT_MS2 = 5 * 60 * 1000;
|
|
6939
6961
|
|
|
@@ -7757,6 +7779,38 @@ var loadEnvFileAsync = async ({ envPath }) => {
|
|
|
7757
7779
|
}
|
|
7758
7780
|
return parseEnvContent(content);
|
|
7759
7781
|
};
|
|
7782
|
+
var findAuthHomeDir = (fs, dir) => {
|
|
7783
|
+
let current = dir;
|
|
7784
|
+
for (;; ) {
|
|
7785
|
+
if (fs.path.basename(current) === UIPATH_HOME_DIR)
|
|
7786
|
+
return current;
|
|
7787
|
+
const parent = fs.path.dirname(current);
|
|
7788
|
+
if (parent === current)
|
|
7789
|
+
return;
|
|
7790
|
+
current = parent;
|
|
7791
|
+
}
|
|
7792
|
+
};
|
|
7793
|
+
var TEMP_FILE_ATTEMPTS = 5;
|
|
7794
|
+
var isFileExists = (error) => error instanceof Error && error.code === "EEXIST";
|
|
7795
|
+
var writeTempFile = async (fs, targetPath, content) => {
|
|
7796
|
+
for (let attempt = 1;; attempt++) {
|
|
7797
|
+
const tempPath = `${targetPath}.${crypto.randomUUID()}.tmp`;
|
|
7798
|
+
try {
|
|
7799
|
+
await fs.writeFile(tempPath, content, {
|
|
7800
|
+
mode: AUTH_FILE_MODE,
|
|
7801
|
+
exclusive: true
|
|
7802
|
+
});
|
|
7803
|
+
return tempPath;
|
|
7804
|
+
} catch (error) {
|
|
7805
|
+
if (!isFileExists(error)) {
|
|
7806
|
+
await fs.rm(tempPath).catch(() => {});
|
|
7807
|
+
throw error;
|
|
7808
|
+
}
|
|
7809
|
+
if (attempt === TEMP_FILE_ATTEMPTS)
|
|
7810
|
+
throw error;
|
|
7811
|
+
}
|
|
7812
|
+
}
|
|
7813
|
+
};
|
|
7760
7814
|
var saveEnvFileAsync = async ({
|
|
7761
7815
|
envPath,
|
|
7762
7816
|
data,
|
|
@@ -7784,10 +7838,18 @@ var saveEnvFileAsync = async ({
|
|
|
7784
7838
|
`)}
|
|
7785
7839
|
`;
|
|
7786
7840
|
const dir = fs.path.dirname(absolutePath);
|
|
7787
|
-
await fs.mkdir(dir);
|
|
7788
|
-
const
|
|
7789
|
-
|
|
7790
|
-
|
|
7841
|
+
await fs.mkdir(dir, { mode: AUTH_DIR_MODE });
|
|
7842
|
+
const authHomeDir = findAuthHomeDir(fs, dir);
|
|
7843
|
+
if (authHomeDir !== undefined) {
|
|
7844
|
+
await fs.chmod?.(authHomeDir, AUTH_DIR_MODE);
|
|
7845
|
+
}
|
|
7846
|
+
const tempPath = await writeTempFile(fs, absolutePath, content);
|
|
7847
|
+
try {
|
|
7848
|
+
await fs.rename(tempPath, absolutePath);
|
|
7849
|
+
} catch (error) {
|
|
7850
|
+
await fs.rm(tempPath).catch(() => {});
|
|
7851
|
+
throw error;
|
|
7852
|
+
}
|
|
7791
7853
|
};
|
|
7792
7854
|
|
|
7793
7855
|
// ../../auth/src/loginStatus.ts
|
|
@@ -8630,4 +8692,4 @@ export {
|
|
|
8630
8692
|
registerCommands
|
|
8631
8693
|
};
|
|
8632
8694
|
|
|
8633
|
-
//# debugId=
|
|
8695
|
+
//# debugId=8B0677EC0ABC8B0864756E2164756E21
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@uipath/llm-gateway-tool",
|
|
3
3
|
"author": "UiPath",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
|
-
"version": "1.206.0-preview.
|
|
5
|
+
"version": "1.206.0-preview.323",
|
|
6
6
|
"description": "CLI plugin for UiPath LLM Gateway model discovery.",
|
|
7
7
|
"private": false,
|
|
8
8
|
"repository": {
|
|
@@ -24,5 +24,5 @@
|
|
|
24
24
|
"files": [
|
|
25
25
|
"dist"
|
|
26
26
|
],
|
|
27
|
-
"gitHead": "
|
|
27
|
+
"gitHead": "a752d8a8d78de138e3be0a19642620fec7893d99"
|
|
28
28
|
}
|