@posty5/mcp 2.0.0 → 2.2.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/README.md +1 -1
- package/dist/bin/stdio.js +68 -8
- package/dist/bin/stdio.js.map +1 -1
- package/dist/bin/stdio.mjs +69 -9
- package/dist/bin/stdio.mjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +68 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +69 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -60,7 +60,7 @@ The server writes the protocol to stdout and everything else to stderr.
|
|
|
60
60
|
| `qr-codes` | ✅ | QR codes of every type, QR templates, download links (PNG / SVG / print PDF) and scannability checks |
|
|
61
61
|
| `html-hosting` | ✅ | Hosted pages, their variables, form submissions |
|
|
62
62
|
| `social-publisher` | ✅ | Workspaces, connected accounts, posts to every platform |
|
|
63
|
-
|
|
63
|
+
76 tools in all; `listToolsets()` and `listTools()` describe them.
|
|
64
64
|
|
|
65
65
|
The store toolsets (`store`, `store-catalog`, `store-orders`, `store-shipping`,
|
|
66
66
|
`store-dropshipping`) left this package in 2.0.0: the Online Store Builder is
|
package/dist/bin/stdio.js
CHANGED
|
@@ -111,7 +111,7 @@ function selectTools(all, toolsets, access) {
|
|
|
111
111
|
// src/config/instructions.config.ts
|
|
112
112
|
var SERVER_NAME = "posty5";
|
|
113
113
|
var SERVER_TITLE = "Posty5";
|
|
114
|
-
var PACKAGE_VERSION = "2.
|
|
114
|
+
var PACKAGE_VERSION = "2.2.0";
|
|
115
115
|
var SERVER_INSTRUCTIONS = [
|
|
116
116
|
"Posty5 is a platform for short links, QR codes, hosted HTML pages and social media publishing. These tools act on the Posty5 account this connection belongs to.",
|
|
117
117
|
"Start with account_get_current to see which account and plan you are working with.",
|
|
@@ -1670,9 +1670,11 @@ var SOCIAL_POST_STATUSES = [
|
|
|
1670
1670
|
"retrying",
|
|
1671
1671
|
"removing",
|
|
1672
1672
|
"removed",
|
|
1673
|
-
"removeFailed"
|
|
1673
|
+
"removeFailed",
|
|
1674
|
+
"partiallyRemoved"
|
|
1674
1675
|
];
|
|
1675
1676
|
var SOCIAL_POST_PLATFORMS = ["youtube", "facebook", "instagram", "tiktok"];
|
|
1677
|
+
var SOCIAL_POST_REMOVE_PLATFORMS = ["youtube", "facebook", "instagram", "tiktok", "threads", "twitter"];
|
|
1676
1678
|
var VIDEO_PLATFORM_BLOCKS = ["youtube", "tiktok", "facebook", "instagram"];
|
|
1677
1679
|
var SOCIAL_POST_TARGETS = ["workspaceId", "accountId"];
|
|
1678
1680
|
var TIKTOK_PRIVACY_LEVELS = ["PUBLIC_TO_EVERYONE", "FOLLOWER_OF_CREATOR", "MUTUAL_FOLLOW_FRIENDS", "SELF_ONLY"];
|
|
@@ -1692,6 +1694,8 @@ var IMAGE_CAPTION_MAX_LENGTH = 8e3;
|
|
|
1692
1694
|
var YOUTUBE_TITLE_MAX_LENGTH = 100;
|
|
1693
1695
|
var THREADS_TEXT_MAX_LENGTH = 500;
|
|
1694
1696
|
var TWITTER_TEXT_MAX_WEIGHTED_LENGTH = 280;
|
|
1697
|
+
var MAX_WORKSPACE_DEFAULT_COMMENTS = 10;
|
|
1698
|
+
var COMMENT_POST_TYPES = ["shortVideo", "longVideo", "image", "text"];
|
|
1695
1699
|
|
|
1696
1700
|
// src/core/social-publisher.helper.ts
|
|
1697
1701
|
function toScheduleConfig(scheduledAt) {
|
|
@@ -1715,6 +1719,7 @@ function videoPublishOptions(args) {
|
|
|
1715
1719
|
facebook: args.facebook,
|
|
1716
1720
|
instagram: args.instagram,
|
|
1717
1721
|
comment: args.comment,
|
|
1722
|
+
allowPostDefaultComments: args.allowPostDefaultComments,
|
|
1718
1723
|
schedule: args.scheduledAt ? new Date(args.scheduledAt) : void 0,
|
|
1719
1724
|
tag: args.tag,
|
|
1720
1725
|
refId: args.refId
|
|
@@ -1781,7 +1786,19 @@ var commentsField = zod.z.array(
|
|
|
1781
1786
|
imageUrl: zod.z.string().url().optional().describe("A public image to attach \u2014 Facebook only."),
|
|
1782
1787
|
...commentFlags
|
|
1783
1788
|
})
|
|
1784
|
-
).max(socialPublisherPost.
|
|
1789
|
+
).max(socialPublisherPost.MAX_POST_COMMENTS_TOTAL).optional().describe(`Up to ${socialPublisherPost.MAX_POST_COMMENTS_PER_PLATFORM} comments per platform (${socialPublisherPost.MAX_POST_COMMENTS_TOTAL} in all), posted under the post once it is live, in order. Each is charged separately; see account_get_operation_costs.`);
|
|
1790
|
+
var allowDefaultCommentsField = zod.z.boolean().optional().describe(
|
|
1791
|
+
"Add the saved default comments (default true): a workspace's defaults for this post type plus account defaults marked applyToWorkspacePosts, or an account's own. They are added after `comments` and charged like any other comment. Send false to add none \u2014 do so when you already put the defaults you want into `comments` (social_workspace_resolve_default_comments lists them)."
|
|
1792
|
+
);
|
|
1793
|
+
var workspaceDefaultCommentField = zod.z.object({
|
|
1794
|
+
_id: zod.z.string().optional().describe("Send it back to edit this default; omit it to add one."),
|
|
1795
|
+
text: zod.z.string().min(1).max(socialPublisherPost.MAX_COMMENT_LENGTH),
|
|
1796
|
+
delayMinutes: zod.z.number().int().min(0).max(socialPublisherPost.MAX_COMMENT_DELAY_MINUTES).optional().describe("Minutes to wait after the post is live. Default 0."),
|
|
1797
|
+
imageUrl: zod.z.string().url().optional().describe("A public image to attach \u2014 Facebook and Threads only."),
|
|
1798
|
+
isActive: zod.z.boolean().optional().describe("An inactive default is kept but never added. Default true."),
|
|
1799
|
+
postTypes: zod.z.array(zod.z.enum(COMMENT_POST_TYPES)).optional().describe("The post types it is added to. Empty or absent: all of them."),
|
|
1800
|
+
...commentFlags
|
|
1801
|
+
});
|
|
1785
1802
|
var videoPostFields = {
|
|
1786
1803
|
...targetFields2,
|
|
1787
1804
|
videoUrl: zod.z.string().url().describe("A direct, public URL of the video file (.mp4, .mov, .avi, .mkv or .webm). Files cannot be uploaded through this tool."),
|
|
@@ -1791,6 +1808,7 @@ var videoPostFields = {
|
|
|
1791
1808
|
facebook: facebookBlock,
|
|
1792
1809
|
instagram: instagramBlock,
|
|
1793
1810
|
comment: videoCommentField,
|
|
1811
|
+
allowPostDefaultComments: allowDefaultCommentsField,
|
|
1794
1812
|
scheduledAt: scheduledAtField,
|
|
1795
1813
|
...labelFields2
|
|
1796
1814
|
};
|
|
@@ -1829,6 +1847,42 @@ var SOCIAL_PUBLISHER_TOOLS = [
|
|
|
1829
1847
|
input: zod.z.object({ id: idField(WORKSPACE_ID) }),
|
|
1830
1848
|
run: ({ id }, { clients }) => clients.workspaces.getForNewPost(id)
|
|
1831
1849
|
}),
|
|
1850
|
+
defineTool({
|
|
1851
|
+
name: "social_workspace_get_default_comments",
|
|
1852
|
+
toolset: "social-publisher",
|
|
1853
|
+
access: "read",
|
|
1854
|
+
title: "Workspace default comments",
|
|
1855
|
+
description: "The comments every new post to this workspace starts with, in order, each with the post types it applies to (empty = all) and its platforms. Read the workspace's __v with social_workspace_get before changing them.",
|
|
1856
|
+
input: zod.z.object({ id: idField(WORKSPACE_ID) }),
|
|
1857
|
+
run: async ({ id }, { clients }) => ({ comments: await clients.workspaces.getDefaultComments(id) })
|
|
1858
|
+
}),
|
|
1859
|
+
defineTool({
|
|
1860
|
+
name: "social_workspace_resolve_default_comments",
|
|
1861
|
+
toolset: "social-publisher",
|
|
1862
|
+
access: "read",
|
|
1863
|
+
title: "Preview a new post's default comments",
|
|
1864
|
+
description: "The default comments a new post of postType to this workspace would get right now: the workspace's own for that type, then account defaults marked applyToWorkspacePosts, aimed only at platforms the workspace has accounts on. warnings lists any dropped at a platform's ceiling. To publish an edited list, pass it as the post's comments with allowPostDefaultComments: false.",
|
|
1865
|
+
input: zod.z.object({ id: idField(WORKSPACE_ID), postType: zod.z.enum(COMMENT_POST_TYPES) }),
|
|
1866
|
+
run: ({ id, postType }, { clients }) => clients.workspaces.resolveDefaultComments(id, postType)
|
|
1867
|
+
}),
|
|
1868
|
+
defineTool({
|
|
1869
|
+
name: "social_workspace_set_default_comments",
|
|
1870
|
+
toolset: "social-publisher",
|
|
1871
|
+
access: "write",
|
|
1872
|
+
title: "Set workspace default comments",
|
|
1873
|
+
description: `Replaces the workspace's default comments with this list (at most ${MAX_WORKSPACE_DEFAULT_COMMENTS}); an empty list clears them. New posts to the workspace then get them automatically unless the publish call sends allowPostDefaultComments: false, and every added comment is charged like any other. Existing and scheduled posts keep the comments they already have.`,
|
|
1874
|
+
input: zod.z.object({
|
|
1875
|
+
id: idField(WORKSPACE_ID),
|
|
1876
|
+
version: versionField("the workspace"),
|
|
1877
|
+
comments: zod.z.array(workspaceDefaultCommentField).max(MAX_WORKSPACE_DEFAULT_COMMENTS)
|
|
1878
|
+
}),
|
|
1879
|
+
annotations: { idempotent: true },
|
|
1880
|
+
run: async ({ id, version, comments }, { clients }) => {
|
|
1881
|
+
const saved = await clients.workspaces.setDefaultComments(id, comments, version);
|
|
1882
|
+
return { updated: true, id, __v: saved.__v, comments: saved.comments };
|
|
1883
|
+
},
|
|
1884
|
+
entity: (_result, args) => ({ entityType: "socialWorkspace", entityId: args.id })
|
|
1885
|
+
}),
|
|
1832
1886
|
defineTool({
|
|
1833
1887
|
name: "social_account_list",
|
|
1834
1888
|
toolset: "social-publisher",
|
|
@@ -1971,6 +2025,7 @@ var SOCIAL_PUBLISHER_TOOLS = [
|
|
|
1971
2025
|
facebook: facebookBlock,
|
|
1972
2026
|
instagram: instagramBlock,
|
|
1973
2027
|
comments: commentsField,
|
|
2028
|
+
allowPostDefaultComments: allowDefaultCommentsField,
|
|
1974
2029
|
scheduledAt: scheduledAtField,
|
|
1975
2030
|
...labelFields2
|
|
1976
2031
|
}),
|
|
@@ -2057,6 +2112,7 @@ var SOCIAL_PUBLISHER_TOOLS = [
|
|
|
2057
2112
|
reply_settings: zod.z.enum(TWITTER_REPLY_SETTINGS).optional()
|
|
2058
2113
|
}).optional().describe("X override."),
|
|
2059
2114
|
comments: commentsField,
|
|
2115
|
+
allowPostDefaultComments: allowDefaultCommentsField,
|
|
2060
2116
|
scheduledAt: scheduledAtField,
|
|
2061
2117
|
...labelFields2
|
|
2062
2118
|
}),
|
|
@@ -2136,19 +2192,23 @@ var SOCIAL_PUBLISHER_TOOLS = [
|
|
|
2136
2192
|
toolset: "social-publisher",
|
|
2137
2193
|
access: "full",
|
|
2138
2194
|
title: "Remove a post from the platforms",
|
|
2139
|
-
description: "Deletes a published post's media from the platforms it was published to, at once. Instagram and TikTok offer no delete through their APIs, so media there stays. Irreversible. Paid, only when the removal succeeds: the price is in account_get_operation_costs.",
|
|
2140
|
-
input: zod.z.object({
|
|
2195
|
+
description: "Deletes a published post's media from the platforms it was published to, at once, or from one platform when `platform` is given (the others keep their copies and the post becomes partiallyRemoved). Instagram and TikTok offer no delete through their APIs, so media there stays. Irreversible. Paid, only when the removal succeeds: the price is in account_get_operation_costs.",
|
|
2196
|
+
input: zod.z.object({
|
|
2197
|
+
id: idField(POST_ID),
|
|
2198
|
+
version: versionField("the post"),
|
|
2199
|
+
platform: zod.z.enum(SOCIAL_POST_REMOVE_PLATFORMS).optional().describe("Remove from this platform only. The post must have been published there. Omit to remove from every platform.")
|
|
2200
|
+
}),
|
|
2141
2201
|
annotations: { destructive: true, idempotent: true },
|
|
2142
2202
|
confirm: {
|
|
2143
|
-
describe: async ({ id }, { clients }) => {
|
|
2203
|
+
describe: async ({ id, platform }, { clients }) => {
|
|
2144
2204
|
const post = await clients.posts.getStatus(id);
|
|
2145
|
-
const platforms = postPlatforms(post);
|
|
2205
|
+
const platforms = platform ? [platform] : postPlatforms(post);
|
|
2146
2206
|
const where = platforms.length ? platforms.join(", ") : "the platforms it was published to";
|
|
2147
2207
|
return `Remove post #${post.numbering} from ${where}. The published media is deleted from those platforms immediately, and this is irreversible \u2014 it cannot be restored or re-published from here. Instagram and TikTok offer no delete through their APIs, so media there stays.`;
|
|
2148
2208
|
},
|
|
2149
2209
|
costFeaturePath: "socialMediaPublisher.removePost"
|
|
2150
2210
|
},
|
|
2151
|
-
run: ({ id, version }, { clients }) => clients.posts.removePost(id, version),
|
|
2211
|
+
run: ({ id, version, platform }, { clients }) => clients.posts.removePost(id, version, platform),
|
|
2152
2212
|
entity: (_result, args) => ({ entityType: "socialPost", entityId: args.id })
|
|
2153
2213
|
})
|
|
2154
2214
|
];
|