@posty5/mcp 2.1.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.
@@ -5,7 +5,7 @@ import { z } from 'zod';
5
5
  import { QrPrintPresets, QR_PRINT_DPI_VALUES, presetWidthMm, QR_PRINT_DPI_DEFAULT } from '@posty5/qr-design';
6
6
  import { randomUUID, createHash } from 'crypto';
7
7
  import { AuthenticationError, AuthorizationError, NotFoundError, RateLimitError, ConflictError, VersionRequiredError, ValidationError, NetworkError, ServerError, Posty5Error, Posty5BulkCreateError, LINK_BULK_TERMINAL_STATUSES, HttpClient } from '@posty5/core';
8
- import { MAX_COMMENT_LENGTH, MAX_COMMENT_DELAY_MINUTES, MAX_POST_COMMENTS, SocialPublisherPostClient } from '@posty5/social-publisher-post';
8
+ import { MAX_COMMENT_LENGTH, MAX_COMMENT_DELAY_MINUTES, MAX_POST_COMMENTS_TOTAL, MAX_POST_COMMENTS_PER_PLATFORM, SocialPublisherPostClient } from '@posty5/social-publisher-post';
9
9
  import { AccountClient } from '@posty5/account';
10
10
  import { HtmlHostingClient } from '@posty5/html-hosting';
11
11
  import { HtmlHostingFormSubmissionClient } from '@posty5/html-hosting-form-submission';
@@ -109,7 +109,7 @@ function selectTools(all, toolsets, access) {
109
109
  // src/config/instructions.config.ts
110
110
  var SERVER_NAME = "posty5";
111
111
  var SERVER_TITLE = "Posty5";
112
- var PACKAGE_VERSION = "2.0.0";
112
+ var PACKAGE_VERSION = "2.2.0";
113
113
  var SERVER_INSTRUCTIONS = [
114
114
  "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.",
115
115
  "Start with account_get_current to see which account and plan you are working with.",
@@ -1692,6 +1692,8 @@ var IMAGE_CAPTION_MAX_LENGTH = 8e3;
1692
1692
  var YOUTUBE_TITLE_MAX_LENGTH = 100;
1693
1693
  var THREADS_TEXT_MAX_LENGTH = 500;
1694
1694
  var TWITTER_TEXT_MAX_WEIGHTED_LENGTH = 280;
1695
+ var MAX_WORKSPACE_DEFAULT_COMMENTS = 10;
1696
+ var COMMENT_POST_TYPES = ["shortVideo", "longVideo", "image", "text"];
1695
1697
 
1696
1698
  // src/core/social-publisher.helper.ts
1697
1699
  function toScheduleConfig(scheduledAt) {
@@ -1715,6 +1717,7 @@ function videoPublishOptions(args) {
1715
1717
  facebook: args.facebook,
1716
1718
  instagram: args.instagram,
1717
1719
  comment: args.comment,
1720
+ allowPostDefaultComments: args.allowPostDefaultComments,
1718
1721
  schedule: args.scheduledAt ? new Date(args.scheduledAt) : void 0,
1719
1722
  tag: args.tag,
1720
1723
  refId: args.refId
@@ -1781,7 +1784,19 @@ var commentsField = z.array(
1781
1784
  imageUrl: z.string().url().optional().describe("A public image to attach \u2014 Facebook only."),
1782
1785
  ...commentFlags
1783
1786
  })
1784
- ).max(MAX_POST_COMMENTS).optional().describe(`Up to ${MAX_POST_COMMENTS} comments posted under the post once it is live, in order. Each is charged separately; see account_get_operation_costs.`);
1787
+ ).max(MAX_POST_COMMENTS_TOTAL).optional().describe(`Up to ${MAX_POST_COMMENTS_PER_PLATFORM} comments per platform (${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.`);
1788
+ var allowDefaultCommentsField = z.boolean().optional().describe(
1789
+ "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)."
1790
+ );
1791
+ var workspaceDefaultCommentField = z.object({
1792
+ _id: z.string().optional().describe("Send it back to edit this default; omit it to add one."),
1793
+ text: z.string().min(1).max(MAX_COMMENT_LENGTH),
1794
+ delayMinutes: z.number().int().min(0).max(MAX_COMMENT_DELAY_MINUTES).optional().describe("Minutes to wait after the post is live. Default 0."),
1795
+ imageUrl: z.string().url().optional().describe("A public image to attach \u2014 Facebook and Threads only."),
1796
+ isActive: z.boolean().optional().describe("An inactive default is kept but never added. Default true."),
1797
+ postTypes: z.array(z.enum(COMMENT_POST_TYPES)).optional().describe("The post types it is added to. Empty or absent: all of them."),
1798
+ ...commentFlags
1799
+ });
1785
1800
  var videoPostFields = {
1786
1801
  ...targetFields2,
1787
1802
  videoUrl: 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 +1806,7 @@ var videoPostFields = {
1791
1806
  facebook: facebookBlock,
1792
1807
  instagram: instagramBlock,
1793
1808
  comment: videoCommentField,
1809
+ allowPostDefaultComments: allowDefaultCommentsField,
1794
1810
  scheduledAt: scheduledAtField,
1795
1811
  ...labelFields2
1796
1812
  };
@@ -1829,6 +1845,42 @@ var SOCIAL_PUBLISHER_TOOLS = [
1829
1845
  input: z.object({ id: idField(WORKSPACE_ID) }),
1830
1846
  run: ({ id }, { clients }) => clients.workspaces.getForNewPost(id)
1831
1847
  }),
1848
+ defineTool({
1849
+ name: "social_workspace_get_default_comments",
1850
+ toolset: "social-publisher",
1851
+ access: "read",
1852
+ title: "Workspace default comments",
1853
+ 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.",
1854
+ input: z.object({ id: idField(WORKSPACE_ID) }),
1855
+ run: async ({ id }, { clients }) => ({ comments: await clients.workspaces.getDefaultComments(id) })
1856
+ }),
1857
+ defineTool({
1858
+ name: "social_workspace_resolve_default_comments",
1859
+ toolset: "social-publisher",
1860
+ access: "read",
1861
+ title: "Preview a new post's default comments",
1862
+ 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.",
1863
+ input: z.object({ id: idField(WORKSPACE_ID), postType: z.enum(COMMENT_POST_TYPES) }),
1864
+ run: ({ id, postType }, { clients }) => clients.workspaces.resolveDefaultComments(id, postType)
1865
+ }),
1866
+ defineTool({
1867
+ name: "social_workspace_set_default_comments",
1868
+ toolset: "social-publisher",
1869
+ access: "write",
1870
+ title: "Set workspace default comments",
1871
+ 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.`,
1872
+ input: z.object({
1873
+ id: idField(WORKSPACE_ID),
1874
+ version: versionField("the workspace"),
1875
+ comments: z.array(workspaceDefaultCommentField).max(MAX_WORKSPACE_DEFAULT_COMMENTS)
1876
+ }),
1877
+ annotations: { idempotent: true },
1878
+ run: async ({ id, version, comments }, { clients }) => {
1879
+ const saved = await clients.workspaces.setDefaultComments(id, comments, version);
1880
+ return { updated: true, id, __v: saved.__v, comments: saved.comments };
1881
+ },
1882
+ entity: (_result, args) => ({ entityType: "socialWorkspace", entityId: args.id })
1883
+ }),
1832
1884
  defineTool({
1833
1885
  name: "social_account_list",
1834
1886
  toolset: "social-publisher",
@@ -1971,6 +2023,7 @@ var SOCIAL_PUBLISHER_TOOLS = [
1971
2023
  facebook: facebookBlock,
1972
2024
  instagram: instagramBlock,
1973
2025
  comments: commentsField,
2026
+ allowPostDefaultComments: allowDefaultCommentsField,
1974
2027
  scheduledAt: scheduledAtField,
1975
2028
  ...labelFields2
1976
2029
  }),
@@ -2057,6 +2110,7 @@ var SOCIAL_PUBLISHER_TOOLS = [
2057
2110
  reply_settings: z.enum(TWITTER_REPLY_SETTINGS).optional()
2058
2111
  }).optional().describe("X override."),
2059
2112
  comments: commentsField,
2113
+ allowPostDefaultComments: allowDefaultCommentsField,
2060
2114
  scheduledAt: scheduledAtField,
2061
2115
  ...labelFields2
2062
2116
  }),