@inkeep/agents-core 0.0.0-dev-20251223192148 → 0.0.0-dev-20251223202539
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-validation-schemas.d.ts +146 -146
- package/dist/auth/auth.d.ts +37 -37
- package/dist/auth/permissions.d.ts +13 -13
- package/dist/context/ContextResolver.d.ts +4 -0
- package/dist/context/ContextResolver.js +34 -3
- package/dist/context/index.d.ts +2 -2
- package/dist/context/index.js +2 -2
- package/dist/db/schema.d.ts +288 -288
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/validation/drizzle-schema-helpers.d.ts +3 -3
- package/dist/validation/schemas.d.ts +750 -750
- package/dist/validation/schemas.js +1 -1
- 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" | "member" | "invitation" | "project" | "
|
|
830
|
-
actions:
|
|
829
|
+
authorize<K_1 extends "function" | "organization" | "agent" | "member" | "invitation" | "project" | "tool" | "sub_agent" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins20.Subset<"function" | "organization" | "agent" | "member" | "invitation" | "project" | "tool" | "sub_agent" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "team", better_auth_plugins20.Statements>[key] | {
|
|
830
|
+
actions: better_auth_plugins20.Subset<"function" | "organization" | "agent" | "member" | "invitation" | "project" | "tool" | "sub_agent" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "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" | "member" | "invitation" | "project" | "tool" | "sub_agent" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "team", better_auth_plugins20.Statements>;
|
|
834
834
|
};
|
|
835
835
|
admin: {
|
|
836
|
-
authorize<K_1 extends "function" | "organization" | "agent" | "member" | "invitation" | "project" | "
|
|
837
|
-
actions:
|
|
836
|
+
authorize<K_1 extends "function" | "organization" | "agent" | "member" | "invitation" | "project" | "tool" | "sub_agent" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins20.Subset<"function" | "organization" | "agent" | "member" | "invitation" | "project" | "tool" | "sub_agent" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "team", better_auth_plugins20.Statements>[key] | {
|
|
837
|
+
actions: better_auth_plugins20.Subset<"function" | "organization" | "agent" | "member" | "invitation" | "project" | "tool" | "sub_agent" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "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" | "member" | "invitation" | "project" | "tool" | "sub_agent" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "team", better_auth_plugins20.Statements>;
|
|
841
841
|
};
|
|
842
842
|
owner: {
|
|
843
|
-
authorize<K_1 extends "function" | "organization" | "agent" | "member" | "invitation" | "project" | "
|
|
844
|
-
actions:
|
|
843
|
+
authorize<K_1 extends "function" | "organization" | "agent" | "member" | "invitation" | "project" | "tool" | "sub_agent" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins20.Subset<"function" | "organization" | "agent" | "member" | "invitation" | "project" | "tool" | "sub_agent" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "team", better_auth_plugins20.Statements>[key] | {
|
|
844
|
+
actions: better_auth_plugins20.Subset<"function" | "organization" | "agent" | "member" | "invitation" | "project" | "tool" | "sub_agent" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "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" | "member" | "invitation" | "project" | "tool" | "sub_agent" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "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" | "member" | "invitation" | "project" | "
|
|
1109
|
-
actions:
|
|
1108
|
+
authorize<K_1 extends "function" | "organization" | "agent" | "member" | "invitation" | "project" | "tool" | "sub_agent" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins20.Subset<"function" | "organization" | "agent" | "member" | "invitation" | "project" | "tool" | "sub_agent" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "team", better_auth_plugins20.Statements>[key] | {
|
|
1109
|
+
actions: better_auth_plugins20.Subset<"function" | "organization" | "agent" | "member" | "invitation" | "project" | "tool" | "sub_agent" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "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" | "member" | "invitation" | "project" | "tool" | "sub_agent" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "team", better_auth_plugins20.Statements>;
|
|
1113
1113
|
};
|
|
1114
1114
|
admin: {
|
|
1115
|
-
authorize<K_1 extends "function" | "organization" | "agent" | "member" | "invitation" | "project" | "
|
|
1116
|
-
actions:
|
|
1115
|
+
authorize<K_1 extends "function" | "organization" | "agent" | "member" | "invitation" | "project" | "tool" | "sub_agent" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins20.Subset<"function" | "organization" | "agent" | "member" | "invitation" | "project" | "tool" | "sub_agent" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "team", better_auth_plugins20.Statements>[key] | {
|
|
1116
|
+
actions: better_auth_plugins20.Subset<"function" | "organization" | "agent" | "member" | "invitation" | "project" | "tool" | "sub_agent" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "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" | "member" | "invitation" | "project" | "tool" | "sub_agent" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "team", better_auth_plugins20.Statements>;
|
|
1120
1120
|
};
|
|
1121
1121
|
owner: {
|
|
1122
|
-
authorize<K_1 extends "function" | "organization" | "agent" | "member" | "invitation" | "project" | "
|
|
1123
|
-
actions:
|
|
1122
|
+
authorize<K_1 extends "function" | "organization" | "agent" | "member" | "invitation" | "project" | "tool" | "sub_agent" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins20.Subset<"function" | "organization" | "agent" | "member" | "invitation" | "project" | "tool" | "sub_agent" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "team", better_auth_plugins20.Statements>[key] | {
|
|
1123
|
+
actions: better_auth_plugins20.Subset<"function" | "organization" | "agent" | "member" | "invitation" | "project" | "tool" | "sub_agent" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "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" | "member" | "invitation" | "project" | "tool" | "sub_agent" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "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" | "member" | "invitation" | "project" | "
|
|
8
|
-
actions:
|
|
7
|
+
authorize<K_1 extends "function" | "organization" | "agent" | "member" | "invitation" | "project" | "tool" | "sub_agent" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"function" | "organization" | "agent" | "member" | "invitation" | "project" | "tool" | "sub_agent" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "team", better_auth_plugins0.Statements>[key] | {
|
|
8
|
+
actions: better_auth_plugins0.Subset<"function" | "organization" | "agent" | "member" | "invitation" | "project" | "tool" | "sub_agent" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "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" | "member" | "invitation" | "project" | "tool" | "sub_agent" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "team", better_auth_plugins0.Statements>;
|
|
12
12
|
};
|
|
13
13
|
declare const adminRole: {
|
|
14
|
-
authorize<K_1 extends "function" | "organization" | "agent" | "member" | "invitation" | "project" | "
|
|
15
|
-
actions:
|
|
14
|
+
authorize<K_1 extends "function" | "organization" | "agent" | "member" | "invitation" | "project" | "tool" | "sub_agent" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"function" | "organization" | "agent" | "member" | "invitation" | "project" | "tool" | "sub_agent" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "team", better_auth_plugins0.Statements>[key] | {
|
|
15
|
+
actions: better_auth_plugins0.Subset<"function" | "organization" | "agent" | "member" | "invitation" | "project" | "tool" | "sub_agent" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "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" | "member" | "invitation" | "project" | "tool" | "sub_agent" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "team", better_auth_plugins0.Statements>;
|
|
19
19
|
};
|
|
20
20
|
declare const ownerRole: {
|
|
21
|
-
authorize<K_1 extends "function" | "organization" | "agent" | "member" | "invitation" | "project" | "
|
|
22
|
-
actions:
|
|
21
|
+
authorize<K_1 extends "function" | "organization" | "agent" | "member" | "invitation" | "project" | "tool" | "sub_agent" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"function" | "organization" | "agent" | "member" | "invitation" | "project" | "tool" | "sub_agent" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "team", better_auth_plugins0.Statements>[key] | {
|
|
22
|
+
actions: better_auth_plugins0.Subset<"function" | "organization" | "agent" | "member" | "invitation" | "project" | "tool" | "sub_agent" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "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" | "member" | "invitation" | "project" | "tool" | "sub_agent" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "ac" | "team", better_auth_plugins0.Statements>;
|
|
26
26
|
};
|
|
27
27
|
//#endregion
|
|
28
28
|
export { ac, adminRole, memberRole, ownerRole };
|
|
@@ -3,7 +3,7 @@ import { setSpanWithError } from "../utils/tracer-factory.js";
|
|
|
3
3
|
import "../utils/index.js";
|
|
4
4
|
import { tracer } from "../utils/tracer.js";
|
|
5
5
|
import { ContextCache } from "./contextCache.js";
|
|
6
|
-
import { ContextFetcher } from "./ContextFetcher.js";
|
|
6
|
+
import { ContextFetcher, MissingRequiredVariableError } from "./ContextFetcher.js";
|
|
7
7
|
import crypto from "node:crypto";
|
|
8
8
|
import { SpanStatusCode } from "@opentelemetry/api";
|
|
9
9
|
|
|
@@ -46,6 +46,7 @@ var ContextResolver = class {
|
|
|
46
46
|
cacheHits: [],
|
|
47
47
|
cacheMisses: [],
|
|
48
48
|
errors: [],
|
|
49
|
+
skipped: [],
|
|
49
50
|
totalDurationMs: 0
|
|
50
51
|
};
|
|
51
52
|
result.resolvedContext.headers = result.headers;
|
|
@@ -88,6 +89,27 @@ var ContextResolver = class {
|
|
|
88
89
|
const requestHash = this.createRequestHash(result.headers);
|
|
89
90
|
const fetchPromises = contextVariableEntries.map(([templateKey, definition]) => this.resolveSingleFetchDefinition(contextConfig, definition, templateKey, options, requestHash, result).catch((error) => {
|
|
90
91
|
const errorMessage = error instanceof Error ? error.message : "Unknown error";
|
|
92
|
+
if (error instanceof MissingRequiredVariableError) {
|
|
93
|
+
logger.info({
|
|
94
|
+
contextConfigId: contextConfig.id,
|
|
95
|
+
definitionId: definition.id,
|
|
96
|
+
templateKey,
|
|
97
|
+
reason: errorMessage
|
|
98
|
+
}, "Context fetch skipped due to missing required variable");
|
|
99
|
+
result.skipped.push({
|
|
100
|
+
definitionId: definition.id,
|
|
101
|
+
reason: errorMessage
|
|
102
|
+
});
|
|
103
|
+
if (definition.defaultValue !== void 0) {
|
|
104
|
+
result.resolvedContext[templateKey] = definition.defaultValue;
|
|
105
|
+
logger.info({
|
|
106
|
+
contextConfigId: contextConfig.id,
|
|
107
|
+
definitionId: definition.id,
|
|
108
|
+
templateKey
|
|
109
|
+
}, "Using default value for skipped context variable");
|
|
110
|
+
}
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
91
113
|
logger.error({
|
|
92
114
|
contextConfigId: contextConfig.id,
|
|
93
115
|
definitionId: definition.id,
|
|
@@ -111,7 +133,8 @@ var ContextResolver = class {
|
|
|
111
133
|
result.totalDurationMs = Date.now() - startTime;
|
|
112
134
|
parentSpan.addEvent("context.resolution.completed", {
|
|
113
135
|
resolved_keys: Object.keys(result.resolvedContext),
|
|
114
|
-
fetched_definitions: result.fetchedDefinitions
|
|
136
|
+
fetched_definitions: result.fetchedDefinitions,
|
|
137
|
+
skipped_definitions: result.skipped.map((s) => s.definitionId)
|
|
115
138
|
});
|
|
116
139
|
if (result.errors.length > 0) parentSpan.setStatus({
|
|
117
140
|
code: SpanStatusCode.ERROR,
|
|
@@ -125,6 +148,7 @@ var ContextResolver = class {
|
|
|
125
148
|
cacheHits: result.cacheHits.length,
|
|
126
149
|
cacheMisses: result.cacheMisses.length,
|
|
127
150
|
errors: result.errors.length,
|
|
151
|
+
skipped: result.skipped.length,
|
|
128
152
|
totalDurationMs: result.totalDurationMs
|
|
129
153
|
}, "Context resolution completed");
|
|
130
154
|
return result;
|
|
@@ -193,7 +217,14 @@ var ContextResolver = class {
|
|
|
193
217
|
});
|
|
194
218
|
return data;
|
|
195
219
|
} catch (error) {
|
|
196
|
-
|
|
220
|
+
if (error instanceof MissingRequiredVariableError) {
|
|
221
|
+
parentSpan.setStatus({ code: SpanStatusCode.OK });
|
|
222
|
+
parentSpan.addEvent("context.fetch_skipped", {
|
|
223
|
+
definition_id: definition.id,
|
|
224
|
+
template_key: templateKey,
|
|
225
|
+
reason: error.message
|
|
226
|
+
});
|
|
227
|
+
} else setSpanWithError(parentSpan, error instanceof Error ? error : new Error(String(error)));
|
|
197
228
|
throw error;
|
|
198
229
|
} finally {
|
|
199
230
|
parentSpan.end();
|
package/dist/context/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { DotPaths } from "./validation-helpers.js";
|
|
2
2
|
import { ContextConfigBuilder, ContextConfigBuilderOptions, contextConfig, fetchDefinition, headers } from "./ContextConfig.js";
|
|
3
3
|
import { TemplateContext, TemplateEngine, TemplateRenderOptions } from "./TemplateEngine.js";
|
|
4
|
-
import { ContextFetcher, FetchResult } from "./ContextFetcher.js";
|
|
4
|
+
import { ContextFetcher, FetchResult, MissingRequiredVariableError } from "./ContextFetcher.js";
|
|
5
5
|
import { ContextResolutionOptions, ContextResolutionResult, ContextResolver, ResolvedContext } from "./ContextResolver.js";
|
|
6
6
|
import { determineContextTrigger, handleContextConfigChange, handleContextResolution } from "./context.js";
|
|
7
7
|
import { ContextCache } from "./contextCache.js";
|
|
8
|
-
export { ContextCache, ContextConfigBuilder, type ContextConfigBuilderOptions, ContextFetcher, type ContextResolutionOptions, type ContextResolutionResult, ContextResolver, type DotPaths, type FetchResult, type ResolvedContext, type TemplateContext, TemplateEngine, type TemplateRenderOptions, contextConfig, determineContextTrigger, fetchDefinition, handleContextConfigChange, handleContextResolution, headers };
|
|
8
|
+
export { ContextCache, ContextConfigBuilder, type ContextConfigBuilderOptions, ContextFetcher, type ContextResolutionOptions, type ContextResolutionResult, ContextResolver, type DotPaths, type FetchResult, MissingRequiredVariableError, type ResolvedContext, type TemplateContext, TemplateEngine, type TemplateRenderOptions, contextConfig, determineContextTrigger, fetchDefinition, handleContextConfigChange, handleContextResolution, headers };
|
package/dist/context/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { ContextConfigBuilder, contextConfig, fetchDefinition, headers } from ".
|
|
|
2
2
|
import { TemplateEngine } from "./TemplateEngine.js";
|
|
3
3
|
import { ContextCache } from "./contextCache.js";
|
|
4
4
|
import { ContextResolver } from "./ContextResolver.js";
|
|
5
|
-
import { ContextFetcher } from "./ContextFetcher.js";
|
|
5
|
+
import { ContextFetcher, MissingRequiredVariableError } from "./ContextFetcher.js";
|
|
6
6
|
import { determineContextTrigger, handleContextConfigChange, handleContextResolution } from "./context.js";
|
|
7
7
|
|
|
8
|
-
export { ContextCache, ContextConfigBuilder, ContextFetcher, ContextResolver, TemplateEngine, contextConfig, determineContextTrigger, fetchDefinition, handleContextConfigChange, handleContextResolution, headers };
|
|
8
|
+
export { ContextCache, ContextConfigBuilder, ContextFetcher, ContextResolver, MissingRequiredVariableError, TemplateEngine, contextConfig, determineContextTrigger, fetchDefinition, handleContextConfigChange, handleContextResolution, headers };
|