@elizaos/server 1.1.5 → 1.1.6

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 CHANGED
@@ -127,6 +127,7 @@ interface ServerOptions {
127
127
  middlewares?: ServerMiddleware[];
128
128
  dataDir?: string;
129
129
  postgresUrl?: string;
130
+ clientPath?: string;
130
131
  }
131
132
  /**
132
133
  * Determines if the web UI should be enabled based on environment variables.
@@ -146,6 +147,7 @@ declare class AgentServer {
146
147
  socketIO: Server;
147
148
  isInitialized: boolean;
148
149
  private isWebUIEnabled;
150
+ private clientPath?;
149
151
  database: DatabaseAdapter;
150
152
  startAgent: (character: Character) => Promise<IAgentRuntime>;
151
153
  stopAgent: (runtime: IAgentRuntime) => void;
package/dist/index.js CHANGED
@@ -3817,7 +3817,7 @@ import express28 from "express";
3817
3817
  // package.json
3818
3818
  var package_default = {
3819
3819
  name: "@elizaos/server",
3820
- version: "1.1.5",
3820
+ version: "1.1.6",
3821
3821
  description: "ElizaOS Server - Core server infrastructure for ElizaOS agents",
3822
3822
  publishConfig: {
3823
3823
  access: "public",
@@ -3869,10 +3869,10 @@ var package_default = {
3869
3869
  which: "^4.0.0",
3870
3870
  ws: "^8.18.0"
3871
3871
  },
3872
- gitHead: "4d7e96cd1335e2764cc913b40d31abe18a6c8400",
3872
+ gitHead: "0e840205db9f212b2b5568b26b669a9860256099",
3873
3873
  dependencies: {
3874
- "@elizaos/core": "1.1.5",
3875
- "@elizaos/plugin-sql": "1.1.5",
3874
+ "@elizaos/core": "1.1.6",
3875
+ "@elizaos/plugin-sql": "1.1.6",
3876
3876
  "@types/express": "^5.0.2",
3877
3877
  "@types/helmet": "^4.0.0",
3878
3878
  "@types/multer": "^1.4.13",
@@ -5567,6 +5567,8 @@ var AgentServer = class {
5567
5567
  // Flag to prevent double initialization
5568
5568
  isWebUIEnabled = true;
5569
5569
  // Default to enabled until initialized
5570
+ clientPath;
5571
+ // Optional path to client dist files
5570
5572
  database;
5571
5573
  startAgent;
5572
5574
  stopAgent;
@@ -5709,6 +5711,9 @@ var AgentServer = class {
5709
5711
  */
5710
5712
  async initializeServer(options) {
5711
5713
  try {
5714
+ if (options?.clientPath) {
5715
+ this.clientPath = options.clientPath;
5716
+ }
5712
5717
  this.app = express31();
5713
5718
  const isProd = process.env.NODE_ENV === "production";
5714
5719
  logger29.debug("Setting up security headers...");
@@ -5946,6 +5951,8 @@ var AgentServer = class {
5946
5951
  let clientPath = null;
5947
5952
  if (this.isWebUIEnabled) {
5948
5953
  const possiblePaths = [
5954
+ // First priority: explicitly provided client path
5955
+ this.clientPath,
5949
5956
  // Development: relative to server package (monorepo)
5950
5957
  path9.resolve(__dirname2, "../../cli/dist"),
5951
5958
  // Production: using require.resolve to find CLI package (if installed as dependency)
@@ -5959,6 +5966,25 @@ var AgentServer = class {
5959
5966
  return null;
5960
5967
  }
5961
5968
  })(),
5969
+ // Check if running from global CLI - look for client files in the same directory as the running process
5970
+ (() => {
5971
+ try {
5972
+ if (process.argv[1]) {
5973
+ const cliPath = path9.dirname(process.argv[1]);
5974
+ const possibleDistPath = path9.join(cliPath, "index.html");
5975
+ if (existsSync3(possibleDistPath)) {
5976
+ return cliPath;
5977
+ }
5978
+ const parentPath = path9.dirname(cliPath);
5979
+ const possibleParentDistPath = path9.join(parentPath, "index.html");
5980
+ if (existsSync3(possibleParentDistPath)) {
5981
+ return parentPath;
5982
+ }
5983
+ }
5984
+ } catch {
5985
+ }
5986
+ return null;
5987
+ })(),
5962
5988
  // Global bun install: check global node_modules locations
5963
5989
  (() => {
5964
5990
  try {
@@ -6010,6 +6036,9 @@ var AgentServer = class {
6010
6036
  })()
6011
6037
  ].filter(Boolean)
6012
6038
  ].filter(Boolean);
6039
+ logger29.debug(`[STATIC] process.argv[0]: ${process.argv[0]}`);
6040
+ logger29.debug(`[STATIC] process.argv[1]: ${process.argv[1]}`);
6041
+ logger29.debug(`[STATIC] __dirname: ${__dirname2}`);
6013
6042
  for (const possiblePath of possiblePaths) {
6014
6043
  if (possiblePath && existsSync3(path9.join(possiblePath, "index.html"))) {
6015
6044
  clientPath = possiblePath;