@inkeep/agents-core 0.58.19 → 0.58.20

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 (33) hide show
  1. package/dist/auth/auth-validation-schemas.d.ts +17 -17
  2. package/dist/auth/auth.d.ts +28 -28
  3. package/dist/auth/permissions.d.ts +13 -13
  4. package/dist/data-access/manage/contextConfigs.d.ts +12 -12
  5. package/dist/data-access/manage/tools.js +4 -2
  6. package/dist/data-access/runtime/cascade-delete.d.ts +4 -0
  7. package/dist/data-access/runtime/cascade-delete.js +27 -1
  8. package/dist/data-access/runtime/conversations.d.ts +7 -7
  9. package/dist/data-access/runtime/messages.d.ts +9 -9
  10. package/dist/data-access/runtime/scheduledTriggerInvocations.d.ts +18 -3
  11. package/dist/data-access/runtime/tasks.d.ts +2 -2
  12. package/dist/data-access/runtime/triggerInvocations.d.ts +5 -0
  13. package/dist/db/manage/manage-schema.d.ts +449 -449
  14. package/dist/db/runtime/runtime-schema.d.ts +440 -332
  15. package/dist/db/runtime/runtime-schema.js +4 -0
  16. package/dist/env.js +7 -0
  17. package/dist/index.d.ts +3 -1
  18. package/dist/index.js +3 -1
  19. package/dist/middleware/no-auth.d.ts +2 -2
  20. package/dist/utils/env-detection.d.ts +6 -0
  21. package/dist/utils/env-detection.js +13 -0
  22. package/dist/utils/index.d.ts +3 -1
  23. package/dist/utils/index.js +3 -1
  24. package/dist/utils/work-app-mcp.d.ts +8 -0
  25. package/dist/utils/work-app-mcp.js +18 -0
  26. package/dist/validation/dolt-schemas.d.ts +1 -1
  27. package/dist/validation/drizzle-schema-helpers.d.ts +3 -3
  28. package/dist/validation/schemas.d.ts +2202 -3990
  29. package/dist/validation/schemas.js +7 -6
  30. package/drizzle/runtime/0023_bumpy_vampiro.sql +4 -0
  31. package/drizzle/runtime/meta/0023_snapshot.json +4264 -0
  32. package/drizzle/runtime/meta/_journal.json +7 -0
  33. package/package.json +1 -1
@@ -1,9 +1,9 @@
1
1
  import { z } from "@hono/zod-openapi";
2
2
  import * as drizzle_orm_pg_core0 from "drizzle-orm/pg-core";
3
- import * as drizzle_zod0 from "drizzle-zod";
3
+ import * as drizzle_zod3 from "drizzle-zod";
4
4
 
5
5
  //#region src/auth/auth-validation-schemas.d.ts
6
- declare const UserSelectSchema: drizzle_zod0.BuildSchema<"select", {
6
+ declare const UserSelectSchema: drizzle_zod3.BuildSchema<"select", {
7
7
  id: drizzle_orm_pg_core0.PgColumn<{
8
8
  name: "id";
9
9
  tableName: "user";
@@ -124,7 +124,7 @@ declare const UserSelectSchema: drizzle_zod0.BuildSchema<"select", {
124
124
  generated: undefined;
125
125
  }, {}, {}>;
126
126
  }, undefined, undefined>;
127
- declare const UserInsertSchema: drizzle_zod0.BuildSchema<"insert", {
127
+ declare const UserInsertSchema: drizzle_zod3.BuildSchema<"insert", {
128
128
  id: drizzle_orm_pg_core0.PgColumn<{
129
129
  name: "id";
130
130
  tableName: "user";
@@ -245,7 +245,7 @@ declare const UserInsertSchema: drizzle_zod0.BuildSchema<"insert", {
245
245
  generated: undefined;
246
246
  }, {}, {}>;
247
247
  }, undefined, undefined>;
248
- declare const SessionSelectSchema: drizzle_zod0.BuildSchema<"select", {
248
+ declare const SessionSelectSchema: drizzle_zod3.BuildSchema<"select", {
249
249
  id: drizzle_orm_pg_core0.PgColumn<{
250
250
  name: "id";
251
251
  tableName: "session";
@@ -400,7 +400,7 @@ declare const SessionSelectSchema: drizzle_zod0.BuildSchema<"select", {
400
400
  generated: undefined;
401
401
  }, {}, {}>;
402
402
  }, undefined, undefined>;
403
- declare const SessionInsertSchema: drizzle_zod0.BuildSchema<"insert", {
403
+ declare const SessionInsertSchema: drizzle_zod3.BuildSchema<"insert", {
404
404
  id: drizzle_orm_pg_core0.PgColumn<{
405
405
  name: "id";
406
406
  tableName: "session";
@@ -555,7 +555,7 @@ declare const SessionInsertSchema: drizzle_zod0.BuildSchema<"insert", {
555
555
  generated: undefined;
556
556
  }, {}, {}>;
557
557
  }, undefined, undefined>;
558
- declare const AccountSelectSchema: drizzle_zod0.BuildSchema<"select", {
558
+ declare const AccountSelectSchema: drizzle_zod3.BuildSchema<"select", {
559
559
  id: drizzle_orm_pg_core0.PgColumn<{
560
560
  name: "id";
561
561
  tableName: "account";
@@ -778,7 +778,7 @@ declare const AccountSelectSchema: drizzle_zod0.BuildSchema<"select", {
778
778
  generated: undefined;
779
779
  }, {}, {}>;
780
780
  }, undefined, undefined>;
781
- declare const AccountInsertSchema: drizzle_zod0.BuildSchema<"insert", {
781
+ declare const AccountInsertSchema: drizzle_zod3.BuildSchema<"insert", {
782
782
  id: drizzle_orm_pg_core0.PgColumn<{
783
783
  name: "id";
784
784
  tableName: "account";
@@ -1001,7 +1001,7 @@ declare const AccountInsertSchema: drizzle_zod0.BuildSchema<"insert", {
1001
1001
  generated: undefined;
1002
1002
  }, {}, {}>;
1003
1003
  }, undefined, undefined>;
1004
- declare const OrganizationSelectSchema: drizzle_zod0.BuildSchema<"select", {
1004
+ declare const OrganizationSelectSchema: drizzle_zod3.BuildSchema<"select", {
1005
1005
  id: drizzle_orm_pg_core0.PgColumn<{
1006
1006
  name: "id";
1007
1007
  tableName: "organization";
@@ -1139,7 +1139,7 @@ declare const OrganizationSelectSchema: drizzle_zod0.BuildSchema<"select", {
1139
1139
  generated: undefined;
1140
1140
  }, {}, {}>;
1141
1141
  }, undefined, undefined>;
1142
- declare const OrganizationInsertSchema: drizzle_zod0.BuildSchema<"insert", {
1142
+ declare const OrganizationInsertSchema: drizzle_zod3.BuildSchema<"insert", {
1143
1143
  id: drizzle_orm_pg_core0.PgColumn<{
1144
1144
  name: "id";
1145
1145
  tableName: "organization";
@@ -1277,7 +1277,7 @@ declare const OrganizationInsertSchema: drizzle_zod0.BuildSchema<"insert", {
1277
1277
  generated: undefined;
1278
1278
  }, {}, {}>;
1279
1279
  }, undefined, undefined>;
1280
- declare const MemberSelectSchema: drizzle_zod0.BuildSchema<"select", {
1280
+ declare const MemberSelectSchema: drizzle_zod3.BuildSchema<"select", {
1281
1281
  id: drizzle_orm_pg_core0.PgColumn<{
1282
1282
  name: "id";
1283
1283
  tableName: "member";
@@ -1364,7 +1364,7 @@ declare const MemberSelectSchema: drizzle_zod0.BuildSchema<"select", {
1364
1364
  generated: undefined;
1365
1365
  }, {}, {}>;
1366
1366
  }, undefined, undefined>;
1367
- declare const MemberInsertSchema: drizzle_zod0.BuildSchema<"insert", {
1367
+ declare const MemberInsertSchema: drizzle_zod3.BuildSchema<"insert", {
1368
1368
  id: drizzle_orm_pg_core0.PgColumn<{
1369
1369
  name: "id";
1370
1370
  tableName: "member";
@@ -1451,7 +1451,7 @@ declare const MemberInsertSchema: drizzle_zod0.BuildSchema<"insert", {
1451
1451
  generated: undefined;
1452
1452
  }, {}, {}>;
1453
1453
  }, undefined, undefined>;
1454
- declare const InvitationSelectSchema: drizzle_zod0.BuildSchema<"select", {
1454
+ declare const InvitationSelectSchema: drizzle_zod3.BuildSchema<"select", {
1455
1455
  id: drizzle_orm_pg_core0.PgColumn<{
1456
1456
  name: "id";
1457
1457
  tableName: "invitation";
@@ -1606,7 +1606,7 @@ declare const InvitationSelectSchema: drizzle_zod0.BuildSchema<"select", {
1606
1606
  generated: undefined;
1607
1607
  }, {}, {}>;
1608
1608
  }, undefined, undefined>;
1609
- declare const InvitationInsertSchema: drizzle_zod0.BuildSchema<"insert", {
1609
+ declare const InvitationInsertSchema: drizzle_zod3.BuildSchema<"insert", {
1610
1610
  id: drizzle_orm_pg_core0.PgColumn<{
1611
1611
  name: "id";
1612
1612
  tableName: "invitation";
@@ -1761,7 +1761,7 @@ declare const InvitationInsertSchema: drizzle_zod0.BuildSchema<"insert", {
1761
1761
  generated: undefined;
1762
1762
  }, {}, {}>;
1763
1763
  }, undefined, undefined>;
1764
- declare const DeviceCodeSelectSchema: drizzle_zod0.BuildSchema<"select", {
1764
+ declare const DeviceCodeSelectSchema: drizzle_zod3.BuildSchema<"select", {
1765
1765
  id: drizzle_orm_pg_core0.PgColumn<{
1766
1766
  name: "id";
1767
1767
  tableName: "device_code";
@@ -1933,7 +1933,7 @@ declare const DeviceCodeSelectSchema: drizzle_zod0.BuildSchema<"select", {
1933
1933
  generated: undefined;
1934
1934
  }, {}, {}>;
1935
1935
  }, undefined, undefined>;
1936
- declare const DeviceCodeInsertSchema: drizzle_zod0.BuildSchema<"insert", {
1936
+ declare const DeviceCodeInsertSchema: drizzle_zod3.BuildSchema<"insert", {
1937
1937
  id: drizzle_orm_pg_core0.PgColumn<{
1938
1938
  name: "id";
1939
1939
  tableName: "device_code";
@@ -2105,7 +2105,7 @@ declare const DeviceCodeInsertSchema: drizzle_zod0.BuildSchema<"insert", {
2105
2105
  generated: undefined;
2106
2106
  }, {}, {}>;
2107
2107
  }, undefined, undefined>;
2108
- declare const VerificationSelectSchema: drizzle_zod0.BuildSchema<"select", {
2108
+ declare const VerificationSelectSchema: drizzle_zod3.BuildSchema<"select", {
2109
2109
  id: drizzle_orm_pg_core0.PgColumn<{
2110
2110
  name: "id";
2111
2111
  tableName: "verification";
@@ -2209,7 +2209,7 @@ declare const VerificationSelectSchema: drizzle_zod0.BuildSchema<"select", {
2209
2209
  generated: undefined;
2210
2210
  }, {}, {}>;
2211
2211
  }, undefined, undefined>;
2212
- declare const VerificationInsertSchema: drizzle_zod0.BuildSchema<"insert", {
2212
+ declare const VerificationInsertSchema: drizzle_zod3.BuildSchema<"insert", {
2213
2213
  id: drizzle_orm_pg_core0.PgColumn<{
2214
2214
  name: "id";
2215
2215
  tableName: "verification";
@@ -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 better_auth_plugins20 from "better-auth/plugins";
7
+ import * as better_auth_plugins0 from "better-auth/plugins";
8
8
  import { GoogleOptions } from "better-auth/social-providers";
9
9
 
10
10
  //#region src/auth/auth.d.ts
@@ -277,7 +277,7 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
277
277
  handler: (inputContext: better_auth0.MiddlewareInputContext<better_auth0.MiddlewareOptions>) => Promise<void>;
278
278
  }[];
279
279
  };
280
- options: better_auth_plugins20.BearerOptions | undefined;
280
+ options: better_auth_plugins0.BearerOptions | undefined;
281
281
  }, {
282
282
  id: "sso";
283
283
  endpoints: {
@@ -1268,30 +1268,30 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
1268
1268
  handler: (inputContext: better_auth0.MiddlewareInputContext<better_auth0.MiddlewareOptions>) => Promise<void>;
1269
1269
  }[];
1270
1270
  };
1271
- }, better_auth_plugins20.DefaultOrganizationPlugin<{
1271
+ }, better_auth_plugins0.DefaultOrganizationPlugin<{
1272
1272
  allowUserToCreateOrganization: true;
1273
- ac: better_auth_plugins20.AccessControl;
1273
+ ac: better_auth_plugins0.AccessControl;
1274
1274
  roles: {
1275
1275
  member: {
1276
- authorize<K_1 extends "project" | "organization" | "team" | "member" | "ac" | "invitation">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins20.Subset<"project" | "organization" | "team" | "member" | "ac" | "invitation", better_auth_plugins20.Statements>[key] | {
1277
- actions: better_auth_plugins20.Subset<"project" | "organization" | "team" | "member" | "ac" | "invitation", better_auth_plugins20.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];
1278
1278
  connector: "OR" | "AND";
1279
- } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins20.AuthorizeResponse;
1280
- statements: better_auth_plugins20.Subset<"project" | "organization" | "team" | "member" | "ac" | "invitation", better_auth_plugins20.Statements>;
1279
+ } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
1280
+ statements: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>;
1281
1281
  };
1282
1282
  admin: {
1283
- authorize<K_1 extends "project" | "organization" | "team" | "member" | "ac" | "invitation">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins20.Subset<"project" | "organization" | "team" | "member" | "ac" | "invitation", better_auth_plugins20.Statements>[key] | {
1284
- actions: better_auth_plugins20.Subset<"project" | "organization" | "team" | "member" | "ac" | "invitation", better_auth_plugins20.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];
1285
1285
  connector: "OR" | "AND";
1286
- } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins20.AuthorizeResponse;
1287
- statements: better_auth_plugins20.Subset<"project" | "organization" | "team" | "member" | "ac" | "invitation", better_auth_plugins20.Statements>;
1286
+ } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
1287
+ statements: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>;
1288
1288
  };
1289
1289
  owner: {
1290
- authorize<K_1 extends "project" | "organization" | "team" | "member" | "ac" | "invitation">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins20.Subset<"project" | "organization" | "team" | "member" | "ac" | "invitation", better_auth_plugins20.Statements>[key] | {
1291
- actions: better_auth_plugins20.Subset<"project" | "organization" | "team" | "member" | "ac" | "invitation", better_auth_plugins20.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];
1292
1292
  connector: "OR" | "AND";
1293
- } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins20.AuthorizeResponse;
1294
- statements: better_auth_plugins20.Subset<"project" | "organization" | "team" | "member" | "ac" | "invitation", better_auth_plugins20.Statements>;
1293
+ } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
1294
+ statements: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>;
1295
1295
  };
1296
1296
  };
1297
1297
  creatorRole: "admin";
@@ -1302,9 +1302,9 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
1302
1302
  id: string;
1303
1303
  role: string;
1304
1304
  email: string;
1305
- organization: better_auth_plugins20.Organization;
1306
- invitation: better_auth_plugins20.Invitation;
1307
- inviter: better_auth_plugins20.Member & {
1305
+ organization: better_auth_plugins0.Organization;
1306
+ invitation: better_auth_plugins0.Invitation;
1307
+ inviter: better_auth_plugins0.Member & {
1308
1308
  user: better_auth0.User;
1309
1309
  };
1310
1310
  }): Promise<void>;
@@ -1339,28 +1339,28 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
1339
1339
  user,
1340
1340
  organization: org
1341
1341
  }: {
1342
- invitation: better_auth_plugins20.Invitation & Record<string, any>;
1343
- member: better_auth_plugins20.Member & Record<string, any>;
1342
+ invitation: better_auth_plugins0.Invitation & Record<string, any>;
1343
+ member: better_auth_plugins0.Member & Record<string, any>;
1344
1344
  user: better_auth0.User & Record<string, any>;
1345
- organization: better_auth_plugins20.Organization & Record<string, any>;
1345
+ organization: better_auth_plugins0.Organization & Record<string, any>;
1346
1346
  }) => Promise<void>;
1347
1347
  beforeUpdateMemberRole: ({
1348
1348
  member,
1349
1349
  organization: org,
1350
1350
  newRole
1351
1351
  }: {
1352
- member: better_auth_plugins20.Member & Record<string, any>;
1352
+ member: better_auth_plugins0.Member & Record<string, any>;
1353
1353
  newRole: string;
1354
1354
  user: better_auth0.User & Record<string, any>;
1355
- organization: better_auth_plugins20.Organization & Record<string, any>;
1355
+ organization: better_auth_plugins0.Organization & Record<string, any>;
1356
1356
  }) => Promise<void>;
1357
1357
  beforeRemoveMember: ({
1358
1358
  member,
1359
1359
  organization: org
1360
1360
  }: {
1361
- member: better_auth_plugins20.Member & Record<string, any>;
1361
+ member: better_auth_plugins0.Member & Record<string, any>;
1362
1362
  user: better_auth0.User & Record<string, any>;
1363
- organization: better_auth_plugins20.Organization & Record<string, any>;
1363
+ organization: better_auth_plugins0.Organization & Record<string, any>;
1364
1364
  }) => Promise<void>;
1365
1365
  };
1366
1366
  }>, {
@@ -1701,8 +1701,8 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
1701
1701
  readonly AUTHENTICATION_REQUIRED: "Authentication required";
1702
1702
  };
1703
1703
  options: Partial<{
1704
- expiresIn: better_auth_plugins20.TimeString;
1705
- interval: better_auth_plugins20.TimeString;
1704
+ expiresIn: better_auth_plugins0.TimeString;
1705
+ interval: better_auth_plugins0.TimeString;
1706
1706
  deviceCodeLength: number;
1707
1707
  userCodeLength: number;
1708
1708
  schema: {
@@ -1,29 +1,29 @@
1
- import * as better_auth_plugins0 from "better-auth/plugins";
1
+ import * as better_auth_plugins35 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 "project" | "organization" | "team" | "member" | "ac" | "invitation">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"project" | "organization" | "team" | "member" | "ac" | "invitation", better_auth_plugins0.Statements>[key] | {
9
- actions: better_auth_plugins0.Subset<"project" | "organization" | "team" | "member" | "ac" | "invitation", better_auth_plugins0.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
- } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
12
- statements: better_auth_plugins0.Subset<"project" | "organization" | "team" | "member" | "ac" | "invitation", better_auth_plugins0.Statements>;
11
+ } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins35.AuthorizeResponse;
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 "project" | "organization" | "team" | "member" | "ac" | "invitation">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"project" | "organization" | "team" | "member" | "ac" | "invitation", better_auth_plugins0.Statements>[key] | {
16
- actions: better_auth_plugins0.Subset<"project" | "organization" | "team" | "member" | "ac" | "invitation", better_auth_plugins0.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
- } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
19
- statements: better_auth_plugins0.Subset<"project" | "organization" | "team" | "member" | "ac" | "invitation", better_auth_plugins0.Statements>;
18
+ } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins35.AuthorizeResponse;
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 "project" | "organization" | "team" | "member" | "ac" | "invitation">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"project" | "organization" | "team" | "member" | "ac" | "invitation", better_auth_plugins0.Statements>[key] | {
23
- actions: better_auth_plugins0.Subset<"project" | "organization" | "team" | "member" | "ac" | "invitation", better_auth_plugins0.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
- } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
26
- statements: better_auth_plugins0.Subset<"project" | "organization" | "team" | "member" | "ac" | "invitation", better_auth_plugins0.Statements>;
25
+ } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins35.AuthorizeResponse;
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 };
@@ -10,25 +10,25 @@ declare const getContextConfigById: (db: AgentsManageDatabaseClient) => (params:
10
10
  id: string;
11
11
  }) => Promise<{
12
12
  id: string;
13
- tenantId: string;
14
- projectId: string;
15
- agentId: string;
16
13
  createdAt: string;
17
14
  updatedAt: string;
15
+ tenantId: string;
16
+ projectId: string;
18
17
  headersSchema: unknown;
19
18
  contextVariables: Record<string, ContextFetchDefinition> | null;
19
+ agentId: string;
20
20
  } | undefined>;
21
21
  declare const listContextConfigs: (db: AgentsManageDatabaseClient) => (params: {
22
22
  scopes: AgentScopeConfig;
23
23
  }) => Promise<{
24
24
  id: string;
25
- tenantId: string;
26
- projectId: string;
27
- agentId: string;
28
25
  createdAt: string;
29
26
  updatedAt: string;
27
+ tenantId: string;
28
+ projectId: string;
30
29
  headersSchema: unknown;
31
30
  contextVariables: Record<string, ContextFetchDefinition> | null;
31
+ agentId: string;
32
32
  }[]>;
33
33
  declare const listContextConfigsPaginated: (db: AgentsManageDatabaseClient) => (params: {
34
34
  scopes: AgentScopeConfig;
@@ -44,13 +44,13 @@ declare const listContextConfigsPaginated: (db: AgentsManageDatabaseClient) => (
44
44
  }>;
45
45
  declare const createContextConfig: (db: AgentsManageDatabaseClient) => (params: ContextConfigInsert) => Promise<{
46
46
  id: string;
47
- tenantId: string;
48
- projectId: string;
49
- agentId: string;
50
47
  createdAt: string;
51
48
  updatedAt: string;
49
+ tenantId: string;
50
+ projectId: string;
52
51
  headersSchema: unknown;
53
52
  contextVariables: Record<string, ContextFetchDefinition> | null;
53
+ agentId: string;
54
54
  }>;
55
55
  declare const updateContextConfig: (db: AgentsManageDatabaseClient) => (params: {
56
56
  scopes: AgentScopeConfig;
@@ -84,13 +84,13 @@ declare const upsertContextConfig: (db: AgentsManageDatabaseClient) => (params:
84
84
  data: ContextConfigInsert;
85
85
  }) => Promise<{
86
86
  id: string;
87
- tenantId: string;
88
- projectId: string;
89
- agentId: string;
90
87
  createdAt: string;
91
88
  updatedAt: string;
89
+ tenantId: string;
90
+ projectId: string;
92
91
  headersSchema: unknown;
93
92
  contextVariables: Record<string, ContextFetchDefinition> | null;
93
+ agentId: string;
94
94
  }>;
95
95
  //#endregion
96
96
  export { countContextConfigs, createContextConfig, deleteContextConfig, getContextConfigById, hasContextConfig, listContextConfigs, listContextConfigsPaginated, updateContextConfig, upsertContextConfig };
@@ -18,6 +18,7 @@ import { toISODateString } from "../../utils/date.js";
18
18
  import { McpClient } from "../../utils/mcp-client.js";
19
19
  import { configureComposioMCPServer } from "../../utils/third-party-mcp-servers/composio-client.js";
20
20
  import { isThirdPartyMCPServerAuthenticated } from "../../utils/third-party-mcp-servers/third-party-check.js";
21
+ import { TRUSTED_WORK_APP_MCP_PATHS, isTrustedWorkAppMcpUrl } from "../../utils/work-app-mcp.js";
21
22
  import "../../utils/index.js";
22
23
  import { isGithubWorkAppTool } from "../runtime/github-work-app-installations.js";
23
24
  import { getCredentialReference, getUserScopedCredentialReference } from "./credentialReferences.js";
@@ -122,14 +123,15 @@ const discoverToolsFromServer = async (tool, credentialReference, credentialStor
122
123
  sessionId: tool.config.mcp.transport?.sessionId
123
124
  };
124
125
  configureComposioMCPServer(serverConfig, tool.tenantId, tool.projectId, tool.credentialScope === "user" ? "user" : "project", userId);
125
- if (isGithubWorkAppTool(tool)) serverConfig.headers = {
126
+ const urlString = String(serverConfig.url);
127
+ if (isGithubWorkAppTool(tool) && isTrustedWorkAppMcpUrl(urlString, TRUSTED_WORK_APP_MCP_PATHS.github, env.INKEEP_AGENTS_API_URL)) serverConfig.headers = {
126
128
  ...serverConfig.headers,
127
129
  "x-inkeep-tool-id": tool.id,
128
130
  "x-inkeep-tenant-id": tool.tenantId,
129
131
  "x-inkeep-project-id": tool.projectId,
130
132
  Authorization: `Bearer ${env.GITHUB_MCP_API_KEY}`
131
133
  };
132
- if (isSlackWorkAppTool(tool)) serverConfig.headers = {
134
+ if (isSlackWorkAppTool(tool) && isTrustedWorkAppMcpUrl(urlString, TRUSTED_WORK_APP_MCP_PATHS.slack, env.INKEEP_AGENTS_API_URL)) serverConfig.headers = {
133
135
  ...serverConfig.headers,
134
136
  "x-inkeep-tool-id": tool.id,
135
137
  "x-inkeep-tenant-id": tool.tenantId,
@@ -10,6 +10,10 @@ type CascadeDeleteResult = {
10
10
  conversationsDeleted: number;
11
11
  tasksDeleted: number;
12
12
  contextCacheDeleted: number;
13
+ triggerInvocationsDeleted: number;
14
+ scheduledTriggerInvocationsDeleted: number;
15
+ datasetRunsDeleted: number;
16
+ evaluationRunsDeleted: number;
13
17
  apiKeysDeleted: number;
14
18
  slackChannelConfigsDeleted: number;
15
19
  slackWorkspaceDefaultsCleared: number;
@@ -1,4 +1,4 @@
1
- import { apiKeys, contextCache, conversations, tasks, workAppGitHubMcpToolAccessMode, workAppGitHubMcpToolRepositoryAccess, workAppGitHubProjectAccessMode, workAppGitHubProjectRepositoryAccess } from "../../db/runtime/runtime-schema.js";
1
+ import { apiKeys, contextCache, conversations, datasetRun, evaluationRun, scheduledTriggerInvocations, tasks, triggerInvocations, workAppGitHubMcpToolAccessMode, workAppGitHubMcpToolRepositoryAccess, workAppGitHubProjectAccessMode, workAppGitHubProjectRepositoryAccess } from "../../db/runtime/runtime-schema.js";
2
2
  import { projectScopedWhere } from "../manage/scope-helpers.js";
3
3
  import { clearAppDefaultsByAgent, clearAppDefaultsByProject, deleteAppsByProject } from "./apps.js";
4
4
  import { deleteSlackMcpToolAccessConfig } from "./slack-work-app-mcp.js";
@@ -18,10 +18,18 @@ const cascadeDeleteByBranch = (db) => async (params) => {
18
18
  const contextCacheResult = await db.delete(contextCache).where(and(projectScopedWhere(contextCache, scopes), sql`${contextCache.ref}->>'name' = ${fullBranchName}`)).returning();
19
19
  const conversationsResult = await db.delete(conversations).where(and(projectScopedWhere(conversations, scopes), sql`${conversations.ref}->>'name' = ${fullBranchName}`)).returning();
20
20
  const tasksResult = await db.delete(tasks).where(and(projectScopedWhere(tasks, scopes), sql`${tasks.ref}->>'name' = ${fullBranchName}`)).returning();
21
+ const triggerInvocationsResult = await db.delete(triggerInvocations).where(and(eq(triggerInvocations.tenantId, scopes.tenantId), eq(triggerInvocations.projectId, scopes.projectId), sql`${triggerInvocations.ref}->>'name' = ${fullBranchName}`)).returning();
22
+ const scheduledTriggerInvocationsResult = await db.delete(scheduledTriggerInvocations).where(and(eq(scheduledTriggerInvocations.tenantId, scopes.tenantId), eq(scheduledTriggerInvocations.projectId, scopes.projectId), sql`${scheduledTriggerInvocations.ref}->>'name' = ${fullBranchName}`)).returning();
23
+ const datasetRunsResult = await db.delete(datasetRun).where(and(eq(datasetRun.tenantId, scopes.tenantId), eq(datasetRun.projectId, scopes.projectId), sql`${datasetRun.ref}->>'name' = ${fullBranchName}`)).returning();
24
+ const evaluationRunsResult = await db.delete(evaluationRun).where(and(eq(evaluationRun.tenantId, scopes.tenantId), eq(evaluationRun.projectId, scopes.projectId), sql`${evaluationRun.ref}->>'name' = ${fullBranchName}`)).returning();
21
25
  return {
22
26
  conversationsDeleted: conversationsResult.length,
23
27
  tasksDeleted: tasksResult.length,
24
28
  contextCacheDeleted: contextCacheResult.length,
29
+ triggerInvocationsDeleted: triggerInvocationsResult.length,
30
+ scheduledTriggerInvocationsDeleted: scheduledTriggerInvocationsResult.length,
31
+ datasetRunsDeleted: datasetRunsResult.length,
32
+ evaluationRunsDeleted: evaluationRunsResult.length,
25
33
  apiKeysDeleted: 0,
26
34
  slackChannelConfigsDeleted: 0,
27
35
  slackWorkspaceDefaultsCleared: 0,
@@ -42,6 +50,10 @@ const cascadeDeleteByProject = (db) => async (params) => {
42
50
  const contextCacheResult = await db.delete(contextCache).where(and(projectScopedWhere(contextCache, scopes), sql`${contextCache.ref}->>'name' = ${fullBranchName}`)).returning();
43
51
  const conversationsResult = await db.delete(conversations).where(and(projectScopedWhere(conversations, scopes), sql`${conversations.ref}->>'name' = ${fullBranchName}`)).returning();
44
52
  const tasksResult = await db.delete(tasks).where(and(projectScopedWhere(tasks, scopes), sql`${tasks.ref}->>'name' = ${fullBranchName}`)).returning();
53
+ const triggerInvocationsResult = await db.delete(triggerInvocations).where(and(eq(triggerInvocations.tenantId, scopes.tenantId), eq(triggerInvocations.projectId, scopes.projectId), sql`${triggerInvocations.ref}->>'name' = ${fullBranchName}`)).returning();
54
+ const scheduledTriggerInvocationsResult = await db.delete(scheduledTriggerInvocations).where(and(eq(scheduledTriggerInvocations.tenantId, scopes.tenantId), eq(scheduledTriggerInvocations.projectId, scopes.projectId), sql`${scheduledTriggerInvocations.ref}->>'name' = ${fullBranchName}`)).returning();
55
+ const datasetRunsResult = await db.delete(datasetRun).where(and(eq(datasetRun.tenantId, scopes.tenantId), eq(datasetRun.projectId, scopes.projectId), sql`${datasetRun.ref}->>'name' = ${fullBranchName}`)).returning();
56
+ const evaluationRunsResult = await db.delete(evaluationRun).where(and(eq(evaluationRun.tenantId, scopes.tenantId), eq(evaluationRun.projectId, scopes.projectId), sql`${evaluationRun.ref}->>'name' = ${fullBranchName}`)).returning();
45
57
  const apiKeysResult = await db.delete(apiKeys).where(projectScopedWhere(apiKeys, scopes)).returning();
46
58
  await cascadeDeleteGitHubAccessByProject(db)({
47
59
  tenantId: scopes.tenantId,
@@ -56,6 +68,10 @@ const cascadeDeleteByProject = (db) => async (params) => {
56
68
  conversationsDeleted: conversationsResult.length,
57
69
  tasksDeleted: tasksResult.length,
58
70
  contextCacheDeleted: contextCacheResult.length,
71
+ triggerInvocationsDeleted: triggerInvocationsResult.length,
72
+ scheduledTriggerInvocationsDeleted: scheduledTriggerInvocationsResult.length,
73
+ datasetRunsDeleted: datasetRunsResult.length,
74
+ evaluationRunsDeleted: evaluationRunsResult.length,
59
75
  apiKeysDeleted: apiKeysResult.length,
60
76
  slackChannelConfigsDeleted,
61
77
  slackWorkspaceDefaultsCleared,
@@ -85,6 +101,8 @@ const cascadeDeleteByAgent = (db) => async (params) => {
85
101
  }
86
102
  }
87
103
  tasksDeleted = (await db.delete(tasks).where(and(projectScopedWhere(tasks, scopes), eq(tasks.agentId, scopes.agentId), sql`${tasks.ref}->>'name' = ${fullBranchName}`)).returning()).length;
104
+ const triggerInvocationsResult = await db.delete(triggerInvocations).where(and(eq(triggerInvocations.tenantId, scopes.tenantId), eq(triggerInvocations.projectId, scopes.projectId), eq(triggerInvocations.agentId, scopes.agentId), sql`${triggerInvocations.ref}->>'name' = ${fullBranchName}`)).returning();
105
+ const scheduledTriggerInvocationsResult = await db.delete(scheduledTriggerInvocations).where(and(eq(scheduledTriggerInvocations.tenantId, scopes.tenantId), eq(scheduledTriggerInvocations.projectId, scopes.projectId), eq(scheduledTriggerInvocations.agentId, scopes.agentId), sql`${scheduledTriggerInvocations.ref}->>'name' = ${fullBranchName}`)).returning();
88
106
  apiKeysDeleted = (await db.delete(apiKeys).where(and(projectScopedWhere(apiKeys, scopes), eq(apiKeys.agentId, scopes.agentId))).returning()).length;
89
107
  const appDefaultsCleared = await clearAppDefaultsByAgent(db)(scopes.tenantId, scopes.agentId);
90
108
  const slackChannelConfigsDeleted = await deleteWorkAppSlackChannelAgentConfigsByAgent(db)(scopes.tenantId, scopes.projectId, scopes.agentId);
@@ -94,6 +112,10 @@ const cascadeDeleteByAgent = (db) => async (params) => {
94
112
  conversationsDeleted,
95
113
  tasksDeleted,
96
114
  contextCacheDeleted,
115
+ triggerInvocationsDeleted: triggerInvocationsResult.length,
116
+ scheduledTriggerInvocationsDeleted: scheduledTriggerInvocationsResult.length,
117
+ datasetRunsDeleted: 0,
118
+ evaluationRunsDeleted: 0,
97
119
  apiKeysDeleted,
98
120
  slackChannelConfigsDeleted,
99
121
  slackWorkspaceDefaultsCleared,
@@ -121,6 +143,10 @@ const cascadeDeleteBySubAgent = (db) => async (params) => {
121
143
  conversationsDeleted,
122
144
  tasksDeleted: tasksResult.length,
123
145
  contextCacheDeleted,
146
+ triggerInvocationsDeleted: 0,
147
+ scheduledTriggerInvocationsDeleted: 0,
148
+ datasetRunsDeleted: 0,
149
+ evaluationRunsDeleted: 0,
124
150
  apiKeysDeleted: 0,
125
151
  slackChannelConfigsDeleted: 0,
126
152
  slackWorkspaceDefaultsCleared: 0,
@@ -25,7 +25,7 @@ declare const createConversation: (db: AgentsRunDatabaseClient) => (params: Conv
25
25
  updatedAt: string;
26
26
  metadata: ConversationMetadata | null;
27
27
  ref: {
28
- type: "tag" | "commit" | "branch";
28
+ type: "commit" | "tag" | "branch";
29
29
  name: string;
30
30
  hash: string;
31
31
  } | null;
@@ -44,7 +44,7 @@ declare const updateConversation: (db: AgentsRunDatabaseClient) => (params: {
44
44
  agentId: string | null;
45
45
  activeSubAgentId: string;
46
46
  ref: {
47
- type: "tag" | "commit" | "branch";
47
+ type: "commit" | "tag" | "branch";
48
48
  name: string;
49
49
  hash: string;
50
50
  } | null;
@@ -70,7 +70,7 @@ declare const updateConversationActiveSubAgent: (db: AgentsRunDatabaseClient) =>
70
70
  agentId: string | null;
71
71
  activeSubAgentId: string;
72
72
  ref: {
73
- type: "tag" | "commit" | "branch";
73
+ type: "commit" | "tag" | "branch";
74
74
  name: string;
75
75
  hash: string;
76
76
  } | null;
@@ -94,7 +94,7 @@ declare const getConversation: (db: AgentsRunDatabaseClient) => (params: {
94
94
  updatedAt: string;
95
95
  metadata: ConversationMetadata | null;
96
96
  ref: {
97
- type: "tag" | "commit" | "branch";
97
+ type: "commit" | "tag" | "branch";
98
98
  name: string;
99
99
  hash: string;
100
100
  } | null;
@@ -108,7 +108,7 @@ declare const createOrGetConversation: (db: AgentsRunDatabaseClient) => (input:
108
108
  tenantId: string;
109
109
  id: string;
110
110
  ref: {
111
- type: "tag" | "commit" | "branch";
111
+ type: "commit" | "tag" | "branch";
112
112
  name: string;
113
113
  hash: string;
114
114
  };
@@ -130,7 +130,7 @@ declare const createOrGetConversation: (db: AgentsRunDatabaseClient) => (input:
130
130
  updatedAt: string;
131
131
  metadata: ConversationMetadata | null;
132
132
  ref: {
133
- type: "tag" | "commit" | "branch";
133
+ type: "commit" | "tag" | "branch";
134
134
  name: string;
135
135
  hash: string;
136
136
  } | null;
@@ -162,7 +162,7 @@ declare const getActiveAgentForConversation: (db: AgentsRunDatabaseClient) => (p
162
162
  updatedAt: string;
163
163
  metadata: ConversationMetadata | null;
164
164
  ref: {
165
- type: "tag" | "commit" | "branch";
165
+ type: "commit" | "tag" | "branch";
166
166
  name: string;
167
167
  hash: string;
168
168
  } | null;
@@ -17,17 +17,17 @@ declare const getMessageById: (db: AgentsRunDatabaseClient) => (params: {
17
17
  updatedAt: string;
18
18
  metadata: MessageMetadata | null;
19
19
  content: MessageContent;
20
- role: string;
20
+ conversationId: string;
21
21
  fromSubAgentId: string | null;
22
22
  toSubAgentId: string | null;
23
23
  fromExternalAgentId: string | null;
24
24
  toExternalAgentId: string | null;
25
25
  taskId: string | null;
26
26
  a2aTaskId: string | null;
27
- conversationId: string;
27
+ role: string;
28
+ visibility: string;
28
29
  fromTeamAgentId: string | null;
29
30
  toTeamAgentId: string | null;
30
- visibility: string;
31
31
  messageType: string;
32
32
  parentMessageId: string | null;
33
33
  a2aSessionId: string | null;
@@ -151,17 +151,17 @@ declare const createMessage: (db: AgentsRunDatabaseClient) => (params: {
151
151
  updatedAt: string;
152
152
  metadata: MessageMetadata | null;
153
153
  content: MessageContent;
154
- role: string;
154
+ conversationId: string;
155
155
  fromSubAgentId: string | null;
156
156
  toSubAgentId: string | null;
157
157
  fromExternalAgentId: string | null;
158
158
  toExternalAgentId: string | null;
159
159
  taskId: string | null;
160
160
  a2aTaskId: string | null;
161
- conversationId: string;
161
+ role: string;
162
+ visibility: string;
162
163
  fromTeamAgentId: string | null;
163
164
  toTeamAgentId: string | null;
164
- visibility: string;
165
165
  messageType: string;
166
166
  parentMessageId: string | null;
167
167
  a2aSessionId: string | null;
@@ -204,17 +204,17 @@ declare const deleteMessage: (db: AgentsRunDatabaseClient) => (params: {
204
204
  updatedAt: string;
205
205
  metadata: MessageMetadata | null;
206
206
  content: MessageContent;
207
- role: string;
207
+ conversationId: string;
208
208
  fromSubAgentId: string | null;
209
209
  toSubAgentId: string | null;
210
210
  fromExternalAgentId: string | null;
211
211
  toExternalAgentId: string | null;
212
212
  taskId: string | null;
213
213
  a2aTaskId: string | null;
214
- conversationId: string;
214
+ role: string;
215
+ visibility: string;
215
216
  fromTeamAgentId: string | null;
216
217
  toTeamAgentId: string | null;
217
- visibility: string;
218
218
  messageType: string;
219
219
  parentMessageId: string | null;
220
220
  a2aSessionId: string | null;