Channel Publish channel-publish
Publish content to the user's bound Channel Accounts, schedule or change Publish At, cancel an unfinished Publish Task, or update already published content.
Use it when the user wants to post, schedule, cancel, or update social content on a connected platform.
- Our test
- —
- not tested yet
- GitHub stars
- 29k
- yikart/aitoearn
- Added by
- 0
- members
- Updated
- Dec 6
- commit 5c32758
- Content
- 1 file
- no scripts · 9 KB
- License
- MIT
- free to use
What our test found
Not tested yet. Our model tries every skill on a realistic request and scores the result, the most popular skills first. Until then, the safety checks on the right still apply.
name: channel-publish description: Publish content to the user's bound Channel Accounts, schedule or change Publish At, cancel an unfinished Publish Task, or update already published content. Use when the user wants to post, schedule, cancel, or update social content on a connected platform. allowed-tools: - list_channel_accounts - list_channel_platforms - get_channel_platform - get_channel_publish_record
Channel Publish
Publish through Channel Accounts. Limits come from get_channel_platform, not from this file.
Environment
Some domestic platforms are not available on this edition — treat list_channel_platforms as the source of truth and never promise an unlisted platform. When the user asks to publish to a platform that is not listed, say it is not supported here and guide them to the domestic edition.
Tools
list_channel_accounts/get_channel_account: find the target account and its current status before server-side publishing.list_channel_platforms: check which platforms support server-side publishing and discover their assembled tool IDs.get_channel_platform: read the platform rules and available modes before preparing content. An instruction to use a browser extension means server-side publishing is unavailable for that platform.list_channel_publish_records/get_channel_publish_record: inspect flows and tasks. UseflowId/taskIdto getChannelPublishRecord.id(recordId)when you need arecordId.extract_video_frame: extract a single frame from a video (videoUrl, optionaltimeInSeconds, default 2s) and upload it as a cover image. Returns{ coverUrl }. Use it before plugin publish when the platform requires a cover for video content (e.g. xhs video notes,coverRequired); you may pass the returnedcoverUrltogenerate_imageas a reference to design a styled cover first.probe_video_metadata/probe_audio_metadata/probe_image_metadata(auxiliary): probe a media URL's duration / resolution / size to pre-check material against theget_channel_platformlimits before creating a publish flow — fewersuccess:falsevalidation round-trips. Each probe is billed per call; video/audio probes are async, so wait for the result and do not probe the same URL twice.get_channel_publish_user_action: DouyinWaitingForUserActiononly. Input isrecordIdonly — resolve it viaget_channel_publish_record { flowId | taskId }first. Output containsshareId/schemeUrl/shortLink/expiresAt/qrImageUrl(httpUrl);qrImageUrlis an httpUrl produced by agent-sideqrcode+AssetsService.uploadFromBuffer, frontend renders it. Do NOT use rawqrText.publish_channel_task_now/update_channel_publish_at/cancel_channel_publish_task/request_channel_publish_update: task commands. Search them when needed.
Do not invent platform limits. Do not dump option schema into the user reply.
Publish modes
- Platforms with publish modes (e.g. Facebook, Instagram) expose one create tool per mode:
create_{slug}_{mode}_publish_flow(e.g.create_facebook_post_publish_flow/create_facebook_reel_publish_flow/create_facebook_story_publish_flow). The mode option field (e.g.content_category) is filled by the tool automatically — never pass it yourself. - Pick the tool that matches the media type: video content → the video/reel mode tool; image or text content → the post/image mode tool.
get_channel_platformlists each mode's limits and create tool id under## 发布模式/## 工具. - If a create tool fails with a validation error indicating the media type does not match the publish mode, retry with the matching publish mode's create tool (corrected-parameter retries are fine; unchanged retries are not).
AI content label
When publishing AI-generated media, default to declaring it via the platform's AI label option; omit it only when the user explicitly says not to label it. It is an optional option field on the create tool: is_ai_generated (Facebook, reel mode only), is_aigc (TikTok), made_with_ai (Twitter), containsSyntheticMedia (YouTube). Platforms or modes without such a field simply do not send one.
Topics and body
create_*_publish_flowtools have no `topics` field. Topics are carried only as#hashtaginsidebody. Server extracts them via/#([\w\p{Script=Han}]+)/gu(parseTopicsFromBody) and fornativeField:trueplatforms strips them from body (stripTopicsFromBody) into the native topic field.- When
get_channel_platformshows## 话题as “支持话题”: if the user gave topics (list or “带上 #AI”), normalize each to#+ trimmed non-empty tag, dedupe, and insert into `body` as `#hashtag` (e.g.正文 #AI #旅行or inline within the body). If no topics were given, do not invent any. RespectmaxCount/maxTotalLength— truncate or ask the user to choose.request_channel_publish_updatefollows the same rule. - When
## 话题says “不要带话题”: do not insert hashtags. If the user insists, warn and strip them.
Defaults — do not interrogate the user
Complete a publish request in the same turn; never ask the user to supply copy or optional settings first:
- Write
titleandbodyyourself based on the content being published — never ask the user for copy. - Do not ask about optional settings: omit
publishAtto publish immediately, default originality/AI-label flags per the sections above (e.g.postFlag/originalStatementunchecked unless the user asks), and skip optional decorations. - Produce required fields yourself — when a cover is required, call
extract_video_frame(optionally restyle the frame viagenerate_image) instead of asking the user for a URL. - Ask only when a decision truly blocks the call: which account to use among several usable ones (Workflow step 1), or the media to publish is missing entirely.
Validation failures and unsupported platforms
- If the tool rejects the input, read its validation details and correct the indicated field or publish mode. If the response is ambiguous or the request times out, check publish records before submitting again.
- For an offline account or authorization error, ask the user to reauthorize the affected account in AiToEarn 「我的频道」. A frontend guidance tool may be used if the current connector lists it.
- If platform metadata requires a browser extension, provide the prepared content and media URLs and tell the user which extension workflow the platform specifies. Mark the status as awaiting user action. Browser automation is never a fallback for a failed server-side request.
Douyin WaitingForUserAction — two-step query and QR
Douyin uses CompletionStrategy.UserHandoff. After publish, a task may enter WaitingForUserAction. You must do a two-step query:
get_channel_publish_recordwith{ flowId }(or{ taskId }) from theChannelPublishFlowresult to obtainChannelPublishRecord.idasrecordId. The publish tools returnflowId+tasks[].id(taskId)only —recordIdis not returned directly.get_channel_publish_user_action { recordId }to fetchschemeUrl/shortLink/expiresAt/qrImageUrl. The QR image is generated and uploaded agent-side (qrcode+AssetsService.uploadFromBuffer→qrImageUrlhttpUrl) for frontend rendering. Never render rawqrText.
After step 2, echo the QR URL in the conversation as clickable shortLink + schemeUrl text plus expiresAt, and let frontend render qrImageUrl. Tell the user to scan with the Douyin App or tap the link before expiry. Continue polling get_channel_publish_record until Published / Failed.
Workflow
- Read
get_channel_platformfor the requested platform. Prepare the requested title, body, media, cover, topics and mode according to its rules. - For a platform that requires a browser extension, prepare the content and any required cover, then follow the handoff above.
- For server-side publishing, use
list_channel_accountsto find usable accounts. If none are usable, guide the user to reauthorize. If multiple are usable and the target is ambiguous, ask which to use. - Find the platform's actual create flow and option tools in the current connection. Resolve required fields using the current tool schemas, then create the flow for the authorized target and mode.
- Use
get_channel_publish_recordto verify status. For DouyinWaitingForUserAction, useget_channel_publish_user_actionwith the resolved record ID, surface the returned QR/link and expiry, and keep the status pending until the record confirms completion. - Use the relevant task tool for immediate publication, rescheduling, cancellation or supported updates.
Failed or canceled Publish Tasks are not retried. Create a new Publish Flow to publish again.