@m6d/cortex-server 1.0.0 → 1.1.0

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.
@@ -111,6 +111,7 @@ export type ResolvedCortexAgentConfig = {
111
111
  knowledge?: KnowledgeConfig;
112
112
  };
113
113
  export type CortexConfig = {
114
+ port?: number;
114
115
  database: DatabaseConfig;
115
116
  storage: StorageConfig;
116
117
  auth: {
@@ -5,6 +5,7 @@ import type { AppEnv } from "./types.ts";
5
5
  export type CortexInstance = {
6
6
  serve(): Promise<{
7
7
  app: Hono<AppEnv>;
8
+ port: number;
8
9
  fetch: Hono<AppEnv>["fetch"];
9
10
  websocket: typeof websocket;
10
11
  }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m6d/cortex-server",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "Reusable AI agent chat server library for Hono + Bun",
5
5
  "license": "MIT",
6
6
  "type": "module",
package/src/config.ts CHANGED
@@ -121,6 +121,7 @@ export type ResolvedCortexAgentConfig = {
121
121
  };
122
122
 
123
123
  export type CortexConfig = {
124
+ port?: number;
124
125
  database: DatabaseConfig;
125
126
  storage: StorageConfig;
126
127
  auth: {
package/src/factory.ts CHANGED
@@ -18,6 +18,7 @@ import { extractEndpoints as extractEndpointsFn } from "./cli/extract-endpoints.
18
18
  export type CortexInstance = {
19
19
  serve(): Promise<{
20
20
  app: Hono<AppEnv>;
21
+ port: number;
21
22
  fetch: Hono<AppEnv>["fetch"];
22
23
  websocket: typeof websocket;
23
24
  }>;
@@ -104,8 +105,11 @@ export function createCortex(config: CortexConfig): CortexInstance {
104
105
 
105
106
  app.route("/agents/:agentId", agentApp);
106
107
 
108
+ const port = config.port ?? 3000;
109
+
107
110
  return {
108
111
  app,
112
+ port,
109
113
  fetch: app.fetch,
110
114
  websocket,
111
115
  };