@taskmagic/apps-raia-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 +7 -0
- package/package.json +48 -0
- package/src/index.d.ts +3 -0
- package/src/index.js +48 -0
- package/src/index.js.map +1 -0
- package/src/lib/actions/prompt-agent.d.ts +3 -0
- package/src/lib/actions/prompt-agent.js +35 -0
- package/src/lib/actions/prompt-agent.js.map +1 -0
- package/src/lib/actions/upload-agent-file.d.ts +3 -0
- package/src/lib/actions/upload-agent-file.js +36 -0
- package/src/lib/actions/upload-agent-file.js.map +1 -0
- package/src/lib/common/auth.d.ts +1 -0
- package/src/lib/common/auth.js +36 -0
- package/src/lib/common/auth.js.map +1 -0
- package/src/lib/common/constants.d.ts +2 -0
- package/src/lib/common/constants.js +6 -0
- package/src/lib/common/constants.js.map +1 -0
package/README.md
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@taskmagic/apps-raia-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
|
+
"form-data": "4.0.5",
|
|
11
|
+
"mime-types": "2.1.35",
|
|
12
|
+
"nanoid": "3.3.8",
|
|
13
|
+
"openai": "4.67.1",
|
|
14
|
+
"replicate": "0.34.1",
|
|
15
|
+
"semver": "7.6.0",
|
|
16
|
+
"zod": "3.25.76",
|
|
17
|
+
"@taskmagic/pieces-common": "0.4.4",
|
|
18
|
+
"@taskmagic/pieces-framework": "0.7.46",
|
|
19
|
+
"@taskmagic/shared": "0.10.171",
|
|
20
|
+
"tslib": "1.14.1"
|
|
21
|
+
},
|
|
22
|
+
"overrides": {
|
|
23
|
+
"cross-spawn": "7.0.6",
|
|
24
|
+
"elliptic": "^6.6.1",
|
|
25
|
+
"fast-xml-parser": "^4.4.1",
|
|
26
|
+
"protobufjs": "^7.5.5",
|
|
27
|
+
"tmp": "^0.2.4",
|
|
28
|
+
"koa": "^2.16.4",
|
|
29
|
+
"picomatch": "^4.0.4",
|
|
30
|
+
"langsmith": "^0.6.0",
|
|
31
|
+
"serialize-javascript": "^6.0.2",
|
|
32
|
+
"elevenlabs": {
|
|
33
|
+
"form-data": "^4.0.4"
|
|
34
|
+
},
|
|
35
|
+
"@tryfabric/martian": {
|
|
36
|
+
"@notionhq/client": "$@notionhq/client"
|
|
37
|
+
},
|
|
38
|
+
"vite": {
|
|
39
|
+
"rollup": "npm:@rollup/wasm-node@^4.61.1"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"resolutions": {
|
|
43
|
+
"rollup": "npm:@rollup/wasm-node@^4.61.1"
|
|
44
|
+
},
|
|
45
|
+
"types": "./src/index.d.ts",
|
|
46
|
+
"main": "./src/index.js",
|
|
47
|
+
"type": "commonjs"
|
|
48
|
+
}
|
package/src/index.d.ts
ADDED
package/src/index.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.raiaAi = exports.raiaAiAuth = 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 shared_1 = require("@taskmagic/shared");
|
|
8
|
+
const auth_1 = require("./lib/common/auth");
|
|
9
|
+
Object.defineProperty(exports, "raiaAiAuth", { enumerable: true, get: function () { return auth_1.raiaAiAuth; } });
|
|
10
|
+
const constants_1 = require("./lib/common/constants");
|
|
11
|
+
const prompt_agent_1 = require("./lib/actions/prompt-agent");
|
|
12
|
+
const upload_agent_file_1 = require("./lib/actions/upload-agent-file");
|
|
13
|
+
exports.raiaAi = (0, pieces_framework_1.createPiece)({
|
|
14
|
+
displayName: 'raia',
|
|
15
|
+
auth: auth_1.raiaAiAuth,
|
|
16
|
+
minimumSupportedRelease: '0.30.0',
|
|
17
|
+
logoUrl: 'https://cdn.activepieces.com/pieces/raia-ai.png',
|
|
18
|
+
categories: [shared_1.PieceCategory.ARTIFICIAL_INTELLIGENCE],
|
|
19
|
+
authors: ['kishanprmr'],
|
|
20
|
+
ai: {
|
|
21
|
+
description: 'Interact with a raia AI agent: send prompts to get responses and upload files as agent context.',
|
|
22
|
+
keywords: [
|
|
23
|
+
'raia',
|
|
24
|
+
'ai agent',
|
|
25
|
+
'prompt agent',
|
|
26
|
+
'chatbot',
|
|
27
|
+
'ask agent',
|
|
28
|
+
'upload file',
|
|
29
|
+
'agent context',
|
|
30
|
+
'conversational ai',
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
actions: [
|
|
34
|
+
prompt_agent_1.promptAgentAction,
|
|
35
|
+
upload_agent_file_1.uploadAgentFileAction,
|
|
36
|
+
(0, pieces_common_1.createCustomApiCallAction)({
|
|
37
|
+
auth: auth_1.raiaAiAuth,
|
|
38
|
+
baseUrl: () => constants_1.BASE_URL,
|
|
39
|
+
authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
40
|
+
return {
|
|
41
|
+
[constants_1.AGENT_SECRET_KEY_HEADER]: `${auth}`,
|
|
42
|
+
};
|
|
43
|
+
}),
|
|
44
|
+
}),
|
|
45
|
+
],
|
|
46
|
+
triggers: [],
|
|
47
|
+
});
|
|
48
|
+
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/pieces/community/raia-ai/src/index.ts"],"names":[],"mappings":";;;;AAAA,kEAA0D;AAC1D,4DAAqE;AACrE,8CAAkD;AAClD,4CAA+C;AAKtC,2FALA,iBAAU,OAKA;AAJnB,sDAA2E;AAC3E,6DAA+D;AAC/D,uEAAwE;AAI3D,QAAA,MAAM,GAAG,IAAA,8BAAW,EAAC;IAChC,WAAW,EAAE,MAAM;IACnB,IAAI,EAAE,iBAAU;IAChB,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,iDAAiD;IAC1D,UAAU,EAAE,CAAC,sBAAa,CAAC,uBAAuB,CAAC;IACnD,OAAO,EAAE,CAAC,YAAY,CAAC;IACvB,EAAE,EAAE;QACF,WAAW,EACT,iGAAiG;QACnG,QAAQ,EAAE;YACR,MAAM;YACN,UAAU;YACV,cAAc;YACd,SAAS;YACT,WAAW;YACX,aAAa;YACb,eAAe;YACf,mBAAmB;SACpB;KACF;IACD,OAAO,EAAE;QACP,gCAAiB;QACjB,yCAAqB;QACrB,IAAA,yCAAyB,EAAC;YACxB,IAAI,EAAE,iBAAU;YAChB,OAAO,EAAE,GAAG,EAAE,CAAC,oBAAQ;YACvB,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAC1B,OAAO;oBACL,CAAC,mCAAuB,CAAC,EAAE,GAAG,IAAI,EAAE;iBACrC,CAAC;YACJ,CAAC,CAAA;SACF,CAAC;KACH;IACD,QAAQ,EAAE,EAAE;CACb,CAAC,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.promptAgentAction = 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 constants_1 = require("../common/constants");
|
|
9
|
+
exports.promptAgentAction = (0, pieces_framework_1.createAction)({
|
|
10
|
+
name: 'prompt-agent',
|
|
11
|
+
displayName: 'Prompt Agent',
|
|
12
|
+
description: 'Sends a prompt to a Raia Agent.',
|
|
13
|
+
auth: auth_1.raiaAiAuth,
|
|
14
|
+
props: {
|
|
15
|
+
prompt: pieces_framework_1.Property.LongText({
|
|
16
|
+
displayName: 'Prompt',
|
|
17
|
+
required: true,
|
|
18
|
+
}),
|
|
19
|
+
},
|
|
20
|
+
run(context) {
|
|
21
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
22
|
+
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
23
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
24
|
+
url: constants_1.BASE_URL + '/prompts',
|
|
25
|
+
headers: {
|
|
26
|
+
[constants_1.AGENT_SECRET_KEY_HEADER]: context.auth,
|
|
27
|
+
'Content-Type': 'application/json',
|
|
28
|
+
},
|
|
29
|
+
body: { prompt: context.propsValue.prompt },
|
|
30
|
+
});
|
|
31
|
+
return response.body;
|
|
32
|
+
});
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
//# sourceMappingURL=prompt-agent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt-agent.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/raia-ai/src/lib/actions/prompt-agent.ts"],"names":[],"mappings":";;;;AAAA,kEAAqE;AACrE,4DAAkE;AAClE,yCAA4C;AAC5C,mDAAwE;AAE3D,QAAA,iBAAiB,GAAG,IAAA,+BAAY,EAAC;IAC5C,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,cAAc;IAC3B,WAAW,EAAE,iCAAiC;IAC9C,IAAI,EAAE,iBAAU;IAChB,KAAK,EAAE;QACL,MAAM,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACxB,WAAW,EAAE,QAAQ;YACrB,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC5C,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,oBAAQ,GAAG,UAAU;gBAC1B,OAAO,EAAE;oBACP,CAAC,mCAAuB,CAAC,EAAE,OAAO,CAAC,IAAc;oBACjD,cAAc,EAAE,kBAAkB;iBACnC;gBACD,IAAI,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,UAAU,CAAC,MAAM,EAAE;aAC5C,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.uploadAgentFileAction = 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 form_data_1 = tslib_1.__importDefault(require("form-data"));
|
|
8
|
+
const auth_1 = require("../common/auth");
|
|
9
|
+
const constants_1 = require("../common/constants");
|
|
10
|
+
exports.uploadAgentFileAction = (0, pieces_framework_1.createAction)({
|
|
11
|
+
name: 'upload-agent-file',
|
|
12
|
+
displayName: 'Upload Agent File',
|
|
13
|
+
description: 'Upload file to a Raia Agent.',
|
|
14
|
+
auth: auth_1.raiaAiAuth,
|
|
15
|
+
props: {
|
|
16
|
+
file: pieces_framework_1.Property.File({
|
|
17
|
+
displayName: 'File',
|
|
18
|
+
required: true,
|
|
19
|
+
}),
|
|
20
|
+
},
|
|
21
|
+
run(context) {
|
|
22
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
const { file } = context.propsValue;
|
|
24
|
+
const formData = new form_data_1.default();
|
|
25
|
+
formData.append('file', file.data, { filename: file.filename });
|
|
26
|
+
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
27
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
28
|
+
url: constants_1.BASE_URL + '/agent-files/upload',
|
|
29
|
+
headers: Object.assign({ [constants_1.AGENT_SECRET_KEY_HEADER]: context.auth }, formData.getHeaders()),
|
|
30
|
+
body: formData,
|
|
31
|
+
});
|
|
32
|
+
return response.body;
|
|
33
|
+
});
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
//# sourceMappingURL=upload-agent-file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload-agent-file.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/raia-ai/src/lib/actions/upload-agent-file.ts"],"names":[],"mappings":";;;;AAAA,kEAAqE;AACrE,4DAAkE;AAClE,kEAAiC;AACjC,yCAA4C;AAC5C,mDAAwE;AAE3D,QAAA,qBAAqB,GAAG,IAAA,+BAAY,EAAC;IAChD,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE,mBAAmB;IAChC,WAAW,EAAE,8BAA8B;IAC3C,IAAI,EAAE,iBAAU;IAChB,KAAK,EAAE;QACL,IAAI,EAAE,2BAAQ,CAAC,IAAI,CAAC;YAClB,WAAW,EAAE,MAAM;YACnB,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAEpC,MAAM,QAAQ,GAAG,IAAI,mBAAQ,EAAE,CAAC;YAChC,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;YAEhE,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC5C,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,oBAAQ,GAAG,qBAAqB;gBACrC,OAAO,kBACL,CAAC,mCAAuB,CAAC,EAAE,OAAO,CAAC,IAAc,IAC9C,QAAQ,CAAC,UAAU,EAAE,CACzB;gBACD,IAAI,EAAE,QAAQ;aACf,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const raiaAiAuth: import("@taskmagic/pieces-framework").SecretTextProperty<true>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.raiaAiAuth = 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 constants_1 = require("./constants");
|
|
8
|
+
exports.raiaAiAuth = pieces_framework_1.PieceAuth.SecretText({
|
|
9
|
+
displayName: 'API Key',
|
|
10
|
+
required: true,
|
|
11
|
+
description: `
|
|
12
|
+
1. Open your agent in raiaAI Launch Pad and go to Agent → Skills.
|
|
13
|
+
2. Add/enable "API Skill" (toggle it Active).
|
|
14
|
+
3. In the API Skill settings, click "Generate Secret Key" (your agent's API key).`,
|
|
15
|
+
validate: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
|
|
16
|
+
try {
|
|
17
|
+
yield pieces_common_1.httpClient.sendRequest({
|
|
18
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
19
|
+
url: constants_1.BASE_URL + '/agents/by-api-key',
|
|
20
|
+
headers: {
|
|
21
|
+
[constants_1.AGENT_SECRET_KEY_HEADER]: auth,
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
return {
|
|
25
|
+
valid: true,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
catch (_b) {
|
|
29
|
+
return {
|
|
30
|
+
valid: false,
|
|
31
|
+
error: 'Invalid API Key.',
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
}),
|
|
35
|
+
});
|
|
36
|
+
//# sourceMappingURL=auth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/raia-ai/src/lib/common/auth.ts"],"names":[],"mappings":";;;;AAAA,kEAAwD;AACxD,4DAAkE;AAClE,2CAAgE;AAEnD,QAAA,UAAU,GAAG,4BAAS,CAAC,UAAU,CAAC;IAC7C,WAAW,EAAE,SAAS;IACtB,QAAQ,EAAE,IAAI;IACd,WAAW,EAAE;;;sFAGuE;IACpF,QAAQ,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;QACvB,IAAI,CAAC;YACH,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC3B,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,GAAG,EAAE,oBAAQ,GAAG,oBAAoB;gBACpC,OAAO,EAAE;oBACP,CAAC,mCAAuB,CAAC,EAAE,IAAI;iBAChC;aACF,CAAC,CAAC;YAEH,OAAO;gBACL,KAAK,EAAE,IAAI;aACZ,CAAC;QACJ,CAAC;QAAC,WAAM,CAAC;YACP,OAAO;gBACL,KAAK,EAAE,KAAK;gBACZ,KAAK,EAAE,kBAAkB;aAC1B,CAAC;QACJ,CAAC;IACH,CAAC,CAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AGENT_SECRET_KEY_HEADER = exports.BASE_URL = void 0;
|
|
4
|
+
exports.BASE_URL = 'https://api.raia2.com/external';
|
|
5
|
+
exports.AGENT_SECRET_KEY_HEADER = 'Agent-Secret-Key';
|
|
6
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/raia-ai/src/lib/common/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,QAAQ,GAAG,gCAAgC,CAAC;AAE5C,QAAA,uBAAuB,GAAG,kBAAkB,CAAC"}
|