@taskmagic/apps-vadoo-ai 0.0.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 ADDED
@@ -0,0 +1,3 @@
1
+ # vadoo-ai
2
+
3
+ Vadoo AI — generate AI videos, podcasts, images, and captions.
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "@taskmagic/apps-vadoo-ai",
3
+ "version": "0.0.1",
4
+ "dependencies": {
5
+ "@anthropic-ai/sdk": "0.33.1",
6
+ "@sinclair/typebox": "0.34.11",
7
+ "axios": "1.17.0",
8
+ "axios-retry": "4.4.1",
9
+ "deepmerge-ts": "7.1.0",
10
+ "mime-types": "2.1.35",
11
+ "nanoid": "3.3.8",
12
+ "openai": "4.67.1",
13
+ "replicate": "0.34.1",
14
+ "semver": "7.6.0",
15
+ "zod": "3.25.76",
16
+ "@taskmagic/pieces-common": "0.4.4",
17
+ "@taskmagic/pieces-framework": "0.7.46",
18
+ "@taskmagic/shared": "0.10.171",
19
+ "tslib": "1.14.1"
20
+ },
21
+ "overrides": {
22
+ "cross-spawn": "7.0.6",
23
+ "elliptic": "^6.6.1",
24
+ "fast-xml-parser": "^4.4.1",
25
+ "protobufjs": "^7.5.5",
26
+ "tmp": "^0.2.4",
27
+ "koa": "^2.16.4",
28
+ "picomatch": "^4.0.4",
29
+ "langsmith": "^0.6.0",
30
+ "serialize-javascript": "^6.0.2",
31
+ "elevenlabs": {
32
+ "form-data": "^4.0.4"
33
+ },
34
+ "@tryfabric/martian": {
35
+ "@notionhq/client": "$@notionhq/client"
36
+ },
37
+ "vite": {
38
+ "rollup": "npm:@rollup/wasm-node@^4.61.1"
39
+ }
40
+ },
41
+ "resolutions": {
42
+ "rollup": "npm:@rollup/wasm-node@^4.61.1"
43
+ },
44
+ "types": "./src/index.d.ts",
45
+ "main": "./src/index.js",
46
+ "type": "commonjs"
47
+ }
package/src/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export declare const vadooAi: import("@taskmagic/pieces-framework").Piece<import("@taskmagic/pieces-framework").SecretTextProperty<true>>;
package/src/index.js ADDED
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.vadooAi = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@taskmagic/pieces-framework");
6
+ const shared_1 = require("@taskmagic/shared");
7
+ const pieces_common_1 = require("@taskmagic/pieces-common");
8
+ const auth_1 = require("./lib/auth");
9
+ const generate_video_1 = require("./lib/actions/generate-video");
10
+ const generate_podcast_1 = require("./lib/actions/generate-podcast");
11
+ const generate_ai_image_1 = require("./lib/actions/generate-ai-image");
12
+ const generate_ai_captions_1 = require("./lib/actions/generate-ai-captions");
13
+ exports.vadooAi = (0, pieces_framework_1.createPiece)({
14
+ displayName: 'Vadoo AI',
15
+ auth: auth_1.vadooAiAuth,
16
+ minimumSupportedRelease: '0.30.0',
17
+ logoUrl: 'https://cdn.activepieces.com/pieces/vadoo-ai.png',
18
+ categories: [shared_1.PieceCategory.ARTIFICIAL_INTELLIGENCE],
19
+ authors: ['fortunamide'],
20
+ actions: [
21
+ generate_video_1.generateVideo,
22
+ generate_podcast_1.generatePodcast,
23
+ generate_ai_image_1.generateAiImage,
24
+ generate_ai_captions_1.generateAiCaptions,
25
+ (0, pieces_common_1.createCustomApiCallAction)({
26
+ auth: auth_1.vadooAiAuth,
27
+ baseUrl: () => 'https://viralapi.vadoo.tv/api',
28
+ authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
29
+ return {
30
+ 'X-API-KEY': auth,
31
+ };
32
+ }),
33
+ }),
34
+ ],
35
+ triggers: [],
36
+ });
37
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/pieces/community/vadoo-ai/src/index.ts"],"names":[],"mappings":";;;;AAAA,kEAA0D;AAC1D,8CAAkD;AAClD,4DAAqE;AACrE,qCAAyC;AACzC,iEAA6D;AAC7D,qEAAiE;AACjE,uEAAkE;AAClE,6EAAwE;AAE3D,QAAA,OAAO,GAAG,IAAA,8BAAW,EAAC;IACjC,WAAW,EAAE,UAAU;IACvB,IAAI,EAAE,kBAAW;IACjB,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,kDAAkD;IAC3D,UAAU,EAAE,CAAC,sBAAa,CAAC,uBAAuB,CAAC;IACnD,OAAO,EAAE,CAAC,aAAa,CAAC;IACxB,OAAO,EAAE;QACP,8BAAa;QACb,kCAAe;QACf,mCAAe;QACf,yCAAkB;QAClB,IAAA,yCAAyB,EAAC;YACxB,IAAI,EAAE,kBAAW;YACjB,OAAO,EAAE,GAAG,EAAE,CAAC,+BAA+B;YAC9C,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAC1B,OAAO;oBACL,WAAW,EAAE,IAAc;iBAC5B,CAAC;YACJ,CAAC,CAAA;SACF,CAAC;KACH;IACD,QAAQ,EAAE,EAAE;CACb,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare const generateAiCaptions: import("@taskmagic/pieces-framework").IAction<import("@taskmagic/pieces-framework").SecretTextProperty<true>, {
2
+ url: import("@taskmagic/pieces-framework").ShortTextProperty<true>;
3
+ theme: import("@taskmagic/pieces-framework").DropdownProperty<string, false>;
4
+ language: import("@taskmagic/pieces-framework").DropdownProperty<string, false>;
5
+ }>;
@@ -0,0 +1,149 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.generateAiCaptions = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@taskmagic/pieces-framework");
6
+ const auth_1 = require("../auth");
7
+ const pieces_common_1 = require("@taskmagic/pieces-common");
8
+ const schemas_1 = require("../schemas");
9
+ const shared_1 = require("@taskmagic/shared");
10
+ exports.generateAiCaptions = (0, pieces_framework_1.createAction)({
11
+ auth: auth_1.vadooAiAuth,
12
+ name: 'generate_ai_captions',
13
+ displayName: 'Generate AI Captions',
14
+ description: 'Generates AI captions for a video.',
15
+ props: {
16
+ url: pieces_framework_1.Property.ShortText({
17
+ displayName: 'Video URL',
18
+ description: 'URL of the input video to add captions to',
19
+ required: true,
20
+ }),
21
+ theme: pieces_framework_1.Property.Dropdown({
22
+ displayName: 'Theme',
23
+ description: 'To display captions with style',
24
+ required: false,
25
+ refreshers: [],
26
+ options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
27
+ if (!auth) {
28
+ return {
29
+ disabled: true,
30
+ options: [],
31
+ placeholder: 'Please authenticate first',
32
+ };
33
+ }
34
+ try {
35
+ const response = yield pieces_common_1.httpClient.sendRequest({
36
+ method: pieces_common_1.HttpMethod.GET,
37
+ url: 'https://viralapi.vadoo.tv/api/get_themes',
38
+ headers: {
39
+ 'X-API-KEY': auth,
40
+ },
41
+ });
42
+ const themes = response.body;
43
+ return {
44
+ disabled: false,
45
+ options: themes.map((theme) => ({
46
+ label: theme,
47
+ value: theme,
48
+ })),
49
+ };
50
+ }
51
+ catch (error) {
52
+ return {
53
+ disabled: true,
54
+ options: [],
55
+ placeholder: 'Failed to load themes.',
56
+ };
57
+ }
58
+ }),
59
+ }),
60
+ language: pieces_framework_1.Property.Dropdown({
61
+ displayName: 'Language',
62
+ description: 'To generate captions in language you want',
63
+ required: false,
64
+ refreshers: [],
65
+ options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
66
+ if (!auth) {
67
+ return {
68
+ disabled: true,
69
+ options: [],
70
+ placeholder: 'Please authenticate first',
71
+ };
72
+ }
73
+ try {
74
+ const response = yield pieces_common_1.httpClient.sendRequest({
75
+ method: pieces_common_1.HttpMethod.GET,
76
+ url: 'https://viralapi.vadoo.tv/api/get_languages',
77
+ headers: {
78
+ 'X-API-KEY': auth,
79
+ },
80
+ });
81
+ const languages = response.body;
82
+ return {
83
+ disabled: false,
84
+ options: languages.map((language) => ({
85
+ label: language,
86
+ value: language,
87
+ })),
88
+ };
89
+ }
90
+ catch (error) {
91
+ return {
92
+ disabled: true,
93
+ options: [],
94
+ placeholder: 'Failed to load languages',
95
+ };
96
+ }
97
+ }),
98
+ }),
99
+ },
100
+ run(context) {
101
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
102
+ // Validate props with Zod schema
103
+ yield pieces_common_1.propsValidation.validateZod(context.propsValue, schemas_1.generateAiCaptionsSchema);
104
+ const { url, theme, language } = context.propsValue;
105
+ // Build request body, only including non-empty values
106
+ const requestBody = {
107
+ url: url,
108
+ };
109
+ if (theme)
110
+ requestBody['theme'] = theme;
111
+ if (language)
112
+ requestBody['language'] = language;
113
+ const response = yield pieces_common_1.httpClient.sendRequest({
114
+ method: pieces_common_1.HttpMethod.POST,
115
+ url: 'https://viralapi.vadoo.tv/api/add_captions',
116
+ headers: {
117
+ 'X-API-KEY': context.auth,
118
+ 'Content-Type': 'application/json',
119
+ },
120
+ body: requestBody,
121
+ });
122
+ if ((0, shared_1.isEmpty)(response.body) || (0, shared_1.isEmpty)(response.body.vid)) {
123
+ throw new Error('Failed to generate captions.');
124
+ }
125
+ const videoId = response.body.vid;
126
+ let status = 'pending';
127
+ const timeoutAt = Date.now() + 5 * 60 * 1000;
128
+ do {
129
+ yield new Promise((resolve) => setTimeout(resolve, 5000));
130
+ const pollRes = yield pieces_common_1.httpClient.sendRequest({
131
+ method: pieces_common_1.HttpMethod.GET,
132
+ url: 'https://viralapi.vadoo.tv/api/get_video_url',
133
+ headers: {
134
+ 'X-API-KEY': context.auth,
135
+ 'Content-Type': 'application/json',
136
+ },
137
+ queryParams: {
138
+ id: videoId.toString(),
139
+ },
140
+ });
141
+ status = pollRes.body.status;
142
+ if (status === 'complete')
143
+ return pollRes.body;
144
+ } while (status !== 'complete' && Date.now() < timeoutAt);
145
+ throw new Error('Generate Caption timed out or failed.');
146
+ });
147
+ },
148
+ });
149
+ //# sourceMappingURL=generate-ai-captions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-ai-captions.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/vadoo-ai/src/lib/actions/generate-ai-captions.ts"],"names":[],"mappings":";;;;AAAA,kEAAqE;AACrE,kCAAsC;AACtC,4DAIkC;AAClC,wCAAsD;AACtD,8CAA4C;AAE/B,QAAA,kBAAkB,GAAG,IAAA,+BAAY,EAAC;IAC7C,IAAI,EAAE,kBAAW;IACjB,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,sBAAsB;IACnC,WAAW,EAAE,oCAAoC;IACjD,KAAK,EAAE;QACL,GAAG,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACtB,WAAW,EAAE,WAAW;YACxB,WAAW,EAAE,2CAA2C;YACxD,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,KAAK,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACvB,WAAW,EAAE,OAAO;YACpB,WAAW,EAAE,gCAAgC;YAC7C,QAAQ,EAAE,KAAK;YACf,UAAU,EAAE,EAAE;YACd,OAAO,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;gBACtB,IAAI,CAAC,IAAI,EAAE,CAAC;oBACV,OAAO;wBACL,QAAQ,EAAE,IAAI;wBACd,OAAO,EAAE,EAAE;wBACX,WAAW,EAAE,2BAA2B;qBACzC,CAAC;gBACJ,CAAC;gBAED,IAAI,CAAC;oBACH,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;wBAC5C,MAAM,EAAE,0BAAU,CAAC,GAAG;wBACtB,GAAG,EAAE,0CAA0C;wBAC/C,OAAO,EAAE;4BACP,WAAW,EAAE,IAAc;yBAC5B;qBACF,CAAC,CAAC;oBAEH,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAgB,CAAC;oBACzC,OAAO;wBACL,QAAQ,EAAE,KAAK;wBACf,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;4BAC9B,KAAK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,MAAM,OAAO,GAAG,MAAM,0BAAU,CAAC,WAAW,CAGzC;oBACD,MAAM,EAAE,0BAAU,CAAC,GAAG;oBACtB,GAAG,EAAE,6CAA6C;oBAClD,OAAO,EAAE;wBACP,WAAW,EAAE,OAAO,CAAC,IAAc;wBACnC,cAAc,EAAE,kBAAkB;qBACnC;oBACD,WAAW,EAAE;wBACX,EAAE,EAAE,OAAO,CAAC,QAAQ,EAAE;qBACvB;iBACF,CAAC,CAAC;gBAEH,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC;gBAC7B,IAAI,MAAM,KAAK,UAAU;oBAAE,OAAO,OAAO,CAAC,IAAI,CAAC;YACjD,CAAC,QAAQ,MAAM,KAAK,UAAU,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,EAAE;YAE1D,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;QAC3D,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare const generateAiImage: import("@taskmagic/pieces-framework").IAction<import("@taskmagic/pieces-framework").SecretTextProperty<true>, {
2
+ id: import("@taskmagic/pieces-framework").DropdownProperty<string, true>;
3
+ ratio: import("@taskmagic/pieces-framework").StaticDropdownProperty<string, true>;
4
+ prompt: import("@taskmagic/pieces-framework").LongTextProperty<true>;
5
+ }>;
@@ -0,0 +1,122 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.generateAiImage = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@taskmagic/pieces-framework");
6
+ const auth_1 = require("../auth");
7
+ const pieces_common_1 = require("@taskmagic/pieces-common");
8
+ const schemas_1 = require("../schemas");
9
+ const shared_1 = require("@taskmagic/shared");
10
+ exports.generateAiImage = (0, pieces_framework_1.createAction)({
11
+ auth: auth_1.vadooAiAuth,
12
+ name: 'generate_ai_image',
13
+ displayName: 'Generate AI Image',
14
+ description: 'Generates AI generated image based on prompt for a character.',
15
+ props: {
16
+ id: pieces_framework_1.Property.Dropdown({
17
+ displayName: 'Character',
18
+ description: 'Select the character to generate an image for',
19
+ required: true,
20
+ refreshers: [],
21
+ options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
22
+ if (!auth) {
23
+ return {
24
+ disabled: true,
25
+ options: [],
26
+ placeholder: 'Please authenticate first',
27
+ };
28
+ }
29
+ try {
30
+ const response = yield pieces_common_1.httpClient.sendRequest({
31
+ method: pieces_common_1.HttpMethod.GET,
32
+ url: 'https://viralapi.vadoo.tv/api/get_all_characters',
33
+ headers: {
34
+ 'X-API-KEY': auth,
35
+ },
36
+ });
37
+ const characters = response.body;
38
+ return {
39
+ disabled: false,
40
+ options: characters.map((character) => ({
41
+ label: `${character.name} (ID: ${character.id})`,
42
+ value: character.id.toString(),
43
+ })),
44
+ };
45
+ }
46
+ catch (error) {
47
+ return {
48
+ disabled: true,
49
+ options: [],
50
+ placeholder: 'Failed to load characters',
51
+ };
52
+ }
53
+ }),
54
+ }),
55
+ ratio: pieces_framework_1.Property.StaticDropdown({
56
+ displayName: 'Aspect Ratio',
57
+ description: 'The aspect ratio for the generated image',
58
+ required: true,
59
+ options: {
60
+ options: [
61
+ { label: '9:16 (Portrait)', value: '9:16' },
62
+ { label: '1:1 (Square)', value: '1:1' },
63
+ { label: '16:9 (Landscape)', value: '16:9' },
64
+ { label: '3:4 (Portrait)', value: '3:4' },
65
+ { label: '4:3 (Landscape)', value: '4:3' },
66
+ ],
67
+ },
68
+ }),
69
+ prompt: pieces_framework_1.Property.LongText({
70
+ displayName: 'Image Prompt',
71
+ description: 'Prompt to generate a character image',
72
+ required: true,
73
+ }),
74
+ },
75
+ run(context) {
76
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
77
+ // Validate props with Zod schema
78
+ yield pieces_common_1.propsValidation.validateZod(context.propsValue, schemas_1.generateAiImageSchema);
79
+ const { id, ratio, prompt } = context.propsValue;
80
+ // Build request body
81
+ const requestBody = {
82
+ id: parseInt(id, 10),
83
+ ratio: ratio,
84
+ prompt: prompt,
85
+ };
86
+ const response = yield pieces_common_1.httpClient.sendRequest({
87
+ method: pieces_common_1.HttpMethod.POST,
88
+ url: 'https://viralapi.vadoo.tv/api/generate_character_image',
89
+ headers: {
90
+ 'X-API-KEY': context.auth,
91
+ 'Content-Type': 'application/json',
92
+ },
93
+ body: requestBody,
94
+ });
95
+ if ((0, shared_1.isEmpty)(response.body) || (0, shared_1.isEmpty)(response.body.id)) {
96
+ throw new Error('Failed to generate image.');
97
+ }
98
+ const imageId = response.body.id;
99
+ let status = 'pending';
100
+ const timeoutAt = Date.now() + 5 * 60 * 1000;
101
+ do {
102
+ yield new Promise((resolve) => setTimeout(resolve, 5000));
103
+ const pollRes = yield pieces_common_1.httpClient.sendRequest({
104
+ method: pieces_common_1.HttpMethod.GET,
105
+ url: 'https://viralapi.vadoo.tv/api/get_character_image',
106
+ headers: {
107
+ 'X-API-KEY': context.auth,
108
+ 'Content-Type': 'application/json',
109
+ },
110
+ queryParams: {
111
+ id: imageId.toString(),
112
+ },
113
+ });
114
+ status = pollRes.body.status;
115
+ if (status === 'complete')
116
+ return pollRes.body;
117
+ } while (status !== 'complete' && Date.now() < timeoutAt);
118
+ throw new Error('Generate Image timed out or failed.');
119
+ });
120
+ },
121
+ });
122
+ //# sourceMappingURL=generate-ai-image.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-ai-image.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/vadoo-ai/src/lib/actions/generate-ai-image.ts"],"names":[],"mappings":";;;;AAAA,kEAAqE;AACrE,kCAAsC;AACtC,4DAIkC;AAClC,wCAAmD;AACnD,8CAA4C;AAE/B,QAAA,eAAe,GAAG,IAAA,+BAAY,EAAC;IAC1C,IAAI,EAAE,kBAAW;IACjB,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE,mBAAmB;IAChC,WAAW,EAAE,+DAA+D;IAC5E,KAAK,EAAE;QACL,E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AC;gBACxD,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;YAC/C,CAAC;YAED,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YACjC,IAAI,MAAM,GAAG,SAAS,CAAC;YACvB,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC;YAE7C,GAAG,CAAC;gBACF,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;gBAC1D,MAAM,OAAO,GAAG,MAAM,0BAAU,CAAC,WAAW,CAGzC;oBACD,MAAM,EAAE,0BAAU,CAAC,GAAG;oBACtB,GAAG,EAAE,mDAAmD;oBACxD,OAAO,EAAE;wBACP,WAAW,EAAE,OAAO,CAAC,IAAc;wBACnC,cAAc,EAAE,kBAAkB;qBACnC;oBACD,WAAW,EAAE;wBACX,EAAE,EAAE,OAAO,CAAC,QAAQ,EAAE;qBACvB;iBACF,CAAC,CAAC;gBAEH,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC;gBAC7B,IAAI,MAAM,KAAK,UAAU;oBAAE,OAAO,OAAO,CAAC,IAAI,CAAC;YACjD,CAAC,QAAQ,MAAM,KAAK,UAAU,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,EAAE;YAE1D,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;QACzD,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,13 @@
1
+ export declare const generatePodcast: import("@taskmagic/pieces-framework").IAction<import("@taskmagic/pieces-framework").SecretTextProperty<true>, {
2
+ content_source: import("@taskmagic/pieces-framework").StaticDropdownProperty<string, true>;
3
+ url: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
4
+ text: import("@taskmagic/pieces-framework").LongTextProperty<false>;
5
+ name1: import("@taskmagic/pieces-framework").ShortTextProperty<true>;
6
+ voice1: import("@taskmagic/pieces-framework").DropdownProperty<string, false>;
7
+ name2: import("@taskmagic/pieces-framework").ShortTextProperty<true>;
8
+ voice2: import("@taskmagic/pieces-framework").DropdownProperty<string, false>;
9
+ theme: import("@taskmagic/pieces-framework").DropdownProperty<string, false>;
10
+ language: import("@taskmagic/pieces-framework").DropdownProperty<string, false>;
11
+ duration: import("@taskmagic/pieces-framework").StaticDropdownProperty<string, false>;
12
+ tone: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
13
+ }>;