@openclaw-caribbean/protocol 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.
@@ -0,0 +1,2 @@
1
+ export * from './messages';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ export * from './messages';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
@@ -0,0 +1,58 @@
1
+ import type { NodeStatus } from '@openclaw-caribbean/shared';
2
+ export type MessageType = 'heartbeat' | 'command' | 'connect' | 'disconnect' | 'ack' | 'connected' | 'result';
3
+ export interface BaseMessage {
4
+ type: MessageType;
5
+ timestamp: string;
6
+ }
7
+ export interface HeartbeatMessage extends BaseMessage {
8
+ type: 'heartbeat';
9
+ payload: {
10
+ nodeId: string;
11
+ timestamp: string;
12
+ status: NodeStatus;
13
+ };
14
+ }
15
+ export interface CommandMessage extends BaseMessage {
16
+ type: 'command';
17
+ id: string;
18
+ action: string;
19
+ params: Record<string, unknown>;
20
+ }
21
+ export interface ConnectMessage extends BaseMessage {
22
+ type: 'connect';
23
+ payload: {
24
+ nodeId?: string;
25
+ name: string;
26
+ tags: string[];
27
+ version: string;
28
+ clientIp?: string;
29
+ };
30
+ }
31
+ export interface ConnectedMessage extends BaseMessage {
32
+ type: 'connected';
33
+ payload: {
34
+ nodeId: string;
35
+ };
36
+ }
37
+ export interface DisconnectMessage extends BaseMessage {
38
+ type: 'disconnect';
39
+ payload: {
40
+ nodeId: string;
41
+ reason: string;
42
+ };
43
+ }
44
+ export interface AckMessage extends BaseMessage {
45
+ type: 'ack';
46
+ id: string;
47
+ success: boolean;
48
+ error?: string;
49
+ }
50
+ export interface ResultMessage extends BaseMessage {
51
+ type: 'result';
52
+ id: string;
53
+ success: boolean;
54
+ error?: string;
55
+ data?: unknown;
56
+ }
57
+ export type Message = HeartbeatMessage | CommandMessage | ConnectMessage | ConnectedMessage | DisconnectMessage | AckMessage | ResultMessage;
58
+ //# sourceMappingURL=messages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../src/messages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAE7D,MAAM,MAAM,WAAW,GAAG,WAAW,GAAG,SAAS,GAAG,SAAS,GAAG,YAAY,GAAG,KAAK,GAAG,WAAW,GAAG,QAAQ,CAAC;AAE9G,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,WAAW,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD,IAAI,EAAE,WAAW,CAAC;IAClB,OAAO,EAAE;QACP,MAAM,EAAE,MAAM,CAAC;QACf,SAAS,EAAE,MAAM,CAAC;QAClB,MAAM,EAAE,UAAU,CAAC;KACpB,CAAC;CACH;AAED,MAAM,WAAW,cAAe,SAAQ,WAAW;IACjD,IAAI,EAAE,SAAS,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC;AAED,MAAM,WAAW,cAAe,SAAQ,WAAW;IACjD,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,EAAE;QACP,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,EAAE,CAAC;QACf,OAAO,EAAE,MAAM,CAAC;QAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC;CACH;AAED,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD,IAAI,EAAE,WAAW,CAAC;IAClB,OAAO,EAAE;QACP,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;CACH;AAED,MAAM,WAAW,iBAAkB,SAAQ,WAAW;IACpD,IAAI,EAAE,YAAY,CAAC;IACnB,OAAO,EAAE;QACP,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;CACH;AAED,MAAM,WAAW,UAAW,SAAQ,WAAW;IAC7C,IAAI,EAAE,KAAK,CAAC;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,aAAc,SAAQ,WAAW;IAChD,IAAI,EAAE,QAAQ,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,MAAM,OAAO,GAAG,gBAAgB,GAAG,cAAc,GAAG,cAAc,GAAG,gBAAgB,GAAG,iBAAiB,GAAG,UAAU,GAAG,aAAa,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=messages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messages.js","sourceRoot":"","sources":["../src/messages.ts"],"names":[],"mappings":""}
package/package.json ADDED
@@ -0,0 +1,26 @@
1
+ {
2
+ "name": "@openclaw-caribbean/protocol",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "main": "./dist/index.js",
6
+ "types": "./dist/index.d.ts",
7
+ "exports": "./dist/index.js",
8
+ "files": [
9
+ "dist"
10
+ ],
11
+ "publishConfig": {
12
+ "access": "public"
13
+ },
14
+ "scripts": {
15
+ "build": "tsc",
16
+ "dev": "tsc --watch",
17
+ "clean": "rm -rf dist",
18
+ "prepublishOnly": "pnpm run build"
19
+ },
20
+ "dependencies": {
21
+ "@openclaw-caribbean/shared": "workspace:*"
22
+ },
23
+ "devDependencies": {
24
+ "typescript": "^5.3.3"
25
+ }
26
+ }