@langwatch/server 3.1.0-beta.24 → 3.1.0-beta.26
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/package.json +1 -1
- package/packages/server/dist/cli.cjs +33 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@langwatch/server",
|
|
3
|
-
"version": "3.1.0-beta.
|
|
3
|
+
"version": "3.1.0-beta.26",
|
|
4
4
|
"description": "Run LangWatch locally with one command — `npx @langwatch/server`. Complete LangWatch stack: observability, evaluations, AI gateway, agent simulations.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://langwatch.ai",
|
|
@@ -22601,7 +22601,7 @@ async function startClickhouse(ctx, bus) {
|
|
|
22601
22601
|
if (!resolvedPath) throw new Error("clickhouse predep not resolved \u2014 run install first");
|
|
22602
22602
|
const sp = servicePaths(ctx.paths);
|
|
22603
22603
|
const configFile = (0, import_node_path27.join)(sp.clickhouseConfigDir, "config.xml");
|
|
22604
|
-
|
|
22604
|
+
writeClickhouseConfig(configFile, ctx);
|
|
22605
22605
|
const handle = supervise({
|
|
22606
22606
|
spec: {
|
|
22607
22607
|
name: "clickhouse",
|
|
@@ -22621,7 +22621,9 @@ async function startClickhouse(ctx, bus) {
|
|
|
22621
22621
|
});
|
|
22622
22622
|
if (!ready.ok) {
|
|
22623
22623
|
await handle.stop();
|
|
22624
|
-
|
|
22624
|
+
const hint = diagnoseClickhouseFailure(ctx);
|
|
22625
|
+
throw new Error(`clickhouse did not become ready: ${ready.reason}${hint ? `
|
|
22626
|
+
${hint}` : ""}`);
|
|
22625
22627
|
}
|
|
22626
22628
|
await ensureDatabase(ctx);
|
|
22627
22629
|
bus.emit({ type: "healthy", service: "clickhouse", durationMs: Date.now() - start });
|
|
@@ -22682,6 +22684,28 @@ function writeClickhouseConfig(path6, ctx) {
|
|
|
22682
22684
|
`;
|
|
22683
22685
|
(0, import_node_fs24.writeFileSync)(path6, xml);
|
|
22684
22686
|
}
|
|
22687
|
+
function diagnoseClickhouseFailure(ctx) {
|
|
22688
|
+
const errLog = (0, import_node_path27.join)(ctx.paths.logs, "clickhouse-server.err.log");
|
|
22689
|
+
if (!(0, import_node_fs24.existsSync)(errLog)) return null;
|
|
22690
|
+
let tail;
|
|
22691
|
+
try {
|
|
22692
|
+
const buf = (0, import_node_fs24.readFileSync)(errLog, "utf8");
|
|
22693
|
+
tail = buf.slice(-4e3);
|
|
22694
|
+
} catch {
|
|
22695
|
+
return null;
|
|
22696
|
+
}
|
|
22697
|
+
const portMatch = tail.match(/Listen \[127\.0\.0\.1\]:(\d+) failed: Address already in use/);
|
|
22698
|
+
if (portMatch) {
|
|
22699
|
+
const port = portMatch[1];
|
|
22700
|
+
return `\u2192 port :${port} is already bound by another process \u2014 likely a zombie clickhouse from a previous run.
|
|
22701
|
+
Investigate: lsof -iTCP:${port} -sTCP:LISTEN
|
|
22702
|
+
Quick fix: pkill -f langwatch/bin/clickhouse # then re-run npx`;
|
|
22703
|
+
}
|
|
22704
|
+
if (/Permission denied/.test(tail)) {
|
|
22705
|
+
return `\u2192 permission denied while opening files in ~/.langwatch/data/clickhouse \u2014 check directory ownership.`;
|
|
22706
|
+
}
|
|
22707
|
+
return null;
|
|
22708
|
+
}
|
|
22685
22709
|
var import_node_fs24, import_node_path27, DB_NAME;
|
|
22686
22710
|
var init_clickhouse = __esm({
|
|
22687
22711
|
"src/services/clickhouse.ts"() {
|
|
@@ -23318,7 +23342,7 @@ async function startRedis(ctx, bus) {
|
|
|
23318
23342
|
if (!resolvedPath) throw new Error("redis predep not resolved \u2014 run install first");
|
|
23319
23343
|
const sp = servicePaths(ctx.paths);
|
|
23320
23344
|
const conf = sp.redisConf;
|
|
23321
|
-
|
|
23345
|
+
writeRedisConf(conf, ctx.ports.redis, ctx.paths.redisData);
|
|
23322
23346
|
const handle = supervise({
|
|
23323
23347
|
spec: {
|
|
23324
23348
|
name: "redis",
|
|
@@ -26519,7 +26543,11 @@ var pnpmPredep = {
|
|
|
26519
26543
|
}
|
|
26520
26544
|
return { installed: false, reason: `bundled pnpm ${v2 ?? "unknown"} != pinned ${PNPM_VERSION}` };
|
|
26521
26545
|
}
|
|
26522
|
-
|
|
26546
|
+
const sysVersion = await resolveVersion4("pnpm");
|
|
26547
|
+
if (sysVersion && /^10\./.test(sysVersion)) {
|
|
26548
|
+
return { installed: true, version: sysVersion, resolvedPath: "pnpm" };
|
|
26549
|
+
}
|
|
26550
|
+
return { installed: false, reason: sysVersion ? `system pnpm ${sysVersion} is not 10.x \u2014 bundled pnpm ${PNPM_VERSION} required` : "no system pnpm on PATH; will install bundled" };
|
|
26523
26551
|
},
|
|
26524
26552
|
async install({ platform: platform5, paths: paths2, task }) {
|
|
26525
26553
|
const url = downloadUrl3(platform5);
|
|
@@ -27021,7 +27049,7 @@ var placeholderRuntime = {
|
|
|
27021
27049
|
};
|
|
27022
27050
|
|
|
27023
27051
|
// src/cli.ts
|
|
27024
|
-
var VERSION = true ? "3.1.0-beta.
|
|
27052
|
+
var VERSION = true ? "3.1.0-beta.26" : "0.0.0-dev";
|
|
27025
27053
|
async function loadRuntime() {
|
|
27026
27054
|
try {
|
|
27027
27055
|
const real = await Promise.resolve().then(() => (init_runtime(), runtime_exports));
|