@2en/clawly-plugins 1.28.0 → 1.28.1

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/config-setup.ts CHANGED
@@ -35,6 +35,7 @@ export interface ConfigPluginConfig {
35
35
  workspaceDir?: string
36
36
  defaultModel?: string
37
37
  defaultImageModel?: string
38
+ defaultHeartbeatModel?: string
38
39
  elevenlabsApiKey?: string
39
40
  modelGatewayBaseUrl?: string
40
41
  modelGatewayToken?: string
@@ -201,6 +202,20 @@ export function patchGateway(config: Record<string, unknown>): boolean {
201
202
  dirty = true
202
203
  }
203
204
 
205
+ // controlUi.allowedOrigins: enforce wildcard.
206
+ // OpenClaw v2026.2.26+ enforces origin checks for ANY browser WebSocket
207
+ // client (not just Control UI / Webchat). Without this, the Clawly web app
208
+ // fails to connect because the browser auto-sends an Origin header that
209
+ // doesn't match any allowlist entry. Wildcard is safe here — these are
210
+ // dedicated per-user sprites protected by token + device auth.
211
+ const controlUi = (gateway.controlUi ?? {}) as Record<string, unknown>
212
+ const allowedOrigins = controlUi.allowedOrigins
213
+ if (!Array.isArray(allowedOrigins) || allowedOrigins.length !== 1 || allowedOrigins[0] !== '*') {
214
+ controlUi.allowedOrigins = ['*']
215
+ gateway.controlUi = controlUi
216
+ dirty = true
217
+ }
218
+
204
219
  if (dirty) config.gateway = gateway
205
220
  return dirty
206
221
  }
@@ -454,6 +469,39 @@ export function patchMemorySearch(
454
469
  return dirty
455
470
  }
456
471
 
472
+ const DEFAULT_HEARTBEAT_MODEL = `${PROVIDER_NAME}/qwen/qwen3.5-flash-02-23`
473
+
474
+ function resolveDefaultHeartbeatModel(pc: ConfigPluginConfig): string {
475
+ return toProviderModelId(pc.defaultHeartbeatModel) || DEFAULT_HEARTBEAT_MODEL
476
+ }
477
+
478
+ export function patchHeartbeat(config: Record<string, unknown>, pc: ConfigPluginConfig): boolean {
479
+ let dirty = false
480
+ const agents = (config.agents ?? {}) as Record<string, unknown>
481
+ const defaults = (agents.defaults ?? {}) as Record<string, unknown>
482
+ const heartbeat = (defaults.heartbeat ?? {}) as Record<string, unknown>
483
+
484
+ // model: set-if-missing
485
+ if (!heartbeat.model) {
486
+ heartbeat.model = resolveDefaultHeartbeatModel(pc)
487
+ dirty = true
488
+ }
489
+
490
+ // lightContext: set-if-missing
491
+ if (heartbeat.lightContext === undefined) {
492
+ heartbeat.lightContext = true
493
+ dirty = true
494
+ }
495
+
496
+ if (dirty) {
497
+ defaults.heartbeat = heartbeat
498
+ agents.defaults = defaults
499
+ config.agents = agents
500
+ }
501
+
502
+ return dirty
503
+ }
504
+
457
505
  // TODO: Re-enable patchToolPolicy once rollback-safe (deny is sticky — rolling back
458
506
  // the plugin leaves web_search permanently denied). Tracked in ENG-1493.
459
507
  // export function patchToolPolicy(config: Record<string, unknown>, pc: ConfigPluginConfig): boolean {
@@ -608,6 +656,7 @@ function reconcileRuntimeConfig(
608
656
 
609
657
  let dirty = false
610
658
  dirty = patchAgent(config, pc) || dirty
659
+ dirty = patchHeartbeat(config, pc) || dirty
611
660
  dirty = patchGateway(config) || dirty
612
661
  dirty = patchBrowser(config) || dirty
613
662
  dirty = patchSession(config) || dirty
@@ -56,6 +56,7 @@
56
56
  "workspaceDir": { "type": "string" },
57
57
  "defaultModel": { "type": "string" },
58
58
  "defaultImageModel": { "type": "string" },
59
+ "defaultHeartbeatModel": { "type": "string" },
59
60
  "elevenlabsApiKey": { "type": "string" },
60
61
  "otelToken": { "type": "string" },
61
62
  "otelDataset": { "type": "string" },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@2en/clawly-plugins",
3
- "version": "1.28.0",
3
+ "version": "1.28.1",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "repository": {