openclaw-remote 0.5.1 → 0.5.2

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.
Files changed (2) hide show
  1. package/dist/index.js +43 -42
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -3007,50 +3007,51 @@ function createRemotePlugin() {
3007
3007
  log?.info?.(`Webhook received: ${payload.event} for task ${payload.task_id} (agent: ${payload.agent_name})`);
3008
3008
  const body = formatWebhookEvent(payload);
3009
3009
  const sessionKey = `remote:${account.accountId}:${payload.task_id}`;
3010
- try {
3011
- const rt = getRemoteRuntime();
3012
- const currentCfg = await rt.config.loadConfig();
3013
- const msgCtx = rt.channel.reply.finalizeInboundContext({
3014
- Body: body,
3015
- RawBody: body,
3016
- CommandBody: body,
3017
- From: `remote:${payload.task_id}`,
3018
- To: `remote:${account.accountId}`,
3019
- SessionKey: sessionKey,
3020
- AccountId: account.accountId,
3021
- OriginatingChannel: CHANNEL_ID,
3022
- OriginatingTo: `remote:${payload.task_id}`,
3023
- ChatType: "direct",
3024
- SenderName: payload.author_name || "Remote Board",
3025
- SenderId: payload.task_id,
3026
- Provider: CHANNEL_ID,
3027
- Surface: CHANNEL_ID,
3028
- ConversationLabel: payload.task_title || `Task ${payload.task_id}`,
3029
- Timestamp: Date.now()
3030
- });
3031
- await rt.channel.reply.dispatchReplyWithBufferedBlockDispatcher({
3032
- ctx: msgCtx,
3033
- cfg: currentCfg,
3034
- dispatcherOptions: {
3035
- deliver: async (deliverPayload) => {
3036
- if (deliverPayload.isReasoning) return;
3037
- const text = deliverPayload?.text ?? deliverPayload?.body;
3038
- if (text) {
3039
- await postComment(account, payload.task_id, text);
3010
+ (async () => {
3011
+ try {
3012
+ const rt = getRemoteRuntime();
3013
+ const currentCfg = await rt.config.loadConfig();
3014
+ const msgCtx = rt.channel.reply.finalizeInboundContext({
3015
+ Body: body,
3016
+ RawBody: body,
3017
+ CommandBody: body,
3018
+ From: `remote:${payload.task_id}`,
3019
+ To: `remote:${account.accountId}`,
3020
+ SessionKey: sessionKey,
3021
+ AccountId: account.accountId,
3022
+ OriginatingChannel: CHANNEL_ID,
3023
+ OriginatingTo: `remote:${payload.task_id}`,
3024
+ ChatType: "direct",
3025
+ SenderName: payload.author_name || "Remote Board",
3026
+ SenderId: payload.task_id,
3027
+ Provider: CHANNEL_ID,
3028
+ Surface: CHANNEL_ID,
3029
+ ConversationLabel: payload.task_title || `Task ${payload.task_id}`,
3030
+ Timestamp: Date.now()
3031
+ });
3032
+ await rt.channel.reply.dispatchReplyWithBufferedBlockDispatcher({
3033
+ ctx: msgCtx,
3034
+ cfg: currentCfg,
3035
+ dispatcherOptions: {
3036
+ deliver: async (deliverPayload) => {
3037
+ if (deliverPayload.isReasoning) return;
3038
+ const text = deliverPayload?.text ?? deliverPayload?.body;
3039
+ if (text) {
3040
+ await postComment(account, payload.task_id, text);
3041
+ }
3042
+ },
3043
+ onReplyStart: () => {
3044
+ log?.info?.(`Agent reply started for task ${payload.task_id}`);
3040
3045
  }
3041
- },
3042
- onReplyStart: () => {
3043
- log?.info?.(`Agent reply started for task ${payload.task_id}`);
3044
3046
  }
3045
- }
3046
- });
3047
- } catch (err) {
3048
- log?.error?.(
3049
- `Error dispatching webhook event: ${err instanceof Error ? err.message : String(err)}`
3050
- );
3051
- return { status: 500, body: { error: "Internal error" } };
3052
- }
3053
- return { status: 200, body: { ok: true } };
3047
+ });
3048
+ } catch (err) {
3049
+ log?.error?.(
3050
+ `Error dispatching webhook event: ${err instanceof Error ? err.message : String(err)}`
3051
+ );
3052
+ }
3053
+ })();
3054
+ return { status: 200, body: { ok: true, event: payload.event } };
3054
3055
  };
3055
3056
  const routeKey = `${accountId}:${account.webhookPath}`;
3056
3057
  const prevUnregister = activeRouteUnregisters.get(routeKey);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openclaw-remote",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "description": "Remote project board channel plugin for OpenClaw",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",