@sider-ai/chrome-openclaw-sider 1.0.33 → 1.0.34

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.
@@ -7,7 +7,7 @@ import {
7
7
  buildToolResultEvent,
8
8
  buildToolResultPart
9
9
  } from "./channel-builders.js";
10
- import { sendSiderEventBestEffort, sendSiderMessageBestEffort } from "./channel-relay.js";
10
+ import { sendSiderEventBestEffort } from "./channel-relay.js";
11
11
  import { logDebug, logWarn } from "./channel-runtime.js";
12
12
  import {
13
13
  clearBindingRunId,
@@ -189,24 +189,47 @@ function maybeSendNoQuotaRemainingError(params) {
189
189
  return;
190
190
  }
191
191
  params.runState.noQuotaRemainingErrorSent = true;
192
- void sendSiderMessageBestEffort({
193
- account: params.binding.account,
194
- sessionId: params.binding.sessionId,
192
+ const quotaPart = {
193
+ ...buildTextPart(NO_QUOTA_REMAINING_TEXT),
194
+ payload: {
195
+ text: NO_QUOTA_REMAINING_TEXT,
196
+ is_error: true
197
+ }
198
+ };
199
+ enqueueCompletedParts({
200
+ runId: params.runId,
195
201
  parts: [
196
- {
197
- ...buildTextPart(NO_QUOTA_REMAINING_TEXT),
198
- payload: {
199
- text: NO_QUOTA_REMAINING_TEXT,
200
- is_error: true
201
- }
202
- }
202
+ quotaPart
203
203
  ],
204
- meta: {
205
- provider: params.runState.provider,
206
- model: params.runState.model
207
- },
208
- context: params.context
204
+ sessionId: params.binding.sessionId,
205
+ accountId: params.binding.account.accountId,
206
+ provider: params.runState.provider,
207
+ model: params.runState.model
209
208
  });
209
+ void (async () => {
210
+ try {
211
+ await flushQueuedPartsExceptTailForRun({
212
+ runId: params.runId,
213
+ account: params.binding.account,
214
+ sessionId: params.binding.sessionId,
215
+ context: `${params.context}.except_tail`
216
+ });
217
+ await flushFinalQueuedPartForRun({
218
+ runId: params.runId,
219
+ account: params.binding.account,
220
+ sessionId: params.binding.sessionId,
221
+ context: `${params.context}.final_tail`
222
+ });
223
+ } catch (err) {
224
+ logWarn("sider failed to persist NO_QUOTA_REMAINING final message", {
225
+ accountId: params.binding.account.accountId,
226
+ sessionId: params.binding.sessionId,
227
+ runId: params.runId,
228
+ context: params.context,
229
+ error: String(err)
230
+ });
231
+ }
232
+ })();
210
233
  }
211
234
  function isNoQuotaRemainingAssistantError(source) {
212
235
  const assistant = toRecord(source);
@@ -28,6 +28,7 @@ type DispatchedSiderParts = {
28
28
  messageId: string;
29
29
  conversationId: string;
30
30
  };
31
+ declare function buildSiderDispatchReceipt(dispatchResult: DispatchedSiderParts): Record<string, unknown>;
31
32
  declare function readSiderSendText(params: Record<string, unknown>): string | undefined;
32
33
  declare function collectSiderSendAttachments(params: Record<string, unknown>): NormalizedSiderAttachment[];
33
34
  declare function prepareSiderSendParts(params: {
@@ -70,4 +71,4 @@ declare function sendToSider(params: {
70
71
  conversationId: string;
71
72
  }>;
72
73
 
73
- export { type DispatchedSiderParts, type PreparedSiderSend, collectSiderSendAttachments, dispatchSiderParts, handleSiderSendAction, prepareSiderSendParts, readSiderSendText, sendToSider };
74
+ export { type DispatchedSiderParts, type PreparedSiderSend, buildSiderDispatchReceipt, collectSiderSendAttachments, dispatchSiderParts, handleSiderSendAction, prepareSiderSendParts, readSiderSendText, sendToSider };
@@ -20,6 +20,21 @@ import {
20
20
  startDeferredSiderUploads
21
21
  } from "./media-upload.js";
22
22
  import { buildTextPart } from "./channel-builders.js";
23
+ function buildSiderDispatchReceipt(dispatchResult) {
24
+ if (dispatchResult.kind === "sent") {
25
+ return {
26
+ ok: true,
27
+ status: "sent",
28
+ messageId: dispatchResult.messageId,
29
+ conversationId: dispatchResult.conversationId
30
+ };
31
+ }
32
+ return {
33
+ ok: true,
34
+ runId: dispatchResult.runId,
35
+ sessionKey: dispatchResult.sessionKey
36
+ };
37
+ }
23
38
  const SIDER_ATTACHMENT_SOURCE_KEYS = [
24
39
  "path",
25
40
  "filePath",
@@ -246,7 +261,7 @@ async function handleSiderSendAction(params) {
246
261
  })
247
262
  )
248
263
  );
249
- await dispatchSiderParts({
264
+ const dispatchResult = await dispatchSiderParts({
250
265
  account: prepared.account,
251
266
  sessionId: prepared.sessionId,
252
267
  parts: prepared.parts,
@@ -254,11 +269,13 @@ async function handleSiderSendAction(params) {
254
269
  allowMergeActiveRun: true,
255
270
  context: "action.send"
256
271
  });
272
+ const receipt = buildSiderDispatchReceipt(dispatchResult);
257
273
  if (fileResults.length === 0) {
258
- return { ok: true };
274
+ return receipt;
259
275
  }
260
276
  return {
261
277
  ...fileResults[0],
278
+ ...receipt,
262
279
  files: fileResults,
263
280
  fileCount: fileResults.length
264
281
  };
@@ -282,6 +299,7 @@ async function sendToSider(params) {
282
299
  };
283
300
  }
284
301
  export {
302
+ buildSiderDispatchReceipt,
285
303
  collectSiderSendAttachments,
286
304
  dispatchSiderParts,
287
305
  handleSiderSendAction,
@@ -73,6 +73,7 @@ import {
73
73
  } from "./channel-state.js";
74
74
  import { buildTextPart } from "./channel-builders.js";
75
75
  import {
76
+ buildSiderDispatchReceipt,
76
77
  dispatchSiderParts,
77
78
  handleSiderSendAction,
78
79
  sendToSider
@@ -772,7 +773,7 @@ const siderPlugin = {
772
773
  source: savedAttachment.path,
773
774
  path: savedAttachment.path
774
775
  });
775
- await dispatchSiderParts({
776
+ const dispatchResult = await dispatchSiderParts({
776
777
  account,
777
778
  sessionId,
778
779
  parts: sendParts,
@@ -780,7 +781,10 @@ const siderPlugin = {
780
781
  allowMergeActiveRun: true,
781
782
  context: "action.sendAttachment"
782
783
  });
783
- return jsonResult(attachmentResult);
784
+ return jsonResult({
785
+ ...attachmentResult,
786
+ ...buildSiderDispatchReceipt(dispatchResult)
787
+ });
784
788
  }
785
789
  },
786
790
  outbound: {
@@ -10,7 +10,7 @@ declare const SIDER_CHANNEL_DOCS_LABEL = "sider";
10
10
  declare const SIDER_CHANNEL_BLURB = "Command your OpenClaw from Chrome Sidebar directly.";
11
11
  declare const SIDER_CHANNEL_ALIASES: readonly ["sider"];
12
12
  declare const SIDER_DEFAULT_BASE_URL = "https://sider.ai/api/claw/self";
13
- declare const SIDER_PUSH_TOOL_ERROR_WARNINGS = true;
13
+ declare const SIDER_PUSH_TOOL_ERROR_WARNINGS: boolean;
14
14
  declare const SIDER_TOOL_ERROR_WARNING_TEXT_RE: RegExp;
15
15
  declare function readSiderBaseUrlEnv(): string | undefined;
16
16
  declare function readDefaultSiderSetupTokenEnv(): string | undefined;
@@ -10,7 +10,7 @@ const SIDER_CHANNEL_DOCS_LABEL = "sider";
10
10
  const SIDER_CHANNEL_BLURB = "Command your OpenClaw from Chrome Sidebar directly.";
11
11
  const SIDER_CHANNEL_ALIASES = ["sider"];
12
12
  const SIDER_DEFAULT_BASE_URL = "https://sider.ai/api/claw/self";
13
- const SIDER_PUSH_TOOL_ERROR_WARNINGS = true;
13
+ const SIDER_PUSH_TOOL_ERROR_WARNINGS = false ? true : false;
14
14
  const SIDER_TOOL_ERROR_WARNING_TEXT_RE = /^⚠️ [^\n]+ failed(?:: [^\n]+)?$/u;
15
15
  function readSiderBaseUrlEnv() {
16
16
  return process.env.SIDER_GATEWAY_URL;
@@ -1,4 +1,4 @@
1
- const SIDER_PLUGIN_VERSION = "1.0.33";
1
+ const SIDER_PLUGIN_VERSION = "1.0.34";
2
2
  const SIDER_USER_AGENT = `openclaw-sider/${SIDER_PLUGIN_VERSION}`;
3
3
  export {
4
4
  SIDER_PLUGIN_VERSION,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sider-ai/chrome-openclaw-sider",
3
3
  "private": false,
4
- "version": "1.0.33",
4
+ "version": "1.0.34",
5
5
  "description": "Official Chrome channel plugin for connecting OpenClaw in Sider Chrome extension",
6
6
  "type": "module",
7
7
  "files": [