@inline-openclaw/inline 0.0.30 → 0.0.31

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/dist/index.js CHANGED
@@ -5560,6 +5560,13 @@ var import_runtime = __toESM(require_commonjs(), 1);
5560
5560
  var import_runtime2 = __toESM(require_commonjs(), 1);
5561
5561
  var import_runtime3 = __toESM(require_commonjs(), 1);
5562
5562
  var import_runtime4 = __toESM(require_commonjs(), 1);
5563
+ var ConnectionError_Reason;
5564
+ (function(ConnectionError_Reason2) {
5565
+ ConnectionError_Reason2[ConnectionError_Reason2["REASON_UNSPECIFIED"] = 0] = "REASON_UNSPECIFIED";
5566
+ ConnectionError_Reason2[ConnectionError_Reason2["UNAUTHORIZED"] = 1] = "UNAUTHORIZED";
5567
+ ConnectionError_Reason2[ConnectionError_Reason2["INVALID_AUTH"] = 2] = "INVALID_AUTH";
5568
+ ConnectionError_Reason2[ConnectionError_Reason2["SESSION_REVOKED"] = 3] = "SESSION_REVOKED";
5569
+ })(ConnectionError_Reason || (ConnectionError_Reason = {}));
5563
5570
  var MessageEntity_Type;
5564
5571
  (function(MessageEntity_Type2) {
5565
5572
  MessageEntity_Type2[MessageEntity_Type2["UNSPECIFIED"] = 0] = "UNSPECIFIED";
@@ -5719,6 +5726,7 @@ var Method;
5719
5726
  Method2[Method2["RESERVE_CHAT_IDS"] = 47] = "RESERVE_CHAT_IDS";
5720
5727
  Method2[Method2["INVOKE_MESSAGE_ACTION"] = 48] = "INVOKE_MESSAGE_ACTION";
5721
5728
  Method2[Method2["ANSWER_MESSAGE_ACTION"] = 49] = "ANSWER_MESSAGE_ACTION";
5729
+ Method2[Method2["REVOKE_SESSION"] = 50] = "REVOKE_SESSION";
5722
5730
  })(Method || (Method = {}));
5723
5731
  var PushNotificationProvider;
5724
5732
  (function(PushNotificationProvider2) {
@@ -6161,18 +6169,39 @@ var ConnectionOpen = new ConnectionOpen$Type;
6161
6169
 
6162
6170
  class ConnectionError$Type extends import_runtime4.MessageType {
6163
6171
  constructor() {
6164
- super("ConnectionError", []);
6172
+ super("ConnectionError", [
6173
+ { no: 1, name: "reason", kind: "enum", T: () => ["ConnectionError.Reason", ConnectionError_Reason] }
6174
+ ]);
6165
6175
  }
6166
6176
  create(value) {
6167
6177
  const message = globalThis.Object.create(this.messagePrototype);
6178
+ message.reason = 0;
6168
6179
  if (value !== undefined)
6169
6180
  import_runtime3.reflectionMergePartial(this, message, value);
6170
6181
  return message;
6171
6182
  }
6172
6183
  internalBinaryRead(reader, length, options, target) {
6173
- return target ?? this.create();
6184
+ let message = target ?? this.create(), end = reader.pos + length;
6185
+ while (reader.pos < end) {
6186
+ let [fieldNo, wireType] = reader.tag();
6187
+ switch (fieldNo) {
6188
+ case 1:
6189
+ message.reason = reader.int32();
6190
+ break;
6191
+ default:
6192
+ let u = options.readUnknownField;
6193
+ if (u === "throw")
6194
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
6195
+ let d = reader.skip(wireType);
6196
+ if (u !== false)
6197
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
6198
+ }
6199
+ }
6200
+ return message;
6174
6201
  }
6175
6202
  internalBinaryWrite(message, writer, options) {
6203
+ if (message.reason !== 0)
6204
+ writer.tag(1, import_runtime.WireType.Varint).int32(message.reason);
6176
6205
  let u = options.writeUnknownFields;
6177
6206
  if (u !== false)
6178
6207
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -9370,7 +9399,8 @@ class RpcCall$Type extends import_runtime4.MessageType {
9370
9399
  { no: 47, name: "showChatInSidebar", kind: "message", oneof: "input", T: () => ShowChatInSidebarInput },
9371
9400
  { no: 48, name: "reserveChatIds", kind: "message", oneof: "input", T: () => ReserveChatIdsInput },
9372
9401
  { no: 49, name: "invokeMessageAction", kind: "message", oneof: "input", T: () => InvokeMessageActionInput },
9373
- { no: 50, name: "answerMessageAction", kind: "message", oneof: "input", T: () => AnswerMessageActionInput }
9402
+ { no: 50, name: "answerMessageAction", kind: "message", oneof: "input", T: () => AnswerMessageActionInput },
9403
+ { no: 51, name: "revokeSession", kind: "message", oneof: "input", T: () => RevokeSessionInput }
9374
9404
  ]);
9375
9405
  }
9376
9406
  create(value) {
@@ -9683,6 +9713,12 @@ class RpcCall$Type extends import_runtime4.MessageType {
9683
9713
  answerMessageAction: AnswerMessageActionInput.internalBinaryRead(reader, reader.uint32(), options, message.input.answerMessageAction)
9684
9714
  };
9685
9715
  break;
9716
+ case 51:
9717
+ message.input = {
9718
+ oneofKind: "revokeSession",
9719
+ revokeSession: RevokeSessionInput.internalBinaryRead(reader, reader.uint32(), options, message.input.revokeSession)
9720
+ };
9721
+ break;
9686
9722
  default:
9687
9723
  let u = options.readUnknownField;
9688
9724
  if (u === "throw")
@@ -9795,6 +9831,8 @@ class RpcCall$Type extends import_runtime4.MessageType {
9795
9831
  InvokeMessageActionInput.internalBinaryWrite(message.input.invokeMessageAction, writer.tag(49, import_runtime.WireType.LengthDelimited).fork(), options).join();
9796
9832
  if (message.input.oneofKind === "answerMessageAction")
9797
9833
  AnswerMessageActionInput.internalBinaryWrite(message.input.answerMessageAction, writer.tag(50, import_runtime.WireType.LengthDelimited).fork(), options).join();
9834
+ if (message.input.oneofKind === "revokeSession")
9835
+ RevokeSessionInput.internalBinaryWrite(message.input.revokeSession, writer.tag(51, import_runtime.WireType.LengthDelimited).fork(), options).join();
9798
9836
  let u = options.writeUnknownFields;
9799
9837
  if (u !== false)
9800
9838
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -9855,7 +9893,8 @@ class RpcResult$Type extends import_runtime4.MessageType {
9855
9893
  { no: 47, name: "showChatInSidebar", kind: "message", oneof: "result", T: () => ShowChatInSidebarResult },
9856
9894
  { no: 48, name: "reserveChatIds", kind: "message", oneof: "result", T: () => ReserveChatIdsResult },
9857
9895
  { no: 49, name: "invokeMessageAction", kind: "message", oneof: "result", T: () => InvokeMessageActionResult },
9858
- { no: 50, name: "answerMessageAction", kind: "message", oneof: "result", T: () => AnswerMessageActionResult }
9896
+ { no: 50, name: "answerMessageAction", kind: "message", oneof: "result", T: () => AnswerMessageActionResult },
9897
+ { no: 51, name: "revokeSession", kind: "message", oneof: "result", T: () => RevokeSessionResult }
9859
9898
  ]);
9860
9899
  }
9861
9900
  create(value) {
@@ -10168,6 +10207,12 @@ class RpcResult$Type extends import_runtime4.MessageType {
10168
10207
  answerMessageAction: AnswerMessageActionResult.internalBinaryRead(reader, reader.uint32(), options, message.result.answerMessageAction)
10169
10208
  };
10170
10209
  break;
10210
+ case 51:
10211
+ message.result = {
10212
+ oneofKind: "revokeSession",
10213
+ revokeSession: RevokeSessionResult.internalBinaryRead(reader, reader.uint32(), options, message.result.revokeSession)
10214
+ };
10215
+ break;
10171
10216
  default:
10172
10217
  let u = options.readUnknownField;
10173
10218
  if (u === "throw")
@@ -10280,6 +10325,8 @@ class RpcResult$Type extends import_runtime4.MessageType {
10280
10325
  InvokeMessageActionResult.internalBinaryWrite(message.result.invokeMessageAction, writer.tag(49, import_runtime.WireType.LengthDelimited).fork(), options).join();
10281
10326
  if (message.result.oneofKind === "answerMessageAction")
10282
10327
  AnswerMessageActionResult.internalBinaryWrite(message.result.answerMessageAction, writer.tag(50, import_runtime.WireType.LengthDelimited).fork(), options).join();
10328
+ if (message.result.oneofKind === "revokeSession")
10329
+ RevokeSessionResult.internalBinaryWrite(message.result.revokeSession, writer.tag(51, import_runtime.WireType.LengthDelimited).fork(), options).join();
10283
10330
  let u = options.writeUnknownFields;
10284
10331
  if (u !== false)
10285
10332
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -11417,6 +11464,99 @@ class ListBotsResult$Type extends import_runtime4.MessageType {
11417
11464
  }
11418
11465
  var ListBotsResult = new ListBotsResult$Type;
11419
11466
 
11467
+ class RevokeSessionInput$Type extends import_runtime4.MessageType {
11468
+ constructor() {
11469
+ super("RevokeSessionInput", [
11470
+ { no: 1, name: "session_id", kind: "scalar", T: 3, L: 0 }
11471
+ ]);
11472
+ }
11473
+ create(value) {
11474
+ const message = globalThis.Object.create(this.messagePrototype);
11475
+ message.sessionId = 0n;
11476
+ if (value !== undefined)
11477
+ import_runtime3.reflectionMergePartial(this, message, value);
11478
+ return message;
11479
+ }
11480
+ internalBinaryRead(reader, length, options, target) {
11481
+ let message = target ?? this.create(), end = reader.pos + length;
11482
+ while (reader.pos < end) {
11483
+ let [fieldNo, wireType] = reader.tag();
11484
+ switch (fieldNo) {
11485
+ case 1:
11486
+ message.sessionId = reader.int64().toBigInt();
11487
+ break;
11488
+ default:
11489
+ let u = options.readUnknownField;
11490
+ if (u === "throw")
11491
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
11492
+ let d = reader.skip(wireType);
11493
+ if (u !== false)
11494
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
11495
+ }
11496
+ }
11497
+ return message;
11498
+ }
11499
+ internalBinaryWrite(message, writer, options) {
11500
+ if (message.sessionId !== 0n)
11501
+ writer.tag(1, import_runtime.WireType.Varint).int64(message.sessionId);
11502
+ let u = options.writeUnknownFields;
11503
+ if (u !== false)
11504
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
11505
+ return writer;
11506
+ }
11507
+ }
11508
+ var RevokeSessionInput = new RevokeSessionInput$Type;
11509
+
11510
+ class RevokeSessionResult$Type extends import_runtime4.MessageType {
11511
+ constructor() {
11512
+ super("RevokeSessionResult", [
11513
+ { no: 1, name: "revoked", kind: "scalar", T: 8 },
11514
+ { no: 2, name: "already_revoked", kind: "scalar", T: 8 }
11515
+ ]);
11516
+ }
11517
+ create(value) {
11518
+ const message = globalThis.Object.create(this.messagePrototype);
11519
+ message.revoked = false;
11520
+ message.alreadyRevoked = false;
11521
+ if (value !== undefined)
11522
+ import_runtime3.reflectionMergePartial(this, message, value);
11523
+ return message;
11524
+ }
11525
+ internalBinaryRead(reader, length, options, target) {
11526
+ let message = target ?? this.create(), end = reader.pos + length;
11527
+ while (reader.pos < end) {
11528
+ let [fieldNo, wireType] = reader.tag();
11529
+ switch (fieldNo) {
11530
+ case 1:
11531
+ message.revoked = reader.bool();
11532
+ break;
11533
+ case 2:
11534
+ message.alreadyRevoked = reader.bool();
11535
+ break;
11536
+ default:
11537
+ let u = options.readUnknownField;
11538
+ if (u === "throw")
11539
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
11540
+ let d = reader.skip(wireType);
11541
+ if (u !== false)
11542
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
11543
+ }
11544
+ }
11545
+ return message;
11546
+ }
11547
+ internalBinaryWrite(message, writer, options) {
11548
+ if (message.revoked !== false)
11549
+ writer.tag(1, import_runtime.WireType.Varint).bool(message.revoked);
11550
+ if (message.alreadyRevoked !== false)
11551
+ writer.tag(2, import_runtime.WireType.Varint).bool(message.alreadyRevoked);
11552
+ let u = options.writeUnknownFields;
11553
+ if (u !== false)
11554
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
11555
+ return writer;
11556
+ }
11557
+ }
11558
+ var RevokeSessionResult = new RevokeSessionResult$Type;
11559
+
11420
11560
  class BotCommand$Type extends import_runtime4.MessageType {
11421
11561
  constructor() {
11422
11562
  super("BotCommand", [
@@ -18857,6 +18997,9 @@ class WebSocketTransport {
18857
18997
  }
18858
18998
  async reconnect(options) {
18859
18999
  const skipDelay = options?.skipDelay ?? false;
19000
+ if (this.state === "connecting" && this.reconnectionTimer) {
19001
+ return;
19002
+ }
18860
19003
  await this.setConnecting();
18861
19004
  this.cleanUpPreviousConnection();
18862
19005
  this.connectionAttemptNo = this.connectionAttemptNo + 1 >>> 0;
@@ -35155,6 +35298,9 @@ function formatSdkLogLine(message, meta3) {
35155
35298
  return message;
35156
35299
  return `${message} ${detail}`;
35157
35300
  }
35301
+ function isTransientSdkConnectionLog(line) {
35302
+ return line.startsWith("WebSocket reconnect scheduled ") || line.startsWith("WebSocket closed ") || line.startsWith("WebSocket error: ") || line.startsWith("Protocol reconnect scheduled ") || line.startsWith("Ping timeout, reconnecting ") || line.startsWith("Failed to send ping") || line.startsWith("Failed to send RPC request; waiting for reconnect");
35303
+ }
35158
35304
  var DEFAULT_DM_HISTORY_LIMIT = 6;
35159
35305
  var HISTORY_LINE_MAX_CHARS = 280;
35160
35306
  var URL_LIKE_PATTERN = /https?:\/\/\S+/i;
@@ -35411,9 +35557,7 @@ function resolveInlineReplyActions(payload) {
35411
35557
  }
35412
35558
  if (!hasExplicitButtons)
35413
35559
  return;
35414
- const rows = normalizeReplyMarkupButtonsWith(rawButtons, {
35415
- ...mapCallbackData ? { mapCallbackData } : {}
35416
- });
35560
+ const rows = normalizeReplyMarkupButtonsWith(rawButtons, mapCallbackData ? { mapCallbackData } : undefined);
35417
35561
  return {
35418
35562
  rows: rows.map((row, rowIndex) => ({
35419
35563
  actions: row.map((button, buttonIndex) => ({
@@ -35972,7 +36116,7 @@ async function monitorInlineProvider(params) {
35972
36116
  let client = null;
35973
36117
  const pushDiagnostics = (patch) => {
35974
36118
  statusSink?.({
35975
- ...patch ?? {},
36119
+ ...patch,
35976
36120
  ...client ? { diagnostics: client.getDiagnostics() } : {}
35977
36121
  });
35978
36122
  };
@@ -35982,12 +36126,12 @@ async function monitorInlineProvider(params) {
35982
36126
  warn: (msg, meta3) => {
35983
36127
  const line = formatSdkLogLine(msg, meta3);
35984
36128
  log?.warn(line);
35985
- pushDiagnostics({ lastError: line });
36129
+ pushDiagnostics();
35986
36130
  },
35987
36131
  error: (msg, meta3) => {
35988
36132
  const line = formatSdkLogLine(msg, meta3);
35989
36133
  log?.error(line);
35990
- pushDiagnostics({ lastError: line });
36134
+ pushDiagnostics(isTransientSdkConnectionLog(line) ? undefined : { lastError: line });
35991
36135
  }
35992
36136
  };
35993
36137
  client = new InlineSdkClient({
@@ -36721,16 +36865,6 @@ ${currentEntityText}` : null
36721
36865
  await handlePartialStreamPayload(payload);
36722
36866
  }
36723
36867
  } : {},
36724
- ...streamViaEditMessage ? {
36725
- onReasoningStream: async (payload) => {
36726
- await handlePartialStreamPayload(payload);
36727
- }
36728
- } : {},
36729
- ...streamViaEditMessage ? {
36730
- onReasoningEnd: async () => {
36731
- await editStreamState.opChain;
36732
- }
36733
- } : {},
36734
36868
  ...streamViaEditMessage ? {
36735
36869
  onToolStart: async () => {
36736
36870
  await resetEditStreamOnBoundary();
@@ -36761,6 +36895,9 @@ ${currentEntityText}` : null
36761
36895
  ...prefixOptions,
36762
36896
  ...typingCallbacks ? { typingCallbacks } : {},
36763
36897
  deliver: async (payload, info) => {
36898
+ if (payload.isReasoning === true) {
36899
+ return;
36900
+ }
36764
36901
  const rawText = payload.text ?? "";
36765
36902
  const mediaList = payload.mediaUrls?.length ? payload.mediaUrls : payload.mediaUrl ? [payload.mediaUrl] : [];
36766
36903
  const outboundText = rewriteNumericMentionsToUsernames(rawText, senderProfilesById);
@@ -39015,6 +39152,9 @@ function readInlineProbeSummary(value) {
39015
39152
  function looksLikeAuthError(text) {
39016
39153
  return /(401|403|unauth|forbidden|invalid token|token invalid|unauthorized)/i.test(text);
39017
39154
  }
39155
+ function looksLikeTransientConnectionNotice(text) {
39156
+ return text.startsWith("WebSocket reconnect scheduled ") || text.startsWith("WebSocket closed ") || text.startsWith("WebSocket error: ") || text.startsWith("Protocol reconnect scheduled ") || text.startsWith("Ping timeout, reconnecting ") || text.startsWith("Failed to send ping") || text.startsWith("Failed to send RPC request; waiting for reconnect");
39157
+ }
39018
39158
  function readInlineDiagnosticsSummary(value) {
39019
39159
  if (!isRecord5(value)) {
39020
39160
  return {};
@@ -39083,7 +39223,7 @@ function collectInlineStatusIssues(accounts) {
39083
39223
  });
39084
39224
  }
39085
39225
  const lastError = asString(entry.lastError);
39086
- if (lastError) {
39226
+ if (lastError && !looksLikeTransientConnectionNotice(lastError)) {
39087
39227
  issues.push({
39088
39228
  channel: "inline",
39089
39229
  accountId,
@@ -41311,5 +41451,5 @@ export {
41311
41451
  src_default as default
41312
41452
  };
41313
41453
 
41314
- //# debugId=1C8239561365068664756E2164756E21
41454
+ //# debugId=AA2B11EC366875DE64756E2164756E21
41315
41455
  //# sourceMappingURL=index.js.map