langsmith 0.0.34 → 0.0.35
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/cli/main.cjs +0 -2
- package/dist/cli/main.js +1 -3
- package/dist/cli/main.ts +0 -3
- package/dist/utils/env.cjs +1 -45
- package/dist/utils/env.d.ts +0 -5
- package/dist/utils/env.js +0 -43
- package/package.json +1 -1
package/dist/cli/main.cjs
CHANGED
|
@@ -287,11 +287,9 @@ class SmithCommand {
|
|
|
287
287
|
}
|
|
288
288
|
async env() {
|
|
289
289
|
const env = await (0, env_js_1.getRuntimeEnvironment)();
|
|
290
|
-
const dockerEnv = await (0, env_js_1.getDockerEnvironment)();
|
|
291
290
|
const envVars = await (0, env_js_1.getLangChainEnvVars)();
|
|
292
291
|
const envDict = {
|
|
293
292
|
...env,
|
|
294
|
-
...dockerEnv,
|
|
295
293
|
...envVars,
|
|
296
294
|
};
|
|
297
295
|
// Pretty print
|
package/dist/cli/main.js
CHANGED
|
@@ -3,7 +3,7 @@ import * as path from "path";
|
|
|
3
3
|
import * as util from "util";
|
|
4
4
|
import { Command } from "commander";
|
|
5
5
|
import * as child_process from "child_process";
|
|
6
|
-
import {
|
|
6
|
+
import { getLangChainEnvVars, getRuntimeEnvironment, setEnvironmentVariable, } from "../utils/env.js";
|
|
7
7
|
import { spawn } from "child_process";
|
|
8
8
|
const currentFileName = __filename;
|
|
9
9
|
const currentDirName = __dirname;
|
|
@@ -261,11 +261,9 @@ class SmithCommand {
|
|
|
261
261
|
}
|
|
262
262
|
async env() {
|
|
263
263
|
const env = await getRuntimeEnvironment();
|
|
264
|
-
const dockerEnv = await getDockerEnvironment();
|
|
265
264
|
const envVars = await getLangChainEnvVars();
|
|
266
265
|
const envDict = {
|
|
267
266
|
...env,
|
|
268
|
-
...dockerEnv,
|
|
269
267
|
...envVars,
|
|
270
268
|
};
|
|
271
269
|
// Pretty print
|
package/dist/cli/main.ts
CHANGED
|
@@ -4,7 +4,6 @@ import * as util from "util";
|
|
|
4
4
|
import { Command } from "commander";
|
|
5
5
|
import * as child_process from "child_process";
|
|
6
6
|
import {
|
|
7
|
-
getDockerEnvironment,
|
|
8
7
|
getLangChainEnvVars,
|
|
9
8
|
getRuntimeEnvironment,
|
|
10
9
|
setEnvironmentVariable,
|
|
@@ -295,11 +294,9 @@ class SmithCommand {
|
|
|
295
294
|
|
|
296
295
|
async env() {
|
|
297
296
|
const env = await getRuntimeEnvironment();
|
|
298
|
-
const dockerEnv = await getDockerEnvironment();
|
|
299
297
|
const envVars = await getLangChainEnvVars();
|
|
300
298
|
const envDict = {
|
|
301
299
|
...env,
|
|
302
|
-
...dockerEnv,
|
|
303
300
|
...envVars,
|
|
304
301
|
};
|
|
305
302
|
// Pretty print
|
package/dist/utils/env.cjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getShas = exports.setEnvironmentVariable = exports.getEnvironmentVariable = exports.getEnvironmentVariables = exports.getLangChainEnvVars = exports.
|
|
4
|
-
const child_process_1 = require("child_process");
|
|
3
|
+
exports.getShas = exports.setEnvironmentVariable = exports.getEnvironmentVariable = exports.getEnvironmentVariables = exports.getLangChainEnvVars = exports.getRuntimeEnvironment = exports.getEnv = exports.isNode = exports.isDeno = exports.isJsDom = exports.isWebWorker = exports.isBrowser = void 0;
|
|
5
4
|
const isBrowser = () => typeof window !== "undefined" && typeof window.document !== "undefined";
|
|
6
5
|
exports.isBrowser = isBrowser;
|
|
7
6
|
const isWebWorker = () => typeof globalThis === "object" &&
|
|
@@ -60,49 +59,6 @@ async function getRuntimeEnvironment() {
|
|
|
60
59
|
return runtimeEnvironment;
|
|
61
60
|
}
|
|
62
61
|
exports.getRuntimeEnvironment = getRuntimeEnvironment;
|
|
63
|
-
async function getDockerEnvironment() {
|
|
64
|
-
const getDockerVersion = () => new Promise((resolve) => {
|
|
65
|
-
(0, child_process_1.exec)("docker --version", (error, stdout) => {
|
|
66
|
-
if (error) {
|
|
67
|
-
resolve(undefined);
|
|
68
|
-
}
|
|
69
|
-
else {
|
|
70
|
-
resolve(stdout.trim());
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
});
|
|
74
|
-
const getDockerComposeCommand = () => new Promise((resolve) => {
|
|
75
|
-
(0, child_process_1.exec)("which docker-compose", (error, stdout) => {
|
|
76
|
-
if (error) {
|
|
77
|
-
resolve(undefined);
|
|
78
|
-
}
|
|
79
|
-
else {
|
|
80
|
-
resolve(stdout.trim());
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
});
|
|
84
|
-
const getDockerComposeVersion = () => new Promise((resolve) => {
|
|
85
|
-
(0, child_process_1.exec)("docker-compose --version", (error, stdout) => {
|
|
86
|
-
if (error) {
|
|
87
|
-
resolve(undefined);
|
|
88
|
-
}
|
|
89
|
-
else {
|
|
90
|
-
resolve(stdout.trim());
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
});
|
|
94
|
-
const [dockerVersion, dockerComposeCommand, dockerComposeVersion] = await Promise.all([
|
|
95
|
-
getDockerVersion(),
|
|
96
|
-
getDockerComposeCommand(),
|
|
97
|
-
getDockerComposeVersion(),
|
|
98
|
-
]);
|
|
99
|
-
return {
|
|
100
|
-
dockerVersion,
|
|
101
|
-
dockerComposeCommand,
|
|
102
|
-
dockerComposeVersion,
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
exports.getDockerEnvironment = getDockerEnvironment;
|
|
106
62
|
/**
|
|
107
63
|
* Retrieves the LangChain-specific environment variables from the current runtime environment.
|
|
108
64
|
* Sensitive keys (containing the word "key") have their values redacted for security.
|
package/dist/utils/env.d.ts
CHANGED
|
@@ -18,11 +18,6 @@ export type RuntimeEnvironment = {
|
|
|
18
18
|
runtimeVersion?: string;
|
|
19
19
|
};
|
|
20
20
|
export declare function getRuntimeEnvironment(): Promise<RuntimeEnvironment>;
|
|
21
|
-
export declare function getDockerEnvironment(): Promise<{
|
|
22
|
-
dockerVersion: string | undefined;
|
|
23
|
-
dockerComposeCommand: string | undefined;
|
|
24
|
-
dockerComposeVersion: string | undefined;
|
|
25
|
-
}>;
|
|
26
21
|
/**
|
|
27
22
|
* Retrieves the LangChain-specific environment variables from the current runtime environment.
|
|
28
23
|
* Sensitive keys (containing the word "key") have their values redacted for security.
|
package/dist/utils/env.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { exec } from "child_process";
|
|
2
1
|
export const isBrowser = () => typeof window !== "undefined" && typeof window.document !== "undefined";
|
|
3
2
|
export const isWebWorker = () => typeof globalThis === "object" &&
|
|
4
3
|
globalThis.constructor &&
|
|
@@ -50,48 +49,6 @@ export async function getRuntimeEnvironment() {
|
|
|
50
49
|
}
|
|
51
50
|
return runtimeEnvironment;
|
|
52
51
|
}
|
|
53
|
-
export async function getDockerEnvironment() {
|
|
54
|
-
const getDockerVersion = () => new Promise((resolve) => {
|
|
55
|
-
exec("docker --version", (error, stdout) => {
|
|
56
|
-
if (error) {
|
|
57
|
-
resolve(undefined);
|
|
58
|
-
}
|
|
59
|
-
else {
|
|
60
|
-
resolve(stdout.trim());
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
const getDockerComposeCommand = () => new Promise((resolve) => {
|
|
65
|
-
exec("which docker-compose", (error, stdout) => {
|
|
66
|
-
if (error) {
|
|
67
|
-
resolve(undefined);
|
|
68
|
-
}
|
|
69
|
-
else {
|
|
70
|
-
resolve(stdout.trim());
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
});
|
|
74
|
-
const getDockerComposeVersion = () => new Promise((resolve) => {
|
|
75
|
-
exec("docker-compose --version", (error, stdout) => {
|
|
76
|
-
if (error) {
|
|
77
|
-
resolve(undefined);
|
|
78
|
-
}
|
|
79
|
-
else {
|
|
80
|
-
resolve(stdout.trim());
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
});
|
|
84
|
-
const [dockerVersion, dockerComposeCommand, dockerComposeVersion] = await Promise.all([
|
|
85
|
-
getDockerVersion(),
|
|
86
|
-
getDockerComposeCommand(),
|
|
87
|
-
getDockerComposeVersion(),
|
|
88
|
-
]);
|
|
89
|
-
return {
|
|
90
|
-
dockerVersion,
|
|
91
|
-
dockerComposeCommand,
|
|
92
|
-
dockerComposeVersion,
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
52
|
/**
|
|
96
53
|
* Retrieves the LangChain-specific environment variables from the current runtime environment.
|
|
97
54
|
* Sensitive keys (containing the word "key") have their values redacted for security.
|