@usepipa/pipa 0.5.0 → 0.5.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/app.mjs +4 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usepipa/pipa",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "Run Pipa through Slack Socket Mode with OpenCode",
5
5
  "keywords": [
6
6
  "slack",
package/src/app.mjs CHANGED
@@ -165,7 +165,10 @@ export async function startPipa(options = {}) {
165
165
 
166
166
  const handle = async (thread, message, subscribe) => {
167
167
  if (!accepting || !isAuthorized(thread, message, config) || shouldIgnore(thread, message)) return;
168
- const prompt = subscribe || message.isMention ? stripMention(message.text) : message.text.trim();
168
+ const messageText = subscribe || message.isMention ? stripMention(message.text) : message.text.trim();
169
+ const missingLinks = (message.links ?? []).map((link) => link.url)
170
+ .filter((url) => typeof url === "string" && !messageText.split(/\s+/u).includes(url));
171
+ const prompt = missingLinks.length ? `${messageText}\n\nFull links:\n${[...new Set(missingLinks)].join("\n")}` : messageText;
169
172
  if (!prompt) return;
170
173
  const attachments = message.attachments ?? [];
171
174
  if (subscribe) await thread.subscribe();