postfast-mcp 0.6.1 → 0.7.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/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +1 -1
- package/dist/core/build-tools.d.ts +10 -0
- package/dist/core/build-tools.js +15 -5
- package/dist/core/build-tools.js.map +1 -1
- package/dist/core/confirm-token.d.ts +23 -0
- package/dist/core/confirm-token.js +64 -0
- package/dist/core/confirm-token.js.map +1 -0
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/instructions.d.ts +3 -1
- package/dist/core/instructions.js +26 -2
- package/dist/core/instructions.js.map +1 -1
- package/dist/core/tool-def.d.ts +14 -3
- package/dist/core/tools/inbox-confirm.d.ts +12 -0
- package/dist/core/tools/inbox-confirm.js +103 -0
- package/dist/core/tools/inbox-confirm.js.map +1 -0
- package/dist/core/tools/inbox.js +23 -7
- package/dist/core/tools/inbox.js.map +1 -1
- package/dist/core/tools/index.js +2 -0
- package/dist/core/tools/index.js.map +1 -1
- package/dist/core/tools/posts.js +27 -12
- package/dist/core/tools/posts.js.map +1 -1
- package/dist/core/tools/tiktok.js +1 -1
- package/dist/core/tools/tiktok.js.map +1 -1
- package/dist/core/tools/uploads.js +13 -5
- package/dist/core/tools/uploads.js.map +1 -1
- package/dist/stdio/index.js +1 -1
- package/package.json +2 -1
- package/skills/social-media-post/SKILL.md +3 -3
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
{
|
|
12
12
|
"name": "postfast",
|
|
13
13
|
"description": "Schedule, manage, and analyze social media posts via PostFast. Supports Facebook, Instagram, X, TikTok, LinkedIn, YouTube, BlueSky, Threads, Pinterest, Telegram, and Google Business Profile.",
|
|
14
|
-
"version": "0.
|
|
14
|
+
"version": "0.7.0",
|
|
15
15
|
"author": {
|
|
16
16
|
"name": "PostFast",
|
|
17
17
|
"email": "me@peturgeorgievv.com"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "postfast",
|
|
3
3
|
"description": "Schedule, manage, and analyze social media posts via PostFast. Supports Facebook, Instagram, X, TikTok, LinkedIn, YouTube, BlueSky, Threads, Pinterest, Telegram, and Google Business Profile. After installing, tell Cowork: 'Set my PostFast API key' — get your key at https://app.postfa.st/dashboard → API.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.7.0",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "PostFast",
|
|
7
7
|
"email": "me@peturgeorgievv.com"
|
package/README.md
CHANGED
|
@@ -164,7 +164,7 @@ When creating posts, you can pass platform-specific settings via the `controls`
|
|
|
164
164
|
| **X (Twitter)** | `xRetweetUrl` |
|
|
165
165
|
| **Instagram** | `instagramPublishType` (TIMELINE/STORY/REEL), `instagramTrialReelStrategy` (MANUAL/SS_PERFORMANCE — trial reel shown to non-followers; Reels only, no collaborators), `instagramPostToGrid`, `instagramCollaborators`, `instagramLocationId`/`instagramLocationName` (geotag from `search_places`), `instagramIsAiGenerated` (adds the "AI info" label; set at creation only) |
|
|
166
166
|
| **Facebook** | `facebookContentType` (POST/REEL/STORY), `facebookAllowComments`, `facebookPrivacy`, `facebookCarouselMainLink`, `facebookCarouselShowEndCard`, `facebookReelsCollaborators`, `facebookTargetCountries` (ISO alpha-2, max 25), `facebookPlaceId`/`facebookPlaceName` (geotag from `search_places`) |
|
|
167
|
-
| **TikTok** | `tiktokTitle` (photo posts, max 90 chars), `tiktokMusicSoundId`/`tiktokMusicSoundName` (Commercial Music Library sound from `list_tiktok_sounds`; photo
|
|
167
|
+
| **TikTok** | `tiktokTitle` (photo posts, max 90 chars), `tiktokMusicSoundId`/`tiktokMusicSoundName` (Commercial Music Library sound from `list_tiktok_sounds`; photo, carousel and video posts — on video it plays at 50% volume over the original audio at 50%; exclusive with `tiktokAutoAddMusic`), `tiktokIsDraft`, `tiktokAllowComments`, `tiktokAllowDuet`, `tiktokAllowStitch`, `tiktokBrandOrganic`, `tiktokBrandContent`, `tiktokAutoAddMusic` (photo/carousel posts), `tiktokIsAigc`, `tiktokPrivacy` (deprecated — account default applies) |
|
|
168
168
|
| **YouTube** | `youtubeTitle`, `youtubePrivacy` (PUBLIC/PRIVATE/UNLISTED), `youtubeTags`, `youtubeCategoryId`, `youtubeIsShort`, `youtubeMadeForKids`, `youtubeContainsSyntheticMedia` (altered/synthetic content disclosure; set at creation only), `youtubePlaylistId`, `youtubeThumbnailKey` |
|
|
169
169
|
| **Pinterest** | `pinterestBoardId` (required), `pinterestLink` |
|
|
170
170
|
| **LinkedIn** | `linkedinAttachmentKey`, `linkedinAttachmentTitle` |
|
|
@@ -2,6 +2,10 @@ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
|
2
2
|
import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
3
3
|
import type { BackendPort } from './backend-port.js';
|
|
4
4
|
import type { Binding, ResolvedTool } from './tool-def.js';
|
|
5
|
+
export interface ConfirmGateOptions {
|
|
6
|
+
/** HMAC key for confirm tokens; at least 32 characters. */
|
|
7
|
+
secret: string;
|
|
8
|
+
}
|
|
5
9
|
export interface BuildToolsOptions {
|
|
6
10
|
binding: Binding;
|
|
7
11
|
/**
|
|
@@ -16,6 +20,12 @@ export interface BuildToolsOptions {
|
|
|
16
20
|
* catalog keeps working when a newer catalog adds tools it can't serve yet.
|
|
17
21
|
*/
|
|
18
22
|
port?: BackendPort;
|
|
23
|
+
/**
|
|
24
|
+
* Remote only. Holds every new post for approval and routes comment
|
|
25
|
+
* replies, private replies and deletions through prepare_inbox_action and
|
|
26
|
+
* confirm_inbox_action. When absent, the output is identical to 0.6.2.
|
|
27
|
+
*/
|
|
28
|
+
confirmGate?: ConfirmGateOptions;
|
|
19
29
|
}
|
|
20
30
|
/** Resolve the catalog for one binding: filter, flatten binding-variant fields. */
|
|
21
31
|
export declare function buildTools(options: BuildToolsOptions): ResolvedTool[];
|
package/dist/core/build-tools.js
CHANGED
|
@@ -2,10 +2,16 @@ import { workspaceIdField } from './shared.js';
|
|
|
2
2
|
import { ALL_TOOLS } from './tools/index.js';
|
|
3
3
|
/** Resolve the catalog for one binding: filter, flatten binding-variant fields. */
|
|
4
4
|
export function buildTools(options) {
|
|
5
|
-
const { binding, withWorkspaceField = false, port } = options;
|
|
5
|
+
const { binding, withWorkspaceField = false, port, confirmGate } = options;
|
|
6
|
+
const gated = binding === 'remote' && !!confirmGate;
|
|
7
|
+
if (gated && !(confirmGate.secret?.length >= 32)) {
|
|
8
|
+
throw new Error('confirmGate.secret must be at least 32 characters.');
|
|
9
|
+
}
|
|
6
10
|
return ALL_TOOLS.filter((def) => {
|
|
7
11
|
if (def.binding !== 'both' && def.binding !== binding)
|
|
8
12
|
return false;
|
|
13
|
+
if (gated ? def.hiddenWhenGated : def.gatedOnly)
|
|
14
|
+
return false;
|
|
9
15
|
if (port &&
|
|
10
16
|
def.portMethod &&
|
|
11
17
|
typeof port[def.portMethod] !== 'function') {
|
|
@@ -14,18 +20,22 @@ export function buildTools(options) {
|
|
|
14
20
|
}
|
|
15
21
|
return true;
|
|
16
22
|
}).map((def) => {
|
|
17
|
-
const inputSchema = typeof def.inputSchema === 'function' ? def.inputSchema(binding) : def.inputSchema;
|
|
23
|
+
const inputSchema = typeof def.inputSchema === 'function' ? def.inputSchema(binding, gated) : def.inputSchema;
|
|
24
|
+
const annotations = gated && def.gatedAnnotations ? def.gatedAnnotations : def.annotations;
|
|
18
25
|
return {
|
|
19
26
|
name: def.name,
|
|
20
27
|
title: def.title,
|
|
21
|
-
description: typeof def.description === 'function' ? def.description(binding) : def.description,
|
|
28
|
+
description: typeof def.description === 'function' ? def.description(binding, gated) : def.description,
|
|
22
29
|
inputSchema: withWorkspaceField && def.workspaceScoped !== false
|
|
23
30
|
? { ...inputSchema, workspaceId: workspaceIdField }
|
|
24
31
|
: inputSchema,
|
|
25
|
-
annotations: { title: def.title, ...
|
|
32
|
+
annotations: { title: def.title, ...annotations },
|
|
26
33
|
_meta: def._meta,
|
|
27
34
|
portMethod: def.portMethod,
|
|
28
|
-
|
|
35
|
+
// Gated: hand the secret to run(), also for hosts that call tool.run() themselves.
|
|
36
|
+
run: gated
|
|
37
|
+
? (p, args, workspaceId) => def.run(p, args, workspaceId, { confirmSecret: confirmGate.secret })
|
|
38
|
+
: def.run,
|
|
29
39
|
};
|
|
30
40
|
});
|
|
31
41
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-tools.js","sourceRoot":"","sources":["../../src/core/build-tools.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"build-tools.js","sourceRoot":"","sources":["../../src/core/build-tools.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AA6B7C,mFAAmF;AACnF,MAAM,UAAU,UAAU,CAAC,OAA0B;IACnD,MAAM,EAAE,OAAO,EAAE,kBAAkB,GAAG,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC;IAC3E,MAAM,KAAK,GAAG,OAAO,KAAK,QAAQ,IAAI,CAAC,CAAC,WAAW,CAAC;IACpD,IAAI,KAAK,IAAI,CAAC,CAAC,WAAW,CAAC,MAAM,EAAE,MAAM,IAAI,EAAE,CAAC,EAAE,CAAC;QACjD,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;IACxE,CAAC;IAED,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE;QAC9B,IAAI,GAAG,CAAC,OAAO,KAAK,MAAM,IAAI,GAAG,CAAC,OAAO,KAAK,OAAO;YAAE,OAAO,KAAK,CAAC;QACpE,IAAI,KAAK,CAAC,CAAC,CAA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AAwB,CAAC,CAAC;IACvE,CAAC;AACH,CAAC;AAMD,oEAAoE;AACpE,MAAM,UAAU,oBAAoB,CAClC,MAAiB,EACjB,OAA6B;IAE7B,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;IAEzB,KAAK,MAAM,IAAI,IAAI,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QACvC,MAAM,CAAC,YAAY,CACjB,IAAI,CAAC,IAAI,EACT;YACE,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAC7C,EACD,CAAC,IAA6B,EAAE,EAAE,CAChC,OAAO,CAAC,GAAG,EAAE;YACX,MAAM,EAAE,WAAW,EAAE,GAAG,IAAI,EAAE,GAAG,IAAI,IAAI,EAAE,CAAC;YAC5C,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,WAAiC,CAAC,CAAC;QACjE,CAAC,CAAC,CACL,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tokens that tie confirm_inbox_action to exactly what prepare_inbox_action
|
|
3
|
+
* previewed: an HMAC over the workspace, item, action and text. Format
|
|
4
|
+
* `v1.<exp>.<jti>.<base64url mac>`, exp in epoch seconds. Stateless apart from
|
|
5
|
+
* the used-jti list below, so a token verifies on any replica of a host.
|
|
6
|
+
*/
|
|
7
|
+
export type ConfirmAction = 'REPLY' | 'PRIVATE_REPLY' | 'DELETE';
|
|
8
|
+
export interface ConfirmFields {
|
|
9
|
+
ws?: string;
|
|
10
|
+
itemId: string;
|
|
11
|
+
action: ConfirmAction;
|
|
12
|
+
text?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function sign(fields: ConfirmFields, secret: string, now?: number): {
|
|
15
|
+
confirmToken: string;
|
|
16
|
+
expiresAt: string;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Verify a token against the caller's own values and reserve its jti in the
|
|
20
|
+
* same synchronous step, so two concurrent confirms cannot both pass. Returns
|
|
21
|
+
* a release() for when the action itself then fails.
|
|
22
|
+
*/
|
|
23
|
+
export declare function redeem(confirmToken: string, fields: ConfirmFields, secret: string, now?: number): () => void;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { createHmac, randomUUID, timingSafeEqual } from 'node:crypto';
|
|
2
|
+
const TTL_SECONDS = 900;
|
|
3
|
+
const MISMATCH = 'confirmToken does not match this action. Prepare it again with prepare_inbox_action and confirm exactly what was previewed.';
|
|
4
|
+
const EXPIRED = 'confirmToken has expired. Prepare the action again.';
|
|
5
|
+
const USED = 'This confirmToken was already used.';
|
|
6
|
+
/**
|
|
7
|
+
* jti -> exp of every redeemed token that has not expired yet. Module-level,
|
|
8
|
+
* so it spans sessions and buildTools() calls, but it is per process: a token
|
|
9
|
+
* replayed on another replica of a host is not caught here.
|
|
10
|
+
*/
|
|
11
|
+
const usedJtis = new Map();
|
|
12
|
+
function prune(nowSeconds) {
|
|
13
|
+
for (const [jti, exp] of usedJtis) {
|
|
14
|
+
if (exp < nowSeconds)
|
|
15
|
+
usedJtis.delete(jti);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function mac(secret, exp, jti, fields) {
|
|
19
|
+
// DELETE carries no text: any text passed is ignored when signing and when
|
|
20
|
+
// verifying, so a confirm that echoes one still matches.
|
|
21
|
+
const text = fields.action === 'DELETE' ? '' : (fields.text ?? '');
|
|
22
|
+
return createHmac('sha256', secret)
|
|
23
|
+
.update(JSON.stringify(['v1', exp, jti, fields.ws ?? '', fields.itemId, fields.action, text]))
|
|
24
|
+
.digest('base64url');
|
|
25
|
+
}
|
|
26
|
+
export function sign(fields, secret, now = Date.now()) {
|
|
27
|
+
const nowSeconds = Math.floor(now / 1000);
|
|
28
|
+
prune(nowSeconds);
|
|
29
|
+
const exp = nowSeconds + TTL_SECONDS;
|
|
30
|
+
const jti = randomUUID();
|
|
31
|
+
return {
|
|
32
|
+
confirmToken: `v1.${exp}.${jti}.${mac(secret, exp, jti, fields)}`,
|
|
33
|
+
expiresAt: new Date(exp * 1000).toISOString(),
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Verify a token against the caller's own values and reserve its jti in the
|
|
38
|
+
* same synchronous step, so two concurrent confirms cannot both pass. Returns
|
|
39
|
+
* a release() for when the action itself then fails.
|
|
40
|
+
*/
|
|
41
|
+
export function redeem(confirmToken, fields, secret, now = Date.now()) {
|
|
42
|
+
const nowSeconds = Math.floor(now / 1000);
|
|
43
|
+
prune(nowSeconds);
|
|
44
|
+
const parts = confirmToken.split('.');
|
|
45
|
+
const [version, expText, jti, given] = parts;
|
|
46
|
+
if (parts.length !== 4 || version !== 'v1' || !/^\d+$/.test(expText)) {
|
|
47
|
+
throw new Error(MISMATCH);
|
|
48
|
+
}
|
|
49
|
+
const exp = Number(expText);
|
|
50
|
+
if (nowSeconds > exp)
|
|
51
|
+
throw new Error(EXPIRED);
|
|
52
|
+
const expected = Buffer.from(mac(secret, exp, jti, fields));
|
|
53
|
+
const actual = Buffer.from(given);
|
|
54
|
+
if (expected.length !== actual.length || !timingSafeEqual(expected, actual)) {
|
|
55
|
+
throw new Error(MISMATCH);
|
|
56
|
+
}
|
|
57
|
+
if (usedJtis.has(jti))
|
|
58
|
+
throw new Error(USED);
|
|
59
|
+
usedJtis.set(jti, exp);
|
|
60
|
+
return () => {
|
|
61
|
+
usedJtis.delete(jti);
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=confirm-token.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"confir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C,IAAI,CAAC,KAAK,CAAC,CAAC;IAClC,IAAI,QAAQ,CAAC,MAAM,KAAK,MAAM,CAAC,MAAM,IAAI,CAAC,eAAe,CAAC,QAAQ,EAAE,MAAM,CAAC,EAAE,CAAC;QAC5E,MAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC5B,CAAC;IACD,IAAI,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC;IAC7C,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACvB,OAAO,GAAG,EAAE;QACV,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACvB,CAAC,CAAC;AACJ,CAAC"}
|
package/dist/core/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* remote host (social-schedule-mcp). Import as "postfast-mcp/core".
|
|
5
5
|
*/
|
|
6
6
|
export * from './backend-port.js';
|
|
7
|
-
export { buildTools, registerCatalogTools, runTool, toolError, toolResult, type BuildToolsOptions, type RegisterToolsOptions, } from './build-tools.js';
|
|
7
|
+
export { buildTools, registerCatalogTools, runTool, toolError, toolResult, type BuildToolsOptions, type ConfirmGateOptions, type RegisterToolsOptions, } from './build-tools.js';
|
|
8
8
|
export { SERVER_INSTRUCTIONS, instructionsFor } from './instructions.js';
|
|
9
9
|
export { CREATE_APPROVAL_STATUSES, CREATE_STATUSES, IMAGE_MIME_TYPES, PLATFORMS, POST_STATUSES, SET_APPROVAL_STATUSES, VIDEO_MIME_TYPES, jsonParse, workspaceIdField, } from './shared.js';
|
|
10
10
|
export type { Binding, ResolvedTool, ResolvedToolAnnotations, ToolAnnotations, ToolDef, } from './tool-def.js';
|
package/dist/core/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,cAAc,mBAAmB,CAAC;AAClC,OAAO,EACL,UAAU,EACV,oBAAoB,EACpB,OAAO,EACP,SAAS,EACT,UAAU,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,cAAc,mBAAmB,CAAC;AAClC,OAAO,EACL,UAAU,EACV,oBAAoB,EACpB,OAAO,EACP,SAAS,EACT,UAAU,GAIX,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EACL,wBAAwB,EACxB,eAAe,EACf,gBAAgB,EAChB,SAAS,EACT,aAAa,EACb,qBAAqB,EACrB,gBAAgB,EAChB,SAAS,EACT,gBAAgB,GACjB,MAAM,aAAa,CAAC;AAQrB,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,cAAc,YAAY,CAAC"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import type { Binding } from './tool-def.js';
|
|
2
2
|
export declare const SERVER_INSTRUCTIONS: Record<Binding, string>;
|
|
3
|
-
export declare function instructionsFor(binding: Binding
|
|
3
|
+
export declare function instructionsFor(binding: Binding, opts?: {
|
|
4
|
+
gated?: boolean;
|
|
5
|
+
}): string;
|
|
@@ -30,7 +30,7 @@ Platform-specific options go in the controls object, e.g.:
|
|
|
30
30
|
- Pinterest: controls.pinterestBoardId is REQUIRED — it is a board's boardId from list_pinterest_boards, NOT the Pinterest account's socialMediaId.
|
|
31
31
|
- Google Business Profile: controls.gbpLocationId is required — the locationId from list_gbp_locations.
|
|
32
32
|
- YouTube: controls.youtubePlaylistId is the playlistId from list_youtube_playlists; youtubeIsShort defaults true; title falls back to the first 100 chars of content.
|
|
33
|
-
- TikTok: controls.tiktokPrivacy is deprecated (videos use the account default, photos default to public); tiktokTitle applies to photo carousels only (max 90); firstComment (max 1,200
|
|
33
|
+
- TikTok: controls.tiktokPrivacy is deprecated (videos use the account default, photos default to public); tiktokTitle applies to photo carousels only (max 90); firstComment (max 1,200).
|
|
34
34
|
- Instagram: controls.instagramPublishType = TIMELINE | STORY | REEL.
|
|
35
35
|
- Facebook: controls.facebookContentType = POST | REEL | STORY. controls.facebookTargetCountries limits who can see a FEED post by country (ISO 3166-1 alpha-2, max 25; not Reels/Stories).
|
|
36
36
|
- Geotag a place (Facebook/Instagram): call search_places, then pass a returned id as controls.facebookPlaceId (Facebook feed posts only — not Reels/Stories/video) and/or controls.instagramLocationId (Instagram single media only — not carousels). One id works for both.
|
|
@@ -61,7 +61,31 @@ export const SERVER_INSTRUCTIONS = {
|
|
|
61
61
|
stdio: STDIO_INSTRUCTIONS,
|
|
62
62
|
remote: REMOTE_INSTRUCTIONS,
|
|
63
63
|
};
|
|
64
|
-
|
|
64
|
+
/**
|
|
65
|
+
* The remote text for a host with the confirm gate on: REMOTE_INSTRUCTIONS
|
|
66
|
+
* with the paragraphs starting with these prefixes swapped, so the ungated
|
|
67
|
+
* text above is never touched.
|
|
68
|
+
*/
|
|
69
|
+
const GATED_PARAGRAPHS = [
|
|
70
|
+
[
|
|
71
|
+
'Flow: ',
|
|
72
|
+
"Flow: list_accounts (+ list_workspaces) to see what's connected → create_posts (one socialMediaId per post; batch up to 15) → attach media via upload_from_url (a public https URL) or upload_media (base64 bytes in data + contentType). Posts are held for approval and nothing publishes until approve_posts sets them to APPROVED: show the user what will be posted, where and when, and call approve_posts only after they confirm.",
|
|
73
|
+
],
|
|
74
|
+
[
|
|
75
|
+
'Status & timing: ',
|
|
76
|
+
'Status & timing: status=SCHEDULED requires scheduledAt on every post (ISO-8601, in the future, within 1 year); status=DRAFT must omit scheduledAt. Every post is created as PENDING_APPROVAL and publishes at its scheduledAt only once approve_posts sets it to APPROVED.',
|
|
77
|
+
],
|
|
78
|
+
[
|
|
79
|
+
'Social inbox ',
|
|
80
|
+
"Social inbox (comments on your posts: TikTok, Instagram, Facebook Pages, Threads; an account's inboxCapable flag from list_accounts says what is live today): read with list_inbox_conversations → list_inbox_items (get_inbox_unread_count for the total). To reply publicly under a comment (REPLY), send an Instagram private reply (PRIVATE_REPLY: one per comment, within 7 days) or delete a comment permanently (DELETE), call prepare_inbox_action, show the user the preview, and carry it out with confirm_inbox_action only after they agree. Whether and how long a reply can be comes ONLY from the conversation's server-computed canReply / maxReplyLength / windowState / disabledReason; never assume platform rules. Hide or restore a comment with set_inbox_item_state (HIDE / UNHIDE), triage with set_inbox_conversation_status and assign_inbox_conversation, and call mark_inbox_conversation_read after presenting a thread. It is a comments inbox; never present it as DMs or messages.",
|
|
81
|
+
],
|
|
82
|
+
];
|
|
83
|
+
const GATED_REMOTE_INSTRUCTIONS = REMOTE_INSTRUCTIONS.split('\n\n')
|
|
84
|
+
.map((paragraph) => GATED_PARAGRAPHS.find(([prefix]) => paragraph.startsWith(prefix))?.[1] ?? paragraph)
|
|
85
|
+
.join('\n\n');
|
|
86
|
+
export function instructionsFor(binding, opts) {
|
|
87
|
+
if (binding === 'remote' && opts?.gated)
|
|
88
|
+
return GATED_REMOTE_INSTRUCTIONS;
|
|
65
89
|
return SERVER_INSTRUCTIONS[binding];
|
|
66
90
|
}
|
|
67
91
|
//# sourceMappingURL=instructions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instructions.js","sourceRoot":"","sources":["../../src/core/instructions.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AAEH,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;w4BAkCo3B,CAAC;AAEz4B,MAAM,kBAAkB,GAAG;;;;;;EAMzB,WAAW,EAAE,CAAC;AAEhB,MAAM,mBAAmB,GAAG;;;;;;EAM1B,WAAW,EAAE,CAAC;AAEhB,MAAM,CAAC,MAAM,mBAAmB,GAA4B;IAC1D,KAAK,EAAE,kBAAkB;IACzB,MAAM,EAAE,mBAAmB;CAC5B,CAAC;AAEF,MAAM,UAAU,eAAe,CAAC,OAAgB;
|
|
1
|
+
{"version":3,"file":"instructions.js","sourceRoot":"","sources":["../../src/core/instructions.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AAEH,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;w4BAkCo3B,CAAC;AAEz4B,MAAM,kBAAkB,GAAG;;;;;;EAMzB,WAAW,EAAE,CAAC;AAEhB,MAAM,mBAAmB,GAAG;;;;;;EAM1B,WAAW,EAAE,CAAC;AAEhB,MAAM,CAAC,MAAM,mBAAmB,GAA4B;IAC1D,KAAK,EAAE,kBAAkB;IACzB,MAAM,EAAE,mBAAmB;CAC5B,CAAC;AAEF;;;;GAIG;AACH,MAAM,gBAAgB,GAAqC;IACzD;QACE,QAAQ;QACR,2aAA2a;KAC5a;IACD;QACE,mBAAmB;QACnB,4QAA4Q;KAC7Q;IACD;QACE,eAAe;QACf,o9BAAo9B;KACr9B;CACF,CAAC;AAEF,MAAM,yBAAyB,GAAG,mBAAmB,CAAC,KAAK,CAAC,MAAM,CAAC;KAChE,GAAG,CACF,CAAC,SAAS,EAAE,EAAE,CACZ,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,SAAS,CACtF;KACA,IAAI,CAAC,MAAM,CAAC,CAAC;AAEhB,MAAM,UAAU,eAAe,CAAC,OAAgB,EAAE,IAA0B;IAC1E,IAAI,OAAO,KAAK,QAAQ,IAAI,IAAI,EAAE,KAAK;QAAE,OAAO,yBAAyB,CAAC;IAC1E,OAAO,mBAAmB,CAAC,OAAO,CAAC,CAAC;AACtC,CAAC"}
|
package/dist/core/tool-def.d.ts
CHANGED
|
@@ -27,19 +27,27 @@ export type ResolvedToolAnnotations = ToolAnnotations & {
|
|
|
27
27
|
* function of the binding for the few spots where the surfaces genuinely
|
|
28
28
|
* differ (upload-tool references — stdio uploads local files, the remote
|
|
29
29
|
* uploads conversation media/URLs). Everything else is binding-invariant.
|
|
30
|
+
* The functions also receive `gated`: true only on a remote build with the
|
|
31
|
+
* confirm gate on (BuildToolsOptions.confirmGate).
|
|
30
32
|
*/
|
|
31
33
|
export interface ToolDef {
|
|
32
34
|
name: string;
|
|
33
35
|
/** Which binding(s) expose the tool. */
|
|
34
36
|
binding: Binding | 'both';
|
|
35
37
|
title: string;
|
|
36
|
-
description: string | ((binding: Binding) => string);
|
|
37
|
-
inputSchema: ZodRawShape | ((binding: Binding) => ZodRawShape);
|
|
38
|
+
description: string | ((binding: Binding, gated?: boolean) => string);
|
|
39
|
+
inputSchema: ZodRawShape | ((binding: Binding, gated?: boolean) => ZodRawShape);
|
|
38
40
|
annotations: ToolAnnotations;
|
|
41
|
+
/** Replaces `annotations` when the confirm gate is on. */
|
|
42
|
+
gatedAnnotations?: ToolAnnotations;
|
|
39
43
|
/** Extra tool metadata, e.g. the ChatGPT file-param marker on upload_media. */
|
|
40
44
|
_meta?: Record<string, unknown>;
|
|
41
45
|
/** False only for tools that are not scoped to a workspace (list_workspaces). */
|
|
42
46
|
workspaceScoped?: boolean;
|
|
47
|
+
/** The tool exists only when the confirm gate is on. */
|
|
48
|
+
gatedOnly?: boolean;
|
|
49
|
+
/** The tool is dropped when the confirm gate is on. */
|
|
50
|
+
hiddenWhenGated?: boolean;
|
|
43
51
|
/**
|
|
44
52
|
* The BackendPort method this tool's run() dispatches to. When set and the
|
|
45
53
|
* port instance lacks the method (an older adapter running a newer catalog),
|
|
@@ -51,8 +59,11 @@ export interface ToolDef {
|
|
|
51
59
|
* Dispatch to the backend. `args` are the validated tool arguments minus
|
|
52
60
|
* `workspaceId`, which is split off by the registrar and passed separately
|
|
53
61
|
* (always undefined on stdio — the pf-api-key is already workspace-scoped).
|
|
62
|
+
* `ctx.confirmSecret` is set by buildTools() when the confirm gate is on.
|
|
54
63
|
*/
|
|
55
|
-
run: (port: BackendPort, args: Record<string, unknown>, workspaceId?: string
|
|
64
|
+
run: (port: BackendPort, args: Record<string, unknown>, workspaceId?: string, ctx?: {
|
|
65
|
+
confirmSecret?: string;
|
|
66
|
+
}) => Promise<unknown>;
|
|
56
67
|
}
|
|
57
68
|
/** A ToolDef with binding-dependent fields resolved for one concrete binding. */
|
|
58
69
|
export interface ResolvedTool {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ToolDef } from '../tool-def.js';
|
|
2
|
+
/**
|
|
3
|
+
* Comment replies, Instagram private replies and comment deletions in two
|
|
4
|
+
* steps, for hosts with the confirm gate on (there they replace
|
|
5
|
+
* reply_to_inbox_item, send_inbox_private_reply and set_inbox_item_state
|
|
6
|
+
* DELETE). prepare returns a preview and a signed token and calls nothing.
|
|
7
|
+
* confirm repeats the same values, so the client's approval prompt for the
|
|
8
|
+
* destructive call shows the real reply text, and any change fails the
|
|
9
|
+
* signature. The token is not tied to a user: confirm runs with the caller's
|
|
10
|
+
* own credentials, so the backend still decides who may reply or delete.
|
|
11
|
+
*/
|
|
12
|
+
export declare const inboxConfirmTools: ToolDef[];
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { redeem, sign } from '../confirm-token.js';
|
|
3
|
+
const CONFIRM_ACTIONS = ['REPLY', 'PRIVATE_REPLY', 'DELETE'];
|
|
4
|
+
/** The confirm-gate secret, handed to run() by buildTools() when the gate is on. */
|
|
5
|
+
function secretOf(ctx) {
|
|
6
|
+
if (!ctx?.confirmSecret) {
|
|
7
|
+
throw new Error('The confirm gate is not configured on this server.');
|
|
8
|
+
}
|
|
9
|
+
return ctx.confirmSecret;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Comment replies, Instagram private replies and comment deletions in two
|
|
13
|
+
* steps, for hosts with the confirm gate on (there they replace
|
|
14
|
+
* reply_to_inbox_item, send_inbox_private_reply and set_inbox_item_state
|
|
15
|
+
* DELETE). prepare returns a preview and a signed token and calls nothing.
|
|
16
|
+
* confirm repeats the same values, so the client's approval prompt for the
|
|
17
|
+
* destructive call shows the real reply text, and any change fails the
|
|
18
|
+
* signature. The token is not tied to a user: confirm runs with the caller's
|
|
19
|
+
* own credentials, so the backend still decides who may reply or delete.
|
|
20
|
+
*/
|
|
21
|
+
export const inboxConfirmTools = [
|
|
22
|
+
{
|
|
23
|
+
name: 'prepare_inbox_action',
|
|
24
|
+
binding: 'remote',
|
|
25
|
+
gatedOnly: true,
|
|
26
|
+
title: 'Prepare Comment Reply or Deletion',
|
|
27
|
+
description: "Prepare a reply to a comment, an Instagram private reply, or a comment deletion WITHOUT doing it. REPLY posts publicly under the comment; PRIVATE_REPLY sends an Instagram private reply that arrives as a direct message (one per comment, within 7 days; check the item's canPrivateReply); DELETE removes the comment on the platform permanently (not supported on Threads). Before a reply, check the conversation's canReply and maxReplyLength. Returns a preview and a confirmToken. Show the user the preview and carry it out with confirm_inbox_action only after they agree. Nothing reaches the platform in this step.",
|
|
28
|
+
inputSchema: {
|
|
29
|
+
itemId: z.uuid().describe('The comment item id (from list_inbox_items)'),
|
|
30
|
+
action: z
|
|
31
|
+
.enum(CONFIRM_ACTIONS)
|
|
32
|
+
.describe('REPLY (public, under the comment), PRIVATE_REPLY (Instagram only) or DELETE (permanent)'),
|
|
33
|
+
text: z
|
|
34
|
+
.string()
|
|
35
|
+
.min(1)
|
|
36
|
+
.optional()
|
|
37
|
+
.describe('Reply text. Required for REPLY and PRIVATE_REPLY; omit for DELETE.'),
|
|
38
|
+
},
|
|
39
|
+
annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: false },
|
|
40
|
+
portMethod: 'replyToInboxItem',
|
|
41
|
+
run: async (_port, args, workspaceId, ctx) => {
|
|
42
|
+
const action = args.action;
|
|
43
|
+
const itemId = args.itemId;
|
|
44
|
+
const text = action === 'DELETE' ? undefined : args.text;
|
|
45
|
+
if (action !== 'DELETE' && !text) {
|
|
46
|
+
throw new Error('text is required for REPLY and PRIVATE_REPLY.');
|
|
47
|
+
}
|
|
48
|
+
const { confirmToken, expiresAt } = sign({ ws: workspaceId, itemId, action, text }, secretOf(ctx));
|
|
49
|
+
return {
|
|
50
|
+
preview: {
|
|
51
|
+
action,
|
|
52
|
+
itemId,
|
|
53
|
+
...(text === undefined ? {} : { text }),
|
|
54
|
+
...(workspaceId === undefined ? {} : { workspaceId }),
|
|
55
|
+
},
|
|
56
|
+
confirmToken,
|
|
57
|
+
expiresAt,
|
|
58
|
+
next: 'Show the user this preview. If they agree, call confirm_inbox_action with this confirmToken and the same itemId, action and text, plus the same workspaceId only if you passed one.',
|
|
59
|
+
};
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: 'confirm_inbox_action',
|
|
64
|
+
binding: 'remote',
|
|
65
|
+
gatedOnly: true,
|
|
66
|
+
title: 'Confirm Comment Reply or Deletion',
|
|
67
|
+
description: 'Carry out a reply or deletion prepared with prepare_inbox_action. Pass its confirmToken with the same itemId, action and text (and workspaceId, if you used one); anything different is rejected. Call it only after the user has agreed to the preview. Replies on Threads cannot be removed through PostFast, private replies cannot be unsent, and deletions cannot be undone. A token expires 15 minutes after it was prepared and works once. Failures return the underlying inbox.* codes (for example replyTooLong, privateReplyAlreadySent, deleteNotSupported).',
|
|
68
|
+
inputSchema: {
|
|
69
|
+
confirmToken: z.string().min(1).describe('The confirmToken from prepare_inbox_action'),
|
|
70
|
+
itemId: z.uuid().describe('Must match the prepared action exactly.'),
|
|
71
|
+
action: z.enum(CONFIRM_ACTIONS).describe('Must match the prepared action exactly.'),
|
|
72
|
+
text: z.string().min(1).optional().describe('Must match the prepared action exactly.'),
|
|
73
|
+
},
|
|
74
|
+
annotations: {
|
|
75
|
+
readOnlyHint: false,
|
|
76
|
+
destructiveHint: true,
|
|
77
|
+
idempotentHint: false,
|
|
78
|
+
openWorldHint: true,
|
|
79
|
+
},
|
|
80
|
+
portMethod: 'replyToInboxItem',
|
|
81
|
+
run: async (port, args, workspaceId, ctx) => {
|
|
82
|
+
const action = args.action;
|
|
83
|
+
const itemId = args.itemId;
|
|
84
|
+
const text = action === 'DELETE' ? undefined : args.text;
|
|
85
|
+
// Reserves the token before the platform call; released only if that call throws.
|
|
86
|
+
const release = redeem(args.confirmToken, { ws: workspaceId, itemId, action, text }, secretOf(ctx));
|
|
87
|
+
try {
|
|
88
|
+
if (action === 'REPLY') {
|
|
89
|
+
return await port.replyToInboxItem({ itemId, text: text }, workspaceId);
|
|
90
|
+
}
|
|
91
|
+
if (action === 'PRIVATE_REPLY') {
|
|
92
|
+
return await port.sendInboxPrivateReply({ itemId, text: text }, workspaceId);
|
|
93
|
+
}
|
|
94
|
+
return await port.setInboxItemState({ itemId, action: 'DELETE' }, workspaceId);
|
|
95
|
+
}
|
|
96
|
+
catch (err) {
|
|
97
|
+
release();
|
|
98
|
+
throw err;
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
];
|
|
103
|
+
//# sourceMappingURL=inbox-confirm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inbox-confirm.js","sourceRoot":"","sources":["../../../src/core/tools/inbox-confirm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,IAAI,EAAsB,MAAM,qBAAqB,CAAC;AAGvE,MAAM,eAAe,GAAG,CAAC,OAAO,EAAE,eAAe,EAAE,QAAQ,CAAU,CAAC;AAEtE,oFAAoF;AACpF,SAAS,QAAQ,CAAC,GAAgC;IAChD,IAAI,CAAC,GAAG,EAAE,aAAa,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;IACxE,CAAC;IACD,OAAO,GAAG,CAAC,aAAa,CAAC;AAC3B,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAc;IAC1C;QACE,IAAI,EAAE,sBAAsB;QAC5B,OAAO,EAAE,QAAQ;QACjB,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M,OAAO,GAAG,MAAM,CACpB,IAAI,CAAC,YAAsB,EAC3B,EAAE,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EACzC,QAAQ,CAAC,GAAG,CAAC,CACd,CAAC;YACF,IAAI,CAAC;gBACH,IAAI,MAAM,KAAK,OAAO,EAAE,CAAC;oBACvB,OAAO,MAAM,IAAI,CAAC,gBAAiB,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,IAAc,EAAE,EAAE,WAAW,CAAC,CAAC;gBACrF,CAAC;gBACD,IAAI,MAAM,KAAK,eAAe,EAAE,CAAC;oBAC/B,OAAO,MAAM,IAAI,CAAC,qBAAsB,CACtC,EAAE,MAAM,EAAE,IAAI,EAAE,IAAc,EAAE,EAChC,WAAW,CACZ,CAAC;gBACJ,CAAC;gBACD,OAAO,MAAM,IAAI,CAAC,iBAAkB,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,WAAW,CAAC,CAAC;YAClF,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,OAAO,EAAE,CAAC;gBACV,MAAM,GAAG,CAAC;YACZ,CAAC;QACH,CAAC;KACF;CACF,CAAC"}
|
package/dist/core/tools/inbox.js
CHANGED
|
@@ -63,7 +63,9 @@ export const inboxTools = [
|
|
|
63
63
|
name: 'list_inbox_items',
|
|
64
64
|
binding: 'both',
|
|
65
65
|
title: 'List Inbox Items',
|
|
66
|
-
description: 'List the items of one inbox conversation — the comments and the replies sent to them — oldest first by default (order=DESC for newest first). Items carry direction (INBOUND | OUTBOUND), state (VISIBLE | HIDDEN | DELETED), author info, and on Instagram comments canPrivateReply (eligibility for
|
|
66
|
+
description: (_binding, gated) => 'List the items of one inbox conversation — the comments and the replies sent to them — oldest first by default (order=DESC for newest first). Items carry direction (INBOUND | OUTBOUND), state (VISIBLE | HIDDEN | DELETED), author info, and on Instagram comments canPrivateReply (eligibility for ' +
|
|
67
|
+
(gated ? 'a PRIVATE_REPLY through prepare_inbox_action' : 'send_inbox_private_reply') +
|
|
68
|
+
'). Replies sent from PostFast appear exactly once — no duplicates when the platform reports them back.',
|
|
67
69
|
inputSchema: {
|
|
68
70
|
conversationId: z
|
|
69
71
|
.uuid()
|
|
@@ -101,6 +103,7 @@ export const inboxTools = [
|
|
|
101
103
|
// destructive: publishes a public comment; Threads exposes no delete verb, so a
|
|
102
104
|
// reply there cannot be removed through our API.
|
|
103
105
|
annotations: { readOnlyHint: false, destructiveHint: true, openWorldHint: true },
|
|
106
|
+
hiddenWhenGated: true,
|
|
104
107
|
portMethod: 'replyToInboxItem',
|
|
105
108
|
run: (port, args, workspaceId) => port.replyToInboxItem(args, workspaceId),
|
|
106
109
|
},
|
|
@@ -118,6 +121,7 @@ export const inboxTools = [
|
|
|
118
121
|
// destructive: sends a real direct message with no unsend path, and the
|
|
119
122
|
// once-per-comment guard means the attempt cannot be repeated.
|
|
120
123
|
annotations: { readOnlyHint: false, destructiveHint: true, openWorldHint: true },
|
|
124
|
+
hiddenWhenGated: true,
|
|
121
125
|
portMethod: 'sendInboxPrivateReply',
|
|
122
126
|
run: (port, args, workspaceId) => port.sendInboxPrivateReply(args, workspaceId),
|
|
123
127
|
},
|
|
@@ -125,14 +129,26 @@ export const inboxTools = [
|
|
|
125
129
|
name: 'set_inbox_item_state',
|
|
126
130
|
binding: 'both',
|
|
127
131
|
title: 'Moderate Inbox Comment',
|
|
128
|
-
description:
|
|
129
|
-
|
|
132
|
+
description: (_binding, gated) => gated
|
|
133
|
+
? 'Hide a comment from the public on the platform (HIDE) or restore it (UNHIDE). Works on TikTok, Instagram, Facebook and Threads and can be reversed. To delete a comment permanently, use prepare_inbox_action with action DELETE. State changes made on the platform itself sync back to the inbox automatically.'
|
|
134
|
+
: 'Moderate a comment on the platform: HIDE hides it from the public, UNHIDE restores it, DELETE removes the comment on the platform — cannot be undone. HIDE/UNHIDE work on TikTok, Instagram, Facebook, and Threads; DELETE is not supported on Threads (inbox.deleteNotSupported). State changes made on the platform itself sync back to the inbox automatically.',
|
|
135
|
+
inputSchema: (_binding, gated) => ({
|
|
130
136
|
itemId: z.uuid().describe('The comment item id (from list_inbox_items)'),
|
|
131
|
-
action:
|
|
132
|
-
.enum(
|
|
133
|
-
|
|
134
|
-
|
|
137
|
+
action: gated
|
|
138
|
+
? z.enum(['HIDE', 'UNHIDE']).describe('HIDE or UNHIDE')
|
|
139
|
+
: z
|
|
140
|
+
.enum(INBOX_ITEM_STATE_ACTIONS)
|
|
141
|
+
.describe('HIDE, UNHIDE, or DELETE (DELETE is irreversible)'),
|
|
142
|
+
}),
|
|
135
143
|
annotations: { readOnlyHint: false, destructiveHint: true, openWorldHint: true },
|
|
144
|
+
// Gated, DELETE moves to prepare/confirm_inbox_action, leaving only
|
|
145
|
+
// reversible HIDE/UNHIDE here.
|
|
146
|
+
gatedAnnotations: {
|
|
147
|
+
readOnlyHint: false,
|
|
148
|
+
destructiveHint: false,
|
|
149
|
+
idempotentHint: true,
|
|
150
|
+
openWorldHint: true,
|
|
151
|
+
},
|
|
136
152
|
portMethod: 'setInboxItemState',
|
|
137
153
|
run: (port, args, workspaceId) => port.setInboxItemState(args, workspaceId),
|
|
138
154
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inbox.js","sourceRoot":"","sources":["../../../src/core/tools/inbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,OAAO,EACL,2BAA2B,EAC3B,wBAAwB,EACxB,SAAS,GACV,MAAM,cAAc,CAAC;AAGtB;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,UAAU,GAAc;IACnC;QACE,IAAI,EAAE,0BAA0B;QAChC,OAAO,EAAE,MAAM;QACf,KAAK,EAAE,0BAA0B;QACjC,WAAW,EACT,i2BAAi2B;QACn2B,WAAW,EAAE;YACX,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,C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Q,CAAC,iDAAiD,CAAC;YAC9D,cAAc,EAAE,CAAC;iBACd,IAAI,EAAE;iBACN,QAAQ,EAAE;iBACV,QAAQ,CAAC,uDAAuD,CAAC;SACrE;QACD,WAAW,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE;QAClF,UAAU,EAAE,yBAAyB;QACrC,GAAG,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,CAC/B,IAAI,CAAC,uBAAwB,CAC3B,IAA8C,EAC9C,WAAW,CACZ;KACJ;CACF,CAAC"}
|
package/dist/core/tools/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { accountTools } from './accounts.js';
|
|
2
|
+
import { inboxConfirmTools } from './inbox-confirm.js';
|
|
2
3
|
import { inboxTools } from './inbox.js';
|
|
3
4
|
import { postTools } from './posts.js';
|
|
4
5
|
import { tiktokTools } from './tiktok.js';
|
|
@@ -17,5 +18,6 @@ export const ALL_TOOLS = [
|
|
|
17
18
|
...uploadTools,
|
|
18
19
|
...inboxTools,
|
|
19
20
|
...tiktokTools,
|
|
21
|
+
...inboxConfirmTools,
|
|
20
22
|
];
|
|
21
23
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGjD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,SAAS,GAAc;IAClC,GAAG,SAAS;IACZ,GAAG,YAAY;IACf,GAAG,cAAc;IACjB,GAAG,WAAW;IACd,GAAG,UAAU;IACb,GAAG,WAAW;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGjD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,SAAS,GAAc;IAClC,GAAG,SAAS;IACZ,GAAG,YAAY;IACf,GAAG,cAAc;IACjB,GAAG,WAAW;IACd,GAAG,UAAU;IACb,GAAG,WAAW;IACd,GAAG,iBAAiB;CACrB,CAAC"}
|
package/dist/core/tools/posts.js
CHANGED
|
@@ -14,7 +14,7 @@ const mediaItemSchema = (binding) => z.object({
|
|
|
14
14
|
coverImageKey: z
|
|
15
15
|
.string()
|
|
16
16
|
.optional()
|
|
17
|
-
.describe('Media key of a custom cover/thumbnail for video posts. Supported on Instagram Reels, Facebook Reels, Pinterest video pins.'),
|
|
17
|
+
.describe('Media key of a custom cover/thumbnail for video posts. Supported on Instagram Reels, Facebook Reels, Pinterest video pins, and TikTok videos.'),
|
|
18
18
|
coverTimestamp: z
|
|
19
19
|
.string()
|
|
20
20
|
.optional()
|
|
@@ -25,7 +25,7 @@ const postItemSchema = (binding) => z.object({
|
|
|
25
25
|
firstComment: z
|
|
26
26
|
.string()
|
|
27
27
|
.optional()
|
|
28
|
-
.describe('First comment posted automatically after publishing. Supported on X, Instagram, Facebook, YouTube, Threads, and TikTok (TikTok: max 1,200 chars
|
|
28
|
+
.describe('First comment posted automatically after publishing. Supported on X, Instagram, Facebook, YouTube, Threads, and TikTok (TikTok: max 1,200 chars).'),
|
|
29
29
|
mediaItems: z
|
|
30
30
|
.array(mediaItemSchema(binding))
|
|
31
31
|
.optional()
|
|
@@ -51,7 +51,10 @@ const controlsSchema = z.object({
|
|
|
51
51
|
tiktokAllowStitch: z.boolean().optional(),
|
|
52
52
|
tiktokBrandOrganic: z.boolean().optional(),
|
|
53
53
|
tiktokBrandContent: z.boolean().optional(),
|
|
54
|
-
tiktokAutoAddMusic: z
|
|
54
|
+
tiktokAutoAddMusic: z
|
|
55
|
+
.boolean()
|
|
56
|
+
.optional()
|
|
57
|
+
.describe('Let TikTok add a recommended sound. Photo/carousel posts only (ignored on videos). Mutually exclusive with tiktokMusicSoundId (sending both is rejected).'),
|
|
55
58
|
tiktokIsAigc: z
|
|
56
59
|
.boolean()
|
|
57
60
|
.optional()
|
|
@@ -65,7 +68,7 @@ const controlsSchema = z.object({
|
|
|
65
68
|
.string()
|
|
66
69
|
.max(128)
|
|
67
70
|
.optional()
|
|
68
|
-
.describe(
|
|
71
|
+
.describe("Commercial Music Library sound id from list_tiktok_sounds. TikTok photo, carousel and video posts. On videos the track plays at 50% volume over the video's original audio at 50%, like the TikTok app; there are no volume or trim controls. Mutually exclusive with tiktokAutoAddMusic (sending both is rejected). Not applied when tiktokIsDraft is true. Omit for no sound."),
|
|
69
72
|
tiktokMusicSoundName: z
|
|
70
73
|
.string()
|
|
71
74
|
.max(256)
|
|
@@ -204,9 +207,12 @@ export const postTools = [
|
|
|
204
207
|
name: 'create_posts',
|
|
205
208
|
binding: 'both',
|
|
206
209
|
title: 'Create Posts',
|
|
207
|
-
description: (binding) =>
|
|
210
|
+
description: (binding, gated) => (gated
|
|
211
|
+
? 'Create social media posts (batch up to 15), held for approval: nothing publishes until approve_posts sets them to APPROVED.'
|
|
212
|
+
: 'Create and schedule social media posts (batch up to 15).') +
|
|
213
|
+
' Each post targets one social account (socialMediaId from list_accounts). SCHEDULED requires scheduledAt on every post; DRAFT must omit scheduledAt. Scheduling to a disconnected account (connectionStatus DISABLED in list_accounts) is rejected with HTTP 400 "socialMediaDisconnected" — pre-check connectionStatus before calling. Saving as DRAFT to a disconnected account is allowed. TikTok, Instagram, YouTube, Pinterest, and Google Business Profile require at least one media item EVEN FOR DRAFTS — attach media first (ask the user for an image/video, or generate+upload one, if none was provided). Attach media via the key returned by ' +
|
|
208
214
|
`${UPLOAD_TOOLS[binding]}.`,
|
|
209
|
-
inputSchema: (binding) => ({
|
|
215
|
+
inputSchema: (binding, gated) => ({
|
|
210
216
|
posts: jsonParse(z
|
|
211
217
|
.array(postItemSchema(binding))
|
|
212
218
|
.min(1)
|
|
@@ -216,25 +222,34 @@ export const postTools = [
|
|
|
216
222
|
.enum(CREATE_STATUSES)
|
|
217
223
|
.default('SCHEDULED')
|
|
218
224
|
.describe('Post status. SCHEDULED requires scheduledAt on every post.'),
|
|
219
|
-
approvalStatus:
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
225
|
+
approvalStatus: gated
|
|
226
|
+
? z
|
|
227
|
+
.enum(['PENDING_APPROVAL'])
|
|
228
|
+
.default('PENDING_APPROVAL')
|
|
229
|
+
.describe('Posts created here are always held for approval. Publish them with approve_posts after the user confirms.')
|
|
230
|
+
: z
|
|
231
|
+
.enum(CREATE_APPROVAL_STATUSES)
|
|
232
|
+
.default('APPROVED')
|
|
233
|
+
.describe('Approval workflow status'),
|
|
223
234
|
controls: jsonParse(controlsSchema
|
|
224
235
|
.optional()
|
|
225
236
|
.describe('Platform-specific controls (shared across all posts in the batch)')),
|
|
226
237
|
}),
|
|
227
238
|
// destructive: a SCHEDULED+APPROVED post (both defaults) publishes publicly and
|
|
228
239
|
// cannot be retracted through our API — delete_post removes our row, not the
|
|
229
|
-
// platform post.
|
|
240
|
+
// platform post. Gated, every post is created held, so the call only writes to
|
|
241
|
+
// PostFast (removable with delete_post); approve_posts is what publishes.
|
|
230
242
|
annotations: { readOnlyHint: false, destructiveHint: true, openWorldHint: true },
|
|
243
|
+
gatedAnnotations: { readOnlyHint: false, destructiveHint: false, openWorldHint: false },
|
|
231
244
|
run: (port, args, workspaceId) => port.createPosts(args, workspaceId),
|
|
232
245
|
},
|
|
233
246
|
{
|
|
234
247
|
name: 'approve_posts',
|
|
235
248
|
binding: 'remote',
|
|
236
249
|
title: 'Approve Posts',
|
|
237
|
-
description:
|
|
250
|
+
description: (_binding, gated) => gated
|
|
251
|
+
? 'Approve posts so they publish at their scheduled time. This is the only way a post created with create_posts goes out, so show the user exactly what will be posted, where and when, and call this only after they confirm. Can also set PENDING_APPROVAL, REJECTED or NEEDS_WORK. If its scheduled time passed more than 2 hours ago, create the post again with a new time instead of approving it, and delete the old one.'
|
|
252
|
+
: 'Set the approval status of one or more posts (approval workflow). Typically used to move posts to APPROVED so they can publish, or to PENDING_APPROVAL / REJECTED / NEEDS_WORK.',
|
|
238
253
|
inputSchema: {
|
|
239
254
|
postIds: z.array(z.uuid()).min(1).describe('Post ids to update'),
|
|
240
255
|
approvalStatus: z.enum(SET_APPROVAL_STATUSES).describe('New approval status'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"posts.js","sourceRoot":"","sources":["../../../src/core/tools/posts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,OAAO,EACL,wBAAwB,EACxB,eAAe,EACf,SAAS,EACT,aAAa,EACb,qBAAqB,EACrB,SAAS,GACV,MAAM,cAAc,CAAC;AAGtB,6EAA6E;AAC7E,MAAM,YAAY,GAA4B;IAC5C,KAAK,EAAE,gCAAgC;IACvC,MAAM,EAAE,gCAAgC;CACzC,CAAC;AAEF,MAAM,eAAe,GAAG,CAAC,OAAgB,EAAE,EAAE,CAC3C,CAAC,CAAC,MAAM,CAAC;IACP,GAAG,EAAE,CAAC;SACH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AAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,qBAAqB,CAAC;YAChF,cAAc,EAAE,CAAC;iBACd,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;iBACf,QAAQ,EAAE;iBACV,QAAQ,CAAC,6CAA6C,CAAC;SAC3D;QACD,2EAA2E;QAC3E,iCAAiC;QACjC,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE;QACjF,GAAG,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,CAC/B,IAAI,CAAC,gBAAgB,CAAC,IAAgC,EAAE,WAAW,CAAC;KACvE;CACF,CAAC"}
|
|
@@ -4,7 +4,7 @@ export const tiktokTools = [
|
|
|
4
4
|
name: 'list_tiktok_sounds',
|
|
5
5
|
binding: 'both',
|
|
6
6
|
title: 'List TikTok Sounds',
|
|
7
|
-
description: "List trending pre-cleared Commercial Music Library tracks for a connected TikTok account. Returns up to 100 trending sounds with musicSoundId, name, artist, duration, and preview/thumbnail URLs. Pass a musicSoundId to create_posts as tiktokMusicSoundId to attach that sound to a TikTok photo
|
|
7
|
+
description: "List trending pre-cleared Commercial Music Library tracks for a connected TikTok account. Returns up to 100 trending sounds with musicSoundId, name, artist, duration, and preview/thumbnail URLs. Pass a musicSoundId to create_posts as tiktokMusicSoundId to attach that sound to a TikTok photo, carousel or video post. genre takes raw TikTok values like 'POP', 'HIP_HOP/RAP', 'R&B/SOUL', 'K-POP' (invalid values return the full valid list in the error). The list rotates daily — fetch fresh rather than reusing old ids for display. An unknown countryCode returns an empty list. If the API returns tiktokMusic.requiresBusinessApi, the TikTok account needs a one-time reconnect.",
|
|
8
8
|
inputSchema: {
|
|
9
9
|
socialMediaId: z.uuid().describe('TikTok account id (from list_accounts)'),
|
|
10
10
|
genre: z
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tiktok.js","sourceRoot":"","sources":["../../../src/core/tools/tiktok.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,MAAM,CAAC,MAAM,WAAW,GAAc;IACpC;QACE,IAAI,EAAE,oBAAoB;QAC1B,OAAO,EAAE,MAAM;QACf,KAAK,EAAE,oBAAoB;QAC3B,WAAW,EACT,
|
|
1
|
+
{"version":3,"file":"tiktok.js","sourceRoot":"","sources":["../../../src/core/tools/tiktok.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,MAAM,CAAC,MAAM,WAAW,GAAc;IACpC;QACE,IAAI,EAAE,oBAAoB;QAC1B,OAAO,EAAE,MAAM;QACf,KAAK,EAAE,oBAAoB;QAC3B,WAAW,EACT,oqBAAoqB;QACtqB,WAAW,EAAE;YACX,aAAa,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,wCAAwC,CAAC;YAC1E,KAAK,EAAE,CAAC;iBACL,MAAM,EAAE;iBACR,QAAQ,EAAE;iBACV,QAAQ,CACP,yJAAyJ,CAC1J;YACH,WAAW,EAAE,CAAC;iBACX,MAAM,EAAE;iBACR,MAAM,CAAC,CAAC,CAAC;iBACT,QAAQ,EAAE;iBACV,QAAQ,CAAC,mFAAmF,CAAC;YAChG,SAAS,EAAE,CAAC;iBACT,IAAI,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;iBACxC,QAAQ,EAAE;iBACV,QAAQ,CAAC,gCAAgC,CAAC;SAC9C;QACD,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE;QAChF,UAAU,EAAE,kBAAkB;QAC9B,GAAG,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,CAC/B,IAAI,CAAC,gBAAiB,CAAC,IAAuC,EAAE,WAAW,CAAC;KAC/E;CACF,CAAC"}
|
|
@@ -45,7 +45,11 @@ export const uploadTools = [
|
|
|
45
45
|
name: 'upload_from_url',
|
|
46
46
|
binding: 'remote',
|
|
47
47
|
title: 'Upload Media From URL',
|
|
48
|
-
description: 'Fetch media from a public https URL and store it for use in create_posts. Returns { media_id, type }; pass media_id as a mediaItems[].key.
|
|
48
|
+
description: (_binding, gated) => 'Fetch media from a public https URL and store it for use in create_posts. Returns { media_id, type }; pass media_id as a mediaItems[].key. ' +
|
|
49
|
+
(gated
|
|
50
|
+
? 'Use this when the media is already at a public https URL, such as a CDN or hosted image.'
|
|
51
|
+
: 'Ideal for ChatGPT/Claude-generated image URLs and remote CDN media.') +
|
|
52
|
+
' Redirects are followed (each hop is SSRF-validated); the URL must be public https and within the size limit. Supported types: image/jpeg, image/png, image/gif, image/webp, video/mp4, video/webm, video/quicktime.',
|
|
49
53
|
inputSchema: {
|
|
50
54
|
sourceUrl: z.url().describe('Public https URL of the media to upload'),
|
|
51
55
|
contentType: z
|
|
@@ -60,8 +64,10 @@ export const uploadTools = [
|
|
|
60
64
|
name: 'upload_media',
|
|
61
65
|
binding: 'remote',
|
|
62
66
|
title: 'Upload Media',
|
|
63
|
-
description:
|
|
64
|
-
|
|
67
|
+
description: (_binding, gated) => gated
|
|
68
|
+
? "Upload an image or video for use in create_posts. If the media is already at a public https URL, use upload_from_url instead. Otherwise pass the file as base64 bytes in `data` with its MIME type in `contentType`. If you cannot read the file's bytes, ask the user for a public https link and use upload_from_url. Clients that attach files natively may supply `file` instead. Returns { media_id, type }; use media_id as a mediaItems[].key. Supported types: image/jpeg, image/png, image/gif, image/webp, video/mp4, video/webm, video/quicktime."
|
|
69
|
+
: 'Upload an image/video that is present in this conversation, for use in create_posts. Pass EITHER a ChatGPT-attached or model-generated file (the `file` argument — ChatGPT fills this automatically) OR base64 bytes (`data` + `contentType`). Returns { media_id, type }; use media_id as a mediaItems[].key. For large or remote media, prefer upload_from_url. Supported types: image/jpeg, image/png, image/gif, image/webp, video/mp4, video/webm, video/quicktime.',
|
|
70
|
+
inputSchema: (_binding, gated) => ({
|
|
65
71
|
file: z
|
|
66
72
|
.object({
|
|
67
73
|
download_url: z.url().describe('Temporary URL to fetch the file'),
|
|
@@ -70,7 +76,9 @@ export const uploadTools = [
|
|
|
70
76
|
file_name: z.string().optional(),
|
|
71
77
|
})
|
|
72
78
|
.optional()
|
|
73
|
-
.describe(
|
|
79
|
+
.describe(gated
|
|
80
|
+
? 'A file supplied natively by the client, for clients that support attaching files to tool calls. If yours does not, leave this empty and use data + contentType.'
|
|
81
|
+
: 'A ChatGPT-provided file (attached or generated). Filled in automatically by ChatGPT.'),
|
|
74
82
|
data: z
|
|
75
83
|
.string()
|
|
76
84
|
.optional()
|
|
@@ -79,7 +87,7 @@ export const uploadTools = [
|
|
|
79
87
|
.string()
|
|
80
88
|
.optional()
|
|
81
89
|
.describe('MIME type for base64 data (e.g. image/png). Required with data.'),
|
|
82
|
-
},
|
|
90
|
+
}),
|
|
83
91
|
annotations: { readOnlyHint: false, destructiveHint: false, openWorldHint: true },
|
|
84
92
|
_meta: { 'openai/fileParams': ['file'] },
|
|
85
93
|
run: (port, args, workspaceId) => port.uploadMedia(args, workspaceId),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uploads.js","sourceRoot":"","sources":["../../../src/core/tools/uploads.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAGlE,MAAM,oBAAoB,GAAG,CAAC,GAAG,gBAAgB,EAAE,GAAG,gBAAgB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEnF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,WAAW,GAAc;IACpC;QACE,IAAI,EAAE,iBAAiB;QACvB,OAAO,EAAE,OAAO;QAChB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EAAE;aACjC,CAAC;iBACD,QAAQ,EAAE;iBACV,QAAQ,CACP,KAAK;gBACH,CAAC,CAAC,iKAAiK;gBACnK,CAAC,CAAC,sFAAsF,CAC3F;YACH,IAAI,EAAE,CAAC;iBACJ,MAAM,EAAE;iBACR,QAAQ,EAAE;iBACV,QAAQ,CAAC,kEAAkE,CAAC;YAC/E,WAAW,EAAE,CAAC;iBACX,MAAM,EAAE;iBACR,QAAQ,EAAE;iBACV,QAAQ,CAAC,iEAAiE,CAAC;SAC/E,CAAC;QACF,WAAW,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE;QACjF,KAAK,EAAE,EAAE,mBAAmB,EAAE,CAAC,MAAM,CAAC,EAAE;QACxC,GAAG,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,CAC/B,IAAI,CAAC,WAAW,CAAC,IAAkC,EAAE,WAAW,CAAC;KACpE;CACF,CAAC"}
|
package/dist/stdio/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { instructionsFor } from '../core/instructions.js';
|
|
|
6
6
|
import { RestAdapter } from './rest-adapter.js';
|
|
7
7
|
const server = new McpServer({
|
|
8
8
|
name: 'postfast',
|
|
9
|
-
version: '0.
|
|
9
|
+
version: '0.7.0',
|
|
10
10
|
}, { instructions: instructionsFor('stdio') });
|
|
11
11
|
const port = new RestAdapter();
|
|
12
12
|
registerCatalogTools(server, { binding: 'stdio', port });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "postfast-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"mcpName": "io.github.peturgeorgievv-factory/postfast-mcp",
|
|
5
5
|
"description": "MCP server for the PostFast API — schedule and manage social media posts via AI tools",
|
|
6
6
|
"type": "module",
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"build": "tsc",
|
|
29
29
|
"dev": "tsc --watch",
|
|
30
30
|
"start": "node dist/stdio/index.js",
|
|
31
|
+
"test": "npm run build && node --test test/*.test.mjs",
|
|
31
32
|
"version": "changeset version && node scripts/stamp-versions.mjs",
|
|
32
33
|
"prepublishOnly": "npm run build"
|
|
33
34
|
},
|
|
@@ -28,7 +28,7 @@ If any PostFast tool call fails with an authentication/401 error, tell the user:
|
|
|
28
28
|
- `scheduledAt`: ISO 8601 datetime (required unless status is DRAFT)
|
|
29
29
|
- `mediaItems`: array of `{key, type, sortOrder}` from uploaded media
|
|
30
30
|
- `status`: SCHEDULED (default) or DRAFT
|
|
31
|
-
- `firstComment`: optional first comment text, posted automatically after publishing (supported on X, Instagram, Facebook, YouTube, Threads, and TikTok — TikTok: max 1,200 chars
|
|
31
|
+
- `firstComment`: optional first comment text, posted automatically after publishing (supported on X, Instagram, Facebook, YouTube, Threads, and TikTok — TikTok: max 1,200 chars)
|
|
32
32
|
- `controls`: platform-specific settings (see below)
|
|
33
33
|
- You can batch up to 15 posts in a single call — great for content calendars
|
|
34
34
|
- Don't schedule to a `DISABLED` account — the API rejects it with HTTP 400 `socialMediaDisconnected`. Saving as DRAFT is still allowed. Check `connectionStatus` from step 1 first.
|
|
@@ -62,10 +62,10 @@ If any PostFast tool call fails with an authentication/401 error, tell the user:
|
|
|
62
62
|
- `tiktokAllowStitch`: boolean, default true
|
|
63
63
|
- `tiktokBrandOrganic`: boolean, default false
|
|
64
64
|
- `tiktokBrandContent`: boolean, default false
|
|
65
|
-
- `tiktokAutoAddMusic`: boolean, default false
|
|
65
|
+
- `tiktokAutoAddMusic`: boolean, default false (let TikTok add a recommended sound — photo/carousel posts only, ignored on videos; mutually exclusive with `tiktokMusicSoundId`)
|
|
66
66
|
- `tiktokIsAigc`: boolean, default false (declare the post as AI-generated content — videos and photo posts)
|
|
67
67
|
- `tiktokTitle`: title for photo posts (max 90 chars; photo posts only) — when set, the full content becomes the description; without it, content auto-splits on the first newline into title + description
|
|
68
|
-
- `tiktokMusicSoundId` + `tiktokMusicSoundName`: attach a pre-cleared Commercial Music Library sound to a photo
|
|
68
|
+
- `tiktokMusicSoundId` + `tiktokMusicSoundName`: attach a pre-cleared Commercial Music Library sound to a photo, carousel or video post — find sounds with `list_tiktok_sounds` (the list rotates daily). On video the sound plays at 50% volume over the video's original audio at 50%, like the TikTok app; there are no volume or trim controls. Mutually exclusive with `tiktokAutoAddMusic`; not applied when `tiktokIsDraft` is true. Always set the name alongside the id
|
|
69
69
|
|
|
70
70
|
### YouTube
|
|
71
71
|
- `youtubeTitle`: defaults to first 100 chars of content
|