@inkeep/agents-api 0.42.0 → 0.44.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.
Files changed (138) hide show
  1. package/dist/.well-known/workflow/v1/manifest.debug.json +6 -6
  2. package/dist/.well-known/workflow/v1/step.cjs +220467 -203416
  3. package/dist/_virtual/rolldown_runtime.js +7 -0
  4. package/dist/createApp.js +47 -17
  5. package/dist/domains/evals/api/.well-known/workflow/v1/flow.d.ts +4 -0
  6. package/dist/domains/evals/api/.well-known/workflow/v1/flow.js +12 -0
  7. package/dist/domains/evals/api/.well-known/workflow/v1/step.d.ts +4 -0
  8. package/dist/domains/evals/api/.well-known/workflow/v1/step.js +12 -0
  9. package/dist/domains/evals/routes/datasetTriggers.d.ts +2 -2
  10. package/dist/domains/evals/routes/index.d.ts +2 -2
  11. package/dist/domains/evals/scripts/build-workflow.js +2 -2
  12. package/dist/domains/evals/workflow/world.js +3 -2
  13. package/dist/domains/manage/index.js +6 -2
  14. package/dist/domains/manage/routes/agent.js +7 -4
  15. package/dist/domains/manage/routes/agentFull.js +9 -6
  16. package/dist/domains/manage/routes/apiKeys.js +1 -2
  17. package/dist/domains/manage/routes/artifactComponents.js +5 -5
  18. package/dist/domains/manage/routes/cliAuth.js +3 -3
  19. package/dist/domains/manage/routes/contextConfigs.js +5 -5
  20. package/dist/domains/manage/routes/conversations.d.ts +2 -2
  21. package/dist/domains/manage/routes/credentialStores.js +2 -2
  22. package/dist/domains/manage/routes/credentials.js +6 -7
  23. package/dist/domains/manage/routes/dataComponents.js +6 -7
  24. package/dist/domains/manage/routes/externalAgents.js +1 -2
  25. package/dist/domains/manage/routes/github.d.ts +16 -0
  26. package/dist/domains/manage/routes/github.js +511 -0
  27. package/dist/domains/manage/routes/index.d.ts +2 -2
  28. package/dist/domains/manage/routes/index.js +4 -0
  29. package/dist/domains/manage/routes/invitations.js +1 -1
  30. package/dist/domains/manage/routes/mcp.d.ts +2 -2
  31. package/dist/domains/manage/routes/{agentToolRelations.d.ts → mcpToolGithubAccess.d.ts} +1 -1
  32. package/dist/domains/manage/routes/mcpToolGithubAccess.js +205 -0
  33. package/dist/domains/manage/routes/playgroundToken.js +1 -2
  34. package/dist/domains/manage/routes/projectFull.js +33 -11
  35. package/dist/domains/manage/routes/projectGithubAccess.d.ts +9 -0
  36. package/dist/domains/manage/routes/projectGithubAccess.js +167 -0
  37. package/dist/domains/manage/routes/projectMembers.js +12 -44
  38. package/dist/domains/manage/routes/projectPermissions.js +11 -11
  39. package/dist/domains/manage/routes/projects.js +15 -18
  40. package/dist/domains/manage/routes/signoz.d.ts +2 -2
  41. package/dist/domains/manage/routes/signoz.js +7 -4
  42. package/dist/domains/manage/routes/subAgentArtifactComponents.js +5 -5
  43. package/dist/domains/manage/routes/subAgentDataComponents.js +5 -5
  44. package/dist/domains/manage/routes/subAgentExternalAgentRelations.js +5 -5
  45. package/dist/domains/manage/routes/subAgentFunctionTools.js +5 -5
  46. package/dist/domains/manage/routes/subAgentRelations.js +6 -6
  47. package/dist/domains/manage/routes/subAgentTeamAgentRelations.js +6 -6
  48. package/dist/domains/manage/routes/subAgentToolRelations.js +6 -6
  49. package/dist/domains/manage/routes/subAgents.js +5 -5
  50. package/dist/domains/manage/routes/tools.js +28 -5
  51. package/dist/domains/manage/routes/triggers.js +49 -24
  52. package/dist/domains/manage/routes/userOrganizations.js +4 -4
  53. package/dist/domains/manage/routes/userProjectMemberships.d.ts +9 -0
  54. package/dist/domains/manage/routes/userProjectMemberships.js +44 -0
  55. package/dist/domains/mcp/routes/mcp.d.ts +7 -0
  56. package/dist/domains/mcp/routes/mcp.js +45 -0
  57. package/dist/domains/run/agents/Agent.d.ts +1 -0
  58. package/dist/domains/run/agents/Agent.js +235 -45
  59. package/dist/domains/run/agents/relationTools.d.ts +2 -2
  60. package/dist/domains/run/constants/execution-limits/defaults.d.ts +1 -1
  61. package/dist/domains/run/constants/execution-limits/defaults.js +1 -1
  62. package/dist/domains/run/constants/execution-limits/index.d.ts +1 -1
  63. package/dist/domains/run/context/ContextFetcher.js +8 -7
  64. package/dist/domains/run/context/validation.d.ts +1 -1
  65. package/dist/domains/run/handlers/executionHandler.js +143 -79
  66. package/dist/domains/run/routes/agents.js +1 -1
  67. package/dist/domains/run/routes/chat.js +47 -1
  68. package/dist/domains/run/routes/chatDataStream.js +107 -14
  69. package/dist/domains/run/routes/webhooks.js +40 -348
  70. package/dist/domains/run/services/AgentSession.d.ts +3 -0
  71. package/dist/domains/run/services/AgentSession.js +14 -1
  72. package/dist/domains/run/services/ToolApprovalUiBus.d.ts +28 -0
  73. package/dist/domains/run/services/ToolApprovalUiBus.js +44 -0
  74. package/dist/domains/run/services/TriggerService.d.ts +31 -0
  75. package/dist/domains/run/services/TriggerService.js +545 -0
  76. package/dist/domains/run/tools/NativeSandboxExecutor.d.ts +3 -2
  77. package/dist/domains/run/tools/NativeSandboxExecutor.js +76 -48
  78. package/dist/domains/run/tools/SandboxExecutorFactory.d.ts +11 -1
  79. package/dist/domains/run/tools/SandboxExecutorFactory.js +27 -3
  80. package/dist/domains/run/tools/VercelSandboxExecutor.d.ts +3 -11
  81. package/dist/domains/run/tools/VercelSandboxExecutor.js +137 -127
  82. package/dist/domains/run/tools/sandbox-utils.js +1 -1
  83. package/dist/domains/run/types/executionContext.js +3 -1
  84. package/dist/domains/run/utils/stream-helpers.d.ts +134 -0
  85. package/dist/domains/run/utils/stream-helpers.js +182 -0
  86. package/dist/domains/run/utils/token-estimator.d.ts +2 -2
  87. package/dist/env.d.ts +12 -2
  88. package/dist/env.js +37 -32
  89. package/dist/factory.d.ts +31 -31
  90. package/dist/factory.js +4 -10
  91. package/dist/index.d.ts +30 -29
  92. package/dist/index.js +3 -5
  93. package/dist/middleware/branchScopedDb.d.ts +1 -1
  94. package/dist/middleware/cors.js +1 -1
  95. package/dist/middleware/evalsAuth.d.ts +2 -2
  96. package/dist/middleware/manageAuth.d.ts +2 -2
  97. package/dist/middleware/projectAccess.d.ts +4 -20
  98. package/dist/middleware/projectAccess.js +7 -49
  99. package/dist/middleware/projectConfig.d.ts +3 -3
  100. package/dist/middleware/ref.d.ts +1 -1
  101. package/dist/middleware/requirePermission.d.ts +2 -2
  102. package/dist/middleware/requirePermission.js +1 -2
  103. package/dist/middleware/runAuth.d.ts +4 -4
  104. package/dist/middleware/sessionAuth.d.ts +3 -3
  105. package/dist/middleware/sessionAuth.js +1 -2
  106. package/dist/middleware/tenantAccess.d.ts +2 -2
  107. package/dist/middleware/tenantAccess.js +4 -4
  108. package/dist/middleware/tracing.d.ts +3 -3
  109. package/dist/openapi.d.ts +36 -1
  110. package/dist/openapi.js +40 -95
  111. package/dist/routes/healthChecks.d.ts +10 -0
  112. package/dist/routes/healthChecks.js +75 -0
  113. package/dist/types/app.d.ts +2 -0
  114. package/dist/types/runExecutionContext.js +3 -1
  115. package/dist/utils/healthChecks.d.ts +8 -0
  116. package/dist/utils/healthChecks.js +38 -0
  117. package/dist/utils/signozHelpers.d.ts +2 -2
  118. package/dist/utils/signozHelpers.js +15 -3
  119. package/package.json +8 -9
  120. package/dist/domains/evals/services/startEvaluation.d.ts +0 -19
  121. package/dist/domains/evals/services/startEvaluation.js +0 -18
  122. package/dist/domains/index.d.ts +0 -4
  123. package/dist/domains/index.js +0 -5
  124. package/dist/domains/manage/routes/agentToolRelations.js +0 -289
  125. package/dist/domains/run/agents/ModelFactory.d.ts +0 -63
  126. package/dist/domains/run/agents/ModelFactory.js +0 -194
  127. package/dist/domains/run/data/agent.d.ts +0 -7
  128. package/dist/domains/run/data/agent.js +0 -67
  129. package/dist/domains/run/services/evaluationRunConfigMatcher.d.ts +0 -4
  130. package/dist/domains/run/services/evaluationRunConfigMatcher.js +0 -7
  131. package/dist/domains/run/utils/cleanup.d.ts +0 -21
  132. package/dist/domains/run/utils/cleanup.js +0 -59
  133. package/dist/initialization.d.ts +0 -6
  134. package/dist/initialization.js +0 -65
  135. package/dist/utils/tempApiKeys.d.ts +0 -17
  136. package/dist/utils/tempApiKeys.js +0 -26
  137. package/dist/utils/workflowApiHelpers.d.ts +0 -1
  138. package/dist/utils/workflowApiHelpers.js +0 -1
package/dist/index.d.ts CHANGED
@@ -3,7 +3,6 @@ import "./types/index.js";
3
3
  import { createAgentsHono } from "./createApp.js";
4
4
  import { NativeSandboxConfig, SandboxConfig, VercelSandboxConfig } from "./domains/run/types/executionContext.js";
5
5
  import "./env.js";
6
- import { initializeDefaultUser } from "./initialization.js";
7
6
  import { createAuth0Provider, createOIDCProvider } from "./ssoHelpers.js";
8
7
  import { SSOProviderConfig, UserAuthConfig, createAgentsApp } from "./factory.js";
9
8
  import { Hono } from "hono";
@@ -123,11 +122,11 @@ declare const auth: better_auth78.Auth<{
123
122
  useSecureCookies?: boolean | undefined;
124
123
  disableCSRFCheck?: boolean | undefined;
125
124
  disableOriginCheck?: boolean | undefined;
126
- crossSubDomainCookies: {
125
+ crossSubDomainCookies?: {
127
126
  enabled: boolean;
128
127
  additionalCookies?: string[];
129
128
  domain?: string;
130
- };
129
+ } | undefined;
131
130
  cookies?: {
132
131
  [key: string]: {
133
132
  name?: string;
@@ -796,27 +795,28 @@ declare const auth: better_auth78.Auth<{
796
795
  ac: better_auth_plugins69.AccessControl;
797
796
  roles: {
798
797
  member: {
799
- authorize<K_1 extends "organization" | "ac" | "member" | "project" | "team" | "invitation">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins69.Subset<"organization" | "ac" | "member" | "project" | "team" | "invitation", better_auth_plugins69.Statements>[key] | {
800
- actions: better_auth_plugins69.Subset<"organization" | "ac" | "member" | "project" | "team" | "invitation", better_auth_plugins69.Statements>[key];
798
+ authorize<K_1 extends "organization" | "member" | "invitation" | "ac" | "project" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins69.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins69.Statements>[key] | {
799
+ actions: better_auth_plugins69.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins69.Statements>[key];
801
800
  connector: "OR" | "AND";
802
801
  } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins69.AuthorizeResponse;
803
- statements: better_auth_plugins69.Subset<"organization" | "ac" | "member" | "project" | "team" | "invitation", better_auth_plugins69.Statements>;
802
+ statements: better_auth_plugins69.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins69.Statements>;
804
803
  };
805
804
  admin: {
806
- authorize<K_1 extends "organization" | "ac" | "member" | "project" | "team" | "invitation">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins69.Subset<"organization" | "ac" | "member" | "project" | "team" | "invitation", better_auth_plugins69.Statements>[key] | {
807
- actions: better_auth_plugins69.Subset<"organization" | "ac" | "member" | "project" | "team" | "invitation", better_auth_plugins69.Statements>[key];
805
+ authorize<K_1 extends "organization" | "member" | "invitation" | "ac" | "project" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins69.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins69.Statements>[key] | {
806
+ actions: better_auth_plugins69.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins69.Statements>[key];
808
807
  connector: "OR" | "AND";
809
808
  } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins69.AuthorizeResponse;
810
- statements: better_auth_plugins69.Subset<"organization" | "ac" | "member" | "project" | "team" | "invitation", better_auth_plugins69.Statements>;
809
+ statements: better_auth_plugins69.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins69.Statements>;
811
810
  };
812
811
  owner: {
813
- authorize<K_1 extends "organization" | "ac" | "member" | "project" | "team" | "invitation">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins69.Subset<"organization" | "ac" | "member" | "project" | "team" | "invitation", better_auth_plugins69.Statements>[key] | {
814
- actions: better_auth_plugins69.Subset<"organization" | "ac" | "member" | "project" | "team" | "invitation", better_auth_plugins69.Statements>[key];
812
+ authorize<K_1 extends "organization" | "member" | "invitation" | "ac" | "project" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins69.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins69.Statements>[key] | {
813
+ actions: better_auth_plugins69.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins69.Statements>[key];
815
814
  connector: "OR" | "AND";
816
815
  } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins69.AuthorizeResponse;
817
- statements: better_auth_plugins69.Subset<"organization" | "ac" | "member" | "project" | "team" | "invitation", better_auth_plugins69.Statements>;
816
+ statements: better_auth_plugins69.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins69.Statements>;
818
817
  };
819
818
  };
819
+ creatorRole: "admin";
820
820
  membershipLimit: number;
821
821
  invitationLimit: number;
822
822
  invitationExpiresIn: number;
@@ -841,13 +841,13 @@ declare const auth: better_auth78.Auth<{
841
841
  user: better_auth78.User & Record<string, any>;
842
842
  organization: better_auth_plugins69.Organization & Record<string, any>;
843
843
  }) => Promise<void>;
844
- afterUpdateMemberRole: ({
844
+ beforeUpdateMemberRole: ({
845
845
  member,
846
846
  organization: org,
847
- previousRole
847
+ newRole
848
848
  }: {
849
849
  member: better_auth_plugins69.Member & Record<string, any>;
850
- previousRole: string;
850
+ newRole: string;
851
851
  user: better_auth78.User & Record<string, any>;
852
852
  organization: better_auth_plugins69.Organization & Record<string, any>;
853
853
  }) => Promise<void>;
@@ -1105,27 +1105,28 @@ declare const auth: better_auth78.Auth<{
1105
1105
  ac: better_auth_plugins69.AccessControl;
1106
1106
  roles: {
1107
1107
  member: {
1108
- authorize<K_1 extends "organization" | "ac" | "member" | "project" | "team" | "invitation">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins69.Subset<"organization" | "ac" | "member" | "project" | "team" | "invitation", better_auth_plugins69.Statements>[key] | {
1109
- actions: better_auth_plugins69.Subset<"organization" | "ac" | "member" | "project" | "team" | "invitation", better_auth_plugins69.Statements>[key];
1108
+ authorize<K_1 extends "organization" | "member" | "invitation" | "ac" | "project" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins69.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins69.Statements>[key] | {
1109
+ actions: better_auth_plugins69.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins69.Statements>[key];
1110
1110
  connector: "OR" | "AND";
1111
1111
  } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins69.AuthorizeResponse;
1112
- statements: better_auth_plugins69.Subset<"organization" | "ac" | "member" | "project" | "team" | "invitation", better_auth_plugins69.Statements>;
1112
+ statements: better_auth_plugins69.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins69.Statements>;
1113
1113
  };
1114
1114
  admin: {
1115
- authorize<K_1 extends "organization" | "ac" | "member" | "project" | "team" | "invitation">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins69.Subset<"organization" | "ac" | "member" | "project" | "team" | "invitation", better_auth_plugins69.Statements>[key] | {
1116
- actions: better_auth_plugins69.Subset<"organization" | "ac" | "member" | "project" | "team" | "invitation", better_auth_plugins69.Statements>[key];
1115
+ authorize<K_1 extends "organization" | "member" | "invitation" | "ac" | "project" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins69.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins69.Statements>[key] | {
1116
+ actions: better_auth_plugins69.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins69.Statements>[key];
1117
1117
  connector: "OR" | "AND";
1118
1118
  } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins69.AuthorizeResponse;
1119
- statements: better_auth_plugins69.Subset<"organization" | "ac" | "member" | "project" | "team" | "invitation", better_auth_plugins69.Statements>;
1119
+ statements: better_auth_plugins69.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins69.Statements>;
1120
1120
  };
1121
1121
  owner: {
1122
- authorize<K_1 extends "organization" | "ac" | "member" | "project" | "team" | "invitation">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins69.Subset<"organization" | "ac" | "member" | "project" | "team" | "invitation", better_auth_plugins69.Statements>[key] | {
1123
- actions: better_auth_plugins69.Subset<"organization" | "ac" | "member" | "project" | "team" | "invitation", better_auth_plugins69.Statements>[key];
1122
+ authorize<K_1 extends "organization" | "member" | "invitation" | "ac" | "project" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins69.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins69.Statements>[key] | {
1123
+ actions: better_auth_plugins69.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins69.Statements>[key];
1124
1124
  connector: "OR" | "AND";
1125
1125
  } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins69.AuthorizeResponse;
1126
- statements: better_auth_plugins69.Subset<"organization" | "ac" | "member" | "project" | "team" | "invitation", better_auth_plugins69.Statements>;
1126
+ statements: better_auth_plugins69.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins69.Statements>;
1127
1127
  };
1128
1128
  };
1129
+ creatorRole: "admin";
1129
1130
  membershipLimit: number;
1130
1131
  invitationLimit: number;
1131
1132
  invitationExpiresIn: number;
@@ -1150,13 +1151,13 @@ declare const auth: better_auth78.Auth<{
1150
1151
  user: better_auth78.User & Record<string, any>;
1151
1152
  organization: better_auth_plugins69.Organization & Record<string, any>;
1152
1153
  }) => Promise<void>;
1153
- afterUpdateMemberRole: ({
1154
+ beforeUpdateMemberRole: ({
1154
1155
  member,
1155
1156
  organization: org,
1156
- previousRole
1157
+ newRole
1157
1158
  }: {
1158
1159
  member: better_auth_plugins69.Member & Record<string, any>;
1159
- previousRole: string;
1160
+ newRole: string;
1160
1161
  user: better_auth78.User & Record<string, any>;
1161
1162
  organization: better_auth_plugins69.Organization & Record<string, any>;
1162
1163
  }) => Promise<void>;
@@ -1530,7 +1531,7 @@ declare const auth: better_auth78.Auth<{
1530
1531
  verificationUri?: string | undefined;
1531
1532
  }>;
1532
1533
  }];
1533
- }> | null;
1534
+ }>;
1534
1535
  declare const app: Hono<hono_types3.BlankEnv, hono_types3.BlankSchema, "/">;
1535
1536
  //#endregion
1536
- export { type AppConfig, type AppVariables, Hono, type NativeSandboxConfig, type SSOProviderConfig, type SandboxConfig, type UserAuthConfig, type VercelSandboxConfig, auth, createAgentsApp, createAgentsHono, createAuth0Provider, createOIDCProvider, app as default, initializeDefaultUser };
1537
+ export { type AppConfig, type AppVariables, Hono, type NativeSandboxConfig, type SSOProviderConfig, type SandboxConfig, type UserAuthConfig, type VercelSandboxConfig, auth, createAgentsApp, createAgentsHono, createAuth0Provider, createOIDCProvider, app as default };
package/dist/index.js CHANGED
@@ -1,11 +1,10 @@
1
- import { env } from "./env.js";
1
+ import "./env.js";
2
2
  import { defaultSDK } from "./instrumentation.js";
3
3
  import { createAgentsHono } from "./createApp.js";
4
- import { initializeDefaultUser } from "./initialization.js";
5
4
  import { createAuth0Provider, createOIDCProvider } from "./ssoHelpers.js";
6
5
  import { createAgentsApp, createAgentsAuth } from "./factory.js";
7
- import { Hono } from "hono";
8
6
  import { CredentialStoreRegistry, createDefaultCredentialStores } from "@inkeep/agents-core";
7
+ import { Hono } from "hono";
9
8
 
10
9
  //#region src/index.ts
11
10
  defaultSDK.start();
@@ -52,8 +51,7 @@ const app = createAgentsHono({
52
51
  auth,
53
52
  sandboxConfig
54
53
  });
55
- if (env.ENVIRONMENT === "development") initializeDefaultUser(auth);
56
54
  var src_default = app;
57
55
 
58
56
  //#endregion
59
- export { Hono, auth, createAgentsApp, createAgentsHono, createAuth0Provider, createOIDCProvider, src_default as default, initializeDefaultUser };
57
+ export { Hono, auth, createAgentsApp, createAgentsHono, createAuth0Provider, createOIDCProvider, src_default as default };
@@ -1,5 +1,5 @@
1
- import { Context, Next } from "hono";
2
1
  import { AgentsManageDatabaseClient } from "@inkeep/agents-core";
2
+ import { Context, Next } from "hono";
3
3
  import { Pool } from "pg";
4
4
 
5
5
  //#region src/middleware/branchScopedDb.d.ts
@@ -18,7 +18,7 @@ function isOriginAllowed(origin) {
18
18
  if (!origin) return false;
19
19
  try {
20
20
  const requestUrl = new URL(origin);
21
- const apiUrl = new URL(env.INKEEP_AGENTS_API_URL || `http://localhost:3002`);
21
+ const apiUrl = new URL(env.INKEEP_AGENTS_API_URL || "http://localhost:3002");
22
22
  const uiUrl = env.INKEEP_AGENTS_MANAGE_UI_URL ? new URL(env.INKEEP_AGENTS_MANAGE_UI_URL) : null;
23
23
  if (requestUrl.hostname === "localhost" || requestUrl.hostname === "127.0.0.1") return true;
24
24
  if (uiUrl && requestUrl.hostname === uiUrl.hostname) return true;
@@ -1,5 +1,5 @@
1
- import * as hono0 from "hono";
2
1
  import { BaseExecutionContext } from "@inkeep/agents-core";
2
+ import * as hono2 from "hono";
3
3
 
4
4
  //#region src/middleware/evalsAuth.d.ts
5
5
 
@@ -7,7 +7,7 @@ import { BaseExecutionContext } from "@inkeep/agents-core";
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: () => hono0.MiddlewareHandler<{
10
+ declare const evalApiKeyAuth: () => hono2.MiddlewareHandler<{
11
11
  Variables: {
12
12
  executionContext: BaseExecutionContext;
13
13
  };
@@ -1,5 +1,5 @@
1
- import * as hono1 from "hono";
2
1
  import { BaseExecutionContext } from "@inkeep/agents-core";
2
+ import * as hono3 from "hono";
3
3
  import { createAuth } from "@inkeep/agents-core/auth";
4
4
 
5
5
  //#region src/middleware/manageAuth.d.ts
@@ -12,7 +12,7 @@ import { createAuth } from "@inkeep/agents-core/auth";
12
12
  * 3. Database API key
13
13
  * 4. Internal service token
14
14
  */
15
- declare const manageApiKeyAuth: () => hono1.MiddlewareHandler<{
15
+ declare const manageApiKeyAuth: () => hono3.MiddlewareHandler<{
16
16
  Variables: {
17
17
  executionContext: BaseExecutionContext;
18
18
  userId?: string;
@@ -1,31 +1,15 @@
1
1
  import { ManageAppVariables } from "../types/app.js";
2
- import * as hono2 from "hono";
2
+ import { ProjectPermissionLevel } from "@inkeep/agents-core";
3
+ import * as hono4 from "hono";
3
4
 
4
5
  //#region src/middleware/projectAccess.d.ts
5
-
6
- /**
7
- * Permission levels for project access
8
- *
9
- * - view: Can see project and resources (read-only)
10
- * - use: Can invoke agents, create API keys, view traces
11
- * - edit: Can modify configurations and manage members
12
- */
13
- type ProjectPermission = 'view' | 'use' | 'edit';
14
6
  /**
15
7
  * Middleware to check project-level access.
16
- *
17
- * When ENABLE_AUTHZ is false:
18
- * - 'view' permission: all org members can view
19
- * - 'edit': only org owner/admin
20
- *
21
- * When ENABLE_AUTHZ is true:
22
- * - Uses SpiceDB to check permissions
23
- * - Org owner/admin bypass (handled in canViewProject etc.)
24
8
  */
25
9
  declare const requireProjectPermission: <Env$1 extends {
26
10
  Variables: ManageAppVariables;
27
11
  } = {
28
12
  Variables: ManageAppVariables;
29
- }>(permission?: ProjectPermission) => hono2.MiddlewareHandler<Env$1, string, {}, Response>;
13
+ }>(permission?: ProjectPermissionLevel) => hono4.MiddlewareHandler<Env$1, string, {}, Response>;
30
14
  //#endregion
31
- export { ProjectPermission, requireProjectPermission };
15
+ export { requireProjectPermission };
@@ -1,23 +1,13 @@
1
- import { env } from "../env.js";
2
- import { canEditProject, canUseProject, canViewProject, createApiError, isAuthzEnabled } from "@inkeep/agents-core";
1
+ import { canEditProject, canUseProject, canViewProject, createApiError } from "@inkeep/agents-core";
3
2
  import { createMiddleware } from "hono/factory";
4
3
  import { HTTPException } from "hono/http-exception";
5
4
 
6
5
  //#region src/middleware/projectAccess.ts
7
6
  /**
8
7
  * Middleware to check project-level access.
9
- *
10
- * When ENABLE_AUTHZ is false:
11
- * - 'view' permission: all org members can view
12
- * - 'edit': only org owner/admin
13
- *
14
- * When ENABLE_AUTHZ is true:
15
- * - Uses SpiceDB to check permissions
16
- * - Org owner/admin bypass (handled in canViewProject etc.)
17
8
  */
18
9
  const requireProjectPermission = (permission = "view") => createMiddleware(async (c, next) => {
19
- const isTestEnvironment = process.env.ENVIRONMENT === "test";
20
- if (env.DISABLE_AUTH || isTestEnvironment) {
10
+ if (process.env.ENVIRONMENT === "test") {
21
11
  await next();
22
12
  return;
23
13
  }
@@ -44,7 +34,6 @@ const requireProjectPermission = (permission = "view") => createMiddleware(async
44
34
  switch (permission) {
45
35
  case "view":
46
36
  hasAccess = await canViewProject({
47
- tenantId,
48
37
  userId,
49
38
  projectId,
50
39
  orgRole: tenantRole
@@ -52,7 +41,6 @@ const requireProjectPermission = (permission = "view") => createMiddleware(async
52
41
  break;
53
42
  case "use":
54
43
  hasAccess = await canUseProject({
55
- tenantId,
56
44
  userId,
57
45
  projectId,
58
46
  orgRole: tenantRole
@@ -60,47 +48,17 @@ const requireProjectPermission = (permission = "view") => createMiddleware(async
60
48
  break;
61
49
  case "edit":
62
50
  hasAccess = await canEditProject({
63
- tenantId,
64
51
  userId,
65
52
  projectId,
66
53
  orgRole: tenantRole
67
54
  });
68
55
  break;
69
56
  }
70
- if (!hasAccess) {
71
- if (isAuthzEnabled(tenantId) && permission !== "view") {
72
- if (await canViewProject({
73
- tenantId,
74
- userId,
75
- projectId,
76
- orgRole: tenantRole
77
- })) throw createApiError({
78
- code: "forbidden",
79
- message: `Permission denied. Required: project:${permission}`,
80
- instance: c.req.path,
81
- extensions: { requiredPermissions: [`project:${permission}`] }
82
- });
83
- }
84
- if (isAuthzEnabled(tenantId)) throw createApiError({
85
- code: "not_found",
86
- message: "Project not found",
87
- instance: c.req.path
88
- });
89
- throw createApiError({
90
- code: "forbidden",
91
- message: `Permission denied. Required: project:${permission}`,
92
- instance: c.req.path,
93
- extensions: {
94
- requiredPermissions: [`project:${permission}`],
95
- context: {
96
- userId,
97
- organizationId: tenantId,
98
- projectId,
99
- currentRole: tenantRole
100
- }
101
- }
102
- });
103
- }
57
+ if (!hasAccess) throw createApiError({
58
+ code: "not_found",
59
+ message: "Project not found",
60
+ instance: c.req.path
61
+ });
104
62
  await next();
105
63
  } catch (error) {
106
64
  if (error instanceof HTTPException) throw error;
@@ -1,11 +1,11 @@
1
- import * as hono3 from "hono";
2
1
  import { BaseExecutionContext, ResolvedRef } from "@inkeep/agents-core";
2
+ import * as hono5 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: hono3.MiddlewareHandler<{
8
+ declare const projectConfigMiddleware: hono5.MiddlewareHandler<{
9
9
  Variables: {
10
10
  executionContext: BaseExecutionContext;
11
11
  resolvedRef: ResolvedRef;
@@ -15,7 +15,7 @@ declare const projectConfigMiddleware: hono3.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) => hono3.MiddlewareHandler<{
18
+ declare const projectConfigMiddlewareExcept: (skipRouteCheck: (path: string) => boolean) => hono5.MiddlewareHandler<{
19
19
  Variables: {
20
20
  executionContext: BaseExecutionContext;
21
21
  resolvedRef: ResolvedRef;
@@ -1,5 +1,5 @@
1
- import { Context, Next } from "hono";
2
1
  import { AgentsManageDatabaseClient, ResolvedRef } from "@inkeep/agents-core";
2
+ import { Context, Next } from "hono";
3
3
 
4
4
  //#region src/middleware/ref.d.ts
5
5
  type RefContext = {
@@ -1,5 +1,5 @@
1
1
  import { ManageAppVariables } from "../types/app.js";
2
- import * as hono5 from "hono";
2
+ import * as hono8 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) => hono5.MiddlewareHandler<Env$1, string, {}, Response>;
12
+ }>(permissions: Permission) => hono8.MiddlewareHandler<Env$1, string, {}, Response>;
13
13
  //#endregion
14
14
  export { requirePermission };
@@ -1,4 +1,3 @@
1
- import { env } from "../env.js";
2
1
  import { createApiError } from "@inkeep/agents-core";
3
2
  import { createMiddleware } from "hono/factory";
4
3
  import { HTTPException } from "hono/http-exception";
@@ -15,7 +14,7 @@ function formatPermissionsForDisplay(permissions) {
15
14
  const requirePermission = (permissions) => createMiddleware(async (c, next) => {
16
15
  const isTestEnvironment = process.env.ENVIRONMENT === "test";
17
16
  const auth = c.get("auth");
18
- if (env.DISABLE_AUTH || isTestEnvironment || !auth) {
17
+ if (isTestEnvironment || !auth) {
19
18
  await next();
20
19
  return;
21
20
  }
@@ -1,8 +1,8 @@
1
- import * as hono6 from "hono";
2
1
  import { BaseExecutionContext } from "@inkeep/agents-core";
2
+ import * as hono9 from "hono";
3
3
 
4
4
  //#region src/middleware/runAuth.d.ts
5
- declare const runApiKeyAuth: () => hono6.MiddlewareHandler<{
5
+ declare const runApiKeyAuth: () => hono9.MiddlewareHandler<{
6
6
  Variables: {
7
7
  executionContext: BaseExecutionContext;
8
8
  };
@@ -11,7 +11,7 @@ declare const runApiKeyAuth: () => hono6.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) => hono6.MiddlewareHandler<{
14
+ declare const runApiKeyAuthExcept: (skipRouteCheck: (path: string) => boolean) => hono9.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: () => hono6.MiddlewareHandler<{
23
+ declare const runOptionalAuth: () => hono9.MiddlewareHandler<{
24
24
  Variables: {
25
25
  executionContext?: BaseExecutionContext;
26
26
  };
@@ -1,4 +1,4 @@
1
- import * as hono9 from "hono";
1
+ import * as hono12 from "hono";
2
2
 
3
3
  //#region src/middleware/sessionAuth.d.ts
4
4
 
@@ -7,11 +7,11 @@ import * as hono9 from "hono";
7
7
  * Requires that a user has already been authenticated via Better Auth session.
8
8
  * Used primarily for manage routes that require an active user session.
9
9
  */
10
- declare const sessionAuth: () => hono9.MiddlewareHandler<any, string, {}, Response>;
10
+ declare const sessionAuth: () => hono12.MiddlewareHandler<any, string, {}, Response>;
11
11
  /**
12
12
  * Global session middleware - sets user and session in context for all routes
13
13
  * Used for all routes that require an active user session.
14
14
  */
15
- declare const sessionContext: () => hono9.MiddlewareHandler<any, string, {}, Response>;
15
+ declare const sessionContext: () => hono12.MiddlewareHandler<any, string, {}, Response>;
16
16
  //#endregion
17
17
  export { sessionAuth, sessionContext };
@@ -1,4 +1,3 @@
1
- import { env } from "../env.js";
2
1
  import { createApiError } from "@inkeep/agents-core";
3
2
  import { createMiddleware } from "hono/factory";
4
3
  import { HTTPException } from "hono/http-exception";
@@ -33,7 +32,7 @@ const sessionAuth = () => createMiddleware(async (c, next) => {
33
32
  */
34
33
  const sessionContext = () => createMiddleware(async (c, next) => {
35
34
  const auth = c.get("auth");
36
- if (env.DISABLE_AUTH || !auth) {
35
+ if (!auth) {
37
36
  c.set("user", null);
38
37
  c.set("session", null);
39
38
  await next();
@@ -1,4 +1,4 @@
1
- import * as hono11 from "hono";
1
+ import * as hono14 from "hono";
2
2
 
3
3
  //#region src/middleware/tenantAccess.d.ts
4
4
 
@@ -11,7 +11,7 @@ import * as hono11 from "hono";
11
11
  * - API key user: Access only to the tenant associated with the API key
12
12
  * - Session user: Access based on organization membership
13
13
  */
14
- declare const requireTenantAccess: () => hono11.MiddlewareHandler<{
14
+ declare const requireTenantAccess: () => hono14.MiddlewareHandler<{
15
15
  Variables: {
16
16
  userId: string;
17
17
  tenantId: string;
@@ -1,5 +1,5 @@
1
1
  import runDbClient_default from "../data/db/runDbClient.js";
2
- import { createApiError, getUserOrganizations } from "@inkeep/agents-core";
2
+ import { OrgRoles, createApiError, getUserOrganizationsFromDb } from "@inkeep/agents-core";
3
3
  import { createMiddleware } from "hono/factory";
4
4
  import { HTTPException } from "hono/http-exception";
5
5
 
@@ -26,7 +26,7 @@ const requireTenantAccess = () => createMiddleware(async (c, next) => {
26
26
  });
27
27
  if (userId === "system") {
28
28
  c.set("tenantId", tenantId);
29
- c.set("tenantRole", "owner");
29
+ c.set("tenantRole", OrgRoles.OWNER);
30
30
  await next();
31
31
  return;
32
32
  }
@@ -37,12 +37,12 @@ const requireTenantAccess = () => createMiddleware(async (c, next) => {
37
37
  message: "API key does not have access to this organization"
38
38
  });
39
39
  c.set("tenantId", tenantId);
40
- c.set("tenantRole", "owner");
40
+ c.set("tenantRole", OrgRoles.OWNER);
41
41
  await next();
42
42
  return;
43
43
  }
44
44
  try {
45
- const organizationAccess = (await getUserOrganizations(runDbClient_default)(userId)).find((org) => org.organizationId === tenantId);
45
+ const organizationAccess = (await getUserOrganizationsFromDb(runDbClient_default)(userId)).find((org) => org.organizationId === tenantId);
46
46
  if (!organizationAccess) throw createApiError({
47
47
  code: "forbidden",
48
48
  message: "Access denied to this organization"
@@ -1,7 +1,7 @@
1
- import * as hono12 from "hono";
1
+ import * as hono15 from "hono";
2
2
 
3
3
  //#region src/middleware/tracing.d.ts
4
- declare const otelBaggageMiddleware: () => hono12.MiddlewareHandler<any, string, {}, Response>;
5
- declare const executionBaggageMiddleware: () => hono12.MiddlewareHandler<any, string, {}, Response>;
4
+ declare const otelBaggageMiddleware: () => hono15.MiddlewareHandler<any, string, {}, Response>;
5
+ declare const executionBaggageMiddleware: () => hono15.MiddlewareHandler<any, string, {}, Response>;
6
6
  //#endregion
7
7
  export { executionBaggageMiddleware, otelBaggageMiddleware };
package/dist/openapi.d.ts CHANGED
@@ -2,6 +2,41 @@ import { OpenAPIHono } from "@hono/zod-openapi";
2
2
  import { Env } from "hono";
3
3
 
4
4
  //#region src/openapi.d.ts
5
+ declare const TagToDescription: {
6
+ A2A: string;
7
+ 'API Keys': string;
8
+ Agents: string;
9
+ 'Artifact Components': string;
10
+ Branches: string;
11
+ CLI: string;
12
+ Chat: string;
13
+ 'Context Configs': string;
14
+ Conversations: string;
15
+ Credentials: string;
16
+ 'Credential Stores': string;
17
+ 'Data Components': string;
18
+ Evaluations: string;
19
+ 'External Agents': string;
20
+ 'Function Tools': string;
21
+ Functions: string;
22
+ GitHub: string;
23
+ Invitations: string;
24
+ MCP: string;
25
+ 'MCP Catalog': string;
26
+ OAuth: string;
27
+ 'Project Members': string;
28
+ 'Project Permissions': string;
29
+ Projects: string;
30
+ Refs: string;
31
+ SubAgents: string;
32
+ 'Third-Party MCP Servers': string;
33
+ Tools: string;
34
+ Triggers: string;
35
+ 'User Organizations': string;
36
+ 'User Project Memberships': string;
37
+ Webhooks: string;
38
+ Workflows: string;
39
+ };
5
40
  declare function setupOpenAPIRoutes<E extends Env = Env>(app: OpenAPIHono<E>): void;
6
41
  //#endregion
7
- export { setupOpenAPIRoutes };
42
+ export { TagToDescription, setupOpenAPIRoutes };