harness-evolver 2.6.0 → 2.6.1
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/install.js +41 -13
- package/package.json +1 -1
package/bin/install.js
CHANGED
|
@@ -231,20 +231,48 @@ async function main() {
|
|
|
231
231
|
|
|
232
232
|
// LangSmith CLI
|
|
233
233
|
const hasLangsmithCli = checkCommand("langsmith-cli --version");
|
|
234
|
-
|
|
235
|
-
|
|
234
|
+
const langsmithCredsDir = process.platform === "darwin"
|
|
235
|
+
? path.join(HOME, "Library", "Application Support", "langsmith-cli")
|
|
236
|
+
: path.join(HOME, ".config", "langsmith-cli");
|
|
237
|
+
const langsmithCredsFile = path.join(langsmithCredsDir, "credentials");
|
|
238
|
+
const hasLangsmithCreds = fs.existsSync(langsmithCredsFile);
|
|
239
|
+
|
|
240
|
+
if (hasLangsmithCli && hasLangsmithCreds) {
|
|
241
|
+
console.log(` ${GREEN}✓${RESET} langsmith-cli installed and authenticated`);
|
|
236
242
|
} else {
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
243
|
+
if (!hasLangsmithCli) {
|
|
244
|
+
console.log(` ${BOLD}LangSmith CLI${RESET} — rich trace analysis (error rates, latency, token usage)`);
|
|
245
|
+
const lsAnswer = await ask(rl, `\n ${YELLOW}Install langsmith-cli? [y/N]:${RESET} `);
|
|
246
|
+
if (lsAnswer.trim().toLowerCase() === "y") {
|
|
247
|
+
console.log(`\n Installing langsmith-cli...`);
|
|
248
|
+
try {
|
|
249
|
+
execSync("uv tool install langsmith-cli", { stdio: "inherit" });
|
|
250
|
+
console.log(`\n ${GREEN}✓${RESET} langsmith-cli installed`);
|
|
251
|
+
} catch {
|
|
252
|
+
console.log(`\n ${RED}Failed.${RESET} Install manually: uv tool install langsmith-cli\n`);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
} else {
|
|
256
|
+
console.log(` ${GREEN}✓${RESET} langsmith-cli already installed`);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
// Auth — ask for API key inline if not already configured
|
|
260
|
+
if (!hasLangsmithCreds) {
|
|
261
|
+
console.log(`\n ${BOLD}LangSmith API Key${RESET} — get yours at ${DIM}https://smith.langchain.com/settings${RESET}`);
|
|
262
|
+
const apiKey = await ask(rl, ` ${YELLOW}Paste your LangSmith API key (or Enter to skip):${RESET} `);
|
|
263
|
+
const key = apiKey.trim();
|
|
264
|
+
if (key && key.startsWith("lsv2_")) {
|
|
265
|
+
try {
|
|
266
|
+
fs.mkdirSync(langsmithCredsDir, { recursive: true });
|
|
267
|
+
fs.writeFileSync(langsmithCredsFile, `LANGSMITH_API_KEY=${key}\n`);
|
|
268
|
+
console.log(` ${GREEN}✓${RESET} LangSmith API key saved`);
|
|
269
|
+
} catch {
|
|
270
|
+
console.log(` ${RED}Failed to save credentials.${RESET} Set LANGSMITH_API_KEY in your shell instead.`);
|
|
271
|
+
}
|
|
272
|
+
} else if (key) {
|
|
273
|
+
console.log(` ${YELLOW}Doesn't look like a LangSmith key (should start with lsv2_). Skipped.${RESET}`);
|
|
274
|
+
} else {
|
|
275
|
+
console.log(` ${DIM}Skipped. Set LANGSMITH_API_KEY later or run: langsmith-cli auth login${RESET}`);
|
|
248
276
|
}
|
|
249
277
|
}
|
|
250
278
|
}
|