@inline-openclaw/inline 0.0.51 → 0.0.53

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/README.md CHANGED
@@ -39,10 +39,11 @@ Requires OpenClaw `2026.6.11` or newer.
39
39
 
40
40
  | Plugin version | OpenClaw host | Inline realtime SDK | Status | Notes |
41
41
  | --- | --- | --- | --- | --- |
42
- | `0.0.51` | `>=2026.6.11` | `0.0.12` | Current | Adds follow-mode mention gating for eligible reply/fresh Inline threads. Publish the SDK first. |
43
- | `0.0.50` | `>=2026.6.11` | `0.0.11` | Superseded | Supported line for current stable OpenClaw. Uses focused plugin SDK entrypoints and canonical ClawHub install metadata. |
44
- | `0.0.48` - `0.0.49` | `>=2026.6.11` | `0.0.11` | Superseded | Transitional 2026.6.11 compatibility releases. Prefer `0.0.51`; `0.0.49` fixed metadata shape but still used the non-canonical ClawHub spec. |
45
- | `0.0.47` and earlier | `>=2026.5.18`, tested before the `2026.6.11` floor | `0.0.11` | Legacy | Use only when an older OpenClaw host cannot be upgraded yet. Keeps the previous broad SDK compatibility path. |
42
+ | `0.0.53` | `>=2026.6.11` | `0.0.13` | Current | Clears recovered Inline WebSocket errors from channel status after reconnect. |
43
+ | `0.0.52` | `>=2026.6.11` | `0.0.13` | Stable | Patch release for the SDK protocol dependency. |
44
+ | `0.0.51` | `>=2026.6.11` | `0.0.12` | Stable | Added follow-mode mention gating for eligible reply/fresh Inline threads. |
45
+ | `0.0.50` | `>=2026.6.11` | `0.0.11` | Stable | Supported line for current stable OpenClaw. Uses focused plugin SDK entrypoints and canonical ClawHub install metadata. |
46
+ | `0.0.48` - `0.0.49` | `>=2026.6.11` | `0.0.11` | Stable | Transitional 2026.6.11 compatibility releases. `0.0.49` fixed metadata shape but still used the non-canonical ClawHub spec. |
46
47
 
47
48
  From npm:
48
49
 
@@ -46406,6 +46406,22 @@ function formatSdkLogLine(message, meta3) {
46406
46406
  return message;
46407
46407
  return `${message} ${detail}`;
46408
46408
  }
46409
+ function isRecoverableInlineConnectionError(line) {
46410
+ return /^(WebSocket (?:closed|error|reconnect scheduled)|Protocol reconnect scheduled|Ping timeout, reconnecting|Failed to send RPC request; waiting for reconnect)/.test(line);
46411
+ }
46412
+ function isInlineConnectionRecovered(diagnostics) {
46413
+ const snapshot = diagnostics;
46414
+ const protocol2 = snapshot.protocol;
46415
+ if (protocol2?.state !== "open")
46416
+ return false;
46417
+ const transport = protocol2.transport;
46418
+ if (transport?.state != null && transport.state !== "connected")
46419
+ return false;
46420
+ if (transport?.socketReadyState != null && transport.socketReadyState !== 1)
46421
+ return false;
46422
+ const pendingCount = protocol2.ping?.pendingCount;
46423
+ return typeof pendingCount !== "number" || pendingCount === 0;
46424
+ }
46409
46425
  function formatInlineOperationError(operation, error51) {
46410
46426
  const detail = summarizeSdkMeta(error51) || String(error51);
46411
46427
  return `${operation} failed: ${detail}`;
@@ -48071,10 +48087,26 @@ async function monitorInlineProvider(params) {
48071
48087
  const hasExistingState = await stat(statePath).then(() => true).catch(() => false);
48072
48088
  await mkdir2(path4.dirname(statePath), { recursive: true });
48073
48089
  let client = null;
48090
+ let currentLastError = null;
48091
+ let recoverableConnectionError = null;
48092
+ const publishStatus = (patch) => {
48093
+ if (Object.prototype.hasOwnProperty.call(patch, "lastError")) {
48094
+ currentLastError = typeof patch.lastError === "string" ? patch.lastError : null;
48095
+ if (currentLastError == null) {
48096
+ recoverableConnectionError = null;
48097
+ }
48098
+ }
48099
+ statusSink?.(patch);
48100
+ };
48074
48101
  const pushDiagnostics = (patch) => {
48075
- statusSink?.({
48076
- ...patch,
48077
- ...client ? { diagnostics: client.getDiagnostics() } : {}
48102
+ const diagnostics = client?.getDiagnostics();
48103
+ const nextPatch = { ...patch };
48104
+ if (diagnostics && !Object.prototype.hasOwnProperty.call(nextPatch, "lastError") && currentLastError != null && currentLastError === recoverableConnectionError && isInlineConnectionRecovered(diagnostics)) {
48105
+ nextPatch.lastError = null;
48106
+ }
48107
+ publishStatus({
48108
+ ...nextPatch,
48109
+ ...diagnostics ? { diagnostics } : {}
48078
48110
  });
48079
48111
  };
48080
48112
  const sdkLog = {
@@ -48083,11 +48115,21 @@ async function monitorInlineProvider(params) {
48083
48115
  warn: (msg, meta3) => {
48084
48116
  const line = formatSdkLogLine(msg, meta3);
48085
48117
  log?.warn(line);
48118
+ if (isRecoverableInlineConnectionError(line)) {
48119
+ recoverableConnectionError = line;
48120
+ } else {
48121
+ recoverableConnectionError = null;
48122
+ }
48086
48123
  pushDiagnostics({ lastError: line });
48087
48124
  },
48088
48125
  error: (msg, meta3) => {
48089
48126
  const line = formatSdkLogLine(msg, meta3);
48090
48127
  log?.error(line);
48128
+ if (isRecoverableInlineConnectionError(line)) {
48129
+ recoverableConnectionError = line;
48130
+ } else {
48131
+ recoverableConnectionError = null;
48132
+ }
48091
48133
  pushDiagnostics({ lastError: line });
48092
48134
  }
48093
48135
  };
@@ -48173,7 +48215,7 @@ async function monitorInlineProvider(params) {
48173
48215
  }
48174
48216
  hydratedParticipantChats.add(chatKey);
48175
48217
  })().catch((err) => {
48176
- statusSink?.({ lastError: `getChatParticipants failed: ${String(err)}` });
48218
+ publishStatus({ lastError: `getChatParticipants failed: ${String(err)}` });
48177
48219
  }).finally(() => {
48178
48220
  participantFetches.delete(chatKey);
48179
48221
  });
@@ -48197,7 +48239,7 @@ async function monitorInlineProvider(params) {
48197
48239
  }
48198
48240
  cachedDirectoryUserProfilesHydrated = true;
48199
48241
  })().catch((err) => {
48200
- statusSink?.({ lastError: `getChats failed: ${String(err)}` });
48242
+ publishStatus({ lastError: `getChats failed: ${String(err)}` });
48201
48243
  }).finally(() => {
48202
48244
  cachedDirectoryUserProfilesFetch = null;
48203
48245
  });
@@ -48210,7 +48252,7 @@ async function monitorInlineProvider(params) {
48210
48252
  chatInfo = await resolveChatInfo(client, chatCache, params2.chatId);
48211
48253
  } catch (err) {
48212
48254
  chatInfo = { kind: "group", title: null };
48213
- statusSink?.({ lastError: `getChat failed: ${String(err)}` });
48255
+ publishStatus({ lastError: `getChat failed: ${String(err)}` });
48214
48256
  }
48215
48257
  const isGroup = chatInfo.kind !== "direct";
48216
48258
  const replyThreadsEnabled = isInlineReplyThreadsEnabled({ cfg, accountId: account.accountId });
@@ -48221,7 +48263,7 @@ async function monitorInlineProvider(params) {
48221
48263
  chatInfo,
48222
48264
  chatCache
48223
48265
  }).catch((err) => {
48224
- statusSink?.({ lastError: `getChat (system event reply thread) failed: ${String(err)}` });
48266
+ publishStatus({ lastError: `getChat (system event reply thread) failed: ${String(err)}` });
48225
48267
  return null;
48226
48268
  });
48227
48269
  const effectiveChatId = replyThreadContext?.parentChatId ?? params2.chatId;
@@ -48331,7 +48373,7 @@ async function monitorInlineProvider(params) {
48331
48373
  if (!messageIds.length)
48332
48374
  return;
48333
48375
  const inboundAt = Date.now();
48334
- statusSink?.({
48376
+ publishStatus({
48335
48377
  lastInboundAt: inboundAt,
48336
48378
  lastEventAt: inboundAt,
48337
48379
  ...createTransportActivityStatusPatch(inboundAt)
@@ -48358,7 +48400,7 @@ async function monitorInlineProvider(params) {
48358
48400
  };
48359
48401
  const queueInlineReactionSystemEvent = async (params2) => {
48360
48402
  const inboundAt = Date.now();
48361
- statusSink?.({
48403
+ publishStatus({
48362
48404
  lastInboundAt: inboundAt,
48363
48405
  lastEventAt: inboundAt,
48364
48406
  ...createTransportActivityStatusPatch(inboundAt)
@@ -48400,7 +48442,7 @@ async function monitorInlineProvider(params) {
48400
48442
  if (!participant || participant.userId !== meId)
48401
48443
  return;
48402
48444
  const inboundAt = Date.now();
48403
- statusSink?.({
48445
+ publishStatus({
48404
48446
  lastInboundAt: inboundAt,
48405
48447
  lastEventAt: inboundAt,
48406
48448
  ...createTransportActivityStatusPatch(inboundAt)
@@ -48418,7 +48460,7 @@ async function monitorInlineProvider(params) {
48418
48460
  chatId: params2.chatId,
48419
48461
  limit: 10
48420
48462
  }).catch((err) => {
48421
- statusSink?.({ lastError: `getChatHistory (participant add) failed: ${String(err)}` });
48463
+ publishStatus({ lastError: `getChatHistory (participant add) failed: ${String(err)}` });
48422
48464
  return null;
48423
48465
  });
48424
48466
  const freshness = resolveInlineThreadFreshness({
@@ -48478,7 +48520,7 @@ async function monitorInlineProvider(params) {
48478
48520
  meId,
48479
48521
  botMessageIdsByChat
48480
48522
  }).catch((err) => {
48481
- statusSink?.({ lastError: `getChatHistory (reaction target) failed: ${String(err)}` });
48523
+ publishStatus({ lastError: `getChatHistory (reaction target) failed: ${String(err)}` });
48482
48524
  return false;
48483
48525
  });
48484
48526
  };
@@ -48504,7 +48546,7 @@ async function monitorInlineProvider(params) {
48504
48546
  return;
48505
48547
  }
48506
48548
  const inboundAt = Date.now();
48507
- statusSink?.({
48549
+ publishStatus({
48508
48550
  lastInboundAt: inboundAt,
48509
48551
  lastEventAt: inboundAt,
48510
48552
  ...createTransportActivityStatusPatch(inboundAt)
@@ -48514,7 +48556,7 @@ async function monitorInlineProvider(params) {
48514
48556
  chatInfo = await resolveChatInfo(client, chatCache, chatId);
48515
48557
  } catch (err) {
48516
48558
  chatInfo = { kind: "group", title: null };
48517
- statusSink?.({ lastError: `getChat failed: ${String(err)}` });
48559
+ publishStatus({ lastError: `getChat failed: ${String(err)}` });
48518
48560
  }
48519
48561
  const isGroup = chatInfo.kind !== "direct";
48520
48562
  const inlineThreadDefaults = cfg.channels?.inline ?? {};
@@ -48526,7 +48568,7 @@ async function monitorInlineProvider(params) {
48526
48568
  chatInfo,
48527
48569
  chatCache
48528
48570
  }).catch((err) => {
48529
- statusSink?.({ lastError: `getChat (reply thread) failed: ${String(err)}` });
48571
+ publishStatus({ lastError: `getChat (reply thread) failed: ${String(err)}` });
48530
48572
  return null;
48531
48573
  });
48532
48574
  const effectiveChatId = replyThreadContext?.parentChatId ?? chatId;
@@ -48738,7 +48780,7 @@ async function monitorInlineProvider(params) {
48738
48780
  code
48739
48781
  })
48740
48782
  });
48741
- statusSink?.({ lastOutboundAt: Date.now() });
48783
+ publishStatus({ lastOutboundAt: Date.now() });
48742
48784
  } catch (err) {
48743
48785
  runtime.error?.(`inline: pairing reply failed for ${senderId}: ${String(err)}`);
48744
48786
  }
@@ -48792,7 +48834,7 @@ async function monitorInlineProvider(params) {
48792
48834
  historyLimit,
48793
48835
  botMessageIdsByChat
48794
48836
  }).catch((err) => {
48795
- statusSink?.({ lastError: `getChatHistory failed: ${String(err)}` });
48837
+ publishStatus({ lastError: `getChatHistory failed: ${String(err)}` });
48796
48838
  return {
48797
48839
  historyText: null,
48798
48840
  attachmentText: null,
@@ -48929,7 +48971,7 @@ async function monitorInlineProvider(params) {
48929
48971
  });
48930
48972
  rememberSentBotMessage({ chatId, messageId: sent.messageId, replyThreadContext });
48931
48973
  }
48932
- statusSink?.({ lastOutboundAt: Date.now() });
48974
+ publishStatus({ lastOutboundAt: Date.now() });
48933
48975
  }
48934
48976
  await answerCallbackIfNeeded().catch((error51) => {
48935
48977
  runtime.error?.(`inline callback answer failed: ${String(error51)}`);
@@ -48982,7 +49024,7 @@ async function monitorInlineProvider(params) {
48982
49024
  });
48983
49025
  rememberSentBotMessage({ chatId, messageId: sent.messageId, replyThreadContext });
48984
49026
  }
48985
- statusSink?.({ lastOutboundAt: Date.now() });
49027
+ publishStatus({ lastOutboundAt: Date.now() });
48986
49028
  return;
48987
49029
  }
48988
49030
  const nativeCommandMenu = resolveInlineNativeCommandMenu({
@@ -49029,7 +49071,7 @@ async function monitorInlineProvider(params) {
49029
49071
  });
49030
49072
  rememberSentBotMessage({ chatId, messageId: sent.messageId, replyThreadContext });
49031
49073
  }
49032
- statusSink?.({ lastOutboundAt: Date.now() });
49074
+ publishStatus({ lastOutboundAt: Date.now() });
49033
49075
  await answerCallbackIfNeeded().catch((error51) => {
49034
49076
  runtime.error?.(`inline callback answer failed: ${String(error51)}`);
49035
49077
  });
@@ -49132,7 +49174,7 @@ This model will be used for your next message.`, []);
49132
49174
  }
49133
49175
  }
49134
49176
  }
49135
- statusSink?.({ lastOutboundAt: Date.now() });
49177
+ publishStatus({ lastOutboundAt: Date.now() });
49136
49178
  await answerCallbackIfNeeded().catch((error51) => {
49137
49179
  runtime.error?.(`inline callback answer failed: ${String(error51)}`);
49138
49180
  });
@@ -49169,7 +49211,7 @@ This model will be used for your next message.`, []);
49169
49211
  parentMessageId: msg.id,
49170
49212
  agentId: route.agentId
49171
49213
  }).catch((error51) => {
49172
- statusSink?.({ lastError: `reply-thread route lookup failed: ${String(error51)}` });
49214
+ publishStatus({ lastError: `reply-thread route lookup failed: ${String(error51)}` });
49173
49215
  runtime.error?.(`inline reply-thread route lookup failed: ${String(error51)}`);
49174
49216
  return null;
49175
49217
  });
@@ -49180,7 +49222,7 @@ This model will be used for your next message.`, []);
49180
49222
  chatCache,
49181
49223
  fallbackParentChatTitle: effectiveGroupTitle
49182
49224
  }).catch((error51) => {
49183
- statusSink?.({ lastError: `reply-thread route restore failed: ${String(error51)}` });
49225
+ publishStatus({ lastError: `reply-thread route restore failed: ${String(error51)}` });
49184
49226
  runtime.error?.(`inline reply-thread route restore failed: ${String(error51)}`);
49185
49227
  return null;
49186
49228
  });
@@ -49192,7 +49234,7 @@ This model will be used for your next message.`, []);
49192
49234
  parentChatId: effectiveChatId,
49193
49235
  parentMessageId: msg.id
49194
49236
  }).catch((error51) => {
49195
- statusSink?.({ lastError: `createSubthread failed: ${String(error51)}` });
49237
+ publishStatus({ lastError: `createSubthread failed: ${String(error51)}` });
49196
49238
  runtime.error?.(`inline create reply thread failed: ${String(error51)}`);
49197
49239
  return null;
49198
49240
  });
@@ -49265,7 +49307,7 @@ This model will be used for your next message.`, []);
49265
49307
  meId,
49266
49308
  botMessageIdsByChat
49267
49309
  }).catch((err) => {
49268
- statusSink?.({ lastError: `getChatHistory (reply thread parent) failed: ${String(err)}` });
49310
+ publishStatus({ lastError: `getChatHistory (reply thread parent) failed: ${String(err)}` });
49269
49311
  return null;
49270
49312
  });
49271
49313
  if (parentHistoryContext) {
@@ -49544,7 +49586,7 @@ This model will be used for your next message.`, []);
49544
49586
  }
49545
49587
  }
49546
49588
  progressState.text = text;
49547
- statusSink?.({ lastOutboundAt: Date.now() });
49589
+ publishStatus({ lastOutboundAt: Date.now() });
49548
49590
  }).catch((error51) => {
49549
49591
  runtime.error?.(`inline progress placeholder failed: ${String(error51)}`);
49550
49592
  });
@@ -49675,7 +49717,7 @@ This model will be used for your next message.`, []);
49675
49717
  }
49676
49718
  }
49677
49719
  editStreamState.accumulatedText = nextText;
49678
- statusSink?.({ lastOutboundAt: Date.now() });
49720
+ publishStatus({ lastOutboundAt: Date.now() });
49679
49721
  } catch (error51) {
49680
49722
  editStreamState.failed = true;
49681
49723
  runtime.error?.(`inline edit stream failed: ${String(error51)}`);
@@ -49912,7 +49954,7 @@ This model will be used for your next message.`, []);
49912
49954
  }
49913
49955
  await updateStreamedMessage(outboundText, callbackEditActions);
49914
49956
  delivered = true;
49915
- statusSink?.({ lastOutboundAt: Date.now() });
49957
+ publishStatus({ lastOutboundAt: Date.now() });
49916
49958
  return;
49917
49959
  }
49918
49960
  if (streamViaEditMessage && infoKind === "final" && finalDeliveredForCurrentAssistantMessage && editStreamState.messageId != null) {
@@ -49930,13 +49972,13 @@ This model will be used for your next message.`, []);
49930
49972
  if (infoKind === "final") {
49931
49973
  finalDeliveredForCurrentAssistantMessage = true;
49932
49974
  }
49933
- statusSink?.({ lastOutboundAt: Date.now() });
49975
+ publishStatus({ lastOutboundAt: Date.now() });
49934
49976
  return;
49935
49977
  }
49936
49978
  if (!outboundText.trim())
49937
49979
  return;
49938
49980
  await sendTextFallback(outboundText, true, true);
49939
- statusSink?.({ lastOutboundAt: Date.now() });
49981
+ publishStatus({ lastOutboundAt: Date.now() });
49940
49982
  return;
49941
49983
  }
49942
49984
  if (streamViaEditMessage && editStreamState.messageId != null && outboundText.trim()) {
@@ -49974,7 +50016,7 @@ Attachment: ${mediaUrl}` : `Attachment: ${mediaUrl}`;
49974
50016
  await sendTextFallback(fallbackText, isFirst, isFirst);
49975
50017
  }
49976
50018
  }
49977
- statusSink?.({ lastOutboundAt: Date.now() });
50019
+ publishStatus({ lastOutboundAt: Date.now() });
49978
50020
  },
49979
50021
  onSkip: (_payload, info) => {
49980
50022
  if (info?.reason !== "silent") {
@@ -50012,7 +50054,7 @@ Attachment: ${mediaUrl}` : `Attachment: ${mediaUrl}`;
50012
50054
  messageId: sent.messageId,
50013
50055
  replyThreadContext: deliveryReplyThreadContext
50014
50056
  });
50015
- statusSink?.({ lastOutboundAt: Date.now() });
50057
+ publishStatus({ lastOutboundAt: Date.now() });
50016
50058
  }
50017
50059
  } finally {
50018
50060
  await setParentThreadCreationTyping(false);
@@ -50088,7 +50130,7 @@ Attachment: ${mediaUrl}` : `Attachment: ${mediaUrl}`;
50088
50130
  chatId,
50089
50131
  text: INLINE_DEBOUNCE_ERROR_FALLBACK
50090
50132
  }).then(() => {
50091
- statusSink?.({ lastOutboundAt: Date.now() });
50133
+ publishStatus({ lastOutboundAt: Date.now() });
50092
50134
  }).catch((sendErr) => {
50093
50135
  runtime.error?.(`inline debounce fallback send failed: ${String(sendErr)}`);
50094
50136
  });
@@ -50110,7 +50152,7 @@ Attachment: ${mediaUrl}` : `Attachment: ${mediaUrl}`;
50110
50152
  chatInfo = await resolveChatInfo(client, chatCache, entry.chatId);
50111
50153
  } catch (err) {
50112
50154
  chatInfo = { kind: "group", title: null };
50113
- statusSink?.({ lastError: `getChat failed: ${String(err)}` });
50155
+ publishStatus({ lastError: `getChat failed: ${String(err)}` });
50114
50156
  }
50115
50157
  const isGroup = chatInfo.kind !== "direct";
50116
50158
  const replyThreadsEnabled = isInlineReplyThreadsEnabled({ cfg, accountId: account.accountId });
@@ -50121,7 +50163,7 @@ Attachment: ${mediaUrl}` : `Attachment: ${mediaUrl}`;
50121
50163
  chatInfo,
50122
50164
  chatCache
50123
50165
  }).catch((err) => {
50124
- statusSink?.({ lastError: `getChat (abort reply thread) failed: ${String(err)}` });
50166
+ publishStatus({ lastError: `getChat (abort reply thread) failed: ${String(err)}` });
50125
50167
  return null;
50126
50168
  });
50127
50169
  const effectiveChatId = replyThreadContext?.parentChatId ?? entry.chatId;
@@ -50224,13 +50266,13 @@ Attachment: ${mediaUrl}` : `Attachment: ${mediaUrl}`;
50224
50266
  }
50225
50267
  } catch (error51) {
50226
50268
  const message = String(error51);
50227
- statusSink?.({ lastError: message });
50269
+ publishStatus({ lastError: message });
50228
50270
  runtime.error?.(`inline ${label} failed: ${message}`);
50229
50271
  return;
50230
50272
  }
50231
50273
  const tracked = task.catch((error51) => {
50232
50274
  const message = String(error51);
50233
- statusSink?.({ lastError: message });
50275
+ publishStatus({ lastError: message });
50234
50276
  runtime.error?.(`inline ${label} failed: ${message}`);
50235
50277
  }).finally(() => {
50236
50278
  pendingInboundTasks.delete(tracked);
@@ -50506,7 +50548,7 @@ Attachment: ${mediaUrl}` : `Attachment: ${mediaUrl}`;
50506
50548
  }
50507
50549
  }
50508
50550
  } catch (err) {
50509
- statusSink?.({ lastError: String(err) });
50551
+ publishStatus({ lastError: String(err) });
50510
50552
  runtime.error?.(`inline monitor loop crashed: ${String(err)}`);
50511
50553
  }
50512
50554
  })();
@@ -53233,5 +53275,5 @@ export {
53233
53275
  inlineChannelPlugin
53234
53276
  };
53235
53277
 
53236
- //# debugId=02F10208EE86F71264756E2164756E21
53278
+ //# debugId=2896D388FCF0CB2964756E2164756E21
53237
53279
  //# sourceMappingURL=channel-plugin-api.js.map