@inkeep/agents-run-api 0.0.0-dev-20250910232631

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.
Files changed (152) hide show
  1. package/LICENSE.md +49 -0
  2. package/README.md +117 -0
  3. package/dist/__tests__/setup.d.ts +4 -0
  4. package/dist/__tests__/setup.d.ts.map +1 -0
  5. package/dist/__tests__/setup.js +80 -0
  6. package/dist/__tests__/utils/testProject.d.ts +18 -0
  7. package/dist/__tests__/utils/testProject.d.ts.map +1 -0
  8. package/dist/__tests__/utils/testProject.js +26 -0
  9. package/dist/__tests__/utils/testRequest.d.ts +8 -0
  10. package/dist/__tests__/utils/testRequest.d.ts.map +1 -0
  11. package/dist/__tests__/utils/testRequest.js +32 -0
  12. package/dist/__tests__/utils/testTenant.d.ts +64 -0
  13. package/dist/__tests__/utils/testTenant.d.ts.map +1 -0
  14. package/dist/__tests__/utils/testTenant.js +71 -0
  15. package/dist/a2a/client.d.ts +182 -0
  16. package/dist/a2a/client.d.ts.map +1 -0
  17. package/dist/a2a/client.js +645 -0
  18. package/dist/a2a/handlers.d.ts +4 -0
  19. package/dist/a2a/handlers.d.ts.map +1 -0
  20. package/dist/a2a/handlers.js +656 -0
  21. package/dist/a2a/transfer.d.ts +18 -0
  22. package/dist/a2a/transfer.d.ts.map +1 -0
  23. package/dist/a2a/transfer.js +22 -0
  24. package/dist/a2a/types.d.ts +63 -0
  25. package/dist/a2a/types.d.ts.map +1 -0
  26. package/dist/a2a/types.js +1 -0
  27. package/dist/agents/Agent.d.ts +151 -0
  28. package/dist/agents/Agent.d.ts.map +1 -0
  29. package/dist/agents/Agent.js +1164 -0
  30. package/dist/agents/ModelFactory.d.ts +62 -0
  31. package/dist/agents/ModelFactory.d.ts.map +1 -0
  32. package/dist/agents/ModelFactory.js +208 -0
  33. package/dist/agents/SystemPromptBuilder.d.ts +14 -0
  34. package/dist/agents/SystemPromptBuilder.d.ts.map +1 -0
  35. package/dist/agents/SystemPromptBuilder.js +62 -0
  36. package/dist/agents/ToolSessionManager.d.ts +53 -0
  37. package/dist/agents/ToolSessionManager.d.ts.map +1 -0
  38. package/dist/agents/ToolSessionManager.js +106 -0
  39. package/dist/agents/artifactTools.d.ts +30 -0
  40. package/dist/agents/artifactTools.d.ts.map +1 -0
  41. package/dist/agents/artifactTools.js +463 -0
  42. package/dist/agents/generateTaskHandler.d.ts +41 -0
  43. package/dist/agents/generateTaskHandler.d.ts.map +1 -0
  44. package/dist/agents/generateTaskHandler.js +350 -0
  45. package/dist/agents/relationTools.d.ts +35 -0
  46. package/dist/agents/relationTools.d.ts.map +1 -0
  47. package/dist/agents/relationTools.js +246 -0
  48. package/dist/agents/types.d.ts +23 -0
  49. package/dist/agents/types.d.ts.map +1 -0
  50. package/dist/agents/types.js +1 -0
  51. package/dist/agents/versions/V1Config.d.ts +21 -0
  52. package/dist/agents/versions/V1Config.d.ts.map +1 -0
  53. package/dist/agents/versions/V1Config.js +285 -0
  54. package/dist/app.d.ts +5 -0
  55. package/dist/app.d.ts.map +1 -0
  56. package/dist/app.js +219 -0
  57. package/dist/data/agentGraph.d.ts +4 -0
  58. package/dist/data/agentGraph.d.ts.map +1 -0
  59. package/dist/data/agentGraph.js +73 -0
  60. package/dist/data/agents.d.ts +4 -0
  61. package/dist/data/agents.d.ts.map +1 -0
  62. package/dist/data/agents.js +78 -0
  63. package/dist/data/conversations.d.ts +59 -0
  64. package/dist/data/conversations.d.ts.map +1 -0
  65. package/dist/data/conversations.js +216 -0
  66. package/dist/data/db/clean.d.ts +6 -0
  67. package/dist/data/db/clean.d.ts.map +1 -0
  68. package/dist/data/db/clean.js +77 -0
  69. package/dist/data/db/dbClient.d.ts +3 -0
  70. package/dist/data/db/dbClient.d.ts.map +1 -0
  71. package/dist/data/db/dbClient.js +13 -0
  72. package/dist/env.d.ts +45 -0
  73. package/dist/env.d.ts.map +1 -0
  74. package/dist/env.js +64 -0
  75. package/dist/handlers/executionHandler.d.ts +36 -0
  76. package/dist/handlers/executionHandler.d.ts.map +1 -0
  77. package/dist/handlers/executionHandler.js +415 -0
  78. package/dist/index.d.ts +11 -0
  79. package/dist/index.d.ts.map +1 -0
  80. package/dist/index.js +28 -0
  81. package/dist/instrumentation.d.ts +13 -0
  82. package/dist/instrumentation.d.ts.map +1 -0
  83. package/dist/instrumentation.js +66 -0
  84. package/dist/logger.d.ts +4 -0
  85. package/dist/logger.d.ts.map +1 -0
  86. package/dist/logger.js +32 -0
  87. package/dist/middleware/api-key-auth.d.ts +22 -0
  88. package/dist/middleware/api-key-auth.d.ts.map +1 -0
  89. package/dist/middleware/api-key-auth.js +139 -0
  90. package/dist/middleware/index.d.ts +2 -0
  91. package/dist/middleware/index.d.ts.map +1 -0
  92. package/dist/middleware/index.js +1 -0
  93. package/dist/openapi.d.ts +2 -0
  94. package/dist/openapi.d.ts.map +1 -0
  95. package/dist/openapi.js +36 -0
  96. package/dist/routes/agents.d.ts +10 -0
  97. package/dist/routes/agents.d.ts.map +1 -0
  98. package/dist/routes/agents.js +158 -0
  99. package/dist/routes/chat.d.ts +10 -0
  100. package/dist/routes/chat.d.ts.map +1 -0
  101. package/dist/routes/chat.js +307 -0
  102. package/dist/routes/chatDataStream.d.ts +10 -0
  103. package/dist/routes/chatDataStream.d.ts.map +1 -0
  104. package/dist/routes/chatDataStream.js +185 -0
  105. package/dist/routes/mcp.d.ts +10 -0
  106. package/dist/routes/mcp.d.ts.map +1 -0
  107. package/dist/routes/mcp.js +500 -0
  108. package/dist/tracer.d.ts +24 -0
  109. package/dist/tracer.d.ts.map +1 -0
  110. package/dist/tracer.js +107 -0
  111. package/dist/types/chat.d.ts +25 -0
  112. package/dist/types/chat.d.ts.map +1 -0
  113. package/dist/types/chat.js +1 -0
  114. package/dist/types/execution-context.d.ts +14 -0
  115. package/dist/types/execution-context.d.ts.map +1 -0
  116. package/dist/types/execution-context.js +14 -0
  117. package/dist/utils/agent-operations.d.ts +93 -0
  118. package/dist/utils/agent-operations.d.ts.map +1 -0
  119. package/dist/utils/agent-operations.js +78 -0
  120. package/dist/utils/artifact-component-schema.d.ts +29 -0
  121. package/dist/utils/artifact-component-schema.d.ts.map +1 -0
  122. package/dist/utils/artifact-component-schema.js +119 -0
  123. package/dist/utils/artifact-parser.d.ts +71 -0
  124. package/dist/utils/artifact-parser.d.ts.map +1 -0
  125. package/dist/utils/artifact-parser.js +253 -0
  126. package/dist/utils/cleanup.d.ts +19 -0
  127. package/dist/utils/cleanup.d.ts.map +1 -0
  128. package/dist/utils/cleanup.js +66 -0
  129. package/dist/utils/data-component-schema.d.ts +6 -0
  130. package/dist/utils/data-component-schema.d.ts.map +1 -0
  131. package/dist/utils/data-component-schema.js +43 -0
  132. package/dist/utils/graph-session.d.ts +230 -0
  133. package/dist/utils/graph-session.d.ts.map +1 -0
  134. package/dist/utils/graph-session.js +1199 -0
  135. package/dist/utils/incremental-stream-parser.d.ts +62 -0
  136. package/dist/utils/incremental-stream-parser.d.ts.map +1 -0
  137. package/dist/utils/incremental-stream-parser.js +330 -0
  138. package/dist/utils/response-formatter.d.ts +26 -0
  139. package/dist/utils/response-formatter.d.ts.map +1 -0
  140. package/dist/utils/response-formatter.js +158 -0
  141. package/dist/utils/stream-helpers.d.ts +186 -0
  142. package/dist/utils/stream-helpers.d.ts.map +1 -0
  143. package/dist/utils/stream-helpers.js +603 -0
  144. package/dist/utils/stream-registry.d.ts +18 -0
  145. package/dist/utils/stream-registry.d.ts.map +1 -0
  146. package/dist/utils/stream-registry.js +33 -0
  147. package/package.json +95 -0
  148. package/templates/v1/artifact.xml +7 -0
  149. package/templates/v1/data-component.xml +9 -0
  150. package/templates/v1/system-prompt.xml +52 -0
  151. package/templates/v1/thinking-preparation.xml +34 -0
  152. package/templates/v1/tool.xml +12 -0
@@ -0,0 +1,139 @@
1
+ import { getLogger, validateAndGetApiKey } from '@inkeep/agents-core';
2
+ import { createMiddleware } from 'hono/factory';
3
+ import { HTTPException } from 'hono/http-exception';
4
+ import dbClient from '../data/db/dbClient';
5
+ import { env } from '../env';
6
+ import { createExecutionContext } from '../types/execution-context';
7
+ const logger = getLogger('env-key-auth');
8
+ /**
9
+ * Middleware to authenticate API requests using Bearer token authentication
10
+ * First checks if token matches INKEEP_AGENTS_RUN_BYPASS_SECRET, then falls back to API key validation
11
+ * Extracts and validates API keys, then adds execution context to the request
12
+ */
13
+ export const apiKeyAuth = () => createMiddleware(async (c, next) => {
14
+ const authHeader = c.req.header('Authorization');
15
+ const tenantId = c.req.header('x-inkeep-tenant-id');
16
+ const projectId = c.req.header('x-inkeep-project-id');
17
+ const graphId = c.req.header('x-inkeep-graph-id');
18
+ const agentId = c.req.header('x-inkeep-agent-id');
19
+ const baseUrl = new URL(c.req.url).origin;
20
+ // Bypass authentication only for integration tests with specific header
21
+ if (process.env.ENVIRONMENT === 'development' || process.env.ENVIRONMENT === 'test') {
22
+ const executionContext = createExecutionContext({
23
+ apiKey: 'development',
24
+ tenantId: tenantId || 'test-tenant',
25
+ projectId: projectId || 'test-project',
26
+ graphId: graphId || 'test-graph',
27
+ apiKeyId: 'test-key',
28
+ baseUrl: baseUrl,
29
+ agentId: agentId,
30
+ });
31
+ c.set('executionContext', executionContext);
32
+ logger.info({}, 'Test environment bypass authenticated successfully');
33
+ await next();
34
+ return;
35
+ }
36
+ // Check for Bearer token
37
+ if (!authHeader || !authHeader.startsWith('Bearer ')) {
38
+ throw new HTTPException(401, {
39
+ message: 'Missing or invalid authorization header. Expected: Bearer <api_key>',
40
+ });
41
+ }
42
+ const apiKey = authHeader.substring(7); // Remove 'Bearer ' prefix
43
+ // If bypass secret is configured, allow bypass authentication or api key validation
44
+ if (env.INKEEP_AGENTS_RUN_BYPASS_SECRET) {
45
+ if (apiKey === env.INKEEP_AGENTS_RUN_BYPASS_SECRET) {
46
+ // Extract base URL from request
47
+ if (!tenantId || !projectId || !graphId) {
48
+ throw new HTTPException(401, {
49
+ message: 'Missing or invalid tenant, project, or graph ID',
50
+ });
51
+ }
52
+ // Create bypass execution context with default values
53
+ const executionContext = createExecutionContext({
54
+ apiKey: apiKey,
55
+ tenantId: tenantId,
56
+ projectId: projectId,
57
+ graphId: graphId,
58
+ apiKeyId: 'bypass',
59
+ baseUrl: baseUrl,
60
+ agentId: agentId,
61
+ });
62
+ c.set('executionContext', executionContext);
63
+ logger.info({}, 'Bypass secret authenticated successfully');
64
+ await next();
65
+ return;
66
+ }
67
+ else if (apiKey) {
68
+ const executionContext = await extractContextFromApiKey(apiKey);
69
+ c.set('executionContext', executionContext);
70
+ logger.info({}, 'API key authenticated successfully');
71
+ await next();
72
+ return;
73
+ }
74
+ else {
75
+ // Bypass secret is set but token doesn't match - reject
76
+ throw new HTTPException(401, {
77
+ message: 'Invalid Token',
78
+ });
79
+ }
80
+ }
81
+ // No bypass secret configured - continue with normal API key validation
82
+ // Validate API key format (basic validation)
83
+ if (!apiKey || apiKey.length < 16) {
84
+ throw new HTTPException(401, {
85
+ message: 'Invalid API key format',
86
+ });
87
+ }
88
+ try {
89
+ const executionContext = await extractContextFromApiKey(apiKey);
90
+ c.set('executionContext', executionContext);
91
+ // Log successful authentication (without sensitive data)
92
+ logger.debug({
93
+ tenantId: executionContext.tenantId,
94
+ projectId: executionContext.projectId,
95
+ graphId: executionContext.graphId,
96
+ }, 'API key authenticated successfully');
97
+ await next();
98
+ }
99
+ catch (error) {
100
+ // Re-throw HTTPException
101
+ if (error instanceof HTTPException) {
102
+ throw error;
103
+ }
104
+ // Log unexpected errors and return generic message
105
+ logger.error({ error }, 'API key authentication error');
106
+ throw new HTTPException(500, {
107
+ message: 'Authentication failed',
108
+ });
109
+ }
110
+ });
111
+ export const extractContextFromApiKey = async (apiKey) => {
112
+ const apiKeyRecord = await validateAndGetApiKey(apiKey, dbClient);
113
+ if (!apiKeyRecord) {
114
+ throw new HTTPException(401, {
115
+ message: 'Invalid or expired API key',
116
+ });
117
+ }
118
+ return createExecutionContext({
119
+ apiKey: apiKey,
120
+ tenantId: apiKeyRecord.tenantId,
121
+ projectId: apiKeyRecord.projectId,
122
+ graphId: apiKeyRecord.graphId,
123
+ apiKeyId: apiKeyRecord.id,
124
+ });
125
+ };
126
+ /**
127
+ * Helper middleware for endpoints that optionally support API key authentication
128
+ * If no auth header is present, it continues without setting the executionContext
129
+ */
130
+ export const optionalAuth = () => createMiddleware(async (c, next) => {
131
+ const authHeader = c.req.header('Authorization');
132
+ // If no auth header, continue without authentication
133
+ if (!authHeader || !authHeader.startsWith('Bearer ')) {
134
+ await next();
135
+ return;
136
+ }
137
+ // If auth header exists, use the regular auth middleware
138
+ return apiKeyAuth()(c, next);
139
+ });
@@ -0,0 +1,2 @@
1
+ export * from './api-key-auth';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/middleware/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
@@ -0,0 +1 @@
1
+ export * from './api-key-auth';
@@ -0,0 +1,2 @@
1
+ export declare function setupOpenAPIRoutes(app: any): void;
2
+ //# sourceMappingURL=openapi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openapi.d.ts","sourceRoot":"","sources":["../src/openapi.ts"],"names":[],"mappings":"AAIA,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,GAAG,QAsC1C"}
@@ -0,0 +1,36 @@
1
+ import { swaggerUI } from '@hono/swagger-ui';
2
+ import { env } from './env';
3
+ export function setupOpenAPIRoutes(app) {
4
+ // OpenAPI specification endpoint - serves the complete API spec
5
+ app.get('/openapi.json', (c) => {
6
+ try {
7
+ const document = app.getOpenAPIDocument({
8
+ openapi: '3.0.0',
9
+ info: {
10
+ title: 'Inkeep Execution API',
11
+ version: '1.0.0',
12
+ description: 'Complete REST API for Inkeep Execution application including chat completions, A2A agent communication, and comprehensive CRUD operations for all entities',
13
+ },
14
+ servers: [
15
+ {
16
+ url: env.AGENT_BASE_URL || `http://localhost:3003`,
17
+ description: 'Development server',
18
+ },
19
+ ],
20
+ });
21
+ return c.json(document);
22
+ }
23
+ catch (error) {
24
+ console.error('OpenAPI document generation failed:', error);
25
+ const errorDetails = error instanceof Error
26
+ ? { message: error.message, stack: error.stack }
27
+ : JSON.stringify(error, null, 2);
28
+ return c.json({ error: 'Failed to generate OpenAPI document', details: errorDetails }, 500);
29
+ }
30
+ });
31
+ // Swagger UI endpoint for interactive documentation
32
+ app.get('/docs', swaggerUI({
33
+ url: '/openapi.json',
34
+ title: 'Inkeep Execution API Documentation',
35
+ }));
36
+ }
@@ -0,0 +1,10 @@
1
+ import { OpenAPIHono } from '@hono/zod-openapi';
2
+ import { type CredentialStoreRegistry } from '@inkeep/agents-core';
3
+ type AppVariables = {
4
+ credentialStores: CredentialStoreRegistry;
5
+ };
6
+ declare const app: OpenAPIHono<{
7
+ Variables: AppVariables;
8
+ }, {}, "/">;
9
+ export default app;
10
+ //# sourceMappingURL=agents.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../src/routes/agents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EACL,KAAK,uBAAuB,EAI7B,MAAM,qBAAqB,CAAC;AAS7B,KAAK,YAAY,GAAG;IAClB,gBAAgB,EAAE,uBAAuB,CAAC;CAC3C,CAAC;AAEF,QAAA,MAAM,GAAG;eAAgC,YAAY;WAAK,CAAC;AAqM3D,eAAe,GAAG,CAAC"}
@@ -0,0 +1,158 @@
1
+ import { createRoute, OpenAPIHono } from '@hono/zod-openapi';
2
+ import { getAgentGraphWithDefaultAgent, getRequestExecutionContext, HeadersScopeSchema, } from '@inkeep/agents-core';
3
+ import { z } from 'zod';
4
+ import { a2aHandler } from '../a2a/handlers';
5
+ import { getRegisteredGraph } from '../data/agentGraph';
6
+ import { getRegisteredAgent } from '../data/agents';
7
+ import dbClient from '../data/db/dbClient';
8
+ import { getLogger } from '../logger';
9
+ const app = new OpenAPIHono();
10
+ const logger = getLogger('agents');
11
+ // A2A Agent Card Discovery (REST with OpenAPI)
12
+ app.openapi(createRoute({
13
+ method: 'get',
14
+ path: '/.well-known/agent.json',
15
+ request: {
16
+ headers: HeadersScopeSchema,
17
+ },
18
+ tags: ['a2a'],
19
+ security: [{ bearerAuth: [] }],
20
+ responses: {
21
+ 200: {
22
+ description: 'Agent Card for A2A discovery',
23
+ content: {
24
+ 'application/json': {
25
+ schema: z.object({
26
+ name: z.string(),
27
+ description: z.string().optional(),
28
+ url: z.string(),
29
+ version: z.string(),
30
+ defaultInputModes: z.array(z.string()),
31
+ defaultOutputModes: z.array(z.string()),
32
+ skills: z.array(z.any()),
33
+ }),
34
+ },
35
+ },
36
+ },
37
+ 404: {
38
+ description: 'Agent not found',
39
+ },
40
+ },
41
+ }), async (c) => {
42
+ const otelHeaders = {
43
+ traceparent: c.req.header('traceparent'),
44
+ tracestate: c.req.header('tracestate'),
45
+ baggage: c.req.header('baggage'),
46
+ };
47
+ logger.info({
48
+ otelHeaders,
49
+ path: c.req.path,
50
+ method: c.req.method,
51
+ }, 'OpenTelemetry headers: well-known agent.json');
52
+ // Get execution context from API key authentication
53
+ const executionContext = getRequestExecutionContext(c);
54
+ const { tenantId, projectId, graphId, agentId } = executionContext;
55
+ // If agentId is defined in execution context, run agent-level logic
56
+ if (agentId) {
57
+ logger.info({
58
+ message: 'getRegisteredAgent (agent-level)',
59
+ tenantId,
60
+ projectId,
61
+ graphId,
62
+ agentId,
63
+ }, 'agent-level well-known agent.json');
64
+ const credentialStores = c.get('credentialStores');
65
+ const agent = await getRegisteredAgent(executionContext, credentialStores);
66
+ logger.info({ agent }, 'agent registered: well-known agent.json');
67
+ if (!agent) {
68
+ return c.json({ error: 'Agent not found' }, 404);
69
+ }
70
+ return c.json(agent.agentCard);
71
+ }
72
+ else {
73
+ // Run graph-level logic
74
+ logger.info({
75
+ message: 'getRegisteredGraph (graph-level)',
76
+ tenantId,
77
+ projectId,
78
+ graphId,
79
+ }, 'graph-level well-known agent.json');
80
+ const graph = await getRegisteredGraph(executionContext);
81
+ if (!graph) {
82
+ return c.json({ error: 'Graph not found' }, 404);
83
+ }
84
+ return c.json(graph.agentCard);
85
+ }
86
+ });
87
+ // A2A Protocol Handler (supports both agent-level and graph-level)
88
+ app.post('/a2a', async (c) => {
89
+ const otelHeaders = {
90
+ traceparent: c.req.header('traceparent'),
91
+ tracestate: c.req.header('tracestate'),
92
+ baggage: c.req.header('baggage'),
93
+ };
94
+ logger.info({
95
+ otelHeaders,
96
+ path: c.req.path,
97
+ method: c.req.method,
98
+ }, 'OpenTelemetry headers: a2a');
99
+ // Get execution context from API key authentication
100
+ const executionContext = getRequestExecutionContext(c);
101
+ const { tenantId, projectId, graphId, agentId } = executionContext;
102
+ // If agentId is defined in execution context, run agent-level logic
103
+ if (agentId) {
104
+ logger.info({
105
+ message: 'a2a (agent-level)',
106
+ tenantId,
107
+ projectId,
108
+ graphId,
109
+ agentId,
110
+ }, 'agent-level a2a endpoint');
111
+ // Ensure agent is registered (lazy loading)
112
+ const credentialStores = c.get('credentialStores');
113
+ const agent = await getRegisteredAgent(executionContext, credentialStores);
114
+ if (!agent) {
115
+ return c.json({
116
+ jsonrpc: '2.0',
117
+ error: { code: -32004, message: 'Agent not found' },
118
+ id: null,
119
+ }, 404);
120
+ }
121
+ return a2aHandler(c, agent);
122
+ }
123
+ else {
124
+ // Run graph-level logic
125
+ logger.info({
126
+ message: 'a2a (graph-level)',
127
+ tenantId,
128
+ projectId,
129
+ graphId,
130
+ }, 'graph-level a2a endpoint');
131
+ // fetch the graph and the default agent
132
+ const graph = await getAgentGraphWithDefaultAgent(dbClient)({
133
+ scopes: { tenantId, projectId },
134
+ graphId,
135
+ });
136
+ if (!graph) {
137
+ return c.json({
138
+ jsonrpc: '2.0',
139
+ error: { code: -32004, message: 'Agent not found' },
140
+ id: null,
141
+ }, 404);
142
+ }
143
+ executionContext.agentId = graph.defaultAgentId;
144
+ // fetch the default agent and use it as entry point for the graph
145
+ const credentialStores = c.get('credentialStores');
146
+ const defaultAgent = await getRegisteredAgent(executionContext, credentialStores);
147
+ if (!defaultAgent) {
148
+ return c.json({
149
+ jsonrpc: '2.0',
150
+ error: { code: -32004, message: 'Agent not found' },
151
+ id: null,
152
+ }, 404);
153
+ }
154
+ // Use the existing a2aHandler with the default agent as a registered agent
155
+ return a2aHandler(c, defaultAgent);
156
+ }
157
+ });
158
+ export default app;
@@ -0,0 +1,10 @@
1
+ import { OpenAPIHono } from '@hono/zod-openapi';
2
+ import { type CredentialStoreRegistry } from '@inkeep/agents-core';
3
+ type AppVariables = {
4
+ credentialStores: CredentialStoreRegistry;
5
+ };
6
+ declare const app: OpenAPIHono<{
7
+ Variables: AppVariables;
8
+ }, {}, "/">;
9
+ export default app;
10
+ //# sourceMappingURL=chat.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../src/routes/chat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EACL,KAAK,uBAAuB,EAW7B,MAAM,qBAAqB,CAAC;AAY7B,KAAK,YAAY,GAAG;IAClB,gBAAgB,EAAE,uBAAuB,CAAC;CAC3C,CAAC;AAEF,QAAA,MAAM,GAAG;eAAgC,YAAY;WAAK,CAAC;AA2W3D,eAAe,GAAG,CAAC"}