@inkeep/agents-core 0.55.1 → 0.55.3

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.
@@ -54,6 +54,29 @@ interface SSOProviderConfig {
54
54
  oidcConfig?: OIDCProviderConfig;
55
55
  samlConfig?: SAMLProviderConfig;
56
56
  }
57
+ interface EmailServiceConfig {
58
+ sendInvitationEmail(data: {
59
+ to: string;
60
+ inviterName: string;
61
+ organizationName: string;
62
+ role: string;
63
+ invitationUrl: string;
64
+ authMethod?: string;
65
+ expiresInDays?: number;
66
+ }): Promise<{
67
+ emailSent: boolean;
68
+ error?: string;
69
+ }>;
70
+ sendPasswordResetEmail(data: {
71
+ to: string;
72
+ resetUrl: string;
73
+ expiresInMinutes?: number;
74
+ }): Promise<{
75
+ emailSent: boolean;
76
+ error?: string;
77
+ }>;
78
+ isConfigured: boolean;
79
+ }
57
80
  interface BetterAuthConfig {
58
81
  baseURL: string;
59
82
  secret: string;
@@ -65,6 +88,7 @@ interface BetterAuthConfig {
65
88
  google?: GoogleOptions;
66
89
  };
67
90
  advanced?: BetterAuthAdvancedOptions;
91
+ emailService?: EmailServiceConfig;
68
92
  }
69
93
  interface UserAuthConfig {
70
94
  ssoProviders?: SSOProviderConfig[];
@@ -90,6 +114,7 @@ interface UserAuthConfig {
90
114
  * - Any *.inkeep.com URL -> .inkeep.com
91
115
  */
92
116
  declare function extractCookieDomain(baseURL: string, explicitDomain?: string): string | undefined;
117
+ declare function hasCredentialAccount(dbClient: AgentsRunDatabaseClient, userId: string): Promise<boolean>;
93
118
  declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
94
119
  baseURL: string;
95
120
  secret: string;
@@ -1248,25 +1273,25 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
1248
1273
  ac: better_auth_plugins0.AccessControl;
1249
1274
  roles: {
1250
1275
  member: {
1251
- authorize<K_1 extends "organization" | "member" | "invitation" | "ac" | "project" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins0.Statements>[key] | {
1252
- actions: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins0.Statements>[key];
1276
+ authorize<K_1 extends "project" | "organization" | "member" | "invitation" | "ac" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>[key] | {
1277
+ actions: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>[key];
1253
1278
  connector: "OR" | "AND";
1254
1279
  } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
1255
- statements: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins0.Statements>;
1280
+ statements: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>;
1256
1281
  };
1257
1282
  admin: {
1258
- authorize<K_1 extends "organization" | "member" | "invitation" | "ac" | "project" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins0.Statements>[key] | {
1259
- actions: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins0.Statements>[key];
1283
+ authorize<K_1 extends "project" | "organization" | "member" | "invitation" | "ac" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>[key] | {
1284
+ actions: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>[key];
1260
1285
  connector: "OR" | "AND";
1261
1286
  } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
1262
- statements: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins0.Statements>;
1287
+ statements: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>;
1263
1288
  };
1264
1289
  owner: {
1265
- authorize<K_1 extends "organization" | "member" | "invitation" | "ac" | "project" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins0.Statements>[key] | {
1266
- actions: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins0.Statements>[key];
1290
+ authorize<K_1 extends "project" | "organization" | "member" | "invitation" | "ac" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>[key] | {
1291
+ actions: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>[key];
1267
1292
  connector: "OR" | "AND";
1268
1293
  } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
1269
- statements: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins0.Statements>;
1294
+ statements: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>;
1270
1295
  };
1271
1296
  };
1272
1297
  creatorRole: "admin";
@@ -1706,4 +1731,4 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
1706
1731
  }>;
1707
1732
  declare const auth: ReturnType<typeof createAuth>;
1708
1733
  //#endregion
1709
- export { BetterAuthConfig, OIDCProviderConfig, SAMLProviderConfig, SSOProviderConfig, UserAuthConfig, auth, createAuth, extractCookieDomain };
1734
+ export { BetterAuthConfig, EmailServiceConfig, OIDCProviderConfig, SAMLProviderConfig, SSOProviderConfig, UserAuthConfig, auth, createAuth, extractCookieDomain, hasCredentialAccount };
package/dist/auth/auth.js CHANGED
@@ -1,11 +1,12 @@
1
- import { member, ssoProvider } from "./auth-schema.js";
1
+ import { account, member, ssoProvider } from "./auth-schema.js";
2
2
  import { OrgRoles } from "./authz/types.js";
3
3
  import { env } from "../env.js";
4
+ import { setEmailSendStatus } from "./email-send-status-store.js";
4
5
  import { setPasswordResetLink } from "./password-reset-link-store.js";
5
6
  import { generateId as generateId$1 } from "../utils/conversations.js";
6
7
  import "../utils/index.js";
7
8
  import { ac, adminRole, memberRole, ownerRole } from "./permissions.js";
8
- import { eq } from "drizzle-orm";
9
+ import { and, eq } from "drizzle-orm";
9
10
  import { betterAuth } from "better-auth";
10
11
  import { sso } from "@better-auth/sso";
11
12
  import { drizzleAdapter } from "better-auth/adapters/drizzle";
@@ -71,6 +72,10 @@ async function registerSSOProvider(dbClient, provider) {
71
72
  console.error(`❌ Failed to register SSO provider '${provider.providerId}':`, error);
72
73
  }
73
74
  }
75
+ async function hasCredentialAccount(dbClient, userId) {
76
+ const [row] = await dbClient.select({ id: account.id }).from(account).where(and(eq(account.userId, userId), eq(account.providerId, "credential"))).limit(1);
77
+ return !!row;
78
+ }
74
79
  function createAuth(config) {
75
80
  const cookieDomain = extractCookieDomain(config.baseURL, config.cookieDomain);
76
81
  const isSecure = config.baseURL.startsWith("https://");
@@ -86,11 +91,20 @@ function createAuth(config) {
86
91
  autoSignIn: true,
87
92
  resetPasswordTokenExpiresIn: 1800,
88
93
  sendResetPassword: async ({ user, url, token }) => {
94
+ if (!await hasCredentialAccount(config.dbClient, user.id)) return;
89
95
  setPasswordResetLink({
90
96
  email: user.email,
91
97
  url,
92
98
  token
93
99
  });
100
+ if (config.emailService?.isConfigured) try {
101
+ await config.emailService.sendPasswordResetEmail({
102
+ to: user.email,
103
+ resetUrl: url
104
+ });
105
+ } catch (err) {
106
+ console.error("[email] Failed to send password reset email:", err);
107
+ }
94
108
  }
95
109
  },
96
110
  account: { accountLinking: {
@@ -169,6 +183,34 @@ function createAuth(config) {
169
183
  organization: data.organization.name,
170
184
  invitationId: data.id
171
185
  });
186
+ if (config.emailService?.isConfigured) try {
187
+ const invitationUrl = `${env.INKEEP_AGENTS_MANAGE_UI_URL || "http://localhost:3000"}/accept-invitation/${data.id}?email=${encodeURIComponent(data.email)}`;
188
+ const result = await config.emailService.sendInvitationEmail({
189
+ to: data.email,
190
+ inviterName: data.inviter.user.name || data.inviter.user.email,
191
+ organizationName: data.organization.name,
192
+ role: data.role,
193
+ invitationUrl,
194
+ authMethod: data.invitation?.authMethod
195
+ });
196
+ setEmailSendStatus(data.id, {
197
+ emailSent: result.emailSent,
198
+ error: result.error,
199
+ organizationId: data.organization.id
200
+ });
201
+ } catch (err) {
202
+ const message = err instanceof Error ? err.message : String(err);
203
+ console.error(`[email] Failed to send invitation email to ${data.email}:`, message);
204
+ setEmailSendStatus(data.id, {
205
+ emailSent: false,
206
+ error: message,
207
+ organizationId: data.organization.id
208
+ });
209
+ }
210
+ else setEmailSendStatus(data.id, {
211
+ emailSent: false,
212
+ organizationId: data.organization.id
213
+ });
172
214
  },
173
215
  schema: {
174
216
  invitation: { additionalFields: { authMethod: {
@@ -266,4 +308,4 @@ function createAuth(config) {
266
308
  const auth = null;
267
309
 
268
310
  //#endregion
269
- export { auth, createAuth, extractCookieDomain };
311
+ export { auth, createAuth, extractCookieDomain, hasCredentialAccount };
@@ -0,0 +1,10 @@
1
+ //#region src/auth/email-send-status-store.d.ts
2
+ type EmailSendStatus = {
3
+ emailSent: boolean;
4
+ error?: string;
5
+ organizationId?: string;
6
+ };
7
+ declare function setEmailSendStatus(id: string, status: EmailSendStatus, ttlMs?: number): void;
8
+ declare function getEmailSendStatus(id: string): EmailSendStatus | null;
9
+ //#endregion
10
+ export { getEmailSendStatus, setEmailSendStatus };
@@ -0,0 +1,20 @@
1
+ //#region src/auth/email-send-status-store.ts
2
+ const DEFAULT_TTL_MS = 300 * 1e3;
3
+ const store = /* @__PURE__ */ new Map();
4
+ const timers = /* @__PURE__ */ new Map();
5
+ function setEmailSendStatus(id, status, ttlMs = DEFAULT_TTL_MS) {
6
+ const existingTimer = timers.get(id);
7
+ if (existingTimer) clearTimeout(existingTimer);
8
+ store.set(id, status);
9
+ const timer = setTimeout(() => {
10
+ store.delete(id);
11
+ timers.delete(id);
12
+ }, ttlMs);
13
+ timers.set(id, timer);
14
+ }
15
+ function getEmailSendStatus(id) {
16
+ return store.get(id) ?? null;
17
+ }
18
+
19
+ //#endregion
20
+ export { getEmailSendStatus, setEmailSendStatus };
@@ -5,25 +5,25 @@ import { organizationClient } from "better-auth/client/plugins";
5
5
  //#region src/auth/permissions.d.ts
6
6
  declare const ac: AccessControl;
7
7
  declare const memberRole: {
8
- authorize<K_1 extends "organization" | "member" | "invitation" | "ac" | "project" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins35.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins35.Statements>[key] | {
9
- actions: better_auth_plugins35.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins35.Statements>[key];
8
+ authorize<K_1 extends "project" | "organization" | "member" | "invitation" | "ac" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins35.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins35.Statements>[key] | {
9
+ actions: better_auth_plugins35.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins35.Statements>[key];
10
10
  connector: "OR" | "AND";
11
11
  } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins35.AuthorizeResponse;
12
- statements: better_auth_plugins35.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins35.Statements>;
12
+ statements: better_auth_plugins35.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins35.Statements>;
13
13
  };
14
14
  declare const adminRole: {
15
- authorize<K_1 extends "organization" | "member" | "invitation" | "ac" | "project" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins35.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins35.Statements>[key] | {
16
- actions: better_auth_plugins35.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins35.Statements>[key];
15
+ authorize<K_1 extends "project" | "organization" | "member" | "invitation" | "ac" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins35.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins35.Statements>[key] | {
16
+ actions: better_auth_plugins35.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins35.Statements>[key];
17
17
  connector: "OR" | "AND";
18
18
  } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins35.AuthorizeResponse;
19
- statements: better_auth_plugins35.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins35.Statements>;
19
+ statements: better_auth_plugins35.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins35.Statements>;
20
20
  };
21
21
  declare const ownerRole: {
22
- authorize<K_1 extends "organization" | "member" | "invitation" | "ac" | "project" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins35.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins35.Statements>[key] | {
23
- actions: better_auth_plugins35.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins35.Statements>[key];
22
+ authorize<K_1 extends "project" | "organization" | "member" | "invitation" | "ac" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins35.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins35.Statements>[key] | {
23
+ actions: better_auth_plugins35.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins35.Statements>[key];
24
24
  connector: "OR" | "AND";
25
25
  } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins35.AuthorizeResponse;
26
- statements: better_auth_plugins35.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins35.Statements>;
26
+ statements: better_auth_plugins35.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins35.Statements>;
27
27
  };
28
28
  //#endregion
29
29
  export { ac, adminRole, memberRole, organizationClient, ownerRole };
@@ -11,9 +11,9 @@ declare const getAgentById: (db: AgentsManageDatabaseClient) => (params: {
11
11
  }) => Promise<{
12
12
  id: string;
13
13
  name: string;
14
+ description: string | null;
14
15
  createdAt: string;
15
16
  updatedAt: string;
16
- description: string | null;
17
17
  projectId: string;
18
18
  tenantId: string;
19
19
  defaultSubAgentId: string | null;
@@ -57,9 +57,9 @@ declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (
57
57
  }) => Promise<{
58
58
  id: string;
59
59
  name: string;
60
+ description: string | null;
60
61
  createdAt: string;
61
62
  updatedAt: string;
62
- description: string | null;
63
63
  projectId: string;
64
64
  tenantId: string;
65
65
  defaultSubAgentId: string | null;
@@ -100,9 +100,9 @@ declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (
100
100
  defaultSubAgent: {
101
101
  id: string;
102
102
  name: string;
103
+ description: string | null;
103
104
  createdAt: string;
104
105
  updatedAt: string;
105
- description: string | null;
106
106
  agentId: string;
107
107
  projectId: string;
108
108
  tenantId: string;
@@ -132,9 +132,9 @@ declare const listAgents: (db: AgentsManageDatabaseClient) => (params: {
132
132
  }) => Promise<{
133
133
  id: string;
134
134
  name: string;
135
+ description: string | null;
135
136
  createdAt: string;
136
137
  updatedAt: string;
137
- description: string | null;
138
138
  projectId: string;
139
139
  tenantId: string;
140
140
  defaultSubAgentId: string | null;
@@ -248,9 +248,9 @@ declare function listAgentsAcrossProjectMainBranches(db: AgentsManageDatabaseCli
248
248
  declare const createAgent: (db: AgentsManageDatabaseClient) => (data: AgentInsert) => Promise<{
249
249
  id: string;
250
250
  name: string;
251
+ description: string | null;
251
252
  createdAt: string;
252
253
  updatedAt: string;
253
- description: string | null;
254
254
  projectId: string;
255
255
  tenantId: string;
256
256
  defaultSubAgentId: string | null;
@@ -11,9 +11,9 @@ declare const getArtifactComponentById: (db: AgentsManageDatabaseClient) => (par
11
11
  }) => Promise<{
12
12
  id: string;
13
13
  name: string;
14
+ description: string | null;
14
15
  createdAt: string;
15
16
  updatedAt: string;
16
- description: string | null;
17
17
  projectId: string;
18
18
  tenantId: string;
19
19
  props: {
@@ -67,9 +67,9 @@ declare const listArtifactComponentsPaginated: (db: AgentsManageDatabaseClient)
67
67
  declare const createArtifactComponent: (db: AgentsManageDatabaseClient) => (params: ArtifactComponentInsert) => Promise<{
68
68
  id: string;
69
69
  name: string;
70
+ description: string | null;
70
71
  createdAt: string;
71
72
  updatedAt: string;
72
- description: string | null;
73
73
  projectId: string;
74
74
  tenantId: string;
75
75
  props: {
@@ -12,11 +12,11 @@ declare const getContextConfigById: (db: AgentsManageDatabaseClient) => (params:
12
12
  id: string;
13
13
  createdAt: string;
14
14
  updatedAt: string;
15
- headersSchema: unknown;
16
- contextVariables: Record<string, ContextFetchDefinition> | null;
17
15
  agentId: string;
18
16
  projectId: string;
19
17
  tenantId: string;
18
+ headersSchema: unknown;
19
+ contextVariables: Record<string, ContextFetchDefinition> | null;
20
20
  } | undefined>;
21
21
  declare const listContextConfigs: (db: AgentsManageDatabaseClient) => (params: {
22
22
  scopes: AgentScopeConfig;
@@ -24,11 +24,11 @@ declare const listContextConfigs: (db: AgentsManageDatabaseClient) => (params: {
24
24
  id: string;
25
25
  createdAt: string;
26
26
  updatedAt: string;
27
- headersSchema: unknown;
28
- contextVariables: Record<string, ContextFetchDefinition> | null;
29
27
  agentId: string;
30
28
  projectId: string;
31
29
  tenantId: string;
30
+ headersSchema: unknown;
31
+ contextVariables: Record<string, ContextFetchDefinition> | null;
32
32
  }[]>;
33
33
  declare const listContextConfigsPaginated: (db: AgentsManageDatabaseClient) => (params: {
34
34
  scopes: AgentScopeConfig;
@@ -46,11 +46,11 @@ declare const createContextConfig: (db: AgentsManageDatabaseClient) => (params:
46
46
  id: string;
47
47
  createdAt: string;
48
48
  updatedAt: string;
49
- headersSchema: unknown;
50
- contextVariables: Record<string, ContextFetchDefinition> | null;
51
49
  agentId: string;
52
50
  projectId: string;
53
51
  tenantId: string;
52
+ headersSchema: unknown;
53
+ contextVariables: Record<string, ContextFetchDefinition> | null;
54
54
  }>;
55
55
  declare const updateContextConfig: (db: AgentsManageDatabaseClient) => (params: {
56
56
  scopes: AgentScopeConfig;
@@ -86,11 +86,11 @@ declare const upsertContextConfig: (db: AgentsManageDatabaseClient) => (params:
86
86
  id: string;
87
87
  createdAt: string;
88
88
  updatedAt: string;
89
- headersSchema: unknown;
90
- contextVariables: Record<string, ContextFetchDefinition> | null;
91
89
  agentId: string;
92
90
  projectId: string;
93
91
  tenantId: string;
92
+ headersSchema: unknown;
93
+ contextVariables: Record<string, ContextFetchDefinition> | null;
94
94
  }>;
95
95
  //#endregion
96
96
  export { countContextConfigs, createContextConfig, deleteContextConfig, getContextConfigById, hasContextConfig, listContextConfigs, listContextConfigsPaginated, updateContextConfig, upsertContextConfig };
@@ -55,13 +55,13 @@ declare const createFunctionTool: (db: AgentsManageDatabaseClient) => (params: {
55
55
  }) => Promise<{
56
56
  id: string;
57
57
  name: string;
58
+ description: string | null;
59
+ functionId: string;
58
60
  createdAt: string;
59
61
  updatedAt: string;
60
- description: string | null;
61
62
  agentId: string;
62
63
  projectId: string;
63
64
  tenantId: string;
64
- functionId: string;
65
65
  }>;
66
66
  /**
67
67
  * Update a function tool (agent-scoped)
@@ -97,13 +97,13 @@ declare const upsertFunctionTool: (db: AgentsManageDatabaseClient) => (params: {
97
97
  }) => Promise<{
98
98
  id: string;
99
99
  name: string;
100
+ description: string | null;
101
+ functionId: string;
100
102
  createdAt: string;
101
103
  updatedAt: string;
102
- description: string | null;
103
104
  agentId: string;
104
105
  projectId: string;
105
106
  tenantId: string;
106
- functionId: string;
107
107
  }>;
108
108
  declare const getFunctionToolsForSubAgent: (db: AgentsManageDatabaseClient) => (params: {
109
109
  scopes: {
@@ -10,12 +10,12 @@ declare const getSkillById: (db: AgentsManageDatabaseClient) => (params: {
10
10
  }) => Promise<{
11
11
  id: string;
12
12
  name: string;
13
+ description: string;
13
14
  createdAt: string;
14
15
  updatedAt: string;
15
- metadata: Record<string, string> | null;
16
- description: string;
17
16
  projectId: string;
18
17
  tenantId: string;
18
+ metadata: Record<string, string> | null;
19
19
  content: string;
20
20
  } | null>;
21
21
  declare const listSkills: (db: AgentsManageDatabaseClient) => (params: {
@@ -43,23 +43,23 @@ declare const listSkills: (db: AgentsManageDatabaseClient) => (params: {
43
43
  declare const createSkill: (db: AgentsManageDatabaseClient) => (data: SkillInsert) => Promise<{
44
44
  id: string;
45
45
  name: string;
46
+ description: string;
46
47
  createdAt: string;
47
48
  updatedAt: string;
48
- metadata: Record<string, string> | null;
49
- description: string;
50
49
  projectId: string;
51
50
  tenantId: string;
51
+ metadata: Record<string, string> | null;
52
52
  content: string;
53
53
  }>;
54
54
  declare const upsertSkill: (db: AgentsManageDatabaseClient) => (data: SkillInsert) => Promise<{
55
55
  id: string;
56
56
  name: string;
57
+ description: string;
57
58
  createdAt: string;
58
59
  updatedAt: string;
59
- metadata: Record<string, string> | null;
60
- description: string;
61
60
  projectId: string;
62
61
  tenantId: string;
62
+ metadata: Record<string, string> | null;
63
63
  content: string;
64
64
  }>;
65
65
  declare const updateSkill: (db: AgentsManageDatabaseClient) => (params: {
@@ -12,11 +12,11 @@ declare const getSubAgentExternalAgentRelationById: (db: AgentsManageDatabaseCli
12
12
  id: string;
13
13
  createdAt: string;
14
14
  updatedAt: string;
15
- headers: Record<string, string> | null;
16
15
  agentId: string;
17
16
  projectId: string;
18
17
  tenantId: string;
19
18
  subAgentId: string;
19
+ headers: Record<string, string> | null;
20
20
  externalAgentId: string;
21
21
  } | undefined>;
22
22
  declare const listSubAgentExternalAgentRelations: (db: AgentsManageDatabaseClient) => (params: {
@@ -47,11 +47,11 @@ declare const getSubAgentExternalAgentRelations: (db: AgentsManageDatabaseClient
47
47
  id: string;
48
48
  createdAt: string;
49
49
  updatedAt: string;
50
- headers: Record<string, string> | null;
51
50
  agentId: string;
52
51
  projectId: string;
53
52
  tenantId: string;
54
53
  subAgentId: string;
54
+ headers: Record<string, string> | null;
55
55
  externalAgentId: string;
56
56
  }[]>;
57
57
  declare const getSubAgentExternalAgentRelationsByAgent: (db: AgentsManageDatabaseClient) => (params: {
@@ -60,11 +60,11 @@ declare const getSubAgentExternalAgentRelationsByAgent: (db: AgentsManageDatabas
60
60
  id: string;
61
61
  createdAt: string;
62
62
  updatedAt: string;
63
- headers: Record<string, string> | null;
64
63
  agentId: string;
65
64
  projectId: string;
66
65
  tenantId: string;
67
66
  subAgentId: string;
67
+ headers: Record<string, string> | null;
68
68
  externalAgentId: string;
69
69
  }[]>;
70
70
  declare const getSubAgentExternalAgentRelationsByExternalAgent: (db: AgentsManageDatabaseClient) => (params: {
@@ -183,11 +183,11 @@ declare const createSubAgentExternalAgentRelation: (db: AgentsManageDatabaseClie
183
183
  id: string;
184
184
  createdAt: string;
185
185
  updatedAt: string;
186
- headers: Record<string, string> | null;
187
186
  agentId: string;
188
187
  projectId: string;
189
188
  tenantId: string;
190
189
  subAgentId: string;
190
+ headers: Record<string, string> | null;
191
191
  externalAgentId: string;
192
192
  }>;
193
193
  /**
@@ -200,11 +200,11 @@ declare const getSubAgentExternalAgentRelationByParams: (db: AgentsManageDatabas
200
200
  id: string;
201
201
  createdAt: string;
202
202
  updatedAt: string;
203
- headers: Record<string, string> | null;
204
203
  agentId: string;
205
204
  projectId: string;
206
205
  tenantId: string;
207
206
  subAgentId: string;
207
+ headers: Record<string, string> | null;
208
208
  externalAgentId: string;
209
209
  } | undefined>;
210
210
  /**
@@ -221,11 +221,11 @@ declare const upsertSubAgentExternalAgentRelation: (db: AgentsManageDatabaseClie
221
221
  id: string;
222
222
  createdAt: string;
223
223
  updatedAt: string;
224
- headers: Record<string, string> | null;
225
224
  agentId: string;
226
225
  projectId: string;
227
226
  tenantId: string;
228
227
  subAgentId: string;
228
+ headers: Record<string, string> | null;
229
229
  externalAgentId: string;
230
230
  }>;
231
231
  declare const updateSubAgentExternalAgentRelation: (db: AgentsManageDatabaseClient) => (params: {
@@ -207,15 +207,15 @@ declare const createAgentToolRelation: (db: AgentsManageDatabaseClient) => (para
207
207
  id: string;
208
208
  createdAt: string;
209
209
  updatedAt: string;
210
- headers: Record<string, string> | null;
211
210
  agentId: string;
212
211
  projectId: string;
213
212
  tenantId: string;
214
213
  subAgentId: string;
215
- toolId: string;
216
214
  toolPolicies: Record<string, {
217
215
  needsApproval?: boolean;
218
216
  }> | null;
217
+ headers: Record<string, string> | null;
218
+ toolId: string;
219
219
  selectedTools: string[] | null;
220
220
  }>;
221
221
  declare const updateAgentToolRelation: (db: AgentsManageDatabaseClient) => (params: {
@@ -251,15 +251,15 @@ declare const getAgentToolRelationById: (db: AgentsManageDatabaseClient) => (par
251
251
  id: string;
252
252
  createdAt: string;
253
253
  updatedAt: string;
254
- headers: Record<string, string> | null;
255
254
  agentId: string;
256
255
  projectId: string;
257
256
  tenantId: string;
258
257
  subAgentId: string;
259
- toolId: string;
260
258
  toolPolicies: Record<string, {
261
259
  needsApproval?: boolean;
262
260
  }> | null;
261
+ headers: Record<string, string> | null;
262
+ toolId: string;
263
263
  selectedTools: string[] | null;
264
264
  } | undefined>;
265
265
  declare const getAgentToolRelationByAgent: (db: AgentsManageDatabaseClient) => (params: {
@@ -12,11 +12,11 @@ declare const getSubAgentTeamAgentRelationById: (db: AgentsManageDatabaseClient)
12
12
  id: string;
13
13
  createdAt: string;
14
14
  updatedAt: string;
15
- headers: Record<string, string> | null;
16
15
  agentId: string;
17
16
  projectId: string;
18
17
  tenantId: string;
19
18
  subAgentId: string;
19
+ headers: Record<string, string> | null;
20
20
  targetAgentId: string;
21
21
  } | undefined>;
22
22
  declare const listSubAgentTeamAgentRelations: (db: AgentsManageDatabaseClient) => (params: {
@@ -47,11 +47,11 @@ declare const getSubAgentTeamAgentRelations: (db: AgentsManageDatabaseClient) =>
47
47
  id: string;
48
48
  createdAt: string;
49
49
  updatedAt: string;
50
- headers: Record<string, string> | null;
51
50
  agentId: string;
52
51
  projectId: string;
53
52
  tenantId: string;
54
53
  subAgentId: string;
54
+ headers: Record<string, string> | null;
55
55
  targetAgentId: string;
56
56
  }[]>;
57
57
  declare const getSubAgentTeamAgentRelationsByAgent: (db: AgentsManageDatabaseClient) => (params: {
@@ -60,11 +60,11 @@ declare const getSubAgentTeamAgentRelationsByAgent: (db: AgentsManageDatabaseCli
60
60
  id: string;
61
61
  createdAt: string;
62
62
  updatedAt: string;
63
- headers: Record<string, string> | null;
64
63
  agentId: string;
65
64
  projectId: string;
66
65
  tenantId: string;
67
66
  subAgentId: string;
67
+ headers: Record<string, string> | null;
68
68
  targetAgentId: string;
69
69
  }[]>;
70
70
  declare const getSubAgentTeamAgentRelationsByTeamAgent: (db: AgentsManageDatabaseClient) => (params: {
@@ -213,11 +213,11 @@ declare const createSubAgentTeamAgentRelation: (db: AgentsManageDatabaseClient)
213
213
  id: string;
214
214
  createdAt: string;
215
215
  updatedAt: string;
216
- headers: Record<string, string> | null;
217
216
  agentId: string;
218
217
  projectId: string;
219
218
  tenantId: string;
220
219
  subAgentId: string;
220
+ headers: Record<string, string> | null;
221
221
  targetAgentId: string;
222
222
  }>;
223
223
  /**
@@ -230,11 +230,11 @@ declare const getSubAgentTeamAgentRelationByParams: (db: AgentsManageDatabaseCli
230
230
  id: string;
231
231
  createdAt: string;
232
232
  updatedAt: string;
233
- headers: Record<string, string> | null;
234
233
  agentId: string;
235
234
  projectId: string;
236
235
  tenantId: string;
237
236
  subAgentId: string;
237
+ headers: Record<string, string> | null;
238
238
  targetAgentId: string;
239
239
  } | undefined>;
240
240
  /**
@@ -251,11 +251,11 @@ declare const upsertSubAgentTeamAgentRelation: (db: AgentsManageDatabaseClient)
251
251
  id: string;
252
252
  createdAt: string;
253
253
  updatedAt: string;
254
- headers: Record<string, string> | null;
255
254
  agentId: string;
256
255
  projectId: string;
257
256
  tenantId: string;
258
257
  subAgentId: string;
258
+ headers: Record<string, string> | null;
259
259
  targetAgentId: string;
260
260
  }>;
261
261
  declare const updateSubAgentTeamAgentRelation: (db: AgentsManageDatabaseClient) => (params: {