@elizaos/server 1.0.14 → 1.0.15
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/index.d.ts +0 -8
- package/dist/index.js +5 -79
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -150,14 +150,6 @@ declare class AgentServer {
|
|
|
150
150
|
* @constructor
|
|
151
151
|
*/
|
|
152
152
|
constructor();
|
|
153
|
-
/**
|
|
154
|
-
* Dynamically resolves the client path based on the installation context.
|
|
155
|
-
* Handles both development and production scenarios.
|
|
156
|
-
*
|
|
157
|
-
* @returns {string} The resolved path to the client dist directory
|
|
158
|
-
* @throws {Error} If no valid client path can be found
|
|
159
|
-
*/
|
|
160
|
-
private resolveClientPath;
|
|
161
153
|
/**
|
|
162
154
|
* Initializes the database and server.
|
|
163
155
|
*
|
package/dist/index.js
CHANGED
|
@@ -4,13 +4,7 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var
|
|
8
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
9
|
-
}) : x)(function(x) {
|
|
10
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
11
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
12
|
-
});
|
|
13
|
-
var __commonJS = (cb, mod) => function __require2() {
|
|
7
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
14
8
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
15
9
|
};
|
|
16
10
|
var __copyProps = (to, from, except, desc) => {
|
|
@@ -5471,46 +5465,6 @@ var AgentServer = class {
|
|
|
5471
5465
|
throw error;
|
|
5472
5466
|
}
|
|
5473
5467
|
}
|
|
5474
|
-
/**
|
|
5475
|
-
* Dynamically resolves the client path based on the installation context.
|
|
5476
|
-
* Handles both development and production scenarios.
|
|
5477
|
-
*
|
|
5478
|
-
* @returns {string} The resolved path to the client dist directory
|
|
5479
|
-
* @throws {Error} If no valid client path can be found
|
|
5480
|
-
*/
|
|
5481
|
-
resolveClientPath() {
|
|
5482
|
-
try {
|
|
5483
|
-
const cliPackageJson = __require.resolve("@elizaos/cli/package.json");
|
|
5484
|
-
const cliDir = path9.dirname(cliPackageJson);
|
|
5485
|
-
const cliDistPath = path9.join(cliDir, "dist");
|
|
5486
|
-
if (fs9.existsSync(path9.join(cliDistPath, "index.html"))) {
|
|
5487
|
-
logger29.debug(`[CLIENT PATH] Resolved client path from npm package: ${cliDistPath}`);
|
|
5488
|
-
return cliDistPath;
|
|
5489
|
-
}
|
|
5490
|
-
} catch (e) {
|
|
5491
|
-
logger29.debug("[CLIENT PATH] Could not resolve @elizaos/cli package, trying other methods");
|
|
5492
|
-
}
|
|
5493
|
-
const relativePath = path9.resolve(__dirname2, "../../cli/dist");
|
|
5494
|
-
if (fs9.existsSync(path9.join(relativePath, "index.html"))) {
|
|
5495
|
-
logger29.debug(`[CLIENT PATH] Resolved client path from relative path: ${relativePath}`);
|
|
5496
|
-
return relativePath;
|
|
5497
|
-
}
|
|
5498
|
-
const cwdPath = path9.join(process.cwd(), "dist");
|
|
5499
|
-
if (fs9.existsSync(path9.join(cwdPath, "index.html"))) {
|
|
5500
|
-
logger29.debug(`[CLIENT PATH] Resolved client path from current directory: ${cwdPath}`);
|
|
5501
|
-
return cwdPath;
|
|
5502
|
-
}
|
|
5503
|
-
if (process.env.ELIZA_CLIENT_PATH) {
|
|
5504
|
-
const envPath = path9.resolve(process.env.ELIZA_CLIENT_PATH);
|
|
5505
|
-
if (fs9.existsSync(path9.join(envPath, "index.html"))) {
|
|
5506
|
-
logger29.debug(`[CLIENT PATH] Resolved client path from environment variable: ${envPath}`);
|
|
5507
|
-
return envPath;
|
|
5508
|
-
}
|
|
5509
|
-
}
|
|
5510
|
-
throw new Error(
|
|
5511
|
-
"Unable to locate client files. Please ensure @elizaos/cli is properly installed."
|
|
5512
|
-
);
|
|
5513
|
-
}
|
|
5514
5468
|
/**
|
|
5515
5469
|
* Initializes the database and server.
|
|
5516
5470
|
*
|
|
@@ -5854,14 +5808,8 @@ var AgentServer = class {
|
|
|
5854
5808
|
}
|
|
5855
5809
|
}
|
|
5856
5810
|
};
|
|
5857
|
-
|
|
5858
|
-
|
|
5859
|
-
this.app.use(express30.static(clientPath, staticOptions));
|
|
5860
|
-
logger29.info(`[STATIC] Serving client files from: ${clientPath}`);
|
|
5861
|
-
} catch (error) {
|
|
5862
|
-
logger29.error("[STATIC] Failed to resolve client path:", error);
|
|
5863
|
-
logger29.warn("[STATIC] Client UI will not be available. API endpoints will still work.");
|
|
5864
|
-
}
|
|
5811
|
+
const clientPath = path9.resolve(__dirname2, "../../cli/dist");
|
|
5812
|
+
this.app.use(express30.static(clientPath, staticOptions));
|
|
5865
5813
|
const pluginRouteHandler = createPluginRouteHandler(this.agents);
|
|
5866
5814
|
this.app.use(pluginRouteHandler);
|
|
5867
5815
|
const apiRouter = createApiRouter(this.agents, this);
|
|
@@ -5903,30 +5851,8 @@ var AgentServer = class {
|
|
|
5903
5851
|
res.setHeader("Content-Type", "application/javascript");
|
|
5904
5852
|
return res.status(404).send(`// JavaScript module not found: ${req.path}`);
|
|
5905
5853
|
}
|
|
5906
|
-
|
|
5907
|
-
|
|
5908
|
-
res.sendFile(path9.join(cliDistPath, "index.html"), (err) => {
|
|
5909
|
-
if (err && !res.headersSent) {
|
|
5910
|
-
logger29.error("[STATIC] Failed to serve index.html:", err);
|
|
5911
|
-
res.status(404).json({
|
|
5912
|
-
success: false,
|
|
5913
|
-
error: {
|
|
5914
|
-
message: "Client UI not available. Please ensure @elizaos/cli is properly installed.",
|
|
5915
|
-
code: 404
|
|
5916
|
-
}
|
|
5917
|
-
});
|
|
5918
|
-
}
|
|
5919
|
-
});
|
|
5920
|
-
} catch (error) {
|
|
5921
|
-
logger29.error("[STATIC] Failed to resolve client path for fallback route:", error);
|
|
5922
|
-
res.status(404).json({
|
|
5923
|
-
success: false,
|
|
5924
|
-
error: {
|
|
5925
|
-
message: "Client UI not available. API endpoints are still accessible at /api/*",
|
|
5926
|
-
code: 404
|
|
5927
|
-
}
|
|
5928
|
-
});
|
|
5929
|
-
}
|
|
5854
|
+
const cliDistPath = path9.resolve(__dirname2, "../../cli/dist");
|
|
5855
|
+
res.sendFile(path9.join(cliDistPath, "index.html"));
|
|
5930
5856
|
});
|
|
5931
5857
|
this.server = http.createServer(this.app);
|
|
5932
5858
|
this.socketIO = setupSocketIO(this.server, this.agents, this);
|