@inkeep/agents-run-api 0.0.0-dev-20250910233133 → 0.0.0-dev-20250910233151

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/dist/chunk-3COYP2VE.js +70 -0
  2. package/dist/chunk-JIWNRFDU.js +236 -0
  3. package/dist/chunk-PKBMQBKP.js +5 -0
  4. package/dist/conversations-YTJWHN67.js +1 -0
  5. package/dist/index.cjs +9060 -0
  6. package/dist/index.d.cts +15 -0
  7. package/dist/index.d.ts +13 -9
  8. package/dist/index.js +8633 -27
  9. package/dist/instrumentation-KKYHA3A3.js +1 -0
  10. package/package.json +3 -3
  11. package/dist/__tests__/setup.d.ts +0 -4
  12. package/dist/__tests__/setup.d.ts.map +0 -1
  13. package/dist/__tests__/setup.js +0 -80
  14. package/dist/__tests__/utils/testProject.d.ts +0 -18
  15. package/dist/__tests__/utils/testProject.d.ts.map +0 -1
  16. package/dist/__tests__/utils/testProject.js +0 -26
  17. package/dist/__tests__/utils/testRequest.d.ts +0 -8
  18. package/dist/__tests__/utils/testRequest.d.ts.map +0 -1
  19. package/dist/__tests__/utils/testRequest.js +0 -32
  20. package/dist/__tests__/utils/testTenant.d.ts +0 -64
  21. package/dist/__tests__/utils/testTenant.d.ts.map +0 -1
  22. package/dist/__tests__/utils/testTenant.js +0 -71
  23. package/dist/a2a/client.d.ts +0 -182
  24. package/dist/a2a/client.d.ts.map +0 -1
  25. package/dist/a2a/client.js +0 -645
  26. package/dist/a2a/handlers.d.ts +0 -4
  27. package/dist/a2a/handlers.d.ts.map +0 -1
  28. package/dist/a2a/handlers.js +0 -656
  29. package/dist/a2a/transfer.d.ts +0 -18
  30. package/dist/a2a/transfer.d.ts.map +0 -1
  31. package/dist/a2a/transfer.js +0 -22
  32. package/dist/a2a/types.d.ts +0 -63
  33. package/dist/a2a/types.d.ts.map +0 -1
  34. package/dist/a2a/types.js +0 -1
  35. package/dist/agents/Agent.d.ts +0 -151
  36. package/dist/agents/Agent.d.ts.map +0 -1
  37. package/dist/agents/Agent.js +0 -1164
  38. package/dist/agents/ModelFactory.d.ts +0 -62
  39. package/dist/agents/ModelFactory.d.ts.map +0 -1
  40. package/dist/agents/ModelFactory.js +0 -208
  41. package/dist/agents/SystemPromptBuilder.d.ts +0 -14
  42. package/dist/agents/SystemPromptBuilder.d.ts.map +0 -1
  43. package/dist/agents/SystemPromptBuilder.js +0 -62
  44. package/dist/agents/ToolSessionManager.d.ts +0 -53
  45. package/dist/agents/ToolSessionManager.d.ts.map +0 -1
  46. package/dist/agents/ToolSessionManager.js +0 -106
  47. package/dist/agents/artifactTools.d.ts +0 -30
  48. package/dist/agents/artifactTools.d.ts.map +0 -1
  49. package/dist/agents/artifactTools.js +0 -463
  50. package/dist/agents/generateTaskHandler.d.ts +0 -41
  51. package/dist/agents/generateTaskHandler.d.ts.map +0 -1
  52. package/dist/agents/generateTaskHandler.js +0 -350
  53. package/dist/agents/relationTools.d.ts +0 -35
  54. package/dist/agents/relationTools.d.ts.map +0 -1
  55. package/dist/agents/relationTools.js +0 -246
  56. package/dist/agents/types.d.ts +0 -23
  57. package/dist/agents/types.d.ts.map +0 -1
  58. package/dist/agents/types.js +0 -1
  59. package/dist/agents/versions/V1Config.d.ts +0 -21
  60. package/dist/agents/versions/V1Config.d.ts.map +0 -1
  61. package/dist/agents/versions/V1Config.js +0 -285
  62. package/dist/app.d.ts +0 -5
  63. package/dist/app.d.ts.map +0 -1
  64. package/dist/app.js +0 -219
  65. package/dist/data/agentGraph.d.ts +0 -4
  66. package/dist/data/agentGraph.d.ts.map +0 -1
  67. package/dist/data/agentGraph.js +0 -73
  68. package/dist/data/agents.d.ts +0 -4
  69. package/dist/data/agents.d.ts.map +0 -1
  70. package/dist/data/agents.js +0 -78
  71. package/dist/data/conversations.d.ts +0 -59
  72. package/dist/data/conversations.d.ts.map +0 -1
  73. package/dist/data/conversations.js +0 -216
  74. package/dist/data/db/clean.d.ts +0 -6
  75. package/dist/data/db/clean.d.ts.map +0 -1
  76. package/dist/data/db/clean.js +0 -77
  77. package/dist/data/db/dbClient.d.ts +0 -3
  78. package/dist/data/db/dbClient.d.ts.map +0 -1
  79. package/dist/data/db/dbClient.js +0 -13
  80. package/dist/env.d.ts +0 -45
  81. package/dist/env.d.ts.map +0 -1
  82. package/dist/env.js +0 -64
  83. package/dist/handlers/executionHandler.d.ts +0 -36
  84. package/dist/handlers/executionHandler.d.ts.map +0 -1
  85. package/dist/handlers/executionHandler.js +0 -415
  86. package/dist/index.d.ts.map +0 -1
  87. package/dist/instrumentation.d.ts +0 -13
  88. package/dist/instrumentation.d.ts.map +0 -1
  89. package/dist/instrumentation.js +0 -66
  90. package/dist/logger.d.ts +0 -4
  91. package/dist/logger.d.ts.map +0 -1
  92. package/dist/logger.js +0 -32
  93. package/dist/middleware/api-key-auth.d.ts +0 -22
  94. package/dist/middleware/api-key-auth.d.ts.map +0 -1
  95. package/dist/middleware/api-key-auth.js +0 -162
  96. package/dist/middleware/index.d.ts +0 -2
  97. package/dist/middleware/index.d.ts.map +0 -1
  98. package/dist/middleware/index.js +0 -1
  99. package/dist/openapi.d.ts +0 -2
  100. package/dist/openapi.d.ts.map +0 -1
  101. package/dist/openapi.js +0 -36
  102. package/dist/routes/agents.d.ts +0 -10
  103. package/dist/routes/agents.d.ts.map +0 -1
  104. package/dist/routes/agents.js +0 -158
  105. package/dist/routes/chat.d.ts +0 -10
  106. package/dist/routes/chat.d.ts.map +0 -1
  107. package/dist/routes/chat.js +0 -307
  108. package/dist/routes/chatDataStream.d.ts +0 -10
  109. package/dist/routes/chatDataStream.d.ts.map +0 -1
  110. package/dist/routes/chatDataStream.js +0 -185
  111. package/dist/routes/mcp.d.ts +0 -10
  112. package/dist/routes/mcp.d.ts.map +0 -1
  113. package/dist/routes/mcp.js +0 -500
  114. package/dist/tracer.d.ts +0 -24
  115. package/dist/tracer.d.ts.map +0 -1
  116. package/dist/tracer.js +0 -107
  117. package/dist/types/chat.d.ts +0 -25
  118. package/dist/types/chat.d.ts.map +0 -1
  119. package/dist/types/chat.js +0 -1
  120. package/dist/types/execution-context.d.ts +0 -14
  121. package/dist/types/execution-context.d.ts.map +0 -1
  122. package/dist/types/execution-context.js +0 -14
  123. package/dist/utils/agent-operations.d.ts +0 -93
  124. package/dist/utils/agent-operations.d.ts.map +0 -1
  125. package/dist/utils/agent-operations.js +0 -78
  126. package/dist/utils/artifact-component-schema.d.ts +0 -29
  127. package/dist/utils/artifact-component-schema.d.ts.map +0 -1
  128. package/dist/utils/artifact-component-schema.js +0 -119
  129. package/dist/utils/artifact-parser.d.ts +0 -71
  130. package/dist/utils/artifact-parser.d.ts.map +0 -1
  131. package/dist/utils/artifact-parser.js +0 -253
  132. package/dist/utils/cleanup.d.ts +0 -19
  133. package/dist/utils/cleanup.d.ts.map +0 -1
  134. package/dist/utils/cleanup.js +0 -66
  135. package/dist/utils/data-component-schema.d.ts +0 -6
  136. package/dist/utils/data-component-schema.d.ts.map +0 -1
  137. package/dist/utils/data-component-schema.js +0 -43
  138. package/dist/utils/graph-session.d.ts +0 -230
  139. package/dist/utils/graph-session.d.ts.map +0 -1
  140. package/dist/utils/graph-session.js +0 -1199
  141. package/dist/utils/incremental-stream-parser.d.ts +0 -62
  142. package/dist/utils/incremental-stream-parser.d.ts.map +0 -1
  143. package/dist/utils/incremental-stream-parser.js +0 -330
  144. package/dist/utils/response-formatter.d.ts +0 -26
  145. package/dist/utils/response-formatter.d.ts.map +0 -1
  146. package/dist/utils/response-formatter.js +0 -158
  147. package/dist/utils/stream-helpers.d.ts +0 -186
  148. package/dist/utils/stream-helpers.d.ts.map +0 -1
  149. package/dist/utils/stream-helpers.js +0 -603
  150. package/dist/utils/stream-registry.d.ts +0 -18
  151. package/dist/utils/stream-registry.d.ts.map +0 -1
  152. package/dist/utils/stream-registry.js +0 -33
@@ -1,162 +0,0 @@
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
- let executionContext;
23
- if (authHeader?.startsWith('Bearer ')) {
24
- try {
25
- executionContext = await extractContextFromApiKey(authHeader.substring(7));
26
- logger.info({}, 'Development/test environment - API key authenticated successfully');
27
- }
28
- catch {
29
- // If API key extraction fails, fallback to default context
30
- executionContext = createExecutionContext({
31
- apiKey: 'development',
32
- tenantId: tenantId || 'test-tenant',
33
- projectId: projectId || 'test-project',
34
- graphId: graphId || 'test-graph',
35
- apiKeyId: 'test-key',
36
- baseUrl: baseUrl,
37
- agentId: agentId,
38
- });
39
- logger.info({}, 'Development/test environment - fallback to default context due to invalid API key');
40
- }
41
- }
42
- else {
43
- // No API key provided, use default context
44
- executionContext = createExecutionContext({
45
- apiKey: 'development',
46
- tenantId: tenantId || 'test-tenant',
47
- projectId: projectId || 'test-project',
48
- graphId: graphId || 'test-graph',
49
- apiKeyId: 'test-key',
50
- baseUrl: baseUrl,
51
- agentId: agentId,
52
- });
53
- logger.info({}, 'Development/test environment - no API key provided, using default context');
54
- }
55
- c.set('executionContext', executionContext);
56
- await next();
57
- return;
58
- }
59
- // Check for Bearer token
60
- if (!authHeader || !authHeader.startsWith('Bearer ')) {
61
- throw new HTTPException(401, {
62
- message: 'Missing or invalid authorization header. Expected: Bearer <api_key>',
63
- });
64
- }
65
- const apiKey = authHeader.substring(7); // Remove 'Bearer ' prefix
66
- // If bypass secret is configured, allow bypass authentication or api key validation
67
- if (env.INKEEP_AGENTS_RUN_BYPASS_SECRET) {
68
- if (apiKey === env.INKEEP_AGENTS_RUN_BYPASS_SECRET) {
69
- // Extract base URL from request
70
- if (!tenantId || !projectId || !graphId) {
71
- throw new HTTPException(401, {
72
- message: 'Missing or invalid tenant, project, or graph ID',
73
- });
74
- }
75
- // Create bypass execution context with default values
76
- const executionContext = createExecutionContext({
77
- apiKey: apiKey,
78
- tenantId: tenantId,
79
- projectId: projectId,
80
- graphId: graphId,
81
- apiKeyId: 'bypass',
82
- baseUrl: baseUrl,
83
- agentId: agentId,
84
- });
85
- c.set('executionContext', executionContext);
86
- logger.info({}, 'Bypass secret authenticated successfully');
87
- await next();
88
- return;
89
- }
90
- else if (apiKey) {
91
- const executionContext = await extractContextFromApiKey(apiKey);
92
- c.set('executionContext', executionContext);
93
- logger.info({}, 'API key authenticated successfully');
94
- await next();
95
- return;
96
- }
97
- else {
98
- // Bypass secret is set but token doesn't match - reject
99
- throw new HTTPException(401, {
100
- message: 'Invalid Token',
101
- });
102
- }
103
- }
104
- // No bypass secret configured - continue with normal API key validation
105
- // Validate API key format (basic validation)
106
- if (!apiKey || apiKey.length < 16) {
107
- throw new HTTPException(401, {
108
- message: 'Invalid API key format',
109
- });
110
- }
111
- try {
112
- const executionContext = await extractContextFromApiKey(apiKey);
113
- c.set('executionContext', executionContext);
114
- // Log successful authentication (without sensitive data)
115
- logger.debug({
116
- tenantId: executionContext.tenantId,
117
- projectId: executionContext.projectId,
118
- graphId: executionContext.graphId,
119
- }, 'API key authenticated successfully');
120
- await next();
121
- }
122
- catch (error) {
123
- // Re-throw HTTPException
124
- if (error instanceof HTTPException) {
125
- throw error;
126
- }
127
- // Log unexpected errors and return generic message
128
- logger.error({ error }, 'API key authentication error');
129
- throw new HTTPException(500, {
130
- message: 'Authentication failed',
131
- });
132
- }
133
- });
134
- export const extractContextFromApiKey = async (apiKey) => {
135
- const apiKeyRecord = await validateAndGetApiKey(apiKey, dbClient);
136
- if (!apiKeyRecord) {
137
- throw new HTTPException(401, {
138
- message: 'Invalid or expired API key',
139
- });
140
- }
141
- return createExecutionContext({
142
- apiKey: apiKey,
143
- tenantId: apiKeyRecord.tenantId,
144
- projectId: apiKeyRecord.projectId,
145
- graphId: apiKeyRecord.graphId,
146
- apiKeyId: apiKeyRecord.id,
147
- });
148
- };
149
- /**
150
- * Helper middleware for endpoints that optionally support API key authentication
151
- * If no auth header is present, it continues without setting the executionContext
152
- */
153
- export const optionalAuth = () => createMiddleware(async (c, next) => {
154
- const authHeader = c.req.header('Authorization');
155
- // If no auth header, continue without authentication
156
- if (!authHeader || !authHeader.startsWith('Bearer ')) {
157
- await next();
158
- return;
159
- }
160
- // If auth header exists, use the regular auth middleware
161
- return apiKeyAuth()(c, next);
162
- });
@@ -1,2 +0,0 @@
1
- export * from './api-key-auth';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/middleware/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
@@ -1 +0,0 @@
1
- export * from './api-key-auth';
package/dist/openapi.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export declare function setupOpenAPIRoutes(app: any): void;
2
- //# sourceMappingURL=openapi.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"openapi.d.ts","sourceRoot":"","sources":["../src/openapi.ts"],"names":[],"mappings":"AAIA,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,GAAG,QAsC1C"}
package/dist/openapi.js DELETED
@@ -1,36 +0,0 @@
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
- }
@@ -1,10 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,158 +0,0 @@
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;
@@ -1,10 +0,0 @@
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
@@ -1 +0,0 @@
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"}