@inkeep/agents-sdk 0.0.0-dev-20250911192304 → 0.0.0-dev-20250911210702

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkeep/agents-sdk",
3
- "version": "0.0.0-dev-20250911192304",
3
+ "version": "0.0.0-dev-20250911210702",
4
4
  "description": "SDK for building and managing agents in the Inkeep Agent Framework",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -8,7 +8,7 @@
8
8
  "dependencies": {
9
9
  "nanoid": "^5.1.5",
10
10
  "zod": "^4.1.5",
11
- "@inkeep/agents-core": "^0.0.0-dev-20250911192304"
11
+ "@inkeep/agents-core": "^0.0.0-dev-20250911210702"
12
12
  },
13
13
  "devDependencies": {
14
14
  "@types/node": "^20.11.24",
@@ -1,145 +0,0 @@
1
- import { getLogger } from '@inkeep/agents-core';
2
-
3
- var __defProp = Object.defineProperty;
4
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5
- var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
6
- var logger = getLogger("tool");
7
- var Tool = class {
8
- constructor(config) {
9
- __publicField(this, "config");
10
- __publicField(this, "baseURL");
11
- __publicField(this, "tenantId");
12
- __publicField(this, "initialized", false);
13
- __publicField(this, "projectId");
14
- this.config = config;
15
- this.baseURL = process.env.INKEEP_API_URL || "http://localhost:3002";
16
- this.tenantId = config.tenantId || "default";
17
- this.projectId = config.projectId || "default";
18
- logger.info(
19
- {
20
- Id: this.getId(),
21
- Name: config.name
22
- },
23
- "Tool constructor initialized"
24
- );
25
- }
26
- // Compute ID from name using same slug transformation as agents
27
- getId() {
28
- return this.config.id;
29
- }
30
- getName() {
31
- return this.config.name;
32
- }
33
- getDescription() {
34
- return this.config.description || "";
35
- }
36
- getServerUrl() {
37
- return this.config.serverUrl;
38
- }
39
- getActiveTools() {
40
- return this.config.activeTools;
41
- }
42
- getCredentialReferenceId() {
43
- return this.config.credential?.id;
44
- }
45
- // Public method to ensure tool exists in backend (with upsert behavior)
46
- async init(options) {
47
- if (this.initialized) return;
48
- try {
49
- if (!options?.skipDatabaseRegistration) {
50
- await this.upsertTool();
51
- }
52
- logger.info(
53
- {
54
- toolId: this.getId()
55
- },
56
- "Tool initialized successfully"
57
- );
58
- this.initialized = true;
59
- } catch (error) {
60
- logger.error(
61
- {
62
- toolId: this.getId(),
63
- error: error instanceof Error ? error.message : "Unknown error"
64
- },
65
- "Failed to initialize tool"
66
- );
67
- throw error;
68
- }
69
- }
70
- // Private method to upsert tool (create or update)
71
- async upsertTool() {
72
- const toolDataForUpdate = {
73
- id: this.getId(),
74
- name: this.config.name,
75
- credentialReferenceId: this.config.credential?.id ?? null,
76
- headers: this.config.headers ?? null,
77
- imageUrl: this.config.imageUrl,
78
- config: {
79
- type: "mcp",
80
- mcp: {
81
- server: {
82
- url: this.config.serverUrl
83
- },
84
- transport: this.config.transport,
85
- activeTools: this.config.activeTools
86
- }
87
- }
88
- };
89
- const toolDataForCreate = {
90
- ...toolDataForUpdate
91
- };
92
- logger.info({ toolDataForCreate }, "toolDataForCreate");
93
- const updateResponse = await fetch(
94
- `${this.baseURL}/tenants/${this.tenantId}/crud/projects/${this.projectId}/tools/${this.getId()}`,
95
- {
96
- method: "PUT",
97
- headers: {
98
- "Content-Type": "application/json"
99
- },
100
- body: JSON.stringify(toolDataForUpdate)
101
- }
102
- );
103
- logger.info({ updateResponse }, "tool updateResponse");
104
- if (updateResponse.ok) {
105
- logger.info(
106
- {
107
- toolId: this.getId()
108
- },
109
- "Tool updated successfully"
110
- );
111
- return;
112
- }
113
- if (updateResponse.status === 404) {
114
- logger.info(
115
- {
116
- toolId: this.getId()
117
- },
118
- "Tool not found, creating new tool"
119
- );
120
- const createResponse = await fetch(
121
- `${this.baseURL}/tenants/${this.tenantId}/crud/projects/${this.projectId}/tools`,
122
- {
123
- method: "POST",
124
- headers: {
125
- "Content-Type": "application/json"
126
- },
127
- body: JSON.stringify(toolDataForCreate)
128
- }
129
- );
130
- if (!createResponse.ok) {
131
- throw new Error(`Failed to create tool: ${createResponse.status}`);
132
- }
133
- logger.info(
134
- {
135
- toolId: this.getId()
136
- },
137
- "Tool created successfully"
138
- );
139
- return;
140
- }
141
- throw new Error(`Failed to update tool: ${updateResponse.status}`);
142
- }
143
- };
144
-
145
- export { Tool, __publicField };
@@ -1 +0,0 @@
1
- export { Tool } from './chunk-BCJFVUMJ.js';