keryx 0.10.7 → 0.11.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.
package/index.ts CHANGED
@@ -18,9 +18,17 @@ import "./initializers/signals";
18
18
  import "./initializers/swagger";
19
19
 
20
20
  export * from "./api";
21
+ export { HTTP_METHOD } from "./classes/Action";
21
22
  export type { ActionMiddleware } from "./classes/Action";
23
+ export { CHANNEL_NAME_PATTERN } from "./classes/Channel";
24
+ export type { ChannelMiddleware } from "./classes/Channel";
25
+ export { LogLevel } from "./classes/Logger";
22
26
  export { ErrorStatusCodes, ErrorType, TypedError } from "./classes/TypedError";
23
27
  export type { KeryxConfig } from "./config";
28
+ export type { SessionData } from "./initializers/session";
29
+ export { RateLimitMiddleware, checkRateLimit } from "./middleware/rateLimit";
30
+ export type { WebServer } from "./servers/web";
31
+ export { buildProgram } from "./util/cli";
24
32
  export { deepMerge, loadFromEnvIfSet } from "./util/config";
25
33
  export { globLoader } from "./util/glob";
26
34
  export {
@@ -321,7 +321,6 @@ export class McpInitializer extends Initializer {
321
321
 
322
322
  async stop() {
323
323
  if (!config.server.mcp.enabled) return;
324
- if (!api.mcp) return;
325
324
 
326
325
  // Close all transports
327
326
  for (const transport of api.mcp.transports.values()) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "keryx",
3
- "version": "0.10.7",
3
+ "version": "0.11.0",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -1,4 +1,4 @@
1
- import type { ActionMiddleware } from "keryx/classes/Action.ts";
1
+ import type { ActionMiddleware } from "keryx";
2
2
 
3
3
  export const {{className}}: ActionMiddleware = {
4
4
  runBefore: async (params, connection) => {
@@ -1,6 +1,5 @@
1
1
  import { z } from "zod";
2
- import { Action, type ActionParams } from "keryx";
3
- import { HTTP_METHOD } from "keryx/classes/Action.ts";
2
+ import { Action, type ActionParams, HTTP_METHOD } from "keryx";
4
3
 
5
4
  export class {{className}} implements Action {
6
5
  name = "{{name}}";
@@ -1,6 +1,5 @@
1
1
  import { z } from "zod";
2
- import { Action, type ActionParams } from "keryx";
3
- import { HTTP_METHOD } from "keryx/classes/Action.ts";
2
+ import { Action, type ActionParams, HTTP_METHOD } from "keryx";
4
3
 
5
4
  export class Hello implements Action {
6
5
  name = "hello";
@@ -3,7 +3,7 @@
3
3
  // Set rootDir before any framework code loads actions
4
4
  import "./index";
5
5
 
6
- import { buildProgram } from "keryx/util/cli.ts";
6
+ import { buildProgram } from "keryx";
7
7
  import pkg from "./package.json";
8
8
 
9
9
  const program = await buildProgram({
package/util/glob.ts CHANGED
@@ -25,26 +25,8 @@ export async function globLoader<T>(searchDir: string) {
25
25
  const fullPath = path.join(dir, file);
26
26
  const modules = (await import(fullPath)) as Record<string, unknown>;
27
27
 
28
- // Object.entries() can throw ReferenceError if an export is still in
29
- // TDZ (temporal dead zone) due to circular imports. Fall back to
30
- // per-key access so one TDZ export doesn't block the entire module.
31
- let entries: [string, unknown][];
32
- try {
33
- entries = Object.entries(modules);
34
- } catch {
35
- const keys = Object.getOwnPropertyNames(modules);
36
- entries = [];
37
- for (const key of keys) {
38
- try {
39
- entries.push([key, modules[key]]);
40
- } catch {
41
- // Skip TDZ exports — they'll be loaded by their own initializer
42
- }
43
- }
44
- }
45
-
46
- for (const [name, klass] of entries) {
47
- // Skip non-class exports (constants, functions, type remnants)
28
+ for (const [name, klass] of Object.entries(modules)) {
29
+ // Skip non-class exports (constants, enums, functions)
48
30
  if (typeof klass !== "function" || klass.prototype === undefined) {
49
31
  continue;
50
32
  }
package/util/scaffold.ts CHANGED
@@ -101,7 +101,7 @@ export async function generateConfigFileContents(): Promise<
101
101
  );
102
102
  content = content.replace(
103
103
  /from ["']\.\.\/classes\/Logger["']/g,
104
- 'from "keryx/classes/Logger.ts"',
104
+ 'from "keryx"',
105
105
  );
106
106
 
107
107
  // In index.ts, change `export const config` to `export default`
@@ -139,7 +139,7 @@ export async function generateBuiltinActionContents(): Promise<
139
139
  content = content.replace(/from ["']\.\.\/api["']/g, 'from "keryx"');
140
140
  content = content.replace(
141
141
  /from ["']\.\.\/classes\/Action["']/g,
142
- 'from "keryx/classes/Action.ts"',
142
+ 'from "keryx"',
143
143
  );
144
144
  content = content.replace(
145
145
  /from ["']\.\.\/package\.json["']/g,