-
Notifications
You must be signed in to change notification settings - Fork 850
Expand file tree
/
Copy pathwebchannel_v1.json
More file actions
145 lines (145 loc) · 4.73 KB
/
webchannel_v1.json
File metadata and controls
145 lines (145 loc) · 4.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
{
"name": "webchannel_v1",
"version": 1,
"envelope": {
"required": [
"v",
"type",
"session_id"
],
"optional": [
"agent_id",
"request_id",
"payload",
"access_token",
"auth_token"
],
"fields": {
"v": "integer (must be 1)",
"type": "string event name",
"session_id": "string conversation/session id",
"agent_id": "string logical agent id",
"request_id": "string request correlation id",
"payload": "object event-specific payload",
"access_token": "string UI JWT (pairing mode, relay mode)",
"auth_token": "string channel token (local message_auth_mode=token)"
}
},
"events": {
"pairing_request": {
"direction": "ui_to_core",
"payload": {
"pairing_code": "string required (one-time code)",
"client_pub": "string optional base64url X25519 public key",
"client_public_key": "string optional alias for client_pub"
}
},
"pairing_result": {
"direction": "core_to_ui",
"payload": {
"ok": "boolean required",
"client_id": "string required UI identity",
"access_token": "string required JWT for subsequent relay events",
"token_type": "string required (Bearer)",
"expires_in": "integer required seconds",
"set_cookie": "string optional cookie value for relay HTTP layer",
"e2e_required": "boolean required",
"e2e": {
"alg": "string optional (x25519-chacha20poly1305-v1)",
"agent_pub": "string optional base64url X25519 public key"
}
}
},
"user_message": {
"direction": "ui_to_core",
"payload": {
"content": "string required unless payload.e2e is used",
"sender_id": "string optional",
"access_token": "string required in pairing mode (can be top-level access_token)",
"auth_token": "string required in local token mode (can be top-level auth_token)",
"e2e": {
"alg": "string optional (x25519-chacha20poly1305-v1)",
"nonce": "string required when e2e is used (base64url)",
"ciphertext": "string required when e2e is used (base64url)"
}
}
},
"assistant_chunk": {
"direction": "core_to_ui",
"payload": {
"content": "string required unless payload.e2e is used",
"e2e": {
"alg": "string optional (x25519-chacha20poly1305-v1)",
"nonce": "string required when e2e is used (base64url)",
"ciphertext": "string required when e2e is used (base64url)"
}
}
},
"assistant_final": {
"direction": "core_to_ui",
"payload": {
"content": "string required unless payload.e2e is used",
"e2e": {
"alg": "string optional (x25519-chacha20poly1305-v1)",
"nonce": "string required when e2e is used (base64url)",
"ciphertext": "string required when e2e is used (base64url)"
}
}
},
"tool_call": {
"direction": "core_to_ui",
"payload": {
"name": "string required",
"arguments": "object required"
}
},
"tool_result": {
"direction": "core_to_ui",
"payload": {
"ok": "boolean required",
"result": "any optional",
"error": "string optional"
}
},
"approval_request": {
"direction": "core_to_ui",
"payload": {
"action": "string required",
"reason": "string optional"
}
},
"approval_response": {
"direction": "ui_to_core",
"payload": {
"approved": "boolean required",
"reason": "string optional"
}
},
"error": {
"direction": "both",
"payload": {
"code": "string optional",
"message": "string required"
}
}
},
"relay_security": {
"pairing_code": {
"description": "One-time code printed by nullclaw relay connection",
"ttl_seconds": "configurable via relay_pairing_code_ttl_secs (60..300)"
},
"ui_access_token": {
"description": "JWT used by browser UI for relay user_message",
"ttl_seconds": "configurable via relay_ui_token_ttl_secs (300..2592000)"
},
"relay_agent_token": {
"description": "Dedicated relay credential for nullclaw <-> relay transport auth",
"lifecycle": "config relay_token -> env NULLCLAW_RELAY_TOKEN -> persisted auth credential -> generated token",
"ttl_seconds": "configurable via relay_token_ttl_secs (3600..31536000)"
},
"local_message_token": {
"description": "Local user_message token auth for orchestration mode",
"config": "channels.web.accounts.<id>.message_auth_mode=token + channels.web.accounts.<id>.auth_token (or NULLCLAW_WEB_TOKEN / NULLCLAW_GATEWAY_TOKEN / OPENCLAW_GATEWAY_TOKEN)"
}
}
}