@inkeep/agents-manage-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 (108) hide show
  1. package/dist/index.cjs +5075 -0
  2. package/dist/index.d.cts +15 -0
  3. package/dist/index.d.ts +13 -8
  4. package/dist/index.js +5044 -26
  5. package/package.json +3 -3
  6. package/dist/__tests__/setup.d.ts +0 -2
  7. package/dist/__tests__/setup.d.ts.map +0 -1
  8. package/dist/__tests__/setup.js +0 -26
  9. package/dist/__tests__/utils/testProject.d.ts +0 -18
  10. package/dist/__tests__/utils/testProject.d.ts.map +0 -1
  11. package/dist/__tests__/utils/testProject.js +0 -26
  12. package/dist/__tests__/utils/testRequest.d.ts +0 -2
  13. package/dist/__tests__/utils/testRequest.d.ts.map +0 -1
  14. package/dist/__tests__/utils/testRequest.js +0 -11
  15. package/dist/__tests__/utils/testTenant.d.ts +0 -64
  16. package/dist/__tests__/utils/testTenant.d.ts.map +0 -1
  17. package/dist/__tests__/utils/testTenant.js +0 -71
  18. package/dist/app.d.ts +0 -5
  19. package/dist/app.d.ts.map +0 -1
  20. package/dist/app.js +0 -151
  21. package/dist/data/conversations.d.ts +0 -59
  22. package/dist/data/conversations.d.ts.map +0 -1
  23. package/dist/data/conversations.js +0 -216
  24. package/dist/data/db/clean.d.ts +0 -6
  25. package/dist/data/db/clean.d.ts.map +0 -1
  26. package/dist/data/db/clean.js +0 -77
  27. package/dist/data/db/dbClient.d.ts +0 -3
  28. package/dist/data/db/dbClient.d.ts.map +0 -1
  29. package/dist/data/db/dbClient.js +0 -13
  30. package/dist/data/graphFull.d.ts +0 -11
  31. package/dist/data/graphFull.d.ts.map +0 -1
  32. package/dist/data/graphFull.js +0 -90
  33. package/dist/data/graphFullClient.d.ts +0 -22
  34. package/dist/data/graphFullClient.d.ts.map +0 -1
  35. package/dist/data/graphFullClient.js +0 -189
  36. package/dist/data/tools.d.ts +0 -82
  37. package/dist/data/tools.d.ts.map +0 -1
  38. package/dist/data/tools.js +0 -271
  39. package/dist/env.d.ts +0 -41
  40. package/dist/env.d.ts.map +0 -1
  41. package/dist/env.js +0 -59
  42. package/dist/index.d.ts.map +0 -1
  43. package/dist/logger.d.ts +0 -4
  44. package/dist/logger.d.ts.map +0 -1
  45. package/dist/logger.js +0 -32
  46. package/dist/middleware/auth.d.ts +0 -12
  47. package/dist/middleware/auth.d.ts.map +0 -1
  48. package/dist/middleware/auth.js +0 -36
  49. package/dist/openapi.d.ts +0 -2
  50. package/dist/openapi.d.ts.map +0 -1
  51. package/dist/openapi.js +0 -38
  52. package/dist/routes/agentArtifactComponents.d.ts +0 -4
  53. package/dist/routes/agentArtifactComponents.d.ts.map +0 -1
  54. package/dist/routes/agentArtifactComponents.js +0 -228
  55. package/dist/routes/agentDataComponents.d.ts +0 -4
  56. package/dist/routes/agentDataComponents.d.ts.map +0 -1
  57. package/dist/routes/agentDataComponents.js +0 -224
  58. package/dist/routes/agentGraph.d.ts +0 -4
  59. package/dist/routes/agentGraph.d.ts.map +0 -1
  60. package/dist/routes/agentGraph.js +0 -287
  61. package/dist/routes/agentRelations.d.ts +0 -4
  62. package/dist/routes/agentRelations.d.ts.map +0 -1
  63. package/dist/routes/agentRelations.js +0 -289
  64. package/dist/routes/agentToolRelations.d.ts +0 -4
  65. package/dist/routes/agentToolRelations.d.ts.map +0 -1
  66. package/dist/routes/agentToolRelations.js +0 -342
  67. package/dist/routes/agents.d.ts +0 -4
  68. package/dist/routes/agents.d.ts.map +0 -1
  69. package/dist/routes/agents.js +0 -212
  70. package/dist/routes/apiKeys.d.ts +0 -4
  71. package/dist/routes/apiKeys.d.ts.map +0 -1
  72. package/dist/routes/apiKeys.js +0 -235
  73. package/dist/routes/artifactComponents.d.ts +0 -4
  74. package/dist/routes/artifactComponents.d.ts.map +0 -1
  75. package/dist/routes/artifactComponents.js +0 -201
  76. package/dist/routes/contextConfigs.d.ts +0 -4
  77. package/dist/routes/contextConfigs.d.ts.map +0 -1
  78. package/dist/routes/contextConfigs.js +0 -180
  79. package/dist/routes/credentials.d.ts +0 -10
  80. package/dist/routes/credentials.d.ts.map +0 -1
  81. package/dist/routes/credentials.js +0 -218
  82. package/dist/routes/dataComponents.d.ts +0 -4
  83. package/dist/routes/dataComponents.d.ts.map +0 -1
  84. package/dist/routes/dataComponents.js +0 -187
  85. package/dist/routes/externalAgents.d.ts +0 -4
  86. package/dist/routes/externalAgents.d.ts.map +0 -1
  87. package/dist/routes/externalAgents.js +0 -215
  88. package/dist/routes/graphFull.d.ts +0 -4
  89. package/dist/routes/graphFull.d.ts.map +0 -1
  90. package/dist/routes/graphFull.js +0 -247
  91. package/dist/routes/index.d.ts +0 -4
  92. package/dist/routes/index.d.ts.map +0 -1
  93. package/dist/routes/index.js +0 -37
  94. package/dist/routes/oauth.d.ts +0 -21
  95. package/dist/routes/oauth.d.ts.map +0 -1
  96. package/dist/routes/oauth.js +0 -191
  97. package/dist/routes/projects.d.ts +0 -4
  98. package/dist/routes/projects.d.ts.map +0 -1
  99. package/dist/routes/projects.js +0 -220
  100. package/dist/routes/tools.d.ts +0 -11
  101. package/dist/routes/tools.d.ts.map +0 -1
  102. package/dist/routes/tools.js +0 -554
  103. package/dist/utils/auth-detection.d.ts +0 -22
  104. package/dist/utils/auth-detection.d.ts.map +0 -1
  105. package/dist/utils/auth-detection.js +0 -149
  106. package/dist/utils/oauth-service.d.ts +0 -88
  107. package/dist/utils/oauth-service.d.ts.map +0 -1
  108. package/dist/utils/oauth-service.js +0 -240
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkeep/agents-manage-api",
3
- "version": "0.0.0-dev-20250910233133",
3
+ "version": "0.0.0-dev-20250910233151",
4
4
  "description": "Management API for Inkeep Agent Framework - handles CRUD operations and OAuth",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -25,7 +25,7 @@
25
25
  "pino": "^9.7.0",
26
26
  "pino-pretty": "^13.0.0",
27
27
  "zod": "^4.1.5",
28
- "@inkeep/agents-core": "^0.0.0-dev-20250910233133"
28
+ "@inkeep/agents-core": "^0.0.0-dev-20250910233151"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@biomejs/biome": "2.1.4",
@@ -59,7 +59,7 @@
59
59
  },
60
60
  "scripts": {
61
61
  "dev": "vite",
62
- "build": "tsc",
62
+ "build": "tsup",
63
63
  "start": "node dist/server.js",
64
64
  "test": "vitest --run",
65
65
  "test:watch": "vitest",
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=setup.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../src/__tests__/setup.ts"],"names":[],"mappings":""}
@@ -1,26 +0,0 @@
1
- import { getLogger } from '@inkeep/agents-core';
2
- import { sql } from 'drizzle-orm';
3
- import { migrate } from 'drizzle-orm/libsql/migrator';
4
- import { afterAll, afterEach, beforeAll } from 'vitest';
5
- import dbClient from '../data/db/dbClient';
6
- // Initialize database schema for in-memory test databases using Drizzle migrations
7
- beforeAll(async () => {
8
- const logger = getLogger('Test Setup');
9
- try {
10
- logger.debug({}, 'Applying database migrations to in-memory test database');
11
- // Temporarily disable foreign key constraints for tests due to composite key issues
12
- await dbClient.run(sql `PRAGMA foreign_keys = OFF`);
13
- await migrate(dbClient, { migrationsFolder: '../packages/agents-core/drizzle' });
14
- logger.debug({}, 'Database migrations applied successfully');
15
- }
16
- catch (error) {
17
- logger.error({ error }, 'Failed to apply database migrations');
18
- throw error;
19
- }
20
- });
21
- afterEach(() => {
22
- // Any cleanup if needed
23
- });
24
- afterAll(() => {
25
- // Any final cleanup if needed
26
- });
@@ -1,18 +0,0 @@
1
- /**
2
- * Ensures a project exists for a given tenant ID.
3
- * This is needed because of foreign key constraints in the database.
4
- *
5
- * @param tenantId - The tenant ID
6
- * @param projectId - The project ID (defaults to 'default')
7
- * @returns Promise that resolves when the project is created
8
- */
9
- export declare function ensureTestProject(tenantId: string, projectId?: string): Promise<void>;
10
- /**
11
- * Creates multiple test projects for a tenant.
12
- *
13
- * @param tenantId - The tenant ID
14
- * @param projectIds - Array of project IDs to create
15
- * @returns Promise that resolves when all projects are created
16
- */
17
- export declare function ensureTestProjects(tenantId: string, projectIds: string[]): Promise<void>;
18
- //# sourceMappingURL=testProject.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"testProject.d.ts","sourceRoot":"","sources":["../../../src/__tests__/utils/testProject.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,wBAAsB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,SAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAK9F;AAED;;;;;;GAMG;AACH,wBAAsB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAE9F"}
@@ -1,26 +0,0 @@
1
- import { sql } from 'drizzle-orm';
2
- import dbClient from '../../data/db/dbClient';
3
- /**
4
- * Ensures a project exists for a given tenant ID.
5
- * This is needed because of foreign key constraints in the database.
6
- *
7
- * @param tenantId - The tenant ID
8
- * @param projectId - The project ID (defaults to 'default')
9
- * @returns Promise that resolves when the project is created
10
- */
11
- export async function ensureTestProject(tenantId, projectId = 'default') {
12
- await dbClient.run(sql `
13
- INSERT OR IGNORE INTO projects (tenant_id, id, name, description, created_at, updated_at)
14
- VALUES (${tenantId}, ${projectId}, ${`Test Project ${projectId}`}, ${`Test project for ${projectId}`}, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP)
15
- `);
16
- }
17
- /**
18
- * Creates multiple test projects for a tenant.
19
- *
20
- * @param tenantId - The tenant ID
21
- * @param projectIds - Array of project IDs to create
22
- * @returns Promise that resolves when all projects are created
23
- */
24
- export async function ensureTestProjects(tenantId, projectIds) {
25
- await Promise.all(projectIds.map((projectId) => ensureTestProject(tenantId, projectId)));
26
- }
@@ -1,2 +0,0 @@
1
- export declare const makeRequest: (url: string, options?: RequestInit) => Promise<Response>;
2
- //# sourceMappingURL=testRequest.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"testRequest.d.ts","sourceRoot":"","sources":["../../../src/__tests__/utils/testRequest.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,WAAW,GAAU,KAAK,MAAM,EAAE,UAAS,WAAgB,sBAQvE,CAAC"}
@@ -1,11 +0,0 @@
1
- import app from '../../index';
2
- // Helper function to make requests with JSON headers
3
- export const makeRequest = async (url, options = {}) => {
4
- return app.request(url, {
5
- ...options,
6
- headers: {
7
- 'Content-Type': 'application/json',
8
- ...options.headers,
9
- },
10
- });
11
- };
@@ -1,64 +0,0 @@
1
- /**
2
- * Creates a unique tenant ID for test isolation.
3
- *
4
- * Each test run gets its own tenant to ensure parallel tests don't interfere with each other.
5
- * The generated tenant ID follows the format: test-tenant-{prefix}-{uuid} or test-tenant-{uuid}
6
- *
7
- * @param prefix - Optional prefix to include in the tenant ID (e.g., test file name)
8
- * @returns A unique tenant ID for test isolation
9
- *
10
- * @example
11
- * ```typescript
12
- * import { createTestTenantId } from './utils/testTenant';
13
- *
14
- * describe('My test suite', () => {
15
- * const tenantId = createTestTenantId('agents');
16
- *
17
- * it('should work with isolated tenant', async () => {
18
- * // Your test code using the unique tenant ID
19
- * console.log(tenantId); // e.g., "test-tenant-agents-123e4567-e89b-12d3-a456-426614174000"
20
- * });
21
- * });
22
- * ```
23
- */
24
- export declare function createTestTenantId(prefix?: string): string;
25
- /**
26
- * Creates multiple unique tenant IDs for test isolation.
27
- *
28
- * Useful when you need multiple tenants in a single test.
29
- *
30
- * @param count - Number of tenant IDs to generate
31
- * @param prefix - Optional prefix to include in all tenant IDs
32
- * @returns Array of unique tenant IDs
33
- *
34
- * @example
35
- * ```typescript
36
- * import { createTestTenantIds } from './utils/testTenant';
37
- *
38
- * describe('Multi-tenant test suite', () => {
39
- * const [tenantA, tenantB] = createTestTenantIds(2, 'multi-tenant');
40
- *
41
- * it('should handle cross-tenant operations', async () => {
42
- * // Test operations across different tenants
43
- * });
44
- * });
45
- * ```
46
- */
47
- export declare function createTestTenantIds(count: number, prefix?: string): string[];
48
- /**
49
- * Checks if a tenant ID is a test tenant.
50
- *
51
- * @param tenantId - The tenant ID to check
52
- * @returns True if the tenant ID is a test tenant
53
- *
54
- * @example
55
- * ```typescript
56
- * import { isTestTenant } from './utils/testTenant';
57
- *
58
- * const tenantId = createTestTenantId();
59
- * console.log(isTestTenant(tenantId)); // true
60
- * console.log(isTestTenant('production-tenant')); // false
61
- * ```
62
- */
63
- export declare function isTestTenant(tenantId: string): boolean;
64
- //# sourceMappingURL=testTenant.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"testTenant.d.ts","sourceRoot":"","sources":["../../../src/__tests__/utils/testTenant.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAG1D;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAE5E;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAEtD"}
@@ -1,71 +0,0 @@
1
- import { randomUUID } from 'node:crypto';
2
- /**
3
- * Creates a unique tenant ID for test isolation.
4
- *
5
- * Each test run gets its own tenant to ensure parallel tests don't interfere with each other.
6
- * The generated tenant ID follows the format: test-tenant-{prefix}-{uuid} or test-tenant-{uuid}
7
- *
8
- * @param prefix - Optional prefix to include in the tenant ID (e.g., test file name)
9
- * @returns A unique tenant ID for test isolation
10
- *
11
- * @example
12
- * ```typescript
13
- * import { createTestTenantId } from './utils/testTenant';
14
- *
15
- * describe('My test suite', () => {
16
- * const tenantId = createTestTenantId('agents');
17
- *
18
- * it('should work with isolated tenant', async () => {
19
- * // Your test code using the unique tenant ID
20
- * console.log(tenantId); // e.g., "test-tenant-agents-123e4567-e89b-12d3-a456-426614174000"
21
- * });
22
- * });
23
- * ```
24
- */
25
- export function createTestTenantId(prefix) {
26
- const uuid = randomUUID();
27
- return prefix ? `test-tenant-${prefix}-${uuid}` : `test-tenant-${uuid}`;
28
- }
29
- /**
30
- * Creates multiple unique tenant IDs for test isolation.
31
- *
32
- * Useful when you need multiple tenants in a single test.
33
- *
34
- * @param count - Number of tenant IDs to generate
35
- * @param prefix - Optional prefix to include in all tenant IDs
36
- * @returns Array of unique tenant IDs
37
- *
38
- * @example
39
- * ```typescript
40
- * import { createTestTenantIds } from './utils/testTenant';
41
- *
42
- * describe('Multi-tenant test suite', () => {
43
- * const [tenantA, tenantB] = createTestTenantIds(2, 'multi-tenant');
44
- *
45
- * it('should handle cross-tenant operations', async () => {
46
- * // Test operations across different tenants
47
- * });
48
- * });
49
- * ```
50
- */
51
- export function createTestTenantIds(count, prefix) {
52
- return Array.from({ length: count }, () => createTestTenantId(prefix));
53
- }
54
- /**
55
- * Checks if a tenant ID is a test tenant.
56
- *
57
- * @param tenantId - The tenant ID to check
58
- * @returns True if the tenant ID is a test tenant
59
- *
60
- * @example
61
- * ```typescript
62
- * import { isTestTenant } from './utils/testTenant';
63
- *
64
- * const tenantId = createTestTenantId();
65
- * console.log(isTestTenant(tenantId)); // true
66
- * console.log(isTestTenant('production-tenant')); // false
67
- * ```
68
- */
69
- export function isTestTenant(tenantId) {
70
- return tenantId.startsWith('test-tenant-');
71
- }
package/dist/app.d.ts DELETED
@@ -1,5 +0,0 @@
1
- import { Hono } from 'hono';
2
- import type { CredentialStoreRegistry, ServerConfig } from '@inkeep/agents-core';
3
- declare function createManagementHono(serverConfig: ServerConfig, credentialStores: CredentialStoreRegistry): Hono<import("hono/types").BlankEnv, import("hono/types").BlankSchema, "/">;
4
- export { createManagementHono };
5
- //# sourceMappingURL=app.d.ts.map
package/dist/app.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,OAAO,KAAK,EAAE,uBAAuB,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAkBjF,iBAAS,oBAAoB,CAC3B,YAAY,EAAE,YAAY,EAC1B,gBAAgB,EAAE,uBAAuB,8EAqK1C;AAED,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
package/dist/app.js DELETED
@@ -1,151 +0,0 @@
1
- import { Hono } from 'hono';
2
- import { createRoute, OpenAPIHono } from '@hono/zod-openapi';
3
- import { handleApiError } from '@inkeep/agents-core';
4
- import { cors } from 'hono/cors';
5
- import { HTTPException } from 'hono/http-exception';
6
- import { requestId } from 'hono/request-id';
7
- import { pinoLogger } from 'hono-pino';
8
- import { getLogger } from './logger';
9
- import { apiKeyAuth } from './middleware/auth';
10
- import { setupOpenAPIRoutes } from './openapi';
11
- import crudRoutes from './routes/index';
12
- import oauthRoutes from './routes/oauth';
13
- function createManagementHono(serverConfig, credentialStores) {
14
- const app = new OpenAPIHono();
15
- // Request ID middleware
16
- app.use('*', requestId());
17
- // Server config and credential stores middleware
18
- app.use('*', async (c, next) => {
19
- c.set('serverConfig', serverConfig);
20
- c.set('credentialStores', credentialStores);
21
- return next();
22
- });
23
- // Logging middleware
24
- app.use(pinoLogger({
25
- pino: getLogger(),
26
- http: {
27
- onResLevel(c) {
28
- if (c.res.status >= 500) {
29
- return 'error';
30
- }
31
- return 'info';
32
- },
33
- },
34
- }));
35
- // Error handling
36
- app.onError(async (err, c) => {
37
- const isExpectedError = err instanceof HTTPException;
38
- const status = isExpectedError ? err.status : 500;
39
- const requestId = c.get('requestId') || 'unknown';
40
- // Zod validation error detection
41
- let zodIssues;
42
- if (err && typeof err === 'object') {
43
- if (err.cause && Array.isArray(err.cause.issues)) {
44
- zodIssues = err.cause.issues;
45
- }
46
- else if (Array.isArray(err.issues)) {
47
- zodIssues = err.issues;
48
- }
49
- }
50
- if (status === 400 && Array.isArray(zodIssues)) {
51
- c.status(400);
52
- c.header('Content-Type', 'application/problem+json');
53
- c.header('X-Content-Type-Options', 'nosniff');
54
- return c.json({
55
- type: 'https://docs.inkeep.com/agents-api/errors#bad_request',
56
- title: 'Validation Failed',
57
- status: 400,
58
- detail: 'Request validation failed',
59
- errors: zodIssues.map((issue) => ({
60
- detail: issue.message,
61
- pointer: issue.path ? `/${issue.path.join('/')}` : undefined,
62
- name: issue.path ? issue.path.join('.') : undefined,
63
- reason: issue.message,
64
- })),
65
- });
66
- }
67
- if (status >= 500) {
68
- if (!isExpectedError) {
69
- const errorMessage = err instanceof Error ? err.message : String(err);
70
- const errorStack = err instanceof Error ? err.stack : undefined;
71
- getLogger().error({
72
- error: err,
73
- message: errorMessage,
74
- stack: errorStack,
75
- path: c.req.path,
76
- requestId,
77
- }, 'Unexpected server error occurred');
78
- }
79
- else {
80
- getLogger().error({
81
- error: err,
82
- path: c.req.path,
83
- requestId,
84
- status,
85
- }, 'Server error occurred');
86
- }
87
- }
88
- if (isExpectedError) {
89
- try {
90
- const response = err.getResponse();
91
- return response;
92
- }
93
- catch (responseError) {
94
- getLogger().error({ error: responseError }, 'Error while handling HTTPException response');
95
- }
96
- }
97
- const { status: respStatus, title, detail, instance } = await handleApiError(err, requestId);
98
- c.status(respStatus);
99
- c.header('Content-Type', 'application/problem+json');
100
- c.header('X-Content-Type-Options', 'nosniff');
101
- return c.json({
102
- type: 'https://docs.inkeep.com/agents-api/errors#internal_server_error',
103
- title,
104
- status: respStatus,
105
- detail,
106
- ...(instance && { instance }),
107
- });
108
- });
109
- // CORS middleware
110
- app.use('*', cors({
111
- origin: (origin) => {
112
- if (!origin)
113
- return origin;
114
- return origin.startsWith('http://localhost:') || origin.startsWith('https://localhost:')
115
- ? origin
116
- : null;
117
- },
118
- allowMethods: ['GET', 'POST', 'PUT', 'DELETE', 'OPTIONS', 'PATCH'],
119
- allowHeaders: ['*'],
120
- exposeHeaders: ['Content-Length'],
121
- maxAge: 86400,
122
- credentials: true,
123
- }));
124
- // Health check endpoint
125
- app.openapi(createRoute({
126
- method: 'get',
127
- path: '/health',
128
- tags: ['health'],
129
- summary: 'Health check',
130
- description: 'Check if the management service is healthy',
131
- responses: {
132
- 204: {
133
- description: 'Service is healthy',
134
- },
135
- },
136
- }), (c) => {
137
- return c.body(null, 204);
138
- });
139
- // API Key authentication middleware for protected routes
140
- app.use('/tenants/*', apiKeyAuth());
141
- // Mount CRUD routes for all entities
142
- app.route('/tenants/:tenantId/crud', crudRoutes);
143
- // Mount OAuth routes - global OAuth callback endpoint
144
- app.route('/oauth', oauthRoutes);
145
- // Setup OpenAPI documentation endpoints (/openapi.json and /docs)
146
- setupOpenAPIRoutes(app);
147
- const baseApp = new Hono();
148
- baseApp.route('/', app);
149
- return baseApp;
150
- }
151
- export { createManagementHono };
@@ -1,59 +0,0 @@
1
- import { type AgentConversationHistoryConfig, type ConversationHistoryConfig, type ConversationScopeOptions } from '@inkeep/agents-core';
2
- /**
3
- * Creates default conversation history configuration
4
- * @param mode - The conversation history mode ('full' | 'scoped' | 'none')
5
- * @returns Default AgentConversationHistoryConfig
6
- */
7
- export declare function createDefaultConversationHistoryConfig(mode?: 'full' | 'scoped' | 'none'): AgentConversationHistoryConfig;
8
- /**
9
- * Saves the result of an A2A client sendMessage call as a conversation message
10
- * @param response - The response from a2aClient.sendMessage()
11
- * @param params - Parameters for saving the message
12
- * @returns The saved message or null if no text content was found
13
- */
14
- export declare function saveA2AMessageResponse(response: any, // SendMessageResponse type
15
- params: {
16
- tenantId: string;
17
- projectId: string;
18
- conversationId: string;
19
- messageType: 'a2a-response' | 'a2a-request';
20
- visibility: 'internal' | 'external' | 'user-facing';
21
- fromAgentId?: string;
22
- toAgentId?: string;
23
- fromExternalAgentId?: string;
24
- toExternalAgentId?: string;
25
- a2aTaskId?: string;
26
- a2aSessionId?: string;
27
- metadata?: Record<string, unknown>;
28
- }): Promise<any | null>;
29
- /**
30
- * Applies filtering based on agent, task, or both criteria
31
- * Returns the filtered messages array
32
- */
33
- export declare function getScopedHistory({ tenantId, projectId, conversationId, filters, options, }: {
34
- tenantId: string;
35
- projectId: string;
36
- conversationId: string;
37
- filters?: ConversationScopeOptions;
38
- options?: ConversationHistoryConfig;
39
- }): Promise<any[]>;
40
- /**
41
- * Get user-facing conversation history (for client display)
42
- */
43
- export declare function getUserFacingHistory(tenantId: string, projectId: string, conversationId: string, limit?: number): Promise<any[]>;
44
- /**
45
- * Get full conversation context (for agent processing)
46
- */
47
- export declare function getFullConversationContext(tenantId: string, projectId: string, conversationId: string, maxTokens?: number): Promise<any[]>;
48
- /**
49
- * Get formatted conversation history for a2a
50
- */
51
- export declare function getFormattedConversationHistory({ tenantId, projectId, conversationId, currentMessage, options, filters, }: {
52
- tenantId: string;
53
- projectId: string;
54
- conversationId: string;
55
- currentMessage?: string;
56
- options?: ConversationHistoryConfig;
57
- filters?: ConversationScopeOptions;
58
- }): Promise<string>;
59
- //# sourceMappingURL=conversations.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"conversations.d.ts","sourceRoot":"","sources":["../../src/data/conversations.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,8BAA8B,EACnC,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAG9B,MAAM,qBAAqB,CAAC;AAI7B;;;;GAIG;AACH,wBAAgB,sCAAsC,CACpD,IAAI,GAAE,MAAM,GAAG,QAAQ,GAAG,MAAe,GACxC,8BAA8B,CAQhC;AAYD;;;;;GAKG;AACH,wBAAsB,sBAAsB,CAC1C,QAAQ,EAAE,GAAG,EAAE,2BAA2B;AAC1C,MAAM,EAAE;IACN,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,cAAc,GAAG,aAAa,CAAC;IAC5C,UAAU,EAAE,UAAU,GAAG,UAAU,GAAG,aAAa,CAAC;IACpD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC,GACA,OAAO,CAAC,GAAG,GAAG,IAAI,CAAC,CAkDrB;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,CAAC,EACrC,QAAQ,EACR,SAAS,EACT,cAAc,EACd,OAAO,EACP,OAAO,GACR,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,wBAAwB,CAAC;IACnC,OAAO,CAAC,EAAE,yBAAyB,CAAC;CACrC,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAyDjB;AAED;;GAEG;AACH,wBAAsB,oBAAoB,CACxC,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,cAAc,EAAE,MAAM,EACtB,KAAK,SAAK,GACT,OAAO,CAAC,GAAG,EAAE,CAAC,CAUhB;AAED;;GAEG;AACH,wBAAsB,0BAA0B,CAC9C,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,cAAc,EAAE,MAAM,EACtB,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,GAAG,EAAE,CAAC,CAUhB;AAED;;GAEG;AACH,wBAAsB,+BAA+B,CAAC,EACpD,QAAQ,EACR,SAAS,EACT,cAAc,EACd,cAAc,EACd,OAAO,EACP,OAAO,GACR,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,yBAAyB,CAAC;IACpC,OAAO,CAAC,EAAE,wBAAwB,CAAC;CACpC,GAAG,OAAO,CAAC,MAAM,CAAC,CAuDlB"}