@composio/core 0.13.1 → 0.14.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 +62 -247
- package/dist/BaseProvider-Dc5yKZhk.d.mts +29394 -0
- package/dist/{CustomTool-DLf7JeKt.d.mts → CustomTool-4nVuwLzO.d.mts} +1 -2
- package/dist/{CustomTool-D9qwyMrv.mjs → CustomTool-l-j5HtEf.mjs} +17 -15
- package/dist/FileModifierErrors-B8V8_3VE.mjs +97 -0
- package/dist/{FileModifierErrors-3fSwIWoa.mjs → SsrfErrors-DNJt57GL.mjs} +24 -85
- package/dist/{Telemetry-DhGI_J4G.mjs → Telemetry-CF0rNHu2.mjs} +40 -8
- package/dist/{jsonSchema-CFKdONpP.mjs → cancellation-BbJ-UQ__.mjs} +64 -19
- package/dist/{composio-BHSQwOUz.d.mts → composio-ChU3eD9F.d.mts} +1083 -1061
- package/dist/{customTool.types-9yFqPjdw.d.mts → customTool.types-CX2-LbfI.d.mts} +634 -601
- package/dist/docs/reference/sdk-reference/typescript/index.mdx +1 -22
- package/dist/docs/reference/sdk-reference/typescript/session-files.mdx +2 -0
- package/dist/{errors-DSIlYfl5.mjs → errors-BcEUHZbq.mjs} +75 -74
- package/dist/experimental/index.d.mts +2 -2
- package/dist/experimental/index.mjs +1 -1
- package/dist/{fileUtils.node-BiO1JQsJ.mjs → fileUtils.node-DOkW4PBg.mjs} +36 -70
- package/dist/index.d.mts +2446 -1563
- package/dist/index.mjs +1415 -1381
- package/dist/models/Files.node.d.mts +2 -11
- package/dist/models/Files.node.mjs +2 -2
- package/dist/models/Files.workerd.d.mts +0 -1
- package/dist/platform/node.d.mts +1 -2
- package/dist/platform/node.mjs +3 -0
- package/dist/platform/workerd.d.mts +1 -2
- package/dist/platform/workerd.mjs +30 -3
- package/dist/sensitiveFileUploadPaths-C43dHP7S.mjs +164 -0
- package/dist/{types-BJLCRj9q.d.mts → types-D5N60gUD.d.mts} +2 -3
- package/dist/{types-DdoCRzLj.d.mts → types-DY1r-kN9.d.mts} +9 -0
- package/dist/utils/config-defaults/ConfigDefaults.node.d.mts +1 -2
- package/dist/utils/config-defaults/ConfigDefaults.workerd.d.mts +1 -2
- package/dist/utils/modifiers/FileToolModifier.node.d.mts +1 -2
- package/dist/utils/modifiers/FileToolModifier.node.mjs +6 -5
- package/dist/utils/modifiers/FileToolModifier.workerd.d.mts +1 -2
- package/dist/utils/ssrfGuard.node.d.mts +22 -0
- package/dist/utils/ssrfGuard.node.mjs +152 -0
- package/dist/utils/ssrfGuard.workerd.d.mts +9 -0
- package/dist/utils/ssrfGuard.workerd.mjs +17 -0
- package/package.json +20 -15
- package/src/errors/SsrfErrors.ts +48 -0
- package/src/errors/index.ts +3 -0
- package/src/index.ts +10 -0
- package/src/models/CustomTool.ts +1 -3
- package/src/models/ToolRouterSession.ts +38 -16
- package/src/models/ToolRouterSessionFileMount.ts +7 -3
- package/src/models/Tools.ts +32 -2
- package/src/models/Triggers.ts +16 -76
- package/src/platform/node.ts +4 -0
- package/src/platform/types.ts +10 -0
- package/src/platform/workerd.ts +36 -3
- package/src/provider/OpenAIProvider.ts +19 -14
- package/src/telemetry/Telemetry.ts +9 -6
- package/src/telemetry/redact.ts +40 -0
- package/src/types/tool.types.ts +36 -32
- package/src/utils/fileUtils.node.ts +29 -6
- package/src/utils/jsonSchema.ts +58 -0
- package/src/utils/modifiers/FileToolModifier.node.ts +2 -1
- package/src/utils/readResponseBody.ts +63 -0
- package/src/utils/sdk.ts +5 -4
- package/src/utils/{sensitiveFileUploadPaths.node.ts → sensitiveFileUploadPaths.ts} +29 -13
- package/src/utils/ssrfGuard.node.ts +202 -0
- package/src/utils/ssrfGuard.workerd.ts +19 -0
- package/src/utils/toolkitVersion.ts +21 -2
- package/dist/BaseProvider-Brb3o86-.d.mts +0 -29425
- package/dist/CustomTool-NpHpqdnU.d.mts +0 -74
- package/dist/buffer-PcbMMsgm.mjs +0 -33
- package/dist/composio-DfPD7BAi.d.mts +0 -5666
- package/dist/customTool.types-D-6YqFdW.d.mts +0 -2826
- package/dist/types-CCh8qvui.d.mts +0 -12
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
import { ToolkitVersion, ToolkitVersionParam } from '../types/tool.types';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Canonicalizes a toolkit slug into the form used as a version-map key.
|
|
5
|
+
*
|
|
6
|
+
* Toolkit slugs are matched case-insensitively. This is the single source of
|
|
7
|
+
* truth for that rule: every write into a version map (env vars, user-supplied
|
|
8
|
+
* objects — see `getToolkitVersionsFromEnv`) and every read out of one MUST go
|
|
9
|
+
* through this helper so the two sides can never drift apart and silently miss a
|
|
10
|
+
* configured pin.
|
|
11
|
+
*
|
|
12
|
+
* Kept intentionally equivalent to the Python SDK's `normalize_toolkit_slug`
|
|
13
|
+
* (see python/composio/utils/toolkit_version.py).
|
|
14
|
+
*
|
|
15
|
+
* @param toolkitSlug - The slug/name of the toolkit, in any casing
|
|
16
|
+
* @returns The normalized (lowercase) slug used as a version-map key
|
|
17
|
+
*/
|
|
18
|
+
export const normalizeToolkitSlug = (toolkitSlug: string): string => toolkitSlug.toLowerCase();
|
|
19
|
+
|
|
3
20
|
/**
|
|
4
21
|
* Gets the version for a specific toolkit based on the provided toolkit versions configuration.
|
|
5
22
|
*
|
|
@@ -15,10 +32,12 @@ export const getToolkitVersion = (
|
|
|
15
32
|
if (typeof toolkitVersions === 'string') {
|
|
16
33
|
return toolkitVersions;
|
|
17
34
|
}
|
|
18
|
-
// If toolkitVersions is an object mapping, look up the specific toolkit version
|
|
35
|
+
// If toolkitVersions is an object mapping, look up the specific toolkit version.
|
|
36
|
+
// The map is keyed by normalized slugs, so normalize the lookup too
|
|
37
|
+
// (see normalizeToolkitSlug for why).
|
|
19
38
|
const hasToolkitVersion = toolkitVersions && Object.keys(toolkitVersions).length > 0;
|
|
20
39
|
if (hasToolkitVersion) {
|
|
21
|
-
return toolkitVersions[toolkitSlug] ?? 'latest';
|
|
40
|
+
return toolkitVersions[normalizeToolkitSlug(toolkitSlug)] ?? 'latest';
|
|
22
41
|
}
|
|
23
42
|
|
|
24
43
|
// Else use 'latest'
|