@inkeep/agents-run-api 0.36.1 → 0.37.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/{chunk-H2IQDFCM.js → chunk-2LBNQ773.js} +1 -1
- package/dist/{chunk-CWFQPSTI.js → chunk-D3AB2AZW.js} +1 -1
- package/dist/{chunk-UZXC6MEO.js → chunk-HUZGFAUJ.js} +1 -0
- package/dist/{chunk-7C3GUAQD.js → chunk-OAAX46OE.js} +2 -2
- package/dist/{conversations-ZCZG5434.js → conversations-YFQ52RQB.js} +1 -1
- package/dist/dbClient-XK4IR7QF.js +1 -0
- package/dist/index.cjs +65 -6
- package/dist/index.js +70 -12
- package/dist/instrumentation.cjs +1 -0
- package/dist/instrumentation.js +1 -1
- package/package.json +5 -4
- package/dist/dbClient-XO7KFTE7.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { env } from './chunk-
|
|
1
|
+
import { env } from './chunk-HUZGFAUJ.js';
|
|
2
2
|
import { getLogger } from './chunk-A2S7GSHL.js';
|
|
3
3
|
import { getNodeAutoInstrumentations } from '@opentelemetry/auto-instrumentations-node';
|
|
4
4
|
import { BaggageSpanProcessor, ALLOW_ALL_BAGGAGE_KEYS } from '@opentelemetry/baggage-span-processor';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { env } from './chunk-
|
|
1
|
+
import { env } from './chunk-HUZGFAUJ.js';
|
|
2
2
|
import { F, u, R, x, T, h, U, L, or, C, Vr, ce, ur, P } from './chunk-SBJLXGYG.js';
|
|
3
3
|
import { createDatabaseClient } from '@inkeep/agents-core';
|
|
4
4
|
import * as schema from '@inkeep/agents-core/db/schema';
|
|
@@ -16,6 +16,7 @@ var envSchema = z.object({
|
|
|
16
16
|
GOOGLE_GENERATIVE_AI_API_KEY: z.string().optional(),
|
|
17
17
|
INKEEP_AGENTS_RUN_API_BYPASS_SECRET: z.string().optional(),
|
|
18
18
|
INKEEP_AGENTS_JWT_SIGNING_SECRET: z.string().optional(),
|
|
19
|
+
INKEEP_AGENTS_TEMP_JWT_PUBLIC_KEY: z.string().optional(),
|
|
19
20
|
OTEL_BSP_SCHEDULE_DELAY: z.coerce.number().optional().default(500),
|
|
20
21
|
OTEL_BSP_MAX_EXPORT_BATCH_SIZE: z.coerce.number().optional().default(64)
|
|
21
22
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { dbClient_default } from './chunk-
|
|
1
|
+
import { dbClient_default } from './chunk-D3AB2AZW.js';
|
|
2
2
|
import { CONVERSATION_HISTORY_DEFAULT_LIMIT } from './chunk-IVALDC72.js';
|
|
3
3
|
import { CONVERSATION_HISTORY_MAX_OUTPUT_TOKENS_DEFAULT, createMessage, generateId, getConversationHistory } from '@inkeep/agents-core';
|
|
4
4
|
|
|
@@ -208,7 +208,7 @@ async function getConversationScopedArtifacts(params) {
|
|
|
208
208
|
return [];
|
|
209
209
|
}
|
|
210
210
|
const { getLedgerArtifacts } = await import('@inkeep/agents-core');
|
|
211
|
-
const dbClient = (await import('./dbClient-
|
|
211
|
+
const dbClient = (await import('./dbClient-XK4IR7QF.js')).default;
|
|
212
212
|
const visibleTaskIds = visibleMessages.map((msg) => msg.taskId).filter((taskId) => Boolean(taskId));
|
|
213
213
|
const referenceArtifacts = [];
|
|
214
214
|
for (const taskId of visibleTaskIds) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { createDefaultConversationHistoryConfig, getConversationScopedArtifacts, getFormattedConversationHistory, getFullConversationContext, getScopedHistory, getUserFacingHistory, saveA2AMessageResponse } from './chunk-
|
|
1
|
+
export { createDefaultConversationHistoryConfig, getConversationScopedArtifacts, getFormattedConversationHistory, getFullConversationContext, getScopedHistory, getUserFacingHistory, saveA2AMessageResponse } from './chunk-OAAX46OE.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { dbClient_default as default } from './chunk-D3AB2AZW.js';
|
package/dist/index.cjs
CHANGED
|
@@ -103,6 +103,7 @@ var init_env = __esm({
|
|
|
103
103
|
GOOGLE_GENERATIVE_AI_API_KEY: z8.z.string().optional(),
|
|
104
104
|
INKEEP_AGENTS_RUN_API_BYPASS_SECRET: z8.z.string().optional(),
|
|
105
105
|
INKEEP_AGENTS_JWT_SIGNING_SECRET: z8.z.string().optional(),
|
|
106
|
+
INKEEP_AGENTS_TEMP_JWT_PUBLIC_KEY: z8.z.string().optional(),
|
|
106
107
|
OTEL_BSP_SCHEDULE_DELAY: z8.z.coerce.number().optional().default(500),
|
|
107
108
|
OTEL_BSP_MAX_EXPORT_BATCH_SIZE: z8.z.coerce.number().optional().default(64)
|
|
108
109
|
});
|
|
@@ -7643,6 +7644,31 @@ function createExecutionContext(params) {
|
|
|
7643
7644
|
|
|
7644
7645
|
// src/middleware/api-key-auth.ts
|
|
7645
7646
|
var logger2 = agentsCore.getLogger("env-key-auth");
|
|
7647
|
+
async function tryAuthenticateWithTempJwt(apiKey, baseUrl, subAgentId) {
|
|
7648
|
+
if (!apiKey.startsWith("eyJ") || !env.INKEEP_AGENTS_TEMP_JWT_PUBLIC_KEY) {
|
|
7649
|
+
return null;
|
|
7650
|
+
}
|
|
7651
|
+
try {
|
|
7652
|
+
const publicKeyPem = Buffer.from(env.INKEEP_AGENTS_TEMP_JWT_PUBLIC_KEY, "base64").toString(
|
|
7653
|
+
"utf-8"
|
|
7654
|
+
);
|
|
7655
|
+
const payload = await agentsCore.verifyTempToken(publicKeyPem, apiKey);
|
|
7656
|
+
logger2.info({}, "JWT temp token authenticated successfully");
|
|
7657
|
+
return createExecutionContext({
|
|
7658
|
+
apiKey,
|
|
7659
|
+
tenantId: payload.tenantId,
|
|
7660
|
+
projectId: payload.projectId,
|
|
7661
|
+
agentId: payload.agentId,
|
|
7662
|
+
apiKeyId: "temp-jwt",
|
|
7663
|
+
baseUrl,
|
|
7664
|
+
subAgentId,
|
|
7665
|
+
metadata: { initiatedBy: payload.initiatedBy }
|
|
7666
|
+
});
|
|
7667
|
+
} catch (error) {
|
|
7668
|
+
logger2.debug({ error }, "JWT verification failed");
|
|
7669
|
+
return null;
|
|
7670
|
+
}
|
|
7671
|
+
}
|
|
7646
7672
|
var apiKeyAuth = () => factory.createMiddleware(async (c2, next) => {
|
|
7647
7673
|
if (c2.req.method === "OPTIONS") {
|
|
7648
7674
|
await next();
|
|
@@ -7663,6 +7689,12 @@ var apiKeyAuth = () => factory.createMiddleware(async (c2, next) => {
|
|
|
7663
7689
|
let executionContext;
|
|
7664
7690
|
if (authHeader?.startsWith("Bearer ")) {
|
|
7665
7691
|
const apiKey2 = authHeader.substring(7);
|
|
7692
|
+
const jwtContext2 = await tryAuthenticateWithTempJwt(apiKey2, baseUrl, subAgentId);
|
|
7693
|
+
if (jwtContext2) {
|
|
7694
|
+
c2.set("executionContext", jwtContext2);
|
|
7695
|
+
await next();
|
|
7696
|
+
return;
|
|
7697
|
+
}
|
|
7666
7698
|
try {
|
|
7667
7699
|
executionContext = await extractContextFromApiKey(apiKey2, baseUrl);
|
|
7668
7700
|
if (subAgentId) {
|
|
@@ -7715,6 +7747,12 @@ var apiKeyAuth = () => factory.createMiddleware(async (c2, next) => {
|
|
|
7715
7747
|
});
|
|
7716
7748
|
}
|
|
7717
7749
|
const apiKey = authHeader.substring(7);
|
|
7750
|
+
const jwtContext = await tryAuthenticateWithTempJwt(apiKey, baseUrl, subAgentId);
|
|
7751
|
+
if (jwtContext) {
|
|
7752
|
+
c2.set("executionContext", jwtContext);
|
|
7753
|
+
await next();
|
|
7754
|
+
return;
|
|
7755
|
+
}
|
|
7718
7756
|
if (env.INKEEP_AGENTS_RUN_API_BYPASS_SECRET) {
|
|
7719
7757
|
if (apiKey === env.INKEEP_AGENTS_RUN_API_BYPASS_SECRET) {
|
|
7720
7758
|
if (!tenantId || !projectId || !agentId) {
|
|
@@ -7735,7 +7773,8 @@ var apiKeyAuth = () => factory.createMiddleware(async (c2, next) => {
|
|
|
7735
7773
|
logger2.info({}, "Bypass secret authenticated successfully");
|
|
7736
7774
|
await next();
|
|
7737
7775
|
return;
|
|
7738
|
-
}
|
|
7776
|
+
}
|
|
7777
|
+
if (apiKey) {
|
|
7739
7778
|
try {
|
|
7740
7779
|
const executionContext = await extractContextFromApiKey(apiKey, baseUrl);
|
|
7741
7780
|
if (subAgentId) {
|
|
@@ -7753,11 +7792,10 @@ var apiKeyAuth = () => factory.createMiddleware(async (c2, next) => {
|
|
|
7753
7792
|
}
|
|
7754
7793
|
await next();
|
|
7755
7794
|
return;
|
|
7756
|
-
} else {
|
|
7757
|
-
throw new httpException.HTTPException(401, {
|
|
7758
|
-
message: "Invalid Token"
|
|
7759
|
-
});
|
|
7760
7795
|
}
|
|
7796
|
+
throw new httpException.HTTPException(401, {
|
|
7797
|
+
message: "Invalid Token"
|
|
7798
|
+
});
|
|
7761
7799
|
}
|
|
7762
7800
|
if (!apiKey || apiKey.length < 16) {
|
|
7763
7801
|
throw new httpException.HTTPException(401, {
|
|
@@ -7906,6 +7944,19 @@ function setupOpenAPIRoutes(app6) {
|
|
|
7906
7944
|
}
|
|
7907
7945
|
]
|
|
7908
7946
|
});
|
|
7947
|
+
document2.components = {
|
|
7948
|
+
...document2.components,
|
|
7949
|
+
securitySchemes: {
|
|
7950
|
+
...document2.components?.securitySchemes || {},
|
|
7951
|
+
bearerAuth: {
|
|
7952
|
+
type: "http",
|
|
7953
|
+
scheme: "bearer",
|
|
7954
|
+
bearerFormat: "API Key",
|
|
7955
|
+
description: 'API key authentication. All endpoints require a valid API key in the Authorization header as "Bearer <api-key>". API keys can be created in the management UI.'
|
|
7956
|
+
}
|
|
7957
|
+
}
|
|
7958
|
+
};
|
|
7959
|
+
document2.security = [{ bearerAuth: [] }];
|
|
7909
7960
|
return c2.json(document2);
|
|
7910
7961
|
} catch (error) {
|
|
7911
7962
|
console.error("OpenAPI document generation failed:", error);
|
|
@@ -19137,7 +19188,15 @@ app3.openapi(chatDataStreamRoute, async (c2) => {
|
|
|
19137
19188
|
);
|
|
19138
19189
|
});
|
|
19139
19190
|
} catch (error) {
|
|
19140
|
-
logger26.error(
|
|
19191
|
+
logger26.error(
|
|
19192
|
+
{
|
|
19193
|
+
error,
|
|
19194
|
+
errorMessage: error instanceof Error ? error.message : String(error),
|
|
19195
|
+
errorStack: error instanceof Error ? error.stack : void 0,
|
|
19196
|
+
errorType: error?.constructor?.name
|
|
19197
|
+
},
|
|
19198
|
+
"chatDataStream error - DETAILED"
|
|
19199
|
+
);
|
|
19141
19200
|
throw agentsCore.createApiError({
|
|
19142
19201
|
code: "internal_server_error",
|
|
19143
19202
|
message: "Failed to process chat completion"
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { flushBatchProcessor } from './chunk-
|
|
2
|
-
import { getFormattedConversationHistory, createDefaultConversationHistoryConfig, saveA2AMessageResponse } from './chunk-
|
|
3
|
-
import { dbClient_default } from './chunk-
|
|
4
|
-
import { env } from './chunk-
|
|
1
|
+
import { flushBatchProcessor } from './chunk-2LBNQ773.js';
|
|
2
|
+
import { getFormattedConversationHistory, createDefaultConversationHistoryConfig, saveA2AMessageResponse } from './chunk-OAAX46OE.js';
|
|
3
|
+
import { dbClient_default } from './chunk-D3AB2AZW.js';
|
|
4
|
+
import { env } from './chunk-HUZGFAUJ.js';
|
|
5
5
|
import { getLogger } from './chunk-A2S7GSHL.js';
|
|
6
6
|
import { SESSION_CLEANUP_INTERVAL_MS, AGENT_EXECUTION_MAX_CONSECUTIVE_ERRORS, SESSION_TOOL_RESULT_CACHE_TIMEOUT_MS, STREAM_MAX_LIFETIME_MS, STREAM_BUFFER_MAX_SIZE_BYTES, STREAM_TEXT_GAP_THRESHOLD_MS, ARTIFACT_GENERATION_MAX_RETRIES, ARTIFACT_SESSION_MAX_PENDING, STATUS_UPDATE_DEFAULT_INTERVAL_SECONDS, STATUS_UPDATE_DEFAULT_NUM_EVENTS, ARTIFACT_SESSION_MAX_PREVIOUS_SUMMARIES, AGENT_EXECUTION_MAX_GENERATION_STEPS, FUNCTION_TOOL_SANDBOX_VCPUS_DEFAULT, FUNCTION_TOOL_EXECUTION_TIMEOUT_MS_DEFAULT, LLM_GENERATION_MAX_ALLOWED_TIMEOUT_MS, ARTIFACT_GENERATION_BACKOFF_INITIAL_MS, ARTIFACT_GENERATION_BACKOFF_MAX_MS, LLM_GENERATION_FIRST_CALL_TIMEOUT_MS_STREAMING, LLM_GENERATION_FIRST_CALL_TIMEOUT_MS_NON_STREAMING, LLM_GENERATION_SUBSEQUENT_CALL_TIMEOUT_MS, DELEGATION_TOOL_BACKOFF_MAX_ELAPSED_TIME_MS, DELEGATION_TOOL_BACKOFF_EXPONENT, DELEGATION_TOOL_BACKOFF_MAX_INTERVAL_MS, DELEGATION_TOOL_BACKOFF_INITIAL_INTERVAL_MS, STREAM_PARSER_MAX_SNAPSHOT_SIZE, STREAM_PARSER_MAX_STREAMED_SIZE, STREAM_PARSER_MAX_COLLECTED_PARTS } from './chunk-IVALDC72.js';
|
|
7
|
-
import { getTracer, HeadersScopeSchema, getRequestExecutionContext, createApiError, getAgentWithDefaultSubAgent, contextValidationMiddleware, getConversationId, getFullAgent, createOrGetConversation, getActiveAgentForConversation, setActiveAgentForConversation, getSubAgentById, handleContextResolution, createMessage, generateId, commonGetErrorResponses, loggerFactory, createDefaultCredentialStores, CredentialStoreRegistry, createTask, getTask, updateTask, setSpanWithError, AGENT_EXECUTION_TRANSFER_COUNT_DEFAULT, updateConversation, handleApiError, TaskState, getAgentById, getProject, setActiveAgentForThread, getConversation, getRelatedAgentsForAgent, getExternalAgentsForSubAgent, getTeamAgentsForSubAgent, getToolsForAgent, getDataComponentsForAgent, getArtifactComponentsForAgent, dbResultToMcpTool, CONVERSATION_HISTORY_MAX_OUTPUT_TOKENS_DEFAULT, CONVERSATION_HISTORY_DEFAULT_LIMIT, validateAndGetApiKey, verifyServiceToken, validateTargetAgent, ContextResolver, CredentialStuffer, MCPServerType, getCredentialReference, McpClient, getFunctionToolsForSubAgent, getFunction, getContextConfigById, getFullAgentDefinition, TemplateEngine, listTaskIdsByContextId, getLedgerArtifacts, agentHasArtifactComponents, upsertLedgerArtifact, MCPTransportType, SPAN_KEYS, headers, generateServiceToken } from '@inkeep/agents-core';
|
|
7
|
+
import { getTracer, HeadersScopeSchema, getRequestExecutionContext, createApiError, getAgentWithDefaultSubAgent, contextValidationMiddleware, getConversationId, getFullAgent, createOrGetConversation, getActiveAgentForConversation, setActiveAgentForConversation, getSubAgentById, handleContextResolution, createMessage, generateId, commonGetErrorResponses, loggerFactory, createDefaultCredentialStores, CredentialStoreRegistry, createTask, getTask, updateTask, setSpanWithError, AGENT_EXECUTION_TRANSFER_COUNT_DEFAULT, updateConversation, handleApiError, TaskState, getAgentById, getProject, setActiveAgentForThread, getConversation, getRelatedAgentsForAgent, getExternalAgentsForSubAgent, getTeamAgentsForSubAgent, getToolsForAgent, getDataComponentsForAgent, getArtifactComponentsForAgent, dbResultToMcpTool, CONVERSATION_HISTORY_MAX_OUTPUT_TOKENS_DEFAULT, CONVERSATION_HISTORY_DEFAULT_LIMIT, verifyTempToken, validateAndGetApiKey, verifyServiceToken, validateTargetAgent, ContextResolver, CredentialStuffer, MCPServerType, getCredentialReference, McpClient, getFunctionToolsForSubAgent, getFunction, getContextConfigById, getFullAgentDefinition, TemplateEngine, listTaskIdsByContextId, getLedgerArtifacts, agentHasArtifactComponents, upsertLedgerArtifact, MCPTransportType, SPAN_KEYS, headers, generateServiceToken } from '@inkeep/agents-core';
|
|
8
8
|
import { otel } from '@hono/otel';
|
|
9
9
|
import { OpenAPIHono, createRoute, z as z$1 } from '@hono/zod-openapi';
|
|
10
10
|
import { trace, propagation, context, SpanStatusCode } from '@opentelemetry/api';
|
|
@@ -47,6 +47,31 @@ function createExecutionContext(params) {
|
|
|
47
47
|
|
|
48
48
|
// src/middleware/api-key-auth.ts
|
|
49
49
|
var logger = getLogger("env-key-auth");
|
|
50
|
+
async function tryAuthenticateWithTempJwt(apiKey, baseUrl, subAgentId) {
|
|
51
|
+
if (!apiKey.startsWith("eyJ") || !env.INKEEP_AGENTS_TEMP_JWT_PUBLIC_KEY) {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
try {
|
|
55
|
+
const publicKeyPem = Buffer.from(env.INKEEP_AGENTS_TEMP_JWT_PUBLIC_KEY, "base64").toString(
|
|
56
|
+
"utf-8"
|
|
57
|
+
);
|
|
58
|
+
const payload = await verifyTempToken(publicKeyPem, apiKey);
|
|
59
|
+
logger.info({}, "JWT temp token authenticated successfully");
|
|
60
|
+
return createExecutionContext({
|
|
61
|
+
apiKey,
|
|
62
|
+
tenantId: payload.tenantId,
|
|
63
|
+
projectId: payload.projectId,
|
|
64
|
+
agentId: payload.agentId,
|
|
65
|
+
apiKeyId: "temp-jwt",
|
|
66
|
+
baseUrl,
|
|
67
|
+
subAgentId,
|
|
68
|
+
metadata: { initiatedBy: payload.initiatedBy }
|
|
69
|
+
});
|
|
70
|
+
} catch (error) {
|
|
71
|
+
logger.debug({ error }, "JWT verification failed");
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
50
75
|
var apiKeyAuth = () => createMiddleware(async (c, next) => {
|
|
51
76
|
if (c.req.method === "OPTIONS") {
|
|
52
77
|
await next();
|
|
@@ -67,6 +92,12 @@ var apiKeyAuth = () => createMiddleware(async (c, next) => {
|
|
|
67
92
|
let executionContext;
|
|
68
93
|
if (authHeader?.startsWith("Bearer ")) {
|
|
69
94
|
const apiKey2 = authHeader.substring(7);
|
|
95
|
+
const jwtContext2 = await tryAuthenticateWithTempJwt(apiKey2, baseUrl, subAgentId);
|
|
96
|
+
if (jwtContext2) {
|
|
97
|
+
c.set("executionContext", jwtContext2);
|
|
98
|
+
await next();
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
70
101
|
try {
|
|
71
102
|
executionContext = await extractContextFromApiKey(apiKey2, baseUrl);
|
|
72
103
|
if (subAgentId) {
|
|
@@ -119,6 +150,12 @@ var apiKeyAuth = () => createMiddleware(async (c, next) => {
|
|
|
119
150
|
});
|
|
120
151
|
}
|
|
121
152
|
const apiKey = authHeader.substring(7);
|
|
153
|
+
const jwtContext = await tryAuthenticateWithTempJwt(apiKey, baseUrl, subAgentId);
|
|
154
|
+
if (jwtContext) {
|
|
155
|
+
c.set("executionContext", jwtContext);
|
|
156
|
+
await next();
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
122
159
|
if (env.INKEEP_AGENTS_RUN_API_BYPASS_SECRET) {
|
|
123
160
|
if (apiKey === env.INKEEP_AGENTS_RUN_API_BYPASS_SECRET) {
|
|
124
161
|
if (!tenantId || !projectId || !agentId) {
|
|
@@ -139,7 +176,8 @@ var apiKeyAuth = () => createMiddleware(async (c, next) => {
|
|
|
139
176
|
logger.info({}, "Bypass secret authenticated successfully");
|
|
140
177
|
await next();
|
|
141
178
|
return;
|
|
142
|
-
}
|
|
179
|
+
}
|
|
180
|
+
if (apiKey) {
|
|
143
181
|
try {
|
|
144
182
|
const executionContext = await extractContextFromApiKey(apiKey, baseUrl);
|
|
145
183
|
if (subAgentId) {
|
|
@@ -157,11 +195,10 @@ var apiKeyAuth = () => createMiddleware(async (c, next) => {
|
|
|
157
195
|
}
|
|
158
196
|
await next();
|
|
159
197
|
return;
|
|
160
|
-
} else {
|
|
161
|
-
throw new HTTPException(401, {
|
|
162
|
-
message: "Invalid Token"
|
|
163
|
-
});
|
|
164
198
|
}
|
|
199
|
+
throw new HTTPException(401, {
|
|
200
|
+
message: "Invalid Token"
|
|
201
|
+
});
|
|
165
202
|
}
|
|
166
203
|
if (!apiKey || apiKey.length < 16) {
|
|
167
204
|
throw new HTTPException(401, {
|
|
@@ -307,6 +344,19 @@ function setupOpenAPIRoutes(app6) {
|
|
|
307
344
|
}
|
|
308
345
|
]
|
|
309
346
|
});
|
|
347
|
+
document.components = {
|
|
348
|
+
...document.components,
|
|
349
|
+
securitySchemes: {
|
|
350
|
+
...document.components?.securitySchemes || {},
|
|
351
|
+
bearerAuth: {
|
|
352
|
+
type: "http",
|
|
353
|
+
scheme: "bearer",
|
|
354
|
+
bearerFormat: "API Key",
|
|
355
|
+
description: 'API key authentication. All endpoints require a valid API key in the Authorization header as "Bearer <api-key>". API keys can be created in the management UI.'
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
};
|
|
359
|
+
document.security = [{ bearerAuth: [] }];
|
|
310
360
|
return c.json(document);
|
|
311
361
|
} catch (error) {
|
|
312
362
|
console.error("OpenAPI document generation failed:", error);
|
|
@@ -7900,7 +7950,7 @@ var Agent = class {
|
|
|
7900
7950
|
inputSchema: tool3.inputSchema || tool3.parameters || {},
|
|
7901
7951
|
usageGuidelines: name.startsWith("transfer_to_") || name.startsWith("delegate_to_") ? `Use this tool to ${name.startsWith("transfer_to_") ? "transfer" : "delegate"} to another agent when appropriate.` : "Use this tool when appropriate for the task at hand."
|
|
7902
7952
|
}));
|
|
7903
|
-
const { getConversationScopedArtifacts } = await import('./conversations-
|
|
7953
|
+
const { getConversationScopedArtifacts } = await import('./conversations-YFQ52RQB.js');
|
|
7904
7954
|
const historyConfig = this.config.conversationHistoryConfig ?? createDefaultConversationHistoryConfig();
|
|
7905
7955
|
const referenceArtifacts = await getConversationScopedArtifacts({
|
|
7906
7956
|
tenantId: this.config.tenantId,
|
|
@@ -11459,7 +11509,15 @@ app3.openapi(chatDataStreamRoute, async (c) => {
|
|
|
11459
11509
|
);
|
|
11460
11510
|
});
|
|
11461
11511
|
} catch (error) {
|
|
11462
|
-
logger22.error(
|
|
11512
|
+
logger22.error(
|
|
11513
|
+
{
|
|
11514
|
+
error,
|
|
11515
|
+
errorMessage: error instanceof Error ? error.message : String(error),
|
|
11516
|
+
errorStack: error instanceof Error ? error.stack : void 0,
|
|
11517
|
+
errorType: error?.constructor?.name
|
|
11518
|
+
},
|
|
11519
|
+
"chatDataStream error - DETAILED"
|
|
11520
|
+
);
|
|
11463
11521
|
throw createApiError({
|
|
11464
11522
|
code: "internal_server_error",
|
|
11465
11523
|
message: "Failed to process chat completion"
|
package/dist/instrumentation.cjs
CHANGED
|
@@ -27,6 +27,7 @@ var envSchema = zod.z.object({
|
|
|
27
27
|
GOOGLE_GENERATIVE_AI_API_KEY: zod.z.string().optional(),
|
|
28
28
|
INKEEP_AGENTS_RUN_API_BYPASS_SECRET: zod.z.string().optional(),
|
|
29
29
|
INKEEP_AGENTS_JWT_SIGNING_SECRET: zod.z.string().optional(),
|
|
30
|
+
INKEEP_AGENTS_TEMP_JWT_PUBLIC_KEY: zod.z.string().optional(),
|
|
30
31
|
OTEL_BSP_SCHEDULE_DELAY: zod.z.coerce.number().optional().default(500),
|
|
31
32
|
OTEL_BSP_MAX_EXPORT_BATCH_SIZE: zod.z.coerce.number().optional().default(64)
|
|
32
33
|
});
|
package/dist/instrumentation.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { defaultBatchProcessor, defaultContextManager, defaultInstrumentations, defaultResource, defaultSDK, defaultSpanProcessors, defaultTextMapPropagator, flushBatchProcessor } from './chunk-
|
|
1
|
+
export { defaultBatchProcessor, defaultContextManager, defaultInstrumentations, defaultResource, defaultSDK, defaultSpanProcessors, defaultTextMapPropagator, flushBatchProcessor } from './chunk-2LBNQ773.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inkeep/agents-run-api",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.37.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",
|
|
@@ -48,18 +48,20 @@
|
|
|
48
48
|
"fetch-to-node": "^2.1.0",
|
|
49
49
|
"hono": "^4.10.4",
|
|
50
50
|
"jmespath": "^0.16.0",
|
|
51
|
+
"jose": "^6.1.0",
|
|
51
52
|
"json-schema-to-zod": "^2.6.1",
|
|
52
53
|
"nanoid": "^5.1.5",
|
|
53
54
|
"pino": "^9.11.0",
|
|
54
55
|
"traverse": "^0.6.11",
|
|
55
56
|
"ts-pattern": "^5.7.1",
|
|
56
57
|
"zod": "4.1.5",
|
|
57
|
-
"@inkeep/agents-core": "^0.
|
|
58
|
+
"@inkeep/agents-core": "^0.37.0"
|
|
58
59
|
},
|
|
59
60
|
"optionalDependencies": {
|
|
60
61
|
"keytar": "^7.9.0"
|
|
61
62
|
},
|
|
62
63
|
"devDependencies": {
|
|
64
|
+
"@electric-sql/pglite": "^0.3.13",
|
|
63
65
|
"@hono/vite-dev-server": "^0.20.1",
|
|
64
66
|
"@opentelemetry/exporter-trace-otlp-proto": "^0.203.0",
|
|
65
67
|
"@opentelemetry/sdk-metrics": "^2.1.0",
|
|
@@ -73,8 +75,7 @@
|
|
|
73
75
|
"typescript": "^5.3.3",
|
|
74
76
|
"vite": "^7.1.11",
|
|
75
77
|
"vite-tsconfig-paths": "^5.1.4",
|
|
76
|
-
"vitest": "^3.2.4"
|
|
77
|
-
"@electric-sql/pglite": "^0.3.13"
|
|
78
|
+
"vitest": "^3.2.4"
|
|
78
79
|
},
|
|
79
80
|
"engines": {
|
|
80
81
|
"node": ">=22.0.0"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { dbClient_default as default } from './chunk-CWFQPSTI.js';
|