@inkeep/agents-run-api 0.12.1 → 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
@@ -476,7 +476,7 @@ var apiKeyAuth = () => factory.createMiddleware(async (c, next) => {
476
476
  let executionContext;
477
477
  if (authHeader?.startsWith("Bearer ")) {
478
478
  try {
479
- executionContext = await extractContextFromApiKey(authHeader.substring(7));
479
+ executionContext = await extractContextFromApiKey(authHeader.substring(7), baseUrl);
480
480
  executionContext.agentId = agentId;
481
481
  logger.info({}, "Development/test environment - API key authenticated successfully");
482
482
  } catch {
@@ -540,7 +540,7 @@ var apiKeyAuth = () => factory.createMiddleware(async (c, next) => {
540
540
  await next();
541
541
  return;
542
542
  } else if (apiKey) {
543
- const executionContext = await extractContextFromApiKey(apiKey);
543
+ const executionContext = await extractContextFromApiKey(apiKey, baseUrl);
544
544
  executionContext.agentId = agentId;
545
545
  c.set("executionContext", executionContext);
546
546
  logger.info({}, "API key authenticated successfully");
@@ -558,7 +558,7 @@ var apiKeyAuth = () => factory.createMiddleware(async (c, next) => {
558
558
  });
559
559
  }
560
560
  try {
561
- const executionContext = await extractContextFromApiKey(apiKey);
561
+ const executionContext = await extractContextFromApiKey(apiKey, baseUrl);
562
562
  executionContext.agentId = agentId;
563
563
  c.set("executionContext", executionContext);
564
564
  logger.debug(
@@ -581,7 +581,7 @@ var apiKeyAuth = () => factory.createMiddleware(async (c, next) => {
581
581
  });
582
582
  }
583
583
  });
584
- var extractContextFromApiKey = async (apiKey) => {
584
+ var extractContextFromApiKey = async (apiKey, baseUrl) => {
585
585
  const apiKeyRecord = await agentsCore.validateAndGetApiKey(apiKey, dbClient_default);
586
586
  if (!apiKeyRecord) {
587
587
  throw new httpException.HTTPException(401, {
@@ -593,7 +593,8 @@ var extractContextFromApiKey = async (apiKey) => {
593
593
  tenantId: apiKeyRecord.tenantId,
594
594
  projectId: apiKeyRecord.projectId,
595
595
  graphId: apiKeyRecord.graphId,
596
- apiKeyId: apiKeyRecord.id
596
+ apiKeyId: apiKeyRecord.id,
597
+ baseUrl
597
598
  });
598
599
  };
599
600
 
@@ -4754,7 +4755,7 @@ var A2AClient = class {
4754
4755
  this.serviceEndpointUrl = agentCard.url;
4755
4756
  return agentCard;
4756
4757
  } catch (error) {
4757
- console.error("Error fetching or parsing Agent Card:");
4758
+ console.error("Error fetching or parsing Agent Card:", error);
4758
4759
  throw error;
4759
4760
  }
4760
4761
  }
package/dist/index.js CHANGED
@@ -60,7 +60,7 @@ var apiKeyAuth = () => createMiddleware(async (c, next) => {
60
60
  let executionContext;
61
61
  if (authHeader?.startsWith("Bearer ")) {
62
62
  try {
63
- executionContext = await extractContextFromApiKey(authHeader.substring(7));
63
+ executionContext = await extractContextFromApiKey(authHeader.substring(7), baseUrl);
64
64
  executionContext.agentId = agentId;
65
65
  logger.info({}, "Development/test environment - API key authenticated successfully");
66
66
  } catch {
@@ -124,7 +124,7 @@ var apiKeyAuth = () => createMiddleware(async (c, next) => {
124
124
  await next();
125
125
  return;
126
126
  } else if (apiKey) {
127
- const executionContext = await extractContextFromApiKey(apiKey);
127
+ const executionContext = await extractContextFromApiKey(apiKey, baseUrl);
128
128
  executionContext.agentId = agentId;
129
129
  c.set("executionContext", executionContext);
130
130
  logger.info({}, "API key authenticated successfully");
@@ -142,7 +142,7 @@ var apiKeyAuth = () => createMiddleware(async (c, next) => {
142
142
  });
143
143
  }
144
144
  try {
145
- const executionContext = await extractContextFromApiKey(apiKey);
145
+ const executionContext = await extractContextFromApiKey(apiKey, baseUrl);
146
146
  executionContext.agentId = agentId;
147
147
  c.set("executionContext", executionContext);
148
148
  logger.debug(
@@ -165,7 +165,7 @@ var apiKeyAuth = () => createMiddleware(async (c, next) => {
165
165
  });
166
166
  }
167
167
  });
168
- var extractContextFromApiKey = async (apiKey) => {
168
+ var extractContextFromApiKey = async (apiKey, baseUrl) => {
169
169
  const apiKeyRecord = await validateAndGetApiKey(apiKey, dbClient_default);
170
170
  if (!apiKeyRecord) {
171
171
  throw new HTTPException(401, {
@@ -177,7 +177,8 @@ var extractContextFromApiKey = async (apiKey) => {
177
177
  tenantId: apiKeyRecord.tenantId,
178
178
  projectId: apiKeyRecord.projectId,
179
179
  graphId: apiKeyRecord.graphId,
180
- apiKeyId: apiKeyRecord.id
180
+ apiKeyId: apiKeyRecord.id,
181
+ baseUrl
181
182
  });
182
183
  };
183
184
  function setupOpenAPIRoutes(app6) {
@@ -4290,7 +4291,7 @@ var A2AClient = class {
4290
4291
  this.serviceEndpointUrl = agentCard.url;
4291
4292
  return agentCard;
4292
4293
  } catch (error) {
4293
- console.error("Error fetching or parsing Agent Card:");
4294
+ console.error("Error fetching or parsing Agent Card:", error);
4294
4295
  throw error;
4295
4296
  }
4296
4297
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkeep/agents-run-api",
3
- "version": "0.12.1",
3
+ "version": "0.14.0",
4
4
  "description": "Agents Run API for Inkeep Agent Framework - handles chat, agent execution, and streaming",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -51,7 +51,7 @@
51
51
  "traverse": "^0.6.11",
52
52
  "ts-pattern": "^5.7.1",
53
53
  "zod": "^4.1.11",
54
- "@inkeep/agents-core": "^0.12.1"
54
+ "@inkeep/agents-core": "^0.14.0"
55
55
  },
56
56
  "optionalDependencies": {
57
57
  "keytar": "^7.9.0"