@access-mcp/announcements 0.3.0 → 0.5.0
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/server.d.ts +36 -9
- package/dist/server.js +371 -217
- package/package.json +3 -3
- package/src/index.ts +1 -1
- package/src/server.integration.test.ts +296 -8
- package/src/server.test.ts +443 -119
- package/src/server.ts +529 -275
- package/vitest.integration.config.ts +1 -1
package/dist/server.d.ts
CHANGED
|
@@ -9,6 +9,10 @@ export declare class AnnouncementsServer extends BaseAccessServer {
|
|
|
9
9
|
/**
|
|
10
10
|
* Get or create the Drupal auth provider for JSON:API write operations.
|
|
11
11
|
* Requires DRUPAL_API_URL, DRUPAL_USERNAME, and DRUPAL_PASSWORD env vars.
|
|
12
|
+
*
|
|
13
|
+
* Acting user is determined in priority order:
|
|
14
|
+
* 1. X-Acting-User header (from request context)
|
|
15
|
+
* 2. ACTING_USER environment variable (fallback)
|
|
12
16
|
*/
|
|
13
17
|
private getDrupalAuth;
|
|
14
18
|
protected getTools(): Tool[];
|
|
@@ -28,12 +32,20 @@ export declare class AnnouncementsServer extends BaseAccessServer {
|
|
|
28
32
|
private enhanceAnnouncements;
|
|
29
33
|
private searchAnnouncements;
|
|
30
34
|
/**
|
|
31
|
-
* Get the acting user's
|
|
32
|
-
*
|
|
35
|
+
* Get the acting user's ACCESS ID for content attribution.
|
|
36
|
+
*
|
|
37
|
+
* Priority order:
|
|
38
|
+
* 1. X-Acting-User header (from request context)
|
|
39
|
+
* 2. ACTING_USER environment variable (fallback)
|
|
40
|
+
*
|
|
41
|
+
* Returns the ACCESS ID (e.g., "username@access-ci.org")
|
|
33
42
|
*/
|
|
34
|
-
private
|
|
43
|
+
private getActingUserAccessId;
|
|
35
44
|
/**
|
|
36
45
|
* Create a new announcement via Drupal JSON:API
|
|
46
|
+
*
|
|
47
|
+
* The X-Acting-User header (set by DrupalAuthProvider) tells Drupal which
|
|
48
|
+
* ACCESS user is creating the content. Drupal handles user resolution.
|
|
37
49
|
*/
|
|
38
50
|
private createAnnouncement;
|
|
39
51
|
/**
|
|
@@ -45,17 +57,32 @@ export declare class AnnouncementsServer extends BaseAccessServer {
|
|
|
45
57
|
*/
|
|
46
58
|
private deleteAnnouncement;
|
|
47
59
|
/**
|
|
48
|
-
* Get announcements created by the acting user
|
|
60
|
+
* Get announcements created by the acting user.
|
|
61
|
+
*
|
|
62
|
+
* Uses a Drupal Views page display exposed via jsonapi_views at
|
|
63
|
+
* /jsonapi/views/mcp_my_announcements/page_1.
|
|
64
|
+
* The JsonApiViewsUserParameterSubscriber resolves X-Acting-User header to uid
|
|
65
|
+
* and injects it as the contextual filter argument, so no user UUID lookup is needed.
|
|
49
66
|
*/
|
|
50
67
|
private getMyAnnouncements;
|
|
51
68
|
/**
|
|
52
|
-
* Get
|
|
69
|
+
* Get announcement context - tags, affinity groups, and options for creating announcements.
|
|
70
|
+
*
|
|
71
|
+
* Uses a Drupal Views page display exposed via jsonapi_views at
|
|
72
|
+
* /jsonapi/views/mcp_my_affinity_groups/page_1 for affinity groups lookup.
|
|
73
|
+
* The JsonApiViewsUserParameterSubscriber resolves X-Acting-User header to uid,
|
|
74
|
+
* so no user UUID lookup is needed.
|
|
53
75
|
*/
|
|
54
|
-
private
|
|
76
|
+
private getAnnouncementContext;
|
|
55
77
|
/**
|
|
56
|
-
*
|
|
78
|
+
* Suggest tags for announcement content using Drupal's AI tag suggestion service.
|
|
57
79
|
*/
|
|
58
|
-
private
|
|
80
|
+
private static readonly JSON_HEADERS;
|
|
81
|
+
private suggestTags;
|
|
82
|
+
/**
|
|
83
|
+
* Generate a summary for announcement content using Drupal's AI summary service.
|
|
84
|
+
*/
|
|
85
|
+
private suggestSummary;
|
|
59
86
|
/**
|
|
60
87
|
* Look up affinity group UUID by ID or name
|
|
61
88
|
*/
|
|
@@ -76,5 +103,5 @@ export declare class AnnouncementsServer extends BaseAccessServer {
|
|
|
76
103
|
/**
|
|
77
104
|
* Get tag UUIDs by their names (with caching)
|
|
78
105
|
*/
|
|
79
|
-
private
|
|
106
|
+
private resolveTagNames;
|
|
80
107
|
}
|