@taskmagic/apps-textcortex-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.
Files changed (38) hide show
  1. package/README.md +7 -0
  2. package/package.json +47 -0
  3. package/src/index.d.ts +1 -0
  4. package/src/index.js +47 -0
  5. package/src/index.js.map +1 -0
  6. package/src/lib/actions/create-code.d.ts +8 -0
  7. package/src/lib/actions/create-code.js +120 -0
  8. package/src/lib/actions/create-code.js.map +1 -0
  9. package/src/lib/actions/create-email.d.ts +17 -0
  10. package/src/lib/actions/create-email.js +233 -0
  11. package/src/lib/actions/create-email.js.map +1 -0
  12. package/src/lib/actions/create-paraphrase.d.ts +12 -0
  13. package/src/lib/actions/create-paraphrase.js +191 -0
  14. package/src/lib/actions/create-paraphrase.js.map +1 -0
  15. package/src/lib/actions/create-product-description.d.ts +14 -0
  16. package/src/lib/actions/create-product-description.js +198 -0
  17. package/src/lib/actions/create-product-description.js.map +1 -0
  18. package/src/lib/actions/create-social-caption.d.ts +12 -0
  19. package/src/lib/actions/create-social-caption.js +184 -0
  20. package/src/lib/actions/create-social-caption.js.map +1 -0
  21. package/src/lib/actions/create-summary.d.ts +12 -0
  22. package/src/lib/actions/create-summary.js +191 -0
  23. package/src/lib/actions/create-summary.js.map +1 -0
  24. package/src/lib/actions/create-translation.d.ts +6 -0
  25. package/src/lib/actions/create-translation.js +113 -0
  26. package/src/lib/actions/create-translation.js.map +1 -0
  27. package/src/lib/actions/send-prompt.d.ts +10 -0
  28. package/src/lib/actions/send-prompt.js +162 -0
  29. package/src/lib/actions/send-prompt.js.map +1 -0
  30. package/src/lib/common/auth.d.ts +1 -0
  31. package/src/lib/common/auth.js +66 -0
  32. package/src/lib/common/auth.js.map +1 -0
  33. package/src/lib/common/client.d.ts +12 -0
  34. package/src/lib/common/client.js +26 -0
  35. package/src/lib/common/client.js.map +1 -0
  36. package/src/lib/common/common.d.ts +58 -0
  37. package/src/lib/common/common.js +231 -0
  38. package/src/lib/common/common.js.map +1 -0
package/README.md ADDED
@@ -0,0 +1,7 @@
1
+ # apps-textcortex-ai
2
+
3
+ AI-powered writing assistant for content creation, code generation, translations, and more using multiple AI models.
4
+
5
+ ## Building
6
+
7
+ Run `nx build apps-textcortex-ai` to build the library.
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "@taskmagic/apps-textcortex-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 textcortexAi: import("@taskmagic/pieces-framework").Piece<import("@taskmagic/pieces-framework").SecretTextProperty<true>>;
package/src/index.js ADDED
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.textcortexAi = 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/common/auth");
9
+ const common_1 = require("./lib/common/common");
10
+ const send_prompt_1 = require("./lib/actions/send-prompt");
11
+ const create_paraphrase_1 = require("./lib/actions/create-paraphrase");
12
+ const create_social_caption_1 = require("./lib/actions/create-social-caption");
13
+ const create_translation_1 = require("./lib/actions/create-translation");
14
+ const create_code_1 = require("./lib/actions/create-code");
15
+ const create_email_1 = require("./lib/actions/create-email");
16
+ const create_product_description_1 = require("./lib/actions/create-product-description");
17
+ const create_summary_1 = require("./lib/actions/create-summary");
18
+ exports.textcortexAi = (0, pieces_framework_1.createPiece)({
19
+ displayName: 'TextCortex AI',
20
+ description: 'AI-powered writing assistant for content creation, code generation, translations, and more using multiple AI models.',
21
+ auth: auth_1.textcortexAuth,
22
+ minimumSupportedRelease: '0.30.0',
23
+ logoUrl: 'https://cdn.activepieces.com/pieces/textcortex-ai.png',
24
+ categories: [shared_1.PieceCategory.ARTIFICIAL_INTELLIGENCE],
25
+ authors: ['owuzo', 'onyedikachi-david'],
26
+ actions: [
27
+ send_prompt_1.sendPrompt,
28
+ create_paraphrase_1.createParaphrase,
29
+ create_social_caption_1.createSocialMediaCaption,
30
+ create_translation_1.createTranslation,
31
+ create_code_1.createCode,
32
+ create_email_1.createEmail,
33
+ create_product_description_1.createProductDescription,
34
+ create_summary_1.createSummary,
35
+ (0, pieces_common_1.createCustomApiCallAction)({
36
+ auth: auth_1.textcortexAuth,
37
+ baseUrl: () => common_1.baseUrl,
38
+ authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
39
+ return {
40
+ Authorization: `Bearer ${auth}`,
41
+ };
42
+ }),
43
+ }),
44
+ ],
45
+ triggers: [],
46
+ });
47
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/pieces/community/textcortex-ai/src/index.ts"],"names":[],"mappings":";;;;AAAA,kEAA0D;AAC1D,8CAAkD;AAClD,4DAAqE;AACrE,4CAAmD;AACnD,gDAA8C;AAC9C,2DAAuD;AACvD,uEAAmE;AACnE,+EAA+E;AAC/E,yEAAqE;AACrE,2DAAuD;AACvD,6DAAyD;AACzD,yFAAoF;AACpF,iEAA6D;AAEhD,QAAA,YAAY,GAAG,IAAA,8BAAW,EAAC;IACtC,WAAW,EAAE,eAAe;IAC5B,WAAW,EAAE,sHAAsH;IACnI,IAAI,EAAE,qBAAc;IACpB,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,uDAAuD;IAChE,UAAU,EAAE,CAAC,sBAAa,CAAC,uBAAuB,CAAC;IACnD,OAAO,EAAE,CAAC,OAAO,EAAE,mBAAmB,CAAC;IACvC,OAAO,EAAE;QACP,wBAAU;QACV,oCAAgB;QAChB,gDAAwB;QACxB,sCAAiB;QACjB,wBAAU;QACV,0BAAW;QACX,qDAAwB;QACxB,8BAAa;QACb,IAAA,yCAAyB,EAAC;YACxB,IAAI,EAAE,qBAAc;YACpB,OAAO,EAAE,GAAG,EAAE,CAAC,gBAAO;YACtB,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAC1B,OAAO;oBACL,aAAa,EAAE,UAAU,IAAI,EAAE;iBAChC,CAAC;YACJ,CAAC,CAAA;SACF,CAAC;KACH;IACD,QAAQ,EAAE,EAAE;CACb,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ export declare const createCode: import("@taskmagic/pieces-framework").IAction<import("@taskmagic/pieces-framework").SecretTextProperty<true>, {
2
+ text: import("@taskmagic/pieces-framework").LongTextProperty<true>;
3
+ mode: import("@taskmagic/pieces-framework").StaticDropdownProperty<string, true>;
4
+ model: import("@taskmagic/pieces-framework").StaticDropdownProperty<string, false>;
5
+ max_tokens: import("@taskmagic/pieces-framework").NumberProperty<false>;
6
+ temperature: import("@taskmagic/pieces-framework").NumberProperty<false>;
7
+ n: import("@taskmagic/pieces-framework").NumberProperty<false>;
8
+ }>;
@@ -0,0 +1,120 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createCode = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@taskmagic/pieces-framework");
6
+ const pieces_common_1 = require("@taskmagic/pieces-common");
7
+ const auth_1 = require("../common/auth");
8
+ const client_1 = require("../common/client");
9
+ const common_1 = require("../common/common");
10
+ exports.createCode = (0, pieces_framework_1.createAction)({
11
+ auth: auth_1.textcortexAuth,
12
+ name: 'create_code',
13
+ displayName: 'Create Code',
14
+ description: 'Generate code in a specified programming language based on instructions.',
15
+ props: {
16
+ text: pieces_framework_1.Property.LongText({
17
+ displayName: 'Code Instructions',
18
+ description: 'Describe what you want the code to do (e.g., "Create a function to sort an array")',
19
+ required: true,
20
+ }),
21
+ mode: pieces_framework_1.Property.StaticDropdown({
22
+ displayName: 'Programming Language',
23
+ description: 'Select the programming language for code generation',
24
+ required: true,
25
+ options: {
26
+ options: common_1.PROGRAMMING_LANGUAGES,
27
+ },
28
+ }),
29
+ model: pieces_framework_1.Property.StaticDropdown({
30
+ displayName: 'Model',
31
+ description: 'The language model to use',
32
+ required: false,
33
+ defaultValue: 'gemini-2-0-flash',
34
+ options: {
35
+ options: common_1.AI_MODELS,
36
+ },
37
+ }),
38
+ max_tokens: pieces_framework_1.Property.Number({
39
+ displayName: 'Max Tokens',
40
+ description: 'Maximum length of generated code (1-4096 tokens)',
41
+ required: false,
42
+ defaultValue: 2048,
43
+ }),
44
+ temperature: pieces_framework_1.Property.Number({
45
+ displayName: 'Temperature',
46
+ description: 'Controls creativity (0.0-2.0). Higher values = more creative, lower = more focused.',
47
+ required: false,
48
+ }),
49
+ n: pieces_framework_1.Property.Number({
50
+ displayName: 'Number of Outputs',
51
+ description: 'How many code snippets to generate (1-5)',
52
+ required: false,
53
+ defaultValue: 1,
54
+ }),
55
+ },
56
+ run(context) {
57
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
58
+ var _a, _b, _c, _d, _e, _f, _g;
59
+ try {
60
+ const requestBody = {
61
+ text: context.propsValue.text,
62
+ mode: context.propsValue.mode,
63
+ };
64
+ if (context.propsValue.model && context.propsValue.model !== 'gemini-2-0-flash') {
65
+ requestBody.model = context.propsValue.model;
66
+ }
67
+ if (context.propsValue.max_tokens && context.propsValue.max_tokens !== 2048) {
68
+ requestBody.max_tokens = context.propsValue.max_tokens;
69
+ }
70
+ if (context.propsValue.temperature !== undefined) {
71
+ requestBody.temperature = context.propsValue.temperature;
72
+ }
73
+ if (context.propsValue.n && context.propsValue.n !== 1) {
74
+ requestBody.n = context.propsValue.n;
75
+ }
76
+ const response = yield client_1.textcortexCommon.apiCall({
77
+ auth: context.auth,
78
+ method: pieces_common_1.HttpMethod.POST,
79
+ resourceUri: common_1.API_ENDPOINTS.CODES,
80
+ body: requestBody,
81
+ });
82
+ const outputs = ((_a = response.body.data) === null || _a === void 0 ? void 0 : _a.outputs) || [];
83
+ const generatedCode = outputs.length > 0 ? outputs[0].text : response.body.text || response.body;
84
+ return {
85
+ success: true,
86
+ code: generatedCode,
87
+ outputs: outputs,
88
+ remaining_credits: (_b = response.body.data) === null || _b === void 0 ? void 0 : _b.remaining_credits,
89
+ metadata: {
90
+ instruction: context.propsValue.text,
91
+ programming_language: context.propsValue.mode,
92
+ model: context.propsValue.model || 'gemini-2-0-flash',
93
+ parameters: {
94
+ max_tokens: context.propsValue.max_tokens || 2048,
95
+ temperature: context.propsValue.temperature,
96
+ n: context.propsValue.n || 1,
97
+ },
98
+ timestamp: new Date().toISOString(),
99
+ }
100
+ };
101
+ }
102
+ catch (error) {
103
+ if (((_c = error.response) === null || _c === void 0 ? void 0 : _c.status) === 401) {
104
+ throw new Error('Invalid API key. Please check your TextCortex API key.');
105
+ }
106
+ if (((_d = error.response) === null || _d === void 0 ? void 0 : _d.status) === 429) {
107
+ throw new Error('Rate limit exceeded. Please wait and try again or upgrade your TextCortex plan.');
108
+ }
109
+ if (((_e = error.response) === null || _e === void 0 ? void 0 : _e.status) === 400) {
110
+ throw new Error('Invalid request. Please check your input parameters.');
111
+ }
112
+ if (((_f = error.message) === null || _f === void 0 ? void 0 : _f.includes('network')) || ((_g = error.message) === null || _g === void 0 ? void 0 : _g.includes('timeout'))) {
113
+ throw new Error('Network error. Please check your connection and try again.');
114
+ }
115
+ throw new Error(`Code generation failed: ${error.message || 'Unknown error'}`);
116
+ }
117
+ });
118
+ },
119
+ });
120
+ //# sourceMappingURL=create-code.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-code.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/textcortex-ai/src/lib/actions/create-code.ts"],"names":[],"mappings":";;;;AAAA,kEAAqE;AACrE,4DAAsD;AACtD,yCAAgD;AAChD,6CAAoD;AACpD,6CAAmF;AAEtE,QAAA,UAAU,GAAG,IAAA,+BAAY,EAAC;IACrC,IAAI,EAAE,qBAAc;IACpB,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,aAAa;IAC1B,WAAW,EAAE,0EAA0E;IACvF,KAAK,EAAE;QACL,IAAI,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACtB,WAAW,EAAE,mBAAmB;YAChC,WAAW,EAAE,oFAAoF;YACjG,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,IAAI,EAAE,2BAAQ,CAAC,cAAc,CAAC;YAC5B,WAAW,EAAE,sBAAsB;YACnC,WAAW,EAAE,qDAAqD;YAClE,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,8BAAqB;aAC/B;SACF,CAAC;QACF,KAAK,EAAE,2BAAQ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W,EAAE,OAAO,CAAC,UAAU,CAAC,WAAW;4BAC3C,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC;yBAC7B;wBACD,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;qBACpC;iBACF,CAAC;YACF,CAAC;YAAC,OAAO,KAAU,EAAE,CAAC;gBACpB,IAAI,CAAA,MAAA,KAAK,CAAC,QAAQ,0CAAE,MAAM,MAAK,GAAG,EAAE,CAAC;oBACnC,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAC;gBAC5E,CAAC;gBACD,IAAI,CAAA,MAAA,KAAK,CAAC,QAAQ,0CAAE,MAAM,MAAK,GAAG,EAAE,CAAC;oBACnC,MAAM,IAAI,KAAK,CAAC,iFAAiF,CAAC,CAAC;gBACrG,CAAC;gBACD,IAAI,CAAA,MAAA,KAAK,CAAC,QAAQ,0CAAE,MAAM,MAAK,GAAG,EAAE,CAAC;oBACnC,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAC;gBAC1E,CAAC;gBACD,IAAI,CAAA,MAAA,KAAK,CAAC,OAAO,0CAAE,QAAQ,CAAC,SAAS,CAAC,MAAI,MAAA,KAAK,CAAC,OAAO,0CAAE,QAAQ,CAAC,SAAS,CAAC,CAAA,EAAE,CAAC;oBAC7E,MAAM,IAAI,KAAK,CAAC,4DAA4D,CAAC,CAAC;gBAChF,CAAC;gBAED,MAAM,IAAI,KAAK,CAAC,2BAA2B,KAAK,CAAC,OAAO,IAAI,eAAe,EAAE,CAAC,CAAC;YACjF,CAAC;QACH,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,17 @@
1
+ export declare const createEmail: import("@taskmagic/pieces-framework").IAction<import("@taskmagic/pieces-framework").SecretTextProperty<true>, {
2
+ context: import("@taskmagic/pieces-framework").LongTextProperty<true>;
3
+ mode: import("@taskmagic/pieces-framework").StaticDropdownProperty<string, false>;
4
+ to: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
5
+ from: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
6
+ instructions: import("@taskmagic/pieces-framework").LongTextProperty<false>;
7
+ received_email: import("@taskmagic/pieces-framework").LongTextProperty<false>;
8
+ purpose: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
9
+ company_details: import("@taskmagic/pieces-framework").LongTextProperty<false>;
10
+ model: import("@taskmagic/pieces-framework").StaticDropdownProperty<string, false>;
11
+ formality: import("@taskmagic/pieces-framework").StaticDropdownProperty<string, false>;
12
+ source_lang: import("@taskmagic/pieces-framework").StaticDropdownProperty<string, false>;
13
+ target_lang: import("@taskmagic/pieces-framework").StaticDropdownProperty<string, false>;
14
+ max_tokens: import("@taskmagic/pieces-framework").NumberProperty<false>;
15
+ temperature: import("@taskmagic/pieces-framework").NumberProperty<false>;
16
+ n: import("@taskmagic/pieces-framework").NumberProperty<false>;
17
+ }>;
@@ -0,0 +1,233 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createEmail = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@taskmagic/pieces-framework");
6
+ const pieces_common_1 = require("@taskmagic/pieces-common");
7
+ const auth_1 = require("../common/auth");
8
+ const client_1 = require("../common/client");
9
+ const common_1 = require("../common/common");
10
+ exports.createEmail = (0, pieces_framework_1.createAction)({
11
+ auth: auth_1.textcortexAuth,
12
+ name: 'create_email',
13
+ displayName: 'Create Email',
14
+ description: 'Compose an email using context, recipient ("To"), and sender ("From") metadata.',
15
+ props: {
16
+ context: pieces_framework_1.Property.LongText({
17
+ displayName: 'Context',
18
+ description: 'Context of the email. For example, a summary, or a bullet point list',
19
+ required: true,
20
+ }),
21
+ mode: pieces_framework_1.Property.StaticDropdown({
22
+ displayName: 'Email Mode',
23
+ description: 'The style or tone to be used when writing',
24
+ required: false,
25
+ defaultValue: 'general',
26
+ options: {
27
+ options: [
28
+ { label: 'Reply', value: 'reply' },
29
+ { label: 'General', value: 'general' },
30
+ { label: 'Customer Support', value: 'customer_support' },
31
+ { label: 'Cold Email', value: 'cold' },
32
+ { label: 'From Bullets', value: 'from_bullets' },
33
+ ],
34
+ },
35
+ }),
36
+ to: pieces_framework_1.Property.ShortText({
37
+ displayName: 'To',
38
+ description: 'The recipient of the email',
39
+ required: false,
40
+ }),
41
+ from: pieces_framework_1.Property.ShortText({
42
+ displayName: 'From',
43
+ description: 'The sender of the email',
44
+ required: false,
45
+ }),
46
+ instructions: pieces_framework_1.Property.LongText({
47
+ displayName: 'Instructions',
48
+ description: 'Instructions for the email. Available when mode = reply',
49
+ required: false,
50
+ }),
51
+ received_email: pieces_framework_1.Property.LongText({
52
+ displayName: 'Received Email',
53
+ description: 'The email that is being replied to. Available when mode = reply',
54
+ required: false,
55
+ }),
56
+ purpose: pieces_framework_1.Property.ShortText({
57
+ displayName: 'Purpose',
58
+ description: 'Purpose of the email. Available when mode = cold',
59
+ required: false,
60
+ }),
61
+ company_details: pieces_framework_1.Property.LongText({
62
+ displayName: 'Company Details',
63
+ description: 'Details regarding the company. Available when mode = customer_support',
64
+ required: false,
65
+ }),
66
+ model: pieces_framework_1.Property.StaticDropdown({
67
+ displayName: 'Model',
68
+ description: 'The language model to use',
69
+ required: false,
70
+ defaultValue: 'gemini-2-0-flash',
71
+ options: {
72
+ options: common_1.AI_MODELS,
73
+ },
74
+ }),
75
+ formality: pieces_framework_1.Property.StaticDropdown({
76
+ displayName: 'Formality',
77
+ description: 'The formality of the generated text',
78
+ required: false,
79
+ defaultValue: 'default',
80
+ options: {
81
+ options: common_1.FORMALITY_LEVELS,
82
+ },
83
+ }),
84
+ source_lang: pieces_framework_1.Property.StaticDropdown({
85
+ displayName: 'Source Language',
86
+ description: 'The language of the source text',
87
+ required: false,
88
+ defaultValue: 'en',
89
+ options: {
90
+ options: [
91
+ { label: 'English (Default)', value: 'en' },
92
+ { label: 'Auto-detect', value: 'auto' },
93
+ ...common_1.LANGUAGES.filter(lang => lang.value !== 'en'),
94
+ ],
95
+ },
96
+ }),
97
+ target_lang: pieces_framework_1.Property.StaticDropdown({
98
+ displayName: 'Target Language',
99
+ description: 'The language for the email',
100
+ required: false,
101
+ defaultValue: 'en',
102
+ options: {
103
+ options: [
104
+ { label: 'English (American)', value: 'en' },
105
+ { label: 'English (British)', value: 'en-gb' },
106
+ { label: 'Spanish', value: 'es' },
107
+ { label: 'French', value: 'fr' },
108
+ { label: 'German', value: 'de' },
109
+ { label: 'Portuguese (Brazilian)', value: 'pt-br' },
110
+ { label: 'Portuguese', value: 'pt' },
111
+ ...common_1.LANGUAGES.filter(lang => !['en', 'pt', 'es', 'fr', 'de'].includes(lang.value)),
112
+ ],
113
+ },
114
+ }),
115
+ max_tokens: pieces_framework_1.Property.Number({
116
+ displayName: 'Max Tokens',
117
+ description: 'Maximum length of email (1-4096 tokens)',
118
+ required: false,
119
+ defaultValue: 2048,
120
+ }),
121
+ temperature: pieces_framework_1.Property.Number({
122
+ displayName: 'Temperature',
123
+ description: 'Controls creativity (0.0-2.0). Higher values = more creative, lower = more focused.',
124
+ required: false,
125
+ }),
126
+ n: pieces_framework_1.Property.Number({
127
+ displayName: 'Number of Outputs',
128
+ description: 'How many email drafts to generate (1-5)',
129
+ required: false,
130
+ defaultValue: 1,
131
+ }),
132
+ },
133
+ run(context) {
134
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
135
+ var _a, _b, _c, _d, _e, _f, _g;
136
+ try {
137
+ const requestBody = {};
138
+ if (context.propsValue.context) {
139
+ requestBody.context = context.propsValue.context;
140
+ }
141
+ if (context.propsValue.mode && context.propsValue.mode !== 'general') {
142
+ requestBody.mode = context.propsValue.mode;
143
+ }
144
+ if (context.propsValue.to) {
145
+ requestBody.to = context.propsValue.to;
146
+ }
147
+ if (context.propsValue.from) {
148
+ requestBody.from = context.propsValue.from;
149
+ }
150
+ if (context.propsValue.instructions) {
151
+ requestBody.instructions = context.propsValue.instructions;
152
+ }
153
+ if (context.propsValue.received_email) {
154
+ requestBody.received_email = context.propsValue.received_email;
155
+ }
156
+ if (context.propsValue.purpose) {
157
+ requestBody.purpose = context.propsValue.purpose;
158
+ }
159
+ if (context.propsValue.company_details) {
160
+ requestBody.company_details = context.propsValue.company_details;
161
+ }
162
+ if (context.propsValue.model && context.propsValue.model !== 'gemini-2-0-flash') {
163
+ requestBody.model = context.propsValue.model;
164
+ }
165
+ if (context.propsValue.formality && context.propsValue.formality !== 'default') {
166
+ requestBody.formality = context.propsValue.formality;
167
+ }
168
+ if (context.propsValue.source_lang && context.propsValue.source_lang !== 'en') {
169
+ requestBody.source_lang = context.propsValue.source_lang;
170
+ }
171
+ if (context.propsValue.target_lang && context.propsValue.target_lang !== 'en') {
172
+ requestBody.target_lang = context.propsValue.target_lang;
173
+ }
174
+ if (context.propsValue.max_tokens && context.propsValue.max_tokens !== 2048) {
175
+ requestBody.max_tokens = context.propsValue.max_tokens;
176
+ }
177
+ if (context.propsValue.temperature !== undefined) {
178
+ requestBody.temperature = context.propsValue.temperature;
179
+ }
180
+ if (context.propsValue.n && context.propsValue.n !== 1) {
181
+ requestBody.n = context.propsValue.n;
182
+ }
183
+ const response = yield client_1.textcortexCommon.apiCall({
184
+ auth: context.auth,
185
+ method: pieces_common_1.HttpMethod.POST,
186
+ resourceUri: common_1.API_ENDPOINTS.EMAILS,
187
+ body: requestBody,
188
+ });
189
+ const outputs = ((_a = response.body.data) === null || _a === void 0 ? void 0 : _a.outputs) || [];
190
+ const generatedEmail = outputs.length > 0 ? outputs[0].text : response.body.text || response.body;
191
+ return {
192
+ success: true,
193
+ email: generatedEmail,
194
+ outputs: outputs,
195
+ remaining_credits: (_b = response.body.data) === null || _b === void 0 ? void 0 : _b.remaining_credits,
196
+ metadata: {
197
+ context: context.propsValue.context,
198
+ mode: context.propsValue.mode || 'general',
199
+ to: context.propsValue.to,
200
+ from: context.propsValue.from,
201
+ purpose: context.propsValue.purpose,
202
+ model: context.propsValue.model || 'gemini-2-0-flash',
203
+ formality: context.propsValue.formality || 'default',
204
+ parameters: {
205
+ max_tokens: context.propsValue.max_tokens || 2048,
206
+ temperature: context.propsValue.temperature,
207
+ n: context.propsValue.n || 1,
208
+ source_lang: context.propsValue.source_lang || 'en',
209
+ target_lang: context.propsValue.target_lang || 'en',
210
+ },
211
+ timestamp: new Date().toISOString(),
212
+ }
213
+ };
214
+ }
215
+ catch (error) {
216
+ if (((_c = error.response) === null || _c === void 0 ? void 0 : _c.status) === 401) {
217
+ throw new Error('Invalid API key. Please check your TextCortex API key.');
218
+ }
219
+ if (((_d = error.response) === null || _d === void 0 ? void 0 : _d.status) === 429) {
220
+ throw new Error('Rate limit exceeded. Please wait and try again or upgrade your TextCortex plan.');
221
+ }
222
+ if (((_e = error.response) === null || _e === void 0 ? void 0 : _e.status) === 400) {
223
+ throw new Error('Invalid request. Please check your input parameters.');
224
+ }
225
+ if (((_f = error.message) === null || _f === void 0 ? void 0 : _f.includes('network')) || ((_g = error.message) === null || _g === void 0 ? void 0 : _g.includes('timeout'))) {
226
+ throw new Error('Network error. Please check your connection and try again.');
227
+ }
228
+ throw new Error(`Email generation failed: ${error.message || 'Unknown error'}`);
229
+ }
230
+ });
231
+ },
232
+ });
233
+ //# sourceMappingURL=create-email.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-email.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/textcortex-ai/src/lib/actions/create-email.ts"],"names":[],"mappings":";;;;AAAA,kEAAqE;AACrE,4DAAsD;AACtD,yCAAgD;AAChD,6CAAoD;AACpD,6CAAyF;AAE5E,QAAA,WAAW,GAAG,IAAA,+BAAY,EAAC;IACtC,IAAI,EAAE,qBAAc;IACpB,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,cAAc;IAC3B,WAAW,EAAE,iFAAiF;IAC9F,KAAK,EAAE;QACL,OAAO,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACzB,WAAW,EAAE,SAAS;YACtB,WAAW,EAAE,sEAAsE;YACnF,QAAQ,EAAE,IAAI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F,CAAC;YAAC,OAAO,KAAU,EAAE,CAAC;gBACpB,IAAI,CAAA,MAAA,KAAK,CAAC,QAAQ,0CAAE,MAAM,MAAK,GAAG,EAAE,CAAC;oBACnC,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAC;gBAC5E,CAAC;gBACD,IAAI,CAAA,MAAA,KAAK,CAAC,QAAQ,0CAAE,MAAM,MAAK,GAAG,EAAE,CAAC;oBACnC,MAAM,IAAI,KAAK,CAAC,iFAAiF,CAAC,CAAC;gBACrG,CAAC;gBACD,IAAI,CAAA,MAAA,KAAK,CAAC,QAAQ,0CAAE,MAAM,MAAK,GAAG,EAAE,CAAC;oBACnC,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAC;gBAC1E,CAAC;gBACD,IAAI,CAAA,MAAA,KAAK,CAAC,OAAO,0CAAE,QAAQ,CAAC,SAAS,CAAC,MAAI,MAAA,KAAK,CAAC,OAAO,0CAAE,QAAQ,CAAC,SAAS,CAAC,CAAA,EAAE,CAAC;oBAC7E,MAAM,IAAI,KAAK,CAAC,4DAA4D,CAAC,CAAC;gBAChF,CAAC;gBAED,MAAM,IAAI,KAAK,CAAC,4BAA4B,KAAK,CAAC,OAAO,IAAI,eAAe,EAAE,CAAC,CAAC;YAClF,CAAC;QACH,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,12 @@
1
+ export declare const createParaphrase: import("@taskmagic/pieces-framework").IAction<import("@taskmagic/pieces-framework").SecretTextProperty<true>, {
2
+ text: import("@taskmagic/pieces-framework").LongTextProperty<false>;
3
+ file_id: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
4
+ mode: import("@taskmagic/pieces-framework").StaticDropdownProperty<string, false>;
5
+ model: import("@taskmagic/pieces-framework").StaticDropdownProperty<string, false>;
6
+ formality: import("@taskmagic/pieces-framework").StaticDropdownProperty<string, false>;
7
+ source_lang: import("@taskmagic/pieces-framework").StaticDropdownProperty<string, false>;
8
+ target_lang: import("@taskmagic/pieces-framework").StaticDropdownProperty<string, false>;
9
+ max_tokens: import("@taskmagic/pieces-framework").NumberProperty<false>;
10
+ temperature: import("@taskmagic/pieces-framework").NumberProperty<false>;
11
+ n: import("@taskmagic/pieces-framework").NumberProperty<false>;
12
+ }>;