@composio/core 0.27.0 → 0.29.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 (64) hide show
  1. package/README.md +2 -0
  2. package/dist/{CustomTool-BYHB7sPs.mjs → CustomTool-Bd1KdWvo.mjs} +9 -8
  3. package/dist/{CustomTool-CqPoLUD6.d.mts → CustomTool-CMW-d2ZN.d.mts} +10 -9
  4. package/dist/{Telemetry-41JkqpZ7.mjs → Telemetry-D2PJwXKx.mjs} +1 -1
  5. package/dist/{cancellation-ZoRh6EJQ.mjs → cancellation-BoJjs34Y.mjs} +1 -1
  6. package/dist/{composio-BUa10iB3.d.mts → composio-D5UV5HXN.d.mts} +799 -100
  7. package/dist/{customTool.types-gX421uPT.d.mts → customTool.types-B9fs34dv.d.mts} +105 -60
  8. package/dist/docs/reference/sdk-reference/typescript/composio.mdx +1 -1
  9. package/dist/docs/reference/sdk-reference/typescript/connected-accounts.mdx +2 -2
  10. package/dist/docs/reference/sdk-reference/typescript/custom-toolkits.mdx +86 -3
  11. package/dist/docs/reference/sdk-reference/typescript/experimental.mdx +1 -1
  12. package/dist/docs/reference/sdk-reference/typescript/session-configs.mdx +1 -1
  13. package/dist/docs/reference/sdk-reference/typescript/session.mdx +51 -13
  14. package/dist/docs/reference/sdk-reference/typescript/sessions.mdx +6 -6
  15. package/dist/docs/reference/sdk-reference/typescript/tools.mdx +4 -4
  16. package/dist/docs/reference/sdk-reference/typescript/triggers.mdx +5 -1
  17. package/dist/{errors-Cly0vXFh.mjs → errors-BK6Xc7Ia.mjs} +65 -1
  18. package/dist/experimental/index.d.mts +3 -3
  19. package/dist/experimental/index.mjs +1 -1
  20. package/dist/{fileUtils.node-DNLhLg0W.mjs → fileUtils.node-ILI1IjnZ.mjs} +4 -3
  21. package/dist/index.d.mts +46 -16
  22. package/dist/index.mjs +2973 -2778
  23. package/dist/models/Files.node.mjs +2 -2
  24. package/dist/sensitiveFileUploadPaths-BaEORC7-.mjs +588 -0
  25. package/dist/{types-DXxfzBX3.d.mts → types-CaP2SytR.d.mts} +2 -2
  26. package/dist/utils/config-defaults/ConfigDefaults.node.d.mts +1 -1
  27. package/dist/utils/config-defaults/ConfigDefaults.workerd.d.mts +1 -1
  28. package/dist/utils/modifiers/FileToolModifier.node.d.mts +1 -1
  29. package/dist/utils/modifiers/FileToolModifier.node.mjs +3 -3
  30. package/dist/utils/modifiers/FileToolModifier.workerd.d.mts +1 -1
  31. package/package.json +7 -6
  32. package/src/errors/ToolErrors.ts +73 -1
  33. package/src/experimental/index.ts +6 -1
  34. package/src/lib/toolRouterParams.ts +68 -33
  35. package/src/lib/toolRouterSessionDelete.ts +1 -10
  36. package/src/models/ConnectedAccounts.ts +3 -3
  37. package/src/models/ConnectionRequest.ts +38 -34
  38. package/src/models/CustomTool.ts +26 -31
  39. package/src/models/CustomToolkits.ts +116 -10
  40. package/src/models/Experimental.ts +1 -1
  41. package/src/models/MCP.ts +1 -2
  42. package/src/models/SessionConfigs.ts +11 -3
  43. package/src/models/SessionContext.ts +4 -4
  44. package/src/models/ToolRouter.ts +26 -17
  45. package/src/models/ToolRouterSession.ts +39 -24
  46. package/src/models/Tools.ts +60 -14
  47. package/src/models/Triggers.ts +12 -5
  48. package/src/models/inlineCustomToolsPayload.ts +3 -3
  49. package/src/models/proxyParamsTransform.ts +1 -1
  50. package/src/types/customTool.types.ts +62 -33
  51. package/src/types/customToolkits.types.ts +91 -11
  52. package/src/types/sessionConfigs.types.ts +21 -7
  53. package/src/types/toolRouter.types.ts +53 -24
  54. package/src/types/triggers.types.ts +14 -0
  55. package/src/utils/fileUtils.node.ts +5 -2
  56. package/src/utils/mime.ts +347 -1
  57. package/src/utils/rateLimit.ts +25 -0
  58. package/src/utils/transformers/connectedAccounts.ts +2 -7
  59. package/src/utils/transformers/customToolkits.ts +79 -10
  60. package/src/utils/transformers/sessionConfigs.ts +3 -3
  61. package/src/utils/transformers/toolRouterResponseTransform.ts +23 -75
  62. package/src/utils/transformers/toolkits.ts +7 -13
  63. package/src/utils/transformers/triggers.ts +28 -18
  64. package/dist/sensitiveFileUploadPaths-BlLp-Yo2.mjs +0 -189
package/README.md CHANGED
@@ -6,6 +6,8 @@ Full documentation lives at [docs.composio.dev](https://docs.composio.dev). This
6
6
 
7
7
  ## Installation
8
8
 
9
+ You need **Node.js 22.22.3 or newer**. The SDK is **ESM-only**: use `import` rather than CommonJS `require()`, and set `"type": "module"` in your project's `package.json`. See the [SDK quickstart](https://docs.composio.dev/docs/quickstart) for framework setup.
10
+
9
11
  ```bash
10
12
  npm install @composio/core
11
13
  ```
@@ -1,4 +1,4 @@
1
- import { C as ValidationError } from "./errors-Cly0vXFh.mjs";
1
+ import { C as ValidationError } from "./errors-BK6Xc7Ia.mjs";
2
2
  import { z as z$1 } from "zod/v3";
3
3
  import * as z4 from "zod/v4";
4
4
  import * as zodToJsonSchema from "zod-to-json-schema";
@@ -120,10 +120,10 @@ function validateSlugLength(toolSlug, toolkitSlug, context) {
120
120
  }
121
121
  }
122
122
  /**
123
- * Create a custom tool for use in tool router sessions.
123
+ * Create a local tool for use in tool router sessions.
124
124
  *
125
125
  * The returned object is a lightweight reference containing the tool's metadata
126
- * and execute function. Pass it to `composio.create(userId, { experimental: { customTools: [...] } })`
126
+ * and execute function. Pass it to `composio.create(userId, { experimental: { localTools: [...] } })`
127
127
  * to bind it to a session.
128
128
  *
129
129
  * Just return the result data from `execute`, or throw an error.
@@ -136,7 +136,7 @@ function validateSlugLength(toolSlug, toolkitSlug, context) {
136
136
  *
137
137
  * @param slug - Unique tool identifier (alphanumeric, underscores, hyphens; no LOCAL_ or COMPOSIO_ prefix)
138
138
  * @param options - Tool definition including name, schema, and execute function
139
- * @returns A CustomTool to pass to session creation
139
+ * @returns A LocalTool to pass to session creation
140
140
  *
141
141
  * @example Standalone tool (no auth)
142
142
  * ```typescript
@@ -188,7 +188,8 @@ function createCustomTool(slug, options) {
188
188
  };
189
189
  }
190
190
  /**
191
- * Create a custom toolkit that groups related tools.
191
+ * Create a toolkit that groups related local tools. Pass it to
192
+ * `composio.create(userId, { experimental: { localToolkits: [...] } })`.
192
193
  *
193
194
  * Tools passed here must NOT have `extendsToolkit` set — they inherit the toolkit identity instead.
194
195
  *
@@ -198,7 +199,7 @@ function createCustomTool(slug, options) {
198
199
  *
199
200
  * @param slug - Unique toolkit identifier (alphanumeric, underscores, hyphens; no LOCAL_ or COMPOSIO_ prefix)
200
201
  * @param options - Toolkit definition including name, description, and tools
201
- * @returns A CustomToolkit to pass to session creation
202
+ * @returns A LocalToolkit to pass to session creation
202
203
  *
203
204
  * @example
204
205
  * ```typescript
@@ -442,8 +443,8 @@ function findCustomToolMapEntryByToolkitAndOriginalSlug(customToolsMap, toolkit,
442
443
  /**
443
444
  * Reject legacy attempts to preload custom tools through top-level preload.tools.
444
445
  *
445
- * Custom tool direct exposure is controlled by CustomTool.preload /
446
- * CustomToolkit.preload so it follows the current SDK-provided custom
446
+ * Custom tool direct exposure is controlled by LocalTool.preload /
447
+ * LocalToolkit.preload so it follows the current SDK-provided custom
447
448
  * definitions instead of stale session config.
448
449
  *
449
450
  * @internal
@@ -1,11 +1,11 @@
1
- import { a as CreateCustomToolkitParams, f as CustomToolkit, o as CustomTool, r as CreateCustomToolParams, t as AnyZodSchema } from "./customTool.types-gX421uPT.mjs";
2
- import { SessionCreateResponse } from "@composio/client/resources/tool-router/session/session.mjs";
1
+ import { S as LocalTool, o as CreateLocalToolParams, s as CreateLocalToolkitParams, t as AnyZodSchema, w as LocalToolkit } from "./customTool.types-B9fs34dv.mjs";
2
+ import { SessionCreateResponse } from "@composio/client/resources/tool-router/session";
3
3
  //#region src/models/CustomTool.d.ts
4
4
  /**
5
- * Create a custom tool for use in tool router sessions.
5
+ * Create a local tool for use in tool router sessions.
6
6
  *
7
7
  * The returned object is a lightweight reference containing the tool's metadata
8
- * and execute function. Pass it to `composio.create(userId, { experimental: { customTools: [...] } })`
8
+ * and execute function. Pass it to `composio.create(userId, { experimental: { localTools: [...] } })`
9
9
  * to bind it to a session.
10
10
  *
11
11
  * Just return the result data from `execute`, or throw an error.
@@ -18,7 +18,7 @@ import { SessionCreateResponse } from "@composio/client/resources/tool-router/se
18
18
  *
19
19
  * @param slug - Unique tool identifier (alphanumeric, underscores, hyphens; no LOCAL_ or COMPOSIO_ prefix)
20
20
  * @param options - Tool definition including name, schema, and execute function
21
- * @returns A CustomTool to pass to session creation
21
+ * @returns A LocalTool to pass to session creation
22
22
  *
23
23
  * @example Standalone tool (no auth)
24
24
  * ```typescript
@@ -45,9 +45,10 @@ import { SessionCreateResponse } from "@composio/client/resources/tool-router/se
45
45
  * });
46
46
  * ```
47
47
  */
48
- declare function createCustomTool<T extends AnyZodSchema>(slug: string, options: CreateCustomToolParams<T>): CustomTool;
48
+ declare function createCustomTool<T extends AnyZodSchema>(slug: string, options: CreateLocalToolParams<T>): LocalTool;
49
49
  /**
50
- * Create a custom toolkit that groups related tools.
50
+ * Create a toolkit that groups related local tools. Pass it to
51
+ * `composio.create(userId, { experimental: { localToolkits: [...] } })`.
51
52
  *
52
53
  * Tools passed here must NOT have `extendsToolkit` set — they inherit the toolkit identity instead.
53
54
  *
@@ -57,7 +58,7 @@ declare function createCustomTool<T extends AnyZodSchema>(slug: string, options:
57
58
  *
58
59
  * @param slug - Unique toolkit identifier (alphanumeric, underscores, hyphens; no LOCAL_ or COMPOSIO_ prefix)
59
60
  * @param options - Toolkit definition including name, description, and tools
60
- * @returns A CustomToolkit to pass to session creation
61
+ * @returns A LocalToolkit to pass to session creation
61
62
  *
62
63
  * @example
63
64
  * ```typescript
@@ -68,6 +69,6 @@ declare function createCustomTool<T extends AnyZodSchema>(slug: string, options:
68
69
  * });
69
70
  * ```
70
71
  */
71
- declare function createCustomToolkit(slug: string, options: CreateCustomToolkitParams): CustomToolkit;
72
+ declare function createCustomToolkit(slug: string, options: CreateLocalToolkitParams): LocalToolkit;
72
73
  //#endregion
73
74
  export { createCustomToolkit as n, createCustomTool as t };
@@ -1,5 +1,5 @@
1
1
  import { a as redactSensitiveText, i as logger, p as getEnvVariable, r as ComposioError$1 } from "./SsrfErrors-DiQldIdC.mjs";
2
- import { u as getRandomUUID } from "./sensitiveFileUploadPaths-BlLp-Yo2.mjs";
2
+ import { f as getRandomUUID } from "./sensitiveFileUploadPaths-BaEORC7-.mjs";
3
3
  import { ComposioError } from "@composio/client";
4
4
 
5
5
  //#region src/types/telemetry.types.ts
@@ -1,5 +1,5 @@
1
1
  import { i as logger } from "./SsrfErrors-DiQldIdC.mjs";
2
- import { S as JsonSchemaToZodError, _ as ComposioRequestCancelledError, b as isRequestAbortError, x as JsonSchemaRefResolutionError } from "./errors-Cly0vXFh.mjs";
2
+ import { S as JsonSchemaToZodError, _ as ComposioRequestCancelledError, b as isRequestAbortError, x as JsonSchemaRefResolutionError } from "./errors-BK6Xc7Ia.mjs";
3
3
  import { o as isPlainObject } from "./FileToolModifier.utils.neutral-DWFpnsj2.mjs";
4
4
  import { jsonSchemaToZod } from "@composio/json-schema-to-zod";
5
5