@inkeep/agents-api 0.0.0-dev-20260415131100 → 0.0.0-dev-20260415183758

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 (34) hide show
  1. package/dist/.well-known/workflow/v1/manifest.json +39 -39
  2. package/dist/createApp.d.ts +2 -2
  3. package/dist/data/db/manageDbClient.d.ts +2 -2
  4. package/dist/data/db/runDbClient.d.ts +2 -2
  5. package/dist/data-reconciliation/handlers/agent.d.ts +2 -2
  6. package/dist/data-reconciliation/handlers/sub-agents.d.ts +2 -2
  7. package/dist/data-reconciliation/handlers/tools.d.ts +2 -2
  8. package/dist/domains/evals/routes/index.d.ts +2 -2
  9. package/dist/domains/evals/workflow/routes.d.ts +2 -2
  10. package/dist/domains/manage/routes/authLookup.d.ts +2 -2
  11. package/dist/domains/manage/routes/availableAgents.d.ts +2 -2
  12. package/dist/domains/manage/routes/conversations.d.ts +2 -2
  13. package/dist/domains/manage/routes/feedback.d.ts +2 -2
  14. package/dist/domains/manage/routes/index.d.ts +2 -2
  15. package/dist/domains/manage/routes/invitations.d.ts +2 -2
  16. package/dist/domains/manage/routes/passwordResetLinks.d.ts +2 -2
  17. package/dist/domains/manage/routes/signoz.d.ts +2 -2
  18. package/dist/domains/manage/routes/users.d.ts +2 -2
  19. package/dist/domains/mcp/routes/mcp.d.ts +2 -2
  20. package/dist/domains/run/routes/auth.d.ts +2 -2
  21. package/dist/domains/run/types/chat.d.ts +3 -3
  22. package/dist/factory.d.ts +341 -341
  23. package/dist/index.d.ts +340 -340
  24. package/dist/middleware/branchScopedDb.js +37 -26
  25. package/dist/middleware/evalsAuth.d.ts +2 -2
  26. package/dist/middleware/manageAuth.d.ts +3 -3
  27. package/dist/middleware/projectConfig.d.ts +3 -3
  28. package/dist/middleware/requireEntitlement.d.ts +2 -2
  29. package/dist/middleware/requirePermission.d.ts +2 -2
  30. package/dist/middleware/runAuth.d.ts +4 -4
  31. package/dist/middleware/sessionAuth.d.ts +3 -3
  32. package/dist/middleware/tenantAccess.d.ts +2 -2
  33. package/dist/middleware/tracing.d.ts +3 -3
  34. package/package.json +5 -5
@@ -87,34 +87,45 @@ const branchScopedDbMiddleware = async (c, next) => {
87
87
  const status = c.res.status;
88
88
  const projectDeleteOperation = isProjectDeleteOperation(c.req.path, method);
89
89
  const operationSuccess = status >= 200 && status < 300;
90
- if (resolvedRef.type === "branch" && operationSuccess && !projectDeleteOperation && !isReadMethod) try {
91
- const statusResult = await doltStatus(requestDb)();
92
- if (statusResult.length > 0 && operationSuccess) {
93
- const path = c.req.path;
94
- const commitMessage = generateCommitMessage(method, path);
95
- logger.info({
90
+ if (resolvedRef.type === "branch" && operationSuccess && !projectDeleteOperation && !isReadMethod) {
91
+ const path = c.req.path;
92
+ const commitMessage = generateCommitMessage(method, path);
93
+ const commitAuthor = {
94
+ name: userId ?? "agents-api",
95
+ email: userEmail ?? "api@inkeep.com"
96
+ };
97
+ let committed = false;
98
+ for (let attempt = 1; attempt <= 2 && !committed; attempt++) try {
99
+ const statusResult = await doltStatus(requestDb)();
100
+ if (statusResult.length > 0 && operationSuccess) {
101
+ if (attempt === 1) logger.info({
102
+ branch: resolvedRef.name,
103
+ message: commitMessage
104
+ }, "Auto-committing changes");
105
+ await doltAddAndCommit(requestDb)({
106
+ message: commitMessage,
107
+ author: commitAuthor
108
+ });
109
+ logger.info({ branch: resolvedRef.name }, "Successfully committed changes");
110
+ committed = true;
111
+ } else if (statusResult.length > 0 && !operationSuccess) {
112
+ await doltReset(requestDb)();
113
+ logger.info({ branch: resolvedRef.name }, "Successfully reset changes due to failed operation");
114
+ committed = true;
115
+ } else committed = true;
116
+ } catch (error) {
117
+ if (attempt < 2) logger.warn({
118
+ error,
119
+ ...getDatabaseErrorLogContext(error),
96
120
  branch: resolvedRef.name,
97
- message: commitMessage
98
- }, "Auto-committing changes");
99
- await doltAddAndCommit(requestDb)({
100
- message: commitMessage,
101
- author: {
102
- name: userId ?? "agents-api",
103
- email: userEmail ?? "api@inkeep.com"
104
- }
105
- });
106
- logger.info({ branch: resolvedRef.name }, "Successfully committed changes");
107
- } else if (statusResult.length > 0 && !operationSuccess) {
108
- await doltReset(requestDb)();
109
- logger.info({ branch: resolvedRef.name }, "Successfully reset changes due to failed operation");
121
+ attempt
122
+ }, "Auto-commit attempt failed, retrying");
123
+ else logger.error({
124
+ error,
125
+ ...getDatabaseErrorLogContext(error),
126
+ branch: resolvedRef.name
127
+ }, "Auto-commit failed after retry - writes remain in branch working set for next checkout");
110
128
  }
111
- } catch (error) {
112
- logger.error({
113
- error,
114
- ...getDatabaseErrorLogContext(error),
115
- branch: resolvedRef.name
116
- }, "Failed to auto-commit changes — uncommitted writes will be lost on connection release");
117
- throw error;
118
129
  }
119
130
  } finally {
120
131
  const cleanupStart = Date.now();
@@ -1,5 +1,5 @@
1
1
  import { BaseExecutionContext } from "@inkeep/agents-core";
2
- import * as hono7 from "hono";
2
+ import * as hono13 from "hono";
3
3
 
4
4
  //#region src/middleware/evalsAuth.d.ts
5
5
 
@@ -7,7 +7,7 @@ import * as hono7 from "hono";
7
7
  * Middleware to authenticate API requests using Bearer token authentication
8
8
  * First checks if token matches INKEEP_AGENTS_EVAL_API_BYPASS_SECRET,
9
9
  */
10
- declare const evalApiKeyAuth: () => hono7.MiddlewareHandler<{
10
+ declare const evalApiKeyAuth: () => hono13.MiddlewareHandler<{
11
11
  Variables: {
12
12
  executionContext: BaseExecutionContext;
13
13
  };
@@ -1,5 +1,5 @@
1
1
  import { BaseExecutionContext } from "@inkeep/agents-core";
2
- import * as hono0 from "hono";
2
+ import * as hono14 from "hono";
3
3
  import { createAuth } from "@inkeep/agents-core/auth";
4
4
 
5
5
  //#region src/middleware/manageAuth.d.ts
@@ -17,7 +17,7 @@ import { createAuth } from "@inkeep/agents-core/auth";
17
17
  * EXCEPT for the legacy exception on GET /manage/tenants/:t/projects/:p/conversations/:id
18
18
  * (see isLegacyApiKeyAllowedRoute). API keys are otherwise restricted to the run domain only.
19
19
  */
20
- declare const manageBearerAuth: () => hono0.MiddlewareHandler<{
20
+ declare const manageBearerAuth: () => hono14.MiddlewareHandler<{
21
21
  Variables: {
22
22
  executionContext: BaseExecutionContext;
23
23
  userId?: string;
@@ -31,6 +31,6 @@ declare const manageBearerAuth: () => hono0.MiddlewareHandler<{
31
31
  * Uses Bearer token → manage bearer auth (bypass secret, session, Slack JWT, internal service),
32
32
  * otherwise falls back to session auth.
33
33
  */
34
- declare const manageBearerOrSessionAuth: () => hono0.MiddlewareHandler<any, string, {}, Response>;
34
+ declare const manageBearerOrSessionAuth: () => hono14.MiddlewareHandler<any, string, {}, Response>;
35
35
  //#endregion
36
36
  export { manageBearerAuth, manageBearerOrSessionAuth };
@@ -1,11 +1,11 @@
1
1
  import { BaseExecutionContext, ResolvedRef } from "@inkeep/agents-core";
2
- import * as hono5 from "hono";
2
+ import * as hono6 from "hono";
3
3
 
4
4
  //#region src/middleware/projectConfig.d.ts
5
5
  /**
6
6
  * Middleware that fetches the full project definition from the Management API
7
7
  */
8
- declare const projectConfigMiddleware: hono5.MiddlewareHandler<{
8
+ declare const projectConfigMiddleware: hono6.MiddlewareHandler<{
9
9
  Variables: {
10
10
  executionContext: BaseExecutionContext;
11
11
  resolvedRef: ResolvedRef;
@@ -15,7 +15,7 @@ declare const projectConfigMiddleware: hono5.MiddlewareHandler<{
15
15
  * Creates a middleware that applies project config fetching except for specified route patterns
16
16
  * @param skipRouteCheck - Function that returns true if the route should skip the middleware
17
17
  */
18
- declare const projectConfigMiddlewareExcept: (skipRouteCheck: (path: string) => boolean) => hono5.MiddlewareHandler<{
18
+ declare const projectConfigMiddlewareExcept: (skipRouteCheck: (path: string) => boolean) => hono6.MiddlewareHandler<{
19
19
  Variables: {
20
20
  executionContext: BaseExecutionContext;
21
21
  resolvedRef: ResolvedRef;
@@ -1,5 +1,5 @@
1
1
  import { ManageAppVariables } from "../types/app.js";
2
- import * as hono18 from "hono";
2
+ import * as hono8 from "hono";
3
3
 
4
4
  //#region src/middleware/requireEntitlement.d.ts
5
5
  type EntitlementConfig = {
@@ -11,6 +11,6 @@ declare const requireEntitlement: <Env$1 extends {
11
11
  Variables: ManageAppVariables;
12
12
  } = {
13
13
  Variables: ManageAppVariables;
14
- }>(config: EntitlementConfig) => hono18.MiddlewareHandler<Env$1, string, {}, Response>;
14
+ }>(config: EntitlementConfig) => hono8.MiddlewareHandler<Env$1, string, {}, Response>;
15
15
  //#endregion
16
16
  export { requireEntitlement };
@@ -1,5 +1,5 @@
1
1
  import { ManageAppVariables } from "../types/app.js";
2
- import * as hono8 from "hono";
2
+ import * as hono9 from "hono";
3
3
 
4
4
  //#region src/middleware/requirePermission.d.ts
5
5
  type Permission = {
@@ -9,6 +9,6 @@ declare const requirePermission: <Env$1 extends {
9
9
  Variables: ManageAppVariables;
10
10
  } = {
11
11
  Variables: ManageAppVariables;
12
- }>(permissions: Permission) => hono8.MiddlewareHandler<Env$1, string, {}, Response>;
12
+ }>(permissions: Permission) => hono9.MiddlewareHandler<Env$1, string, {}, Response>;
13
13
  //#endregion
14
14
  export { requirePermission };
@@ -1,8 +1,8 @@
1
1
  import { BaseExecutionContext } from "@inkeep/agents-core";
2
- import * as hono2 from "hono";
2
+ import * as hono0 from "hono";
3
3
 
4
4
  //#region src/middleware/runAuth.d.ts
5
- declare const runApiKeyAuth: () => hono2.MiddlewareHandler<{
5
+ declare const runApiKeyAuth: () => hono0.MiddlewareHandler<{
6
6
  Variables: {
7
7
  executionContext: BaseExecutionContext;
8
8
  };
@@ -11,7 +11,7 @@ declare const runApiKeyAuth: () => hono2.MiddlewareHandler<{
11
11
  * Creates a middleware that applies API key authentication except for specified route patterns
12
12
  * @param skipRouteCheck - Function that returns true if the route should skip authentication
13
13
  */
14
- declare const runApiKeyAuthExcept: (skipRouteCheck: (path: string) => boolean) => hono2.MiddlewareHandler<{
14
+ declare const runApiKeyAuthExcept: (skipRouteCheck: (path: string) => boolean) => hono0.MiddlewareHandler<{
15
15
  Variables: {
16
16
  executionContext: BaseExecutionContext;
17
17
  };
@@ -20,7 +20,7 @@ declare const runApiKeyAuthExcept: (skipRouteCheck: (path: string) => boolean) =
20
20
  * Helper middleware for endpoints that optionally support API key authentication
21
21
  * If no auth header is present, it continues without setting the executionContext
22
22
  */
23
- declare const runOptionalAuth: () => hono2.MiddlewareHandler<{
23
+ declare const runOptionalAuth: () => hono0.MiddlewareHandler<{
24
24
  Variables: {
25
25
  executionContext?: BaseExecutionContext;
26
26
  };
@@ -1,5 +1,5 @@
1
1
  import { AppVariables } from "../types/app.js";
2
- import * as hono19 from "hono";
2
+ import * as hono2 from "hono";
3
3
 
4
4
  //#region src/middleware/sessionAuth.d.ts
5
5
 
@@ -8,12 +8,12 @@ import * as hono19 from "hono";
8
8
  * Requires that a user has already been authenticated via Better Auth session.
9
9
  * Used primarily for manage routes that require an active user session.
10
10
  */
11
- declare const sessionAuth: () => hono19.MiddlewareHandler<any, string, {}, Response>;
11
+ declare const sessionAuth: () => hono2.MiddlewareHandler<any, string, {}, Response>;
12
12
  /**
13
13
  * Global session middleware - sets user and session in context for all routes
14
14
  * Used for all routes that require an active user session.
15
15
  */
16
- declare const sessionContext: () => hono19.MiddlewareHandler<{
16
+ declare const sessionContext: () => hono2.MiddlewareHandler<{
17
17
  Variables: AppVariables;
18
18
  }, string, {}, Response>;
19
19
  //#endregion
@@ -1,4 +1,4 @@
1
- import * as hono9 from "hono";
1
+ import * as hono11 from "hono";
2
2
 
3
3
  //#region src/middleware/tenantAccess.d.ts
4
4
 
@@ -12,7 +12,7 @@ import * as hono9 from "hono";
12
12
  * - API key user: Access only to the tenant associated with the API key
13
13
  * - Session user: Access based on organization membership
14
14
  */
15
- declare const requireTenantAccess: () => hono9.MiddlewareHandler<{
15
+ declare const requireTenantAccess: () => hono11.MiddlewareHandler<{
16
16
  Variables: {
17
17
  userId: string;
18
18
  tenantId: string;
@@ -1,7 +1,7 @@
1
- import * as hono10 from "hono";
1
+ import * as hono4 from "hono";
2
2
 
3
3
  //#region src/middleware/tracing.d.ts
4
- declare const otelBaggageMiddleware: () => hono10.MiddlewareHandler<any, string, {}, Response>;
5
- declare const executionBaggageMiddleware: () => hono10.MiddlewareHandler<any, string, {}, Response>;
4
+ declare const otelBaggageMiddleware: () => hono4.MiddlewareHandler<any, string, {}, Response>;
5
+ declare const executionBaggageMiddleware: () => hono4.MiddlewareHandler<any, string, {}, Response>;
6
6
  //#endregion
7
7
  export { executionBaggageMiddleware, otelBaggageMiddleware };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkeep/agents-api",
3
- "version": "0.0.0-dev-20260415131100",
3
+ "version": "0.0.0-dev-20260415183758",
4
4
  "description": "Unified Inkeep Agents API - combines management, runtime, and evaluation capabilities",
5
5
  "types": "dist/index.d.ts",
6
6
  "exports": {
@@ -74,10 +74,10 @@
74
74
  "pg": "^8.16.3",
75
75
  "undici": "^7.22.0",
76
76
  "workflow": "4.2.0-beta.67",
77
- "@inkeep/agents-core": "^0.0.0-dev-20260415131100",
78
- "@inkeep/agents-email": "^0.0.0-dev-20260415131100",
79
- "@inkeep/agents-mcp": "^0.0.0-dev-20260415131100",
80
- "@inkeep/agents-work-apps": "^0.0.0-dev-20260415131100"
77
+ "@inkeep/agents-core": "^0.0.0-dev-20260415183758",
78
+ "@inkeep/agents-email": "^0.0.0-dev-20260415183758",
79
+ "@inkeep/agents-mcp": "^0.0.0-dev-20260415183758",
80
+ "@inkeep/agents-work-apps": "^0.0.0-dev-20260415183758"
81
81
  },
82
82
  "peerDependencies": {
83
83
  "@hono/zod-openapi": "^1.1.5",