@clawlabz/clawskin 1.0.2 → 1.0.3
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
CHANGED
|
@@ -168,6 +168,7 @@ class ClawSkinApp {
|
|
|
168
168
|
const res = await fetch('/api/config', { signal: AbortSignal.timeout(2000) });
|
|
169
169
|
if (res.ok) {
|
|
170
170
|
const config = await res.json();
|
|
171
|
+
console.log('[ClawSkin] /api/config →', JSON.stringify(config));
|
|
171
172
|
if (config?.gatewayUrl) {
|
|
172
173
|
const saved = this.settings.load();
|
|
173
174
|
const token = config.token || saved.token || '';
|
|
@@ -46,8 +46,15 @@ class GatewayClient {
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
_setState(state, detail) {
|
|
49
|
-
if (state === 'error')
|
|
50
|
-
|
|
49
|
+
if (state === 'error') {
|
|
50
|
+
this.lastError = detail || 'Unknown error';
|
|
51
|
+
console.warn('[GatewayClient]', state, detail || '');
|
|
52
|
+
} else if (state === 'connected') {
|
|
53
|
+
this.lastError = null;
|
|
54
|
+
console.log('[GatewayClient] connected');
|
|
55
|
+
} else {
|
|
56
|
+
console.log('[GatewayClient]', state, detail || '');
|
|
57
|
+
}
|
|
51
58
|
if (this.onStateChange) this.onStateChange(state, detail);
|
|
52
59
|
}
|
|
53
60
|
|
|
@@ -200,10 +207,9 @@ class GatewayClient {
|
|
|
200
207
|
params.auth.token = this.token;
|
|
201
208
|
}
|
|
202
209
|
|
|
203
|
-
// Device identity —
|
|
204
|
-
// The
|
|
205
|
-
|
|
206
|
-
if (typeof DeviceIdentity !== 'undefined') {
|
|
210
|
+
// Device identity — only needed for clients that require Ed25519 pairing
|
|
211
|
+
// (e.g. webchat-ui, control-ui). The 'webchat' client type works without it.
|
|
212
|
+
if (typeof DeviceIdentity !== 'undefined' && this.clientId !== 'webchat') {
|
|
207
213
|
try {
|
|
208
214
|
const identity = await DeviceIdentity.getOrCreate();
|
|
209
215
|
const device = await DeviceIdentity.sign(identity, {
|