@elizaos/server 1.1.0 → 1.1.2

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.js CHANGED
@@ -392,7 +392,6 @@ import { fileURLToPath as fileURLToPath2 } from "url";
392
392
  // src/api/index.ts
393
393
  var import_cors = __toESM(require_lib(), 1);
394
394
  import { logger as logger25, validateUuid as validateUuid21 } from "@elizaos/core";
395
- import bodyParser from "body-parser";
396
395
  import express30 from "express";
397
396
  import helmet from "helmet";
398
397
  import { match } from "path-to-regexp";
@@ -3811,7 +3810,7 @@ import express28 from "express";
3811
3810
  // package.json
3812
3811
  var package_default = {
3813
3812
  name: "@elizaos/server",
3814
- version: "1.0.19",
3813
+ version: "1.1.2",
3815
3814
  description: "ElizaOS Server - Core server infrastructure for ElizaOS agents",
3816
3815
  publishConfig: {
3817
3816
  access: "public",
@@ -3863,10 +3862,10 @@ var package_default = {
3863
3862
  which: "^4.0.0",
3864
3863
  ws: "^8.18.0"
3865
3864
  },
3866
- gitHead: "d5bd5c43bfebeb7ac02f9e029f924cb6cd5c2ec7",
3865
+ gitHead: "fc0714c773d1bb917ffafab7ad8db6eab116d642",
3867
3866
  dependencies: {
3868
- "@elizaos/core": "workspace:*",
3869
- "@elizaos/plugin-sql": "workspace:*",
3867
+ "@elizaos/core": "1.1.2",
3868
+ "@elizaos/plugin-sql": "1.1.2",
3870
3869
  "@types/express": "^5.0.2",
3871
3870
  "@types/helmet": "^4.0.0",
3872
3871
  "@types/multer": "^1.4.13",
@@ -4601,17 +4600,6 @@ function createApiRouter(agents, serverInstance) {
4601
4600
  router.use(securityMiddleware());
4602
4601
  router.use("/media", mediaRouter());
4603
4602
  router.use(validateContentTypeMiddleware());
4604
- router.use(
4605
- bodyParser.json({
4606
- limit: process.env.EXPRESS_MAX_PAYLOAD || "100kb"
4607
- })
4608
- );
4609
- router.use(
4610
- bodyParser.urlencoded({
4611
- extended: true,
4612
- limit: process.env.EXPRESS_MAX_PAYLOAD || "100kb"
4613
- })
4614
- );
4615
4603
  router.use("/agents", agentsRouter(agents, serverInstance));
4616
4604
  router.use("/messaging", messagingRouter(agents, serverInstance));
4617
4605
  router.use("/memory", memoryRouter(agents, serverInstance));
@@ -5817,7 +5805,6 @@ var AgentServer = class {
5817
5805
  fs9.mkdirSync(generatedBasePath, { recursive: true });
5818
5806
  this.app.get(
5819
5807
  "/media/uploads/agents/:agentId/:filename",
5820
- // @ts-expect-error - this is a valid express route
5821
5808
  (req, res) => {
5822
5809
  const agentId = req.params.agentId;
5823
5810
  const filename = req.params.filename;
@@ -5850,7 +5837,6 @@ var AgentServer = class {
5850
5837
  );
5851
5838
  this.app.get(
5852
5839
  "/media/generated/:agentId/:filename",
5853
- // @ts-expect-error - this is a valid express route
5854
5840
  (req, res) => {
5855
5841
  const agentId = req.params.agentId;
5856
5842
  const filename = req.params.filename;
@@ -5918,6 +5904,8 @@ var AgentServer = class {
5918
5904
  const staticOptions = {
5919
5905
  etag: true,
5920
5906
  lastModified: true,
5907
+ fallthrough: true,
5908
+ // Allow non-existent files to pass through to the catch-all route
5921
5909
  setHeaders: (res, filePath) => {
5922
5910
  const ext = extname(filePath).toLowerCase();
5923
5911
  if (ext === ".css") {
@@ -5982,7 +5970,12 @@ var AgentServer = class {
5982
5970
  return res.status(404).send(`// JavaScript module not found: ${req.path}`);
5983
5971
  }
5984
5972
  const cliDistPath = path9.resolve(__dirname2, "../../cli/dist");
5985
- res.sendFile(path9.join(cliDistPath, "index.html"));
5973
+ res.sendFile(path9.join(cliDistPath, "index.html"), (err) => {
5974
+ if (err) {
5975
+ logger29.warn(`[STATIC] Failed to serve index.html: ${err.message}`);
5976
+ res.status(404).send("Client application not found");
5977
+ }
5978
+ });
5986
5979
  });
5987
5980
  } else {
5988
5981
  this.app.use((_req, res) => {