@clawroom/sdk 0.0.1 → 0.1.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/package.json +2 -2
- package/src/client.ts +2 -2
- package/src/index.ts +2 -1
- package/src/protocol.ts +14 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clawroom/sdk",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "Claw Room SDK — WebSocket client and protocol types for connecting any agent to the Claw Room marketplace",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"types": "./src/index.ts",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
|
-
"url": "git+https://github.com/
|
|
11
|
+
"url": "git+https://github.com/clawroom/clawroom.git"
|
|
12
12
|
},
|
|
13
13
|
"keywords": [
|
|
14
14
|
"clawroom",
|
package/src/client.ts
CHANGED
|
@@ -58,8 +58,8 @@ export type ClawroomClientOptions = {
|
|
|
58
58
|
*
|
|
59
59
|
* client.onClaimAck((ack) => {
|
|
60
60
|
* if (ack.ok) {
|
|
61
|
-
* // execute the task, then send
|
|
62
|
-
* client.send({ type: "agent.
|
|
61
|
+
* // execute the task, then send complete
|
|
62
|
+
* client.send({ type: "agent.complete", taskId: ack.taskId, output: "Done!" });
|
|
63
63
|
* }
|
|
64
64
|
* });
|
|
65
65
|
*
|
package/src/index.ts
CHANGED
package/src/protocol.ts
CHANGED
|
@@ -7,6 +7,7 @@ export interface AgentHello {
|
|
|
7
7
|
type: "agent.hello";
|
|
8
8
|
deviceId: string;
|
|
9
9
|
skills: string[];
|
|
10
|
+
kind?: string;
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
export interface AgentHeartbeat {
|
|
@@ -24,11 +25,18 @@ export interface AgentResultFile {
|
|
|
24
25
|
data: string; // base64 encoded
|
|
25
26
|
}
|
|
26
27
|
|
|
27
|
-
export interface
|
|
28
|
-
type: "agent.
|
|
28
|
+
export interface AgentComplete {
|
|
29
|
+
type: "agent.complete";
|
|
29
30
|
taskId: string;
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
output: string;
|
|
32
|
+
attachments?: AgentResultFile[];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface AgentProgress {
|
|
36
|
+
type: "agent.progress";
|
|
37
|
+
taskId: string;
|
|
38
|
+
message: string;
|
|
39
|
+
percent?: number;
|
|
32
40
|
}
|
|
33
41
|
|
|
34
42
|
export interface AgentFail {
|
|
@@ -47,7 +55,8 @@ export type AgentMessage =
|
|
|
47
55
|
| AgentHello
|
|
48
56
|
| AgentHeartbeat
|
|
49
57
|
| AgentClaim
|
|
50
|
-
|
|
|
58
|
+
| AgentComplete
|
|
59
|
+
| AgentProgress
|
|
51
60
|
| AgentFail
|
|
52
61
|
| AgentRelease;
|
|
53
62
|
|