@poncho-ai/messaging 0.8.0 → 0.8.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.
- package/.turbo/turbo-build.log +11 -11
- package/.turbo/turbo-test.log +0 -0
- package/CHANGELOG.md +13 -0
- package/dist/index.js +12 -4
- package/package.json +2 -2
- package/src/adapters/slack/utils.ts +14 -5
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
|
|
2
|
-
> @poncho-ai/messaging@0.8.
|
|
2
|
+
> @poncho-ai/messaging@0.8.1 build /Users/cesar/Dev/latitude/poncho-ai/packages/messaging
|
|
3
3
|
> tsup src/index.ts --format esm --dts
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
CLI Building entry: src/index.ts
|
|
6
|
+
CLI Using tsconfig: tsconfig.json
|
|
7
|
+
CLI tsup v8.5.1
|
|
8
|
+
CLI Target: es2022
|
|
9
|
+
ESM Build start
|
|
10
|
+
ESM dist/index.js 53.27 KB
|
|
11
|
+
ESM ⚡️ Build success in 354ms
|
|
12
|
+
DTS Build start
|
|
13
|
+
DTS ⚡️ Build success in 2315ms
|
|
14
|
+
DTS dist/index.d.ts 11.66 KB
|
|
File without changes
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @poncho-ai/messaging
|
|
2
2
|
|
|
3
|
+
## 0.8.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`83d3c5f`](https://github.com/cesr/poncho-ai/commit/83d3c5f841fe84965d1f9fec6dfc5d8832e4489a)]:
|
|
8
|
+
- @poncho-ai/sdk@1.8.0
|
|
9
|
+
|
|
10
|
+
## 0.8.1
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [`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
|
|
15
|
+
|
|
3
16
|
## 0.8.0
|
|
4
17
|
|
|
5
18
|
### 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
|
|
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.
|
|
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.
|
|
3
|
+
"version": "0.8.2",
|
|
4
4
|
"description": "Messaging platform adapters for Poncho agents (Slack, Telegram, etc.)",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@poncho-ai/sdk": "1.
|
|
23
|
+
"@poncho-ai/sdk": "1.8.0"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
26
|
"resend": ">=4.0.0"
|
|
@@ -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
|
|
104
|
+
const params = new URLSearchParams({
|
|
105
105
|
channel,
|
|
106
106
|
ts: threadTs,
|
|
107
|
-
limit: 50,
|
|
108
|
-
})
|
|
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.
|
|
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
|
}
|