echoclaw-relay-agent 0.27.0 → 0.28.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/dist/RelayAgent.d.ts +8 -0
- package/dist/chat/ChatHandler.d.ts +10 -0
- package/dist/chat/HeartbeatScheduler.d.ts +37 -0
- package/dist/{chunk-6F5HKU53.js → chunk-KQ25ZB2L.js} +1110 -183
- package/dist/cli.js +339 -270
- package/dist/core/AgentCore.d.ts +64 -0
- package/dist/core/LocalAdapter.d.ts +21 -0
- package/dist/core/RelayAdapter.d.ts +18 -0
- package/dist/core/types.d.ts +30 -0
- package/dist/gateway/OpenClawWsClient.d.ts +2 -1
- package/dist/gateway/types.d.ts +4 -4
- package/dist/index.js +88 -124
- package/dist/install/InstallHandler.d.ts +8 -3
- package/dist/local/LocalAgent.d.ts +11 -7
- package/dist/mobile/MobileDispatcher.d.ts +62 -0
- package/dist/mobile/types.d.ts +42 -0
- package/dist/sync/SyncCommandHandler.d.ts +10 -1
- package/dist/sync/WorkspaceFileReader.d.ts +17 -0
- package/package.json +1 -1
package/dist/RelayAgent.d.ts
CHANGED
|
@@ -48,6 +48,14 @@ export declare class RelayAgent extends EventEmitter {
|
|
|
48
48
|
* Returns an unsubscribe function.
|
|
49
49
|
*/
|
|
50
50
|
subscribe(event: string, cb: (payload: unknown) => void): () => void;
|
|
51
|
+
/**
|
|
52
|
+
* Send a raw (unencrypted) message through the transport.
|
|
53
|
+
* Used by MobileDispatcher to send MOBILE_DATA replies to relay-server.
|
|
54
|
+
* Does NOT go through E2E encryption — only for mobile companion protocol.
|
|
55
|
+
*/
|
|
56
|
+
sendRaw(msg: object): void;
|
|
57
|
+
/** Get current session ID (pairingId). Used by MobileDispatcher. */
|
|
58
|
+
getSessionId(): string;
|
|
51
59
|
/** Manual restart of OpenClaw process. Bypasses watchdog rate limit. */
|
|
52
60
|
manualRestart(): Promise<{
|
|
53
61
|
success: boolean;
|
|
@@ -30,6 +30,8 @@
|
|
|
30
30
|
* - chat_user_echo: user message from external port (Feishu/WeChat/Web)
|
|
31
31
|
*/
|
|
32
32
|
import { OpenClawWsClient } from '../gateway/OpenClawWsClient.js';
|
|
33
|
+
import { StatusInferenceEngine } from '@echoclaw/claw-engine';
|
|
34
|
+
import { HeartbeatScheduler } from './HeartbeatScheduler.js';
|
|
33
35
|
export interface ChatMessage {
|
|
34
36
|
type: string;
|
|
35
37
|
[key: string]: unknown;
|
|
@@ -108,6 +110,10 @@ export declare class ChatHandler {
|
|
|
108
110
|
private _workspaceReader;
|
|
109
111
|
/** RunIds for which task_ack has already been sent (prevents duplicate sends on accumulated deltas). */
|
|
110
112
|
private _taskAckSentRuns;
|
|
113
|
+
/** Status inference engine — produces activity states and heartbeats for Desktop. */
|
|
114
|
+
private readonly _statusEngine;
|
|
115
|
+
/** Heartbeat scheduler — manages periodic heartbeat emission per run. */
|
|
116
|
+
private readonly _heartbeatScheduler;
|
|
111
117
|
constructor(config?: ChatHandlerConfig);
|
|
112
118
|
/** Expose the underlying WS client for event listening. */
|
|
113
119
|
get client(): OpenClawWsClient;
|
|
@@ -245,4 +251,8 @@ export declare class ChatHandler {
|
|
|
245
251
|
* won't null it between the check and the call.
|
|
246
252
|
*/
|
|
247
253
|
private _sendVia;
|
|
254
|
+
/** Expose the status engine so InstallHandler can share it. */
|
|
255
|
+
get statusEngine(): StatusInferenceEngine;
|
|
256
|
+
/** Expose the heartbeat scheduler so InstallHandler can share it. */
|
|
257
|
+
get heartbeatScheduler(): HeartbeatScheduler;
|
|
248
258
|
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HeartbeatScheduler — Manages periodic heartbeat emission for a run.
|
|
3
|
+
*
|
|
4
|
+
* Shared between ChatHandler and InstallHandler to avoid duplicated
|
|
5
|
+
* timer logic. Handles:
|
|
6
|
+
* - Initial delay before first heartbeat
|
|
7
|
+
* - Periodic interval emission
|
|
8
|
+
* - Safety valve (max duration)
|
|
9
|
+
* - Clean cancellation (no orphan timers on early stop)
|
|
10
|
+
*
|
|
11
|
+
* @since v0.28.0
|
|
12
|
+
*/
|
|
13
|
+
import { StatusInferenceEngine } from '@echoclaw/claw-engine';
|
|
14
|
+
import type { TaskHeartbeat } from '@echoclaw/claw-engine';
|
|
15
|
+
type EmitFn = (heartbeat: TaskHeartbeat) => void;
|
|
16
|
+
export declare class HeartbeatScheduler {
|
|
17
|
+
private readonly _engine;
|
|
18
|
+
private readonly _emit;
|
|
19
|
+
private readonly _runs;
|
|
20
|
+
constructor(engine: StatusInferenceEngine, emit: EmitFn);
|
|
21
|
+
/**
|
|
22
|
+
* Start heartbeat tracking for a run.
|
|
23
|
+
* @param runId — OpenClaw run ID
|
|
24
|
+
* @param key — Map key for the timer (runId for chat, requestId for install)
|
|
25
|
+
* @param scope — 'chat' or 'install'
|
|
26
|
+
*/
|
|
27
|
+
start(runId: string, key: string, scope: 'chat' | 'install'): void;
|
|
28
|
+
/** Stop heartbeat for a run and clean up engine state. */
|
|
29
|
+
stop(key: string): void;
|
|
30
|
+
/** Emit a final heartbeat and then stop. */
|
|
31
|
+
emitAndStop(runId: string, key: string, scope: 'chat' | 'install'): void;
|
|
32
|
+
/** Stop all active heartbeat timers. */
|
|
33
|
+
stopAll(): void;
|
|
34
|
+
/** Emit a single heartbeat for an entry. */
|
|
35
|
+
private _emitOne;
|
|
36
|
+
}
|
|
37
|
+
export {};
|