@poncho-ai/messaging 0.8.0 → 0.8.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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @poncho-ai/messaging@0.8.0 build /home/runner/work/poncho-ai/poncho-ai/packages/messaging
2
+ > @poncho-ai/messaging@0.8.1 build /home/runner/work/poncho-ai/poncho-ai/packages/messaging
3
3
  > tsup src/index.ts --format esm --dts
4
4
 
5
5
  CLI Building entry: src/index.ts
@@ -7,8 +7,8 @@
7
7
  CLI tsup v8.5.1
8
8
  CLI Target: es2022
9
9
  ESM Build start
10
- ESM dist/index.js 53.03 KB
11
- ESM ⚡️ Build success in 66ms
10
+ ESM dist/index.js 53.27 KB
11
+ ESM ⚡️ Build success in 60ms
12
12
  DTS Build start
13
- DTS ⚡️ Build success in 4862ms
13
+ DTS ⚡️ Build success in 5292ms
14
14
  DTS dist/index.d.ts 11.66 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @poncho-ai/messaging
2
2
 
3
+ ## 0.8.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`69dd20a`](https://github.com/cesr/poncho-ai/commit/69dd20ae31ada0edaf281cf451729ffe37f4df71) Thanks [@cesr](https://github.com/cesr)! - fix: use GET for Slack conversations.replies API call so thread context is fetched correctly
8
+
3
9
  ## 0.8.0
4
10
 
5
11
  ### Minor Changes
package/dist/index.js CHANGED
@@ -204,14 +204,22 @@ var addReaction = async (token, channel, timestamp, reaction) => {
204
204
  }
205
205
  };
206
206
  var fetchThreadMessages = async (token, channel, threadTs, excludeTs) => {
207
- const result = await slackFetch("conversations.replies", token, {
207
+ const params = new URLSearchParams({
208
208
  channel,
209
209
  ts: threadTs,
210
- limit: 50
210
+ limit: "50"
211
211
  });
212
+ const res = await fetch(
213
+ `${SLACK_API}/conversations.replies?${params.toString()}`,
214
+ {
215
+ method: "GET",
216
+ headers: { authorization: `Bearer ${token}` }
217
+ }
218
+ );
219
+ const result = await res.json();
212
220
  if (!result.ok) {
213
- console.warn(
214
- `[slack-adapter] conversations.replies failed: ${result.error}`
221
+ console.error(
222
+ `[slack-adapter] conversations.replies failed: ${result.error} \u2014 ensure the bot has the "channels:history" scope`
215
223
  );
216
224
  return [];
217
225
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@poncho-ai/messaging",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "description": "Messaging platform adapters for Poncho agents (Slack, Telegram, etc.)",
5
5
  "repository": {
6
6
  "type": "git",
@@ -101,19 +101,28 @@ export const fetchThreadMessages = async (
101
101
  threadTs: string,
102
102
  excludeTs?: string,
103
103
  ): Promise<Array<{ user?: string; text?: string; ts: string }>> => {
104
- const result = (await slackFetch("conversations.replies", token, {
104
+ const params = new URLSearchParams({
105
105
  channel,
106
106
  ts: threadTs,
107
- limit: 50,
108
- })) as {
107
+ limit: "50",
108
+ });
109
+
110
+ const res = await fetch(
111
+ `${SLACK_API}/conversations.replies?${params.toString()}`,
112
+ {
113
+ method: "GET",
114
+ headers: { authorization: `Bearer ${token}` },
115
+ },
116
+ );
117
+ const result = (await res.json()) as {
109
118
  ok: boolean;
110
119
  error?: string;
111
120
  messages?: Array<{ user?: string; text?: string; ts: string }>;
112
121
  };
113
122
 
114
123
  if (!result.ok) {
115
- console.warn(
116
- `[slack-adapter] conversations.replies failed: ${result.error}`,
124
+ console.error(
125
+ `[slack-adapter] conversations.replies failed: ${result.error} — ensure the bot has the "channels:history" scope`,
117
126
  );
118
127
  return [];
119
128
  }