@composio/llamaindex 0.4.0 → 0.5.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/dist/index.mjs ADDED
@@ -0,0 +1,58 @@
1
+ import { BaseAgenticProvider, jsonSchemaToZodSchema } from "@composio/core";
2
+ import { tool } from "llamaindex";
3
+
4
+ //#region src/index.ts
5
+ /**
6
+ * Llamaindex Provider
7
+ *
8
+ * This provider provides a set of tools for interacting with Llamaindex.
9
+ *
10
+ * @packageDocumentation
11
+ * @module providers/llamaindex
12
+ */
13
+ var LlamaindexProvider = class extends BaseAgenticProvider {
14
+ name = "llamaindex";
15
+ /**
16
+ * Wrap a tool in the llamaindex format.
17
+ * @param tool - The tool to wrap.
18
+ * @returns The wrapped tool.
19
+ */
20
+ wrapTool(tool$1, executeTool) {
21
+ const inputParams = tool$1.inputParameters;
22
+ const inputParametersSchema = jsonSchemaToZodSchema(inputParams ?? {});
23
+ return tool({
24
+ name: tool$1.slug,
25
+ description: tool$1.description ?? tool$1.name ?? "",
26
+ parameters: inputParametersSchema,
27
+ execute: async (input) => {
28
+ const result = await executeTool(tool$1.slug, input);
29
+ return JSON.stringify(result);
30
+ }
31
+ });
32
+ }
33
+ /**
34
+ * Wrap a list of tools in the llamaindex format.
35
+ * @param tools - The tools to wrap.
36
+ * @returns The wrapped tools.
37
+ */
38
+ wrapTools(tools, executeTool) {
39
+ return tools.map((tool$1) => this.wrapTool(tool$1, executeTool));
40
+ }
41
+ /**
42
+ * Transform MCP URL response into Anthropic-specific format.
43
+ * By default, Anthropic uses the standard format (same as default),
44
+ * but this method is here to show providers can customize if needed.
45
+ *
46
+ * @param data - The MCP URL response data
47
+ * @returns Standard MCP server response format
48
+ */
49
+ wrapMcpServerResponse(data) {
50
+ return data.map((item) => ({
51
+ url: new URL(item.url),
52
+ name: item.name
53
+ }));
54
+ }
55
+ };
56
+
57
+ //#endregion
58
+ export { LlamaindexProvider };
package/package.json CHANGED
@@ -1,17 +1,25 @@
1
1
  {
2
2
  "name": "@composio/llamaindex",
3
- "version": "0.4.0",
3
+ "version": "0.5.1",
4
4
  "description": "Agentic Provider for llamaindex in Composio SDK",
5
- "main": "dist/index.js",
6
- "type": "module",
5
+ "main": "dist/index.mjs",
7
6
  "publishConfig": {
8
7
  "access": "public"
9
8
  },
10
9
  "exports": {
11
10
  ".": {
12
- "import": "./dist/index.js",
13
- "types": "./dist/index.d.ts",
14
- "require": "./dist/index.cjs"
11
+ "import": {
12
+ "types": "./dist/index.d.mts",
13
+ "default": "./dist/index.mjs"
14
+ },
15
+ "require": {
16
+ "types": "./dist/index.d.cts",
17
+ "default": "./dist/index.cjs"
18
+ },
19
+ "default": {
20
+ "types": "./dist/index.d.cts",
21
+ "default": "./dist/index.cjs"
22
+ }
15
23
  }
16
24
  },
17
25
  "files": [
@@ -26,17 +34,17 @@
26
34
  "author": "",
27
35
  "license": "ISC",
28
36
  "peerDependencies": {
29
- "@composio/core": "0.4.0",
37
+ "@composio/core": "0.5.1",
30
38
  "llamaindex": "^0.12.0"
31
39
  },
32
40
  "devDependencies": {
33
- "tsup": "^8.5.0",
41
+ "tsdown": "^0.18.4",
34
42
  "typescript": "^5.9.2",
35
- "@composio/core": "0.4.0"
43
+ "@composio/core": "0.5.1"
36
44
  },
37
45
  "scripts": {
38
- "build": "tsup",
46
+ "build": "tsdown",
39
47
  "test": "vitest run"
40
48
  },
41
- "types": "dist/index.d.ts"
49
+ "types": "dist/index.d.mts"
42
50
  }
package/dist/index.d.ts DELETED
@@ -1,40 +0,0 @@
1
- import { BaseAgenticProvider, McpServerGetResponse, Tool, ExecuteToolFn, McpUrlResponse } from '@composio/core';
2
- import { tool } from 'llamaindex';
3
-
4
- /**
5
- * Llamaindex Provider
6
- *
7
- * This provider provides a set of tools for interacting with Llamaindex.
8
- *
9
- * @packageDocumentation
10
- * @module providers/llamaindex
11
- */
12
-
13
- type LlamaindexTool = ReturnType<typeof tool>;
14
- type LlamaindexToolCollection = Array<LlamaindexTool>;
15
- declare class LlamaindexProvider extends BaseAgenticProvider<Array<LlamaindexTool>, LlamaindexTool, McpServerGetResponse> {
16
- readonly name = "llamaindex";
17
- /**
18
- * Wrap a tool in the llamaindex format.
19
- * @param tool - The tool to wrap.
20
- * @returns The wrapped tool.
21
- */
22
- wrapTool(tool: Tool, executeTool: ExecuteToolFn): LlamaindexTool;
23
- /**
24
- * Wrap a list of tools in the llamaindex format.
25
- * @param tools - The tools to wrap.
26
- * @returns The wrapped tools.
27
- */
28
- wrapTools(tools: Tool[], executeTool: ExecuteToolFn): LlamaindexToolCollection;
29
- /**
30
- * Transform MCP URL response into Anthropic-specific format.
31
- * By default, Anthropic uses the standard format (same as default),
32
- * but this method is here to show providers can customize if needed.
33
- *
34
- * @param data - The MCP URL response data
35
- * @returns Standard MCP server response format
36
- */
37
- wrapMcpServerResponse(data: McpUrlResponse): McpServerGetResponse;
38
- }
39
-
40
- export { LlamaindexProvider, type LlamaindexTool, type LlamaindexToolCollection };
package/dist/index.js DELETED
@@ -1,52 +0,0 @@
1
- // src/index.ts
2
- import {
3
- BaseAgenticProvider,
4
- jsonSchemaToZodSchema
5
- } from "@composio/core";
6
- import { tool as createLlamaindexTool } from "llamaindex";
7
- var LlamaindexProvider = class extends BaseAgenticProvider {
8
- name = "llamaindex";
9
- /**
10
- * Wrap a tool in the llamaindex format.
11
- * @param tool - The tool to wrap.
12
- * @returns The wrapped tool.
13
- */
14
- wrapTool(tool, executeTool) {
15
- const inputParams = tool.inputParameters;
16
- const inputParametersSchema = jsonSchemaToZodSchema(inputParams ?? {});
17
- return createLlamaindexTool({
18
- name: tool.slug,
19
- description: tool.description ?? tool.name ?? "",
20
- parameters: inputParametersSchema,
21
- execute: async (input) => {
22
- const result = await executeTool(tool.slug, input);
23
- return JSON.stringify(result);
24
- }
25
- });
26
- }
27
- /**
28
- * Wrap a list of tools in the llamaindex format.
29
- * @param tools - The tools to wrap.
30
- * @returns The wrapped tools.
31
- */
32
- wrapTools(tools, executeTool) {
33
- return tools.map((tool) => this.wrapTool(tool, executeTool));
34
- }
35
- /**
36
- * Transform MCP URL response into Anthropic-specific format.
37
- * By default, Anthropic uses the standard format (same as default),
38
- * but this method is here to show providers can customize if needed.
39
- *
40
- * @param data - The MCP URL response data
41
- * @returns Standard MCP server response format
42
- */
43
- wrapMcpServerResponse(data) {
44
- return data.map((item) => ({
45
- url: new URL(item.url),
46
- name: item.name
47
- }));
48
- }
49
- };
50
- export {
51
- LlamaindexProvider
52
- };