@inkeep/agents-core 0.0.0-dev-20260303010841 → 0.0.0-dev-20260303041823
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.
- package/dist/auth/auth-schema.d.ts +85 -85
- package/dist/auth/auth-validation-schemas.d.ts +152 -152
- package/dist/auth/auth.d.ts +54 -29
- package/dist/auth/auth.js +45 -3
- package/dist/auth/email-send-status-store.d.ts +10 -0
- package/dist/auth/email-send-status-store.js +20 -0
- package/dist/auth/permissions.d.ts +13 -13
- package/dist/data-access/manage/agents.d.ts +32 -32
- package/dist/data-access/manage/artifactComponents.d.ts +14 -14
- package/dist/data-access/manage/contextConfigs.d.ts +8 -8
- package/dist/data-access/manage/dataComponents.d.ts +4 -4
- package/dist/data-access/manage/functionTools.d.ts +10 -10
- package/dist/data-access/manage/skills.d.ts +11 -11
- package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +18 -18
- package/dist/data-access/manage/subAgentRelations.d.ts +12 -12
- package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +18 -18
- package/dist/data-access/manage/subAgents.d.ts +12 -12
- package/dist/data-access/manage/tools.d.ts +18 -18
- package/dist/data-access/manage/triggers.d.ts +2 -2
- package/dist/data-access/runtime/apiKeys.d.ts +12 -12
- package/dist/data-access/runtime/conversations.d.ts +31 -31
- package/dist/data-access/runtime/messages.d.ts +24 -24
- package/dist/data-access/runtime/tasks.d.ts +9 -9
- package/dist/db/manage/manage-schema.d.ts +451 -451
- package/dist/db/runtime/runtime-schema.d.ts +298 -298
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/middleware/no-auth.d.ts +2 -2
- package/dist/utils/error.d.ts +51 -51
- package/dist/validation/dolt-schemas.d.ts +1 -1
- package/dist/validation/drizzle-schema-helpers.d.ts +3 -3
- package/dist/validation/schemas.d.ts +1896 -1896
- package/package.json +1 -1
package/dist/auth/auth.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import * as zod0 from "zod";
|
|
|
4
4
|
import * as better_auth0 from "better-auth";
|
|
5
5
|
import { BetterAuthAdvancedOptions } from "better-auth";
|
|
6
6
|
import * as _better_auth_sso0 from "@better-auth/sso";
|
|
7
|
-
import * as
|
|
7
|
+
import * as better_auth_plugins20 from "better-auth/plugins";
|
|
8
8
|
import { GoogleOptions } from "better-auth/social-providers";
|
|
9
9
|
|
|
10
10
|
//#region src/auth/auth.d.ts
|
|
@@ -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;
|
|
@@ -252,7 +277,7 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
|
|
|
252
277
|
handler: (inputContext: better_auth0.MiddlewareInputContext<better_auth0.MiddlewareOptions>) => Promise<void>;
|
|
253
278
|
}[];
|
|
254
279
|
};
|
|
255
|
-
options:
|
|
280
|
+
options: better_auth_plugins20.BearerOptions | undefined;
|
|
256
281
|
}, {
|
|
257
282
|
id: "sso";
|
|
258
283
|
endpoints: {
|
|
@@ -1243,30 +1268,30 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
|
|
|
1243
1268
|
handler: (inputContext: better_auth0.MiddlewareInputContext<better_auth0.MiddlewareOptions>) => Promise<void>;
|
|
1244
1269
|
}[];
|
|
1245
1270
|
};
|
|
1246
|
-
},
|
|
1271
|
+
}, better_auth_plugins20.DefaultOrganizationPlugin<{
|
|
1247
1272
|
allowUserToCreateOrganization: true;
|
|
1248
|
-
ac:
|
|
1273
|
+
ac: better_auth_plugins20.AccessControl;
|
|
1249
1274
|
roles: {
|
|
1250
1275
|
member: {
|
|
1251
|
-
authorize<K_1 extends "organization" | "member" | "
|
|
1252
|
-
actions:
|
|
1276
|
+
authorize<K_1 extends "organization" | "member" | "project" | "team" | "ac" | "invitation">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins20.Subset<"organization" | "member" | "project" | "team" | "ac" | "invitation", better_auth_plugins20.Statements>[key] | {
|
|
1277
|
+
actions: better_auth_plugins20.Subset<"organization" | "member" | "project" | "team" | "ac" | "invitation", better_auth_plugins20.Statements>[key];
|
|
1253
1278
|
connector: "OR" | "AND";
|
|
1254
|
-
} | undefined } : never, connector?: "OR" | "AND"):
|
|
1255
|
-
statements:
|
|
1279
|
+
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins20.AuthorizeResponse;
|
|
1280
|
+
statements: better_auth_plugins20.Subset<"organization" | "member" | "project" | "team" | "ac" | "invitation", better_auth_plugins20.Statements>;
|
|
1256
1281
|
};
|
|
1257
1282
|
admin: {
|
|
1258
|
-
authorize<K_1 extends "organization" | "member" | "
|
|
1259
|
-
actions:
|
|
1283
|
+
authorize<K_1 extends "organization" | "member" | "project" | "team" | "ac" | "invitation">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins20.Subset<"organization" | "member" | "project" | "team" | "ac" | "invitation", better_auth_plugins20.Statements>[key] | {
|
|
1284
|
+
actions: better_auth_plugins20.Subset<"organization" | "member" | "project" | "team" | "ac" | "invitation", better_auth_plugins20.Statements>[key];
|
|
1260
1285
|
connector: "OR" | "AND";
|
|
1261
|
-
} | undefined } : never, connector?: "OR" | "AND"):
|
|
1262
|
-
statements:
|
|
1286
|
+
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins20.AuthorizeResponse;
|
|
1287
|
+
statements: better_auth_plugins20.Subset<"organization" | "member" | "project" | "team" | "ac" | "invitation", better_auth_plugins20.Statements>;
|
|
1263
1288
|
};
|
|
1264
1289
|
owner: {
|
|
1265
|
-
authorize<K_1 extends "organization" | "member" | "
|
|
1266
|
-
actions:
|
|
1290
|
+
authorize<K_1 extends "organization" | "member" | "project" | "team" | "ac" | "invitation">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins20.Subset<"organization" | "member" | "project" | "team" | "ac" | "invitation", better_auth_plugins20.Statements>[key] | {
|
|
1291
|
+
actions: better_auth_plugins20.Subset<"organization" | "member" | "project" | "team" | "ac" | "invitation", better_auth_plugins20.Statements>[key];
|
|
1267
1292
|
connector: "OR" | "AND";
|
|
1268
|
-
} | undefined } : never, connector?: "OR" | "AND"):
|
|
1269
|
-
statements:
|
|
1293
|
+
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins20.AuthorizeResponse;
|
|
1294
|
+
statements: better_auth_plugins20.Subset<"organization" | "member" | "project" | "team" | "ac" | "invitation", better_auth_plugins20.Statements>;
|
|
1270
1295
|
};
|
|
1271
1296
|
};
|
|
1272
1297
|
creatorRole: "admin";
|
|
@@ -1277,9 +1302,9 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
|
|
|
1277
1302
|
id: string;
|
|
1278
1303
|
role: string;
|
|
1279
1304
|
email: string;
|
|
1280
|
-
organization:
|
|
1281
|
-
invitation:
|
|
1282
|
-
inviter:
|
|
1305
|
+
organization: better_auth_plugins20.Organization;
|
|
1306
|
+
invitation: better_auth_plugins20.Invitation;
|
|
1307
|
+
inviter: better_auth_plugins20.Member & {
|
|
1283
1308
|
user: better_auth0.User;
|
|
1284
1309
|
};
|
|
1285
1310
|
}): Promise<void>;
|
|
@@ -1314,28 +1339,28 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
|
|
|
1314
1339
|
user,
|
|
1315
1340
|
organization: org
|
|
1316
1341
|
}: {
|
|
1317
|
-
invitation:
|
|
1318
|
-
member:
|
|
1342
|
+
invitation: better_auth_plugins20.Invitation & Record<string, any>;
|
|
1343
|
+
member: better_auth_plugins20.Member & Record<string, any>;
|
|
1319
1344
|
user: better_auth0.User & Record<string, any>;
|
|
1320
|
-
organization:
|
|
1345
|
+
organization: better_auth_plugins20.Organization & Record<string, any>;
|
|
1321
1346
|
}) => Promise<void>;
|
|
1322
1347
|
beforeUpdateMemberRole: ({
|
|
1323
1348
|
member,
|
|
1324
1349
|
organization: org,
|
|
1325
1350
|
newRole
|
|
1326
1351
|
}: {
|
|
1327
|
-
member:
|
|
1352
|
+
member: better_auth_plugins20.Member & Record<string, any>;
|
|
1328
1353
|
newRole: string;
|
|
1329
1354
|
user: better_auth0.User & Record<string, any>;
|
|
1330
|
-
organization:
|
|
1355
|
+
organization: better_auth_plugins20.Organization & Record<string, any>;
|
|
1331
1356
|
}) => Promise<void>;
|
|
1332
1357
|
beforeRemoveMember: ({
|
|
1333
1358
|
member,
|
|
1334
1359
|
organization: org
|
|
1335
1360
|
}: {
|
|
1336
|
-
member:
|
|
1361
|
+
member: better_auth_plugins20.Member & Record<string, any>;
|
|
1337
1362
|
user: better_auth0.User & Record<string, any>;
|
|
1338
|
-
organization:
|
|
1363
|
+
organization: better_auth_plugins20.Organization & Record<string, any>;
|
|
1339
1364
|
}) => Promise<void>;
|
|
1340
1365
|
};
|
|
1341
1366
|
}>, {
|
|
@@ -1676,8 +1701,8 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
|
|
|
1676
1701
|
readonly AUTHENTICATION_REQUIRED: "Authentication required";
|
|
1677
1702
|
};
|
|
1678
1703
|
options: Partial<{
|
|
1679
|
-
expiresIn:
|
|
1680
|
-
interval:
|
|
1704
|
+
expiresIn: better_auth_plugins20.TimeString;
|
|
1705
|
+
interval: better_auth_plugins20.TimeString;
|
|
1681
1706
|
deviceCodeLength: number;
|
|
1682
1707
|
userCodeLength: number;
|
|
1683
1708
|
schema: {
|
|
@@ -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 };
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as better_auth_plugins0 from "better-auth/plugins";
|
|
2
2
|
import { AccessControl } from "better-auth/plugins/access";
|
|
3
3
|
import { organizationClient } from "better-auth/client/plugins";
|
|
4
4
|
|
|
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" | "
|
|
9
|
-
actions:
|
|
8
|
+
authorize<K_1 extends "organization" | "member" | "project" | "team" | "ac" | "invitation">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"organization" | "member" | "project" | "team" | "ac" | "invitation", better_auth_plugins0.Statements>[key] | {
|
|
9
|
+
actions: better_auth_plugins0.Subset<"organization" | "member" | "project" | "team" | "ac" | "invitation", better_auth_plugins0.Statements>[key];
|
|
10
10
|
connector: "OR" | "AND";
|
|
11
|
-
} | undefined } : never, connector?: "OR" | "AND"):
|
|
12
|
-
statements:
|
|
11
|
+
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
|
|
12
|
+
statements: better_auth_plugins0.Subset<"organization" | "member" | "project" | "team" | "ac" | "invitation", better_auth_plugins0.Statements>;
|
|
13
13
|
};
|
|
14
14
|
declare const adminRole: {
|
|
15
|
-
authorize<K_1 extends "organization" | "member" | "
|
|
16
|
-
actions:
|
|
15
|
+
authorize<K_1 extends "organization" | "member" | "project" | "team" | "ac" | "invitation">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"organization" | "member" | "project" | "team" | "ac" | "invitation", better_auth_plugins0.Statements>[key] | {
|
|
16
|
+
actions: better_auth_plugins0.Subset<"organization" | "member" | "project" | "team" | "ac" | "invitation", better_auth_plugins0.Statements>[key];
|
|
17
17
|
connector: "OR" | "AND";
|
|
18
|
-
} | undefined } : never, connector?: "OR" | "AND"):
|
|
19
|
-
statements:
|
|
18
|
+
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
|
|
19
|
+
statements: better_auth_plugins0.Subset<"organization" | "member" | "project" | "team" | "ac" | "invitation", better_auth_plugins0.Statements>;
|
|
20
20
|
};
|
|
21
21
|
declare const ownerRole: {
|
|
22
|
-
authorize<K_1 extends "organization" | "member" | "
|
|
23
|
-
actions:
|
|
22
|
+
authorize<K_1 extends "organization" | "member" | "project" | "team" | "ac" | "invitation">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"organization" | "member" | "project" | "team" | "ac" | "invitation", better_auth_plugins0.Statements>[key] | {
|
|
23
|
+
actions: better_auth_plugins0.Subset<"organization" | "member" | "project" | "team" | "ac" | "invitation", better_auth_plugins0.Statements>[key];
|
|
24
24
|
connector: "OR" | "AND";
|
|
25
|
-
} | undefined } : never, connector?: "OR" | "AND"):
|
|
26
|
-
statements:
|
|
25
|
+
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
|
|
26
|
+
statements: better_auth_plugins0.Subset<"organization" | "member" | "project" | "team" | "ac" | "invitation", better_auth_plugins0.Statements>;
|
|
27
27
|
};
|
|
28
28
|
//#endregion
|
|
29
29
|
export { ac, adminRole, memberRole, organizationClient, ownerRole };
|
|
@@ -9,15 +9,13 @@ import { PgTable } from "drizzle-orm/pg-core";
|
|
|
9
9
|
declare const getAgentById: (db: AgentsManageDatabaseClient) => (params: {
|
|
10
10
|
scopes: AgentScopeConfig;
|
|
11
11
|
}) => Promise<{
|
|
12
|
-
id: string;
|
|
13
12
|
name: string;
|
|
13
|
+
description: string | null;
|
|
14
|
+
id: string;
|
|
14
15
|
createdAt: string;
|
|
15
16
|
updatedAt: string;
|
|
16
|
-
description: string | null;
|
|
17
17
|
projectId: string;
|
|
18
18
|
tenantId: string;
|
|
19
|
-
defaultSubAgentId: string | null;
|
|
20
|
-
contextConfigId: string | null;
|
|
21
19
|
models: {
|
|
22
20
|
base?: {
|
|
23
21
|
model?: string | undefined;
|
|
@@ -32,6 +30,11 @@ declare const getAgentById: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
32
30
|
providerOptions?: Record<string, any> | undefined;
|
|
33
31
|
} | undefined;
|
|
34
32
|
} | null;
|
|
33
|
+
stopWhen: {
|
|
34
|
+
transferCountIs?: number | undefined;
|
|
35
|
+
} | null;
|
|
36
|
+
defaultSubAgentId: string | null;
|
|
37
|
+
contextConfigId: string | null;
|
|
35
38
|
prompt: string | null;
|
|
36
39
|
statusUpdates: {
|
|
37
40
|
enabled?: boolean | undefined;
|
|
@@ -48,22 +51,17 @@ declare const getAgentById: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
48
51
|
} | undefined;
|
|
49
52
|
}[] | undefined;
|
|
50
53
|
} | null;
|
|
51
|
-
stopWhen: {
|
|
52
|
-
transferCountIs?: number | undefined;
|
|
53
|
-
} | null;
|
|
54
54
|
} | null>;
|
|
55
55
|
declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (params: {
|
|
56
56
|
scopes: AgentScopeConfig;
|
|
57
57
|
}) => Promise<{
|
|
58
|
-
id: string;
|
|
59
58
|
name: string;
|
|
59
|
+
description: string | null;
|
|
60
|
+
id: string;
|
|
60
61
|
createdAt: string;
|
|
61
62
|
updatedAt: string;
|
|
62
|
-
description: string | null;
|
|
63
63
|
projectId: string;
|
|
64
64
|
tenantId: string;
|
|
65
|
-
defaultSubAgentId: string | null;
|
|
66
|
-
contextConfigId: string | null;
|
|
67
65
|
models: {
|
|
68
66
|
base?: {
|
|
69
67
|
model?: string | undefined;
|
|
@@ -78,6 +76,11 @@ declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (
|
|
|
78
76
|
providerOptions?: Record<string, any> | undefined;
|
|
79
77
|
} | undefined;
|
|
80
78
|
} | null;
|
|
79
|
+
stopWhen: {
|
|
80
|
+
transferCountIs?: number | undefined;
|
|
81
|
+
} | null;
|
|
82
|
+
defaultSubAgentId: string | null;
|
|
83
|
+
contextConfigId: string | null;
|
|
81
84
|
prompt: string | null;
|
|
82
85
|
statusUpdates: {
|
|
83
86
|
enabled?: boolean | undefined;
|
|
@@ -94,16 +97,12 @@ declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (
|
|
|
94
97
|
} | undefined;
|
|
95
98
|
}[] | undefined;
|
|
96
99
|
} | null;
|
|
97
|
-
stopWhen: {
|
|
98
|
-
transferCountIs?: number | undefined;
|
|
99
|
-
} | null;
|
|
100
100
|
defaultSubAgent: {
|
|
101
|
-
id: string;
|
|
102
101
|
name: string;
|
|
102
|
+
description: string | null;
|
|
103
|
+
id: string;
|
|
103
104
|
createdAt: string;
|
|
104
105
|
updatedAt: string;
|
|
105
|
-
description: string | null;
|
|
106
|
-
agentId: string;
|
|
107
106
|
projectId: string;
|
|
108
107
|
tenantId: string;
|
|
109
108
|
models: {
|
|
@@ -120,25 +119,24 @@ declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (
|
|
|
120
119
|
providerOptions?: Record<string, any> | undefined;
|
|
121
120
|
} | undefined;
|
|
122
121
|
} | null;
|
|
123
|
-
prompt: string | null;
|
|
124
122
|
stopWhen: {
|
|
125
123
|
stepCountIs?: number | undefined;
|
|
126
124
|
} | null;
|
|
125
|
+
agentId: string;
|
|
126
|
+
prompt: string | null;
|
|
127
127
|
conversationHistoryConfig: ConversationHistoryConfig | null;
|
|
128
128
|
} | null;
|
|
129
129
|
} | null>;
|
|
130
130
|
declare const listAgents: (db: AgentsManageDatabaseClient) => (params: {
|
|
131
131
|
scopes: ProjectScopeConfig;
|
|
132
132
|
}) => Promise<{
|
|
133
|
-
id: string;
|
|
134
133
|
name: string;
|
|
134
|
+
description: string | null;
|
|
135
|
+
id: string;
|
|
135
136
|
createdAt: string;
|
|
136
137
|
updatedAt: string;
|
|
137
|
-
description: string | null;
|
|
138
138
|
projectId: string;
|
|
139
139
|
tenantId: string;
|
|
140
|
-
defaultSubAgentId: string | null;
|
|
141
|
-
contextConfigId: string | null;
|
|
142
140
|
models: {
|
|
143
141
|
base?: {
|
|
144
142
|
model?: string | undefined;
|
|
@@ -153,6 +151,11 @@ declare const listAgents: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
153
151
|
providerOptions?: Record<string, any> | undefined;
|
|
154
152
|
} | undefined;
|
|
155
153
|
} | null;
|
|
154
|
+
stopWhen: {
|
|
155
|
+
transferCountIs?: number | undefined;
|
|
156
|
+
} | null;
|
|
157
|
+
defaultSubAgentId: string | null;
|
|
158
|
+
contextConfigId: string | null;
|
|
156
159
|
prompt: string | null;
|
|
157
160
|
statusUpdates: {
|
|
158
161
|
enabled?: boolean | undefined;
|
|
@@ -169,9 +172,6 @@ declare const listAgents: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
169
172
|
} | undefined;
|
|
170
173
|
}[] | undefined;
|
|
171
174
|
} | null;
|
|
172
|
-
stopWhen: {
|
|
173
|
-
transferCountIs?: number | undefined;
|
|
174
|
-
} | null;
|
|
175
175
|
}[]>;
|
|
176
176
|
declare const listAgentsPaginated: (db: AgentsManageDatabaseClient) => (params: {
|
|
177
177
|
scopes: ProjectScopeConfig;
|
|
@@ -246,15 +246,13 @@ declare function listAgentsAcrossProjectMainBranches(db: AgentsManageDatabaseCli
|
|
|
246
246
|
projectIds: string[];
|
|
247
247
|
}): Promise<AvailableAgentInfo[]>;
|
|
248
248
|
declare const createAgent: (db: AgentsManageDatabaseClient) => (data: AgentInsert) => Promise<{
|
|
249
|
-
id: string;
|
|
250
249
|
name: string;
|
|
250
|
+
description: string | null;
|
|
251
|
+
id: string;
|
|
251
252
|
createdAt: string;
|
|
252
253
|
updatedAt: string;
|
|
253
|
-
description: string | null;
|
|
254
254
|
projectId: string;
|
|
255
255
|
tenantId: string;
|
|
256
|
-
defaultSubAgentId: string | null;
|
|
257
|
-
contextConfigId: string | null;
|
|
258
256
|
models: {
|
|
259
257
|
base?: {
|
|
260
258
|
model?: string | undefined;
|
|
@@ -269,6 +267,11 @@ declare const createAgent: (db: AgentsManageDatabaseClient) => (data: AgentInser
|
|
|
269
267
|
providerOptions?: Record<string, any> | undefined;
|
|
270
268
|
} | undefined;
|
|
271
269
|
} | null;
|
|
270
|
+
stopWhen: {
|
|
271
|
+
transferCountIs?: number | undefined;
|
|
272
|
+
} | null;
|
|
273
|
+
defaultSubAgentId: string | null;
|
|
274
|
+
contextConfigId: string | null;
|
|
272
275
|
prompt: string | null;
|
|
273
276
|
statusUpdates: {
|
|
274
277
|
enabled?: boolean | undefined;
|
|
@@ -285,9 +288,6 @@ declare const createAgent: (db: AgentsManageDatabaseClient) => (data: AgentInser
|
|
|
285
288
|
} | undefined;
|
|
286
289
|
}[] | undefined;
|
|
287
290
|
} | null;
|
|
288
|
-
stopWhen: {
|
|
289
|
-
transferCountIs?: number | undefined;
|
|
290
|
-
} | null;
|
|
291
291
|
}>;
|
|
292
292
|
declare const updateAgent: (db: AgentsManageDatabaseClient) => (params: {
|
|
293
293
|
scopes: AgentScopeConfig;
|
|
@@ -9,13 +9,9 @@ declare const getArtifactComponentById: (db: AgentsManageDatabaseClient) => (par
|
|
|
9
9
|
scopes: ProjectScopeConfig;
|
|
10
10
|
id: string;
|
|
11
11
|
}) => Promise<{
|
|
12
|
-
id: string;
|
|
13
12
|
name: string;
|
|
14
|
-
createdAt: string;
|
|
15
|
-
updatedAt: string;
|
|
16
13
|
description: string | null;
|
|
17
|
-
|
|
18
|
-
tenantId: string;
|
|
14
|
+
id: string;
|
|
19
15
|
props: {
|
|
20
16
|
[x: string]: unknown;
|
|
21
17
|
type: "object";
|
|
@@ -28,6 +24,10 @@ declare const getArtifactComponentById: (db: AgentsManageDatabaseClient) => (par
|
|
|
28
24
|
component: string;
|
|
29
25
|
mockData: Record<string, unknown>;
|
|
30
26
|
} | null;
|
|
27
|
+
createdAt: string;
|
|
28
|
+
updatedAt: string;
|
|
29
|
+
projectId: string;
|
|
30
|
+
tenantId: string;
|
|
31
31
|
} | undefined>;
|
|
32
32
|
declare const listArtifactComponents: (db: AgentsManageDatabaseClient) => (params: {
|
|
33
33
|
scopes: ProjectScopeConfig;
|
|
@@ -65,13 +65,9 @@ declare const listArtifactComponentsPaginated: (db: AgentsManageDatabaseClient)
|
|
|
65
65
|
};
|
|
66
66
|
}>;
|
|
67
67
|
declare const createArtifactComponent: (db: AgentsManageDatabaseClient) => (params: ArtifactComponentInsert) => Promise<{
|
|
68
|
-
id: string;
|
|
69
68
|
name: string;
|
|
70
|
-
createdAt: string;
|
|
71
|
-
updatedAt: string;
|
|
72
69
|
description: string | null;
|
|
73
|
-
|
|
74
|
-
tenantId: string;
|
|
70
|
+
id: string;
|
|
75
71
|
props: {
|
|
76
72
|
[x: string]: unknown;
|
|
77
73
|
type: "object";
|
|
@@ -84,6 +80,10 @@ declare const createArtifactComponent: (db: AgentsManageDatabaseClient) => (para
|
|
|
84
80
|
component: string;
|
|
85
81
|
mockData: Record<string, unknown>;
|
|
86
82
|
} | null;
|
|
83
|
+
createdAt: string;
|
|
84
|
+
updatedAt: string;
|
|
85
|
+
projectId: string;
|
|
86
|
+
tenantId: string;
|
|
87
87
|
}>;
|
|
88
88
|
declare const updateArtifactComponent: (db: AgentsManageDatabaseClient) => (params: {
|
|
89
89
|
scopes: ProjectScopeConfig;
|
|
@@ -141,12 +141,12 @@ declare const associateArtifactComponentWithAgent: (db: AgentsManageDatabaseClie
|
|
|
141
141
|
scopes: SubAgentScopeConfig;
|
|
142
142
|
artifactComponentId: string;
|
|
143
143
|
}) => Promise<{
|
|
144
|
+
subAgentId: string;
|
|
144
145
|
id: string;
|
|
145
146
|
createdAt: string;
|
|
146
|
-
agentId: string;
|
|
147
147
|
projectId: string;
|
|
148
148
|
tenantId: string;
|
|
149
|
-
|
|
149
|
+
agentId: string;
|
|
150
150
|
artifactComponentId: string;
|
|
151
151
|
}>;
|
|
152
152
|
declare const removeArtifactComponentFromAgent: (db: AgentsManageDatabaseClient) => (params: {
|
|
@@ -184,12 +184,12 @@ declare const upsertAgentArtifactComponentRelation: (db: AgentsManageDatabaseCli
|
|
|
184
184
|
scopes: SubAgentScopeConfig;
|
|
185
185
|
artifactComponentId: string;
|
|
186
186
|
}) => Promise<{
|
|
187
|
+
subAgentId: string;
|
|
187
188
|
id: string;
|
|
188
189
|
createdAt: string;
|
|
189
|
-
agentId: string;
|
|
190
190
|
projectId: string;
|
|
191
191
|
tenantId: string;
|
|
192
|
-
|
|
192
|
+
agentId: string;
|
|
193
193
|
artifactComponentId: string;
|
|
194
194
|
} | null>;
|
|
195
195
|
/**
|
|
@@ -12,11 +12,11 @@ declare const getContextConfigById: (db: AgentsManageDatabaseClient) => (params:
|
|
|
12
12
|
id: string;
|
|
13
13
|
createdAt: string;
|
|
14
14
|
updatedAt: string;
|
|
15
|
+
projectId: string;
|
|
16
|
+
tenantId: string;
|
|
15
17
|
headersSchema: unknown;
|
|
16
18
|
contextVariables: Record<string, ContextFetchDefinition> | null;
|
|
17
19
|
agentId: string;
|
|
18
|
-
projectId: string;
|
|
19
|
-
tenantId: string;
|
|
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
|
+
projectId: string;
|
|
28
|
+
tenantId: string;
|
|
27
29
|
headersSchema: unknown;
|
|
28
30
|
contextVariables: Record<string, ContextFetchDefinition> | null;
|
|
29
31
|
agentId: string;
|
|
30
|
-
projectId: string;
|
|
31
|
-
tenantId: string;
|
|
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
|
+
projectId: string;
|
|
50
|
+
tenantId: string;
|
|
49
51
|
headersSchema: unknown;
|
|
50
52
|
contextVariables: Record<string, ContextFetchDefinition> | null;
|
|
51
53
|
agentId: string;
|
|
52
|
-
projectId: string;
|
|
53
|
-
tenantId: string;
|
|
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
|
+
projectId: string;
|
|
90
|
+
tenantId: string;
|
|
89
91
|
headersSchema: unknown;
|
|
90
92
|
contextVariables: Record<string, ContextFetchDefinition> | null;
|
|
91
93
|
agentId: string;
|
|
92
|
-
projectId: string;
|
|
93
|
-
tenantId: string;
|
|
94
94
|
}>;
|
|
95
95
|
//#endregion
|
|
96
96
|
export { countContextConfigs, createContextConfig, deleteContextConfig, getContextConfigById, hasContextConfig, listContextConfigs, listContextConfigsPaginated, updateContextConfig, upsertContextConfig };
|