ugcinc 4.27.0 → 5.0.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 +56 -12
- package/dist/automations/nodes/create-dm.d.ts +3 -0
- package/dist/automations/nodes/create-dm.js +31 -18
- package/dist/cli.js +1 -1
- package/dist/content-skills.js +4 -3
- package/dist/imessage-conversation.d.ts +33 -0
- package/dist/imessage-conversation.js +16 -4
- package/dist/imessage-workflow.d.ts +35 -0
- package/dist/imessage-workflow.js +77 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.js +7 -4
- package/dist/render/Root.js +1 -38
- package/dist/render/compositions/index.d.ts +0 -1
- package/dist/render/compositions/index.js +1 -5
- package/dist/render.d.ts +0 -39
- package/dist/render.js +0 -63
- package/dist/skills.js +1 -1
- package/dist/tools/imessage.d.ts +2 -0
- package/dist/tools/imessage.js +12 -0
- package/dist/tools/index.js +2 -0
- package/package.json +1 -1
- package/skills/content-automation/SKILL.md +4 -0
- package/skills/imessage/SKILL.md +101 -0
- package/skills/media/SKILL.md +4 -0
- package/dist/render/compositions/IMessageDmComposition/convertPropsToElements.d.ts +0 -27
- package/dist/render/compositions/IMessageDmComposition/convertPropsToElements.js +0 -629
- package/dist/render/compositions/IMessageDmComposition/index.d.ts +0 -21
- package/dist/render/compositions/IMessageDmComposition/index.js +0 -504
- package/dist/render/compositions/IMessageDmComposition/types.d.ts +0 -767
- package/dist/render/compositions/IMessageDmComposition/types.js +0 -228
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.iMessageWorkflowOutput = iMessageWorkflowOutput;
|
|
4
|
+
exports.legacyIMessageIssues = legacyIMessageIssues;
|
|
5
|
+
exports.prepareIMessageWorkflow = prepareIMessageWorkflow;
|
|
6
|
+
const zod_1 = require("zod");
|
|
7
|
+
const imessage_conversation_1 = require("./imessage-conversation");
|
|
8
|
+
function iMessageWorkflowOutput(config) {
|
|
9
|
+
return config.imessageOutputType ?? (config.imessageRenderMode === 'conversation'
|
|
10
|
+
? config.imessageConversation?.output?.kind === 'png' ? 'image' : 'video' : 'image');
|
|
11
|
+
}
|
|
12
|
+
function legacyIMessageIssues(config) {
|
|
13
|
+
const errors = [];
|
|
14
|
+
if (config.dynamicCrop)
|
|
15
|
+
errors.push('Native iMessage does not support message-based dynamic cropping. Remove it and crop the native output in a composer.');
|
|
16
|
+
if (config.imessageSenderBubbleColor)
|
|
17
|
+
errors.push('Native iMessage uses the native bubble colors. Remove the custom sender bubble color.');
|
|
18
|
+
return errors;
|
|
19
|
+
}
|
|
20
|
+
const oldMessages = zod_1.z.array(zod_1.z.object({ sender: zod_1.z.enum(['user', 'recipient']), text: zod_1.z.string(), hasImage: zod_1.z.boolean().optional() })).min(1).max(30);
|
|
21
|
+
/** Resolve saved screenshot fields and current workflow inputs without moving connections. */
|
|
22
|
+
function prepareIMessageWorkflow(config, inputs = {}) {
|
|
23
|
+
const issues = legacyIMessageIssues(config);
|
|
24
|
+
if (issues.length)
|
|
25
|
+
throw new Error(issues.join('\n'));
|
|
26
|
+
const kind = iMessageWorkflowOutput(config);
|
|
27
|
+
let conversation;
|
|
28
|
+
if (config.imessageRenderMode === 'conversation' && !config.imessageLegacyInputs) {
|
|
29
|
+
const value = config.imessageConversationInputType === 'variable' ? inputs.conversation : config.imessageConversation;
|
|
30
|
+
if (!value)
|
|
31
|
+
throw new Error('Provide conversation settings or connect the conversation input.');
|
|
32
|
+
const requested = value.output?.kind === 'png' ? 'image' : 'video';
|
|
33
|
+
if (config.imessageConversationInputType === 'variable' && value.output && requested !== kind)
|
|
34
|
+
throw new Error(`Conversation output is ${requested}, but this node is configured for ${kind}. Change the node output selector or the input.`);
|
|
35
|
+
conversation = { ...value };
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
const messages = oldMessages.parse(config.messagesInputType === 'variable' ? inputs.messages : config.messages);
|
|
39
|
+
const name = config.usernameInputType === 'variable' ? inputs.username : config.username;
|
|
40
|
+
const time = config.timeInputType === 'variable' ? inputs.time : config.time;
|
|
41
|
+
const unread = config.imessageUnreadBadgeInputType === 'variable' ? inputs['unread-badge'] : config.imessageUnreadBadgeText;
|
|
42
|
+
const rawReceipt = config.imessageReadReceiptTimeInputType === 'variable' ? inputs['read-receipt-time'] : config.imessageReadReceiptText;
|
|
43
|
+
if (config.imessageShowReadReceipt && rawReceipt)
|
|
44
|
+
throw new Error('Legacy free-text read receipts need a native readAt timestamp. Convert the receipt in the native conversation editor.');
|
|
45
|
+
const light = config.lightModeInputType === 'variable' ? inputs['light-mode'] : config.lightMode;
|
|
46
|
+
const attachment = config.imageAttachmentInputType === 'variable' ? inputs['image-attachment']?.url : config.imageAttachmentUrl;
|
|
47
|
+
const header = config.imessageMessageHeaderTimeInputType === 'variable' ? inputs['message-header-time'] : config.imessageMessageHeaderTimestampText;
|
|
48
|
+
conversation = {
|
|
49
|
+
...config.imessageConversation,
|
|
50
|
+
contact: { name: name ?? 'Contact' }, theme: light ? 'light' : 'dark', statusBar: { time: time ?? '9:41' },
|
|
51
|
+
unreadCount: unread === undefined || unread === '' ? 0 : Number(unread),
|
|
52
|
+
timestampText: header ? config.imessageMessageHeaderTimeInputType === 'variable' ? `Today ${header}` : header : undefined,
|
|
53
|
+
messages: messages.map((message, index) => {
|
|
54
|
+
if (message.hasImage && !attachment)
|
|
55
|
+
throw new Error(`Message ${index + 1} needs a connected attachment image.`);
|
|
56
|
+
return message.hasImage
|
|
57
|
+
? { id: `message-${index + 1}`, sender: message.sender, imageUrl: attachment, initial: kind === 'image' }
|
|
58
|
+
: { id: `message-${index + 1}`, sender: message.sender, text: message.text, initial: kind === 'image' };
|
|
59
|
+
}),
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
const avatar = config.profilePicInputType === 'variable' ? inputs['profile-pic']?.url : config.imessageRenderMode === 'conversation' ? undefined : config.profilePicUrl;
|
|
63
|
+
if (avatar && conversation.contact)
|
|
64
|
+
conversation.contact = { ...conversation.contact, avatarPngBase64: undefined, avatarUrl: avatar };
|
|
65
|
+
const attachmentUrl = config.imageAttachmentInputType === 'variable' ? inputs['image-attachment']?.url : undefined;
|
|
66
|
+
if (attachmentUrl && config.imessageAttachmentMessageId) {
|
|
67
|
+
const target = config.imessageAttachmentMessageId;
|
|
68
|
+
if (!conversation.messages.some((m, i) => (m.id ?? `message-${i + 1}`) === target))
|
|
69
|
+
throw new Error('Attachment target must identify an existing message.');
|
|
70
|
+
conversation.messages = conversation.messages.map((m, i) => (m.id ?? `message-${i + 1}`) === target
|
|
71
|
+
? { ...m, text: undefined, imagePngBase64: undefined, imageUrl: attachmentUrl } : m);
|
|
72
|
+
}
|
|
73
|
+
conversation.output = kind === 'image'
|
|
74
|
+
? { kind: 'png', ...(conversation.output?.kind === 'png' ? { atMs: conversation.output.atMs } : {}) } : { kind: 'video' };
|
|
75
|
+
(0, imessage_conversation_1.compileIMessageConversation)(conversation);
|
|
76
|
+
return conversation;
|
|
77
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export { CommentsClient } from './comments';
|
|
|
15
15
|
export { BillingClient } from './billing';
|
|
16
16
|
export { iMessageConversationSchema, compileIMessageConversation, iMessageConversationJobSchema } from './imessage-conversation';
|
|
17
17
|
export type { IMessageConversationInput, IMessageConversationSettings, IMessageTiming, IMessageConversationEvent, IMessageConversationPlan, IMessageConversationJob } from './imessage-conversation';
|
|
18
|
-
export { submitImageRenderJob, submitVideoRenderJob, getRenderJobStatus, submitDeduplicationJob, submitSceneSplitJob, submitScreenshotAnimationRenderJob, submitRemotionCompositionRenderJob, submitNativeTextStickerRenderJob, nativeTextStickerSchema, submitAutoCaptionRenderJob, submitInstagramDmRenderJob,
|
|
18
|
+
export { submitImageRenderJob, submitVideoRenderJob, getRenderJobStatus, submitDeduplicationJob, submitSceneSplitJob, submitScreenshotAnimationRenderJob, submitRemotionCompositionRenderJob, submitNativeTextStickerRenderJob, nativeTextStickerSchema, submitAutoCaptionRenderJob, submitInstagramDmRenderJob, } from './render';
|
|
19
19
|
export { remotionCompositionSchema, remotionCompositionNodeSchema, remotionCompositionPortSchema, REMOTION_COMPOSITION_IMPORTS, parseRemotionPropsJson } from './render/types/remotion-composition';
|
|
20
20
|
export type { RemotionCompositionInput } from './render/types/remotion-composition';
|
|
21
21
|
export type { RemotionCompositionNodeConfig } from './automations/nodes/remotion-composition';
|
|
@@ -38,7 +38,7 @@ export type { Org, ApiKey, DeleteApiKeyParams, EditApiKeyParams, IntegrationKey,
|
|
|
38
38
|
export type { UserMedia, MediaUse, SocialAudio, Media, GetMediaParams, GetSocialAudioParams, UploadMediaParams, UploadMediaResponse, MediaTagUpdate, UpdateMediaTagsParams, MediaTagUpdateResult, UpdateMediaTagsResponse, UpdateMediaTagParams, UpdateMediaNameParams, DeleteMediaParams, DeleteMediaResponse, CreateSocialAudioParams, ImportTextParams, ImportTextResponse, CreateMediaFromUrlParams, GetMediaUseParams, GetMediaUseResponse, FilterMediaParams, FilterMediaResponse, PfpSearchParams, PfpSearchResponse, PfpCandidate, ImageSearchParams, ImageSearchResult, ImageSearchResponse, ImageSearchVideoFormat, } from './media';
|
|
39
39
|
export type { CommentStatus, Comment, CreateCommentParams, CreateCommentResponse, GetCommentsParams, } from './comments';
|
|
40
40
|
export type { BillingInfo, PortalUrlResponse, CancelAccountParams, CancelAccountResponse, ReactivateAccountParams, ReactivateAccountResponse, CancelSubscriptionResponse, RequestReplacementParams, RequestReplacementResponse, RequestRefundParams, RequestRefundResponse, BillingRequestInfo, PortalParams, } from './billing';
|
|
41
|
-
export type { RenderJobResponse, RenderJobStatus, SubmitImageRenderJobParams, NativeTextStickerInput, SubmitVideoRenderJobParams, SubmitScreenshotAnimationRenderJobParams, SubmitAutoCaptionRenderJobParams, SubmitSceneSplitJobParams, SceneSplitDetectorConfig, SubmitInstagramDmRenderJobParams,
|
|
41
|
+
export type { RenderJobResponse, RenderJobStatus, SubmitImageRenderJobParams, NativeTextStickerInput, SubmitVideoRenderJobParams, SubmitScreenshotAnimationRenderJobParams, SubmitAutoCaptionRenderJobParams, SubmitSceneSplitJobParams, SceneSplitDetectorConfig, SubmitInstagramDmRenderJobParams, IgDmMessage, RenderVideoEditorConfig, } from './render';
|
|
42
42
|
export type { VideoEditorNodeConfig, VideoEditorChannel, VideoEditorSegment, VideoEditorVideoSegment, VideoEditorAudioSegment, VideoEditorImageSegment, VideoEditorTextSegment, VideoEditorImageSequenceSegment, VideoEditorVideoSequenceSegment, TimeValue, TimeMode, SegmentTimelinePosition, DeduplicationLevel, DeduplicationInput, ImageEditorElement, DimensionPresetKey, } from './render/types';
|
|
43
43
|
export type { ImageEditorNodeConfig, ImageComposerNodeConfig, ImageComposerRenderInput } from './automations/nodes/image-composer';
|
|
44
44
|
export { prepareImageComposerInput } from './automations/nodes/image-composer';
|
|
@@ -90,3 +90,4 @@ export type { PublicPostFailureCode, PublicPostRecovery, PublicPostNextAction, P
|
|
|
90
90
|
export type { ListProfilePostsParams, ListProfilePostsResult, DownloadSocialPostParams, DownloadSocialPostResult, SocialReferencePost, SocialReferenceAsset } from './social-acquisition';
|
|
91
91
|
export type { MatchTextStyleParams, MatchTextStyleResult, SampleColorsParams, MeasureLayoutParams, SampleColorsResult, MeasureLayoutResult, TranscribeAudioParams, MeasureAudioLevelsParams, AudioTranscriptResult, AudioLevelsResult, ReadImageTextParams, ReadVideoTextParams, ImageTextResult, VideoTextResult, ExtractFramesParams, DetectScenesParams, FramesResult, ScenesResult, MediaAnalysisResult, MediaAnalysisJob } from "./media-analysis";
|
|
92
92
|
export { matchTextStyleSchema, matchTextStyleResultSchema, sampleColorsSchema, measureLayoutSchema, sampleColorsResultSchema, measureLayoutResultSchema, binaryMaskSchema, transcribeAudioSchema, measureAudioLevelsSchema, audioTranscriptResultSchema, audioLevelsResultSchema, readImageTextSchema, readVideoTextSchema, imageTextResultSchema, videoTextResultSchema, extractFramesSchema, detectScenesSchema, mediaAnalysisStatusSchema, mediaAnalysisResultSchema } from "./media-analysis";
|
|
93
|
+
export { iMessageWorkflowOutput, legacyIMessageIssues, prepareIMessageWorkflow } from './imessage-workflow';
|
package/dist/index.js
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
* Official TypeScript/JavaScript client for the UGC Inc API
|
|
6
6
|
*/
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.getNodesDownstreamOfSet = exports.getDownstreamNodes = exports.checkCrossContextViolation = exports.getForEachContext = exports.getConnectedSource = exports.cleanupStaleConnections = exports.removeNodeConnections = exports.removeConnection = exports.addConnection = exports.deriveConnections = exports.createNode = exports.getOutputSchema = exports.getNodeByType = exports.getAllNodes = exports.getInputPreviewValue = exports.computeAllNodePortsWithPreviews = exports.computeAllNodePorts = exports.computePortsWithPreviews = exports.computePortsForNode = exports.areTypesCompatible = exports.parseRemotionPropsJson = exports.REMOTION_COMPOSITION_IMPORTS = exports.remotionCompositionPortSchema = exports.remotionCompositionNodeSchema = exports.remotionCompositionSchema = exports.
|
|
9
|
-
exports.prepareImageComposerInput = exports.substituteVariables = exports.processTemplate = exports.extractTemplateVariables = exports.PortIdSchema = exports.normalizeToPortId = exports.portIdToTitle = exports.isValidPortId = exports.portId = exports.selectFromPool = exports.getModelDurations = exports.getModelAspectRatios = exports.ALL_VIDEO_MODELS = exports.getAvailableInputModes = exports.hasReferenceVariant = exports.getReferenceModelId = exports.hasFirstLastFrameVariant = exports.getFirstLastFrameModelId = exports.hasImageToVideoVariant = exports.getImageToVideoModelId = exports.isImageToVideoModel = exports.IMAGE_ASPECT_RATIOS = exports.ALL_IMAGE_MODELS = exports.getEditModelId = exports.isEditModel = exports.getCapturedSourceNodeTypes = exports.getFlowControlNodeTypes = exports.getAllNodeDefinitions = exports.getNodeDefinition = exports.isPortType = exports.formatPortType = exports.isAsyncExecutor = exports.internalNodeTypes = exports.nodeDefinitions = exports.extractWorkflowConfig = exports.generateNodeName = exports.shuffleNodePreview = exports.getPreviewValue = exports.removePreviewForConnection = exports.updatePreviewMapForConnection = exports.computePreviewMap = exports.computeAllNodePreviews = exports.resolveNodePreview = exports.getWorkflowOutputSchema = exports.hasMissingTerminalError = exports.hasMissingTriggerError = exports.getPortErrorsForNode = exports.getErrorNodeIds = exports.validateWorkflow =
|
|
10
|
-
exports.mediaAnalysisResultSchema = exports.mediaAnalysisStatusSchema = exports.detectScenesSchema = exports.extractFramesSchema = exports.videoTextResultSchema = exports.imageTextResultSchema = exports.readVideoTextSchema = exports.readImageTextSchema = exports.audioLevelsResultSchema = exports.audioTranscriptResultSchema = exports.measureAudioLevelsSchema = exports.transcribeAudioSchema = exports.binaryMaskSchema = exports.measureLayoutResultSchema = exports.sampleColorsResultSchema = exports.measureLayoutSchema = exports.sampleColorsSchema = exports.matchTextStyleResultSchema = exports.matchTextStyleSchema = exports.prepareVideoComposerInput = exports.formatDateTag = exports.outputFieldsToZod = exports.outputFieldToZod = exports.LLMProviders = exports.applyLogicOperator = exports.IfLogicOperators = exports.resolvePath = exports.indexExpressionToString = exports.indexExpressionToIndexes = exports.resolveUnknownPath = exports.getOutputTypeFromCategory = exports.parseOpenAPIOutputPath = exports.parseOpenAPIInputs = exports.mapOpenAPIType = exports.nodeConfigToCaptionStyle =
|
|
8
|
+
exports.getCapturedNodes = exports.getNodesDownstreamOfSet = exports.getDownstreamNodes = exports.checkCrossContextViolation = exports.getForEachContext = exports.getConnectedSource = exports.cleanupStaleConnections = exports.removeNodeConnections = exports.removeConnection = exports.addConnection = exports.deriveConnections = exports.createNode = exports.getOutputSchema = exports.getNodeByType = exports.getAllNodes = exports.getInputPreviewValue = exports.computeAllNodePortsWithPreviews = exports.computeAllNodePorts = exports.computePortsWithPreviews = exports.computePortsForNode = exports.areTypesCompatible = exports.parseRemotionPropsJson = exports.REMOTION_COMPOSITION_IMPORTS = exports.remotionCompositionPortSchema = exports.remotionCompositionNodeSchema = exports.remotionCompositionSchema = exports.submitInstagramDmRenderJob = exports.submitAutoCaptionRenderJob = exports.nativeTextStickerSchema = exports.submitNativeTextStickerRenderJob = exports.submitRemotionCompositionRenderJob = exports.submitScreenshotAnimationRenderJob = exports.submitSceneSplitJob = exports.submitDeduplicationJob = exports.getRenderJobStatus = exports.submitVideoRenderJob = exports.submitImageRenderJob = exports.iMessageConversationJobSchema = exports.compileIMessageConversation = exports.iMessageConversationSchema = exports.BillingClient = exports.CommentsClient = exports.MediaClient = exports.AutomationsClient = exports.OrganizationClient = exports.StatsClient = exports.PostsClient = exports.TasksClient = exports.AccountsClient = exports.UGCClient = void 0;
|
|
9
|
+
exports.HttpMethods = exports.prepareImageComposerInput = exports.substituteVariables = exports.processTemplate = exports.extractTemplateVariables = exports.PortIdSchema = exports.normalizeToPortId = exports.portIdToTitle = exports.isValidPortId = exports.portId = exports.selectFromPool = exports.getModelDurations = exports.getModelAspectRatios = exports.ALL_VIDEO_MODELS = exports.getAvailableInputModes = exports.hasReferenceVariant = exports.getReferenceModelId = exports.hasFirstLastFrameVariant = exports.getFirstLastFrameModelId = exports.hasImageToVideoVariant = exports.getImageToVideoModelId = exports.isImageToVideoModel = exports.IMAGE_ASPECT_RATIOS = exports.ALL_IMAGE_MODELS = exports.getEditModelId = exports.isEditModel = exports.getCapturedSourceNodeTypes = exports.getFlowControlNodeTypes = exports.getAllNodeDefinitions = exports.getNodeDefinition = exports.isPortType = exports.formatPortType = exports.isAsyncExecutor = exports.internalNodeTypes = exports.nodeDefinitions = exports.extractWorkflowConfig = exports.generateNodeName = exports.shuffleNodePreview = exports.getPreviewValue = exports.removePreviewForConnection = exports.updatePreviewMapForConnection = exports.computePreviewMap = exports.computeAllNodePreviews = exports.resolveNodePreview = exports.getWorkflowOutputSchema = exports.hasMissingTerminalError = exports.hasMissingTriggerError = exports.getPortErrorsForNode = exports.getErrorNodeIds = exports.validateWorkflow = void 0;
|
|
10
|
+
exports.prepareIMessageWorkflow = exports.legacyIMessageIssues = exports.iMessageWorkflowOutput = exports.mediaAnalysisResultSchema = exports.mediaAnalysisStatusSchema = exports.detectScenesSchema = exports.extractFramesSchema = exports.videoTextResultSchema = exports.imageTextResultSchema = exports.readVideoTextSchema = exports.readImageTextSchema = exports.audioLevelsResultSchema = exports.audioTranscriptResultSchema = exports.measureAudioLevelsSchema = exports.transcribeAudioSchema = exports.binaryMaskSchema = exports.measureLayoutResultSchema = exports.sampleColorsResultSchema = exports.measureLayoutSchema = exports.sampleColorsSchema = exports.matchTextStyleResultSchema = exports.matchTextStyleSchema = exports.prepareVideoComposerInput = exports.formatDateTag = exports.outputFieldsToZod = exports.outputFieldToZod = exports.LLMProviders = exports.applyLogicOperator = exports.IfLogicOperators = exports.resolvePath = exports.indexExpressionToString = exports.indexExpressionToIndexes = exports.resolveUnknownPath = exports.getOutputTypeFromCategory = exports.parseOpenAPIOutputPath = exports.parseOpenAPIInputs = exports.mapOpenAPIType = exports.nodeConfigToCaptionStyle = void 0;
|
|
11
11
|
// =============================================================================
|
|
12
12
|
// Client Exports
|
|
13
13
|
// =============================================================================
|
|
@@ -48,7 +48,6 @@ Object.defineProperty(exports, "submitNativeTextStickerRenderJob", { enumerable:
|
|
|
48
48
|
Object.defineProperty(exports, "nativeTextStickerSchema", { enumerable: true, get: function () { return render_1.nativeTextStickerSchema; } });
|
|
49
49
|
Object.defineProperty(exports, "submitAutoCaptionRenderJob", { enumerable: true, get: function () { return render_1.submitAutoCaptionRenderJob; } });
|
|
50
50
|
Object.defineProperty(exports, "submitInstagramDmRenderJob", { enumerable: true, get: function () { return render_1.submitInstagramDmRenderJob; } });
|
|
51
|
-
Object.defineProperty(exports, "submitIMessageDmRenderJob", { enumerable: true, get: function () { return render_1.submitIMessageDmRenderJob; } });
|
|
52
51
|
var remotion_composition_1 = require("./render/types/remotion-composition");
|
|
53
52
|
Object.defineProperty(exports, "remotionCompositionSchema", { enumerable: true, get: function () { return remotion_composition_1.remotionCompositionSchema; } });
|
|
54
53
|
Object.defineProperty(exports, "remotionCompositionNodeSchema", { enumerable: true, get: function () { return remotion_composition_1.remotionCompositionNodeSchema; } });
|
|
@@ -200,3 +199,7 @@ Object.defineProperty(exports, "extractFramesSchema", { enumerable: true, get: f
|
|
|
200
199
|
Object.defineProperty(exports, "detectScenesSchema", { enumerable: true, get: function () { return media_analysis_1.detectScenesSchema; } });
|
|
201
200
|
Object.defineProperty(exports, "mediaAnalysisStatusSchema", { enumerable: true, get: function () { return media_analysis_1.mediaAnalysisStatusSchema; } });
|
|
202
201
|
Object.defineProperty(exports, "mediaAnalysisResultSchema", { enumerable: true, get: function () { return media_analysis_1.mediaAnalysisResultSchema; } });
|
|
202
|
+
var imessage_workflow_1 = require("./imessage-workflow");
|
|
203
|
+
Object.defineProperty(exports, "iMessageWorkflowOutput", { enumerable: true, get: function () { return imessage_workflow_1.iMessageWorkflowOutput; } });
|
|
204
|
+
Object.defineProperty(exports, "legacyIMessageIssues", { enumerable: true, get: function () { return imessage_workflow_1.legacyIMessageIssues; } });
|
|
205
|
+
Object.defineProperty(exports, "prepareIMessageWorkflow", { enumerable: true, get: function () { return imessage_workflow_1.prepareIMessageWorkflow; } });
|
package/dist/render/Root.js
CHANGED
|
@@ -10,9 +10,6 @@ const AutoCaptionComposition_1 = require("./compositions/AutoCaptionComposition"
|
|
|
10
10
|
const ScreenshotAnimation_1 = require("./compositions/ScreenshotAnimation");
|
|
11
11
|
const InstagramDmComposition_1 = require("./compositions/InstagramDmComposition");
|
|
12
12
|
const convertPropsToElements_1 = require("./compositions/InstagramDmComposition/convertPropsToElements");
|
|
13
|
-
const IMessageDmComposition_1 = require("./compositions/IMessageDmComposition");
|
|
14
|
-
const types_1 = require("./compositions/IMessageDmComposition/types");
|
|
15
|
-
const convertPropsToElements_2 = require("./compositions/IMessageDmComposition/convertPropsToElements");
|
|
16
13
|
const positionResolver_1 = require("./utils/positionResolver");
|
|
17
14
|
const cropBounds_1 = require("./utils/cropBounds");
|
|
18
15
|
const fonts_1 = require("./utils/fonts");
|
|
@@ -444,7 +441,6 @@ const ScreenshotAnimationComp = ScreenshotAnimation_1.ScreenshotAnimation;
|
|
|
444
441
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
445
442
|
const InstagramDmComp = InstagramDmComposition_1.InstagramDmComposition;
|
|
446
443
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
447
|
-
const IMessageDmComp = IMessageDmComposition_1.IMessageDmComposition;
|
|
448
444
|
/**
|
|
449
445
|
* calculateMetadata for ImageEditorComposition
|
|
450
446
|
*
|
|
@@ -537,41 +533,8 @@ const calculateInstagramDmMetadata = async ({ props }) => {
|
|
|
537
533
|
durationInFrames: 90,
|
|
538
534
|
};
|
|
539
535
|
};
|
|
540
|
-
/**
|
|
541
|
-
* calculateMetadata for IMessageDmComposition
|
|
542
|
-
* Computes output dimensions when dynamic crop is enabled.
|
|
543
|
-
*/
|
|
544
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
545
|
-
const calculateIMessageDmMetadata = async ({ props }) => {
|
|
546
|
-
const canvasWidth = props.width ?? 1206;
|
|
547
|
-
const canvasHeight = props.height ?? 2622;
|
|
548
|
-
const defaultResult = { width: canvasWidth, height: canvasHeight, fps: 30, durationInFrames: 90 };
|
|
549
|
-
if (!(0, cropBounds_1.isDynamicCropEnabled)(props.dynamicCrop)) {
|
|
550
|
-
return defaultResult;
|
|
551
|
-
}
|
|
552
|
-
try {
|
|
553
|
-
await (0, fonts_1.preloadFonts)();
|
|
554
|
-
await new Promise(resolve => setTimeout(resolve, 50));
|
|
555
|
-
}
|
|
556
|
-
catch (err) {
|
|
557
|
-
console.error('[calculateIMessageDmMetadata] Font loading failed:', err);
|
|
558
|
-
return defaultResult;
|
|
559
|
-
}
|
|
560
|
-
const mergedProps = { ...IMessageDmComposition_1.defaultIMessageDmProps, ...props };
|
|
561
|
-
const { elements } = (0, convertPropsToElements_2.convertPropsToElements)(mergedProps);
|
|
562
|
-
const { elements: resolved } = (0, positionResolver_1.resolveElementPositions)(elements, {});
|
|
563
|
-
if (!resolved)
|
|
564
|
-
return defaultResult;
|
|
565
|
-
const cropBounds = (0, cropBounds_1.calculateCropBounds)(resolved, props.dynamicCrop, canvasWidth, canvasHeight);
|
|
566
|
-
return {
|
|
567
|
-
width: Math.round(cropBounds.width),
|
|
568
|
-
height: Math.round(cropBounds.height),
|
|
569
|
-
fps: 30,
|
|
570
|
-
durationInFrames: 90,
|
|
571
|
-
};
|
|
572
|
-
};
|
|
573
536
|
const RenderRoot = () => {
|
|
574
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(remotion_1.Composition, { id: "ImageEditorComposition", component: ImageComp, calculateMetadata: calculateImageMetadata, durationInFrames: 1, fps: 30, width: 1080, height: 1920, defaultProps: defaultImageProps }), (0, jsx_runtime_1.jsx)(remotion_1.Composition, { id: "VideoEditorComposition", component: VideoComp, durationInFrames: 150, fps: 30, width: 1080, height: 1920, defaultProps: defaultVideoProps }), (0, jsx_runtime_1.jsx)(remotion_1.Composition, { id: "AutoCaptionComposition", component: AutoCaptionComp, durationInFrames: 300, fps: 30, width: 1080, height: 1920, defaultProps: defaultAutoCaptionProps }), (0, jsx_runtime_1.jsx)(remotion_1.Composition, { id: "ScreenshotAnimationComposition", component: ScreenshotAnimationComp, schema: screenshotAnimationSchema, durationInFrames: 180, fps: 59, width: 1206, height: 2622, defaultProps: defaultScreenshotAnimationProps }), (0, jsx_runtime_1.jsx)(remotion_1.Composition, { id: "InstagramDmComposition", component: InstagramDmComp, calculateMetadata: calculateInstagramDmMetadata, schema: instagramDmSchema, durationInFrames: 90, fps: 30, width: 1206, height: 2622, defaultProps: InstagramDmComposition_1.defaultInstagramDmProps })
|
|
537
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(remotion_1.Composition, { id: "ImageEditorComposition", component: ImageComp, calculateMetadata: calculateImageMetadata, durationInFrames: 1, fps: 30, width: 1080, height: 1920, defaultProps: defaultImageProps }), (0, jsx_runtime_1.jsx)(remotion_1.Composition, { id: "VideoEditorComposition", component: VideoComp, durationInFrames: 150, fps: 30, width: 1080, height: 1920, defaultProps: defaultVideoProps }), (0, jsx_runtime_1.jsx)(remotion_1.Composition, { id: "AutoCaptionComposition", component: AutoCaptionComp, durationInFrames: 300, fps: 30, width: 1080, height: 1920, defaultProps: defaultAutoCaptionProps }), (0, jsx_runtime_1.jsx)(remotion_1.Composition, { id: "ScreenshotAnimationComposition", component: ScreenshotAnimationComp, schema: screenshotAnimationSchema, durationInFrames: 180, fps: 59, width: 1206, height: 2622, defaultProps: defaultScreenshotAnimationProps }), (0, jsx_runtime_1.jsx)(remotion_1.Composition, { id: "InstagramDmComposition", component: InstagramDmComp, calculateMetadata: calculateInstagramDmMetadata, schema: instagramDmSchema, durationInFrames: 90, fps: 30, width: 1206, height: 2622, defaultProps: InstagramDmComposition_1.defaultInstagramDmProps })] }));
|
|
575
538
|
};
|
|
576
539
|
exports.RenderRoot = RenderRoot;
|
|
577
540
|
exports.default = exports.RenderRoot;
|
|
@@ -7,7 +7,6 @@ export { AutoCaptionComposition, AutoCaptionCompositionWithVideo, } from './Auto
|
|
|
7
7
|
export { ScreenshotAnimation, type ScreenshotAnimationProps, } from './ScreenshotAnimation';
|
|
8
8
|
export { InstagramDmComposition, defaultInstagramDmProps, convertPropsToElements as convertInstagramPropsToElements, type InstagramDmCompositionProps, type IgTheme, } from './InstagramDmComposition';
|
|
9
9
|
export { convertPublicToProps, validatePublicInput, type ValidationError, } from './InstagramDmComposition/convertPublicToProps';
|
|
10
|
-
export { IMessageDmComposition, defaultIMessageDmProps, convertPropsToElements as convertIMessagePropsToElements, type IMessageDmCompositionProps, type ImMessage, type ImMessageSender, } from './IMessageDmComposition';
|
|
11
10
|
export { BaseDmComposition, DebugOverlay, type BaseDmCompositionProps, } from './DmComposition';
|
|
12
11
|
export { DeduplicationPreview, type DeduplicationPreviewProps, } from './DeduplicationPreview';
|
|
13
12
|
export * from './messaging';
|
|
@@ -17,7 +17,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
17
17
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.DeduplicationPreview = exports.DebugOverlay = exports.BaseDmComposition = exports.
|
|
20
|
+
exports.DeduplicationPreview = exports.DebugOverlay = exports.BaseDmComposition = exports.validatePublicInput = exports.convertPublicToProps = exports.convertInstagramPropsToElements = exports.defaultInstagramDmProps = exports.InstagramDmComposition = exports.ScreenshotAnimation = exports.AutoCaptionCompositionWithVideo = exports.AutoCaptionComposition = exports.VideoEditorComposition = exports.ImageEditorComposition = void 0;
|
|
21
21
|
var ImageEditorComposition_1 = require("./ImageEditorComposition");
|
|
22
22
|
Object.defineProperty(exports, "ImageEditorComposition", { enumerable: true, get: function () { return ImageEditorComposition_1.ImageEditorComposition; } });
|
|
23
23
|
var VideoEditorComposition_1 = require("./VideoEditorComposition");
|
|
@@ -34,10 +34,6 @@ Object.defineProperty(exports, "convertInstagramPropsToElements", { enumerable:
|
|
|
34
34
|
var convertPublicToProps_1 = require("./InstagramDmComposition/convertPublicToProps");
|
|
35
35
|
Object.defineProperty(exports, "convertPublicToProps", { enumerable: true, get: function () { return convertPublicToProps_1.convertPublicToProps; } });
|
|
36
36
|
Object.defineProperty(exports, "validatePublicInput", { enumerable: true, get: function () { return convertPublicToProps_1.validatePublicInput; } });
|
|
37
|
-
var IMessageDmComposition_1 = require("./IMessageDmComposition");
|
|
38
|
-
Object.defineProperty(exports, "IMessageDmComposition", { enumerable: true, get: function () { return IMessageDmComposition_1.IMessageDmComposition; } });
|
|
39
|
-
Object.defineProperty(exports, "defaultIMessageDmProps", { enumerable: true, get: function () { return IMessageDmComposition_1.defaultIMessageDmProps; } });
|
|
40
|
-
Object.defineProperty(exports, "convertIMessagePropsToElements", { enumerable: true, get: function () { return IMessageDmComposition_1.convertPropsToElements; } });
|
|
41
37
|
var DmComposition_1 = require("./DmComposition");
|
|
42
38
|
Object.defineProperty(exports, "BaseDmComposition", { enumerable: true, get: function () { return DmComposition_1.BaseDmComposition; } });
|
|
43
39
|
Object.defineProperty(exports, "DebugOverlay", { enumerable: true, get: function () { return DmComposition_1.DebugOverlay; } });
|
package/dist/render.d.ts
CHANGED
|
@@ -150,40 +150,6 @@ export interface SubmitInstagramDmRenderJobParams {
|
|
|
150
150
|
/** Dynamic crop configuration - crop output to DM element bounds */
|
|
151
151
|
dynamicCrop?: import('./render/types/crop').DynamicCropConfig;
|
|
152
152
|
}
|
|
153
|
-
interface ImDmMessageInternal {
|
|
154
|
-
id: string;
|
|
155
|
-
sender: 'user' | 'recipient';
|
|
156
|
-
text: string;
|
|
157
|
-
imageUrl?: string;
|
|
158
|
-
groupWithPrevious?: boolean;
|
|
159
|
-
}
|
|
160
|
-
export type ImDmMessage = ImDmMessageInternal;
|
|
161
|
-
export interface SubmitIMessageDmRenderJobParams {
|
|
162
|
-
/** Username displayed in header */
|
|
163
|
-
username: string;
|
|
164
|
-
/** Profile picture URL */
|
|
165
|
-
profilePicUrl: string;
|
|
166
|
-
/** Light or dark theme */
|
|
167
|
-
theme: 'light' | 'dark';
|
|
168
|
-
/** Status bar time */
|
|
169
|
-
time: string;
|
|
170
|
-
/** Messages in the conversation */
|
|
171
|
-
messages: CreateDmMessage[];
|
|
172
|
-
/** Image attachment URL (used for sender images with hasImage flag) */
|
|
173
|
-
imageAttachmentUrl?: string;
|
|
174
|
-
/** Sender bubble color (default blue) */
|
|
175
|
-
senderBubbleColor?: string;
|
|
176
|
-
/** Whether to show read receipt */
|
|
177
|
-
showReadReceipt?: boolean;
|
|
178
|
-
/** Read receipt text (e.g., "Read 2:30 PM") */
|
|
179
|
-
readReceiptText?: string;
|
|
180
|
-
/** Unread badge text (number of unread messages) */
|
|
181
|
-
unreadBadgeText?: string;
|
|
182
|
-
/** Message header timestamp text (e.g., "Today 2:15 PM") */
|
|
183
|
-
messageHeaderTimestampText?: string;
|
|
184
|
-
/** Dynamic crop configuration - crop output to DM element bounds */
|
|
185
|
-
dynamicCrop?: import('./render/types/crop').DynamicCropConfig;
|
|
186
|
-
}
|
|
187
153
|
/**
|
|
188
154
|
* Submit an image render job to the render worker.
|
|
189
155
|
* Uses the element-based format for single-source-of-truth rendering.
|
|
@@ -222,8 +188,3 @@ export declare function submitAutoCaptionRenderJob(params: SubmitAutoCaptionRend
|
|
|
222
188
|
* Renders a fake Instagram DM conversation image.
|
|
223
189
|
*/
|
|
224
190
|
export declare function submitInstagramDmRenderJob(params: SubmitInstagramDmRenderJobParams): Promise<ApiResponse<RenderJobResponse>>;
|
|
225
|
-
/**
|
|
226
|
-
* Submit an iMessage DM render job to the render worker.
|
|
227
|
-
* Renders a fake iMessage conversation image.
|
|
228
|
-
*/
|
|
229
|
-
export declare function submitIMessageDmRenderJob(params: SubmitIMessageDmRenderJobParams): Promise<ApiResponse<RenderJobResponse>>;
|
package/dist/render.js
CHANGED
|
@@ -20,7 +20,6 @@ exports.submitSceneSplitJob = submitSceneSplitJob;
|
|
|
20
20
|
exports.submitScreenshotAnimationRenderJob = submitScreenshotAnimationRenderJob;
|
|
21
21
|
exports.submitAutoCaptionRenderJob = submitAutoCaptionRenderJob;
|
|
22
22
|
exports.submitInstagramDmRenderJob = submitInstagramDmRenderJob;
|
|
23
|
-
exports.submitIMessageDmRenderJob = submitIMessageDmRenderJob;
|
|
24
23
|
const zod_1 = require("zod");
|
|
25
24
|
const remotion_composition_1 = require("./render/types/remotion-composition");
|
|
26
25
|
const native_text_1 = require("./render/types/native-text");
|
|
@@ -136,19 +135,6 @@ function transformToInstagramMessages(messages, imageAttachmentUrl) {
|
|
|
136
135
|
groupWithPrevious: msg.groupWithPrevious,
|
|
137
136
|
}));
|
|
138
137
|
}
|
|
139
|
-
/**
|
|
140
|
-
* Transform CreateDmMessage[] to ImDmMessageInternal[] for iMessage DM
|
|
141
|
-
*/
|
|
142
|
-
function transformToIMessageMessages(messages, imageAttachmentUrl) {
|
|
143
|
-
const processedMessages = addGroupWithPrevious(messages);
|
|
144
|
-
return processedMessages.map((msg, index) => ({
|
|
145
|
-
id: generateMessageId(index),
|
|
146
|
-
sender: msg.sender,
|
|
147
|
-
text: msg.text,
|
|
148
|
-
imageUrl: msg.hasImage && msg.sender === 'user' ? imageAttachmentUrl : undefined,
|
|
149
|
-
groupWithPrevious: msg.groupWithPrevious,
|
|
150
|
-
}));
|
|
151
|
-
}
|
|
152
138
|
// =============================================================================
|
|
153
139
|
// Render Functions
|
|
154
140
|
// =============================================================================
|
|
@@ -458,52 +444,3 @@ async function submitInstagramDmRenderJob(params) {
|
|
|
458
444
|
return { ok: false, code: 500, message: `Failed to submit Instagram DM job: ${errorMessage}` };
|
|
459
445
|
}
|
|
460
446
|
}
|
|
461
|
-
/**
|
|
462
|
-
* Submit an iMessage DM render job to the render worker.
|
|
463
|
-
* Renders a fake iMessage conversation image.
|
|
464
|
-
*/
|
|
465
|
-
async function submitIMessageDmRenderJob(params) {
|
|
466
|
-
try {
|
|
467
|
-
const transformedMessages = transformToIMessageMessages(params.messages, params.imageAttachmentUrl);
|
|
468
|
-
const response = await renderFetch('/submit-job', {
|
|
469
|
-
method: 'POST',
|
|
470
|
-
headers: { 'Content-Type': 'application/json' },
|
|
471
|
-
body: JSON.stringify({
|
|
472
|
-
config: {
|
|
473
|
-
_compositionType: 'imessage-dm',
|
|
474
|
-
input: {
|
|
475
|
-
username: params.username,
|
|
476
|
-
profilePicUrl: params.profilePicUrl,
|
|
477
|
-
theme: params.theme,
|
|
478
|
-
time: params.time,
|
|
479
|
-
messages: transformedMessages,
|
|
480
|
-
senderBubbleColor: params.senderBubbleColor,
|
|
481
|
-
showReadReceipt: params.showReadReceipt,
|
|
482
|
-
readReceiptText: params.readReceiptText,
|
|
483
|
-
unreadBadgeText: params.unreadBadgeText,
|
|
484
|
-
messageHeaderTimestampText: params.messageHeaderTimestampText,
|
|
485
|
-
dynamicCrop: params.dynamicCrop,
|
|
486
|
-
},
|
|
487
|
-
},
|
|
488
|
-
output_type: 'image',
|
|
489
|
-
image_format: 'png',
|
|
490
|
-
})
|
|
491
|
-
});
|
|
492
|
-
const text = await response.text();
|
|
493
|
-
let data;
|
|
494
|
-
try {
|
|
495
|
-
data = JSON.parse(text);
|
|
496
|
-
}
|
|
497
|
-
catch {
|
|
498
|
-
return { ok: false, code: response.status || 500, message: `Render endpoint error: ${text.substring(0, 100)}` };
|
|
499
|
-
}
|
|
500
|
-
if (data.status === 'error' || !response.ok) {
|
|
501
|
-
return { ok: false, code: response.status, message: data.error ?? data.message ?? 'Failed to submit iMessage DM job' };
|
|
502
|
-
}
|
|
503
|
-
return { ok: true, code: 200, message: "iMessage DM job submitted", data };
|
|
504
|
-
}
|
|
505
|
-
catch (error) {
|
|
506
|
-
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
507
|
-
return { ok: false, code: 500, message: `Failed to submit iMessage DM job: ${errorMessage}` };
|
|
508
|
-
}
|
|
509
|
-
}
|
package/dist/skills.js
CHANGED
|
@@ -233,7 +233,7 @@ Nodes are organized into 4 categories:
|
|
|
233
233
|
- **auto-caption** — Burn TikTok-style captions into video. Presets: hormozi, minimal, bold-pop, clean, neon. Inputs: video. Outputs: video.
|
|
234
234
|
- **custom-model** — Run any fal.ai model by ID. Configure input params and output type/path. Outputs: image, video, or audio.
|
|
235
235
|
- **transcript** — Speech-to-text with timestamps. Inputs: video or audio. Outputs: text + segments (object[]).
|
|
236
|
-
- **create-dm** —
|
|
236
|
+
- **create-dm** — Native iMessage PNG/video or Instagram screenshot. For iMessage set platform imessage, imessageRenderMode conversation and explicit imessageOutputType image/video; connect a full conversation object or configure static authoring. Read the imessage skill. Old iMessage Remotion rendering is removed.
|
|
237
237
|
- **screenshot-animation** — iPhone reveal animation from image. Inputs: image. Outputs: video.
|
|
238
238
|
- **deduplicate** — Modify video to evade content-ID detection (levels 1-5). Inputs: video. Outputs: video.
|
|
239
239
|
- **regex** — Match/replace text with regex. Outputs: result (text), match (boolean), groups (text[]).
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.imessageTools = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const imessage_conversation_1 = require("../imessage-conversation");
|
|
6
|
+
const job = zod_1.z.object({ jobId: zod_1.z.string().uuid() }).strict();
|
|
7
|
+
exports.imessageTools = [
|
|
8
|
+
{ name: 'compile_imessage_conversation', description: 'Validate native iMessage authoring and inspect deterministic duration, arrival/typing schedule and events locally. No render is submitted. Submit the authoring input, not this compiled plan.', schema: imessage_conversation_1.iMessageConversationSchema, execute: async (_client, input) => ({ ok: true, data: (0, imessage_conversation_1.compileIMessageConversation)(input) }) },
|
|
9
|
+
{ name: 'render_imessage_conversation', description: 'Submit a native iMessage PNG image or 60fps video. Needs content:render. Returns a job immediately; poll get_imessage_conversation. Supports HTTPS imageUrl/avatarUrl media and PNG base64. No real messages are sent.', schema: imessage_conversation_1.iMessageConversationSchema, execute: async (client, input) => client.media.renderIMessageConversation(input) },
|
|
10
|
+
{ name: 'get_imessage_conversation', description: 'Get native iMessage render status. Only completed jobs have an output URL. Stop on failed/cancelled; preserve the returned jobId for retries and cancellation.', schema: job, execute: async (client, input) => client.media.getIMessageConversation(input) },
|
|
11
|
+
{ name: 'cancel_imessage_conversation', description: 'Request cancellation of a native iMessage render. Continue polling until terminal; cancelRequested alone does not establish completion.', schema: job, execute: async (client, input) => client.media.cancelIMessageConversation(input) },
|
|
12
|
+
];
|
package/dist/tools/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.billingTools = exports.orgTools = exports.commentTools = exports.taskTools = exports.statsTools = exports.automationTools = exports.mediaTools = exports.postTools = exports.accountTools = exports.toolRegistry = exports.allTools = void 0;
|
|
4
|
+
const imessage_1 = require("./imessage");
|
|
4
5
|
const accounts_1 = require("./accounts");
|
|
5
6
|
Object.defineProperty(exports, "accountTools", { enumerable: true, get: function () { return accounts_1.accountTools; } });
|
|
6
7
|
const posts_1 = require("./posts");
|
|
@@ -23,6 +24,7 @@ exports.allTools = [
|
|
|
23
24
|
...accounts_1.accountTools,
|
|
24
25
|
...posts_1.postTools,
|
|
25
26
|
...media_1.mediaTools,
|
|
27
|
+
...imessage_1.imessageTools,
|
|
26
28
|
...automations_1.automationTools,
|
|
27
29
|
...stats_1.statsTools,
|
|
28
30
|
...tasks_1.taskTools,
|
package/package.json
CHANGED
|
@@ -80,3 +80,7 @@ SAM and automatic segmentation/overlay tracking are deferred. Use supplied
|
|
|
80
80
|
assets, user-supplied boxes/masks or honest visual analysis; do not claim recovered
|
|
81
81
|
source layers or automatic clean cutouts. If the runtime cannot inspect a media
|
|
82
82
|
modality, record that limit and do not certify the uninspected property.
|
|
83
|
+
|
|
84
|
+
For text-message formats, use the `imessage` skill and native Create DM for both
|
|
85
|
+
PNG and video. Generate dialogue as structured authoring data, compile pacing,
|
|
86
|
+
and review native output before combining with reaction footage, audio or CTA.
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: imessage
|
|
3
|
+
description: Create native iMessage conversation PNGs and videos, or wire messaging scenes into UGC Inc workflows. Use for synthetic text-message content, typing, replies, reactions, receipts, avatars and image attachments.
|
|
4
|
+
allowed-tools: Bash, Read
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Use the native service for every iMessage image and video. The old Remotion
|
|
8
|
+
composition and iMessage player are removed. Instagram DM remains a separate
|
|
9
|
+
screenshot implementation. These are synthetic renders, never real messages.
|
|
10
|
+
|
|
11
|
+
Read the current [authoring guide](https://docs.ugc.inc/guides/imessage-conversations.md)
|
|
12
|
+
and [field contract](https://docs.ugc.inc/data-structures/imessage-conversation.md)
|
|
13
|
+
for optional appearance, group, reply/reaction and timing fields.
|
|
14
|
+
|
|
15
|
+
## Author and inspect pacing
|
|
16
|
+
|
|
17
|
+
Give the conversation one concrete situation, a readable opening, useful replies
|
|
18
|
+
and a clear payoff. Preserve the user's requested tone and product capabilities;
|
|
19
|
+
rendering success does not establish that the dialogue is good. Use stable IDs,
|
|
20
|
+
`sender: "user"` for the phone owner and `"recipient"` for the other person
|
|
21
|
+
(or declared group participant IDs). Give each bubble one thought. Separate
|
|
22
|
+
content generation from reusable appearance/pacing settings.
|
|
23
|
+
|
|
24
|
+
`compile_imessage_conversation` accepts the authoring JSON and returns duration,
|
|
25
|
+
typing/arrival schedule and events without submitting a render. Inspect the total
|
|
26
|
+
length and important pauses; adjust authoring timing before rendering. A long
|
|
27
|
+
conversation at default typing speed may exceed the 120-second limit. Do not
|
|
28
|
+
submit the compiled plan to the render endpoint.
|
|
29
|
+
|
|
30
|
+
For a populated still, mark all messages `initial: true` and use
|
|
31
|
+
`output: {"kind":"png"}`. For an animated scene, put only existing history first
|
|
32
|
+
with `initial:true`; later messages animate. `output:{"kind":"png","atMs":500}`
|
|
33
|
+
renders that native moment losslessly. Video defaults to 60fps. Emoji are complete
|
|
34
|
+
Unicode graphemes and local typing uses the native keyboard.
|
|
35
|
+
|
|
36
|
+
## Render and handle jobs
|
|
37
|
+
|
|
38
|
+
Use existing UGC credentials/org; restricted keys need `content:render`.
|
|
39
|
+
`render_imessage_conversation` submits authoring JSON and immediately returns a
|
|
40
|
+
job. Check outer `ok`, save `data.jobId`, and poll `get_imessage_conversation`
|
|
41
|
+
with `{jobId}` until completed/failed/cancelled. Only completed output has a URL.
|
|
42
|
+
Use a bounded polling deadline; on timeout retain the job instead of duplicating
|
|
43
|
+
it. `cancel_imessage_conversation` requests cancellation; keep polling to terminal.
|
|
44
|
+
These jobs do not use `get_media_analysis`.
|
|
45
|
+
|
|
46
|
+
An idempotency key reuses identical input within the org; changing input needs a
|
|
47
|
+
new key. Status records are retained seven days. Report safe returned errors and
|
|
48
|
+
retryability. Use the SDK methods when shell JSON quoting is awkward.
|
|
49
|
+
|
|
50
|
+
Image bodies accept exactly one `text`, `imagePngBase64`, or public HTTPS
|
|
51
|
+
`imageUrl`. Contact/group/participant avatars accept a PNG payload or `avatarUrl`.
|
|
52
|
+
The service resolves URL images; do not make agents build base64 blobs. Avatar
|
|
53
|
+
conversion fits96px, attachment conversion fits2048px; media/request budgets
|
|
54
|
+
still apply. A document-name string is text, not an actual file attachment;
|
|
55
|
+
render a deliberate PNG asset if the format calls for an image of a document.
|
|
56
|
+
|
|
57
|
+
## Workflow integration
|
|
58
|
+
|
|
59
|
+
Discover `create-dm` with `get_node_type`. Configure:
|
|
60
|
+
|
|
61
|
+
```json
|
|
62
|
+
{
|
|
63
|
+
"platform": "imessage",
|
|
64
|
+
"platformInputType": "static",
|
|
65
|
+
"imessageRenderMode": "conversation",
|
|
66
|
+
"imessageOutputType": "video",
|
|
67
|
+
"imessageConversationInputType": "variable"
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Connect the full authoring object to `conversation`. The output port is `output`;
|
|
72
|
+
`imessageOutputType:"image"` fixes an image port, `"video"` fixes a video port.
|
|
73
|
+
A variable input declaring the opposite output kind rejects. Static settings use
|
|
74
|
+
`imessageConversation`. For a direct-chat avatar, set `profilePicInputType` to
|
|
75
|
+
`variable` and connect `profile-pic`. To replace an image message, set
|
|
76
|
+
`imageAttachmentInputType` to `variable`, set `imessageAttachmentMessageId` to the
|
|
77
|
+
target ID and connect `image-attachment`. Input images retain normal `{url}` shape.
|
|
78
|
+
|
|
79
|
+
Saved screenshot nodes retain their existing connections and resolve to native
|
|
80
|
+
populated PNGs. Custom bubble colors, message-based cropping and free-text legacy
|
|
81
|
+
read receipts need explicit correction; do not silently discard them. Use native
|
|
82
|
+
message receipt/readAt fields or downstream composition as appropriate.
|
|
83
|
+
|
|
84
|
+
Validate the graph before running. Feed video into Video Composer alongside the
|
|
85
|
+
reaction clip, soundtrack and required CTA; feed PNG into an image workflow.
|
|
86
|
+
End with Save to Media or a Pass-Through output for review. Do not add posting
|
|
87
|
+
or recurrence without authorization. Use the automations skill for graph details.
|
|
88
|
+
|
|
89
|
+
## Review boundaries
|
|
90
|
+
|
|
91
|
+
Inspect PNGs and opening/changing/final video states at phone viewing size.
|
|
92
|
+
Use the compiled schedule to choose moments around typing, arrival and payoff;
|
|
93
|
+
check scrolling, emoji, attachments and end hold. Native video is1126×2436 with
|
|
94
|
+
one codec-padding column; PNG is1125×2436. Composite deliberately into the target
|
|
95
|
+
canvas. Audio is added separately; inspect the final mixed video's actual audio.
|
|
96
|
+
|
|
97
|
+
The profile is iPhone XS/iOS18.6.2, not the newest iOS UI. Full-screen/bubble-send
|
|
98
|
+
effects, arbitrary fonts/coordinates and custom native dimensions/fps are absent.
|
|
99
|
+
Seeded timing is repeatable, but independent reaction pixels can differ. Do not
|
|
100
|
+
promise universal pixel parity. Share only decoded, verified public HTTPS previews,
|
|
101
|
+
including video Range support. Describe uninspected playback/audio honestly.
|
package/skills/media/SKILL.md
CHANGED
|
@@ -81,3 +81,7 @@ uploading, use the supported owned storage path; do not claim a file is hosted
|
|
|
81
81
|
because a media record was created for an arbitrary URL.
|
|
82
82
|
|
|
83
83
|
For building a reusable content format, use the `content-automation` skill.
|
|
84
|
+
|
|
85
|
+
For native iMessage render jobs use the `imessage` skill and its separate
|
|
86
|
+
submit/status/cancel tools. They require `content:render`, not `content:analyze`,
|
|
87
|
+
and are not media-analysis jobs.
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Convert iMessage DM Composition props to ImageEditorElements
|
|
3
|
-
*
|
|
4
|
-
* This module transforms the composition props into renderable message elements.
|
|
5
|
-
* Header, footer, and status bar elements are rendered directly in the composition JSX.
|
|
6
|
-
*/
|
|
7
|
-
import type { ImageEditorElement } from '../../types/element';
|
|
8
|
-
import type { IMessageDmCompositionProps } from './types';
|
|
9
|
-
/** Tail render data for SVG rendering */
|
|
10
|
-
export interface TailRenderData {
|
|
11
|
-
id: string;
|
|
12
|
-
isUser: boolean;
|
|
13
|
-
messageLeft: number;
|
|
14
|
-
messageRight: number;
|
|
15
|
-
messageBottom: number;
|
|
16
|
-
}
|
|
17
|
-
/** Result of converting props to elements */
|
|
18
|
-
export interface ConversionResult {
|
|
19
|
-
elements: ImageEditorElement[];
|
|
20
|
-
imageUrls: Record<string, string>;
|
|
21
|
-
tails: TailRenderData[];
|
|
22
|
-
width: number;
|
|
23
|
-
height: number;
|
|
24
|
-
}
|
|
25
|
-
/** Input ID prefix for sender images */
|
|
26
|
-
export declare const SENDER_IMAGE_INPUT_ID_PREFIX = "sender-image-";
|
|
27
|
-
export declare function convertPropsToElements(props: IMessageDmCompositionProps): ConversionResult;
|