@openclaw-cloud/agent-controller 0.1.3 → 0.1.5
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/.husky/pre-commit +1 -0
- package/CLAUDE.md +59 -0
- package/__tests__/api.test.ts +123 -0
- package/__tests__/board-handler.test.ts +6 -3
- package/__tests__/chat.test.ts +191 -0
- package/__tests__/config.test.ts +100 -0
- package/__tests__/file-write.test.ts +119 -0
- package/__tests__/gateway-adapter.test.ts +366 -0
- package/__tests__/gateway-client.test.ts +272 -0
- package/__tests__/onboarding.test.ts +55 -0
- package/__tests__/package-install.test.ts +109 -0
- package/__tests__/pair.test.ts +60 -0
- package/__tests__/self-update.test.ts +123 -0
- package/__tests__/stop.test.ts +38 -0
- package/bin/agent-controller.js +15 -2
- package/dist/commands/self-update.d.ts +1 -0
- package/dist/commands/self-update.js +41 -0
- package/dist/commands/self-update.js.map +1 -0
- package/dist/connection.js +24 -0
- package/dist/connection.js.map +1 -1
- package/dist/handlers/board-handler.d.ts +1 -0
- package/dist/handlers/board-handler.js +5 -2
- package/dist/handlers/board-handler.js.map +1 -1
- package/dist/handlers/chat.d.ts +4 -0
- package/dist/handlers/chat.js +62 -0
- package/dist/handlers/chat.js.map +1 -0
- package/dist/handlers/file-write.d.ts +2 -0
- package/dist/handlers/file-write.js +59 -0
- package/dist/handlers/file-write.js.map +1 -0
- package/dist/handlers/onboarding.d.ts +2 -0
- package/dist/handlers/onboarding.js +18 -0
- package/dist/handlers/onboarding.js.map +1 -0
- package/dist/handlers/package-install.d.ts +2 -0
- package/dist/handlers/package-install.js +59 -0
- package/dist/handlers/package-install.js.map +1 -0
- package/dist/index.js +18 -3
- package/dist/index.js.map +1 -1
- package/dist/openclaw/gateway-adapter.d.ts +22 -0
- package/dist/openclaw/gateway-adapter.js +108 -0
- package/dist/openclaw/gateway-adapter.js.map +1 -0
- package/dist/openclaw/gateway-client.d.ts +21 -0
- package/dist/openclaw/gateway-client.js +114 -0
- package/dist/openclaw/gateway-client.js.map +1 -0
- package/dist/openclaw/index.d.ts +8 -0
- package/dist/openclaw/index.js +12 -0
- package/dist/openclaw/index.js.map +1 -0
- package/dist/openclaw/types.d.ts +36 -0
- package/dist/openclaw/types.js +2 -0
- package/dist/openclaw/types.js.map +1 -0
- package/dist/types.d.ts +2 -1
- package/package.json +4 -2
- package/src/commands/self-update.ts +43 -0
- package/src/connection.ts +25 -0
- package/src/handlers/board-handler.ts +5 -2
- package/src/handlers/chat.ts +79 -0
- package/src/handlers/file-write.ts +65 -0
- package/src/handlers/onboarding.ts +19 -0
- package/src/handlers/package-install.ts +69 -0
- package/src/index.ts +19 -3
- package/src/openclaw/gateway-adapter.ts +129 -0
- package/src/openclaw/gateway-client.ts +131 -0
- package/src/openclaw/index.ts +17 -0
- package/src/openclaw/types.ts +41 -0
- package/src/types.ts +5 -1
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export interface ChatSession {
|
|
2
|
+
key: string;
|
|
3
|
+
sessionId: string;
|
|
4
|
+
kind: string;
|
|
5
|
+
updatedAt: number;
|
|
6
|
+
model?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface ChatMessage {
|
|
10
|
+
role: 'user' | 'assistant';
|
|
11
|
+
content: string; // normalized to plain text
|
|
12
|
+
timestamp: string; // ISO 8601
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface ChatAttachment {
|
|
16
|
+
type: 'image';
|
|
17
|
+
mimeType: string;
|
|
18
|
+
content: string; // base64
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface IChatProvider {
|
|
22
|
+
listSessions(): Promise<ChatSession[]>;
|
|
23
|
+
getHistory(sessionKey: string, limit?: number): Promise<ChatMessage[]>;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Send message. Returns after the agent finishes (full response).
|
|
27
|
+
* Calls onDelta with accumulated text during streaming.
|
|
28
|
+
* Calls onDone when agent response is complete.
|
|
29
|
+
*/
|
|
30
|
+
sendMessage(params: {
|
|
31
|
+
sessionKey: string;
|
|
32
|
+
text: string;
|
|
33
|
+
idempotencyKey: string;
|
|
34
|
+
attachments?: ChatAttachment[];
|
|
35
|
+
onDelta?: (accumulatedText: string) => void;
|
|
36
|
+
onDone?: (finalText: string) => void;
|
|
37
|
+
onError?: (error: string) => void;
|
|
38
|
+
}): Promise<void>;
|
|
39
|
+
|
|
40
|
+
abort(sessionKey: string, runId?: string): Promise<void>;
|
|
41
|
+
}
|
package/src/types.ts
CHANGED
|
@@ -4,7 +4,10 @@
|
|
|
4
4
|
* heartbeat:<agentId> — heartbeat publications from agent
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
export type CommandType =
|
|
7
|
+
export type CommandType =
|
|
8
|
+
| 'exec' | 'restart' | 'deploy' | 'config' | 'pair' | 'stop' | 'backup'
|
|
9
|
+
| 'chat_list_sessions' | 'chat_history' | 'chat_send'
|
|
10
|
+
| 'package_install' | 'file_write' | 'onboarding_complete';
|
|
8
11
|
|
|
9
12
|
export interface AgentCommand {
|
|
10
13
|
id: string;
|
|
@@ -56,6 +59,7 @@ export interface BoardEvent {
|
|
|
56
59
|
export interface BoardInfo {
|
|
57
60
|
board: {
|
|
58
61
|
id: string;
|
|
62
|
+
workspaceId: string;
|
|
59
63
|
columns: Array<{
|
|
60
64
|
id: string;
|
|
61
65
|
name: string;
|