@ha-bits/bit-intersect 0.1.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.
Files changed (58) hide show
  1. package/README.md +41 -0
  2. package/dist/index.d.ts +12 -0
  3. package/dist/index.d.ts.map +1 -0
  4. package/dist/index.js +72 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/lib/actions/ask-assistant.d.ts +6 -0
  7. package/dist/lib/actions/ask-assistant.d.ts.map +1 -0
  8. package/dist/lib/actions/ask-assistant.js +121 -0
  9. package/dist/lib/actions/ask-assistant.js.map +1 -0
  10. package/dist/lib/actions/create-canvas.d.ts +6 -0
  11. package/dist/lib/actions/create-canvas.d.ts.map +1 -0
  12. package/dist/lib/actions/create-canvas.js +127 -0
  13. package/dist/lib/actions/create-canvas.js.map +1 -0
  14. package/dist/lib/actions/create-video.d.ts +6 -0
  15. package/dist/lib/actions/create-video.d.ts.map +1 -0
  16. package/dist/lib/actions/create-video.js +46 -0
  17. package/dist/lib/actions/create-video.js.map +1 -0
  18. package/dist/lib/actions/extract-structure-data.action.d.ts +6 -0
  19. package/dist/lib/actions/extract-structure-data.action.d.ts.map +1 -0
  20. package/dist/lib/actions/extract-structure-data.action.js +151 -0
  21. package/dist/lib/actions/extract-structure-data.action.js.map +1 -0
  22. package/dist/lib/actions/generate-image.d.ts +6 -0
  23. package/dist/lib/actions/generate-image.d.ts.map +1 -0
  24. package/dist/lib/actions/generate-image.js +140 -0
  25. package/dist/lib/actions/generate-image.js.map +1 -0
  26. package/dist/lib/actions/index.d.ts +16 -0
  27. package/dist/lib/actions/index.d.ts.map +1 -0
  28. package/dist/lib/actions/index.js +30 -0
  29. package/dist/lib/actions/index.js.map +1 -0
  30. package/dist/lib/actions/send-prompt.d.ts +6 -0
  31. package/dist/lib/actions/send-prompt.d.ts.map +1 -0
  32. package/dist/lib/actions/send-prompt.js +187 -0
  33. package/dist/lib/actions/send-prompt.js.map +1 -0
  34. package/dist/lib/actions/text-to-speech.d.ts +6 -0
  35. package/dist/lib/actions/text-to-speech.d.ts.map +1 -0
  36. package/dist/lib/actions/text-to-speech.js +111 -0
  37. package/dist/lib/actions/text-to-speech.js.map +1 -0
  38. package/dist/lib/actions/text-to-voice.d.ts +6 -0
  39. package/dist/lib/actions/text-to-voice.d.ts.map +1 -0
  40. package/dist/lib/actions/text-to-voice.js +124 -0
  41. package/dist/lib/actions/text-to-voice.js.map +1 -0
  42. package/dist/lib/actions/transcriptions.d.ts +6 -0
  43. package/dist/lib/actions/transcriptions.d.ts.map +1 -0
  44. package/dist/lib/actions/transcriptions.js +74 -0
  45. package/dist/lib/actions/transcriptions.js.map +1 -0
  46. package/dist/lib/actions/translation.d.ts +6 -0
  47. package/dist/lib/actions/translation.d.ts.map +1 -0
  48. package/dist/lib/actions/translation.js +59 -0
  49. package/dist/lib/actions/translation.js.map +1 -0
  50. package/dist/lib/actions/vision-prompt.d.ts +6 -0
  51. package/dist/lib/actions/vision-prompt.d.ts.map +1 -0
  52. package/dist/lib/actions/vision-prompt.js +147 -0
  53. package/dist/lib/actions/vision-prompt.js.map +1 -0
  54. package/dist/lib/common/common.d.ts +49 -0
  55. package/dist/lib/common/common.d.ts.map +1 -0
  56. package/dist/lib/common/common.js +295 -0
  57. package/dist/lib/common/common.js.map +1 -0
  58. package/package.json +53 -0
package/README.md ADDED
@@ -0,0 +1,41 @@
1
+ # @ha-bits/bit-intersect
2
+
3
+ Intersect AI integration bit module for the Habits workflow system.
4
+
5
+ This module provides AI actions (chat, image generation, transcription, etc.) that connect to Intersect AI services.
6
+
7
+ ## Key Difference from @ha-bits/piece-intersect
8
+
9
+ This module imports from `@ha-bits/cortex` instead of `@activepieces/*` packages, making it fully independent of the Activepieces ecosystem.
10
+
11
+ ## Features
12
+
13
+ - Send prompts to AI models
14
+ - Generate images
15
+ - Text-to-speech conversion
16
+ - Audio transcription and translation
17
+ - Vision prompts (analyze images)
18
+ - Structured data extraction
19
+ - Create videos
20
+ - Ask AI assistant
21
+
22
+ ## Installation
23
+
24
+ ```bash
25
+ npm install @ha-bits/bit-intersect
26
+ ```
27
+
28
+ ## Usage
29
+
30
+ This module is designed to be used with the Habits workflow executor:
31
+
32
+ ```typescript
33
+ import { intersect } from '@ha-bits/bit-intersect';
34
+
35
+ // Use in workflow configuration
36
+ const action = intersect.actions.send_prompt;
37
+ ```
38
+
39
+ ## License
40
+
41
+ MIT
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @ha-bits/bit-intersect
3
+ *
4
+ * Intersect AI integration bit module for the Habits workflow system.
5
+ * This module imports from @ha-bits/cortex instead of @activepieces/* packages.
6
+ */
7
+ import { intersectAuth, openaiAuth } from './lib/common/common';
8
+ export { intersectAuth, openaiAuth };
9
+ export declare const intersect: any;
10
+ export declare const openai: any;
11
+ export default intersect;
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAeH,OAAO,EAAuB,aAAa,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAQrF,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,CAAC;AAErC,eAAO,MAAM,SAAS,KA0CpB,CAAC;AAGH,eAAO,MAAM,MAAM,KAAY,CAAC;AAGhC,eAAe,SAAS,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ /**
3
+ * @ha-bits/bit-intersect
4
+ *
5
+ * Intersect AI integration bit module for the Habits workflow system.
6
+ * This module imports from @ha-bits/cortex instead of @activepieces/* packages.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.openai = exports.intersect = exports.openaiAuth = exports.intersectAuth = void 0;
10
+ const cortex_1 = require("@ha-bits/cortex");
11
+ const ask_assistant_1 = require("./lib/actions/ask-assistant");
12
+ const generate_image_1 = require("./lib/actions/generate-image");
13
+ const send_prompt_1 = require("./lib/actions/send-prompt");
14
+ const text_to_speech_1 = require("./lib/actions/text-to-speech");
15
+ const transcriptions_1 = require("./lib/actions/transcriptions");
16
+ const translation_1 = require("./lib/actions/translation");
17
+ const vision_prompt_1 = require("./lib/actions/vision-prompt");
18
+ const common_1 = require("./lib/common/common");
19
+ Object.defineProperty(exports, "intersectAuth", { enumerable: true, get: function () { return common_1.intersectAuth; } });
20
+ Object.defineProperty(exports, "openaiAuth", { enumerable: true, get: function () { return common_1.openaiAuth; } });
21
+ const extract_structure_data_action_1 = require("./lib/actions/extract-structure-data.action");
22
+ const create_video_1 = require("./lib/actions/create-video");
23
+ const text_to_voice_1 = require("./lib/actions/text-to-voice");
24
+ const create_canvas_1 = require("./lib/actions/create-canvas");
25
+ exports.intersect = (0, cortex_1.createBit)({
26
+ displayName: 'Intersect',
27
+ description: 'Use Intersect AI tools including ChatGPT, image generation, and canvas features.',
28
+ minimumSupportedRelease: '0.63.0',
29
+ logoUrl: 'lucide:Sparkles',
30
+ categories: [cortex_1.PieceCategory.ARTIFICIAL_INTELLIGENCE],
31
+ auth: common_1.intersectAuth,
32
+ actions: [
33
+ send_prompt_1.askOpenAI,
34
+ ask_assistant_1.askAssistant,
35
+ generate_image_1.generateImage,
36
+ vision_prompt_1.visionPrompt,
37
+ text_to_speech_1.textToSpeech,
38
+ transcriptions_1.transcribeAction,
39
+ translation_1.translateAction,
40
+ extract_structure_data_action_1.extractStructuredDataAction,
41
+ create_video_1.createVideo,
42
+ text_to_voice_1.textToVoice,
43
+ create_canvas_1.createCanvas,
44
+ (0, cortex_1.createCustomApiCallAction)({
45
+ auth: common_1.intersectAuth,
46
+ baseUrl: (auth) => (0, common_1.getIntersectBaseUrl)(auth.host),
47
+ authMapping: async (auth) => ({
48
+ headers: {
49
+ Authorization: `Bearer ${auth.apiKey}`,
50
+ },
51
+ }),
52
+ }),
53
+ ],
54
+ authors: [
55
+ 'aboudzein',
56
+ 'astorozhevsky',
57
+ 'Willianwg',
58
+ 'Nilesh',
59
+ 'Salem-Alaa',
60
+ 'kishanprmr',
61
+ 'MoShizzle',
62
+ 'khaledmashaly',
63
+ 'abuaboud',
64
+ 'amrdb',
65
+ ],
66
+ triggers: [],
67
+ });
68
+ // Keep for backwards compatibility
69
+ exports.openai = exports.intersect;
70
+ // Default export
71
+ exports.default = exports.intersect;
72
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,4CAIyB;AAEzB,+DAA2D;AAC3D,iEAA6D;AAC7D,2DAAsD;AACtD,iEAA4D;AAC5D,iEAAgE;AAChE,2DAA4D;AAC5D,+DAA2D;AAC3D,gDAAqF;AAQ5E,8FARqB,sBAAa,OAQrB;AAAE,2FARqB,mBAAU,OAQrB;AAPlC,+FAA0F;AAE1F,6DAAyD;AACzD,+DAA0D;AAC1D,+DAA2D;AAK9C,QAAA,SAAS,GAAG,IAAA,kBAAS,EAAC;IACjC,WAAW,EAAE,WAAW;IACxB,WAAW,EAAE,kFAAkF;IAC/F,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,iBAAiB;IAC1B,UAAU,EAAE,CAAC,sBAAa,CAAC,uBAAuB,CAAC;IACnD,IAAI,EAAE,sBAAa;IACnB,OAAO,EAAE;QACP,uBAAS;QACT,4BAAY;QACZ,8BAAa;QACb,4BAAY;QACZ,6BAAY;QACZ,iCAAgB;QAChB,6BAAe;QACf,2DAA2B;QAC3B,0BAAW;QACX,2BAAW;QACX,4BAAY;QACZ,IAAA,kCAAyB,EAAC;YACxB,IAAI,EAAE,sBAAoB;YAC1B,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,4BAAmB,EAAE,IAAoC,CAAC,IAAI,CAAC;YAClF,WAAW,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;gBAC5B,OAAO,EAAE;oBACP,aAAa,EAAE,UAAW,IAAsC,CAAC,MAAM,EAAE;iBAC1E;aACF,CAAC;SACH,CAAQ;KACV;IACD,OAAO,EAAE;QACP,WAAW;QACX,eAAe;QACf,WAAW;QACX,QAAQ;QACR,YAAY;QACZ,YAAY;QACZ,WAAW;QACX,eAAe;QACf,UAAU;QACV,OAAO;KACR;IACD,QAAQ,EAAE,EAAE;CACb,CAAC,CAAC;AAEH,mCAAmC;AACtB,QAAA,MAAM,GAAG,iBAAS,CAAC;AAEhC,iBAAiB;AACjB,kBAAe,iBAAS,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Ask Assistant Action
3
+ * Ask a GPT assistant anything you want!
4
+ */
5
+ export declare const askAssistant: any;
6
+ //# sourceMappingURL=ask-assistant.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ask-assistant.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/ask-assistant.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAWH,eAAO,MAAM,YAAY,KAuHvB,CAAC"}
@@ -0,0 +1,121 @@
1
+ "use strict";
2
+ /**
3
+ * Ask Assistant Action
4
+ * Ask a GPT assistant anything you want!
5
+ */
6
+ var __importDefault = (this && this.__importDefault) || function (mod) {
7
+ return (mod && mod.__esModule) ? mod : { "default": mod };
8
+ };
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.askAssistant = void 0;
11
+ const cortex_1 = require("@ha-bits/cortex");
12
+ const openai_1 = __importDefault(require("openai"));
13
+ const common_1 = require("../common/common");
14
+ const common_2 = require("../common/common");
15
+ exports.askAssistant = (0, cortex_1.createAction)({
16
+ auth: common_1.intersectAuth,
17
+ name: 'ask_assistant',
18
+ displayName: 'Ask Assistant',
19
+ description: 'Ask a GPT assistant anything you want!',
20
+ props: {
21
+ assistant: cortex_1.Property.Dropdown({
22
+ auth: common_1.intersectAuth,
23
+ displayName: 'Assistant',
24
+ required: true,
25
+ description: 'The assistant which will generate the completion.',
26
+ refreshers: [],
27
+ options: async ({ auth }) => {
28
+ if (!auth) {
29
+ return {
30
+ disabled: true,
31
+ placeholder: 'Enter your API key first',
32
+ options: [],
33
+ };
34
+ }
35
+ try {
36
+ const authValue = auth;
37
+ const openai = new openai_1.default({
38
+ apiKey: authValue.apiKey,
39
+ baseURL: (0, common_2.getIntersectBaseUrl)(authValue.host),
40
+ });
41
+ const assistants = await openai.beta.assistants.list();
42
+ return {
43
+ disabled: false,
44
+ options: assistants.data.map((assistant) => {
45
+ return {
46
+ label: assistant.name,
47
+ value: assistant.id,
48
+ };
49
+ }),
50
+ };
51
+ }
52
+ catch (error) {
53
+ return {
54
+ disabled: true,
55
+ options: [],
56
+ placeholder: "Couldn't load assistants, API key is invalid",
57
+ };
58
+ }
59
+ },
60
+ }),
61
+ prompt: cortex_1.Property.LongText({
62
+ displayName: 'Question',
63
+ required: true,
64
+ }),
65
+ memoryKey: cortex_1.Property.ShortText({
66
+ displayName: 'Memory Key',
67
+ description: 'A memory key that will keep the chat history shared across runs and flows. Keep it empty to leave your assistant without memory of previous messages.',
68
+ required: false,
69
+ }),
70
+ },
71
+ async run({ auth, propsValue, store }) {
72
+ // Inline validation to avoid Zod version mismatch
73
+ const { memoryKey } = propsValue;
74
+ if (memoryKey !== undefined && memoryKey !== null) {
75
+ if (typeof memoryKey !== 'string' || memoryKey.length > 128) {
76
+ throw new Error('Memory key must be a string with max 128 characters');
77
+ }
78
+ }
79
+ const authValue = auth;
80
+ const openai = new openai_1.default({
81
+ apiKey: authValue.apiKey,
82
+ baseURL: (0, common_2.getIntersectBaseUrl)(authValue.host),
83
+ });
84
+ const { assistant, prompt } = propsValue;
85
+ const runCheckDelay = 1000;
86
+ let response;
87
+ let thread;
88
+ if (memoryKey) {
89
+ // Get existing thread ID or create a new thread for this memory key
90
+ thread = await store.get(memoryKey, cortex_1.StoreScope.PROJECT);
91
+ if (!thread) {
92
+ thread = await openai.beta.threads.create();
93
+ store.put(memoryKey, thread, cortex_1.StoreScope.PROJECT);
94
+ }
95
+ }
96
+ else {
97
+ thread = await openai.beta.threads.create();
98
+ }
99
+ const message = await openai.beta.threads.messages.create(thread.id, {
100
+ role: 'user',
101
+ content: prompt,
102
+ });
103
+ const run = await openai.beta.threads.runs.create(thread.id, {
104
+ assistant_id: assistant,
105
+ });
106
+ // Wait at least 400ms for inference to finish before checking to save requests
107
+ await (0, common_2.sleep)(400);
108
+ while (!response) {
109
+ const runCheck = await openai.beta.threads.runs.retrieve(thread.id, run.id);
110
+ if (runCheck.status == 'completed') {
111
+ const messages = await openai.beta.threads.messages.list(thread.id);
112
+ // Return only messages that are newer than the user's latest message
113
+ response = messages.data.splice(0, messages.data.findIndex((m) => m.id == message.id));
114
+ break;
115
+ }
116
+ await (0, common_2.sleep)(runCheckDelay);
117
+ }
118
+ return response;
119
+ },
120
+ });
121
+ //# sourceMappingURL=ask-assistant.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ask-assistant.js","sourceRoot":"","sources":["../../../src/lib/actions/ask-assistant.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;AAEH,4CAIyB;AACzB,oDAA4B;AAC5B,6CAAiD;AACjD,6CAAkF;AAErE,QAAA,YAAY,GAAG,IAAA,qBAAY,EAAC;IACvC,IAAI,EAAE,sBAAa;IACnB,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,eAAe;IAC5B,WAAW,EAAE,wCAAwC;IACrD,KAAK,EAAE;QACL,SAAS,EAAE,iBAAQ,CAAC,QAAQ,CAAC;YAC3B,IAAI,EAAE,sBAAa;YACnB,WAAW,EAAE,WAAW;YACxB,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,mDAAmD;YAChE,UAAU,EAAE,EAAE;YACd,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;gBAC1B,IAAI,CAAC,IAAI,EAAE,CAAC;oBACV,OAAO;wBACL,QAAQ,EAAE,IAAI;wBACd,WAAW,EAAE,0BAA0B;wBACvC,OAAO,EAAE,EAAE;qBACZ,CAAC;gBACJ,CAAC;gBACD,IAA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CAAC,CAAC;QACH,+EAA+E;QAC/E,MAAM,IAAA,cAAK,EAAC,GAAG,CAAC,CAAC;QAEjB,OAAO,CAAC,QAAQ,EAAE,CAAC;YACjB,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CACtD,MAAM,CAAC,EAAE,EACT,GAAG,CAAC,EAAE,CACP,CAAC;YACF,IAAI,QAAQ,CAAC,MAAM,IAAI,WAAW,EAAE,CAAC;gBACnC,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;gBACpE,qEAAqE;gBACrE,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC,MAAM,CAC7B,CAAC,EACD,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,OAAO,CAAC,EAAE,CAAC,CACnD,CAAC;gBACF,MAAM;YACR,CAAC;YAED,MAAM,IAAA,cAAK,EAAC,aAAa,CAAC,CAAC;QAC7B,CAAC;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Create Canvas Action
3
+ * Create a canvas of any type using AI.
4
+ */
5
+ export declare const createCanvas: any;
6
+ //# sourceMappingURL=create-canvas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-canvas.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/create-canvas.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAsBH,eAAO,MAAM,YAAY,KAsHvB,CAAC"}
@@ -0,0 +1,127 @@
1
+ "use strict";
2
+ /**
3
+ * Create Canvas Action
4
+ * Create a canvas of any type using AI.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.createCanvas = void 0;
8
+ const cortex_1 = require("@ha-bits/cortex");
9
+ const common_1 = require("../common/common");
10
+ const common_2 = require("../common/common");
11
+ /**
12
+ * Canvas type options mapping display labels to API values
13
+ */
14
+ const canvasTypeOptions = [
15
+ { label: 'Create a landing page', value: 'webcanvas' },
16
+ { label: 'Create a document', value: 'draftcanvas' },
17
+ { label: 'Create a diagram', value: 'drawcanvas' },
18
+ { label: 'Create a vector graphic', value: 'svgcanvas' },
19
+ ];
20
+ exports.createCanvas = (0, cortex_1.createAction)({
21
+ auth: common_1.intersectAuth,
22
+ name: 'create_canvas',
23
+ displayName: 'Create Canvas',
24
+ description: 'Create a canvas of any type using AI. Returns a link and generated output.',
25
+ props: {
26
+ modelName: cortex_1.Property.Dropdown({
27
+ auth: common_1.intersectAuth,
28
+ displayName: 'Model',
29
+ description: 'The AI model to use for generating the canvas content.',
30
+ required: true,
31
+ refreshers: [],
32
+ defaultValue: 'gpt-4o',
33
+ options: async ({ auth }) => {
34
+ if (!auth) {
35
+ return {
36
+ disabled: true,
37
+ placeholder: 'Enter your API key first',
38
+ options: [],
39
+ };
40
+ }
41
+ try {
42
+ const authValue = auth;
43
+ const baseUrl = (0, common_2.getIntersectBaseUrl)(authValue.host);
44
+ const response = await cortex_1.httpClient.sendRequest({
45
+ url: `${baseUrl}/models?type=text`,
46
+ method: cortex_1.HttpMethod.GET,
47
+ authentication: {
48
+ type: cortex_1.AuthenticationType.BEARER_TOKEN,
49
+ token: authValue.apiKey,
50
+ },
51
+ });
52
+ return {
53
+ disabled: false,
54
+ options: response.body.data.map((model) => ({
55
+ label: model.id,
56
+ value: model.id,
57
+ })),
58
+ };
59
+ }
60
+ catch (error) {
61
+ return {
62
+ disabled: true,
63
+ options: [],
64
+ placeholder: "Couldn't load models, API key is invalid",
65
+ };
66
+ }
67
+ },
68
+ }),
69
+ type: cortex_1.Property.StaticDropdown({
70
+ displayName: 'Canvas Type',
71
+ description: 'The type of canvas to create.',
72
+ required: true,
73
+ options: {
74
+ disabled: false,
75
+ options: canvasTypeOptions,
76
+ },
77
+ }),
78
+ prompt: cortex_1.Property.LongText({
79
+ displayName: 'Prompt',
80
+ description: 'Describe what you want to create in the canvas.',
81
+ required: true,
82
+ }),
83
+ additionalOptions: cortex_1.Property.Object({
84
+ displayName: 'Additional Options',
85
+ description: 'Optional additional parameters to pass to the canvas API.',
86
+ required: false,
87
+ }),
88
+ },
89
+ async run({ auth, propsValue }) {
90
+ const { modelName, type, prompt, additionalOptions } = propsValue;
91
+ const authValue = auth;
92
+ const canvasApiUrl = (0, common_2.getCanvasApiUrl)(authValue.host, 'create-canvas');
93
+ const requestBody = {
94
+ modelName,
95
+ type,
96
+ prompt,
97
+ };
98
+ // Get host/origin from canvasApiUrl
99
+ const url = new URL(canvasApiUrl);
100
+ const origin = url.origin;
101
+ // Merge additional options if provided
102
+ if (additionalOptions && typeof additionalOptions === 'object') {
103
+ Object.assign(requestBody, additionalOptions);
104
+ }
105
+ try {
106
+ const response = await cortex_1.httpClient.sendRequest({
107
+ method: cortex_1.HttpMethod.POST,
108
+ url: canvasApiUrl,
109
+ headers: {
110
+ 'Content-Type': 'application/json',
111
+ 'Authorization': `Bearer ${authValue.apiKey}`,
112
+ 'origin': origin
113
+ },
114
+ body: requestBody,
115
+ });
116
+ return {
117
+ link: response.body.link || null,
118
+ output: response.body.output || response.body,
119
+ rawResponse: response.body,
120
+ };
121
+ }
122
+ catch (e) {
123
+ throw new Error(`Error creating canvas:\n${e}`);
124
+ }
125
+ },
126
+ });
127
+ //# sourceMappingURL=create-canvas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-canvas.js","sourceRoot":"","sources":["../../../src/lib/actions/create-canvas.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,4CAMyB;AACzB,6CAAiD;AACjD,6CAA4F;AAE5F;;GAEG;AACH,MAAM,iBAAiB,GAAG;IACxB,EAAE,KAAK,EAAE,uBAAuB,EAAE,KAAK,EAAE,WAAW,EAAE;IACtD,EAAE,KAAK,EAAE,mBAAmB,E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AM,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC;QAE1B,uCAAuC;QACvC,IAAI,iBAAiB,IAAI,OAAO,iBAAiB,KAAK,QAAQ,EAAE,CAAC;YAC/D,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,iBAAiB,CAAC,CAAC;QAChD,CAAC;QAED,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,mBAAU,CAAC,WAAW,CAI1C;gBACD,MAAM,EAAE,mBAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,YAAY;gBACjB,OAAO,EAAE;oBACP,cAAc,EAAE,kBAAkB;oBAClC,eAAe,EAAE,UAAU,SAAS,CAAC,MAAM,EAAE;oBAC7C,QAAQ,EAAE,MAAM;iBACjB;gBACD,IAAI,EAAE,WAAW;aAClB,CAAC,CAAC;YAEH,OAAO;gBACL,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI;gBAChC,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,MAAM,IAAI,QAAQ,CAAC,IAAI;gBAC7C,WAAW,EAAE,QAAQ,CAAC,IAAI;aAC3B,CAAC;QACJ,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,EAAE,CAAC,CAAC;QAClD,CAAC;IACH,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Create Video Action
3
+ * Create a video using VideoCanvas with AI
4
+ */
5
+ export declare const createVideo: any;
6
+ //# sourceMappingURL=create-video.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-video.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/create-video.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAWH,eAAO,MAAM,WAAW,KAkCtB,CAAC"}
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ /**
3
+ * Create Video Action
4
+ * Create a video using VideoCanvas with AI
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.createVideo = void 0;
8
+ const cortex_1 = require("@ha-bits/cortex");
9
+ const common_1 = require("../common/common");
10
+ const common_2 = require("../common/common");
11
+ exports.createVideo = (0, cortex_1.createAction)({
12
+ auth: common_1.intersectAuth,
13
+ name: 'create_video',
14
+ displayName: 'Create Video',
15
+ description: 'Create a video using VideoCanvas with AI',
16
+ props: {
17
+ prompt: cortex_1.Property.LongText({
18
+ displayName: 'Video Prompt',
19
+ description: 'Describe the video you want to create.',
20
+ required: true,
21
+ }),
22
+ },
23
+ async run({ auth, propsValue }) {
24
+ const { prompt } = propsValue;
25
+ const authValue = auth;
26
+ const canvasApiUrl = (0, common_2.getCanvasApiUrl)(authValue.host, 'create-video');
27
+ try {
28
+ const response = await cortex_1.httpClient.sendRequest({
29
+ method: cortex_1.HttpMethod.POST,
30
+ url: canvasApiUrl,
31
+ headers: {
32
+ 'Content-Type': 'application/json',
33
+ Authorization: `Bearer ${authValue.apiKey}`,
34
+ },
35
+ body: {
36
+ prompt,
37
+ },
38
+ });
39
+ return response.body;
40
+ }
41
+ catch (e) {
42
+ throw new Error(`Error creating video:\n${e}`);
43
+ }
44
+ },
45
+ });
46
+ //# sourceMappingURL=create-video.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-video.js","sourceRoot":"","sources":["../../../src/lib/actions/create-video.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,4CAKyB;AACzB,6CAAiD;AACjD,6CAAuE;AAE1D,QAAA,WAAW,GAAG,IAAA,qBAAY,EAAC;IACtC,IAAI,EAAE,sBAAa;IACnB,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,cAAc;IAC3B,WAAW,EAAE,0CAA0C;IACvD,KAAK,EAAE;QACL,MAAM,EAAE,iBAAQ,CAAC,QAAQ,CAAC;YACxB,WAAW,EAAE,cAAc;YAC3B,WAAW,EAAE,wCAAwC;YACrD,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACD,KAAK,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE;QAC5B,MAAM,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC;QAC9B,MAAM,SAAS,GAAG,IAAqC,CAAC;QACxD,MAAM,YAAY,GAAG,IAAA,wBAAe,EAAC,SAAS,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;QAErE,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,mBAAU,CAAC,WAAW,CAAC;gBAC5C,MAAM,EAAE,mBAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,YAAY;gBACjB,OAAO,EAAE;oBACP,cAAc,EAAE,kBAAkB;oBAClC,aAAa,EAAE,UAAU,SAAS,CAAC,MAAM,EAAE;iBAC5C;gBACD,IAAI,EAAE;oBACJ,MAAM;iBACP;aACF,CAAC,CAAC;YACH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,EAAE,CAAC,CAAC;QACjD,CAAC;IACH,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Extract Structured Data Action
3
+ * Returns structured data from provided unstructured text.
4
+ */
5
+ export declare const extractStructuredDataAction: any;
6
+ //# sourceMappingURL=extract-structure-data.action.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extract-structure-data.action.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/extract-structure-data.action.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAaH,eAAO,MAAM,2BAA2B,KA0ItC,CAAC"}
@@ -0,0 +1,151 @@
1
+ "use strict";
2
+ /**
3
+ * Extract Structured Data Action
4
+ * Returns structured data from provided unstructured text.
5
+ */
6
+ var __importDefault = (this && this.__importDefault) || function (mod) {
7
+ return (mod && mod.__esModule) ? mod : { "default": mod };
8
+ };
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.extractStructuredDataAction = void 0;
11
+ const cortex_1 = require("@ha-bits/cortex");
12
+ const openai_1 = __importDefault(require("openai"));
13
+ const common_1 = require("../common/common");
14
+ exports.extractStructuredDataAction = (0, cortex_1.createAction)({
15
+ auth: common_1.intersectAuth,
16
+ name: 'extract-structured-data',
17
+ displayName: 'Extract Structured Data from Text',
18
+ description: 'Returns structured data from provided unstructured text.',
19
+ props: {
20
+ model: cortex_1.Property.Dropdown({
21
+ auth: common_1.intersectAuth,
22
+ displayName: 'Model',
23
+ required: true,
24
+ refreshers: [],
25
+ defaultValue: 'gpt-3.5-turbo',
26
+ options: async ({ auth }) => {
27
+ if (!auth) {
28
+ return {
29
+ disabled: true,
30
+ placeholder: 'Enter your API key first',
31
+ options: [],
32
+ };
33
+ }
34
+ try {
35
+ const authValue = auth;
36
+ const openai = new openai_1.default({
37
+ apiKey: authValue.apiKey,
38
+ baseURL: (0, common_1.getIntersectBaseUrl)(authValue.host),
39
+ });
40
+ const response = await openai.models.list();
41
+ // We need to get only LLM models
42
+ const models = response.data.filter((model) => !common_1.notLLMs.includes(model.id));
43
+ return {
44
+ disabled: false,
45
+ options: models.map((model) => {
46
+ return {
47
+ label: model.id,
48
+ value: model.id,
49
+ };
50
+ }),
51
+ };
52
+ }
53
+ catch (error) {
54
+ return {
55
+ disabled: true,
56
+ options: [],
57
+ placeholder: "Couldn't load models, API key is invalid",
58
+ };
59
+ }
60
+ },
61
+ }),
62
+ text: cortex_1.Property.LongText({
63
+ displayName: 'Unstructured Text',
64
+ required: true,
65
+ }),
66
+ params: cortex_1.Property.Array({
67
+ displayName: 'Data Definition',
68
+ required: true,
69
+ properties: {
70
+ propName: cortex_1.Property.ShortText({
71
+ displayName: 'Name',
72
+ description: 'Provide the name of the value you want to extract from the unstructured text. The name should be unique and short. ',
73
+ required: true,
74
+ }),
75
+ propDescription: cortex_1.Property.LongText({
76
+ displayName: 'Description',
77
+ description: 'Brief description of the data, this hints for the AI on what to look for',
78
+ required: false,
79
+ }),
80
+ propDataType: cortex_1.Property.StaticDropdown({
81
+ displayName: 'Data Type',
82
+ description: 'Type of parameter.',
83
+ required: true,
84
+ defaultValue: 'string',
85
+ options: {
86
+ disabled: false,
87
+ options: [
88
+ { label: 'Text', value: 'string' },
89
+ { label: 'Number', value: 'number' },
90
+ { label: 'Boolean', value: 'boolean' },
91
+ ],
92
+ },
93
+ }),
94
+ propIsRequired: cortex_1.Property.Checkbox({
95
+ displayName: 'Fail if Not present?',
96
+ required: true,
97
+ defaultValue: false,
98
+ }),
99
+ },
100
+ }),
101
+ },
102
+ async run(context) {
103
+ const { model, text } = context.propsValue;
104
+ const paramInputArray = context.propsValue.params;
105
+ const functionParams = {};
106
+ const requiredFunctionParams = [];
107
+ for (const param of paramInputArray) {
108
+ functionParams[param.propName] = {
109
+ type: param.propDataType,
110
+ description: param.propDescription ?? param.propName,
111
+ };
112
+ if (param.propIsRequired) {
113
+ requiredFunctionParams.push(param.propName);
114
+ }
115
+ }
116
+ const prompt = 'Extract the following data from the provided text';
117
+ const authValue = context.auth;
118
+ const openai = new openai_1.default({
119
+ apiKey: authValue.apiKey,
120
+ baseURL: (0, common_1.getIntersectBaseUrl)(authValue.host),
121
+ });
122
+ const response = await openai.chat.completions.create({
123
+ model: model,
124
+ messages: [{ role: 'user', content: text }],
125
+ tools: [
126
+ {
127
+ type: 'function',
128
+ function: {
129
+ name: 'extract_structured_data',
130
+ description: prompt,
131
+ parameters: {
132
+ type: 'object',
133
+ properties: functionParams,
134
+ required: requiredFunctionParams,
135
+ },
136
+ },
137
+ },
138
+ ],
139
+ });
140
+ const toolCallsResponse = response.choices[0].message.tool_calls;
141
+ if (toolCallsResponse) {
142
+ return JSON.parse(toolCallsResponse[0].function.arguments);
143
+ }
144
+ else {
145
+ throw new Error(JSON.stringify({
146
+ message: "OpenAI couldn't extract the fields from the above text."
147
+ }));
148
+ }
149
+ },
150
+ });
151
+ //# sourceMappingURL=extract-structure-data.action.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extract-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