@taskmagic/apps-gptzero-detect-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
+ # GPTZero
2
+
3
+ Detect AI-generated text with the GPTZero API.
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "@taskmagic/apps-gptzero-detect-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,3 @@
1
+ import { gptzeroDetectAiAuth } from './lib/auth';
2
+ export { gptzeroDetectAiAuth };
3
+ export declare const gptzeroDetectAi: import("@taskmagic/pieces-framework").Piece<import("@taskmagic/pieces-framework").SecretTextProperty<true>>;
package/src/index.js ADDED
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.gptzeroDetectAi = exports.gptzeroDetectAiAuth = 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 scan_file_1 = require("./lib/actions/scan-file");
9
+ const scan_text_1 = require("./lib/actions/scan-text");
10
+ const auth_1 = require("./lib/auth");
11
+ Object.defineProperty(exports, "gptzeroDetectAiAuth", { enumerable: true, get: function () { return auth_1.gptzeroDetectAiAuth; } });
12
+ exports.gptzeroDetectAi = (0, pieces_framework_1.createPiece)({
13
+ displayName: 'GPTZero',
14
+ description: 'Detect AI-generated text with GPTZero API',
15
+ auth: auth_1.gptzeroDetectAiAuth,
16
+ minimumSupportedRelease: '0.30.0',
17
+ logoUrl: 'https://cdn.activepieces.com/pieces/gptzero-detect-ai.png',
18
+ categories: [shared_1.PieceCategory.ARTIFICIAL_INTELLIGENCE],
19
+ authors: ['sanket-a11y'],
20
+ actions: [
21
+ scan_file_1.scanFile,
22
+ scan_text_1.scanText,
23
+ (0, pieces_common_1.createCustomApiCallAction)({
24
+ auth: auth_1.gptzeroDetectAiAuth,
25
+ baseUrl: () => 'https://api.gptzero.me',
26
+ authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
27
+ return {
28
+ 'x-api-key': auth,
29
+ };
30
+ }),
31
+ }),
32
+ ],
33
+ triggers: [],
34
+ });
35
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/pieces/community/gptzero-detect-ai/src/index.ts"],"names":[],"mappings":";;;;AAAA,kEAA0D;AAC1D,4DAAqE;AACrE,8CAAkD;AAClD,uDAAmD;AACnD,uDAAmD;AACnD,qCAAiD;AAExC,oGAFA,0BAAmB,OAEA;AAEf,QAAA,eAAe,GAAG,IAAA,8BAAW,EAAC;IACzC,WAAW,EAAE,SAAS;IACtB,WAAW,EAAE,2CAA2C;IACxD,IAAI,EAAE,0BAAmB;IACzB,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,2DAA2D;IACpE,UAAU,EAAE,CAAC,sBAAa,CAAC,uBAAuB,CAAC;IACnD,OAAO,EAAE,CAAC,aAAa,CAAC;IACxB,OAAO,EAAE;QACP,oBAAQ;QACR,oBAAQ;QACR,IAAA,yCAAyB,EAAC;YACxB,IAAI,EAAE,0BAAmB;YACzB,OAAO,EAAE,GAAG,EAAE,CAAC,wBAAwB;YACvC,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,3 @@
1
+ export declare const scanFile: import("@taskmagic/pieces-framework").IAction<import("@taskmagic/pieces-framework").SecretTextProperty<true>, {
2
+ file: import("@taskmagic/pieces-framework").FileProperty<true>;
3
+ }>;
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.scanFile = 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("../auth");
8
+ exports.scanFile = (0, pieces_framework_1.createAction)({
9
+ auth: auth_1.gptzeroDetectAiAuth,
10
+ name: 'scanFile',
11
+ displayName: 'Scan File',
12
+ description: 'Scan a file for AI-generated content detection',
13
+ props: {
14
+ file: pieces_framework_1.Property.File({
15
+ displayName: 'File',
16
+ description: 'The file to scan for AI-generated content',
17
+ required: true,
18
+ }),
19
+ },
20
+ run(context) {
21
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
22
+ const file = context.propsValue.file;
23
+ const formData = new FormData();
24
+ const fileBuffer = Buffer.from(file.base64, 'base64');
25
+ const mimeType = file.extension
26
+ ? `application/${file.extension}`
27
+ : 'application/octet-stream';
28
+ const blob = new Blob([fileBuffer], { type: mimeType });
29
+ formData.append('files', blob, file.filename);
30
+ const response = yield pieces_common_1.httpClient.sendRequest({
31
+ method: pieces_common_1.HttpMethod.POST,
32
+ url: 'https://api.gptzero.me/v2/predict/files',
33
+ headers: {
34
+ 'x-api-key': context.auth,
35
+ },
36
+ body: formData,
37
+ });
38
+ return response.body;
39
+ });
40
+ },
41
+ });
42
+ //# sourceMappingURL=scan-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scan-file.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/gptzero-detect-ai/src/lib/actions/scan-file.ts"],"names":[],"mappings":";;;;AAAA,kEAAqE;AACrE,4DAAkE;AAClE,kCAA8C;AAEjC,QAAA,QAAQ,GAAG,IAAA,+BAAY,EAAC;IACnC,IAAI,EAAE,0BAAmB;IACzB,IAAI,EAAE,UAAU;IAChB,WAAW,EAAE,WAAW;IACxB,WAAW,EAAE,gDAAgD;IAC7D,KAAK,EAAE;QACL,IAAI,EAAE,2BAAQ,CAAC,IAAI,CAAC;YAClB,WAAW,EAAE,MAAM;YACnB,WAAW,EAAE,2CAA2C;YACxD,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,IAAI,GAAG,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC;YAErC,MAAM,QAAQ,GAAG,IAAI,QAAQ,EAAE,CAAC;YAChC,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;YACtD,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS;gBAC7B,CAAC,CAAC,eAAe,IAAI,CAAC,SAAS,EAAE;gBACjC,CAAC,CAAC,0BAA0B,CAAC;YAC/B,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,CAAC,UAAU,CAAC,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;YACxD,QAAQ,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;YAE9C,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC5C,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,yCAAyC;gBAC9C,OAAO,EAAE;oBACP,WAAW,EAAE,OAAO,CAAC,IAAc;iBACpC;gBACD,IAAI,EAAE,QAAQ;aACf,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const scanText: import("@taskmagic/pieces-framework").IAction<import("@taskmagic/pieces-framework").SecretTextProperty<true>, {
2
+ text: import("@taskmagic/pieces-framework").LongTextProperty<true>;
3
+ }>;
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.scanText = 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("../auth");
8
+ exports.scanText = (0, pieces_framework_1.createAction)({
9
+ auth: auth_1.gptzeroDetectAiAuth,
10
+ name: 'scanText',
11
+ displayName: 'Scan Text',
12
+ description: 'Scan text content for AI-generated content detection',
13
+ props: {
14
+ text: pieces_framework_1.Property.LongText({
15
+ displayName: 'Text',
16
+ description: 'The text content to scan for AI-generated content',
17
+ required: true,
18
+ }),
19
+ },
20
+ run(context) {
21
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
22
+ const payload = {
23
+ document: context.propsValue.text,
24
+ };
25
+ const response = yield pieces_common_1.httpClient.sendRequest({
26
+ method: pieces_common_1.HttpMethod.POST,
27
+ url: 'https://api.gptzero.me/v2/predict/text',
28
+ headers: {
29
+ 'x-api-key': context.auth,
30
+ 'content-type': 'application/json',
31
+ },
32
+ body: payload,
33
+ });
34
+ return response.body;
35
+ });
36
+ },
37
+ });
38
+ //# sourceMappingURL=scan-text.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scan-text.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/gptzero-detect-ai/src/lib/actions/scan-text.ts"],"names":[],"mappings":";;;;AAAA,kEAAqE;AACrE,4DAAkE;AAClE,kCAA8C;AAEjC,QAAA,QAAQ,GAAG,IAAA,+BAAY,EAAC;IACnC,IAAI,EAAE,0BAAmB;IACzB,IAAI,EAAE,UAAU;IAChB,WAAW,EAAE,WAAW;IACxB,WAAW,EAAE,sDAAsD;IACnE,KAAK,EAAE;QACL,IAAI,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACtB,WAAW,EAAE,MAAM;YACnB,WAAW,EAAE,mDAAmD;YAChE,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,OAAO,GAAG;gBACd,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,IAAI;aAClC,CAAC;YAEF,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC5C,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,wCAAwC;gBAC7C,OAAO,EAAE;oBACP,WAAW,EAAE,OAAO,CAAC,IAAc;oBACnC,cAAc,EAAE,kBAAkB;iBACnC;gBACD,IAAI,EAAE,OAAO;aACd,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ export declare const gptzeroDetectAiAuth: import("@taskmagic/pieces-framework").SecretTextProperty<true>;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.gptzeroDetectAiAuth = void 0;
4
+ const pieces_framework_1 = require("@taskmagic/pieces-framework");
5
+ exports.gptzeroDetectAiAuth = pieces_framework_1.PieceAuth.SecretText({
6
+ displayName: 'GPTZero API Key',
7
+ description: 'https://app.gptzero.me/app/api to get your API key',
8
+ required: true,
9
+ });
10
+ //# sourceMappingURL=auth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/community/gptzero-detect-ai/src/lib/auth.ts"],"names":[],"mappings":";;;AAAA,kEAAwD;AAE3C,QAAA,mBAAmB,GAAG,4BAAS,CAAC,UAAU,CAAC;IACtD,WAAW,EAAE,iBAAiB;IAC9B,WAAW,EAAE,oDAAoD;IACjE,QAAQ,EAAE,IAAI;CACf,CAAC,CAAC"}