@inkeep/agents-sdk 0.0.0-dev-20251001202049 → 0.0.0-dev-20251001211316

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.cjs CHANGED
@@ -38,10 +38,13 @@ var ArtifactComponent = class {
38
38
  "ArtifactComponent constructor initialized"
39
39
  );
40
40
  }
41
- // Set context (tenantId and projectId) from external source (agent, graph, CLI, etc)
42
- setContext(tenantId, projectId) {
41
+ // Set context (tenantId, projectId, and baseURL) from external source (agent, graph, CLI, etc)
42
+ setContext(tenantId, projectId, baseURL) {
43
43
  this.tenantId = tenantId;
44
44
  this.projectId = projectId;
45
+ if (baseURL) {
46
+ this.baseURL = baseURL;
47
+ }
45
48
  }
46
49
  // Compute ID from name using same slug transformation as agents
47
50
  getId() {
@@ -180,10 +183,13 @@ var DataComponent = class {
180
183
  "DataComponent constructor initialized"
181
184
  );
182
185
  }
183
- // Set context (tenantId and projectId) from external source (agent, graph, CLI, etc)
184
- setContext(tenantId, projectId) {
186
+ // Set context (tenantId, projectId, and baseURL) from external source (agent, graph, CLI, etc)
187
+ setContext(tenantId, projectId, baseURL) {
185
188
  this.tenantId = tenantId;
186
189
  this.projectId = projectId;
190
+ if (baseURL) {
191
+ this.baseURL = baseURL;
192
+ }
187
193
  }
188
194
  // Compute ID from name using same slug transformation as agents
189
195
  getId() {
@@ -313,10 +319,13 @@ var Tool = class {
313
319
  "Tool constructor initialized"
314
320
  );
315
321
  }
316
- // Set context (tenantId and projectId) from external source (agent, graph, CLI, etc)
317
- setContext(tenantId, projectId) {
322
+ // Set context (tenantId, projectId, and baseURL) from external source (agent, graph, CLI, etc)
323
+ setContext(tenantId, projectId, baseURL) {
318
324
  this.tenantId = tenantId;
319
325
  this.projectId = projectId;
326
+ if (baseURL) {
327
+ this.baseURL = baseURL;
328
+ }
320
329
  }
321
330
  // Compute ID from name using same slug transformation as agents
322
331
  getId() {
@@ -494,10 +503,13 @@ var Agent = class {
494
503
  "Agent constructor initialized"
495
504
  );
496
505
  }
497
- // Set context (tenantId and projectId) from external source (graph, CLI, etc)
498
- setContext(tenantId, projectId) {
506
+ // Set context (tenantId, projectId, and baseURL) from external source (graph, CLI, etc)
507
+ setContext(tenantId, projectId, baseURL) {
499
508
  this.tenantId = tenantId;
500
509
  this.projectId = projectId;
510
+ if (baseURL) {
511
+ this.baseURL = baseURL;
512
+ }
501
513
  }
502
514
  // Return the configured ID
503
515
  getId() {
@@ -1208,20 +1220,25 @@ var AgentGraph = class {
1208
1220
  if (this.isInternalAgent(agent2)) {
1209
1221
  const internalAgent = agent2;
1210
1222
  if (internalAgent.setContext) {
1211
- internalAgent.setContext(tenantId, projectId);
1223
+ internalAgent.setContext(tenantId, projectId, apiUrl);
1212
1224
  }
1213
1225
  const tools = internalAgent.getTools();
1214
1226
  for (const [_, toolInstance] of Object.entries(tools)) {
1215
1227
  if (toolInstance && typeof toolInstance === "object") {
1216
1228
  if ("setContext" in toolInstance && typeof toolInstance.setContext === "function") {
1217
- toolInstance.setContext(tenantId, projectId);
1229
+ toolInstance.setContext(tenantId, projectId, apiUrl);
1218
1230
  }
1219
1231
  }
1220
1232
  }
1233
+ } else {
1234
+ const externalAgent2 = agent2;
1235
+ if (externalAgent2.setContext) {
1236
+ externalAgent2.setContext(tenantId, apiUrl);
1237
+ }
1221
1238
  }
1222
1239
  }
1223
1240
  if (this.contextConfig?.setContext) {
1224
- this.contextConfig.setContext(tenantId, projectId);
1241
+ this.contextConfig.setContext(tenantId, projectId, apiUrl);
1225
1242
  }
1226
1243
  logger6.info(
1227
1244
  {
@@ -3191,9 +3208,12 @@ var ExternalAgent = class {
3191
3208
  throw error;
3192
3209
  }
3193
3210
  }
3194
- // Set context (tenantId) from external source (graph, CLI, etc)
3195
- setContext(tenantId) {
3211
+ // Set context (tenantId and baseURL) from external source (graph, CLI, etc)
3212
+ setContext(tenantId, baseURL) {
3196
3213
  this.tenantId = tenantId;
3214
+ if (baseURL) {
3215
+ this.baseURL = baseURL;
3216
+ }
3197
3217
  }
3198
3218
  // Compute ID from name using a simple slug transformation
3199
3219
  getId() {
package/dist/index.d.cts CHANGED
@@ -18,7 +18,7 @@ declare class Tool implements ToolInterface {
18
18
  private initialized;
19
19
  private projectId;
20
20
  constructor(config: Omit<MCPToolConfig$1, 'tenantId' | 'projectId'>);
21
- setContext(tenantId: string, projectId: string): void;
21
+ setContext(tenantId: string, projectId: string, baseURL?: string): void;
22
22
  getId(): string;
23
23
  getName(): string;
24
24
  getDescription(): string;
@@ -39,7 +39,7 @@ interface ArtifactComponentInterface {
39
39
  getDescription(): ArtifactComponentInsert['description'];
40
40
  getSummaryProps(): ArtifactComponentInsert['summaryProps'];
41
41
  getFullProps(): ArtifactComponentInsert['fullProps'];
42
- setContext(tenantId: string, projectId: string): void;
42
+ setContext(tenantId: string, projectId: string, baseURL?: string): void;
43
43
  }
44
44
  declare class ArtifactComponent implements ArtifactComponentInterface {
45
45
  config: Omit<ArtifactComponentInsert, 'tenantId' | 'projectId'>;
@@ -49,7 +49,7 @@ declare class ArtifactComponent implements ArtifactComponentInterface {
49
49
  private initialized;
50
50
  private id;
51
51
  constructor(config: Omit<ArtifactComponentInsert, 'tenantId' | 'projectId'>);
52
- setContext(tenantId: string, projectId: string): void;
52
+ setContext(tenantId: string, projectId: string, baseURL?: string): void;
53
53
  getId(): string;
54
54
  getName(): string;
55
55
  getDescription(): string;
@@ -131,7 +131,7 @@ interface DataComponentInterface {
131
131
  getName(): DataComponentInsert['name'];
132
132
  getDescription(): DataComponentInsert['description'];
133
133
  getProps(): DataComponentInsert['props'];
134
- setContext(tenantId: string, projectId: string): void;
134
+ setContext(tenantId: string, projectId: string, baseURL?: string): void;
135
135
  }
136
136
  declare class DataComponent implements DataComponentInterface {
137
137
  config: Omit<DataComponentInsert, 'tenantId' | 'projectId'>;
@@ -141,7 +141,7 @@ declare class DataComponent implements DataComponentInterface {
141
141
  private initialized;
142
142
  private id;
143
143
  constructor(config: Omit<DataComponentInsert, 'tenantId' | 'projectId'>);
144
- setContext(tenantId: string, projectId: string): void;
144
+ setContext(tenantId: string, projectId: string, baseURL?: string): void;
145
145
  getId(): string;
146
146
  getName(): string;
147
147
  getDescription(): string;
@@ -170,7 +170,7 @@ declare class ExternalAgent implements ExternalAgentInterface {
170
170
  * Initialize the external agent by upserting it in the database
171
171
  */
172
172
  init(): Promise<void>;
173
- setContext(tenantId: string): void;
173
+ setContext(tenantId: string, baseURL?: string): void;
174
174
  getId(): string;
175
175
  private upsertExternalAgent;
176
176
  /**
@@ -414,7 +414,7 @@ interface AgentInterface {
414
414
  getDelegates(): AllAgentInterface[];
415
415
  getDataComponents(): DataComponentApiInsert[];
416
416
  getArtifactComponents(): ArtifactComponentApiInsert[];
417
- setContext(tenantId: string, projectId: string): void;
417
+ setContext(tenantId: string, projectId: string, baseURL?: string): void;
418
418
  addTool(name: string, tool: any): void;
419
419
  addTransfer(...agents: AgentInterface[]): void;
420
420
  addDelegate(...agents: AgentInterface[]): void;
@@ -429,7 +429,7 @@ interface ExternalAgentInterface {
429
429
  getBaseUrl(): string;
430
430
  getCredentialReferenceId(): string | undefined;
431
431
  getHeaders(): Record<string, string> | undefined;
432
- setContext?(tenantId: string): void;
432
+ setContext?(tenantId: string, baseURL?: string): void;
433
433
  }
434
434
  interface GraphInterface {
435
435
  init(): Promise<void>;
@@ -479,7 +479,7 @@ declare class Agent implements AgentInterface {
479
479
  private projectId;
480
480
  private initialized;
481
481
  constructor(config: AgentConfig);
482
- setContext(tenantId: string, projectId: string): void;
482
+ setContext(tenantId: string, projectId: string, baseURL?: string): void;
483
483
  getId(): string;
484
484
  getName(): string;
485
485
  getInstructions(): string;
package/dist/index.d.ts CHANGED
@@ -18,7 +18,7 @@ declare class Tool implements ToolInterface {
18
18
  private initialized;
19
19
  private projectId;
20
20
  constructor(config: Omit<MCPToolConfig$1, 'tenantId' | 'projectId'>);
21
- setContext(tenantId: string, projectId: string): void;
21
+ setContext(tenantId: string, projectId: string, baseURL?: string): void;
22
22
  getId(): string;
23
23
  getName(): string;
24
24
  getDescription(): string;
@@ -39,7 +39,7 @@ interface ArtifactComponentInterface {
39
39
  getDescription(): ArtifactComponentInsert['description'];
40
40
  getSummaryProps(): ArtifactComponentInsert['summaryProps'];
41
41
  getFullProps(): ArtifactComponentInsert['fullProps'];
42
- setContext(tenantId: string, projectId: string): void;
42
+ setContext(tenantId: string, projectId: string, baseURL?: string): void;
43
43
  }
44
44
  declare class ArtifactComponent implements ArtifactComponentInterface {
45
45
  config: Omit<ArtifactComponentInsert, 'tenantId' | 'projectId'>;
@@ -49,7 +49,7 @@ declare class ArtifactComponent implements ArtifactComponentInterface {
49
49
  private initialized;
50
50
  private id;
51
51
  constructor(config: Omit<ArtifactComponentInsert, 'tenantId' | 'projectId'>);
52
- setContext(tenantId: string, projectId: string): void;
52
+ setContext(tenantId: string, projectId: string, baseURL?: string): void;
53
53
  getId(): string;
54
54
  getName(): string;
55
55
  getDescription(): string;
@@ -131,7 +131,7 @@ interface DataComponentInterface {
131
131
  getName(): DataComponentInsert['name'];
132
132
  getDescription(): DataComponentInsert['description'];
133
133
  getProps(): DataComponentInsert['props'];
134
- setContext(tenantId: string, projectId: string): void;
134
+ setContext(tenantId: string, projectId: string, baseURL?: string): void;
135
135
  }
136
136
  declare class DataComponent implements DataComponentInterface {
137
137
  config: Omit<DataComponentInsert, 'tenantId' | 'projectId'>;
@@ -141,7 +141,7 @@ declare class DataComponent implements DataComponentInterface {
141
141
  private initialized;
142
142
  private id;
143
143
  constructor(config: Omit<DataComponentInsert, 'tenantId' | 'projectId'>);
144
- setContext(tenantId: string, projectId: string): void;
144
+ setContext(tenantId: string, projectId: string, baseURL?: string): void;
145
145
  getId(): string;
146
146
  getName(): string;
147
147
  getDescription(): string;
@@ -170,7 +170,7 @@ declare class ExternalAgent implements ExternalAgentInterface {
170
170
  * Initialize the external agent by upserting it in the database
171
171
  */
172
172
  init(): Promise<void>;
173
- setContext(tenantId: string): void;
173
+ setContext(tenantId: string, baseURL?: string): void;
174
174
  getId(): string;
175
175
  private upsertExternalAgent;
176
176
  /**
@@ -414,7 +414,7 @@ interface AgentInterface {
414
414
  getDelegates(): AllAgentInterface[];
415
415
  getDataComponents(): DataComponentApiInsert[];
416
416
  getArtifactComponents(): ArtifactComponentApiInsert[];
417
- setContext(tenantId: string, projectId: string): void;
417
+ setContext(tenantId: string, projectId: string, baseURL?: string): void;
418
418
  addTool(name: string, tool: any): void;
419
419
  addTransfer(...agents: AgentInterface[]): void;
420
420
  addDelegate(...agents: AgentInterface[]): void;
@@ -429,7 +429,7 @@ interface ExternalAgentInterface {
429
429
  getBaseUrl(): string;
430
430
  getCredentialReferenceId(): string | undefined;
431
431
  getHeaders(): Record<string, string> | undefined;
432
- setContext?(tenantId: string): void;
432
+ setContext?(tenantId: string, baseURL?: string): void;
433
433
  }
434
434
  interface GraphInterface {
435
435
  init(): Promise<void>;
@@ -479,7 +479,7 @@ declare class Agent implements AgentInterface {
479
479
  private projectId;
480
480
  private initialized;
481
481
  constructor(config: AgentConfig);
482
- setContext(tenantId: string, projectId: string): void;
482
+ setContext(tenantId: string, projectId: string, baseURL?: string): void;
483
483
  getId(): string;
484
484
  getName(): string;
485
485
  getInstructions(): string;
package/dist/index.js CHANGED
@@ -36,10 +36,13 @@ var ArtifactComponent = class {
36
36
  "ArtifactComponent constructor initialized"
37
37
  );
38
38
  }
39
- // Set context (tenantId and projectId) from external source (agent, graph, CLI, etc)
40
- setContext(tenantId, projectId) {
39
+ // Set context (tenantId, projectId, and baseURL) from external source (agent, graph, CLI, etc)
40
+ setContext(tenantId, projectId, baseURL) {
41
41
  this.tenantId = tenantId;
42
42
  this.projectId = projectId;
43
+ if (baseURL) {
44
+ this.baseURL = baseURL;
45
+ }
43
46
  }
44
47
  // Compute ID from name using same slug transformation as agents
45
48
  getId() {
@@ -178,10 +181,13 @@ var DataComponent = class {
178
181
  "DataComponent constructor initialized"
179
182
  );
180
183
  }
181
- // Set context (tenantId and projectId) from external source (agent, graph, CLI, etc)
182
- setContext(tenantId, projectId) {
184
+ // Set context (tenantId, projectId, and baseURL) from external source (agent, graph, CLI, etc)
185
+ setContext(tenantId, projectId, baseURL) {
183
186
  this.tenantId = tenantId;
184
187
  this.projectId = projectId;
188
+ if (baseURL) {
189
+ this.baseURL = baseURL;
190
+ }
185
191
  }
186
192
  // Compute ID from name using same slug transformation as agents
187
193
  getId() {
@@ -311,10 +317,13 @@ var Tool = class {
311
317
  "Tool constructor initialized"
312
318
  );
313
319
  }
314
- // Set context (tenantId and projectId) from external source (agent, graph, CLI, etc)
315
- setContext(tenantId, projectId) {
320
+ // Set context (tenantId, projectId, and baseURL) from external source (agent, graph, CLI, etc)
321
+ setContext(tenantId, projectId, baseURL) {
316
322
  this.tenantId = tenantId;
317
323
  this.projectId = projectId;
324
+ if (baseURL) {
325
+ this.baseURL = baseURL;
326
+ }
318
327
  }
319
328
  // Compute ID from name using same slug transformation as agents
320
329
  getId() {
@@ -492,10 +501,13 @@ var Agent = class {
492
501
  "Agent constructor initialized"
493
502
  );
494
503
  }
495
- // Set context (tenantId and projectId) from external source (graph, CLI, etc)
496
- setContext(tenantId, projectId) {
504
+ // Set context (tenantId, projectId, and baseURL) from external source (graph, CLI, etc)
505
+ setContext(tenantId, projectId, baseURL) {
497
506
  this.tenantId = tenantId;
498
507
  this.projectId = projectId;
508
+ if (baseURL) {
509
+ this.baseURL = baseURL;
510
+ }
499
511
  }
500
512
  // Return the configured ID
501
513
  getId() {
@@ -1206,20 +1218,25 @@ var AgentGraph = class {
1206
1218
  if (this.isInternalAgent(agent2)) {
1207
1219
  const internalAgent = agent2;
1208
1220
  if (internalAgent.setContext) {
1209
- internalAgent.setContext(tenantId, projectId);
1221
+ internalAgent.setContext(tenantId, projectId, apiUrl);
1210
1222
  }
1211
1223
  const tools = internalAgent.getTools();
1212
1224
  for (const [_, toolInstance] of Object.entries(tools)) {
1213
1225
  if (toolInstance && typeof toolInstance === "object") {
1214
1226
  if ("setContext" in toolInstance && typeof toolInstance.setContext === "function") {
1215
- toolInstance.setContext(tenantId, projectId);
1227
+ toolInstance.setContext(tenantId, projectId, apiUrl);
1216
1228
  }
1217
1229
  }
1218
1230
  }
1231
+ } else {
1232
+ const externalAgent2 = agent2;
1233
+ if (externalAgent2.setContext) {
1234
+ externalAgent2.setContext(tenantId, apiUrl);
1235
+ }
1219
1236
  }
1220
1237
  }
1221
1238
  if (this.contextConfig?.setContext) {
1222
- this.contextConfig.setContext(tenantId, projectId);
1239
+ this.contextConfig.setContext(tenantId, projectId, apiUrl);
1223
1240
  }
1224
1241
  logger6.info(
1225
1242
  {
@@ -3189,9 +3206,12 @@ var ExternalAgent = class {
3189
3206
  throw error;
3190
3207
  }
3191
3208
  }
3192
- // Set context (tenantId) from external source (graph, CLI, etc)
3193
- setContext(tenantId) {
3209
+ // Set context (tenantId and baseURL) from external source (graph, CLI, etc)
3210
+ setContext(tenantId, baseURL) {
3194
3211
  this.tenantId = tenantId;
3212
+ if (baseURL) {
3213
+ this.baseURL = baseURL;
3214
+ }
3195
3215
  }
3196
3216
  // Compute ID from name using a simple slug transformation
3197
3217
  getId() {
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@inkeep/agents-sdk",
3
- "version": "0.0.0-dev-20251001202049",
3
+ "version": "0.0.0-dev-20251001211316",
4
4
  "description": "Agents SDK for building and managing agents in the Inkeep Agent Framework",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
7
7
  "clean-package": "./clean-package.config.json",
8
8
  "dependencies": {
9
9
  "nanoid": "^5.1.5",
10
- "zod": "^4.1.5",
11
- "@inkeep/agents-core": "^0.0.0-dev-20251001202049"
10
+ "zod": "^4.1.11",
11
+ "@inkeep/agents-core": "^0.0.0-dev-20251001211316"
12
12
  },
13
13
  "devDependencies": {
14
14
  "@types/node": "^20.11.24",