@openclaw/nextcloud-talk 2026.5.18 → 2026.5.19-alpha.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/dist/api.js CHANGED
@@ -1,2 +1,2 @@
1
- import { t as nextcloudTalkPlugin } from "./channel-DYfMObFy.js";
1
+ import { t as nextcloudTalkPlugin } from "./channel-DTTEgtwF.js";
2
2
  export { nextcloudTalkPlugin };
@@ -36,6 +36,7 @@ import { createServer } from "node:http";
36
36
  import { WEBHOOK_RATE_LIMIT_DEFAULTS, createAuthRateLimiter, isRequestBodyLimitError, readRequestBodyWithLimit, requestBodyErrorToText } from "openclaw/plugin-sdk/webhook-ingress";
37
37
  import path from "node:path";
38
38
  import { createClaimableDedupe } from "openclaw/plugin-sdk/persistent-dedupe";
39
+ import { jsonResult, readStringParam, resolveReactionMessageId } from "openclaw/plugin-sdk/channel-actions";
39
40
  import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$1, buildOutboundBaseSessionKey, normalizeAccountId as normalizeAccountId$1 } from "openclaw/plugin-sdk/routing";
40
41
  import { applyAccountNameToChannelSection, createSetupTranslator, createStandardChannelSetupStatus, formatDocsLink, patchScopedAccountConfig, setSetupChannelEnabled } from "openclaw/plugin-sdk/setup";
41
42
  import { createSetupInputPresenceValidator, createSetupTranslator as createSetupTranslator$1, mergeAllowFromEntries, promptParsedAllowFromForAccount, resolveSetupAccountId } from "openclaw/plugin-sdk/setup-runtime";
@@ -742,6 +743,39 @@ async function sendMessageNextcloudTalk(to, text, opts) {
742
743
  await release();
743
744
  }
744
745
  }
746
+ async function sendReactionNextcloudTalk(roomToken, messageId, reaction, opts) {
747
+ const { account, baseUrl, secret } = resolveNextcloudTalkSendContext(opts);
748
+ const normalizedToken = normalizeRoomToken(roomToken);
749
+ const body = JSON.stringify({ reaction });
750
+ const { random, signature } = generateNextcloudTalkSignature({
751
+ body: reaction,
752
+ secret
753
+ });
754
+ const { response, release } = await fetchWithSsrFGuard({
755
+ url: `${baseUrl}/ocs/v2.php/apps/spreed/api/v1/bot/${normalizedToken}/reaction/${messageId}`,
756
+ init: {
757
+ method: "POST",
758
+ headers: {
759
+ "Content-Type": "application/json",
760
+ "OCS-APIRequest": "true",
761
+ "X-Nextcloud-Talk-Bot-Random": random,
762
+ "X-Nextcloud-Talk-Bot-Signature": signature
763
+ },
764
+ body
765
+ },
766
+ auditContext: "nextcloud-talk-reaction",
767
+ policy: ssrfPolicyFromPrivateNetworkOptIn$1(account.config)
768
+ });
769
+ try {
770
+ if (!response.ok) {
771
+ const errorBody = await response.text().catch(() => "");
772
+ throw new Error(`Nextcloud Talk reaction failed: ${response.status} ${errorBody}`.trim());
773
+ }
774
+ return { ok: true };
775
+ } finally {
776
+ await release();
777
+ }
778
+ }
745
779
  //#endregion
746
780
  //#region extensions/nextcloud-talk/src/inbound.ts
747
781
  const CHANNEL_ID = "nextcloud-talk";
@@ -1511,6 +1545,55 @@ const nextcloudTalkGatewayAdapter = {
1511
1545
  }
1512
1546
  };
1513
1547
  //#endregion
1548
+ //#region extensions/nextcloud-talk/src/message-actions.ts
1549
+ const providerId = "nextcloud-talk";
1550
+ function isAccountConfigured(account) {
1551
+ return Boolean(account.enabled && account.secret?.trim() && account.baseUrl?.trim());
1552
+ }
1553
+ function hasConfiguredAccount(cfg, accountId) {
1554
+ if (accountId) return isAccountConfigured(resolveNextcloudTalkAccount({
1555
+ cfg,
1556
+ accountId
1557
+ }));
1558
+ return listNextcloudTalkAccountIds(cfg).map((id) => resolveNextcloudTalkAccount({
1559
+ cfg,
1560
+ accountId: id
1561
+ })).some(isAccountConfigured);
1562
+ }
1563
+ const nextcloudTalkMessageActions = {
1564
+ describeMessageTool: ({ cfg, accountId }) => {
1565
+ if (!hasConfiguredAccount(cfg, accountId)) return null;
1566
+ return { actions: ["send", "react"] };
1567
+ },
1568
+ supportsAction: ({ action }) => action !== "send",
1569
+ handleAction: async ({ action, params, cfg, accountId, toolContext }) => {
1570
+ if (action === "send") throw new Error("Send should be handled by outbound, not actions handler.");
1571
+ if (action === "react") {
1572
+ const target = readStringParam(params, "to", {
1573
+ required: true,
1574
+ label: "to (room token)"
1575
+ });
1576
+ const messageIdRaw = resolveReactionMessageId({
1577
+ args: params,
1578
+ toolContext
1579
+ });
1580
+ if (messageIdRaw == null) throw new Error("messageId required");
1581
+ const messageId = String(messageIdRaw);
1582
+ const emoji = readStringParam(params, "emoji", { required: true });
1583
+ if (params.remove === true) throw new Error("Nextcloud Talk reaction removal is not supported yet; only adding reactions is implemented.");
1584
+ await sendReactionNextcloudTalk(target, messageId, emoji, {
1585
+ accountId: accountId ?? void 0,
1586
+ cfg
1587
+ });
1588
+ return jsonResult({
1589
+ ok: true,
1590
+ added: emoji
1591
+ });
1592
+ }
1593
+ throw new Error(`Action ${action} not supported for ${providerId}.`);
1594
+ }
1595
+ };
1596
+ //#endregion
1514
1597
  //#region extensions/nextcloud-talk/src/message-adapter.ts
1515
1598
  const nextcloudTalkMessageAdapter = defineChannelMessageAdapter({
1516
1599
  id: "nextcloud-talk",
@@ -1969,7 +2052,8 @@ const nextcloudTalkPlugin = createChatChannelPlugin({
1969
2052
  })
1970
2053
  }),
1971
2054
  gateway: nextcloudTalkGatewayAdapter,
1972
- message: nextcloudTalkMessageAdapter
2055
+ message: nextcloudTalkMessageAdapter,
2056
+ actions: nextcloudTalkMessageActions
1973
2057
  },
1974
2058
  pairing: { text: {
1975
2059
  ...nextcloudTalkPairingTextAdapter,
@@ -1,2 +1,2 @@
1
- import { t as nextcloudTalkPlugin } from "./channel-DYfMObFy.js";
1
+ import { t as nextcloudTalkPlugin } from "./channel-DTTEgtwF.js";
2
2
  export { nextcloudTalkPlugin };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/nextcloud-talk",
3
- "version": "2026.5.18",
3
+ "version": "2026.5.19-alpha.1",
4
4
  "description": "OpenClaw Nextcloud Talk channel plugin",
5
5
  "repository": {
6
6
  "type": "git",
@@ -12,7 +12,7 @@
12
12
  "openclaw": "workspace:*"
13
13
  },
14
14
  "peerDependencies": {
15
- "openclaw": ">=2026.5.18"
15
+ "openclaw": ">=2026.5.19-alpha.1"
16
16
  },
17
17
  "peerDependenciesMeta": {
18
18
  "openclaw": {
@@ -44,10 +44,10 @@
44
44
  "minHostVersion": ">=2026.4.10"
45
45
  },
46
46
  "compat": {
47
- "pluginApi": ">=2026.5.18"
47
+ "pluginApi": ">=2026.5.19-alpha.1"
48
48
  },
49
49
  "build": {
50
- "openclawVersion": "2026.5.18"
50
+ "openclawVersion": "2026.5.19-alpha.1"
51
51
  },
52
52
  "release": {
53
53
  "publishToClawHub": true,