weifuwu 0.18.0 → 0.18.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.
@@ -18,9 +18,8 @@ export interface LogEntryInput {
18
18
  message: string;
19
19
  metadata?: Record<string, unknown>;
20
20
  }
21
- export interface LogdbModule {
21
+ export interface LogdbModule extends Router {
22
22
  log(input: LogEntryInput): Promise<LogEntry>;
23
- router(): Router;
24
23
  migrate(): Promise<void>;
25
24
  clean(retentionMonths: number): Promise<number>;
26
25
  close(): Promise<void>;
@@ -1,3 +1,4 @@
1
+ import type { Router } from '../router.ts';
1
2
  import type { AgentModule } from '../agent/types.ts';
2
3
  import type { PostgresClient } from '../postgres/types.ts';
3
4
  import type { Redis } from '../vendor.ts';
@@ -36,9 +37,8 @@ export interface Message {
36
37
  mime_type: string | null;
37
38
  created_at: string;
38
39
  }
39
- export interface MessagerModule {
40
+ export interface MessagerModule extends Router {
40
41
  migrate: () => Promise<void>;
41
- router: () => any;
42
42
  wsHandler: () => any;
43
43
  send: (channelId: number, content: string, opts?: {
44
44
  sender_type?: string;
@@ -74,9 +74,8 @@ export interface OpencodeOptions {
74
74
  skills?: SkillDef[];
75
75
  permissions?: OpencodePermissions;
76
76
  }
77
- export interface OpencodeModule {
77
+ export interface OpencodeModule extends Router {
78
78
  migrate: () => Promise<void>;
79
- router: () => Router | Promise<Router>;
80
79
  wsHandler: () => any;
81
80
  close: () => Promise<void>;
82
81
  }
package/dist/router.d.ts CHANGED
@@ -16,6 +16,7 @@ export declare class Router {
16
16
  private errorHandler?;
17
17
  private wss;
18
18
  use(mw: Middleware): this;
19
+ use(router: Router): this;
19
20
  use(path: string, router: Router): this;
20
21
  use(path: string, mw: Middleware): this;
21
22
  get(path: string, ...args: [...Middleware[], Handler]): this;
@@ -0,0 +1,2 @@
1
+ export declare function clearCompileCache(): void;
2
+ export declare function compileTsx(path: string): Promise<any>;
@@ -0,0 +1,2 @@
1
+ import type { Middleware } from '../types.ts';
2
+ export declare function errorBoundary(errorPath: string): Middleware;
@@ -0,0 +1,7 @@
1
+ export { ssr, ssrBundleHandler } from './ssr.ts';
2
+ export { layout } from './layout.ts';
3
+ export { tailwind } from './tailwind.ts';
4
+ export { notFound } from './not-found.ts';
5
+ export { errorBoundary } from './error-boundary.ts';
6
+ export { liveReload } from './live.ts';
7
+ export { clearCompileCache } from './compile.ts';