@inkeep/agents-core 0.0.0-dev-20260105192809 → 0.0.0-dev-20260105201718
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 +104 -104
- package/dist/auth/auth-validation-schemas.d.ts +146 -146
- package/dist/auth/auth.d.ts +37 -37
- package/dist/auth/permissions.d.ts +13 -13
- package/dist/constants/otel-attributes.d.ts +2 -0
- package/dist/constants/otel-attributes.js +4 -2
- package/dist/constants/signoz-queries.d.ts +1 -0
- package/dist/constants/signoz-queries.js +2 -1
- package/dist/data-access/ledgerArtifacts.d.ts +4 -2
- package/dist/data-access/ledgerArtifacts.js +10 -6
- package/dist/data-access/messages.d.ts +9 -9
- package/dist/data-access/tasks.d.ts +1 -1
- package/dist/db/schema.d.ts +404 -404
- package/dist/types/a2a.d.ts +1 -0
- package/dist/validation/drizzle-schema-helpers.d.ts +3 -3
- package/dist/validation/schemas.d.ts +772 -772
- package/package.json +1 -1
package/dist/auth/auth.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { DatabaseClient } from "../db/client.js";
|
|
|
2
2
|
import * as _better_auth_sso0 from "@better-auth/sso";
|
|
3
3
|
import * as better_auth0 from "better-auth";
|
|
4
4
|
import { BetterAuthAdvancedOptions } from "better-auth";
|
|
5
|
-
import * as
|
|
5
|
+
import * as better_auth_plugins20 from "better-auth/plugins";
|
|
6
6
|
import * as better_auth_social_providers0 from "better-auth/social-providers";
|
|
7
7
|
import { GoogleOptions } from "better-auth/social-providers";
|
|
8
8
|
import * as zod0 from "zod";
|
|
@@ -770,7 +770,7 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
|
|
|
770
770
|
};
|
|
771
771
|
}, {
|
|
772
772
|
id: "oauth-proxy";
|
|
773
|
-
options:
|
|
773
|
+
options: better_auth_plugins20.OAuthProxyOptions | undefined;
|
|
774
774
|
endpoints: {
|
|
775
775
|
oAuthProxy: better_auth0.StrictEndpoint<"/oauth-proxy-callback", {
|
|
776
776
|
method: "GET";
|
|
@@ -821,30 +821,30 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
|
|
|
821
821
|
};
|
|
822
822
|
}, {
|
|
823
823
|
id: "organization";
|
|
824
|
-
endpoints:
|
|
824
|
+
endpoints: better_auth_plugins20.OrganizationEndpoints<{
|
|
825
825
|
allowUserToCreateOrganization: true;
|
|
826
|
-
ac:
|
|
826
|
+
ac: better_auth_plugins20.AccessControl;
|
|
827
827
|
roles: {
|
|
828
828
|
member: {
|
|
829
|
-
authorize<K_1 extends "function" | "organization" | "agent" | "
|
|
830
|
-
actions:
|
|
829
|
+
authorize<K_1 extends "function" | "organization" | "agent" | "project" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "member" | "invitation" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins20.Subset<"function" | "organization" | "agent" | "project" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "member" | "invitation" | "team", better_auth_plugins20.Statements>[key] | {
|
|
830
|
+
actions: better_auth_plugins20.Subset<"function" | "organization" | "agent" | "project" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "member" | "invitation" | "team", better_auth_plugins20.Statements>[key];
|
|
831
831
|
connector: "OR" | "AND";
|
|
832
|
-
} | undefined } : never, connector?: "OR" | "AND"):
|
|
833
|
-
statements:
|
|
832
|
+
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins20.AuthorizeResponse;
|
|
833
|
+
statements: better_auth_plugins20.Subset<"function" | "organization" | "agent" | "project" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "member" | "invitation" | "team", better_auth_plugins20.Statements>;
|
|
834
834
|
};
|
|
835
835
|
admin: {
|
|
836
|
-
authorize<K_1 extends "function" | "organization" | "agent" | "
|
|
837
|
-
actions:
|
|
836
|
+
authorize<K_1 extends "function" | "organization" | "agent" | "project" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "member" | "invitation" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins20.Subset<"function" | "organization" | "agent" | "project" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "member" | "invitation" | "team", better_auth_plugins20.Statements>[key] | {
|
|
837
|
+
actions: better_auth_plugins20.Subset<"function" | "organization" | "agent" | "project" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "member" | "invitation" | "team", better_auth_plugins20.Statements>[key];
|
|
838
838
|
connector: "OR" | "AND";
|
|
839
|
-
} | undefined } : never, connector?: "OR" | "AND"):
|
|
840
|
-
statements:
|
|
839
|
+
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins20.AuthorizeResponse;
|
|
840
|
+
statements: better_auth_plugins20.Subset<"function" | "organization" | "agent" | "project" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "member" | "invitation" | "team", better_auth_plugins20.Statements>;
|
|
841
841
|
};
|
|
842
842
|
owner: {
|
|
843
|
-
authorize<K_1 extends "function" | "organization" | "agent" | "
|
|
844
|
-
actions:
|
|
843
|
+
authorize<K_1 extends "function" | "organization" | "agent" | "project" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "member" | "invitation" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins20.Subset<"function" | "organization" | "agent" | "project" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "member" | "invitation" | "team", better_auth_plugins20.Statements>[key] | {
|
|
844
|
+
actions: better_auth_plugins20.Subset<"function" | "organization" | "agent" | "project" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "member" | "invitation" | "team", better_auth_plugins20.Statements>[key];
|
|
845
845
|
connector: "OR" | "AND";
|
|
846
|
-
} | undefined } : never, connector?: "OR" | "AND"):
|
|
847
|
-
statements:
|
|
846
|
+
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins20.AuthorizeResponse;
|
|
847
|
+
statements: better_auth_plugins20.Subset<"function" | "organization" | "agent" | "project" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "member" | "invitation" | "team", better_auth_plugins20.Statements>;
|
|
848
848
|
};
|
|
849
849
|
};
|
|
850
850
|
membershipLimit: number;
|
|
@@ -854,9 +854,9 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
|
|
|
854
854
|
id: string;
|
|
855
855
|
role: string;
|
|
856
856
|
email: string;
|
|
857
|
-
organization:
|
|
858
|
-
invitation:
|
|
859
|
-
inviter:
|
|
857
|
+
organization: better_auth_plugins20.Organization;
|
|
858
|
+
invitation: better_auth_plugins20.Invitation;
|
|
859
|
+
inviter: better_auth_plugins20.Member & {
|
|
860
860
|
user: better_auth0.User;
|
|
861
861
|
};
|
|
862
862
|
}): Promise<void>;
|
|
@@ -989,7 +989,7 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
|
|
|
989
989
|
organizationId: string;
|
|
990
990
|
email: string;
|
|
991
991
|
role: "member" | "admin" | "owner";
|
|
992
|
-
status:
|
|
992
|
+
status: better_auth_plugins20.InvitationStatus;
|
|
993
993
|
inviterId: string;
|
|
994
994
|
expiresAt: Date;
|
|
995
995
|
createdAt: Date;
|
|
@@ -1028,7 +1028,7 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
|
|
|
1028
1028
|
organizationId: string;
|
|
1029
1029
|
email: string;
|
|
1030
1030
|
role: "member" | "admin" | "owner";
|
|
1031
|
-
status:
|
|
1031
|
+
status: better_auth_plugins20.InvitationStatus;
|
|
1032
1032
|
inviterId: string;
|
|
1033
1033
|
expiresAt: Date;
|
|
1034
1034
|
createdAt: Date;
|
|
@@ -1102,28 +1102,28 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
|
|
|
1102
1102
|
};
|
|
1103
1103
|
options: {
|
|
1104
1104
|
allowUserToCreateOrganization: true;
|
|
1105
|
-
ac:
|
|
1105
|
+
ac: better_auth_plugins20.AccessControl;
|
|
1106
1106
|
roles: {
|
|
1107
1107
|
member: {
|
|
1108
|
-
authorize<K_1 extends "function" | "organization" | "agent" | "
|
|
1109
|
-
actions:
|
|
1108
|
+
authorize<K_1 extends "function" | "organization" | "agent" | "project" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "member" | "invitation" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins20.Subset<"function" | "organization" | "agent" | "project" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "member" | "invitation" | "team", better_auth_plugins20.Statements>[key] | {
|
|
1109
|
+
actions: better_auth_plugins20.Subset<"function" | "organization" | "agent" | "project" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "member" | "invitation" | "team", better_auth_plugins20.Statements>[key];
|
|
1110
1110
|
connector: "OR" | "AND";
|
|
1111
|
-
} | undefined } : never, connector?: "OR" | "AND"):
|
|
1112
|
-
statements:
|
|
1111
|
+
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins20.AuthorizeResponse;
|
|
1112
|
+
statements: better_auth_plugins20.Subset<"function" | "organization" | "agent" | "project" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "member" | "invitation" | "team", better_auth_plugins20.Statements>;
|
|
1113
1113
|
};
|
|
1114
1114
|
admin: {
|
|
1115
|
-
authorize<K_1 extends "function" | "organization" | "agent" | "
|
|
1116
|
-
actions:
|
|
1115
|
+
authorize<K_1 extends "function" | "organization" | "agent" | "project" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "member" | "invitation" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins20.Subset<"function" | "organization" | "agent" | "project" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "member" | "invitation" | "team", better_auth_plugins20.Statements>[key] | {
|
|
1116
|
+
actions: better_auth_plugins20.Subset<"function" | "organization" | "agent" | "project" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "member" | "invitation" | "team", better_auth_plugins20.Statements>[key];
|
|
1117
1117
|
connector: "OR" | "AND";
|
|
1118
|
-
} | undefined } : never, connector?: "OR" | "AND"):
|
|
1119
|
-
statements:
|
|
1118
|
+
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins20.AuthorizeResponse;
|
|
1119
|
+
statements: better_auth_plugins20.Subset<"function" | "organization" | "agent" | "project" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "member" | "invitation" | "team", better_auth_plugins20.Statements>;
|
|
1120
1120
|
};
|
|
1121
1121
|
owner: {
|
|
1122
|
-
authorize<K_1 extends "function" | "organization" | "agent" | "
|
|
1123
|
-
actions:
|
|
1122
|
+
authorize<K_1 extends "function" | "organization" | "agent" | "project" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "member" | "invitation" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins20.Subset<"function" | "organization" | "agent" | "project" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "member" | "invitation" | "team", better_auth_plugins20.Statements>[key] | {
|
|
1123
|
+
actions: better_auth_plugins20.Subset<"function" | "organization" | "agent" | "project" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "member" | "invitation" | "team", better_auth_plugins20.Statements>[key];
|
|
1124
1124
|
connector: "OR" | "AND";
|
|
1125
|
-
} | undefined } : never, connector?: "OR" | "AND"):
|
|
1126
|
-
statements:
|
|
1125
|
+
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins20.AuthorizeResponse;
|
|
1126
|
+
statements: better_auth_plugins20.Subset<"function" | "organization" | "agent" | "project" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "member" | "invitation" | "team", better_auth_plugins20.Statements>;
|
|
1127
1127
|
};
|
|
1128
1128
|
};
|
|
1129
1129
|
membershipLimit: number;
|
|
@@ -1133,9 +1133,9 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
|
|
|
1133
1133
|
id: string;
|
|
1134
1134
|
role: string;
|
|
1135
1135
|
email: string;
|
|
1136
|
-
organization:
|
|
1137
|
-
invitation:
|
|
1138
|
-
inviter:
|
|
1136
|
+
organization: better_auth_plugins20.Organization;
|
|
1137
|
+
invitation: better_auth_plugins20.Invitation;
|
|
1138
|
+
inviter: better_auth_plugins20.Member & {
|
|
1139
1139
|
user: better_auth0.User;
|
|
1140
1140
|
};
|
|
1141
1141
|
}): Promise<void>;
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as better_auth_plugins0 from "better-auth/plugins";
|
|
2
2
|
import { AccessControl } from "better-auth/plugins/access";
|
|
3
3
|
|
|
4
4
|
//#region src/auth/permissions.d.ts
|
|
5
5
|
declare const ac: AccessControl;
|
|
6
6
|
declare const memberRole: {
|
|
7
|
-
authorize<K_1 extends "function" | "organization" | "agent" | "
|
|
8
|
-
actions:
|
|
7
|
+
authorize<K_1 extends "function" | "organization" | "agent" | "project" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "member" | "invitation" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"function" | "organization" | "agent" | "project" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "member" | "invitation" | "team", better_auth_plugins0.Statements>[key] | {
|
|
8
|
+
actions: better_auth_plugins0.Subset<"function" | "organization" | "agent" | "project" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "member" | "invitation" | "team", better_auth_plugins0.Statements>[key];
|
|
9
9
|
connector: "OR" | "AND";
|
|
10
|
-
} | undefined } : never, connector?: "OR" | "AND"):
|
|
11
|
-
statements:
|
|
10
|
+
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
|
|
11
|
+
statements: better_auth_plugins0.Subset<"function" | "organization" | "agent" | "project" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "member" | "invitation" | "team", better_auth_plugins0.Statements>;
|
|
12
12
|
};
|
|
13
13
|
declare const adminRole: {
|
|
14
|
-
authorize<K_1 extends "function" | "organization" | "agent" | "
|
|
15
|
-
actions:
|
|
14
|
+
authorize<K_1 extends "function" | "organization" | "agent" | "project" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "member" | "invitation" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"function" | "organization" | "agent" | "project" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "member" | "invitation" | "team", better_auth_plugins0.Statements>[key] | {
|
|
15
|
+
actions: better_auth_plugins0.Subset<"function" | "organization" | "agent" | "project" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "member" | "invitation" | "team", better_auth_plugins0.Statements>[key];
|
|
16
16
|
connector: "OR" | "AND";
|
|
17
|
-
} | undefined } : never, connector?: "OR" | "AND"):
|
|
18
|
-
statements:
|
|
17
|
+
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
|
|
18
|
+
statements: better_auth_plugins0.Subset<"function" | "organization" | "agent" | "project" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "member" | "invitation" | "team", better_auth_plugins0.Statements>;
|
|
19
19
|
};
|
|
20
20
|
declare const ownerRole: {
|
|
21
|
-
authorize<K_1 extends "function" | "organization" | "agent" | "
|
|
22
|
-
actions:
|
|
21
|
+
authorize<K_1 extends "function" | "organization" | "agent" | "project" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "member" | "invitation" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"function" | "organization" | "agent" | "project" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "member" | "invitation" | "team", better_auth_plugins0.Statements>[key] | {
|
|
22
|
+
actions: better_auth_plugins0.Subset<"function" | "organization" | "agent" | "project" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "member" | "invitation" | "team", better_auth_plugins0.Statements>[key];
|
|
23
23
|
connector: "OR" | "AND";
|
|
24
|
-
} | undefined } : never, connector?: "OR" | "AND"):
|
|
25
|
-
statements:
|
|
24
|
+
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
|
|
25
|
+
statements: better_auth_plugins0.Subset<"function" | "organization" | "agent" | "project" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "member" | "invitation" | "team", better_auth_plugins0.Statements>;
|
|
26
26
|
};
|
|
27
27
|
//#endregion
|
|
28
28
|
export { ac, adminRole, memberRole, ownerRole };
|
|
@@ -14,6 +14,7 @@ declare const SPAN_NAMES: {
|
|
|
14
14
|
readonly TOOL_APPROVAL_REQUESTED: "tool.approval_requested";
|
|
15
15
|
readonly TOOL_APPROVAL_APPROVED: "tool.approval_approved";
|
|
16
16
|
readonly TOOL_APPROVAL_DENIED: "tool.approval_denied";
|
|
17
|
+
readonly COMPRESSOR_SAFE_COMPRESS: "compressor.safe_compress";
|
|
17
18
|
};
|
|
18
19
|
declare const AI_OPERATIONS: {
|
|
19
20
|
readonly GENERATE_TEXT: "ai.generateText.doGenerate";
|
|
@@ -113,6 +114,7 @@ declare const ACTIVITY_TYPES: {
|
|
|
113
114
|
readonly TOOL_APPROVAL_REQUESTED: "tool_approval_requested";
|
|
114
115
|
readonly TOOL_APPROVAL_APPROVED: "tool_approval_approved";
|
|
115
116
|
readonly TOOL_APPROVAL_DENIED: "tool_approval_denied";
|
|
117
|
+
readonly COMPRESSION: "compression";
|
|
116
118
|
};
|
|
117
119
|
/** Activity Status Values */
|
|
118
120
|
declare const ACTIVITY_STATUS: {
|
|
@@ -13,7 +13,8 @@ const SPAN_NAMES = {
|
|
|
13
13
|
ARTIFACT_PROCESSING: "agent_session.process_artifact",
|
|
14
14
|
TOOL_APPROVAL_REQUESTED: "tool.approval_requested",
|
|
15
15
|
TOOL_APPROVAL_APPROVED: "tool.approval_approved",
|
|
16
|
-
TOOL_APPROVAL_DENIED: "tool.approval_denied"
|
|
16
|
+
TOOL_APPROVAL_DENIED: "tool.approval_denied",
|
|
17
|
+
COMPRESSOR_SAFE_COMPRESS: "compressor.safe_compress"
|
|
17
18
|
};
|
|
18
19
|
const AI_OPERATIONS = {
|
|
19
20
|
GENERATE_TEXT: "ai.generateText.doGenerate",
|
|
@@ -112,7 +113,8 @@ const ACTIVITY_TYPES = {
|
|
|
112
113
|
AI_MODEL_STREAMED_OBJECT: "ai_model_streamed_object",
|
|
113
114
|
TOOL_APPROVAL_REQUESTED: "tool_approval_requested",
|
|
114
115
|
TOOL_APPROVAL_APPROVED: "tool_approval_approved",
|
|
115
|
-
TOOL_APPROVAL_DENIED: "tool_approval_denied"
|
|
116
|
+
TOOL_APPROVAL_DENIED: "tool_approval_denied",
|
|
117
|
+
COMPRESSION: "compression"
|
|
116
118
|
};
|
|
117
119
|
/** Activity Status Values */
|
|
118
120
|
const ACTIVITY_STATUS = {
|
|
@@ -103,6 +103,7 @@ declare const QUERY_EXPRESSIONS: {
|
|
|
103
103
|
readonly TOOL_APPROVAL_REQUESTED: "toolApprovalRequested";
|
|
104
104
|
readonly TOOL_APPROVAL_APPROVED: "toolApprovalApproved";
|
|
105
105
|
readonly TOOL_APPROVAL_DENIED: "toolApprovalDenied";
|
|
106
|
+
readonly COMPRESSION: "compression";
|
|
106
107
|
};
|
|
107
108
|
/** Query Reduce Operations */
|
|
108
109
|
declare const REDUCE_OPERATIONS: {
|
|
@@ -102,7 +102,8 @@ const QUERY_EXPRESSIONS = {
|
|
|
102
102
|
ARTIFACT_PROCESSING: "artifactProcessing",
|
|
103
103
|
TOOL_APPROVAL_REQUESTED: "toolApprovalRequested",
|
|
104
104
|
TOOL_APPROVAL_APPROVED: "toolApprovalApproved",
|
|
105
|
-
TOOL_APPROVAL_DENIED: "toolApprovalDenied"
|
|
105
|
+
TOOL_APPROVAL_DENIED: "toolApprovalDenied",
|
|
106
|
+
COMPRESSION: "compression"
|
|
106
107
|
};
|
|
107
108
|
/** Query Reduce Operations */
|
|
108
109
|
const REDUCE_OPERATIONS = {
|
|
@@ -29,13 +29,15 @@ declare const addLedgerArtifacts: (db: DatabaseClient) => (params: {
|
|
|
29
29
|
artifacts: Artifact[];
|
|
30
30
|
}) => Promise<void>;
|
|
31
31
|
/**
|
|
32
|
-
* Retrieve artifacts by taskId, toolCallId, and/or artifactId.
|
|
33
|
-
* At least one of taskId, toolCallId, or artifactId must be provided.
|
|
32
|
+
* Retrieve artifacts by taskId, toolCallId, toolCallIds, and/or artifactId.
|
|
33
|
+
* At least one of taskId, toolCallId, toolCallIds, or artifactId must be provided.
|
|
34
|
+
* Use toolCallIds for batch queries to avoid N+1 query problems.
|
|
34
35
|
*/
|
|
35
36
|
declare const getLedgerArtifacts: (db: DatabaseClient) => (params: {
|
|
36
37
|
scopes: ProjectScopeConfig;
|
|
37
38
|
taskId?: string;
|
|
38
39
|
toolCallId?: string;
|
|
40
|
+
toolCallIds?: string[];
|
|
39
41
|
artifactId?: string;
|
|
40
42
|
}) => Promise<Artifact[]>;
|
|
41
43
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ledgerArtifacts } from "../db/schema.js";
|
|
2
2
|
import { generateId } from "../utils/conversations.js";
|
|
3
|
-
import { and, count, eq } from "drizzle-orm";
|
|
3
|
+
import { and, count, eq, inArray } from "drizzle-orm";
|
|
4
4
|
|
|
5
5
|
//#region src/data-access/ledgerArtifacts.ts
|
|
6
6
|
/**
|
|
@@ -195,16 +195,19 @@ const addLedgerArtifacts = (db) => async (params) => {
|
|
|
195
195
|
throw sanitizedError;
|
|
196
196
|
};
|
|
197
197
|
/**
|
|
198
|
-
* Retrieve artifacts by taskId, toolCallId, and/or artifactId.
|
|
199
|
-
* At least one of taskId, toolCallId, or artifactId must be provided.
|
|
198
|
+
* Retrieve artifacts by taskId, toolCallId, toolCallIds, and/or artifactId.
|
|
199
|
+
* At least one of taskId, toolCallId, toolCallIds, or artifactId must be provided.
|
|
200
|
+
* Use toolCallIds for batch queries to avoid N+1 query problems.
|
|
200
201
|
*/
|
|
201
202
|
const getLedgerArtifacts = (db) => async (params) => {
|
|
202
|
-
const { scopes, taskId, toolCallId, artifactId } = params;
|
|
203
|
-
if (!taskId && !toolCallId && !artifactId) throw new Error("At least one of taskId, toolCallId, or artifactId must be provided");
|
|
203
|
+
const { scopes, taskId, toolCallId, toolCallIds, artifactId } = params;
|
|
204
|
+
if (!taskId && !toolCallId && !toolCallIds && !artifactId) throw new Error("At least one of taskId, toolCallId, toolCallIds, or artifactId must be provided");
|
|
205
|
+
if (toolCallId && toolCallIds) throw new Error("Cannot provide both toolCallId and toolCallIds. Use toolCallIds for batch queries.");
|
|
204
206
|
const conditions = [eq(ledgerArtifacts.tenantId, scopes.tenantId), eq(ledgerArtifacts.projectId, scopes.projectId)];
|
|
205
207
|
if (artifactId) conditions.push(eq(ledgerArtifacts.id, artifactId));
|
|
206
208
|
if (taskId) conditions.push(eq(ledgerArtifacts.taskId, taskId));
|
|
207
209
|
if (toolCallId) conditions.push(eq(ledgerArtifacts.toolCallId, toolCallId));
|
|
210
|
+
if (toolCallIds && toolCallIds.length > 0) conditions.push(inArray(ledgerArtifacts.toolCallId, toolCallIds));
|
|
208
211
|
return (await db.select().from(ledgerArtifacts).where(conditions.length > 1 ? and(...conditions) : conditions[0])).map((row) => ({
|
|
209
212
|
artifactId: row.id,
|
|
210
213
|
type: row.type ?? "source",
|
|
@@ -213,7 +216,8 @@ const getLedgerArtifacts = (db) => async (params) => {
|
|
|
213
216
|
name: row.name ?? void 0,
|
|
214
217
|
description: row.description ?? void 0,
|
|
215
218
|
parts: row.parts ?? [],
|
|
216
|
-
metadata: row.metadata || {}
|
|
219
|
+
metadata: row.metadata || {},
|
|
220
|
+
createdAt: row.createdAt
|
|
217
221
|
}));
|
|
218
222
|
};
|
|
219
223
|
/**
|
|
@@ -16,19 +16,19 @@ declare const getMessageById: (db: DatabaseClient) => (params: {
|
|
|
16
16
|
updatedAt: string;
|
|
17
17
|
metadata: MessageMetadata | null;
|
|
18
18
|
content: MessageContent;
|
|
19
|
+
role: string;
|
|
19
20
|
conversationId: string;
|
|
20
21
|
fromSubAgentId: string | null;
|
|
21
22
|
toSubAgentId: string | null;
|
|
22
23
|
fromExternalAgentId: string | null;
|
|
23
24
|
toExternalAgentId: string | null;
|
|
24
|
-
taskId: string | null;
|
|
25
|
-
a2aTaskId: string | null;
|
|
26
|
-
role: string;
|
|
27
25
|
fromTeamAgentId: string | null;
|
|
28
26
|
toTeamAgentId: string | null;
|
|
29
27
|
visibility: string;
|
|
30
28
|
messageType: string;
|
|
29
|
+
taskId: string | null;
|
|
31
30
|
parentMessageId: string | null;
|
|
31
|
+
a2aTaskId: string | null;
|
|
32
32
|
a2aSessionId: string | null;
|
|
33
33
|
} | undefined>;
|
|
34
34
|
declare const listMessages: (db: DatabaseClient) => (params: {
|
|
@@ -147,19 +147,19 @@ declare const createMessage: (db: DatabaseClient) => (params: MessageInsert) =>
|
|
|
147
147
|
updatedAt: string;
|
|
148
148
|
metadata: MessageMetadata | null;
|
|
149
149
|
content: MessageContent;
|
|
150
|
+
role: string;
|
|
150
151
|
conversationId: string;
|
|
151
152
|
fromSubAgentId: string | null;
|
|
152
153
|
toSubAgentId: string | null;
|
|
153
154
|
fromExternalAgentId: string | null;
|
|
154
155
|
toExternalAgentId: string | null;
|
|
155
|
-
taskId: string | null;
|
|
156
|
-
a2aTaskId: string | null;
|
|
157
|
-
role: string;
|
|
158
156
|
fromTeamAgentId: string | null;
|
|
159
157
|
toTeamAgentId: string | null;
|
|
160
158
|
visibility: string;
|
|
161
159
|
messageType: string;
|
|
160
|
+
taskId: string | null;
|
|
162
161
|
parentMessageId: string | null;
|
|
162
|
+
a2aTaskId: string | null;
|
|
163
163
|
a2aSessionId: string | null;
|
|
164
164
|
}>;
|
|
165
165
|
declare const updateMessage: (db: DatabaseClient) => (params: {
|
|
@@ -200,19 +200,19 @@ declare const deleteMessage: (db: DatabaseClient) => (params: {
|
|
|
200
200
|
updatedAt: string;
|
|
201
201
|
metadata: MessageMetadata | null;
|
|
202
202
|
content: MessageContent;
|
|
203
|
+
role: string;
|
|
203
204
|
conversationId: string;
|
|
204
205
|
fromSubAgentId: string | null;
|
|
205
206
|
toSubAgentId: string | null;
|
|
206
207
|
fromExternalAgentId: string | null;
|
|
207
208
|
toExternalAgentId: string | null;
|
|
208
|
-
taskId: string | null;
|
|
209
|
-
a2aTaskId: string | null;
|
|
210
|
-
role: string;
|
|
211
209
|
fromTeamAgentId: string | null;
|
|
212
210
|
toTeamAgentId: string | null;
|
|
213
211
|
visibility: string;
|
|
214
212
|
messageType: string;
|
|
213
|
+
taskId: string | null;
|
|
215
214
|
parentMessageId: string | null;
|
|
215
|
+
a2aTaskId: string | null;
|
|
216
216
|
a2aSessionId: string | null;
|
|
217
217
|
}>;
|
|
218
218
|
declare const countMessagesByConversation: (db: DatabaseClient) => (params: {
|
|
@@ -13,8 +13,8 @@ declare const createTask: (db: DatabaseClient) => (params: TaskInsert) => Promis
|
|
|
13
13
|
createdAt: string;
|
|
14
14
|
updatedAt: string;
|
|
15
15
|
metadata: TaskMetadataConfig | null;
|
|
16
|
-
contextId: string;
|
|
17
16
|
status: string;
|
|
17
|
+
contextId: string;
|
|
18
18
|
subAgentId: string;
|
|
19
19
|
}>;
|
|
20
20
|
declare const getTask: (db: DatabaseClient) => (params: {
|