@inkeep/agents-sdk 0.13.0 → 0.14.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.
package/dist/index.cjs CHANGED
@@ -2322,7 +2322,7 @@ var AgentGraph = class {
2322
2322
  }
2323
2323
  };
2324
2324
  var logger7 = agentsCore.getLogger("projectFullClient");
2325
- async function createFullProjectViaAPI(tenantId, apiUrl, projectData) {
2325
+ async function createFullProjectViaAPI(tenantId, apiUrl, projectData, apiKey) {
2326
2326
  logger7.info(
2327
2327
  {
2328
2328
  tenantId,
@@ -2332,22 +2332,27 @@ async function createFullProjectViaAPI(tenantId, apiUrl, projectData) {
2332
2332
  "Creating full project via API"
2333
2333
  );
2334
2334
  const url = `${apiUrl}/tenants/${tenantId}/project-full`;
2335
+ const headers = {};
2336
+ if (apiKey) {
2337
+ headers.Authorization = `Bearer ${apiKey}`;
2338
+ }
2335
2339
  let response;
2336
2340
  try {
2337
- response = await fetch(url, {
2341
+ response = await agentsCore.apiFetch(url, {
2338
2342
  method: "POST",
2339
- headers: {
2340
- "Content-Type": "application/json"
2341
- },
2343
+ headers,
2342
2344
  body: JSON.stringify(projectData)
2343
2345
  });
2344
2346
  } catch (fetchError) {
2345
- logger7.error({
2346
- error: fetchError instanceof Error ? fetchError.message : "Unknown fetch error",
2347
- url,
2348
- tenantId,
2349
- projectId: projectData.id
2350
- }, "Fetch request failed");
2347
+ logger7.error(
2348
+ {
2349
+ error: fetchError instanceof Error ? fetchError.message : "Unknown fetch error",
2350
+ url,
2351
+ tenantId,
2352
+ projectId: projectData.id
2353
+ },
2354
+ "Fetch request failed"
2355
+ );
2351
2356
  throw fetchError;
2352
2357
  }
2353
2358
  if (!response.ok) {
@@ -2381,7 +2386,7 @@ async function createFullProjectViaAPI(tenantId, apiUrl, projectData) {
2381
2386
  );
2382
2387
  return result.data;
2383
2388
  }
2384
- async function updateFullProjectViaAPI(tenantId, apiUrl, projectId, projectData) {
2389
+ async function updateFullProjectViaAPI(tenantId, apiUrl, projectId, projectData, apiKey) {
2385
2390
  logger7.info(
2386
2391
  {
2387
2392
  tenantId,
@@ -2391,22 +2396,27 @@ async function updateFullProjectViaAPI(tenantId, apiUrl, projectId, projectData)
2391
2396
  "Updating full project via API"
2392
2397
  );
2393
2398
  const url = `${apiUrl}/tenants/${tenantId}/project-full/${projectId}`;
2399
+ const headers = {};
2400
+ if (apiKey) {
2401
+ headers.Authorization = `Bearer ${apiKey}`;
2402
+ }
2394
2403
  let response;
2395
2404
  try {
2396
- response = await fetch(url, {
2405
+ response = await agentsCore.apiFetch(url, {
2397
2406
  method: "PUT",
2398
- headers: {
2399
- "Content-Type": "application/json"
2400
- },
2407
+ headers,
2401
2408
  body: JSON.stringify(projectData)
2402
2409
  });
2403
2410
  } catch (fetchError) {
2404
- logger7.error({
2405
- error: fetchError instanceof Error ? fetchError.message : "Unknown fetch error",
2406
- url,
2407
- tenantId,
2408
- projectId
2409
- }, "Fetch request failed");
2411
+ logger7.error(
2412
+ {
2413
+ error: fetchError instanceof Error ? fetchError.message : "Unknown fetch error",
2414
+ url,
2415
+ tenantId,
2416
+ projectId
2417
+ },
2418
+ "Fetch request failed"
2419
+ );
2410
2420
  throw fetchError;
2411
2421
  }
2412
2422
  if (!response.ok) {
@@ -2440,7 +2450,7 @@ async function updateFullProjectViaAPI(tenantId, apiUrl, projectId, projectData)
2440
2450
  );
2441
2451
  return result.data;
2442
2452
  }
2443
- async function getFullProjectViaAPI(tenantId, apiUrl, projectId) {
2453
+ async function getFullProjectViaAPI(tenantId, apiUrl, projectId, apiKey) {
2444
2454
  logger7.info(
2445
2455
  {
2446
2456
  tenantId,
@@ -2450,11 +2460,13 @@ async function getFullProjectViaAPI(tenantId, apiUrl, projectId) {
2450
2460
  "Getting full project via API"
2451
2461
  );
2452
2462
  const url = `${apiUrl}/tenants/${tenantId}/project-full/${projectId}`;
2453
- const response = await fetch(url, {
2463
+ const headers = {};
2464
+ if (apiKey) {
2465
+ headers.Authorization = `Bearer ${apiKey}`;
2466
+ }
2467
+ const response = await agentsCore.apiFetch(url, {
2454
2468
  method: "GET",
2455
- headers: {
2456
- "Content-Type": "application/json"
2457
- }
2469
+ headers
2458
2470
  });
2459
2471
  if (!response.ok) {
2460
2472
  if (response.status === 404) {
@@ -2496,7 +2508,7 @@ async function getFullProjectViaAPI(tenantId, apiUrl, projectId) {
2496
2508
  );
2497
2509
  return result.data;
2498
2510
  }
2499
- async function deleteFullProjectViaAPI(tenantId, apiUrl, projectId) {
2511
+ async function deleteFullProjectViaAPI(tenantId, apiUrl, projectId, apiKey) {
2500
2512
  logger7.info(
2501
2513
  {
2502
2514
  tenantId,
@@ -2506,11 +2518,13 @@ async function deleteFullProjectViaAPI(tenantId, apiUrl, projectId) {
2506
2518
  "Deleting full project via API"
2507
2519
  );
2508
2520
  const url = `${apiUrl}/tenants/${tenantId}/project-full/${projectId}`;
2509
- const response = await fetch(url, {
2521
+ const headers = {};
2522
+ if (apiKey) {
2523
+ headers.Authorization = `Bearer ${apiKey}`;
2524
+ }
2525
+ const response = await agentsCore.apiFetch(url, {
2510
2526
  method: "DELETE",
2511
- headers: {
2512
- "Content-Type": "application/json"
2513
- }
2527
+ headers
2514
2528
  });
2515
2529
  if (!response.ok) {
2516
2530
  const errorText = await response.text();
@@ -2552,6 +2566,7 @@ var Project = class {
2552
2566
  __publicField(this, "projectDescription");
2553
2567
  __publicField(this, "tenantId");
2554
2568
  __publicField(this, "baseURL");
2569
+ __publicField(this, "apiKey");
2555
2570
  __publicField(this, "initialized", false);
2556
2571
  __publicField(this, "models");
2557
2572
  __publicField(this, "stopWhen");
@@ -2585,12 +2600,13 @@ var Project = class {
2585
2600
  * Set or update the configuration (tenantId and apiUrl)
2586
2601
  * This is used by the CLI to inject configuration from inkeep.config.ts
2587
2602
  */
2588
- setConfig(tenantId, apiUrl, models) {
2603
+ setConfig(tenantId, apiUrl, models, apiKey) {
2589
2604
  if (this.initialized) {
2590
2605
  throw new Error("Cannot set config after project has been initialized");
2591
2606
  }
2592
2607
  this.tenantId = tenantId;
2593
2608
  this.baseURL = apiUrl;
2609
+ this.apiKey = apiKey;
2594
2610
  if (models) {
2595
2611
  this.models = models;
2596
2612
  }
@@ -2602,7 +2618,8 @@ var Project = class {
2602
2618
  projectId: this.projectId,
2603
2619
  tenantId: this.tenantId,
2604
2620
  apiUrl: this.baseURL,
2605
- hasModels: !!this.models
2621
+ hasModels: !!this.models,
2622
+ hasApiKey: !!this.apiKey
2606
2623
  },
2607
2624
  "Project configuration updated"
2608
2625
  );
@@ -2651,7 +2668,8 @@ var Project = class {
2651
2668
  this.tenantId,
2652
2669
  this.baseURL,
2653
2670
  this.projectId,
2654
- projectDefinition
2671
+ projectDefinition,
2672
+ this.apiKey
2655
2673
  );
2656
2674
  this.initialized = true;
2657
2675
  logger8.info(
package/dist/index.d.cts CHANGED
@@ -777,6 +777,7 @@ declare class Project implements ProjectInterface {
777
777
  private projectDescription?;
778
778
  private tenantId;
779
779
  private baseURL;
780
+ private apiKey?;
780
781
  private initialized;
781
782
  private models?;
782
783
  private stopWhen?;
@@ -788,7 +789,7 @@ declare class Project implements ProjectInterface {
788
789
  * Set or update the configuration (tenantId and apiUrl)
789
790
  * This is used by the CLI to inject configuration from inkeep.config.ts
790
791
  */
791
- setConfig(tenantId: string, apiUrl: string, models?: ProjectConfig['models']): void;
792
+ setConfig(tenantId: string, apiUrl: string, models?: ProjectConfig['models'], apiKey?: string): void;
792
793
  /**
793
794
  * Set credential references for the project
794
795
  * This is used by the CLI to inject environment-specific credentials
@@ -1143,19 +1144,19 @@ declare function registerEnvironmentSettings<T extends EnvironmentSettingsConfig
1143
1144
  /**
1144
1145
  * Create a full project via HTTP API
1145
1146
  */
1146
- declare function createFullProjectViaAPI(tenantId: string, apiUrl: string, projectData: FullProjectDefinition): Promise<FullProjectDefinition>;
1147
+ declare function createFullProjectViaAPI(tenantId: string, apiUrl: string, projectData: FullProjectDefinition, apiKey?: string): Promise<FullProjectDefinition>;
1147
1148
  /**
1148
1149
  * Update a full project via HTTP API (upsert behavior)
1149
1150
  */
1150
- declare function updateFullProjectViaAPI(tenantId: string, apiUrl: string, projectId: string, projectData: FullProjectDefinition): Promise<FullProjectDefinition>;
1151
+ declare function updateFullProjectViaAPI(tenantId: string, apiUrl: string, projectId: string, projectData: FullProjectDefinition, apiKey?: string): Promise<FullProjectDefinition>;
1151
1152
  /**
1152
1153
  * Get a full project via HTTP API
1153
1154
  */
1154
- declare function getFullProjectViaAPI(tenantId: string, apiUrl: string, projectId: string): Promise<FullProjectDefinition | null>;
1155
+ declare function getFullProjectViaAPI(tenantId: string, apiUrl: string, projectId: string, apiKey?: string): Promise<FullProjectDefinition | null>;
1155
1156
  /**
1156
1157
  * Delete a full project via HTTP API
1157
1158
  */
1158
- declare function deleteFullProjectViaAPI(tenantId: string, apiUrl: string, projectId: string): Promise<void>;
1159
+ declare function deleteFullProjectViaAPI(tenantId: string, apiUrl: string, projectId: string, apiKey?: string): Promise<void>;
1159
1160
 
1160
1161
  declare class Runner {
1161
1162
  /**
package/dist/index.d.ts CHANGED
@@ -777,6 +777,7 @@ declare class Project implements ProjectInterface {
777
777
  private projectDescription?;
778
778
  private tenantId;
779
779
  private baseURL;
780
+ private apiKey?;
780
781
  private initialized;
781
782
  private models?;
782
783
  private stopWhen?;
@@ -788,7 +789,7 @@ declare class Project implements ProjectInterface {
788
789
  * Set or update the configuration (tenantId and apiUrl)
789
790
  * This is used by the CLI to inject configuration from inkeep.config.ts
790
791
  */
791
- setConfig(tenantId: string, apiUrl: string, models?: ProjectConfig['models']): void;
792
+ setConfig(tenantId: string, apiUrl: string, models?: ProjectConfig['models'], apiKey?: string): void;
792
793
  /**
793
794
  * Set credential references for the project
794
795
  * This is used by the CLI to inject environment-specific credentials
@@ -1143,19 +1144,19 @@ declare function registerEnvironmentSettings<T extends EnvironmentSettingsConfig
1143
1144
  /**
1144
1145
  * Create a full project via HTTP API
1145
1146
  */
1146
- declare function createFullProjectViaAPI(tenantId: string, apiUrl: string, projectData: FullProjectDefinition): Promise<FullProjectDefinition>;
1147
+ declare function createFullProjectViaAPI(tenantId: string, apiUrl: string, projectData: FullProjectDefinition, apiKey?: string): Promise<FullProjectDefinition>;
1147
1148
  /**
1148
1149
  * Update a full project via HTTP API (upsert behavior)
1149
1150
  */
1150
- declare function updateFullProjectViaAPI(tenantId: string, apiUrl: string, projectId: string, projectData: FullProjectDefinition): Promise<FullProjectDefinition>;
1151
+ declare function updateFullProjectViaAPI(tenantId: string, apiUrl: string, projectId: string, projectData: FullProjectDefinition, apiKey?: string): Promise<FullProjectDefinition>;
1151
1152
  /**
1152
1153
  * Get a full project via HTTP API
1153
1154
  */
1154
- declare function getFullProjectViaAPI(tenantId: string, apiUrl: string, projectId: string): Promise<FullProjectDefinition | null>;
1155
+ declare function getFullProjectViaAPI(tenantId: string, apiUrl: string, projectId: string, apiKey?: string): Promise<FullProjectDefinition | null>;
1155
1156
  /**
1156
1157
  * Delete a full project via HTTP API
1157
1158
  */
1158
- declare function deleteFullProjectViaAPI(tenantId: string, apiUrl: string, projectId: string): Promise<void>;
1159
+ declare function deleteFullProjectViaAPI(tenantId: string, apiUrl: string, projectId: string, apiKey?: string): Promise<void>;
1159
1160
 
1160
1161
  declare class Runner {
1161
1162
  /**
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { getLogger, CredentialReferenceApiInsertSchema, MCPToolConfigSchema, createDatabaseClient, getProject } from '@inkeep/agents-core';
1
+ import { getLogger, apiFetch, CredentialReferenceApiInsertSchema, MCPToolConfigSchema, createDatabaseClient, getProject } from '@inkeep/agents-core';
2
2
  import { z } from 'zod';
3
3
 
4
4
  var __defProp = Object.defineProperty;
@@ -2320,7 +2320,7 @@ var AgentGraph = class {
2320
2320
  }
2321
2321
  };
2322
2322
  var logger7 = getLogger("projectFullClient");
2323
- async function createFullProjectViaAPI(tenantId, apiUrl, projectData) {
2323
+ async function createFullProjectViaAPI(tenantId, apiUrl, projectData, apiKey) {
2324
2324
  logger7.info(
2325
2325
  {
2326
2326
  tenantId,
@@ -2330,22 +2330,27 @@ async function createFullProjectViaAPI(tenantId, apiUrl, projectData) {
2330
2330
  "Creating full project via API"
2331
2331
  );
2332
2332
  const url = `${apiUrl}/tenants/${tenantId}/project-full`;
2333
+ const headers = {};
2334
+ if (apiKey) {
2335
+ headers.Authorization = `Bearer ${apiKey}`;
2336
+ }
2333
2337
  let response;
2334
2338
  try {
2335
- response = await fetch(url, {
2339
+ response = await apiFetch(url, {
2336
2340
  method: "POST",
2337
- headers: {
2338
- "Content-Type": "application/json"
2339
- },
2341
+ headers,
2340
2342
  body: JSON.stringify(projectData)
2341
2343
  });
2342
2344
  } catch (fetchError) {
2343
- logger7.error({
2344
- error: fetchError instanceof Error ? fetchError.message : "Unknown fetch error",
2345
- url,
2346
- tenantId,
2347
- projectId: projectData.id
2348
- }, "Fetch request failed");
2345
+ logger7.error(
2346
+ {
2347
+ error: fetchError instanceof Error ? fetchError.message : "Unknown fetch error",
2348
+ url,
2349
+ tenantId,
2350
+ projectId: projectData.id
2351
+ },
2352
+ "Fetch request failed"
2353
+ );
2349
2354
  throw fetchError;
2350
2355
  }
2351
2356
  if (!response.ok) {
@@ -2379,7 +2384,7 @@ async function createFullProjectViaAPI(tenantId, apiUrl, projectData) {
2379
2384
  );
2380
2385
  return result.data;
2381
2386
  }
2382
- async function updateFullProjectViaAPI(tenantId, apiUrl, projectId, projectData) {
2387
+ async function updateFullProjectViaAPI(tenantId, apiUrl, projectId, projectData, apiKey) {
2383
2388
  logger7.info(
2384
2389
  {
2385
2390
  tenantId,
@@ -2389,22 +2394,27 @@ async function updateFullProjectViaAPI(tenantId, apiUrl, projectId, projectData)
2389
2394
  "Updating full project via API"
2390
2395
  );
2391
2396
  const url = `${apiUrl}/tenants/${tenantId}/project-full/${projectId}`;
2397
+ const headers = {};
2398
+ if (apiKey) {
2399
+ headers.Authorization = `Bearer ${apiKey}`;
2400
+ }
2392
2401
  let response;
2393
2402
  try {
2394
- response = await fetch(url, {
2403
+ response = await apiFetch(url, {
2395
2404
  method: "PUT",
2396
- headers: {
2397
- "Content-Type": "application/json"
2398
- },
2405
+ headers,
2399
2406
  body: JSON.stringify(projectData)
2400
2407
  });
2401
2408
  } catch (fetchError) {
2402
- logger7.error({
2403
- error: fetchError instanceof Error ? fetchError.message : "Unknown fetch error",
2404
- url,
2405
- tenantId,
2406
- projectId
2407
- }, "Fetch request failed");
2409
+ logger7.error(
2410
+ {
2411
+ error: fetchError instanceof Error ? fetchError.message : "Unknown fetch error",
2412
+ url,
2413
+ tenantId,
2414
+ projectId
2415
+ },
2416
+ "Fetch request failed"
2417
+ );
2408
2418
  throw fetchError;
2409
2419
  }
2410
2420
  if (!response.ok) {
@@ -2438,7 +2448,7 @@ async function updateFullProjectViaAPI(tenantId, apiUrl, projectId, projectData)
2438
2448
  );
2439
2449
  return result.data;
2440
2450
  }
2441
- async function getFullProjectViaAPI(tenantId, apiUrl, projectId) {
2451
+ async function getFullProjectViaAPI(tenantId, apiUrl, projectId, apiKey) {
2442
2452
  logger7.info(
2443
2453
  {
2444
2454
  tenantId,
@@ -2448,11 +2458,13 @@ async function getFullProjectViaAPI(tenantId, apiUrl, projectId) {
2448
2458
  "Getting full project via API"
2449
2459
  );
2450
2460
  const url = `${apiUrl}/tenants/${tenantId}/project-full/${projectId}`;
2451
- const response = await fetch(url, {
2461
+ const headers = {};
2462
+ if (apiKey) {
2463
+ headers.Authorization = `Bearer ${apiKey}`;
2464
+ }
2465
+ const response = await apiFetch(url, {
2452
2466
  method: "GET",
2453
- headers: {
2454
- "Content-Type": "application/json"
2455
- }
2467
+ headers
2456
2468
  });
2457
2469
  if (!response.ok) {
2458
2470
  if (response.status === 404) {
@@ -2494,7 +2506,7 @@ async function getFullProjectViaAPI(tenantId, apiUrl, projectId) {
2494
2506
  );
2495
2507
  return result.data;
2496
2508
  }
2497
- async function deleteFullProjectViaAPI(tenantId, apiUrl, projectId) {
2509
+ async function deleteFullProjectViaAPI(tenantId, apiUrl, projectId, apiKey) {
2498
2510
  logger7.info(
2499
2511
  {
2500
2512
  tenantId,
@@ -2504,11 +2516,13 @@ async function deleteFullProjectViaAPI(tenantId, apiUrl, projectId) {
2504
2516
  "Deleting full project via API"
2505
2517
  );
2506
2518
  const url = `${apiUrl}/tenants/${tenantId}/project-full/${projectId}`;
2507
- const response = await fetch(url, {
2519
+ const headers = {};
2520
+ if (apiKey) {
2521
+ headers.Authorization = `Bearer ${apiKey}`;
2522
+ }
2523
+ const response = await apiFetch(url, {
2508
2524
  method: "DELETE",
2509
- headers: {
2510
- "Content-Type": "application/json"
2511
- }
2525
+ headers
2512
2526
  });
2513
2527
  if (!response.ok) {
2514
2528
  const errorText = await response.text();
@@ -2550,6 +2564,7 @@ var Project = class {
2550
2564
  __publicField(this, "projectDescription");
2551
2565
  __publicField(this, "tenantId");
2552
2566
  __publicField(this, "baseURL");
2567
+ __publicField(this, "apiKey");
2553
2568
  __publicField(this, "initialized", false);
2554
2569
  __publicField(this, "models");
2555
2570
  __publicField(this, "stopWhen");
@@ -2583,12 +2598,13 @@ var Project = class {
2583
2598
  * Set or update the configuration (tenantId and apiUrl)
2584
2599
  * This is used by the CLI to inject configuration from inkeep.config.ts
2585
2600
  */
2586
- setConfig(tenantId, apiUrl, models) {
2601
+ setConfig(tenantId, apiUrl, models, apiKey) {
2587
2602
  if (this.initialized) {
2588
2603
  throw new Error("Cannot set config after project has been initialized");
2589
2604
  }
2590
2605
  this.tenantId = tenantId;
2591
2606
  this.baseURL = apiUrl;
2607
+ this.apiKey = apiKey;
2592
2608
  if (models) {
2593
2609
  this.models = models;
2594
2610
  }
@@ -2600,7 +2616,8 @@ var Project = class {
2600
2616
  projectId: this.projectId,
2601
2617
  tenantId: this.tenantId,
2602
2618
  apiUrl: this.baseURL,
2603
- hasModels: !!this.models
2619
+ hasModels: !!this.models,
2620
+ hasApiKey: !!this.apiKey
2604
2621
  },
2605
2622
  "Project configuration updated"
2606
2623
  );
@@ -2649,7 +2666,8 @@ var Project = class {
2649
2666
  this.tenantId,
2650
2667
  this.baseURL,
2651
2668
  this.projectId,
2652
- projectDefinition
2669
+ projectDefinition,
2670
+ this.apiKey
2653
2671
  );
2654
2672
  this.initialized = true;
2655
2673
  logger8.info(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkeep/agents-sdk",
3
- "version": "0.13.0",
3
+ "version": "0.14.0",
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",
@@ -8,7 +8,7 @@
8
8
  "dependencies": {
9
9
  "nanoid": "^5.1.5",
10
10
  "zod": "^4.1.11",
11
- "@inkeep/agents-core": "^0.13.0"
11
+ "@inkeep/agents-core": "^0.14.0"
12
12
  },
13
13
  "devDependencies": {
14
14
  "@types/node": "^20.11.24",