@alfe.ai/openclaw 0.0.13 → 0.0.15

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
@@ -1,5 +1,6 @@
1
1
  import plugin from "./plugin.js";
2
2
  import { EventEmitter } from "node:events";
3
+ import { BaseAgentClient, BaseClientOptions } from "@alfe/agent-client";
3
4
 
4
5
  //#region src/types.d.ts
5
6
 
@@ -93,73 +94,6 @@ declare function registerWithDaemon(client: IPCClient, log: {
93
94
  error(msg: string, ...args: unknown[]): void;
94
95
  }): Promise<RegisterResult | null>;
95
96
  //#endregion
96
- //#region ../../packages-internal/agent-client/dist/types.d.ts
97
- interface BaseClientOptions {
98
- url: string;
99
- token: string;
100
- clientId: string;
101
- displayName: string;
102
- version?: string;
103
- instanceId?: string;
104
- maxPayload?: number;
105
- logger?: Logger;
106
- }
107
- interface Logger {
108
- info(msg: string, ...args: unknown[]): void;
109
- warn(msg: string, ...args: unknown[]): void;
110
- error(msg: string, ...args: unknown[]): void;
111
- debug(msg: string, ...args: unknown[]): void;
112
- }
113
- //# sourceMappingURL=types.d.ts.map
114
- //#endregion
115
- //#region ../../packages-internal/agent-client/dist/base-client.d.ts
116
- declare abstract class BaseAgentClient {
117
- private ws;
118
- private connected;
119
- private closed;
120
- private backoffMs;
121
- private pending;
122
- private readyResolve;
123
- private readyReject;
124
- private readyPromise;
125
- protected readonly log: Logger;
126
- protected readonly opts: BaseClientOptions;
127
- protected readonly instanceId: string;
128
- constructor(opts: BaseClientOptions);
129
- get isConnected(): boolean;
130
- start(): Promise<void>;
131
- stop(): void;
132
- request(method: string, params: object, opts?: {
133
- expectFinal?: boolean;
134
- timeoutMs?: number;
135
- }): Promise<unknown>;
136
- /** Perform protocol-specific handshake after WebSocket opens. */
137
- protected abstract performHandshake(): Promise<void>;
138
- /**
139
- * Handle a protocol event. Base implementation handles 'chat' events.
140
- * Subclasses should override and call super for unhandled events.
141
- */
142
- protected handleEvent(event: string, payload: unknown): void;
143
- /** Called after successful handshake. Override to add service registration, health beacons, etc. */
144
- protected onConnected(): void | Promise<void>;
145
- /** Called when the connection is lost or stopped. Override to clean up timers, etc. */
146
- protected onDisconnected(): void;
147
- /** Close the underlying WebSocket connection. Useful for subclass timeout handling. */
148
- protected closeConnection(code: number, reason: string): void;
149
- /** Mark the client as connected and resolve the ready promise. */
150
- protected setConnected(): void;
151
- /** Resolve the ready promise (call after handshake + onConnected). */
152
- protected resolveReady(): void;
153
- /** Reject the ready promise (call on handshake failure). */
154
- protected rejectReady(err: Error): void;
155
- protected doConnect(): void;
156
- private initiateHandshake;
157
- private handleMessage;
158
- private scheduleReconnect;
159
- private flushPending;
160
- }
161
- //# sourceMappingURL=base-client.d.ts.map
162
- //#endregion
163
97
  //#region src/ws-client.d.ts
164
98
  interface OpenClawClientOptions extends BaseClientOptions {
165
99
  /** Role for the connect handshake. Defaults to 'operator'. */