@evanp/activitypub-bot 0.45.2 → 0.45.3

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/CHANGELOG.md CHANGED
@@ -9,6 +9,12 @@ and this project adheres to
9
9
 
10
10
  ## [Unreleased]
11
11
 
12
+ ## [0.45.3] - 2026-04-24
13
+
14
+ ### Fixed
15
+
16
+ - Correct summary for Announce activities
17
+
12
18
  ## [0.45.2] - 2026-04-24
13
19
 
14
20
  ### Fixed
package/lib/botcontext.js CHANGED
@@ -10,6 +10,8 @@ const AS2_TYPES = [
10
10
  'application/ld+json; profile="https://www.w3.org/ns/activitystreams"'
11
11
  ]
12
12
 
13
+ const AS2_NS = 'https://www.w3.org/ns/activitystreams#'
14
+
13
15
  const WF_NS = 'https://purl.archive.org/socialweb/webfinger#'
14
16
 
15
17
  const THREAD_PROP = 'https://purl.archive.org/socialweb/thread#thread'
@@ -558,7 +560,13 @@ export class BotContext {
558
560
  } else if (obj.summary) {
559
561
  return obj.summary.get()
560
562
  } else if (obj.type) {
561
- return `a(n) ${obj.type.first}`
563
+ const type = (Array.isArray(obj.type))
564
+ ? obj.type[0]
565
+ : obj.type
566
+ const shortType = (type.startsWith(AS2_NS))
567
+ ? type.slice(AS2_NS.length)
568
+ : type
569
+ return `a(n) ${shortType}`
562
570
  } else {
563
571
  return 'an object'
564
572
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evanp/activitypub-bot",
3
- "version": "0.45.2",
3
+ "version": "0.45.3",
4
4
  "description": "server-side ActivityPub bot framework",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",