@transloadit/node 4.10.8 → 4.11.1
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 +1 -1
- package/dist/Transloadit.d.ts +13 -0
- package/dist/Transloadit.d.ts.map +1 -1
- package/dist/Transloadit.js +70 -0
- package/dist/Transloadit.js.map +1 -1
- package/dist/alphalib/imagemagickDensity.d.ts +4 -0
- package/dist/alphalib/imagemagickDensity.d.ts.map +1 -0
- package/dist/alphalib/imagemagickDensity.js +10 -0
- package/dist/alphalib/imagemagickDensity.js.map +1 -0
- package/dist/alphalib/types/assemblyReplay.d.ts +308 -4
- package/dist/alphalib/types/assemblyReplay.d.ts.map +1 -1
- package/dist/alphalib/types/assemblyReplay.js +22 -2
- package/dist/alphalib/types/assemblyReplay.js.map +1 -1
- package/dist/alphalib/types/assemblyStatus.d.ts +11 -10
- package/dist/alphalib/types/assemblyStatus.d.ts.map +1 -1
- package/dist/alphalib/types/assemblyStatus.js +25 -0
- package/dist/alphalib/types/assemblyStatus.js.map +1 -1
- package/dist/alphalib/types/robots/_index.d.ts +93 -0
- package/dist/alphalib/types/robots/_index.d.ts.map +1 -1
- package/dist/alphalib/types/robots/_instructions-primitives.d.ts +14 -2
- package/dist/alphalib/types/robots/_instructions-primitives.d.ts.map +1 -1
- package/dist/alphalib/types/robots/_instructions-primitives.js +36 -6
- package/dist/alphalib/types/robots/_instructions-primitives.js.map +1 -1
- package/dist/alphalib/types/robots/ai-chat.d.ts +13474 -1034
- package/dist/alphalib/types/robots/ai-chat.d.ts.map +1 -1
- package/dist/alphalib/types/robots/ai-chat.js +303 -57
- package/dist/alphalib/types/robots/ai-chat.js.map +1 -1
- package/dist/alphalib/types/robots/audio-artwork.d.ts.map +1 -1
- package/dist/alphalib/types/robots/audio-artwork.js +1 -0
- package/dist/alphalib/types/robots/audio-artwork.js.map +1 -1
- package/dist/alphalib/types/robots/audio-concat.d.ts +12 -0
- package/dist/alphalib/types/robots/audio-concat.d.ts.map +1 -1
- package/dist/alphalib/types/robots/audio-concat.js +3 -1
- package/dist/alphalib/types/robots/audio-concat.js.map +1 -1
- package/dist/alphalib/types/robots/audio-encode.d.ts.map +1 -1
- package/dist/alphalib/types/robots/audio-encode.js +1 -0
- package/dist/alphalib/types/robots/audio-encode.js.map +1 -1
- package/dist/alphalib/types/robots/audio-loop.d.ts.map +1 -1
- package/dist/alphalib/types/robots/audio-loop.js +1 -0
- package/dist/alphalib/types/robots/audio-loop.js.map +1 -1
- package/dist/alphalib/types/robots/audio-merge.d.ts.map +1 -1
- package/dist/alphalib/types/robots/audio-merge.js +1 -0
- package/dist/alphalib/types/robots/audio-merge.js.map +1 -1
- package/dist/alphalib/types/robots/audio-split.d.ts.map +1 -1
- package/dist/alphalib/types/robots/audio-split.js +1 -0
- package/dist/alphalib/types/robots/audio-split.js.map +1 -1
- package/dist/alphalib/types/robots/audio-waveform.d.ts.map +1 -1
- package/dist/alphalib/types/robots/audio-waveform.js +1 -0
- package/dist/alphalib/types/robots/audio-waveform.js.map +1 -1
- package/dist/alphalib/types/robots/azure-import.d.ts +12 -0
- package/dist/alphalib/types/robots/azure-import.d.ts.map +1 -1
- package/dist/alphalib/types/robots/backblaze-import.d.ts +12 -0
- package/dist/alphalib/types/robots/backblaze-import.d.ts.map +1 -1
- package/dist/alphalib/types/robots/box-import.d.ts +12 -0
- package/dist/alphalib/types/robots/box-import.d.ts.map +1 -1
- package/dist/alphalib/types/robots/cloudfiles-import.d.ts +12 -0
- package/dist/alphalib/types/robots/cloudfiles-import.d.ts.map +1 -1
- package/dist/alphalib/types/robots/cloudflare-import.d.ts +12 -0
- package/dist/alphalib/types/robots/cloudflare-import.d.ts.map +1 -1
- package/dist/alphalib/types/robots/digitalocean-import.d.ts +12 -0
- package/dist/alphalib/types/robots/digitalocean-import.d.ts.map +1 -1
- package/dist/alphalib/types/robots/document-merge.d.ts +12 -0
- package/dist/alphalib/types/robots/document-merge.d.ts.map +1 -1
- package/dist/alphalib/types/robots/document-merge.js +2 -1
- package/dist/alphalib/types/robots/document-merge.js.map +1 -1
- package/dist/alphalib/types/robots/document-ocr.d.ts +10 -10
- package/dist/alphalib/types/robots/document-ocr.d.ts.map +1 -1
- package/dist/alphalib/types/robots/document-ocr.js +4 -4
- package/dist/alphalib/types/robots/document-ocr.js.map +1 -1
- package/dist/alphalib/types/robots/dropbox-import.d.ts +12 -0
- package/dist/alphalib/types/robots/dropbox-import.d.ts.map +1 -1
- package/dist/alphalib/types/robots/file-preview.d.ts +12 -12
- package/dist/alphalib/types/robots/file-preview.js +2 -2
- package/dist/alphalib/types/robots/file-preview.js.map +1 -1
- package/dist/alphalib/types/robots/file-serve.d.ts.map +1 -1
- package/dist/alphalib/types/robots/file-serve.js +1 -0
- package/dist/alphalib/types/robots/file-serve.js.map +1 -1
- package/dist/alphalib/types/robots/file-verify.d.ts +12 -0
- package/dist/alphalib/types/robots/file-verify.d.ts.map +1 -1
- package/dist/alphalib/types/robots/file-verify.js +6 -0
- package/dist/alphalib/types/robots/file-verify.js.map +1 -1
- package/dist/alphalib/types/robots/ftp-import.d.ts +12 -0
- package/dist/alphalib/types/robots/ftp-import.d.ts.map +1 -1
- package/dist/alphalib/types/robots/google-import.d.ts +12 -0
- package/dist/alphalib/types/robots/google-import.d.ts.map +1 -1
- package/dist/alphalib/types/robots/http-import.d.ts +12 -12
- package/dist/alphalib/types/robots/http-import.d.ts.map +1 -1
- package/dist/alphalib/types/robots/http-import.js +0 -6
- package/dist/alphalib/types/robots/http-import.js.map +1 -1
- package/dist/alphalib/types/robots/image-bgremove.d.ts +10 -10
- package/dist/alphalib/types/robots/image-bgremove.d.ts.map +1 -1
- package/dist/alphalib/types/robots/image-bgremove.js +4 -4
- package/dist/alphalib/types/robots/image-bgremove.js.map +1 -1
- package/dist/alphalib/types/robots/image-describe.d.ts +10 -10
- package/dist/alphalib/types/robots/image-describe.d.ts.map +1 -1
- package/dist/alphalib/types/robots/image-describe.js +4 -4
- package/dist/alphalib/types/robots/image-describe.js.map +1 -1
- package/dist/alphalib/types/robots/image-facedetect.d.ts +10 -10
- package/dist/alphalib/types/robots/image-facedetect.d.ts.map +1 -1
- package/dist/alphalib/types/robots/image-facedetect.js +4 -4
- package/dist/alphalib/types/robots/image-facedetect.js.map +1 -1
- package/dist/alphalib/types/robots/image-generate.d.ts +6 -6
- package/dist/alphalib/types/robots/image-generate.d.ts.map +1 -1
- package/dist/alphalib/types/robots/image-generate.js +2 -2
- package/dist/alphalib/types/robots/image-generate.js.map +1 -1
- package/dist/alphalib/types/robots/image-merge.d.ts +68 -8
- package/dist/alphalib/types/robots/image-merge.d.ts.map +1 -1
- package/dist/alphalib/types/robots/image-merge.js +46 -3
- package/dist/alphalib/types/robots/image-merge.js.map +1 -1
- package/dist/alphalib/types/robots/image-ocr.d.ts +10 -10
- package/dist/alphalib/types/robots/image-ocr.d.ts.map +1 -1
- package/dist/alphalib/types/robots/image-ocr.js +4 -4
- package/dist/alphalib/types/robots/image-ocr.js.map +1 -1
- package/dist/alphalib/types/robots/image-resize.d.ts +9 -8
- package/dist/alphalib/types/robots/image-resize.d.ts.map +1 -1
- package/dist/alphalib/types/robots/image-resize.js +9 -8
- package/dist/alphalib/types/robots/image-resize.js.map +1 -1
- package/dist/alphalib/types/robots/image-upscale.d.ts +4 -4
- package/dist/alphalib/types/robots/image-upscale.d.ts.map +1 -1
- package/dist/alphalib/types/robots/image-upscale.js +2 -2
- package/dist/alphalib/types/robots/image-upscale.js.map +1 -1
- package/dist/alphalib/types/robots/mega-import.d.ts +12 -0
- package/dist/alphalib/types/robots/mega-import.d.ts.map +1 -1
- package/dist/alphalib/types/robots/minio-import.d.ts +12 -0
- package/dist/alphalib/types/robots/minio-import.d.ts.map +1 -1
- package/dist/alphalib/types/robots/s3-import.d.ts +12 -0
- package/dist/alphalib/types/robots/s3-import.d.ts.map +1 -1
- package/dist/alphalib/types/robots/sftp-import.d.ts +24 -0
- package/dist/alphalib/types/robots/sftp-import.d.ts.map +1 -1
- package/dist/alphalib/types/robots/sftp-import.js +6 -2
- package/dist/alphalib/types/robots/sftp-import.js.map +1 -1
- package/dist/alphalib/types/robots/speech-transcribe.d.ts +10 -10
- package/dist/alphalib/types/robots/speech-transcribe.d.ts.map +1 -1
- package/dist/alphalib/types/robots/speech-transcribe.js +9 -9
- package/dist/alphalib/types/robots/speech-transcribe.js.map +1 -1
- package/dist/alphalib/types/robots/supabase-import.d.ts +12 -0
- package/dist/alphalib/types/robots/supabase-import.d.ts.map +1 -1
- package/dist/alphalib/types/robots/swift-import.d.ts +12 -0
- package/dist/alphalib/types/robots/swift-import.d.ts.map +1 -1
- package/dist/alphalib/types/robots/text-speak.d.ts +10 -10
- package/dist/alphalib/types/robots/text-speak.d.ts.map +1 -1
- package/dist/alphalib/types/robots/text-speak.js +4 -4
- package/dist/alphalib/types/robots/text-speak.js.map +1 -1
- package/dist/alphalib/types/robots/text-translate.d.ts +10 -10
- package/dist/alphalib/types/robots/text-translate.d.ts.map +1 -1
- package/dist/alphalib/types/robots/text-translate.js +4 -4
- package/dist/alphalib/types/robots/text-translate.js.map +1 -1
- package/dist/alphalib/types/robots/tigris-import.d.ts +12 -0
- package/dist/alphalib/types/robots/tigris-import.d.ts.map +1 -1
- package/dist/alphalib/types/robots/tlcdn-deliver.d.ts.map +1 -1
- package/dist/alphalib/types/robots/tlcdn-deliver.js +1 -0
- package/dist/alphalib/types/robots/tlcdn-deliver.js.map +1 -1
- package/dist/alphalib/types/robots/video-adaptive.d.ts.map +1 -1
- package/dist/alphalib/types/robots/video-adaptive.js +1 -0
- package/dist/alphalib/types/robots/video-adaptive.js.map +1 -1
- package/dist/alphalib/types/robots/video-artwork.d.ts.map +1 -1
- package/dist/alphalib/types/robots/video-artwork.js +1 -0
- package/dist/alphalib/types/robots/video-artwork.js.map +1 -1
- package/dist/alphalib/types/robots/video-concat.d.ts +12 -0
- package/dist/alphalib/types/robots/video-concat.d.ts.map +1 -1
- package/dist/alphalib/types/robots/video-concat.js +3 -1
- package/dist/alphalib/types/robots/video-concat.js.map +1 -1
- package/dist/alphalib/types/robots/video-encode.d.ts +4 -4
- package/dist/alphalib/types/robots/video-encode.d.ts.map +1 -1
- package/dist/alphalib/types/robots/video-encode.js +1 -0
- package/dist/alphalib/types/robots/video-encode.js.map +1 -1
- package/dist/alphalib/types/robots/video-generate.d.ts +6 -6
- package/dist/alphalib/types/robots/video-generate.d.ts.map +1 -1
- package/dist/alphalib/types/robots/video-generate.js +3 -2
- package/dist/alphalib/types/robots/video-generate.js.map +1 -1
- package/dist/alphalib/types/robots/video-merge.d.ts +12 -0
- package/dist/alphalib/types/robots/video-merge.d.ts.map +1 -1
- package/dist/alphalib/types/robots/video-merge.js +4 -6
- package/dist/alphalib/types/robots/video-merge.js.map +1 -1
- package/dist/alphalib/types/robots/video-ondemand.d.ts +4 -4
- package/dist/alphalib/types/robots/video-ondemand.d.ts.map +1 -1
- package/dist/alphalib/types/robots/video-ondemand.js +1 -0
- package/dist/alphalib/types/robots/video-ondemand.js.map +1 -1
- package/dist/alphalib/types/robots/video-split.d.ts.map +1 -1
- package/dist/alphalib/types/robots/video-split.js +1 -0
- package/dist/alphalib/types/robots/video-split.js.map +1 -1
- package/dist/alphalib/types/robots/video-subtitle.d.ts.map +1 -1
- package/dist/alphalib/types/robots/video-subtitle.js +1 -0
- package/dist/alphalib/types/robots/video-subtitle.js.map +1 -1
- package/dist/alphalib/types/robots/video-thumbs.d.ts +24 -0
- package/dist/alphalib/types/robots/video-thumbs.d.ts.map +1 -1
- package/dist/alphalib/types/robots/video-thumbs.js +29 -0
- package/dist/alphalib/types/robots/video-thumbs.js.map +1 -1
- package/dist/alphalib/types/robots/vimeo-import.d.ts +12 -0
- package/dist/alphalib/types/robots/vimeo-import.d.ts.map +1 -1
- package/dist/alphalib/types/robots/wasabi-import.d.ts +12 -0
- package/dist/alphalib/types/robots/wasabi-import.d.ts.map +1 -1
- package/dist/cli/commands/assemblies.d.ts +37 -0
- package/dist/cli/commands/assemblies.d.ts.map +1 -1
- package/dist/cli/commands/assemblies.js +173 -1
- package/dist/cli/commands/assemblies.js.map +1 -1
- package/dist/cli/commands/index.d.ts.map +1 -1
- package/dist/cli/commands/index.js +4 -1
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/semanticIntents/imageDescribe.d.ts +1 -1
- package/dist/cli/semanticIntents/imageDescribe.d.ts.map +1 -1
- package/dist/cli/semanticIntents/imageDescribe.js +2 -2
- package/dist/cli/semanticIntents/imageDescribe.js.map +1 -1
- package/package.json +2 -2
- package/src/Transloadit.ts +106 -0
- package/src/alphalib/imagemagickDensity.ts +15 -0
- package/src/alphalib/types/assemblyReplay.ts +31 -2
- package/src/alphalib/types/assemblyStatus.ts +29 -0
- package/src/alphalib/types/robots/_instructions-primitives.ts +39 -6
- package/src/alphalib/types/robots/ai-chat.ts +447 -57
- package/src/alphalib/types/robots/audio-artwork.ts +1 -0
- package/src/alphalib/types/robots/audio-concat.ts +3 -0
- package/src/alphalib/types/robots/audio-encode.ts +1 -0
- package/src/alphalib/types/robots/audio-loop.ts +1 -0
- package/src/alphalib/types/robots/audio-merge.ts +1 -0
- package/src/alphalib/types/robots/audio-split.ts +1 -0
- package/src/alphalib/types/robots/audio-waveform.ts +1 -0
- package/src/alphalib/types/robots/document-merge.ts +7 -1
- package/src/alphalib/types/robots/document-ocr.ts +5 -4
- package/src/alphalib/types/robots/file-preview.ts +2 -2
- package/src/alphalib/types/robots/file-serve.ts +1 -0
- package/src/alphalib/types/robots/file-verify.ts +6 -0
- package/src/alphalib/types/robots/http-import.ts +0 -6
- package/src/alphalib/types/robots/image-bgremove.ts +11 -4
- package/src/alphalib/types/robots/image-describe.ts +5 -4
- package/src/alphalib/types/robots/image-facedetect.ts +5 -4
- package/src/alphalib/types/robots/image-generate.ts +7 -2
- package/src/alphalib/types/robots/image-merge.ts +46 -2
- package/src/alphalib/types/robots/image-ocr.ts +5 -4
- package/src/alphalib/types/robots/image-resize.ts +11 -7
- package/src/alphalib/types/robots/image-upscale.ts +7 -2
- package/src/alphalib/types/robots/sftp-import.ts +12 -2
- package/src/alphalib/types/robots/speech-transcribe.ts +9 -8
- package/src/alphalib/types/robots/text-speak.ts +5 -4
- package/src/alphalib/types/robots/text-translate.ts +5 -4
- package/src/alphalib/types/robots/tlcdn-deliver.ts +1 -0
- package/src/alphalib/types/robots/video-adaptive.ts +1 -0
- package/src/alphalib/types/robots/video-artwork.ts +1 -0
- package/src/alphalib/types/robots/video-concat.ts +3 -0
- package/src/alphalib/types/robots/video-encode.ts +1 -0
- package/src/alphalib/types/robots/video-generate.ts +8 -2
- package/src/alphalib/types/robots/video-merge.ts +5 -5
- package/src/alphalib/types/robots/video-ondemand.ts +1 -0
- package/src/alphalib/types/robots/video-split.ts +1 -0
- package/src/alphalib/types/robots/video-subtitle.ts +1 -0
- package/src/alphalib/types/robots/video-thumbs.ts +29 -0
- package/src/cli/commands/assemblies.ts +244 -2
- package/src/cli/commands/index.ts +6 -0
- package/src/cli/semanticIntents/imageDescribe.ts +2 -3
|
@@ -2,7 +2,12 @@ import type { RobotMetaInput } from './_instructions-primitives.ts'
|
|
|
2
2
|
|
|
3
3
|
import { z } from 'zod'
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
autoProviderDescription,
|
|
7
|
+
interpolateRobot,
|
|
8
|
+
robotBase,
|
|
9
|
+
robotUse,
|
|
10
|
+
} from './_instructions-primitives.ts'
|
|
6
11
|
|
|
7
12
|
export const meta: RobotMetaInput = {
|
|
8
13
|
bytescount: 1,
|
|
@@ -37,6 +42,7 @@ export const meta: RobotMetaInput = {
|
|
|
37
42
|
minimumChargeUsd: 0.06,
|
|
38
43
|
isAllowedForUrlTransform: true,
|
|
39
44
|
trackOutputFileSize: true,
|
|
45
|
+
applyCommunityPlanMediaTrim: true,
|
|
40
46
|
isInternal: false,
|
|
41
47
|
removeJobResultFilesFromDiskRightAfterStoringOnS3: false,
|
|
42
48
|
stage: 'ga',
|
|
@@ -89,7 +95,7 @@ export const robotVideoGenerateInstructionsSchema = robotBase
|
|
|
89
95
|
|
|
90
96
|
export const robotVideoGenerateInstructionsWithHiddenFieldsSchema =
|
|
91
97
|
robotVideoGenerateInstructionsSchema.extend({
|
|
92
|
-
provider: z.string().
|
|
98
|
+
provider: z.string().default('auto').describe(autoProviderDescription),
|
|
93
99
|
result: z
|
|
94
100
|
.union([z.literal('debug'), robotVideoGenerateInstructionsSchema.shape.result])
|
|
95
101
|
.optional(),
|
|
@@ -4,6 +4,8 @@ import { z } from 'zod'
|
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
6
|
color_with_alpha,
|
|
7
|
+
httpUrlSchema,
|
|
8
|
+
inputSortBySchema,
|
|
7
9
|
interpolateRobot,
|
|
8
10
|
resize_strategy,
|
|
9
11
|
robotBase,
|
|
@@ -51,6 +53,7 @@ export const meta: RobotMetaInput = {
|
|
|
51
53
|
queueSlotCount: 60,
|
|
52
54
|
isAllowedForUrlTransform: false,
|
|
53
55
|
trackOutputFileSize: true,
|
|
56
|
+
applyCommunityPlanMediaTrim: true,
|
|
54
57
|
isInternal: false,
|
|
55
58
|
removeJobResultFilesFromDiskRightAfterStoringOnS3: false,
|
|
56
59
|
stage: 'ga',
|
|
@@ -112,13 +115,10 @@ Determines whether the audio of the video should be replaced with a provided aud
|
|
|
112
115
|
.describe(`
|
|
113
116
|
Stacks the input media vertically. All streams need to have the same pixel format and width - so consider using a [/video/encode](/docs/robots/video-encode/) <dfn>Step</dfn> before using this parameter to enforce this.
|
|
114
117
|
`),
|
|
115
|
-
image_url:
|
|
116
|
-
.string()
|
|
117
|
-
.url()
|
|
118
|
-
.optional()
|
|
119
|
-
.describe(`
|
|
118
|
+
image_url: httpUrlSchema.optional().describe(`
|
|
120
119
|
The URL of an image to be merged with the audio or video. When this parameter is provided, the robot will download the image from the URL and merge it with the other media.
|
|
121
120
|
`),
|
|
121
|
+
sort_by: inputSortBySchema,
|
|
122
122
|
transition: z
|
|
123
123
|
.enum(['none', 'crossfade', 'fade_to_black'])
|
|
124
124
|
.default('none')
|
|
@@ -66,6 +66,7 @@ export const meta: RobotMetaInput = {
|
|
|
66
66
|
downloadInputFiles: false,
|
|
67
67
|
isAllowedForUrlTransform: true,
|
|
68
68
|
trackOutputFileSize: true,
|
|
69
|
+
applyCommunityPlanMediaTrim: true,
|
|
69
70
|
isInternal: false,
|
|
70
71
|
removeJobResultFilesFromDiskRightAfterStoringOnS3: false,
|
|
71
72
|
stage: 'beta',
|
|
@@ -47,6 +47,7 @@ export const meta: RobotMetaInput = {
|
|
|
47
47
|
queueSlotCount: 60,
|
|
48
48
|
isAllowedForUrlTransform: false,
|
|
49
49
|
trackOutputFileSize: true,
|
|
50
|
+
applyCommunityPlanMediaTrim: true,
|
|
50
51
|
isInternal: false,
|
|
51
52
|
removeJobResultFilesFromDiskRightAfterStoringOnS3: false,
|
|
52
53
|
stage: 'ga',
|
|
@@ -81,6 +81,7 @@ export const meta: RobotMetaInput = {
|
|
|
81
81
|
queueSlotCount: 60,
|
|
82
82
|
isAllowedForUrlTransform: false,
|
|
83
83
|
trackOutputFileSize: true,
|
|
84
|
+
applyCommunityPlanMediaTrim: true,
|
|
84
85
|
isInternal: false,
|
|
85
86
|
removeJobResultFilesFromDiskRightAfterStoringOnS3: false,
|
|
86
87
|
stage: 'ga',
|
|
@@ -46,6 +46,7 @@ export const meta: RobotMetaInput = {
|
|
|
46
46
|
queueSlotCount: 15,
|
|
47
47
|
isAllowedForUrlTransform: false,
|
|
48
48
|
trackOutputFileSize: true,
|
|
49
|
+
applyCommunityPlanMediaTrim: true,
|
|
49
50
|
isInternal: false,
|
|
50
51
|
removeJobResultFilesFromDiskRightAfterStoringOnS3: false,
|
|
51
52
|
stage: 'ga',
|
|
@@ -121,6 +122,34 @@ Forces the video to be rotated by the specified degree integer. Currently, only
|
|
|
121
122
|
.optional()
|
|
122
123
|
.describe(`
|
|
123
124
|
Specifies the input codec to use when decoding the video. This is useful for videos with special codecs that require specific decoders.
|
|
125
|
+
`),
|
|
126
|
+
smart: z
|
|
127
|
+
.boolean()
|
|
128
|
+
.default(false)
|
|
129
|
+
.describe(`
|
|
130
|
+
When set to \`true\`, enables AI-powered smart thumbnail selection. Instead of returning thumbnails at regular intervals, the Robot will analyze candidate frames and select the most visually appealing ones.
|
|
131
|
+
|
|
132
|
+
The AI evaluates frames based on:
|
|
133
|
+
- Visual clarity (avoiding blurry or dark frames)
|
|
134
|
+
- Composition quality
|
|
135
|
+
- Face presence and expressions
|
|
136
|
+
- Action and motion (avoiding transition frames)
|
|
137
|
+
- Overall visual interest
|
|
138
|
+
|
|
139
|
+
Smart thumbnail analysis is billed with a 50% margin over the underlying AI provider cost.
|
|
140
|
+
`),
|
|
141
|
+
smart_max_candidates: z
|
|
142
|
+
.number()
|
|
143
|
+
.int()
|
|
144
|
+
.min(2)
|
|
145
|
+
.max(100)
|
|
146
|
+
.default(20)
|
|
147
|
+
.describe(`
|
|
148
|
+
The maximum number of candidate frames to extract and analyze when \`smart\` is \`true\`.
|
|
149
|
+
|
|
150
|
+
A higher number may yield better results but increases processing time and cost. The Robot will extract this many frames evenly distributed across the video, analyze them with AI, and return only the top \`count\` results.
|
|
151
|
+
|
|
152
|
+
This parameter is only used when \`smart\` is \`true\`.
|
|
124
153
|
`),
|
|
125
154
|
})
|
|
126
155
|
.strict()
|
|
@@ -3,7 +3,11 @@ import type { Readable } from 'node:stream'
|
|
|
3
3
|
import type { StepsInput } from '../../alphalib/types/template.ts'
|
|
4
4
|
import type { CreateAssemblyParams, ReplayAssemblyParams } from '../../apiTypes.ts'
|
|
5
5
|
import type { LintFatalLevel } from '../../lintAssemblyInstructions.ts'
|
|
6
|
-
import type {
|
|
6
|
+
import type {
|
|
7
|
+
CompileAssemblyInstructionsFromPromptOptions,
|
|
8
|
+
CreateAssemblyOptions,
|
|
9
|
+
Transloadit,
|
|
10
|
+
} from '../../Transloadit.ts'
|
|
7
11
|
import type { IOutputCtl } from '../OutputCtl.ts'
|
|
8
12
|
import type { NormalizedAssemblyResultFile, NormalizedAssemblyResults } from '../resultFiles.ts'
|
|
9
13
|
import type { ResultUrlRow } from '../resultUrls.ts'
|
|
@@ -44,7 +48,7 @@ import {
|
|
|
44
48
|
import { formatAPIError, readCliInput } from '../helpers.ts'
|
|
45
49
|
import { normalizeAssemblyResults } from '../resultFiles.ts'
|
|
46
50
|
import { collectNormalizedResultUrlRows, printResultUrls } from '../resultUrls.ts'
|
|
47
|
-
import { readStepsInputFile } from '../stepsInput.ts'
|
|
51
|
+
import { parseStepsInputJson, readStepsInputFile } from '../stepsInput.ts'
|
|
48
52
|
import { ensureError, isErrnoException } from '../types.ts'
|
|
49
53
|
import { AuthenticatedCommand, UnauthenticatedCommand } from './BaseCommand.ts'
|
|
50
54
|
|
|
@@ -82,6 +86,14 @@ export interface AssemblyLintOptions {
|
|
|
82
86
|
json?: boolean
|
|
83
87
|
}
|
|
84
88
|
|
|
89
|
+
export interface AssemblyInstructionsCompileOptions {
|
|
90
|
+
maxAttempts?: number
|
|
91
|
+
mcpServerUrl?: string
|
|
92
|
+
model?: string
|
|
93
|
+
prompt: string
|
|
94
|
+
timeout?: number
|
|
95
|
+
}
|
|
96
|
+
|
|
85
97
|
function formatAssemblyReference({
|
|
86
98
|
assemblyId,
|
|
87
99
|
assemblyUrl,
|
|
@@ -325,6 +337,49 @@ export async function lint(
|
|
|
325
337
|
return result.success ? 0 : 1
|
|
326
338
|
}
|
|
327
339
|
|
|
340
|
+
function toPositiveInteger(value: number | undefined, optionName: string): number | undefined {
|
|
341
|
+
if (value == null) {
|
|
342
|
+
return undefined
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
if (!Number.isInteger(value) || value < 1) {
|
|
346
|
+
throw new Error(`${optionName} must be a positive integer`)
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
return value
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
function createCompileOptions({
|
|
353
|
+
maxAttempts,
|
|
354
|
+
mcpServerUrl,
|
|
355
|
+
model,
|
|
356
|
+
prompt,
|
|
357
|
+
timeout,
|
|
358
|
+
}: AssemblyInstructionsCompileOptions): CompileAssemblyInstructionsFromPromptOptions {
|
|
359
|
+
return {
|
|
360
|
+
maxAttempts,
|
|
361
|
+
mcpServerUrl,
|
|
362
|
+
model,
|
|
363
|
+
prompt,
|
|
364
|
+
timeout,
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
async function compileAssemblyInstructions(
|
|
369
|
+
output: IOutputCtl,
|
|
370
|
+
client: Transloadit,
|
|
371
|
+
options: AssemblyInstructionsCompileOptions,
|
|
372
|
+
): Promise<number> {
|
|
373
|
+
try {
|
|
374
|
+
const result = await client.compileAssemblyInstructionsFromPrompt(createCompileOptions(options))
|
|
375
|
+
output.print(result.instructionsJson, result)
|
|
376
|
+
return 0
|
|
377
|
+
} catch (error) {
|
|
378
|
+
output.error(formatAPIError(error))
|
|
379
|
+
return 1
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
|
|
328
383
|
// --- From assemblies-create.ts: Helper classes and functions ---
|
|
329
384
|
interface NodeWatcher {
|
|
330
385
|
on(event: 'error', listener: (err: Error) => void): void
|
|
@@ -1658,6 +1713,64 @@ export async function create(
|
|
|
1658
1713
|
}
|
|
1659
1714
|
|
|
1660
1715
|
// --- Command classes ---
|
|
1716
|
+
export class AssemblyInstructionsCompileCommand extends AuthenticatedCommand {
|
|
1717
|
+
static override paths = [
|
|
1718
|
+
['assembly-instructions', 'compile'],
|
|
1719
|
+
['assembly-instruction', 'compile'],
|
|
1720
|
+
['instructions', 'compile'],
|
|
1721
|
+
]
|
|
1722
|
+
|
|
1723
|
+
static override usage = Command.Usage({
|
|
1724
|
+
category: 'Assembly Instructions',
|
|
1725
|
+
description: 'Compile a prompt into Assembly Instructions',
|
|
1726
|
+
details: `
|
|
1727
|
+
Compile a natural-language prompt into validated Transloadit Assembly Instructions JSON.
|
|
1728
|
+
`,
|
|
1729
|
+
examples: [
|
|
1730
|
+
[
|
|
1731
|
+
'Compile instructions',
|
|
1732
|
+
'transloadit assembly-instructions compile "resize uploaded images to 400px wide"',
|
|
1733
|
+
],
|
|
1734
|
+
],
|
|
1735
|
+
})
|
|
1736
|
+
|
|
1737
|
+
prompt = Option.String({ required: true })
|
|
1738
|
+
|
|
1739
|
+
model = Option.String('--model', {
|
|
1740
|
+
description: 'AI model to use for instruction compilation',
|
|
1741
|
+
})
|
|
1742
|
+
|
|
1743
|
+
mcpServerUrl = Option.String('--mcp-server', {
|
|
1744
|
+
description: 'MCP server URL used for Robot docs and instruction linting',
|
|
1745
|
+
})
|
|
1746
|
+
|
|
1747
|
+
maxAttempts = Option.String('--max-attempts', {
|
|
1748
|
+
description: 'Maximum validation attempts',
|
|
1749
|
+
validator: t.applyCascade(t.isNumber(), [t.isAtLeast(1)]),
|
|
1750
|
+
})
|
|
1751
|
+
|
|
1752
|
+
timeout = Option.String('--timeout', {
|
|
1753
|
+
description: 'Compiler Assembly timeout in milliseconds',
|
|
1754
|
+
validator: t.applyCascade(t.isNumber(), [t.isAtLeast(1)]),
|
|
1755
|
+
})
|
|
1756
|
+
|
|
1757
|
+
protected async run(): Promise<number | undefined> {
|
|
1758
|
+
return await compileAssemblyInstructions(this.output, this.client, {
|
|
1759
|
+
maxAttempts: toPositiveInteger(
|
|
1760
|
+
this.maxAttempts == null ? undefined : Number(this.maxAttempts),
|
|
1761
|
+
'--max-attempts',
|
|
1762
|
+
),
|
|
1763
|
+
mcpServerUrl: this.mcpServerUrl,
|
|
1764
|
+
model: this.model,
|
|
1765
|
+
prompt: this.prompt,
|
|
1766
|
+
timeout: toPositiveInteger(
|
|
1767
|
+
this.timeout == null ? undefined : Number(this.timeout),
|
|
1768
|
+
'--timeout',
|
|
1769
|
+
),
|
|
1770
|
+
})
|
|
1771
|
+
}
|
|
1772
|
+
}
|
|
1773
|
+
|
|
1661
1774
|
export class AssembliesCreateCommand extends AuthenticatedCommand {
|
|
1662
1775
|
static override paths = [
|
|
1663
1776
|
['assemblies', 'create'],
|
|
@@ -1775,6 +1888,135 @@ export class AssembliesCreateCommand extends AuthenticatedCommand {
|
|
|
1775
1888
|
}
|
|
1776
1889
|
}
|
|
1777
1890
|
|
|
1891
|
+
export class RunCommand extends AuthenticatedCommand {
|
|
1892
|
+
static override paths = [['run']]
|
|
1893
|
+
|
|
1894
|
+
static override usage = Command.Usage({
|
|
1895
|
+
category: 'Assemblies',
|
|
1896
|
+
description: 'Compile Assembly Instructions and run them as an Assembly',
|
|
1897
|
+
details: `
|
|
1898
|
+
Compile a natural-language prompt into Assembly Instructions, then run those instructions directly.
|
|
1899
|
+
`,
|
|
1900
|
+
examples: [
|
|
1901
|
+
[
|
|
1902
|
+
'Compile and run',
|
|
1903
|
+
'transloadit run "resize uploaded images to 400px wide" -i input.jpg -o output.jpg',
|
|
1904
|
+
],
|
|
1905
|
+
[
|
|
1906
|
+
'Print result URLs',
|
|
1907
|
+
'transloadit run "extract a waveform image from this audio" -i input.mp3 --print-urls',
|
|
1908
|
+
],
|
|
1909
|
+
],
|
|
1910
|
+
})
|
|
1911
|
+
|
|
1912
|
+
prompt = Option.String({ required: true })
|
|
1913
|
+
|
|
1914
|
+
model = Option.String('--model', {
|
|
1915
|
+
description: 'AI model to use for instruction compilation',
|
|
1916
|
+
})
|
|
1917
|
+
|
|
1918
|
+
mcpServerUrl = Option.String('--mcp-server', {
|
|
1919
|
+
description: 'MCP server URL used for Robot docs and instruction linting',
|
|
1920
|
+
})
|
|
1921
|
+
|
|
1922
|
+
maxAttempts = Option.String('--max-attempts', {
|
|
1923
|
+
description: 'Maximum validation attempts',
|
|
1924
|
+
validator: t.applyCascade(t.isNumber(), [t.isAtLeast(1)]),
|
|
1925
|
+
})
|
|
1926
|
+
|
|
1927
|
+
timeout = Option.String('--timeout', {
|
|
1928
|
+
description: 'Compiler Assembly timeout in milliseconds',
|
|
1929
|
+
validator: t.applyCascade(t.isNumber(), [t.isAtLeast(1)]),
|
|
1930
|
+
})
|
|
1931
|
+
|
|
1932
|
+
inputs = inputPathsOption()
|
|
1933
|
+
|
|
1934
|
+
outputPath = Option.String('--output,-o', {
|
|
1935
|
+
description: 'Specify an output file or directory',
|
|
1936
|
+
})
|
|
1937
|
+
|
|
1938
|
+
fields = Option.Array('--field,-f', {
|
|
1939
|
+
description: 'Set an Assembly field (KEY=VAL)',
|
|
1940
|
+
})
|
|
1941
|
+
|
|
1942
|
+
watch = watchOption()
|
|
1943
|
+
|
|
1944
|
+
recursive = recursiveOption()
|
|
1945
|
+
|
|
1946
|
+
deleteAfterProcessing = deleteAfterProcessingOption()
|
|
1947
|
+
|
|
1948
|
+
reprocessStale = reprocessStaleOption()
|
|
1949
|
+
|
|
1950
|
+
singleAssembly = singleAssemblyOption()
|
|
1951
|
+
|
|
1952
|
+
concurrency = concurrencyOption()
|
|
1953
|
+
|
|
1954
|
+
printUrls = printUrlsOption()
|
|
1955
|
+
|
|
1956
|
+
protected async run(): Promise<number | undefined> {
|
|
1957
|
+
const inputList = this.inputs ?? []
|
|
1958
|
+
|
|
1959
|
+
if (inputList.length === 0 && !process.stdin.isTTY) {
|
|
1960
|
+
inputList.push('-')
|
|
1961
|
+
}
|
|
1962
|
+
|
|
1963
|
+
const fieldsMap = parseTemplateFieldAssignments(this.output, this.fields)
|
|
1964
|
+
if (this.fields != null && fieldsMap == null) {
|
|
1965
|
+
return 1
|
|
1966
|
+
}
|
|
1967
|
+
|
|
1968
|
+
const sharedValidationError = validateSharedFileProcessingOptions({
|
|
1969
|
+
explicitInputCount: this.inputs?.length ?? 0,
|
|
1970
|
+
singleAssembly: this.singleAssembly,
|
|
1971
|
+
watch: this.watch,
|
|
1972
|
+
watchRequiresInputsMessage: 'run --watch requires at least one input',
|
|
1973
|
+
})
|
|
1974
|
+
if (sharedValidationError != null) {
|
|
1975
|
+
this.output.error(sharedValidationError)
|
|
1976
|
+
return 1
|
|
1977
|
+
}
|
|
1978
|
+
|
|
1979
|
+
let compiled: Awaited<ReturnType<Transloadit['compileAssemblyInstructionsFromPrompt']>>
|
|
1980
|
+
try {
|
|
1981
|
+
compiled = await this.client.compileAssemblyInstructionsFromPrompt(
|
|
1982
|
+
createCompileOptions({
|
|
1983
|
+
maxAttempts: toPositiveInteger(
|
|
1984
|
+
this.maxAttempts == null ? undefined : Number(this.maxAttempts),
|
|
1985
|
+
'--max-attempts',
|
|
1986
|
+
),
|
|
1987
|
+
mcpServerUrl: this.mcpServerUrl,
|
|
1988
|
+
model: this.model,
|
|
1989
|
+
prompt: this.prompt,
|
|
1990
|
+
timeout: toPositiveInteger(
|
|
1991
|
+
this.timeout == null ? undefined : Number(this.timeout),
|
|
1992
|
+
'--timeout',
|
|
1993
|
+
),
|
|
1994
|
+
}),
|
|
1995
|
+
)
|
|
1996
|
+
} catch (error) {
|
|
1997
|
+
this.output.error(formatAPIError(error))
|
|
1998
|
+
return 1
|
|
1999
|
+
}
|
|
2000
|
+
|
|
2001
|
+
const { hasFailures, resultUrls } = await create(this.output, this.client, {
|
|
2002
|
+
stepsData: parseStepsInputJson(JSON.stringify(compiled.instructions.steps)),
|
|
2003
|
+
fields: fieldsMap ?? {},
|
|
2004
|
+
watch: this.watch,
|
|
2005
|
+
recursive: this.recursive,
|
|
2006
|
+
inputs: inputList,
|
|
2007
|
+
output: this.outputPath ?? null,
|
|
2008
|
+
del: this.deleteAfterProcessing,
|
|
2009
|
+
reprocessStale: this.reprocessStale,
|
|
2010
|
+
singleAssembly: this.singleAssembly,
|
|
2011
|
+
concurrency: this.concurrency == null ? undefined : Number(this.concurrency),
|
|
2012
|
+
})
|
|
2013
|
+
if (this.printUrls) {
|
|
2014
|
+
printResultUrls(this.output, resultUrls)
|
|
2015
|
+
}
|
|
2016
|
+
return hasFailures ? 1 : undefined
|
|
2017
|
+
}
|
|
2018
|
+
}
|
|
2019
|
+
|
|
1778
2020
|
export class AssembliesListCommand extends AuthenticatedCommand {
|
|
1779
2021
|
static override paths = [
|
|
1780
2022
|
['assemblies', 'list'],
|
|
@@ -9,6 +9,8 @@ import {
|
|
|
9
9
|
AssembliesLintCommand,
|
|
10
10
|
AssembliesListCommand,
|
|
11
11
|
AssembliesReplayCommand,
|
|
12
|
+
AssemblyInstructionsCompileCommand,
|
|
13
|
+
RunCommand,
|
|
12
14
|
} from './assemblies.ts'
|
|
13
15
|
import { SignatureCommand, SmartCdnSignatureCommand, TokenCommand } from './auth.ts'
|
|
14
16
|
import { BillsGetCommand } from './bills.ts'
|
|
@@ -65,6 +67,10 @@ export function createCli(): Cli {
|
|
|
65
67
|
// Uploads commands
|
|
66
68
|
cli.register(UploadCommand)
|
|
67
69
|
|
|
70
|
+
// Prompt-to-Assembly-Instructions commands
|
|
71
|
+
cli.register(AssemblyInstructionsCompileCommand)
|
|
72
|
+
cli.register(RunCommand)
|
|
73
|
+
|
|
68
74
|
// Documentation commands (offline metadata)
|
|
69
75
|
cli.register(DocsRobotsListCommand)
|
|
70
76
|
cli.register(DocsRobotsGetCommand)
|
|
@@ -18,7 +18,7 @@ const wordpressDescribeFields = [
|
|
|
18
18
|
'description',
|
|
19
19
|
] as const satisfies readonly ImageDescribeField[]
|
|
20
20
|
|
|
21
|
-
const defaultDescribeModel = 'anthropic/claude-
|
|
21
|
+
const defaultDescribeModel = 'anthropic/claude-sonnet-5'
|
|
22
22
|
const describeFieldDescriptions = {
|
|
23
23
|
altText: 'A concise accessibility-focused alt text that objectively describes the image',
|
|
24
24
|
title: 'A concise publishable title for the image',
|
|
@@ -53,8 +53,7 @@ const imageDescribeExecutionDefinition = {
|
|
|
53
53
|
kind: 'string',
|
|
54
54
|
propertyName: 'model',
|
|
55
55
|
optionFlags: '--model',
|
|
56
|
-
description:
|
|
57
|
-
'Model to use for generated text fields (default: anthropic/claude-4-sonnet-20250514)',
|
|
56
|
+
description: 'Model to use for generated text fields (default: anthropic/claude-sonnet-5)',
|
|
58
57
|
required: false,
|
|
59
58
|
},
|
|
60
59
|
] as const satisfies readonly IntentOptionDefinition[],
|