@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/dist/index.d.mts
CHANGED
|
@@ -371,7 +371,7 @@ declare const CLIENT_HEADER = "X-Posty5-Client";
|
|
|
371
371
|
declare const MCP_CREATED_FROM = "mcp";
|
|
372
372
|
|
|
373
373
|
/** This package's version — kept in step with package.json (a test pins them). */
|
|
374
|
-
declare const PACKAGE_VERSION = "2.
|
|
374
|
+
declare const PACKAGE_VERSION = "2.2.0";
|
|
375
375
|
/**
|
|
376
376
|
* What every assistant is told when it connects (MCP server `instructions`).
|
|
377
377
|
* Short on purpose: it is in the model's context for the whole session.
|
package/dist/index.d.ts
CHANGED
|
@@ -371,7 +371,7 @@ declare const CLIENT_HEADER = "X-Posty5-Client";
|
|
|
371
371
|
declare const MCP_CREATED_FROM = "mcp";
|
|
372
372
|
|
|
373
373
|
/** This package's version — kept in step with package.json (a test pins them). */
|
|
374
|
-
declare const PACKAGE_VERSION = "2.
|
|
374
|
+
declare const PACKAGE_VERSION = "2.2.0";
|
|
375
375
|
/**
|
|
376
376
|
* What every assistant is told when it connects (MCP server `instructions`).
|
|
377
377
|
* Short on purpose: it is in the model's context for the whole session.
|
package/dist/index.js
CHANGED
|
@@ -77,7 +77,7 @@ var MS_PER_MINUTE = 60 * 1e3;
|
|
|
77
77
|
// src/config/instructions.config.ts
|
|
78
78
|
var SERVER_NAME = "posty5";
|
|
79
79
|
var SERVER_TITLE = "Posty5";
|
|
80
|
-
var PACKAGE_VERSION = "2.
|
|
80
|
+
var PACKAGE_VERSION = "2.2.0";
|
|
81
81
|
var SERVER_INSTRUCTIONS = [
|
|
82
82
|
"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.",
|
|
83
83
|
"Start with account_get_current to see which account and plan you are working with.",
|
|
@@ -1647,9 +1647,11 @@ var SOCIAL_POST_STATUSES = [
|
|
|
1647
1647
|
"retrying",
|
|
1648
1648
|
"removing",
|
|
1649
1649
|
"removed",
|
|
1650
|
-
"removeFailed"
|
|
1650
|
+
"removeFailed",
|
|
1651
|
+
"partiallyRemoved"
|
|
1651
1652
|
];
|
|
1652
1653
|
var SOCIAL_POST_PLATFORMS = ["youtube", "facebook", "instagram", "tiktok"];
|
|
1654
|
+
var SOCIAL_POST_REMOVE_PLATFORMS = ["youtube", "facebook", "instagram", "tiktok", "threads", "twitter"];
|
|
1653
1655
|
var VIDEO_PLATFORM_BLOCKS = ["youtube", "tiktok", "facebook", "instagram"];
|
|
1654
1656
|
var SOCIAL_POST_TARGETS = ["workspaceId", "accountId"];
|
|
1655
1657
|
var TIKTOK_PRIVACY_LEVELS = ["PUBLIC_TO_EVERYONE", "FOLLOWER_OF_CREATOR", "MUTUAL_FOLLOW_FRIENDS", "SELF_ONLY"];
|
|
@@ -1669,6 +1671,8 @@ var IMAGE_CAPTION_MAX_LENGTH = 8e3;
|
|
|
1669
1671
|
var YOUTUBE_TITLE_MAX_LENGTH = 100;
|
|
1670
1672
|
var THREADS_TEXT_MAX_LENGTH = 500;
|
|
1671
1673
|
var TWITTER_TEXT_MAX_WEIGHTED_LENGTH = 280;
|
|
1674
|
+
var MAX_WORKSPACE_DEFAULT_COMMENTS = 10;
|
|
1675
|
+
var COMMENT_POST_TYPES = ["shortVideo", "longVideo", "image", "text"];
|
|
1672
1676
|
|
|
1673
1677
|
// src/core/social-publisher.helper.ts
|
|
1674
1678
|
function toScheduleConfig(scheduledAt) {
|
|
@@ -1692,6 +1696,7 @@ function videoPublishOptions(args) {
|
|
|
1692
1696
|
facebook: args.facebook,
|
|
1693
1697
|
instagram: args.instagram,
|
|
1694
1698
|
comment: args.comment,
|
|
1699
|
+
allowPostDefaultComments: args.allowPostDefaultComments,
|
|
1695
1700
|
schedule: args.scheduledAt ? new Date(args.scheduledAt) : void 0,
|
|
1696
1701
|
tag: args.tag,
|
|
1697
1702
|
refId: args.refId
|
|
@@ -1758,7 +1763,19 @@ var commentsField = zod.z.array(
|
|
|
1758
1763
|
imageUrl: zod.z.string().url().optional().describe("A public image to attach \u2014 Facebook only."),
|
|
1759
1764
|
...commentFlags
|
|
1760
1765
|
})
|
|
1761
|
-
).max(socialPublisherPost.
|
|
1766
|
+
).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.`);
|
|
1767
|
+
var allowDefaultCommentsField = zod.z.boolean().optional().describe(
|
|
1768
|
+
"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)."
|
|
1769
|
+
);
|
|
1770
|
+
var workspaceDefaultCommentField = zod.z.object({
|
|
1771
|
+
_id: zod.z.string().optional().describe("Send it back to edit this default; omit it to add one."),
|
|
1772
|
+
text: zod.z.string().min(1).max(socialPublisherPost.MAX_COMMENT_LENGTH),
|
|
1773
|
+
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."),
|
|
1774
|
+
imageUrl: zod.z.string().url().optional().describe("A public image to attach \u2014 Facebook and Threads only."),
|
|
1775
|
+
isActive: zod.z.boolean().optional().describe("An inactive default is kept but never added. Default true."),
|
|
1776
|
+
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."),
|
|
1777
|
+
...commentFlags
|
|
1778
|
+
});
|
|
1762
1779
|
var videoPostFields = {
|
|
1763
1780
|
...targetFields2,
|
|
1764
1781
|
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."),
|
|
@@ -1768,6 +1785,7 @@ var videoPostFields = {
|
|
|
1768
1785
|
facebook: facebookBlock,
|
|
1769
1786
|
instagram: instagramBlock,
|
|
1770
1787
|
comment: videoCommentField,
|
|
1788
|
+
allowPostDefaultComments: allowDefaultCommentsField,
|
|
1771
1789
|
scheduledAt: scheduledAtField,
|
|
1772
1790
|
...labelFields2
|
|
1773
1791
|
};
|
|
@@ -1806,6 +1824,42 @@ var SOCIAL_PUBLISHER_TOOLS = [
|
|
|
1806
1824
|
input: zod.z.object({ id: idField(WORKSPACE_ID) }),
|
|
1807
1825
|
run: ({ id }, { clients }) => clients.workspaces.getForNewPost(id)
|
|
1808
1826
|
}),
|
|
1827
|
+
defineTool({
|
|
1828
|
+
name: "social_workspace_get_default_comments",
|
|
1829
|
+
toolset: "social-publisher",
|
|
1830
|
+
access: "read",
|
|
1831
|
+
title: "Workspace default comments",
|
|
1832
|
+
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.",
|
|
1833
|
+
input: zod.z.object({ id: idField(WORKSPACE_ID) }),
|
|
1834
|
+
run: async ({ id }, { clients }) => ({ comments: await clients.workspaces.getDefaultComments(id) })
|
|
1835
|
+
}),
|
|
1836
|
+
defineTool({
|
|
1837
|
+
name: "social_workspace_resolve_default_comments",
|
|
1838
|
+
toolset: "social-publisher",
|
|
1839
|
+
access: "read",
|
|
1840
|
+
title: "Preview a new post's default comments",
|
|
1841
|
+
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.",
|
|
1842
|
+
input: zod.z.object({ id: idField(WORKSPACE_ID), postType: zod.z.enum(COMMENT_POST_TYPES) }),
|
|
1843
|
+
run: ({ id, postType }, { clients }) => clients.workspaces.resolveDefaultComments(id, postType)
|
|
1844
|
+
}),
|
|
1845
|
+
defineTool({
|
|
1846
|
+
name: "social_workspace_set_default_comments",
|
|
1847
|
+
toolset: "social-publisher",
|
|
1848
|
+
access: "write",
|
|
1849
|
+
title: "Set workspace default comments",
|
|
1850
|
+
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.`,
|
|
1851
|
+
input: zod.z.object({
|
|
1852
|
+
id: idField(WORKSPACE_ID),
|
|
1853
|
+
version: versionField("the workspace"),
|
|
1854
|
+
comments: zod.z.array(workspaceDefaultCommentField).max(MAX_WORKSPACE_DEFAULT_COMMENTS)
|
|
1855
|
+
}),
|
|
1856
|
+
annotations: { idempotent: true },
|
|
1857
|
+
run: async ({ id, version, comments }, { clients }) => {
|
|
1858
|
+
const saved = await clients.workspaces.setDefaultComments(id, comments, version);
|
|
1859
|
+
return { updated: true, id, __v: saved.__v, comments: saved.comments };
|
|
1860
|
+
},
|
|
1861
|
+
entity: (_result, args) => ({ entityType: "socialWorkspace", entityId: args.id })
|
|
1862
|
+
}),
|
|
1809
1863
|
defineTool({
|
|
1810
1864
|
name: "social_account_list",
|
|
1811
1865
|
toolset: "social-publisher",
|
|
@@ -1948,6 +2002,7 @@ var SOCIAL_PUBLISHER_TOOLS = [
|
|
|
1948
2002
|
facebook: facebookBlock,
|
|
1949
2003
|
instagram: instagramBlock,
|
|
1950
2004
|
comments: commentsField,
|
|
2005
|
+
allowPostDefaultComments: allowDefaultCommentsField,
|
|
1951
2006
|
scheduledAt: scheduledAtField,
|
|
1952
2007
|
...labelFields2
|
|
1953
2008
|
}),
|
|
@@ -2034,6 +2089,7 @@ var SOCIAL_PUBLISHER_TOOLS = [
|
|
|
2034
2089
|
reply_settings: zod.z.enum(TWITTER_REPLY_SETTINGS).optional()
|
|
2035
2090
|
}).optional().describe("X override."),
|
|
2036
2091
|
comments: commentsField,
|
|
2092
|
+
allowPostDefaultComments: allowDefaultCommentsField,
|
|
2037
2093
|
scheduledAt: scheduledAtField,
|
|
2038
2094
|
...labelFields2
|
|
2039
2095
|
}),
|
|
@@ -2113,19 +2169,23 @@ var SOCIAL_PUBLISHER_TOOLS = [
|
|
|
2113
2169
|
toolset: "social-publisher",
|
|
2114
2170
|
access: "full",
|
|
2115
2171
|
title: "Remove a post from the platforms",
|
|
2116
|
-
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.",
|
|
2117
|
-
input: zod.z.object({
|
|
2172
|
+
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.",
|
|
2173
|
+
input: zod.z.object({
|
|
2174
|
+
id: idField(POST_ID),
|
|
2175
|
+
version: versionField("the post"),
|
|
2176
|
+
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.")
|
|
2177
|
+
}),
|
|
2118
2178
|
annotations: { destructive: true, idempotent: true },
|
|
2119
2179
|
confirm: {
|
|
2120
|
-
describe: async ({ id }, { clients }) => {
|
|
2180
|
+
describe: async ({ id, platform }, { clients }) => {
|
|
2121
2181
|
const post = await clients.posts.getStatus(id);
|
|
2122
|
-
const platforms = postPlatforms(post);
|
|
2182
|
+
const platforms = platform ? [platform] : postPlatforms(post);
|
|
2123
2183
|
const where = platforms.length ? platforms.join(", ") : "the platforms it was published to";
|
|
2124
2184
|
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.`;
|
|
2125
2185
|
},
|
|
2126
2186
|
costFeaturePath: "socialMediaPublisher.removePost"
|
|
2127
2187
|
},
|
|
2128
|
-
run: ({ id, version }, { clients }) => clients.posts.removePost(id, version),
|
|
2188
|
+
run: ({ id, version, platform }, { clients }) => clients.posts.removePost(id, version, platform),
|
|
2129
2189
|
entity: (_result, args) => ({ entityType: "socialPost", entityId: args.id })
|
|
2130
2190
|
})
|
|
2131
2191
|
];
|