posterly-mcp-server 0.8.2 → 0.19.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 +38 -3
- package/dist/generated/platform-manifest.d.ts +392 -0
- package/dist/generated/platform-manifest.js +695 -0
- package/dist/index.js +331 -1
- package/dist/lib/api-client.d.ts +391 -24
- package/dist/lib/api-client.js +176 -0
- package/dist/tools/audit-google-business-profile.d.ts +24 -0
- package/dist/tools/audit-google-business-profile.js +27 -0
- package/dist/tools/create-oauth-client.d.ts +40 -0
- package/dist/tools/create-oauth-client.js +20 -0
- package/dist/tools/create-post.d.ts +399 -20
- package/dist/tools/create-post.js +81 -78
- package/dist/tools/create-posts-batch.d.ts +567 -0
- package/dist/tools/create-posts-batch.js +38 -0
- package/dist/tools/create-signed-upload.d.ts +24 -0
- package/dist/tools/create-signed-upload.js +20 -0
- package/dist/tools/create-webhook.d.ts +36 -0
- package/dist/tools/create-webhook.js +20 -0
- package/dist/tools/delete-google-business-review-reply.d.ts +32 -0
- package/dist/tools/delete-google-business-review-reply.js +17 -0
- package/dist/tools/delete-oauth-client.d.ts +20 -0
- package/dist/tools/delete-oauth-client.js +13 -0
- package/dist/tools/delete-post-group.d.ts +20 -0
- package/dist/tools/delete-post-group.js +13 -0
- package/dist/tools/delete-webhook.d.ts +20 -0
- package/dist/tools/delete-webhook.js +13 -0
- package/dist/tools/disconnect-account.d.ts +20 -0
- package/dist/tools/disconnect-account.js +22 -0
- package/dist/tools/generate-image.d.ts +4 -4
- package/dist/tools/generate-video.d.ts +59 -0
- package/dist/tools/generate-video.js +34 -0
- package/dist/tools/get-connect-link.d.ts +24 -0
- package/dist/tools/get-connect-link.js +46 -0
- package/dist/tools/get-google-business-review-link.d.ts +24 -0
- package/dist/tools/get-google-business-review-link.js +19 -0
- package/dist/tools/get-platform-schema.d.ts +24 -0
- package/dist/tools/get-platform-schema.js +44 -0
- package/dist/tools/get-post-missing.d.ts +16 -0
- package/dist/tools/get-post-missing.js +12 -0
- package/dist/tools/get-video-job.d.ts +24 -0
- package/dist/tools/get-video-job.js +31 -0
- package/dist/tools/get-video-options.d.ts +8 -0
- package/dist/tools/get-video-options.js +26 -0
- package/dist/tools/get-x-posting-quota.d.ts +16 -0
- package/dist/tools/get-x-posting-quota.js +21 -0
- package/dist/tools/list-activity.d.ts +32 -0
- package/dist/tools/list-activity.js +35 -0
- package/dist/tools/list-google-business-reviews.d.ts +32 -0
- package/dist/tools/list-google-business-reviews.js +28 -0
- package/dist/tools/list-oauth-clients.d.ts +8 -0
- package/dist/tools/list-oauth-clients.js +15 -0
- package/dist/tools/list-platforms.d.ts +16 -0
- package/dist/tools/list-platforms.js +20 -0
- package/dist/tools/list-posts.d.ts +3 -3
- package/dist/tools/list-posts.js +3 -2
- package/dist/tools/list-webhooks.d.ts +16 -0
- package/dist/tools/list-webhooks.js +24 -0
- package/dist/tools/reply-google-business-review.d.ts +36 -0
- package/dist/tools/reply-google-business-review.js +18 -0
- package/dist/tools/run-video-function.d.ts +24 -0
- package/dist/tools/run-video-function.js +25 -0
- package/dist/tools/suggest-google-business-review-reply.d.ts +48 -0
- package/dist/tools/suggest-google-business-review-reply.js +27 -0
- package/dist/tools/test-webhook.d.ts +20 -0
- package/dist/tools/test-webhook.js +14 -0
- package/dist/tools/trigger-platform-helper.d.ts +28 -0
- package/dist/tools/trigger-platform-helper.js +22 -0
- package/dist/tools/update-oauth-client.d.ts +44 -0
- package/dist/tools/update-oauth-client.js +21 -0
- package/dist/tools/update-post-release-id.d.ts +28 -0
- package/dist/tools/update-post-release-id.js +18 -0
- package/dist/tools/update-post-status.d.ts +28 -0
- package/dist/tools/update-post-status.js +23 -0
- package/dist/tools/update-post.js +1 -1
- package/dist/tools/update-webhook.d.ts +40 -0
- package/dist/tools/update-webhook.js +21 -0
- package/dist/tools/upload-media-from-url.d.ts +24 -0
- package/dist/tools/upload-media-from-url.js +26 -0
- package/dist/tools/webhook-events.d.ts +3 -0
- package/dist/tools/webhook-events.js +13 -0
- package/package.json +1 -1
- package/src/generated/platform-manifest.ts +695 -0
- package/src/index.ts +496 -1
- package/src/lib/api-client.ts +497 -19
- package/src/tools/audit-google-business-profile.ts +38 -0
- package/src/tools/create-oauth-client.ts +36 -0
- package/src/tools/create-post.ts +91 -94
- package/src/tools/create-posts-batch.ts +48 -0
- package/src/tools/create-signed-upload.ts +27 -0
- package/src/tools/create-webhook.ts +35 -0
- package/src/tools/delete-google-business-review-reply.ts +30 -0
- package/src/tools/delete-oauth-client.ts +23 -0
- package/src/tools/delete-post-group.ts +17 -0
- package/src/tools/delete-webhook.ts +18 -0
- package/src/tools/disconnect-account.ts +30 -0
- package/src/tools/generate-video.ts +38 -0
- package/src/tools/get-connect-link.ts +56 -0
- package/src/tools/get-google-business-review-link.ts +30 -0
- package/src/tools/get-platform-schema.ts +52 -0
- package/src/tools/get-post-missing.ts +17 -0
- package/src/tools/get-video-job.ts +36 -0
- package/src/tools/get-video-options.ts +30 -0
- package/src/tools/get-x-posting-quota.ts +25 -0
- package/src/tools/list-activity.ts +51 -0
- package/src/tools/list-google-business-reviews.ts +43 -0
- package/src/tools/list-oauth-clients.ts +18 -0
- package/src/tools/list-platforms.ts +25 -0
- package/src/tools/list-posts.ts +3 -2
- package/src/tools/list-webhooks.ts +30 -0
- package/src/tools/reply-google-business-review.ts +32 -0
- package/src/tools/run-video-function.ts +32 -0
- package/src/tools/suggest-google-business-review-reply.ts +44 -0
- package/src/tools/test-webhook.ts +18 -0
- package/src/tools/trigger-platform-helper.ts +34 -0
- package/src/tools/update-oauth-client.ts +38 -0
- package/src/tools/update-post-release-id.ts +26 -0
- package/src/tools/update-post-status.ts +31 -0
- package/src/tools/update-post.ts +1 -1
- package/src/tools/update-webhook.ts +37 -0
- package/src/tools/upload-media-from-url.ts +33 -0
- package/src/tools/webhook-events.ts +16 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { PosterlyClient } from '../lib/api-client.js';
|
|
3
|
+
export declare const createWebhookTool: {
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
inputSchema: z.ZodObject<{
|
|
7
|
+
url: z.ZodString;
|
|
8
|
+
events: z.ZodOptional<z.ZodArray<z.ZodEnum<["webhook.test", "post.created", "post.updated", "post.deleted", "post.publishing", "post.published", "post.failed", "account.disconnected", "analytics.synced"]>, "many">>;
|
|
9
|
+
workspace_id: z.ZodOptional<z.ZodString>;
|
|
10
|
+
description: z.ZodOptional<z.ZodString>;
|
|
11
|
+
is_active: z.ZodOptional<z.ZodBoolean>;
|
|
12
|
+
confirm: z.ZodLiteral<true>;
|
|
13
|
+
}, "strip", z.ZodTypeAny, {
|
|
14
|
+
url: string;
|
|
15
|
+
confirm: true;
|
|
16
|
+
workspace_id?: string | undefined;
|
|
17
|
+
events?: ("webhook.test" | "post.created" | "post.updated" | "post.deleted" | "post.publishing" | "post.published" | "post.failed" | "account.disconnected" | "analytics.synced")[] | undefined;
|
|
18
|
+
description?: string | undefined;
|
|
19
|
+
is_active?: boolean | undefined;
|
|
20
|
+
}, {
|
|
21
|
+
url: string;
|
|
22
|
+
confirm: true;
|
|
23
|
+
workspace_id?: string | undefined;
|
|
24
|
+
events?: ("webhook.test" | "post.created" | "post.updated" | "post.deleted" | "post.publishing" | "post.published" | "post.failed" | "account.disconnected" | "analytics.synced")[] | undefined;
|
|
25
|
+
description?: string | undefined;
|
|
26
|
+
is_active?: boolean | undefined;
|
|
27
|
+
}>;
|
|
28
|
+
execute(client: PosterlyClient, input: {
|
|
29
|
+
url: string;
|
|
30
|
+
events?: string[];
|
|
31
|
+
workspace_id?: string;
|
|
32
|
+
description?: string;
|
|
33
|
+
is_active?: boolean;
|
|
34
|
+
confirm: true;
|
|
35
|
+
}): Promise<string>;
|
|
36
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { webhookEventSchema } from './webhook-events.js';
|
|
3
|
+
export const createWebhookTool = {
|
|
4
|
+
name: 'create_webhook',
|
|
5
|
+
description: 'Create a webhook subscription for post/account/analytics events. WRITE WITH OUTBOUND SIDE EFFECTS: show the user the target URL, workspace, events, and active state, then get explicit confirmation before calling. The response includes the signing secret once.',
|
|
6
|
+
inputSchema: z.object({
|
|
7
|
+
url: z.string().url().describe('HTTPS webhook endpoint URL. Localhost HTTP is allowed by the API for development.'),
|
|
8
|
+
events: z.array(webhookEventSchema).optional().describe('Events to deliver. Defaults to core post lifecycle events.'),
|
|
9
|
+
workspace_id: z.string().optional().describe('Optional workspace filter. Omit for all workspaces owned by the API key user.'),
|
|
10
|
+
description: z.string().max(240).optional(),
|
|
11
|
+
is_active: z.boolean().optional().describe('Defaults to true.'),
|
|
12
|
+
confirm: z.literal(true).describe('Must be true after the user explicitly confirms webhook creation.'),
|
|
13
|
+
}),
|
|
14
|
+
async execute(client, input) {
|
|
15
|
+
const { confirm: _confirm, ...payload } = input;
|
|
16
|
+
const result = await client.createWebhook(payload);
|
|
17
|
+
const secret = result.secret ? `\nSigning secret: ${result.secret}` : '';
|
|
18
|
+
return `Webhook created: ${result.webhook.id}\nURL: ${result.webhook.url}\nEvents: ${result.webhook.events.join(', ')}${secret}`;
|
|
19
|
+
},
|
|
20
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { PosterlyClient } from '../lib/api-client.js';
|
|
3
|
+
export declare const deleteGoogleBusinessReviewReplyTool: {
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
inputSchema: z.ZodObject<{
|
|
7
|
+
workspace_id: z.ZodOptional<z.ZodString>;
|
|
8
|
+
account_id: z.ZodOptional<z.ZodNumber>;
|
|
9
|
+
location_id: z.ZodOptional<z.ZodString>;
|
|
10
|
+
review_name: z.ZodString;
|
|
11
|
+
confirm: z.ZodLiteral<true>;
|
|
12
|
+
}, "strip", z.ZodTypeAny, {
|
|
13
|
+
confirm: true;
|
|
14
|
+
review_name: string;
|
|
15
|
+
workspace_id?: string | undefined;
|
|
16
|
+
account_id?: number | undefined;
|
|
17
|
+
location_id?: string | undefined;
|
|
18
|
+
}, {
|
|
19
|
+
confirm: true;
|
|
20
|
+
review_name: string;
|
|
21
|
+
workspace_id?: string | undefined;
|
|
22
|
+
account_id?: number | undefined;
|
|
23
|
+
location_id?: string | undefined;
|
|
24
|
+
}>;
|
|
25
|
+
execute(client: PosterlyClient, input: {
|
|
26
|
+
workspace_id?: string;
|
|
27
|
+
account_id?: number;
|
|
28
|
+
location_id?: string;
|
|
29
|
+
review_name: string;
|
|
30
|
+
confirm: true;
|
|
31
|
+
}): Promise<any>;
|
|
32
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const deleteGoogleBusinessReviewReplyTool = {
|
|
3
|
+
name: 'delete_google_business_review_reply',
|
|
4
|
+
description: 'Delete the owner reply from a Google Business Profile review. DESTRUCTIVE: confirm the review and location with the user, then pass confirm=true only after explicit confirmation.',
|
|
5
|
+
inputSchema: z.object({
|
|
6
|
+
workspace_id: z.string().optional().describe('Filter to a workspace ID from whoami.'),
|
|
7
|
+
account_id: z.number().int().positive().optional().describe('Google Business account ID from list_accounts.'),
|
|
8
|
+
location_id: z.string().optional().describe('Google Business location/platform_user_id.'),
|
|
9
|
+
review_name: z.string().min(1).describe('Full Google review resource name.'),
|
|
10
|
+
confirm: z.literal(true).describe('Must be true after explicit user confirmation.'),
|
|
11
|
+
}),
|
|
12
|
+
async execute(client, input) {
|
|
13
|
+
const { confirm: _confirm, ...payload } = input;
|
|
14
|
+
const result = await client.deleteGoogleBusinessReviewReply(payload);
|
|
15
|
+
return result.message || 'Google Business review reply deleted successfully.';
|
|
16
|
+
},
|
|
17
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { PosterlyClient } from '../lib/api-client.js';
|
|
3
|
+
export declare const deleteOAuthClientTool: {
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
inputSchema: z.ZodObject<{
|
|
7
|
+
client_id: z.ZodString;
|
|
8
|
+
confirm: z.ZodLiteral<true>;
|
|
9
|
+
}, "strip", z.ZodTypeAny, {
|
|
10
|
+
confirm: true;
|
|
11
|
+
client_id: string;
|
|
12
|
+
}, {
|
|
13
|
+
confirm: true;
|
|
14
|
+
client_id: string;
|
|
15
|
+
}>;
|
|
16
|
+
execute(client: PosterlyClient, input: {
|
|
17
|
+
client_id: string;
|
|
18
|
+
confirm: true;
|
|
19
|
+
}): Promise<string>;
|
|
20
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const deleteOAuthClientTool = {
|
|
3
|
+
name: 'delete_oauth_client',
|
|
4
|
+
description: 'Delete a self-serve OAuth developer client. DESTRUCTIVE: prevents new authorizations for that client_id; existing access tokens remain revocable as API keys.',
|
|
5
|
+
inputSchema: z.object({
|
|
6
|
+
client_id: z.string().min(1),
|
|
7
|
+
confirm: z.literal(true).describe('Must be true after explicit user confirmation.'),
|
|
8
|
+
}),
|
|
9
|
+
async execute(client, input) {
|
|
10
|
+
const result = await client.deleteOAuthClient(input.client_id);
|
|
11
|
+
return `OAuth client deleted: ${result.client_id}`;
|
|
12
|
+
},
|
|
13
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { PosterlyClient } from '../lib/api-client.js';
|
|
3
|
+
export declare const deletePostGroupTool: {
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
inputSchema: z.ZodObject<{
|
|
7
|
+
group_id: z.ZodString;
|
|
8
|
+
confirm: z.ZodLiteral<true>;
|
|
9
|
+
}, "strip", z.ZodTypeAny, {
|
|
10
|
+
confirm: true;
|
|
11
|
+
group_id: string;
|
|
12
|
+
}, {
|
|
13
|
+
confirm: true;
|
|
14
|
+
group_id: string;
|
|
15
|
+
}>;
|
|
16
|
+
execute(client: PosterlyClient, input: {
|
|
17
|
+
group_id: string;
|
|
18
|
+
confirm: true;
|
|
19
|
+
}): Promise<string>;
|
|
20
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const deletePostGroupTool = {
|
|
3
|
+
name: 'delete_post_group',
|
|
4
|
+
description: 'Delete every draft/scheduled/failed/paused post matching a caller-defined group_id, post_group_id, api_group_id, or release_id. DESTRUCTIVE: inspect the group first, list the affected posts, and pass confirm=true only after explicit confirmation.',
|
|
5
|
+
inputSchema: z.object({
|
|
6
|
+
group_id: z.string().min(1).max(160).describe('Group/release ID to delete.'),
|
|
7
|
+
confirm: z.literal(true).describe('Must be true after explicit user confirmation.'),
|
|
8
|
+
}),
|
|
9
|
+
async execute(client, input) {
|
|
10
|
+
const result = await client.deletePostGroup(input.group_id);
|
|
11
|
+
return JSON.stringify(result, null, 2);
|
|
12
|
+
},
|
|
13
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { PosterlyClient } from '../lib/api-client.js';
|
|
3
|
+
export declare const deleteWebhookTool: {
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
inputSchema: z.ZodObject<{
|
|
7
|
+
webhook_id: z.ZodString;
|
|
8
|
+
confirm: z.ZodLiteral<true>;
|
|
9
|
+
}, "strip", z.ZodTypeAny, {
|
|
10
|
+
confirm: true;
|
|
11
|
+
webhook_id: string;
|
|
12
|
+
}, {
|
|
13
|
+
confirm: true;
|
|
14
|
+
webhook_id: string;
|
|
15
|
+
}>;
|
|
16
|
+
execute(client: PosterlyClient, input: {
|
|
17
|
+
webhook_id: string;
|
|
18
|
+
confirm: true;
|
|
19
|
+
}): Promise<string>;
|
|
20
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const deleteWebhookTool = {
|
|
3
|
+
name: 'delete_webhook',
|
|
4
|
+
description: 'Delete a webhook subscription. DESTRUCTIVE: list the webhook first, show the user its URL/events/workspace, and get explicit confirmation before calling.',
|
|
5
|
+
inputSchema: z.object({
|
|
6
|
+
webhook_id: z.string().describe('Webhook ID from list_webhooks.'),
|
|
7
|
+
confirm: z.literal(true).describe('Must be true after the user explicitly confirms webhook deletion.'),
|
|
8
|
+
}),
|
|
9
|
+
async execute(client, input) {
|
|
10
|
+
const result = await client.deleteWebhook(input.webhook_id);
|
|
11
|
+
return `Webhook deleted: ${result.id}`;
|
|
12
|
+
},
|
|
13
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { PosterlyClient } from '../lib/api-client.js';
|
|
3
|
+
export declare const disconnectAccountTool: {
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
inputSchema: z.ZodObject<{
|
|
7
|
+
account_id: z.ZodString;
|
|
8
|
+
confirm: z.ZodBoolean;
|
|
9
|
+
}, "strip", z.ZodTypeAny, {
|
|
10
|
+
account_id: string;
|
|
11
|
+
confirm: boolean;
|
|
12
|
+
}, {
|
|
13
|
+
account_id: string;
|
|
14
|
+
confirm: boolean;
|
|
15
|
+
}>;
|
|
16
|
+
execute(client: PosterlyClient, input: {
|
|
17
|
+
account_id: string;
|
|
18
|
+
confirm: boolean;
|
|
19
|
+
}): Promise<string>;
|
|
20
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const disconnectAccountTool = {
|
|
3
|
+
name: 'disconnect_account',
|
|
4
|
+
description: 'Disconnect a connected social account from posterly. DESTRUCTIVE and IRREVERSIBLE: removes the account connection, emits account.disconnected webhooks, and may transfer Instagram scheduled posts to a replacement account.\n\n' +
|
|
5
|
+
'REQUIRED BEFORE CALLING: Call `list_accounts` first, show the user the exact platform, username, account ID, and workspace that will be disconnected, then get explicit confirmation. Pass confirm=true only after that confirmation.',
|
|
6
|
+
inputSchema: z.object({
|
|
7
|
+
account_id: z.string().describe('Connected social account ID from list_accounts.'),
|
|
8
|
+
confirm: z.boolean().describe('Must be true after explicit user confirmation.'),
|
|
9
|
+
}),
|
|
10
|
+
async execute(client, input) {
|
|
11
|
+
if (input.confirm !== true) {
|
|
12
|
+
throw new Error('Refusing to disconnect account without confirm=true after explicit user confirmation.');
|
|
13
|
+
}
|
|
14
|
+
const result = await client.disconnectAccount(input.account_id);
|
|
15
|
+
const account = result.account || {};
|
|
16
|
+
return [
|
|
17
|
+
`Disconnected ${account.platform || 'account'}${account.username ? ` @${account.username}` : ''} (ID: ${account.id || input.account_id}).`,
|
|
18
|
+
`Transferred posts: ${result.transferred_post_count ?? 0}.`,
|
|
19
|
+
`Stamped posts: ${result.stamped_post_count ?? 0}.`,
|
|
20
|
+
].join('\n');
|
|
21
|
+
},
|
|
22
|
+
};
|
|
@@ -12,15 +12,15 @@ export declare const generateImageTool: {
|
|
|
12
12
|
resolution: z.ZodOptional<z.ZodEnum<["512", "1K", "2K", "4K"]>>;
|
|
13
13
|
}, "strip", z.ZodTypeAny, {
|
|
14
14
|
prompt: string;
|
|
15
|
-
aspect_ratio?: "
|
|
16
|
-
style?: "
|
|
15
|
+
aspect_ratio?: "16:9" | "9:16" | "1:1" | "4:5" | "3:4" | "2:3" | "1:4" | "1:8" | "21:9" | "4:3" | "3:2" | "4:1" | "8:1" | "5:4" | undefined;
|
|
16
|
+
style?: "professional" | "photographic" | "illustration" | "minimal" | "vibrant" | "youtube_thumbnail" | "reel_cover" | "review_background" | undefined;
|
|
17
17
|
variations?: number | undefined;
|
|
18
18
|
model?: "flash" | "pro" | undefined;
|
|
19
19
|
resolution?: "512" | "1K" | "2K" | "4K" | undefined;
|
|
20
20
|
}, {
|
|
21
21
|
prompt: string;
|
|
22
|
-
aspect_ratio?: "
|
|
23
|
-
style?: "
|
|
22
|
+
aspect_ratio?: "16:9" | "9:16" | "1:1" | "4:5" | "3:4" | "2:3" | "1:4" | "1:8" | "21:9" | "4:3" | "3:2" | "4:1" | "8:1" | "5:4" | undefined;
|
|
23
|
+
style?: "professional" | "photographic" | "illustration" | "minimal" | "vibrant" | "youtube_thumbnail" | "reel_cover" | "review_background" | undefined;
|
|
24
24
|
variations?: number | undefined;
|
|
25
25
|
model?: "flash" | "pro" | undefined;
|
|
26
26
|
resolution?: "512" | "1K" | "2K" | "4K" | undefined;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { PosterlyClient } from '../lib/api-client.js';
|
|
3
|
+
export declare const generateVideoTool: {
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
inputSchema: z.ZodObject<{
|
|
7
|
+
prompt: z.ZodString;
|
|
8
|
+
negative_prompt: z.ZodOptional<z.ZodString>;
|
|
9
|
+
aspect_ratio: z.ZodOptional<z.ZodDefault<z.ZodEnum<["16:9", "9:16"]>>>;
|
|
10
|
+
duration_seconds: z.ZodOptional<z.ZodDefault<z.ZodUnion<[z.ZodLiteral<4>, z.ZodLiteral<6>, z.ZodLiteral<8>]>>>;
|
|
11
|
+
resolution: z.ZodOptional<z.ZodDefault<z.ZodEnum<["720p", "1080p"]>>>;
|
|
12
|
+
model: z.ZodOptional<z.ZodDefault<z.ZodEnum<["fast", "standard"]>>>;
|
|
13
|
+
image_url: z.ZodOptional<z.ZodString>;
|
|
14
|
+
end_image_url: z.ZodOptional<z.ZodString>;
|
|
15
|
+
reference_images: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
16
|
+
url: z.ZodString;
|
|
17
|
+
type: z.ZodEnum<["character", "object", "scene"]>;
|
|
18
|
+
}, "strip", z.ZodTypeAny, {
|
|
19
|
+
type: "object" | "character" | "scene";
|
|
20
|
+
url: string;
|
|
21
|
+
}, {
|
|
22
|
+
type: "object" | "character" | "scene";
|
|
23
|
+
url: string;
|
|
24
|
+
}>, "many">>;
|
|
25
|
+
generate_audio: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
26
|
+
source_video_url: z.ZodOptional<z.ZodString>;
|
|
27
|
+
}, "strip", z.ZodTypeAny, {
|
|
28
|
+
prompt: string;
|
|
29
|
+
aspect_ratio?: "16:9" | "9:16" | undefined;
|
|
30
|
+
model?: "fast" | "standard" | undefined;
|
|
31
|
+
resolution?: "720p" | "1080p" | undefined;
|
|
32
|
+
negative_prompt?: string | undefined;
|
|
33
|
+
duration_seconds?: 4 | 6 | 8 | undefined;
|
|
34
|
+
image_url?: string | undefined;
|
|
35
|
+
end_image_url?: string | undefined;
|
|
36
|
+
reference_images?: {
|
|
37
|
+
type: "object" | "character" | "scene";
|
|
38
|
+
url: string;
|
|
39
|
+
}[] | undefined;
|
|
40
|
+
generate_audio?: boolean | undefined;
|
|
41
|
+
source_video_url?: string | undefined;
|
|
42
|
+
}, {
|
|
43
|
+
prompt: string;
|
|
44
|
+
aspect_ratio?: "16:9" | "9:16" | undefined;
|
|
45
|
+
model?: "fast" | "standard" | undefined;
|
|
46
|
+
resolution?: "720p" | "1080p" | undefined;
|
|
47
|
+
negative_prompt?: string | undefined;
|
|
48
|
+
duration_seconds?: 4 | 6 | 8 | undefined;
|
|
49
|
+
image_url?: string | undefined;
|
|
50
|
+
end_image_url?: string | undefined;
|
|
51
|
+
reference_images?: {
|
|
52
|
+
type: "object" | "character" | "scene";
|
|
53
|
+
url: string;
|
|
54
|
+
}[] | undefined;
|
|
55
|
+
generate_audio?: boolean | undefined;
|
|
56
|
+
source_video_url?: string | undefined;
|
|
57
|
+
}>;
|
|
58
|
+
execute(client: PosterlyClient, input: any): Promise<string>;
|
|
59
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const generateVideoTool = {
|
|
3
|
+
name: 'generate_video',
|
|
4
|
+
description: 'Queue a Veo AI video generation job. COSTS VEO CREDITS: confirm prompt, model, duration, resolution, aspect ratio, audio choice, and credit cost with the user before calling. Poll get_video_job for status and final video_url.',
|
|
5
|
+
inputSchema: z.object({
|
|
6
|
+
prompt: z.string().min(5).max(1024),
|
|
7
|
+
negative_prompt: z.string().max(500).optional(),
|
|
8
|
+
aspect_ratio: z.enum(['16:9', '9:16']).default('16:9').optional(),
|
|
9
|
+
duration_seconds: z.union([z.literal(4), z.literal(6), z.literal(8)]).default(8).optional(),
|
|
10
|
+
resolution: z.enum(['720p', '1080p']).default('720p').optional(),
|
|
11
|
+
model: z.enum(['fast', 'standard']).default('fast').optional(),
|
|
12
|
+
image_url: z.string().url().optional(),
|
|
13
|
+
end_image_url: z.string().url().optional(),
|
|
14
|
+
reference_images: z.array(z.object({
|
|
15
|
+
url: z.string().url(),
|
|
16
|
+
type: z.enum(['character', 'object', 'scene']),
|
|
17
|
+
})).max(3).optional(),
|
|
18
|
+
generate_audio: z.boolean().default(true).optional(),
|
|
19
|
+
source_video_url: z.string().url().optional(),
|
|
20
|
+
}),
|
|
21
|
+
async execute(client, input) {
|
|
22
|
+
const result = await client.generateVideo(input);
|
|
23
|
+
return [
|
|
24
|
+
'Video generation job queued',
|
|
25
|
+
`Job ID: ${result.job_id}`,
|
|
26
|
+
`Status: ${result.status}`,
|
|
27
|
+
`Credit cost: ${result.credit_cost} (${result.included_credit_cost || 0} included, ${result.purchased_credit_cost || 0} purchased)`,
|
|
28
|
+
result.message,
|
|
29
|
+
'',
|
|
30
|
+
'Raw response:',
|
|
31
|
+
JSON.stringify(result, null, 2),
|
|
32
|
+
].filter(Boolean).join('\n');
|
|
33
|
+
},
|
|
34
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { PosterlyClient } from '../lib/api-client.js';
|
|
3
|
+
export declare const getConnectLinkTool: {
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
inputSchema: z.ZodObject<{
|
|
7
|
+
platform: z.ZodOptional<z.ZodEnum<["bluesky", "devto", "discord", "facebook", "facebook_instagram", "facebook_pages", "gmb", "google-business", "google_business", "google_business_profile", "hashnode", "instagram", "instagram-standalone", "instagram_direct", "linkedin", "linkedin-company", "linkedin-page", "linkedin_company", "linkedin_page", "linkedin_personal", "mastodon", "medium", "meta", "meta_business", "pinterest", "reddit", "skool", "slack", "telegram", "threads", "tiktok", "twitter", "whop", "wordpress", "x", "x_twitter", "youtube"]>>;
|
|
8
|
+
workspace_id: z.ZodOptional<z.ZodString>;
|
|
9
|
+
include_planned: z.ZodOptional<z.ZodBoolean>;
|
|
10
|
+
}, "strip", z.ZodTypeAny, {
|
|
11
|
+
workspace_id?: string | undefined;
|
|
12
|
+
include_planned?: boolean | undefined;
|
|
13
|
+
platform?: "instagram" | "instagram-standalone" | "facebook" | "tiktok" | "twitter" | "linkedin" | "youtube" | "pinterest" | "threads" | "google_business" | "telegram" | "bluesky" | "reddit" | "wordpress" | "mastodon" | "medium" | "devto" | "hashnode" | "discord" | "slack" | "skool" | "whop" | "gmb" | "google-business" | "google_business_profile" | "x" | "meta" | "linkedin_page" | "facebook_instagram" | "facebook_pages" | "instagram_direct" | "linkedin-company" | "linkedin-page" | "linkedin_company" | "linkedin_personal" | "meta_business" | "x_twitter" | undefined;
|
|
14
|
+
}, {
|
|
15
|
+
workspace_id?: string | undefined;
|
|
16
|
+
include_planned?: boolean | undefined;
|
|
17
|
+
platform?: "instagram" | "instagram-standalone" | "facebook" | "tiktok" | "twitter" | "linkedin" | "youtube" | "pinterest" | "threads" | "google_business" | "telegram" | "bluesky" | "reddit" | "wordpress" | "mastodon" | "medium" | "devto" | "hashnode" | "discord" | "slack" | "skool" | "whop" | "gmb" | "google-business" | "google_business_profile" | "x" | "meta" | "linkedin_page" | "facebook_instagram" | "facebook_pages" | "instagram_direct" | "linkedin-company" | "linkedin-page" | "linkedin_company" | "linkedin_personal" | "meta_business" | "x_twitter" | undefined;
|
|
18
|
+
}>;
|
|
19
|
+
execute(client: PosterlyClient, input: {
|
|
20
|
+
platform?: string;
|
|
21
|
+
workspace_id?: string;
|
|
22
|
+
include_planned?: boolean;
|
|
23
|
+
}): Promise<string>;
|
|
24
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { CONNECT_INPUTS, PLANNED_PLATFORM_IDS } from '../generated/platform-manifest.js';
|
|
3
|
+
export const getConnectLinkTool = {
|
|
4
|
+
name: 'get_connect_link',
|
|
5
|
+
description: 'List dashboard handoff links/readiness for connecting social accounts, or get one platform connection URL. Use connection_url in a logged-in browser. Direct OAuth URLs are intentionally not exposed because provider callbacks rely on browser state.',
|
|
6
|
+
inputSchema: z.object({
|
|
7
|
+
platform: z
|
|
8
|
+
.enum(CONNECT_INPUTS)
|
|
9
|
+
.optional()
|
|
10
|
+
.describe('Connection target such as instagram, meta, linkedin_page, twitter, x, google_business, telegram, reddit, or wordpress. Omit to list live connection targets.'),
|
|
11
|
+
workspace_id: z
|
|
12
|
+
.string()
|
|
13
|
+
.optional()
|
|
14
|
+
.describe('Filter connected account counts to a workspace.'),
|
|
15
|
+
include_planned: z
|
|
16
|
+
.boolean()
|
|
17
|
+
.optional()
|
|
18
|
+
.describe(`Include planned provider expansion targets from the Postiz parity audit: ${PLANNED_PLATFORM_IDS.join(', ')}.`),
|
|
19
|
+
}),
|
|
20
|
+
async execute(client, input) {
|
|
21
|
+
const result = await client.getConnectLink(input);
|
|
22
|
+
if (result.connect) {
|
|
23
|
+
return formatConnectOption(result.connect, true);
|
|
24
|
+
}
|
|
25
|
+
const options = result.connect_options || [];
|
|
26
|
+
const lines = options.map((option) => formatConnectOption(option, false));
|
|
27
|
+
return `Posterly connection options (${options.length}):\n${lines.join('\n\n')}`;
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
function formatConnectOption(option, includeRaw) {
|
|
31
|
+
const missing = option.missing_env?.length
|
|
32
|
+
? `missing env: ${option.missing_env.map((group) => group.join(' or ')).join(', ')}`
|
|
33
|
+
: 'configured';
|
|
34
|
+
const accounts = option.connected_count ?? option.connected_accounts?.length ?? 0;
|
|
35
|
+
const fields = option.credential_fields?.length
|
|
36
|
+
? `; credential fields: ${option.credential_fields.map((field) => field.key).join(', ')}`
|
|
37
|
+
: '';
|
|
38
|
+
const scopes = option.scopes?.length ? `; scopes: ${option.scopes.join(', ')}` : '';
|
|
39
|
+
const raw = includeRaw ? `\n\nRaw connect option:\n${JSON.stringify(option, null, 2)}` : '';
|
|
40
|
+
return [
|
|
41
|
+
`${option.label} (${option.platform})`,
|
|
42
|
+
`Status: ${option.status}; method: ${option.method}; ${missing}; connected accounts: ${accounts}`,
|
|
43
|
+
`Connection URL: ${option.connection_url || 'not available'}${fields}${scopes}`,
|
|
44
|
+
raw,
|
|
45
|
+
].join('\n');
|
|
46
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { PosterlyClient } from '../lib/api-client.js';
|
|
3
|
+
export declare const getGoogleBusinessReviewLinkTool: {
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
inputSchema: z.ZodObject<{
|
|
7
|
+
workspace_id: z.ZodOptional<z.ZodString>;
|
|
8
|
+
account_id: z.ZodOptional<z.ZodNumber>;
|
|
9
|
+
location_id: z.ZodOptional<z.ZodString>;
|
|
10
|
+
}, "strip", z.ZodTypeAny, {
|
|
11
|
+
workspace_id?: string | undefined;
|
|
12
|
+
account_id?: number | undefined;
|
|
13
|
+
location_id?: string | undefined;
|
|
14
|
+
}, {
|
|
15
|
+
workspace_id?: string | undefined;
|
|
16
|
+
account_id?: number | undefined;
|
|
17
|
+
location_id?: string | undefined;
|
|
18
|
+
}>;
|
|
19
|
+
execute(client: PosterlyClient, input: {
|
|
20
|
+
workspace_id?: string;
|
|
21
|
+
account_id?: number;
|
|
22
|
+
location_id?: string;
|
|
23
|
+
}): Promise<string>;
|
|
24
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const getGoogleBusinessReviewLinkTool = {
|
|
3
|
+
name: 'get_google_business_review_link',
|
|
4
|
+
description: 'Get the direct public Google review link for a connected Google Business Profile location. Requires account_id or location_id.',
|
|
5
|
+
inputSchema: z.object({
|
|
6
|
+
workspace_id: z.string().optional().describe('Filter to a workspace ID from whoami.'),
|
|
7
|
+
account_id: z.number().int().positive().optional().describe('Google Business account ID from list_accounts.'),
|
|
8
|
+
location_id: z.string().optional().describe('Google Business location/platform_user_id.'),
|
|
9
|
+
}),
|
|
10
|
+
async execute(client, input) {
|
|
11
|
+
const result = await client.getGoogleBusinessReviewLink(input);
|
|
12
|
+
return [
|
|
13
|
+
`Review link for ${result.businessName}:`,
|
|
14
|
+
result.reviewLink,
|
|
15
|
+
`Place ID: ${result.placeId}`,
|
|
16
|
+
`Account ID: ${result.account_id}`,
|
|
17
|
+
].join('\n');
|
|
18
|
+
},
|
|
19
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { PosterlyClient } from '../lib/api-client.js';
|
|
3
|
+
export declare const getPlatformSchemaTool: {
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
inputSchema: z.ZodObject<{
|
|
7
|
+
account_id: z.ZodOptional<z.ZodString>;
|
|
8
|
+
platform: z.ZodOptional<z.ZodEnum<["bluesky", "devto", "discord", "facebook", "gmb", "google-business", "google_business", "google_business_profile", "hashnode", "instagram", "instagram-standalone", "linkedin", "mastodon", "medium", "pinterest", "reddit", "skool", "slack", "telegram", "threads", "tiktok", "twitter", "whop", "wordpress", "x", "youtube"]>>;
|
|
9
|
+
include_planned: z.ZodOptional<z.ZodBoolean>;
|
|
10
|
+
}, "strip", z.ZodTypeAny, {
|
|
11
|
+
include_planned?: boolean | undefined;
|
|
12
|
+
platform?: "instagram" | "instagram-standalone" | "facebook" | "tiktok" | "twitter" | "linkedin" | "youtube" | "pinterest" | "threads" | "google_business" | "telegram" | "bluesky" | "reddit" | "wordpress" | "mastodon" | "medium" | "devto" | "hashnode" | "discord" | "slack" | "skool" | "whop" | "gmb" | "google-business" | "google_business_profile" | "x" | undefined;
|
|
13
|
+
account_id?: string | undefined;
|
|
14
|
+
}, {
|
|
15
|
+
include_planned?: boolean | undefined;
|
|
16
|
+
platform?: "instagram" | "instagram-standalone" | "facebook" | "tiktok" | "twitter" | "linkedin" | "youtube" | "pinterest" | "threads" | "google_business" | "telegram" | "bluesky" | "reddit" | "wordpress" | "mastodon" | "medium" | "devto" | "hashnode" | "discord" | "slack" | "skool" | "whop" | "gmb" | "google-business" | "google_business_profile" | "x" | undefined;
|
|
17
|
+
account_id?: string | undefined;
|
|
18
|
+
}>;
|
|
19
|
+
execute(client: PosterlyClient, input: {
|
|
20
|
+
account_id?: string;
|
|
21
|
+
platform?: string;
|
|
22
|
+
include_planned?: boolean;
|
|
23
|
+
}): Promise<string>;
|
|
24
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ALL_PLATFORM_INPUTS, SUPPORTED_PLATFORM_IDS } from '../generated/platform-manifest.js';
|
|
3
|
+
export const getPlatformSchemaTool = {
|
|
4
|
+
name: 'get_platform_schema',
|
|
5
|
+
description: 'Get the platform schema for a specific connected account or platform. Call this before creating posts with platform_settings so you know allowed post types, media limits, helper tools, and field names.',
|
|
6
|
+
inputSchema: z.object({
|
|
7
|
+
account_id: z
|
|
8
|
+
.string()
|
|
9
|
+
.optional()
|
|
10
|
+
.describe('Connected account ID from list_accounts. Preferred because it returns account context.'),
|
|
11
|
+
platform: z
|
|
12
|
+
.enum(ALL_PLATFORM_INPUTS)
|
|
13
|
+
.optional()
|
|
14
|
+
.describe(`Platform ID such as ${SUPPORTED_PLATFORM_IDS.join(', ')}. Set include_planned to inspect planned providers.`),
|
|
15
|
+
include_planned: z.boolean().optional(),
|
|
16
|
+
}),
|
|
17
|
+
async execute(client, input) {
|
|
18
|
+
const result = await client.getPlatformSchema(input);
|
|
19
|
+
const schema = result.schema || result.platform || result.platforms?.[0];
|
|
20
|
+
if (!schema)
|
|
21
|
+
return JSON.stringify(result, null, 2);
|
|
22
|
+
const fields = schema.settings_schema?.fields || [];
|
|
23
|
+
const helpers = schema.helper_tools || [];
|
|
24
|
+
const accountLine = result.account
|
|
25
|
+
? `Account: ${result.account.username || result.account.id} (${result.account.platform})\n`
|
|
26
|
+
: '';
|
|
27
|
+
return [
|
|
28
|
+
`${schema.label} (${schema.id}) schema`,
|
|
29
|
+
accountLine.trim(),
|
|
30
|
+
`Status: ${schema.status}`,
|
|
31
|
+
`Post types: ${schema.post_types.join(', ') || 'n/a'}`,
|
|
32
|
+
`Content limit: ${schema.content_limit ?? 'n/a'}`,
|
|
33
|
+
`Media: ${JSON.stringify(schema.media)}`,
|
|
34
|
+
`Analytics: ${schema.analytics_supported ? 'yes' : 'no'}`,
|
|
35
|
+
fields.length
|
|
36
|
+
? `Settings:\n${fields.map((field) => `• ${field.key}${field.required ? ' (required)' : ''}: ${field.description}`).join('\n')}`
|
|
37
|
+
: 'Settings: none',
|
|
38
|
+
helpers.length
|
|
39
|
+
? `Helpers:\n${helpers.map((helper) => `• ${helper.name}: ${helper.description}`).join('\n')}`
|
|
40
|
+
: 'Helpers: none',
|
|
41
|
+
`Example settings: ${JSON.stringify(schema.settings_schema?.example || {})}`,
|
|
42
|
+
].filter(Boolean).join('\n');
|
|
43
|
+
},
|
|
44
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { PosterlyClient } from '../lib/api-client.js';
|
|
3
|
+
export declare const getPostMissingTool: {
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
inputSchema: z.ZodObject<{
|
|
7
|
+
post_id: z.ZodNumber;
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
post_id: number;
|
|
10
|
+
}, {
|
|
11
|
+
post_id: number;
|
|
12
|
+
}>;
|
|
13
|
+
execute(client: PosterlyClient, input: {
|
|
14
|
+
post_id: number;
|
|
15
|
+
}): Promise<string>;
|
|
16
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const getPostMissingTool = {
|
|
3
|
+
name: 'get_post_missing',
|
|
4
|
+
description: 'Inspect whether a post is missing required content, media, account, platform settings, or metadata before it can publish. Use this to repair failed or imported posts.',
|
|
5
|
+
inputSchema: z.object({
|
|
6
|
+
post_id: z.number().int().positive().describe('The post ID to inspect.'),
|
|
7
|
+
}),
|
|
8
|
+
async execute(client, input) {
|
|
9
|
+
const result = await client.getPostMissing(input.post_id);
|
|
10
|
+
return JSON.stringify(result, null, 2);
|
|
11
|
+
},
|
|
12
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { PosterlyClient } from '../lib/api-client.js';
|
|
3
|
+
export declare const getVideoJobTool: {
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
inputSchema: z.ZodObject<{
|
|
7
|
+
job_id: z.ZodOptional<z.ZodString>;
|
|
8
|
+
status: z.ZodOptional<z.ZodEnum<["pending", "processing", "completed", "failed", "dismissed"]>>;
|
|
9
|
+
limit: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
10
|
+
}, "strip", z.ZodTypeAny, {
|
|
11
|
+
status?: "pending" | "processing" | "completed" | "failed" | "dismissed" | undefined;
|
|
12
|
+
limit?: number | undefined;
|
|
13
|
+
job_id?: string | undefined;
|
|
14
|
+
}, {
|
|
15
|
+
status?: "pending" | "processing" | "completed" | "failed" | "dismissed" | undefined;
|
|
16
|
+
limit?: number | undefined;
|
|
17
|
+
job_id?: string | undefined;
|
|
18
|
+
}>;
|
|
19
|
+
execute(client: PosterlyClient, input: {
|
|
20
|
+
job_id?: string;
|
|
21
|
+
status?: string;
|
|
22
|
+
limit?: number;
|
|
23
|
+
}): Promise<string>;
|
|
24
|
+
};
|