@composio/core 0.10.0 → 0.12.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 (69) hide show
  1. package/dist/{tool.types-CwbAy9l_.d.cts → BaseProvider-BBnsv9kS.d.mts} +23683 -23635
  2. package/dist/CustomTool-DEB4BQPl.mjs +468 -0
  3. package/dist/{CustomTool-aber890o.d.cts → CustomTool-DH18rVQu.d.mts} +2 -4
  4. package/dist/{FileModifierErrors-C7z16Dfi.mjs → FileModifierErrors-3fSwIWoa.mjs} +35 -36
  5. package/dist/{FileToolModifier.utils.neutral-B7P7wn-b.mjs → FileToolModifier.utils.neutral-B5rT711M.mjs} +1 -7
  6. package/dist/{Telemetry-kgWlkavX.mjs → Telemetry-DhGI_J4G.mjs} +48 -23
  7. package/dist/{composio-CSMCZZgj.d.cts → composio-CHnEggnv.d.mts} +433 -435
  8. package/dist/{customTool.types-BzEWHa0w.d.cts → customTool.types-DpIdOJjL.d.mts} +177 -236
  9. package/dist/{CustomTool-D7-1S2at.mjs → errors-D5f4pfvI.mjs} +132 -519
  10. package/dist/experimental/index.d.mts +2 -3
  11. package/dist/experimental/index.mjs +1 -3
  12. package/dist/{fileUtils.node-Dq7ebZPC.mjs → fileUtils.node-BiO1JQsJ.mjs} +26 -25
  13. package/dist/index.d.mts +2034 -2356
  14. package/dist/index.mjs +2546 -2335
  15. package/dist/jsonSchema-daqF3S3d.mjs +251 -0
  16. package/dist/models/Files.node.d.mts +1 -2
  17. package/dist/models/Files.node.mjs +3 -4
  18. package/dist/models/Files.workerd.d.mts +0 -1
  19. package/dist/platform/node.d.mts +1 -2
  20. package/dist/platform/workerd.d.mts +1 -2
  21. package/dist/{chunk-CWQeghP5.mjs → rolldown-runtime-w6R9maHv.mjs} +3 -5
  22. package/dist/{types-DE7O6Z6S.d.cts → types-CaI5Z4PA.d.mts} +2 -3
  23. package/dist/utils/config-defaults/ConfigDefaults.node.d.mts +1 -4
  24. package/dist/utils/config-defaults/ConfigDefaults.workerd.d.mts +1 -4
  25. package/dist/utils/config-defaults/ConfigDefaults.workerd.mjs +3 -0
  26. package/dist/utils/json-schema.d.mts +2 -0
  27. package/dist/utils/json-schema.mjs +3 -0
  28. package/dist/utils/modifiers/FileToolModifier.node.d.mts +3 -1
  29. package/dist/utils/modifiers/FileToolModifier.node.mjs +81 -44
  30. package/dist/utils/modifiers/FileToolModifier.workerd.d.mts +3 -1
  31. package/dist/utils/modifiers/FileToolModifier.workerd.mjs +1 -1
  32. package/package.json +48 -88
  33. package/dist/CustomTool-CQ_YjABZ.cjs +0 -1341
  34. package/dist/CustomTool-DJUGNOer.d.mts +0 -76
  35. package/dist/FileModifierErrors-BYJBHiay.cjs +0 -554
  36. package/dist/FileToolModifier.utils.neutral-Dfwqgimk.cjs +0 -102
  37. package/dist/Telemetry-Dm-0sewu.cjs +0 -335
  38. package/dist/buffer-BjWptbNH.cjs +0 -63
  39. package/dist/chunk-CQwRTUmo.cjs +0 -53
  40. package/dist/composio-DRl6WCI9.d.mts +0 -5484
  41. package/dist/customTool.types-CMOMgxoM.d.mts +0 -2513
  42. package/dist/experimental/index.cjs +0 -5
  43. package/dist/experimental/index.d.cts +0 -3
  44. package/dist/fileUtils.node-DtnSRMWa.cjs +0 -462
  45. package/dist/files.types-lo4zZd87.d.cts +0 -17
  46. package/dist/index.cjs +0 -8637
  47. package/dist/index.d.cts +0 -5672
  48. package/dist/models/Files.node.cjs +0 -55
  49. package/dist/models/Files.node.d.cts +0 -56
  50. package/dist/models/Files.workerd.cjs +0 -29
  51. package/dist/models/Files.workerd.d.cts +0 -13
  52. package/dist/platform/node.cjs +0 -55
  53. package/dist/platform/node.d.cts +0 -11
  54. package/dist/platform/workerd.cjs +0 -42
  55. package/dist/platform/workerd.d.cts +0 -12
  56. package/dist/tool.types-CB_4JKhV.d.mts +0 -29377
  57. package/dist/types-BTOPdg4d.d.mts +0 -13
  58. package/dist/types-pDNm1lYs.d.cts +0 -69
  59. package/dist/utils/config-defaults/ConfigDefaults.node.cjs +0 -10
  60. package/dist/utils/config-defaults/ConfigDefaults.node.d.cts +0 -7
  61. package/dist/utils/config-defaults/ConfigDefaults.workerd.cjs +0 -10
  62. package/dist/utils/config-defaults/ConfigDefaults.workerd.d.cts +0 -7
  63. package/dist/utils/modifiers/FileToolModifier.node.cjs +0 -207
  64. package/dist/utils/modifiers/FileToolModifier.node.d.cts +0 -22
  65. package/dist/utils/modifiers/FileToolModifier.workerd.cjs +0 -27
  66. package/dist/utils/modifiers/FileToolModifier.workerd.d.cts +0 -20
  67. /package/dist/{buffer-yOtEsT4J.mjs → buffer-PcbMMsgm.mjs} +0 -0
  68. /package/dist/{files.types-BXDWA_zS.d.mts → files.types-DeMC_mAW.d.mts} +0 -0
  69. /package/dist/{types-HpJQ8K9l.d.mts → types-DdoCRzLj.d.mts} +0 -0
@@ -1,55 +0,0 @@
1
- require('../FileModifierErrors-BYJBHiay.cjs');
2
- const require_Telemetry = require('../Telemetry-Dm-0sewu.cjs');
3
- const require_fileUtils_node = require('../fileUtils.node-DtnSRMWa.cjs');
4
-
5
- //#region src/models/Files.node.ts
6
- var Files = class {
7
- fileOptions;
8
- constructor(client, fileOptions = {}) {
9
- this.client = client;
10
- this.fileOptions = fileOptions;
11
- require_Telemetry.telemetry.instrument(this, "Files");
12
- }
13
- /**
14
- * Upload a file and return the file data.
15
- *
16
- * @param params - The upload parameters.
17
- * @param {File | string} params.file - The path to the file to upload, a URL of the file, or a File object.
18
- * @param {string} params.toolSlug - The slug of the tool that is uploading the file.
19
- * @param {string} params.toolkitSlug - The slug of the toolkit that is uploading the file.
20
- * @returns {Promise<FileUploadData>} The uploaded file data.
21
- *
22
- * @example
23
- *
24
- * const fileData = await composio.files.upload({
25
- * file: 'path/to/file.pdf',
26
- * toolSlug: 'google_drive_upload',
27
- * toolkitSlug: 'google_drive'
28
- * });
29
- * */
30
- async upload({ file, toolSlug, toolkitSlug }) {
31
- return await require_fileUtils_node.getFileDataAfterUploadingToS3(file, {
32
- toolSlug,
33
- toolkitSlug,
34
- client: this.client,
35
- sensitiveFileUploadProtection: this.fileOptions.sensitiveFileUploadProtection,
36
- fileUploadPathDenySegments: this.fileOptions.fileUploadPathDenySegments
37
- });
38
- }
39
- /**
40
- * Download a file from S3 and return the file data.
41
- * @param s3key - The S3 key of the file to download.
42
- * @returns The file data.
43
- */
44
- async download({ toolSlug, s3Url, mimeType }) {
45
- return await require_fileUtils_node.downloadFileFromS3({
46
- toolSlug,
47
- s3Url,
48
- mimeType,
49
- fileDownloadDir: this.fileOptions.fileDownloadDir
50
- });
51
- }
52
- };
53
-
54
- //#endregion
55
- exports.Files = Files;
@@ -1,56 +0,0 @@
1
- import { n as FileUploadData, t as FileDownloadData } from "../files.types-lo4zZd87.cjs";
2
- import ComposioClient from "@composio/client";
3
-
4
- //#region src/models/Files.node.d.ts
5
-
6
- declare class Files {
7
- private readonly client;
8
- private readonly fileOptions;
9
- constructor(client: ComposioClient, fileOptions?: {
10
- sensitiveFileUploadProtection?: boolean;
11
- fileUploadPathDenySegments?: string[];
12
- fileDownloadDir?: string;
13
- });
14
- /**
15
- * Upload a file and return the file data.
16
- *
17
- * @param params - The upload parameters.
18
- * @param {File | string} params.file - The path to the file to upload, a URL of the file, or a File object.
19
- * @param {string} params.toolSlug - The slug of the tool that is uploading the file.
20
- * @param {string} params.toolkitSlug - The slug of the toolkit that is uploading the file.
21
- * @returns {Promise<FileUploadData>} The uploaded file data.
22
- *
23
- * @example
24
- *
25
- * const fileData = await composio.files.upload({
26
- * file: 'path/to/file.pdf',
27
- * toolSlug: 'google_drive_upload',
28
- * toolkitSlug: 'google_drive'
29
- * });
30
- * */
31
- upload({
32
- file,
33
- toolSlug,
34
- toolkitSlug
35
- }: {
36
- file: File | string;
37
- toolSlug: string;
38
- toolkitSlug: string;
39
- }): Promise<FileUploadData>;
40
- /**
41
- * Download a file from S3 and return the file data.
42
- * @param s3key - The S3 key of the file to download.
43
- * @returns The file data.
44
- */
45
- download({
46
- toolSlug,
47
- s3Url,
48
- mimeType
49
- }: {
50
- s3Url: string;
51
- toolSlug: string;
52
- mimeType: string;
53
- }): Promise<FileDownloadData>;
54
- }
55
- //#endregion
56
- export { Files };
@@ -1,29 +0,0 @@
1
-
2
- //#region src/models/Files.workerd.ts
3
- const UNSUPPORTED_MESSAGE = "File operations (upload/download) are not supported in Cloudflare Workers or Edge runtimes. These operations require Node.js-specific APIs (e.g., `node:crypto`, `node:fs`) that are not available in this environment. Please use a Node.js runtime for file operations.";
4
- /**
5
- * Creates a Proxy that throws a user-friendly error when any method is accessed.
6
- * This ensures that users get a clear error message when attempting to use
7
- * file operations in unsupported environments.
8
- */
9
- const createUnsupportedFilesProxy = () => {
10
- return new Proxy({}, { get(_target, prop) {
11
- if (prop === Symbol.toStringTag) return "Files";
12
- if (prop === "constructor") return Files;
13
- return () => {
14
- throw new Error(UNSUPPORTED_MESSAGE);
15
- };
16
- } });
17
- };
18
- /**
19
- * Files class for Cloudflare Workers / Edge runtimes.
20
- * All methods throw an error indicating that file operations are not supported.
21
- */
22
- var Files = class {
23
- constructor(_client) {
24
- return createUnsupportedFilesProxy();
25
- }
26
- };
27
-
28
- //#endregion
29
- exports.Files = Files;
@@ -1,13 +0,0 @@
1
- import ComposioClient from "@composio/client";
2
-
3
- //#region src/models/Files.workerd.d.ts
4
-
5
- /**
6
- * Files class for Cloudflare Workers / Edge runtimes.
7
- * All methods throw an error indicating that file operations are not supported.
8
- */
9
- declare class Files {
10
- constructor(_client: ComposioClient);
11
- }
12
- //#endregion
13
- export { Files };
@@ -1,55 +0,0 @@
1
- const require_chunk = require('../chunk-CQwRTUmo.cjs');
2
- let node_fs = require("node:fs");
3
- node_fs = require_chunk.__toESM(node_fs);
4
- let node_os = require("node:os");
5
- node_os = require_chunk.__toESM(node_os);
6
- let node_path = require("node:path");
7
- node_path = require_chunk.__toESM(node_path);
8
-
9
- //#region src/platform/node.ts
10
- /**
11
- * Node.js platform implementation.
12
- * Provides full file system and OS operations using Node.js built-in modules.
13
- */
14
- const platform = {
15
- supportsFileSystem: true,
16
- homedir() {
17
- try {
18
- return node_os.homedir();
19
- } catch {
20
- return null;
21
- }
22
- },
23
- joinPath(...paths) {
24
- return node_path.join(...paths);
25
- },
26
- resolvePath(...paths) {
27
- return node_path.resolve(...paths);
28
- },
29
- isAbsolutePath(filePath) {
30
- return node_path.isAbsolute(filePath);
31
- },
32
- basename(filePath) {
33
- return node_path.basename(filePath);
34
- },
35
- existsSync(filePath) {
36
- return node_fs.existsSync(filePath);
37
- },
38
- mkdirSync(dirPath) {
39
- node_fs.mkdirSync(dirPath, { recursive: true });
40
- },
41
- readFileSync(filePath, encoding) {
42
- if (encoding === void 0) {
43
- const buf = node_fs.readFileSync(filePath, { encoding: null });
44
- return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength);
45
- }
46
- return node_fs.readFileSync(filePath, { encoding });
47
- },
48
- writeFileSync(filePath, content, encoding) {
49
- if (encoding && typeof content === "string") node_fs.writeFileSync(filePath, content, { encoding });
50
- else node_fs.writeFileSync(filePath, content);
51
- }
52
- };
53
-
54
- //#endregion
55
- exports.platform = platform;
@@ -1,11 +0,0 @@
1
- import { t as Platform } from "../types-pDNm1lYs.cjs";
2
-
3
- //#region src/platform/node.d.ts
4
-
5
- /**
6
- * Node.js platform implementation.
7
- * Provides full file system and OS operations using Node.js built-in modules.
8
- */
9
- declare const platform: Platform;
10
- //#endregion
11
- export { platform };
@@ -1,42 +0,0 @@
1
-
2
- //#region src/platform/workerd.ts
3
- /**
4
- * Cloudflare Workers / Edge runtime platform implementation.
5
- * Provides stub implementations for file system operations that are unavailable in edge runtimes.
6
- * All file system operations gracefully return null/empty values or throw descriptive errors.
7
- */
8
- const platform = {
9
- supportsFileSystem: false,
10
- homedir() {
11
- return null;
12
- },
13
- joinPath(...paths) {
14
- return paths.map((segment, index) => {
15
- if (index === 0) return segment.replace(/\/+$/, "");
16
- return segment.replace(/^\/+|\/+$/g, "");
17
- }).filter(Boolean).join("/");
18
- },
19
- resolvePath(...paths) {
20
- return this.joinPath(...paths);
21
- },
22
- isAbsolutePath(filePath) {
23
- return filePath.startsWith("/");
24
- },
25
- basename(filePath) {
26
- const segments = filePath.replace(/\/+$/, "").split("/");
27
- return segments[segments.length - 1] || "";
28
- },
29
- existsSync(_filePath) {
30
- return false;
31
- },
32
- mkdirSync(_dirPath) {},
33
- readFileSync(_filePath, _encoding) {
34
- throw new Error("File system operations are not supported in this runtime environment (Cloudflare Workers/Edge). Use environment variables or external storage services instead.");
35
- },
36
- writeFileSync(_filePath, _content, _encoding) {
37
- throw new Error("File system operations are not supported in this runtime environment (Cloudflare Workers/Edge). Use environment variables or external storage services instead.");
38
- }
39
- };
40
-
41
- //#endregion
42
- exports.platform = platform;
@@ -1,12 +0,0 @@
1
- import { t as Platform } from "../types-pDNm1lYs.cjs";
2
-
3
- //#region src/platform/workerd.d.ts
4
-
5
- /**
6
- * Cloudflare Workers / Edge runtime platform implementation.
7
- * Provides stub implementations for file system operations that are unavailable in edge runtimes.
8
- * All file system operations gracefully return null/empty values or throw descriptive errors.
9
- */
10
- declare const platform: Platform;
11
- //#endregion
12
- export { platform };