@slapy/mcp 1.0.0-alpha
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/LICENSE +21 -0
- package/README.md +86 -0
- package/bin/slapy-mcp.js +8 -0
- package/dist/action-client.d.ts +41 -0
- package/dist/action-client.js +142 -0
- package/dist/action-client.js.map +1 -0
- package/dist/auth.d.ts +9 -0
- package/dist/auth.js +23 -0
- package/dist/auth.js.map +1 -0
- package/dist/contracts.d.ts +415 -0
- package/dist/contracts.js +157 -0
- package/dist/contracts.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -0
- package/dist/server.d.ts +4 -0
- package/dist/server.js +26 -0
- package/dist/server.js.map +1 -0
- package/dist/tools/analytics.d.ts +2 -0
- package/dist/tools/analytics.js +12 -0
- package/dist/tools/analytics.js.map +1 -0
- package/dist/tools/atomize.d.ts +2 -0
- package/dist/tools/atomize.js +12 -0
- package/dist/tools/atomize.js.map +1 -0
- package/dist/tools/connector.d.ts +2 -0
- package/dist/tools/connector.js +12 -0
- package/dist/tools/connector.js.map +1 -0
- package/dist/tools/draft.d.ts +2 -0
- package/dist/tools/draft.js +22 -0
- package/dist/tools/draft.js.map +1 -0
- package/dist/tools/index.d.ts +18 -0
- package/dist/tools/index.js +84 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/json-schema.d.ts +3 -0
- package/dist/tools/json-schema.js +5 -0
- package/dist/tools/json-schema.js.map +1 -0
- package/dist/tools/review-queue.d.ts +2 -0
- package/dist/tools/review-queue.js +22 -0
- package/dist/tools/review-queue.js.map +1 -0
- package/dist/utils/format-response.d.ts +5 -0
- package/dist/utils/format-response.js +43 -0
- package/dist/utils/format-response.js.map +1 -0
- package/package.json +37 -0
|
@@ -0,0 +1,415 @@
|
|
|
1
|
+
import { z } from "zod/v3";
|
|
2
|
+
export declare const S1_AGENT_ACTIONS: readonly ["draft.read", "draft.create", "draft.update", "connector.read", "atomize.run", "review_queue.approve", "review_queue.reject", "analytics.read"];
|
|
3
|
+
export type McpAction = (typeof S1_AGENT_ACTIONS)[number];
|
|
4
|
+
export declare const TOOL_ACTION_MAP: {
|
|
5
|
+
readonly slapy_draft_list: "draft.read";
|
|
6
|
+
readonly slapy_draft_create: "draft.create";
|
|
7
|
+
readonly slapy_draft_update: "draft.update";
|
|
8
|
+
readonly slapy_connector_list: "connector.read";
|
|
9
|
+
readonly slapy_atomize_run: "atomize.run";
|
|
10
|
+
readonly slapy_review_queue_approve: "review_queue.approve";
|
|
11
|
+
readonly slapy_review_queue_reject: "review_queue.reject";
|
|
12
|
+
readonly slapy_analytics_read: "analytics.read";
|
|
13
|
+
};
|
|
14
|
+
export type ActionToolName = keyof typeof TOOL_ACTION_MAP;
|
|
15
|
+
export declare const SlimeProviderIdSchema: z.ZodEnum<["bluesky", "facebook", "instagram", "linkedin", "threads"]>;
|
|
16
|
+
export declare const DraftReadPayloadSchema: z.ZodObject<{
|
|
17
|
+
draft_id: z.ZodOptional<z.ZodString>;
|
|
18
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
19
|
+
}, "strict", z.ZodTypeAny, {
|
|
20
|
+
draft_id?: string | undefined;
|
|
21
|
+
limit?: number | undefined;
|
|
22
|
+
}, {
|
|
23
|
+
draft_id?: string | undefined;
|
|
24
|
+
limit?: number | undefined;
|
|
25
|
+
}>;
|
|
26
|
+
export declare const DraftCreatePayloadSchema: z.ZodObject<{
|
|
27
|
+
content: z.ZodObject<{
|
|
28
|
+
text: z.ZodString;
|
|
29
|
+
title: z.ZodOptional<z.ZodString>;
|
|
30
|
+
}, "strict", z.ZodTypeAny, {
|
|
31
|
+
text: string;
|
|
32
|
+
title?: string | undefined;
|
|
33
|
+
}, {
|
|
34
|
+
text: string;
|
|
35
|
+
title?: string | undefined;
|
|
36
|
+
}>;
|
|
37
|
+
platforms: z.ZodArray<z.ZodEnum<["bluesky", "facebook", "instagram", "linkedin", "threads"]>, "many">;
|
|
38
|
+
media: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
39
|
+
media_id: z.ZodOptional<z.ZodString>;
|
|
40
|
+
url: z.ZodOptional<z.ZodString>;
|
|
41
|
+
kind: z.ZodEnum<["image", "video"]>;
|
|
42
|
+
}, "strict", z.ZodTypeAny, {
|
|
43
|
+
kind: "image" | "video";
|
|
44
|
+
media_id?: string | undefined;
|
|
45
|
+
url?: string | undefined;
|
|
46
|
+
}, {
|
|
47
|
+
kind: "image" | "video";
|
|
48
|
+
media_id?: string | undefined;
|
|
49
|
+
url?: string | undefined;
|
|
50
|
+
}>, "many">>;
|
|
51
|
+
template_id: z.ZodOptional<z.ZodString>;
|
|
52
|
+
}, "strict", z.ZodTypeAny, {
|
|
53
|
+
content: {
|
|
54
|
+
text: string;
|
|
55
|
+
title?: string | undefined;
|
|
56
|
+
};
|
|
57
|
+
platforms: ("bluesky" | "facebook" | "instagram" | "linkedin" | "threads")[];
|
|
58
|
+
media?: {
|
|
59
|
+
kind: "image" | "video";
|
|
60
|
+
media_id?: string | undefined;
|
|
61
|
+
url?: string | undefined;
|
|
62
|
+
}[] | undefined;
|
|
63
|
+
template_id?: string | undefined;
|
|
64
|
+
}, {
|
|
65
|
+
content: {
|
|
66
|
+
text: string;
|
|
67
|
+
title?: string | undefined;
|
|
68
|
+
};
|
|
69
|
+
platforms: ("bluesky" | "facebook" | "instagram" | "linkedin" | "threads")[];
|
|
70
|
+
media?: {
|
|
71
|
+
kind: "image" | "video";
|
|
72
|
+
media_id?: string | undefined;
|
|
73
|
+
url?: string | undefined;
|
|
74
|
+
}[] | undefined;
|
|
75
|
+
template_id?: string | undefined;
|
|
76
|
+
}>;
|
|
77
|
+
export declare const DraftUpdatePayloadSchema: z.ZodObject<{
|
|
78
|
+
draft_id: z.ZodString;
|
|
79
|
+
patch: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
80
|
+
}, "strict", z.ZodTypeAny, {
|
|
81
|
+
draft_id: string;
|
|
82
|
+
patch: Record<string, unknown>;
|
|
83
|
+
}, {
|
|
84
|
+
draft_id: string;
|
|
85
|
+
patch: Record<string, unknown>;
|
|
86
|
+
}>;
|
|
87
|
+
export declare const ConnectorReadPayloadSchema: z.ZodObject<{
|
|
88
|
+
platform: z.ZodOptional<z.ZodEnum<["bluesky", "facebook", "instagram", "linkedin", "threads"]>>;
|
|
89
|
+
}, "strict", z.ZodTypeAny, {
|
|
90
|
+
platform?: "bluesky" | "facebook" | "instagram" | "linkedin" | "threads" | undefined;
|
|
91
|
+
}, {
|
|
92
|
+
platform?: "bluesky" | "facebook" | "instagram" | "linkedin" | "threads" | undefined;
|
|
93
|
+
}>;
|
|
94
|
+
export declare const AtomizeRunPayloadSchema: z.ZodObject<{
|
|
95
|
+
source_type: z.ZodEnum<["audio", "video", "article", "transcript", "url"]>;
|
|
96
|
+
source_ref: z.ZodString;
|
|
97
|
+
platforms: z.ZodArray<z.ZodEnum<["bluesky", "facebook", "instagram", "linkedin", "threads"]>, "many">;
|
|
98
|
+
formats: z.ZodArray<z.ZodEnum<["post", "thread", "carousel", "short_script", "caption"]>, "many">;
|
|
99
|
+
tone_guide_id: z.ZodOptional<z.ZodString>;
|
|
100
|
+
}, "strict", z.ZodTypeAny, {
|
|
101
|
+
platforms: ("bluesky" | "facebook" | "instagram" | "linkedin" | "threads")[];
|
|
102
|
+
source_type: "url" | "video" | "audio" | "article" | "transcript";
|
|
103
|
+
source_ref: string;
|
|
104
|
+
formats: ("post" | "thread" | "carousel" | "short_script" | "caption")[];
|
|
105
|
+
tone_guide_id?: string | undefined;
|
|
106
|
+
}, {
|
|
107
|
+
platforms: ("bluesky" | "facebook" | "instagram" | "linkedin" | "threads")[];
|
|
108
|
+
source_type: "url" | "video" | "audio" | "article" | "transcript";
|
|
109
|
+
source_ref: string;
|
|
110
|
+
formats: ("post" | "thread" | "carousel" | "short_script" | "caption")[];
|
|
111
|
+
tone_guide_id?: string | undefined;
|
|
112
|
+
}>;
|
|
113
|
+
export declare const ReviewQueueApprovePayloadSchema: z.ZodObject<{
|
|
114
|
+
pending_action_id: z.ZodString;
|
|
115
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
116
|
+
}, "strict", z.ZodTypeAny, {
|
|
117
|
+
pending_action_id: string;
|
|
118
|
+
comment?: string | undefined;
|
|
119
|
+
}, {
|
|
120
|
+
pending_action_id: string;
|
|
121
|
+
comment?: string | undefined;
|
|
122
|
+
}>;
|
|
123
|
+
export declare const ReviewQueueRejectPayloadSchema: z.ZodObject<{
|
|
124
|
+
pending_action_id: z.ZodString;
|
|
125
|
+
reason: z.ZodString;
|
|
126
|
+
}, "strict", z.ZodTypeAny, {
|
|
127
|
+
pending_action_id: string;
|
|
128
|
+
reason: string;
|
|
129
|
+
}, {
|
|
130
|
+
pending_action_id: string;
|
|
131
|
+
reason: string;
|
|
132
|
+
}>;
|
|
133
|
+
export declare const AnalyticsReadPayloadSchema: z.ZodObject<{
|
|
134
|
+
workspace_id: z.ZodString;
|
|
135
|
+
range: z.ZodObject<{
|
|
136
|
+
from: z.ZodString;
|
|
137
|
+
to: z.ZodString;
|
|
138
|
+
}, "strict", z.ZodTypeAny, {
|
|
139
|
+
from: string;
|
|
140
|
+
to: string;
|
|
141
|
+
}, {
|
|
142
|
+
from: string;
|
|
143
|
+
to: string;
|
|
144
|
+
}>;
|
|
145
|
+
granularity: z.ZodOptional<z.ZodEnum<["day", "week", "month"]>>;
|
|
146
|
+
platforms: z.ZodOptional<z.ZodArray<z.ZodEnum<["bluesky", "facebook", "instagram", "linkedin", "threads"]>, "many">>;
|
|
147
|
+
}, "strict", z.ZodTypeAny, {
|
|
148
|
+
workspace_id: string;
|
|
149
|
+
range: {
|
|
150
|
+
from: string;
|
|
151
|
+
to: string;
|
|
152
|
+
};
|
|
153
|
+
platforms?: ("bluesky" | "facebook" | "instagram" | "linkedin" | "threads")[] | undefined;
|
|
154
|
+
granularity?: "day" | "week" | "month" | undefined;
|
|
155
|
+
}, {
|
|
156
|
+
workspace_id: string;
|
|
157
|
+
range: {
|
|
158
|
+
from: string;
|
|
159
|
+
to: string;
|
|
160
|
+
};
|
|
161
|
+
platforms?: ("bluesky" | "facebook" | "instagram" | "linkedin" | "threads")[] | undefined;
|
|
162
|
+
granularity?: "day" | "week" | "month" | undefined;
|
|
163
|
+
}>;
|
|
164
|
+
export declare const ACTION_PAYLOAD_SCHEMAS: {
|
|
165
|
+
readonly "draft.read": z.ZodObject<{
|
|
166
|
+
draft_id: z.ZodOptional<z.ZodString>;
|
|
167
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
168
|
+
}, "strict", z.ZodTypeAny, {
|
|
169
|
+
draft_id?: string | undefined;
|
|
170
|
+
limit?: number | undefined;
|
|
171
|
+
}, {
|
|
172
|
+
draft_id?: string | undefined;
|
|
173
|
+
limit?: number | undefined;
|
|
174
|
+
}>;
|
|
175
|
+
readonly "draft.create": z.ZodObject<{
|
|
176
|
+
content: z.ZodObject<{
|
|
177
|
+
text: z.ZodString;
|
|
178
|
+
title: z.ZodOptional<z.ZodString>;
|
|
179
|
+
}, "strict", z.ZodTypeAny, {
|
|
180
|
+
text: string;
|
|
181
|
+
title?: string | undefined;
|
|
182
|
+
}, {
|
|
183
|
+
text: string;
|
|
184
|
+
title?: string | undefined;
|
|
185
|
+
}>;
|
|
186
|
+
platforms: z.ZodArray<z.ZodEnum<["bluesky", "facebook", "instagram", "linkedin", "threads"]>, "many">;
|
|
187
|
+
media: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
188
|
+
media_id: z.ZodOptional<z.ZodString>;
|
|
189
|
+
url: z.ZodOptional<z.ZodString>;
|
|
190
|
+
kind: z.ZodEnum<["image", "video"]>;
|
|
191
|
+
}, "strict", z.ZodTypeAny, {
|
|
192
|
+
kind: "image" | "video";
|
|
193
|
+
media_id?: string | undefined;
|
|
194
|
+
url?: string | undefined;
|
|
195
|
+
}, {
|
|
196
|
+
kind: "image" | "video";
|
|
197
|
+
media_id?: string | undefined;
|
|
198
|
+
url?: string | undefined;
|
|
199
|
+
}>, "many">>;
|
|
200
|
+
template_id: z.ZodOptional<z.ZodString>;
|
|
201
|
+
}, "strict", z.ZodTypeAny, {
|
|
202
|
+
content: {
|
|
203
|
+
text: string;
|
|
204
|
+
title?: string | undefined;
|
|
205
|
+
};
|
|
206
|
+
platforms: ("bluesky" | "facebook" | "instagram" | "linkedin" | "threads")[];
|
|
207
|
+
media?: {
|
|
208
|
+
kind: "image" | "video";
|
|
209
|
+
media_id?: string | undefined;
|
|
210
|
+
url?: string | undefined;
|
|
211
|
+
}[] | undefined;
|
|
212
|
+
template_id?: string | undefined;
|
|
213
|
+
}, {
|
|
214
|
+
content: {
|
|
215
|
+
text: string;
|
|
216
|
+
title?: string | undefined;
|
|
217
|
+
};
|
|
218
|
+
platforms: ("bluesky" | "facebook" | "instagram" | "linkedin" | "threads")[];
|
|
219
|
+
media?: {
|
|
220
|
+
kind: "image" | "video";
|
|
221
|
+
media_id?: string | undefined;
|
|
222
|
+
url?: string | undefined;
|
|
223
|
+
}[] | undefined;
|
|
224
|
+
template_id?: string | undefined;
|
|
225
|
+
}>;
|
|
226
|
+
readonly "draft.update": z.ZodObject<{
|
|
227
|
+
draft_id: z.ZodString;
|
|
228
|
+
patch: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
229
|
+
}, "strict", z.ZodTypeAny, {
|
|
230
|
+
draft_id: string;
|
|
231
|
+
patch: Record<string, unknown>;
|
|
232
|
+
}, {
|
|
233
|
+
draft_id: string;
|
|
234
|
+
patch: Record<string, unknown>;
|
|
235
|
+
}>;
|
|
236
|
+
readonly "connector.read": z.ZodObject<{
|
|
237
|
+
platform: z.ZodOptional<z.ZodEnum<["bluesky", "facebook", "instagram", "linkedin", "threads"]>>;
|
|
238
|
+
}, "strict", z.ZodTypeAny, {
|
|
239
|
+
platform?: "bluesky" | "facebook" | "instagram" | "linkedin" | "threads" | undefined;
|
|
240
|
+
}, {
|
|
241
|
+
platform?: "bluesky" | "facebook" | "instagram" | "linkedin" | "threads" | undefined;
|
|
242
|
+
}>;
|
|
243
|
+
readonly "atomize.run": z.ZodObject<{
|
|
244
|
+
source_type: z.ZodEnum<["audio", "video", "article", "transcript", "url"]>;
|
|
245
|
+
source_ref: z.ZodString;
|
|
246
|
+
platforms: z.ZodArray<z.ZodEnum<["bluesky", "facebook", "instagram", "linkedin", "threads"]>, "many">;
|
|
247
|
+
formats: z.ZodArray<z.ZodEnum<["post", "thread", "carousel", "short_script", "caption"]>, "many">;
|
|
248
|
+
tone_guide_id: z.ZodOptional<z.ZodString>;
|
|
249
|
+
}, "strict", z.ZodTypeAny, {
|
|
250
|
+
platforms: ("bluesky" | "facebook" | "instagram" | "linkedin" | "threads")[];
|
|
251
|
+
source_type: "url" | "video" | "audio" | "article" | "transcript";
|
|
252
|
+
source_ref: string;
|
|
253
|
+
formats: ("post" | "thread" | "carousel" | "short_script" | "caption")[];
|
|
254
|
+
tone_guide_id?: string | undefined;
|
|
255
|
+
}, {
|
|
256
|
+
platforms: ("bluesky" | "facebook" | "instagram" | "linkedin" | "threads")[];
|
|
257
|
+
source_type: "url" | "video" | "audio" | "article" | "transcript";
|
|
258
|
+
source_ref: string;
|
|
259
|
+
formats: ("post" | "thread" | "carousel" | "short_script" | "caption")[];
|
|
260
|
+
tone_guide_id?: string | undefined;
|
|
261
|
+
}>;
|
|
262
|
+
readonly "review_queue.approve": z.ZodObject<{
|
|
263
|
+
pending_action_id: z.ZodString;
|
|
264
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
265
|
+
}, "strict", z.ZodTypeAny, {
|
|
266
|
+
pending_action_id: string;
|
|
267
|
+
comment?: string | undefined;
|
|
268
|
+
}, {
|
|
269
|
+
pending_action_id: string;
|
|
270
|
+
comment?: string | undefined;
|
|
271
|
+
}>;
|
|
272
|
+
readonly "review_queue.reject": z.ZodObject<{
|
|
273
|
+
pending_action_id: z.ZodString;
|
|
274
|
+
reason: z.ZodString;
|
|
275
|
+
}, "strict", z.ZodTypeAny, {
|
|
276
|
+
pending_action_id: string;
|
|
277
|
+
reason: string;
|
|
278
|
+
}, {
|
|
279
|
+
pending_action_id: string;
|
|
280
|
+
reason: string;
|
|
281
|
+
}>;
|
|
282
|
+
readonly "analytics.read": z.ZodObject<{
|
|
283
|
+
workspace_id: z.ZodString;
|
|
284
|
+
range: z.ZodObject<{
|
|
285
|
+
from: z.ZodString;
|
|
286
|
+
to: z.ZodString;
|
|
287
|
+
}, "strict", z.ZodTypeAny, {
|
|
288
|
+
from: string;
|
|
289
|
+
to: string;
|
|
290
|
+
}, {
|
|
291
|
+
from: string;
|
|
292
|
+
to: string;
|
|
293
|
+
}>;
|
|
294
|
+
granularity: z.ZodOptional<z.ZodEnum<["day", "week", "month"]>>;
|
|
295
|
+
platforms: z.ZodOptional<z.ZodArray<z.ZodEnum<["bluesky", "facebook", "instagram", "linkedin", "threads"]>, "many">>;
|
|
296
|
+
}, "strict", z.ZodTypeAny, {
|
|
297
|
+
workspace_id: string;
|
|
298
|
+
range: {
|
|
299
|
+
from: string;
|
|
300
|
+
to: string;
|
|
301
|
+
};
|
|
302
|
+
platforms?: ("bluesky" | "facebook" | "instagram" | "linkedin" | "threads")[] | undefined;
|
|
303
|
+
granularity?: "day" | "week" | "month" | undefined;
|
|
304
|
+
}, {
|
|
305
|
+
workspace_id: string;
|
|
306
|
+
range: {
|
|
307
|
+
from: string;
|
|
308
|
+
to: string;
|
|
309
|
+
};
|
|
310
|
+
platforms?: ("bluesky" | "facebook" | "instagram" | "linkedin" | "threads")[] | undefined;
|
|
311
|
+
granularity?: "day" | "week" | "month" | undefined;
|
|
312
|
+
}>;
|
|
313
|
+
};
|
|
314
|
+
export type ActionPayloadByAction = {
|
|
315
|
+
[K in McpAction]: z.infer<(typeof ACTION_PAYLOAD_SCHEMAS)[K]>;
|
|
316
|
+
};
|
|
317
|
+
export declare const ReviewQueueListInputSchema: z.ZodObject<{
|
|
318
|
+
status: z.ZodOptional<z.ZodEnum<["pending", "approved", "rejected", "edited_and_approved", "expired", "all"]>>;
|
|
319
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
320
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
321
|
+
agent_key_id: z.ZodOptional<z.ZodString>;
|
|
322
|
+
}, "strict", z.ZodTypeAny, {
|
|
323
|
+
status?: "pending" | "approved" | "rejected" | "edited_and_approved" | "expired" | "all" | undefined;
|
|
324
|
+
limit?: number | undefined;
|
|
325
|
+
cursor?: string | undefined;
|
|
326
|
+
agent_key_id?: string | undefined;
|
|
327
|
+
}, {
|
|
328
|
+
status?: "pending" | "approved" | "rejected" | "edited_and_approved" | "expired" | "all" | undefined;
|
|
329
|
+
limit?: number | undefined;
|
|
330
|
+
cursor?: string | undefined;
|
|
331
|
+
agent_key_id?: string | undefined;
|
|
332
|
+
}>;
|
|
333
|
+
export type ReviewQueueListInput = z.infer<typeof ReviewQueueListInputSchema>;
|
|
334
|
+
export declare const ActionSchema: z.ZodEnum<["draft.read", "draft.create", "draft.update", "connector.read", "atomize.run", "review_queue.approve", "review_queue.reject", "analytics.read"]>;
|
|
335
|
+
export type SlimeGateActionRequest = {
|
|
336
|
+
surface_id: string;
|
|
337
|
+
user_id: string;
|
|
338
|
+
workspace_id: string;
|
|
339
|
+
request_id: string;
|
|
340
|
+
idempotency_key: string;
|
|
341
|
+
target: string;
|
|
342
|
+
timestamp: number;
|
|
343
|
+
nonce: string;
|
|
344
|
+
source?: "mcp";
|
|
345
|
+
} & {
|
|
346
|
+
[K in McpAction]: {
|
|
347
|
+
action: K;
|
|
348
|
+
payload: ActionPayloadByAction[K];
|
|
349
|
+
};
|
|
350
|
+
}[McpAction];
|
|
351
|
+
export declare const BaseActionRequestSchema: z.ZodObject<{
|
|
352
|
+
surface_id: z.ZodString;
|
|
353
|
+
user_id: z.ZodString;
|
|
354
|
+
workspace_id: z.ZodString;
|
|
355
|
+
request_id: z.ZodString;
|
|
356
|
+
idempotency_key: z.ZodString;
|
|
357
|
+
action: z.ZodEnum<["draft.read", "draft.create", "draft.update", "connector.read", "atomize.run", "review_queue.approve", "review_queue.reject", "analytics.read"]>;
|
|
358
|
+
target: z.ZodString;
|
|
359
|
+
payload: z.ZodUnknown;
|
|
360
|
+
timestamp: z.ZodNumber;
|
|
361
|
+
nonce: z.ZodString;
|
|
362
|
+
source: z.ZodOptional<z.ZodLiteral<"mcp">>;
|
|
363
|
+
}, "strict", z.ZodTypeAny, {
|
|
364
|
+
workspace_id: string;
|
|
365
|
+
surface_id: string;
|
|
366
|
+
user_id: string;
|
|
367
|
+
request_id: string;
|
|
368
|
+
idempotency_key: string;
|
|
369
|
+
action: "draft.read" | "draft.create" | "draft.update" | "connector.read" | "atomize.run" | "review_queue.approve" | "review_queue.reject" | "analytics.read";
|
|
370
|
+
target: string;
|
|
371
|
+
timestamp: number;
|
|
372
|
+
nonce: string;
|
|
373
|
+
payload?: unknown;
|
|
374
|
+
source?: "mcp" | undefined;
|
|
375
|
+
}, {
|
|
376
|
+
workspace_id: string;
|
|
377
|
+
surface_id: string;
|
|
378
|
+
user_id: string;
|
|
379
|
+
request_id: string;
|
|
380
|
+
idempotency_key: string;
|
|
381
|
+
action: "draft.read" | "draft.create" | "draft.update" | "connector.read" | "atomize.run" | "review_queue.approve" | "review_queue.reject" | "analytics.read";
|
|
382
|
+
target: string;
|
|
383
|
+
timestamp: number;
|
|
384
|
+
nonce: string;
|
|
385
|
+
payload?: unknown;
|
|
386
|
+
source?: "mcp" | undefined;
|
|
387
|
+
}>;
|
|
388
|
+
export declare const ActionRequestSchema: z.ZodType<SlimeGateActionRequest>;
|
|
389
|
+
export type SlimeVerdict = "AUTHORIZED" | "DENIED" | "IMPOSSIBLE" | "QUARANTINED" | "TAMPERED" | "ERROR_TRANSIENT" | "REQUIRES_APPROVAL" | "REWRITTEN" | "RATE_LIMITED";
|
|
390
|
+
export interface SlimeActionDaemonResponse {
|
|
391
|
+
status: SlimeVerdict;
|
|
392
|
+
reason_code: SlimeVerdict;
|
|
393
|
+
proof_id: string | null;
|
|
394
|
+
request_hash: string;
|
|
395
|
+
terminal_request_id: string | null;
|
|
396
|
+
idempotent_replay: boolean;
|
|
397
|
+
audit_ref: string;
|
|
398
|
+
result?: Record<string, unknown> | null;
|
|
399
|
+
approval_required?: {
|
|
400
|
+
pending_action_id: string;
|
|
401
|
+
expires_at: string;
|
|
402
|
+
approval_url?: string;
|
|
403
|
+
};
|
|
404
|
+
rewrite?: {
|
|
405
|
+
original_hash: string;
|
|
406
|
+
new_payload: unknown;
|
|
407
|
+
diff_summary: string;
|
|
408
|
+
};
|
|
409
|
+
rate_limit?: {
|
|
410
|
+
limit: number;
|
|
411
|
+
remaining: number;
|
|
412
|
+
reset_at: string;
|
|
413
|
+
retry_after: number;
|
|
414
|
+
};
|
|
415
|
+
}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { z } from "zod/v3";
|
|
2
|
+
const PROVIDERS = ["bluesky", "facebook", "instagram", "linkedin", "threads"];
|
|
3
|
+
const CONTENT_FORMATS = ["post", "thread", "carousel", "short_script", "caption"];
|
|
4
|
+
const REVIEW_QUEUE_STATUSES = [
|
|
5
|
+
"pending",
|
|
6
|
+
"approved",
|
|
7
|
+
"rejected",
|
|
8
|
+
"edited_and_approved",
|
|
9
|
+
"expired",
|
|
10
|
+
"all",
|
|
11
|
+
];
|
|
12
|
+
const nonEmptyId = z.string().trim().min(1).max(128);
|
|
13
|
+
const shortText = z.string().trim().min(1).max(500);
|
|
14
|
+
const longText = z.string().trim().min(1).max(20_000);
|
|
15
|
+
const isoDateTime = z.string().datetime({ offset: true });
|
|
16
|
+
const patch = z.record(z.string(), z.unknown());
|
|
17
|
+
export const S1_AGENT_ACTIONS = [
|
|
18
|
+
"draft.read",
|
|
19
|
+
"draft.create",
|
|
20
|
+
"draft.update",
|
|
21
|
+
"connector.read",
|
|
22
|
+
"atomize.run",
|
|
23
|
+
"review_queue.approve",
|
|
24
|
+
"review_queue.reject",
|
|
25
|
+
"analytics.read",
|
|
26
|
+
];
|
|
27
|
+
export const TOOL_ACTION_MAP = {
|
|
28
|
+
slapy_draft_list: "draft.read",
|
|
29
|
+
slapy_draft_create: "draft.create",
|
|
30
|
+
slapy_draft_update: "draft.update",
|
|
31
|
+
slapy_connector_list: "connector.read",
|
|
32
|
+
slapy_atomize_run: "atomize.run",
|
|
33
|
+
slapy_review_queue_approve: "review_queue.approve",
|
|
34
|
+
slapy_review_queue_reject: "review_queue.reject",
|
|
35
|
+
slapy_analytics_read: "analytics.read",
|
|
36
|
+
};
|
|
37
|
+
export const SlimeProviderIdSchema = z.enum(PROVIDERS);
|
|
38
|
+
export const DraftReadPayloadSchema = z
|
|
39
|
+
.object({
|
|
40
|
+
draft_id: nonEmptyId.optional(),
|
|
41
|
+
limit: z.number().int().min(1).max(100).optional(),
|
|
42
|
+
})
|
|
43
|
+
.strict();
|
|
44
|
+
export const DraftCreatePayloadSchema = z
|
|
45
|
+
.object({
|
|
46
|
+
content: z
|
|
47
|
+
.object({
|
|
48
|
+
text: longText,
|
|
49
|
+
title: shortText.optional(),
|
|
50
|
+
})
|
|
51
|
+
.strict(),
|
|
52
|
+
platforms: z.array(SlimeProviderIdSchema).min(1).max(20),
|
|
53
|
+
media: z
|
|
54
|
+
.array(z
|
|
55
|
+
.object({
|
|
56
|
+
media_id: nonEmptyId.optional(),
|
|
57
|
+
url: z.string().url().optional(),
|
|
58
|
+
kind: z.enum(["image", "video"]),
|
|
59
|
+
})
|
|
60
|
+
.strict())
|
|
61
|
+
.max(20)
|
|
62
|
+
.optional(),
|
|
63
|
+
template_id: nonEmptyId.optional(),
|
|
64
|
+
})
|
|
65
|
+
.strict();
|
|
66
|
+
export const DraftUpdatePayloadSchema = z
|
|
67
|
+
.object({
|
|
68
|
+
draft_id: nonEmptyId,
|
|
69
|
+
patch,
|
|
70
|
+
})
|
|
71
|
+
.strict();
|
|
72
|
+
export const ConnectorReadPayloadSchema = z
|
|
73
|
+
.object({
|
|
74
|
+
platform: SlimeProviderIdSchema.optional(),
|
|
75
|
+
})
|
|
76
|
+
.strict();
|
|
77
|
+
export const AtomizeRunPayloadSchema = z
|
|
78
|
+
.object({
|
|
79
|
+
source_type: z.enum(["audio", "video", "article", "transcript", "url"]),
|
|
80
|
+
source_ref: nonEmptyId,
|
|
81
|
+
platforms: z.array(SlimeProviderIdSchema).min(1).max(20),
|
|
82
|
+
formats: z.array(z.enum(CONTENT_FORMATS)).min(1).max(20),
|
|
83
|
+
tone_guide_id: nonEmptyId.optional(),
|
|
84
|
+
})
|
|
85
|
+
.strict();
|
|
86
|
+
export const ReviewQueueApprovePayloadSchema = z
|
|
87
|
+
.object({
|
|
88
|
+
pending_action_id: nonEmptyId,
|
|
89
|
+
comment: z.string().trim().max(1_000).optional(),
|
|
90
|
+
})
|
|
91
|
+
.strict();
|
|
92
|
+
export const ReviewQueueRejectPayloadSchema = z
|
|
93
|
+
.object({
|
|
94
|
+
pending_action_id: nonEmptyId,
|
|
95
|
+
reason: shortText,
|
|
96
|
+
})
|
|
97
|
+
.strict();
|
|
98
|
+
export const AnalyticsReadPayloadSchema = z
|
|
99
|
+
.object({
|
|
100
|
+
workspace_id: nonEmptyId,
|
|
101
|
+
range: z
|
|
102
|
+
.object({
|
|
103
|
+
from: isoDateTime,
|
|
104
|
+
to: isoDateTime,
|
|
105
|
+
})
|
|
106
|
+
.strict(),
|
|
107
|
+
granularity: z.enum(["day", "week", "month"]).optional(),
|
|
108
|
+
platforms: z.array(SlimeProviderIdSchema).min(1).max(20).optional(),
|
|
109
|
+
})
|
|
110
|
+
.strict();
|
|
111
|
+
export const ACTION_PAYLOAD_SCHEMAS = {
|
|
112
|
+
"draft.read": DraftReadPayloadSchema,
|
|
113
|
+
"draft.create": DraftCreatePayloadSchema,
|
|
114
|
+
"draft.update": DraftUpdatePayloadSchema,
|
|
115
|
+
"connector.read": ConnectorReadPayloadSchema,
|
|
116
|
+
"atomize.run": AtomizeRunPayloadSchema,
|
|
117
|
+
"review_queue.approve": ReviewQueueApprovePayloadSchema,
|
|
118
|
+
"review_queue.reject": ReviewQueueRejectPayloadSchema,
|
|
119
|
+
"analytics.read": AnalyticsReadPayloadSchema,
|
|
120
|
+
};
|
|
121
|
+
export const ReviewQueueListInputSchema = z
|
|
122
|
+
.object({
|
|
123
|
+
status: z.enum(REVIEW_QUEUE_STATUSES).optional(),
|
|
124
|
+
limit: z.number().int().min(1).max(200).optional(),
|
|
125
|
+
cursor: nonEmptyId.optional(),
|
|
126
|
+
agent_key_id: nonEmptyId.optional(),
|
|
127
|
+
})
|
|
128
|
+
.strict();
|
|
129
|
+
export const ActionSchema = z.enum(S1_AGENT_ACTIONS);
|
|
130
|
+
export const BaseActionRequestSchema = z
|
|
131
|
+
.object({
|
|
132
|
+
surface_id: nonEmptyId,
|
|
133
|
+
user_id: nonEmptyId,
|
|
134
|
+
workspace_id: nonEmptyId,
|
|
135
|
+
request_id: nonEmptyId,
|
|
136
|
+
idempotency_key: nonEmptyId,
|
|
137
|
+
action: ActionSchema,
|
|
138
|
+
target: nonEmptyId,
|
|
139
|
+
payload: z.unknown(),
|
|
140
|
+
timestamp: z.number().int().positive(),
|
|
141
|
+
nonce: nonEmptyId,
|
|
142
|
+
source: z.literal("mcp").optional(),
|
|
143
|
+
})
|
|
144
|
+
.strict();
|
|
145
|
+
export const ActionRequestSchema = BaseActionRequestSchema.superRefine((value, ctx) => {
|
|
146
|
+
const schema = ACTION_PAYLOAD_SCHEMAS[value.action];
|
|
147
|
+
const result = schema.safeParse(value.payload);
|
|
148
|
+
if (!result.success) {
|
|
149
|
+
for (const issue of result.error.issues) {
|
|
150
|
+
ctx.addIssue({
|
|
151
|
+
...issue,
|
|
152
|
+
path: ["payload", ...issue.path],
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
//# sourceMappingURL=contracts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contracts.js","sourceRoot":"","sources":["../src/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAA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CAAC;AAgBrD,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC;KACrC,MAAM,CAAC;IACN,UAAU,EAAE,UAAU;IACtB,OAAO,EAAE,UAAU;IACnB,YAAY,EAAE,UAAU;IACxB,UAAU,EAAE,UAAU;IACtB,eAAe,EAAE,UAAU;IAC3B,MAAM,EAAE,YAAY;IACpB,MAAM,EAAE,UAAU;IAClB,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;IACpB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IACtC,KAAK,EAAE,UAAU;IACjB,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE;CACpC,CAAC;KACD,MAAM,EAAE,CAAC;AAEZ,MAAM,CAAC,MAAM,mBAAmB,GAAG,uBAAuB,CAAC,WAAW,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACpF,MAAM,MAAM,GAAG,sBAAsB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACpD,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAE/C,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;YACxC,GAAG,CAAC,QAAQ,CAAC;gBACX,GAAG,KAAK;gBACR,IAAI,EAAE,CAAC,SAAS,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC;aACjC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;AACH,CAAC,CAAsC,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { readSlapyMcpConfig, type SlapyMcpConfig } from "./auth.js";
|
|
2
|
+
export { SlapyApiError, buildActionRequest, callAgentAction, listReviewQueue, } from "./action-client.js";
|
|
3
|
+
export { createSlapyMcpServer, connectStdioServer } from "./server.js";
|
|
4
|
+
export { dispatchToolCall, listSlapyTools } from "./tools/index.js";
|
|
5
|
+
export declare function runStdioServer(): Promise<void>;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { readSlapyMcpConfig } from "./auth.js";
|
|
2
|
+
export { SlapyApiError, buildActionRequest, callAgentAction, listReviewQueue, } from "./action-client.js";
|
|
3
|
+
export { createSlapyMcpServer, connectStdioServer } from "./server.js";
|
|
4
|
+
export { dispatchToolCall, listSlapyTools } from "./tools/index.js";
|
|
5
|
+
import { readSlapyMcpConfig } from "./auth.js";
|
|
6
|
+
import { connectStdioServer } from "./server.js";
|
|
7
|
+
export async function runStdioServer() {
|
|
8
|
+
await connectStdioServer(readSlapyMcpConfig());
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAuB,MAAM,WAAW,CAAC;AACpE,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,eAAe,EACf,eAAe,GAChB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD,MAAM,CAAC,KAAK,UAAU,cAAc;IAClC,MAAM,kBAAkB,CAAC,kBAAkB,EAAE,CAAC,CAAC;AACjD,CAAC"}
|
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
2
|
+
import type { SlapyMcpConfig } from "./auth.js";
|
|
3
|
+
export declare function createSlapyMcpServer(config: SlapyMcpConfig): Server;
|
|
4
|
+
export declare function connectStdioServer(config: SlapyMcpConfig): Promise<void>;
|
package/dist/server.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
2
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
3
|
+
import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
4
|
+
import { dispatchToolCall, listSlapyTools } from "./tools/index.js";
|
|
5
|
+
export function createSlapyMcpServer(config) {
|
|
6
|
+
const server = new Server({
|
|
7
|
+
name: "slapy-mcp",
|
|
8
|
+
version: "1.0.0-alpha",
|
|
9
|
+
}, {
|
|
10
|
+
capabilities: {
|
|
11
|
+
tools: {},
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
15
|
+
tools: listSlapyTools(),
|
|
16
|
+
}));
|
|
17
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => dispatchToolCall(request.params.name, request.params.arguments ?? {}, {
|
|
18
|
+
config,
|
|
19
|
+
}));
|
|
20
|
+
return server;
|
|
21
|
+
}
|
|
22
|
+
export async function connectStdioServer(config) {
|
|
23
|
+
const server = createSlapyMcpServer(config);
|
|
24
|
+
await server.connect(new StdioServerTransport());
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,oCAAoC,CAAC;AAG5C,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEpE,MAAM,UAAU,oBAAoB,CAAC,MAAsB;IACzD,MAAM,MAAM,GAAG,IAAI,MAAM,CACvB;QACE,IAAI,EAAE,WAAW;QACjB,OAAO,EAAE,aAAa;KACvB,EACD;QACE,YAAY,EAAE;YACZ,KAAK,EAAE,EAAE;SACV;KACF,CACF,CAAC;IAEF,MAAM,CAAC,iBAAiB,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;QAC5D,KAAK,EAAE,cAAc,EAAE;KACxB,CAAC,CAAC,CAAC;IAEJ,MAAM,CAAC,iBAAiB,CAAC,qBAAqB,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,CAChE,gBAAgB,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,SAAS,IAAI,EAAE,EAAE;QACpE,MAAM;KACP,CAAC,CACH,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,MAAsB;IAC7D,MAAM,MAAM,GAAG,oBAAoB,CAAC,MAAM,CAAC,CAAC;IAC5C,MAAM,MAAM,CAAC,OAAO,CAAC,IAAI,oBAAoB,EAAE,CAAC,CAAC;AACnD,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AnalyticsReadPayloadSchema } from "../contracts.js";
|
|
2
|
+
import { inputSchema } from "./json-schema.js";
|
|
3
|
+
export function analyticsTools() {
|
|
4
|
+
return [
|
|
5
|
+
{
|
|
6
|
+
name: "slapy_analytics_read",
|
|
7
|
+
description: "Read SLAPY analytics for a workspace and date range.",
|
|
8
|
+
inputSchema: inputSchema(AnalyticsReadPayloadSchema),
|
|
9
|
+
},
|
|
10
|
+
];
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=analytics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analytics.js","sourceRoot":"","sources":["../../src/tools/analytics.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,MAAM,UAAU,cAAc;IAC5B,OAAO;QACL;YACE,IAAI,EAAE,sBAAsB;YAC5B,WAAW,EAAE,sDAAsD;YACnE,WAAW,EAAE,WAAW,CAAC,0BAA0B,CAAC;SACrD;KACF,CAAC;AACJ,CAAC"}
|