@inkeep/agents-core 0.70.4 → 0.70.5
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 +154 -154
- package/dist/auth/auth.d.ts +122 -122
- package/dist/auth/auth.js +26 -5
- package/dist/auth/init.js +10 -13
- package/dist/auth/password-policy-rules.d.ts +18 -0
- package/dist/auth/password-policy-rules.js +32 -0
- package/dist/auth/password-policy.d.ts +10 -0
- package/dist/auth/password-policy.js +88 -0
- package/dist/auth/permissions.d.ts +13 -13
- package/dist/data-access/manage/agents.d.ts +31 -31
- package/dist/data-access/manage/artifactComponents.d.ts +14 -14
- package/dist/data-access/manage/contextConfigs.d.ts +12 -12
- package/dist/data-access/manage/dataComponents.d.ts +4 -4
- package/dist/data-access/manage/functionTools.d.ts +18 -18
- package/dist/data-access/manage/skills.d.ts +14 -14
- package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +24 -24
- package/dist/data-access/manage/subAgentRelations.d.ts +28 -28
- package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +24 -24
- package/dist/data-access/manage/subAgents.d.ts +21 -21
- package/dist/data-access/manage/tools.d.ts +33 -33
- package/dist/data-access/manage/triggers.d.ts +2 -2
- package/dist/data-access/runtime/apiKeys.d.ts +20 -20
- package/dist/data-access/runtime/apps.d.ts +8 -8
- package/dist/data-access/runtime/conversations.d.ts +20 -20
- package/dist/data-access/runtime/feedback.d.ts +6 -6
- package/dist/data-access/runtime/messages.d.ts +24 -24
- package/dist/data-access/runtime/scheduledTriggerInvocations.d.ts +4 -4
- package/dist/data-access/runtime/scheduledTriggerUsers.d.ts +1 -1
- package/dist/data-access/runtime/tasks.d.ts +4 -4
- package/dist/db/manage/manage-schema.d.ts +358 -358
- package/dist/db/runtime/runtime-schema.d.ts +391 -391
- package/dist/middleware/inherited-auth.d.ts +5 -5
- package/dist/middleware/no-auth.d.ts +2 -2
- package/dist/setup/setup.js +3 -2
- package/dist/validation/schemas/skills.d.ts +57 -57
- package/dist/validation/schemas.d.ts +2365 -2365
- package/package.json +9 -1
package/dist/auth/auth.js
CHANGED
|
@@ -6,13 +6,14 @@ import { setPasswordResetLink } from "./password-reset-link-store.js";
|
|
|
6
6
|
import { createUserProfileIfNotExists } from "../data-access/runtime/userProfiles.js";
|
|
7
7
|
import { querySsoProviderIds } from "../data-access/runtime/auth.js";
|
|
8
8
|
import { extractCookieDomain, getInitialOrganization, getTrustedOrigins, hasCredentialAccount, shouldAutoProvision } from "./auth-config-utils.js";
|
|
9
|
+
import { passwordPolicyHook } from "./password-policy.js";
|
|
9
10
|
import { ac, adminRole, memberRole, ownerRole } from "./permissions.js";
|
|
10
11
|
import { betterAuth } from "better-auth";
|
|
11
12
|
import { dash } from "@better-auth/infra";
|
|
12
13
|
import { oauthProvider } from "@better-auth/oauth-provider";
|
|
13
14
|
import { sso } from "@better-auth/sso";
|
|
14
15
|
import { drizzleAdapter } from "better-auth/adapters/drizzle";
|
|
15
|
-
import { bearer, deviceAuthorization, jwt, lastLoginMethod, oAuthProxy, organization } from "better-auth/plugins";
|
|
16
|
+
import { bearer, deviceAuthorization, haveIBeenPwned, jwt, lastLoginMethod, oAuthProxy, organization } from "better-auth/plugins";
|
|
16
17
|
|
|
17
18
|
//#region src/auth/auth.ts
|
|
18
19
|
function createAuth(config) {
|
|
@@ -23,11 +24,23 @@ function createAuth(config) {
|
|
|
23
24
|
baseURL: config.baseURL,
|
|
24
25
|
secret: config.secret,
|
|
25
26
|
disabledPaths: ["/token"],
|
|
26
|
-
database:
|
|
27
|
+
database: ((options) => {
|
|
28
|
+
const adapter = drizzleAdapter(config.dbClient, { provider: "pg" })(options);
|
|
29
|
+
return {
|
|
30
|
+
...adapter,
|
|
31
|
+
create: (params) => {
|
|
32
|
+
if (params.model === "organization" && params.data.id && !params.forceAllowId) return adapter.create({
|
|
33
|
+
...params,
|
|
34
|
+
forceAllowId: true
|
|
35
|
+
});
|
|
36
|
+
return adapter.create(params);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
}),
|
|
27
40
|
emailAndPassword: {
|
|
28
41
|
enabled: true,
|
|
29
|
-
minPasswordLength:
|
|
30
|
-
maxPasswordLength:
|
|
42
|
+
minPasswordLength: 15,
|
|
43
|
+
maxPasswordLength: 256,
|
|
31
44
|
requireEmailVerification: false,
|
|
32
45
|
autoSignIn: true,
|
|
33
46
|
resetPasswordTokenExpiresIn: 1800,
|
|
@@ -110,6 +123,7 @@ function createAuth(config) {
|
|
|
110
123
|
...config.advanced
|
|
111
124
|
},
|
|
112
125
|
trustedOrigins: (request) => getTrustedOrigins(config.dbClient, request),
|
|
126
|
+
hooks: { before: passwordPolicyHook },
|
|
113
127
|
plugins: [
|
|
114
128
|
bearer(),
|
|
115
129
|
dash(),
|
|
@@ -224,6 +238,12 @@ function createAuth(config) {
|
|
|
224
238
|
} }
|
|
225
239
|
},
|
|
226
240
|
organizationHooks: {
|
|
241
|
+
beforeCreateOrganization: async ({ organization: org }) => {
|
|
242
|
+
return { data: {
|
|
243
|
+
...org,
|
|
244
|
+
id: org.slug
|
|
245
|
+
} };
|
|
246
|
+
},
|
|
227
247
|
beforeCreateInvitation: async ({ invitation, organization: org }) => {
|
|
228
248
|
const { enforcePerRoleSeatLimit } = await import("./entitlements.js");
|
|
229
249
|
await enforcePerRoleSeatLimit(config.dbClient, org.id, invitation.role);
|
|
@@ -334,7 +354,8 @@ function createAuth(config) {
|
|
|
334
354
|
expiresIn: "60m",
|
|
335
355
|
interval: "5s",
|
|
336
356
|
userCodeLength: 8
|
|
337
|
-
})
|
|
357
|
+
}),
|
|
358
|
+
haveIBeenPwned({ customPasswordCompromisedMessage: "Please choose a more secure password." })
|
|
338
359
|
]
|
|
339
360
|
});
|
|
340
361
|
return instance;
|
package/dist/auth/init.js
CHANGED
|
@@ -6,6 +6,7 @@ import { createAgentsRunDatabaseClient } from "../db/runtime/runtime-client.js";
|
|
|
6
6
|
import { createApp, getAppById } from "../data-access/runtime/apps.js";
|
|
7
7
|
import { addUserToOrganization, upsertOrganization } from "../data-access/runtime/organizations.js";
|
|
8
8
|
import { getUserByEmail } from "../data-access/runtime/users.js";
|
|
9
|
+
import { validatePasswordPolicy } from "./password-policy.js";
|
|
9
10
|
import { createAuth } from "./auth.js";
|
|
10
11
|
import { writeSpiceDbSchema } from "./spicedb-schema.js";
|
|
11
12
|
|
|
@@ -23,7 +24,7 @@ import { writeSpiceDbSchema } from "./spicedb-schema.js";
|
|
|
23
24
|
* - INKEEP_AGENTS_RUN_DATABASE_URL: PostgreSQL connection string
|
|
24
25
|
* - TENANT_ID: Organization/tenant ID (defaults to 'default') - this becomes the org ID
|
|
25
26
|
* - INKEEP_AGENTS_MANAGE_UI_USERNAME: Admin email address
|
|
26
|
-
* - INKEEP_AGENTS_MANAGE_UI_PASSWORD: Admin password (min
|
|
27
|
+
* - INKEEP_AGENTS_MANAGE_UI_PASSWORD: Admin password (min 15 chars, see password policy)
|
|
27
28
|
* - BETTER_AUTH_SECRET: Secret for Better Auth
|
|
28
29
|
*
|
|
29
30
|
* Optional environment variables:
|
|
@@ -56,6 +57,12 @@ async function init() {
|
|
|
56
57
|
console.error(" This secret is used to sign authentication tokens.");
|
|
57
58
|
process.exit(1);
|
|
58
59
|
}
|
|
60
|
+
const passwordViolations = validatePasswordPolicy(password, { userEmail: username });
|
|
61
|
+
if (passwordViolations.length > 0) {
|
|
62
|
+
console.error("❌ INKEEP_AGENTS_MANAGE_UI_PASSWORD does not meet the password policy:");
|
|
63
|
+
for (const v of passwordViolations) console.error(` - ${v.message}`);
|
|
64
|
+
process.exit(1);
|
|
65
|
+
}
|
|
59
66
|
const auth = createAuth({
|
|
60
67
|
baseURL: process.env.INKEEP_AGENTS_API_URL || "http://localhost:3002",
|
|
61
68
|
secret: authSecret,
|
|
@@ -73,18 +80,8 @@ async function init() {
|
|
|
73
80
|
else console.log(` ℹ️ Organization already exists: ${TENANT_ID}`);
|
|
74
81
|
console.log(`\n👤 Creating admin user: ${username}`);
|
|
75
82
|
let user = await getUserByEmail(dbClient)(username);
|
|
76
|
-
if (user) {
|
|
77
|
-
|
|
78
|
-
try {
|
|
79
|
-
const ctx = await auth.$context;
|
|
80
|
-
const hashedPassword = await ctx.password.hash(password);
|
|
81
|
-
await ctx.internalAdapter.updatePassword(user.id, hashedPassword);
|
|
82
|
-
console.log(" ✅ Password synced from .env");
|
|
83
|
-
} catch (error) {
|
|
84
|
-
console.error(" ❌ Failed to sync password from .env:", error);
|
|
85
|
-
process.exit(1);
|
|
86
|
-
}
|
|
87
|
-
} else {
|
|
83
|
+
if (user) console.log(` ℹ️ User already exists: ${username} — skipping creation and password update`);
|
|
84
|
+
else {
|
|
88
85
|
console.log(" Creating user with Better Auth...");
|
|
89
86
|
if (!(await auth.api.signUpEmail({ body: {
|
|
90
87
|
email: username,
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region src/auth/password-policy-rules.d.ts
|
|
2
|
+
declare const MIN_PASSWORD_LENGTH = 15;
|
|
3
|
+
interface PasswordRequirement {
|
|
4
|
+
rule: string;
|
|
5
|
+
label: string;
|
|
6
|
+
test: (password: string) => boolean;
|
|
7
|
+
}
|
|
8
|
+
declare const PASSWORD_REQUIREMENTS: PasswordRequirement[];
|
|
9
|
+
interface PasswordPolicyContext {
|
|
10
|
+
userName?: string;
|
|
11
|
+
userEmail?: string;
|
|
12
|
+
}
|
|
13
|
+
interface PolicyViolation {
|
|
14
|
+
rule: string;
|
|
15
|
+
message: string;
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { MIN_PASSWORD_LENGTH, PASSWORD_REQUIREMENTS, type PasswordPolicyContext, type PasswordRequirement, type PolicyViolation };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
//#region src/auth/password-policy-rules.ts
|
|
2
|
+
const MIN_PASSWORD_LENGTH = 15;
|
|
3
|
+
const PASSWORD_REQUIREMENTS = [
|
|
4
|
+
{
|
|
5
|
+
rule: "minLength",
|
|
6
|
+
label: `At least ${MIN_PASSWORD_LENGTH} characters`,
|
|
7
|
+
test: (p) => p.length >= MIN_PASSWORD_LENGTH
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
rule: "lowercase",
|
|
11
|
+
label: "One lowercase letter",
|
|
12
|
+
test: (p) => /[a-z]/.test(p)
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
rule: "uppercase",
|
|
16
|
+
label: "One uppercase letter",
|
|
17
|
+
test: (p) => /[A-Z]/.test(p)
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
rule: "digit",
|
|
21
|
+
label: "One number",
|
|
22
|
+
test: (p) => /\d/.test(p)
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
rule: "special",
|
|
26
|
+
label: "One special character",
|
|
27
|
+
test: (p) => /[!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?`~]/.test(p)
|
|
28
|
+
}
|
|
29
|
+
];
|
|
30
|
+
|
|
31
|
+
//#endregion
|
|
32
|
+
export { MIN_PASSWORD_LENGTH, PASSWORD_REQUIREMENTS };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { MIN_PASSWORD_LENGTH, PASSWORD_REQUIREMENTS, PasswordPolicyContext, PasswordRequirement, PolicyViolation } from "./password-policy-rules.js";
|
|
2
|
+
import * as better_auth0 from "better-auth";
|
|
3
|
+
|
|
4
|
+
//#region src/auth/password-policy.d.ts
|
|
5
|
+
declare function validatePasswordPolicy(password: string, context?: PasswordPolicyContext): PolicyViolation[];
|
|
6
|
+
declare function enforcePasswordPolicy(password: string, context?: PasswordPolicyContext): void;
|
|
7
|
+
declare const passwordPolicyHook: (inputContext: better_auth0.MiddlewareInputContext<better_auth0.MiddlewareOptions>) => Promise<void>;
|
|
8
|
+
declare function generateCompliantPassword(length?: number): string;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { MIN_PASSWORD_LENGTH, PASSWORD_REQUIREMENTS, type PasswordPolicyContext, type PasswordRequirement, type PolicyViolation, enforcePasswordPolicy, generateCompliantPassword, passwordPolicyHook, validatePasswordPolicy };
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { MIN_PASSWORD_LENGTH, PASSWORD_REQUIREMENTS } from "./password-policy-rules.js";
|
|
2
|
+
import { APIError, createAuthMiddleware } from "better-auth/api";
|
|
3
|
+
import { randomInt } from "node:crypto";
|
|
4
|
+
|
|
5
|
+
//#region src/auth/password-policy.ts
|
|
6
|
+
function validatePasswordPolicy(password, context) {
|
|
7
|
+
const violations = [];
|
|
8
|
+
for (const req of PASSWORD_REQUIREMENTS) if (!req.test(password)) violations.push({
|
|
9
|
+
rule: req.rule,
|
|
10
|
+
message: req.label
|
|
11
|
+
});
|
|
12
|
+
const lower = password.toLowerCase();
|
|
13
|
+
if (context?.userEmail) {
|
|
14
|
+
const localPart = context.userEmail.split("@")[0]?.toLowerCase();
|
|
15
|
+
if (localPart && localPart.length >= 3 && lower.includes(localPart)) violations.push({
|
|
16
|
+
rule: "email",
|
|
17
|
+
message: "Password must not contain your email address"
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
if (context?.userName) {
|
|
21
|
+
const name = context.userName.toLowerCase();
|
|
22
|
+
if (name.length >= 3 && lower.includes(name)) violations.push({
|
|
23
|
+
rule: "name",
|
|
24
|
+
message: "Password must not contain your name"
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
if (lower.includes("inkeep")) violations.push({
|
|
28
|
+
rule: "company",
|
|
29
|
+
message: "Password must not contain the company name"
|
|
30
|
+
});
|
|
31
|
+
return violations;
|
|
32
|
+
}
|
|
33
|
+
function enforcePasswordPolicy(password, context) {
|
|
34
|
+
const violations = validatePasswordPolicy(password, context);
|
|
35
|
+
if (violations.length > 0) throw new APIError("BAD_REQUEST", { message: violations.map((v) => v.message).join("; ") });
|
|
36
|
+
}
|
|
37
|
+
const PASSWORD_POLICY_PATHS = new Set([
|
|
38
|
+
"/sign-up/email",
|
|
39
|
+
"/reset-password",
|
|
40
|
+
"/change-password"
|
|
41
|
+
]);
|
|
42
|
+
function isPlainObject(value) {
|
|
43
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
44
|
+
}
|
|
45
|
+
function readString(body, key) {
|
|
46
|
+
const value = body[key];
|
|
47
|
+
return typeof value === "string" ? value : void 0;
|
|
48
|
+
}
|
|
49
|
+
const passwordPolicyHook = createAuthMiddleware(async (ctx) => {
|
|
50
|
+
if (!PASSWORD_POLICY_PATHS.has(ctx.path)) return;
|
|
51
|
+
if (!isPlainObject(ctx.body)) return;
|
|
52
|
+
const pw = readString(ctx.body, "newPassword") ?? readString(ctx.body, "password");
|
|
53
|
+
if (!pw) return;
|
|
54
|
+
enforcePasswordPolicy(pw, {
|
|
55
|
+
userEmail: readString(ctx.body, "email"),
|
|
56
|
+
userName: readString(ctx.body, "name")
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
const LOWERCASE = "abcdefghijklmnopqrstuvwxyz";
|
|
60
|
+
const UPPERCASE = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
61
|
+
const DIGITS = "0123456789";
|
|
62
|
+
const SPECIALS = "!@#%^&*()_+-[];:,.<>/?~";
|
|
63
|
+
const ALL_CHARS = LOWERCASE + UPPERCASE + DIGITS + SPECIALS;
|
|
64
|
+
function pick(alphabet) {
|
|
65
|
+
return alphabet[randomInt(alphabet.length)];
|
|
66
|
+
}
|
|
67
|
+
function generateCompliantPassword(length = MIN_PASSWORD_LENGTH + 4) {
|
|
68
|
+
if (length < MIN_PASSWORD_LENGTH) throw new Error(`Password length must be at least ${MIN_PASSWORD_LENGTH}`);
|
|
69
|
+
for (let attempt = 0; attempt < 10; attempt++) {
|
|
70
|
+
const chars = [
|
|
71
|
+
pick(LOWERCASE),
|
|
72
|
+
pick(UPPERCASE),
|
|
73
|
+
pick(DIGITS),
|
|
74
|
+
pick(SPECIALS)
|
|
75
|
+
];
|
|
76
|
+
while (chars.length < length) chars.push(pick(ALL_CHARS));
|
|
77
|
+
for (let i = chars.length - 1; i > 0; i--) {
|
|
78
|
+
const j = randomInt(i + 1);
|
|
79
|
+
[chars[i], chars[j]] = [chars[j], chars[i]];
|
|
80
|
+
}
|
|
81
|
+
const password = chars.join("");
|
|
82
|
+
if (validatePasswordPolicy(password).length === 0) return password;
|
|
83
|
+
}
|
|
84
|
+
throw new Error("Failed to generate a policy-compliant password");
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
//#endregion
|
|
88
|
+
export { MIN_PASSWORD_LENGTH, PASSWORD_REQUIREMENTS, enforcePasswordPolicy, generateCompliantPassword, passwordPolicyHook, validatePasswordPolicy };
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as better_auth_plugins0 from "better-auth/plugins";
|
|
2
2
|
import { AccessControl } from "better-auth/plugins/access";
|
|
3
3
|
import { organizationClient } from "better-auth/client/plugins";
|
|
4
4
|
|
|
5
5
|
//#region src/auth/permissions.d.ts
|
|
6
6
|
declare const ac: AccessControl;
|
|
7
7
|
declare const memberRole: {
|
|
8
|
-
authorize<K_1 extends "project" | "organization" | "
|
|
9
|
-
actions:
|
|
8
|
+
authorize<K_1 extends "project" | "organization" | "invitation" | "member" | "team" | "ac">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"project" | "organization" | "invitation" | "member" | "team" | "ac", better_auth_plugins0.Statements>[key] | {
|
|
9
|
+
actions: better_auth_plugins0.Subset<"project" | "organization" | "invitation" | "member" | "team" | "ac", better_auth_plugins0.Statements>[key];
|
|
10
10
|
connector: "OR" | "AND";
|
|
11
|
-
} | undefined } : never, connector?: "OR" | "AND"):
|
|
12
|
-
statements:
|
|
11
|
+
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
|
|
12
|
+
statements: better_auth_plugins0.Subset<"project" | "organization" | "invitation" | "member" | "team" | "ac", better_auth_plugins0.Statements>;
|
|
13
13
|
};
|
|
14
14
|
declare const adminRole: {
|
|
15
|
-
authorize<K_1 extends "project" | "organization" | "
|
|
16
|
-
actions:
|
|
15
|
+
authorize<K_1 extends "project" | "organization" | "invitation" | "member" | "team" | "ac">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"project" | "organization" | "invitation" | "member" | "team" | "ac", better_auth_plugins0.Statements>[key] | {
|
|
16
|
+
actions: better_auth_plugins0.Subset<"project" | "organization" | "invitation" | "member" | "team" | "ac", better_auth_plugins0.Statements>[key];
|
|
17
17
|
connector: "OR" | "AND";
|
|
18
|
-
} | undefined } : never, connector?: "OR" | "AND"):
|
|
19
|
-
statements:
|
|
18
|
+
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
|
|
19
|
+
statements: better_auth_plugins0.Subset<"project" | "organization" | "invitation" | "member" | "team" | "ac", better_auth_plugins0.Statements>;
|
|
20
20
|
};
|
|
21
21
|
declare const ownerRole: {
|
|
22
|
-
authorize<K_1 extends "project" | "organization" | "
|
|
23
|
-
actions:
|
|
22
|
+
authorize<K_1 extends "project" | "organization" | "invitation" | "member" | "team" | "ac">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"project" | "organization" | "invitation" | "member" | "team" | "ac", better_auth_plugins0.Statements>[key] | {
|
|
23
|
+
actions: better_auth_plugins0.Subset<"project" | "organization" | "invitation" | "member" | "team" | "ac", better_auth_plugins0.Statements>[key];
|
|
24
24
|
connector: "OR" | "AND";
|
|
25
|
-
} | undefined } : never, connector?: "OR" | "AND"):
|
|
26
|
-
statements:
|
|
25
|
+
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
|
|
26
|
+
statements: better_auth_plugins0.Subset<"project" | "organization" | "invitation" | "member" | "team" | "ac", better_auth_plugins0.Statements>;
|
|
27
27
|
};
|
|
28
28
|
//#endregion
|
|
29
29
|
export { ac, adminRole, memberRole, organizationClient, ownerRole };
|
|
@@ -10,13 +10,9 @@ import { PgColumn } from "drizzle-orm/pg-core";
|
|
|
10
10
|
declare const getAgentById: (db: AgentsManageDatabaseClient) => (params: {
|
|
11
11
|
scopes: AgentScopeConfig;
|
|
12
12
|
}) => Promise<{
|
|
13
|
-
tenantId: string;
|
|
14
|
-
description: string | null;
|
|
15
|
-
projectId: string;
|
|
16
|
-
name: string;
|
|
17
13
|
id: string;
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
name: string;
|
|
15
|
+
description: string | null;
|
|
20
16
|
models: {
|
|
21
17
|
base?: {
|
|
22
18
|
model?: string | undefined;
|
|
@@ -40,6 +36,10 @@ declare const getAgentById: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
40
36
|
stopWhen: {
|
|
41
37
|
transferCountIs?: number | undefined;
|
|
42
38
|
} | null;
|
|
39
|
+
createdAt: string;
|
|
40
|
+
updatedAt: string;
|
|
41
|
+
tenantId: string;
|
|
42
|
+
projectId: string;
|
|
43
43
|
defaultSubAgentId: string | null;
|
|
44
44
|
contextConfigId: string | null;
|
|
45
45
|
prompt: string | null;
|
|
@@ -63,13 +63,9 @@ declare const getAgentById: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
63
63
|
declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (params: {
|
|
64
64
|
scopes: AgentScopeConfig;
|
|
65
65
|
}) => Promise<{
|
|
66
|
-
tenantId: string;
|
|
67
|
-
description: string | null;
|
|
68
|
-
projectId: string;
|
|
69
|
-
name: string;
|
|
70
66
|
id: string;
|
|
71
|
-
|
|
72
|
-
|
|
67
|
+
name: string;
|
|
68
|
+
description: string | null;
|
|
73
69
|
models: {
|
|
74
70
|
base?: {
|
|
75
71
|
model?: string | undefined;
|
|
@@ -93,6 +89,10 @@ declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (
|
|
|
93
89
|
stopWhen: {
|
|
94
90
|
transferCountIs?: number | undefined;
|
|
95
91
|
} | null;
|
|
92
|
+
createdAt: string;
|
|
93
|
+
updatedAt: string;
|
|
94
|
+
tenantId: string;
|
|
95
|
+
projectId: string;
|
|
96
96
|
defaultSubAgentId: string | null;
|
|
97
97
|
contextConfigId: string | null;
|
|
98
98
|
prompt: string | null;
|
|
@@ -113,14 +113,9 @@ declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (
|
|
|
113
113
|
} | null;
|
|
114
114
|
executionMode: "classic" | "durable";
|
|
115
115
|
defaultSubAgent: {
|
|
116
|
-
tenantId: string;
|
|
117
|
-
description: string | null;
|
|
118
|
-
projectId: string;
|
|
119
|
-
agentId: string;
|
|
120
|
-
name: string;
|
|
121
116
|
id: string;
|
|
122
|
-
|
|
123
|
-
|
|
117
|
+
name: string;
|
|
118
|
+
description: string | null;
|
|
124
119
|
models: {
|
|
125
120
|
base?: {
|
|
126
121
|
model?: string | undefined;
|
|
@@ -144,20 +139,21 @@ declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (
|
|
|
144
139
|
stopWhen: {
|
|
145
140
|
stepCountIs?: number | undefined;
|
|
146
141
|
} | null;
|
|
142
|
+
createdAt: string;
|
|
143
|
+
updatedAt: string;
|
|
144
|
+
tenantId: string;
|
|
145
|
+
projectId: string;
|
|
147
146
|
prompt: string | null;
|
|
147
|
+
agentId: string;
|
|
148
148
|
conversationHistoryConfig: ConversationHistoryConfig | null;
|
|
149
149
|
} | null;
|
|
150
150
|
} | null>;
|
|
151
151
|
declare const listAgents: (db: AgentsManageDatabaseClient) => (params: {
|
|
152
152
|
scopes: ProjectScopeConfig;
|
|
153
153
|
}) => Promise<{
|
|
154
|
-
tenantId: string;
|
|
155
|
-
description: string | null;
|
|
156
|
-
projectId: string;
|
|
157
|
-
name: string;
|
|
158
154
|
id: string;
|
|
159
|
-
|
|
160
|
-
|
|
155
|
+
name: string;
|
|
156
|
+
description: string | null;
|
|
161
157
|
models: {
|
|
162
158
|
base?: {
|
|
163
159
|
model?: string | undefined;
|
|
@@ -181,6 +177,10 @@ declare const listAgents: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
181
177
|
stopWhen: {
|
|
182
178
|
transferCountIs?: number | undefined;
|
|
183
179
|
} | null;
|
|
180
|
+
createdAt: string;
|
|
181
|
+
updatedAt: string;
|
|
182
|
+
tenantId: string;
|
|
183
|
+
projectId: string;
|
|
184
184
|
defaultSubAgentId: string | null;
|
|
185
185
|
contextConfigId: string | null;
|
|
186
186
|
prompt: string | null;
|
|
@@ -281,13 +281,9 @@ declare function listAgentsAcrossProjectMainBranches(db: AgentsManageDatabaseCli
|
|
|
281
281
|
projectIds: string[];
|
|
282
282
|
}): Promise<AvailableAgentInfo[]>;
|
|
283
283
|
declare const createAgent: (db: AgentsManageDatabaseClient) => (data: AgentInsert) => Promise<{
|
|
284
|
-
tenantId: string;
|
|
285
|
-
description: string | null;
|
|
286
|
-
projectId: string;
|
|
287
|
-
name: string;
|
|
288
284
|
id: string;
|
|
289
|
-
|
|
290
|
-
|
|
285
|
+
name: string;
|
|
286
|
+
description: string | null;
|
|
291
287
|
models: {
|
|
292
288
|
base?: {
|
|
293
289
|
model?: string | undefined;
|
|
@@ -311,6 +307,10 @@ declare const createAgent: (db: AgentsManageDatabaseClient) => (data: AgentInser
|
|
|
311
307
|
stopWhen: {
|
|
312
308
|
transferCountIs?: number | undefined;
|
|
313
309
|
} | null;
|
|
310
|
+
createdAt: string;
|
|
311
|
+
updatedAt: string;
|
|
312
|
+
tenantId: string;
|
|
313
|
+
projectId: string;
|
|
314
314
|
defaultSubAgentId: string | null;
|
|
315
315
|
contextConfigId: string | null;
|
|
316
316
|
prompt: string | null;
|
|
@@ -9,11 +9,13 @@ declare const getArtifactComponentById: (db: AgentsManageDatabaseClient) => (par
|
|
|
9
9
|
scopes: ProjectScopeConfig;
|
|
10
10
|
id: string;
|
|
11
11
|
}) => Promise<{
|
|
12
|
-
|
|
12
|
+
id: string;
|
|
13
|
+
name: string;
|
|
13
14
|
description: string | null;
|
|
15
|
+
createdAt: string;
|
|
16
|
+
updatedAt: string;
|
|
17
|
+
tenantId: string;
|
|
14
18
|
projectId: string;
|
|
15
|
-
name: string;
|
|
16
|
-
id: string;
|
|
17
19
|
props: {
|
|
18
20
|
[x: string]: unknown;
|
|
19
21
|
type: "object";
|
|
@@ -26,8 +28,6 @@ declare const getArtifactComponentById: (db: AgentsManageDatabaseClient) => (par
|
|
|
26
28
|
component: string;
|
|
27
29
|
mockData: Record<string, unknown>;
|
|
28
30
|
} | null;
|
|
29
|
-
createdAt: string;
|
|
30
|
-
updatedAt: string;
|
|
31
31
|
} | undefined>;
|
|
32
32
|
declare const listArtifactComponents: (db: AgentsManageDatabaseClient) => (params: {
|
|
33
33
|
scopes: ProjectScopeConfig;
|
|
@@ -65,11 +65,13 @@ declare const listArtifactComponentsPaginated: (db: AgentsManageDatabaseClient)
|
|
|
65
65
|
};
|
|
66
66
|
}>;
|
|
67
67
|
declare const createArtifactComponent: (db: AgentsManageDatabaseClient) => (params: ArtifactComponentInsert) => Promise<{
|
|
68
|
-
|
|
68
|
+
id: string;
|
|
69
|
+
name: string;
|
|
69
70
|
description: string | null;
|
|
71
|
+
createdAt: string;
|
|
72
|
+
updatedAt: string;
|
|
73
|
+
tenantId: string;
|
|
70
74
|
projectId: string;
|
|
71
|
-
name: string;
|
|
72
|
-
id: string;
|
|
73
75
|
props: {
|
|
74
76
|
[x: string]: unknown;
|
|
75
77
|
type: "object";
|
|
@@ -82,8 +84,6 @@ declare const createArtifactComponent: (db: AgentsManageDatabaseClient) => (para
|
|
|
82
84
|
component: string;
|
|
83
85
|
mockData: Record<string, unknown>;
|
|
84
86
|
} | null;
|
|
85
|
-
createdAt: string;
|
|
86
|
-
updatedAt: string;
|
|
87
87
|
}>;
|
|
88
88
|
declare const updateArtifactComponent: (db: AgentsManageDatabaseClient) => (params: {
|
|
89
89
|
scopes: ProjectScopeConfig;
|
|
@@ -141,12 +141,12 @@ declare const associateArtifactComponentWithAgent: (db: AgentsManageDatabaseClie
|
|
|
141
141
|
scopes: SubAgentScopeConfig;
|
|
142
142
|
artifactComponentId: string;
|
|
143
143
|
}) => Promise<{
|
|
144
|
+
id: string;
|
|
145
|
+
createdAt: string;
|
|
144
146
|
tenantId: string;
|
|
145
147
|
projectId: string;
|
|
146
148
|
agentId: string;
|
|
147
149
|
subAgentId: string;
|
|
148
|
-
id: string;
|
|
149
|
-
createdAt: string;
|
|
150
150
|
artifactComponentId: string;
|
|
151
151
|
}>;
|
|
152
152
|
declare const removeArtifactComponentFromAgent: (db: AgentsManageDatabaseClient) => (params: {
|
|
@@ -184,12 +184,12 @@ declare const upsertAgentArtifactComponentRelation: (db: AgentsManageDatabaseCli
|
|
|
184
184
|
scopes: SubAgentScopeConfig;
|
|
185
185
|
artifactComponentId: string;
|
|
186
186
|
}) => Promise<{
|
|
187
|
+
id: string;
|
|
188
|
+
createdAt: string;
|
|
187
189
|
tenantId: string;
|
|
188
190
|
projectId: string;
|
|
189
191
|
agentId: string;
|
|
190
192
|
subAgentId: string;
|
|
191
|
-
id: string;
|
|
192
|
-
createdAt: string;
|
|
193
193
|
artifactComponentId: string;
|
|
194
194
|
} | null>;
|
|
195
195
|
/**
|
|
@@ -9,24 +9,24 @@ declare const getContextConfigById: (db: AgentsManageDatabaseClient) => (params:
|
|
|
9
9
|
scopes: AgentScopeConfig;
|
|
10
10
|
id: string;
|
|
11
11
|
}) => Promise<{
|
|
12
|
-
tenantId: string;
|
|
13
|
-
projectId: string;
|
|
14
|
-
agentId: string;
|
|
15
12
|
id: string;
|
|
16
13
|
createdAt: string;
|
|
17
14
|
updatedAt: string;
|
|
15
|
+
tenantId: string;
|
|
16
|
+
projectId: string;
|
|
17
|
+
agentId: string;
|
|
18
18
|
headersSchema: unknown;
|
|
19
19
|
contextVariables: Record<string, ContextFetchDefinition> | null;
|
|
20
20
|
} | undefined>;
|
|
21
21
|
declare const listContextConfigs: (db: AgentsManageDatabaseClient) => (params: {
|
|
22
22
|
scopes: AgentScopeConfig;
|
|
23
23
|
}) => Promise<{
|
|
24
|
-
tenantId: string;
|
|
25
|
-
projectId: string;
|
|
26
|
-
agentId: string;
|
|
27
24
|
id: string;
|
|
28
25
|
createdAt: string;
|
|
29
26
|
updatedAt: string;
|
|
27
|
+
tenantId: string;
|
|
28
|
+
projectId: string;
|
|
29
|
+
agentId: string;
|
|
30
30
|
headersSchema: unknown;
|
|
31
31
|
contextVariables: Record<string, ContextFetchDefinition> | null;
|
|
32
32
|
}[]>;
|
|
@@ -43,12 +43,12 @@ declare const listContextConfigsPaginated: (db: AgentsManageDatabaseClient) => (
|
|
|
43
43
|
};
|
|
44
44
|
}>;
|
|
45
45
|
declare const createContextConfig: (db: AgentsManageDatabaseClient) => (params: ContextConfigInsert) => Promise<{
|
|
46
|
-
tenantId: string;
|
|
47
|
-
projectId: string;
|
|
48
|
-
agentId: string;
|
|
49
46
|
id: string;
|
|
50
47
|
createdAt: string;
|
|
51
48
|
updatedAt: string;
|
|
49
|
+
tenantId: string;
|
|
50
|
+
projectId: string;
|
|
51
|
+
agentId: string;
|
|
52
52
|
headersSchema: unknown;
|
|
53
53
|
contextVariables: Record<string, ContextFetchDefinition> | null;
|
|
54
54
|
}>;
|
|
@@ -83,12 +83,12 @@ declare const countContextConfigs: (db: AgentsManageDatabaseClient) => (params:
|
|
|
83
83
|
declare const upsertContextConfig: (db: AgentsManageDatabaseClient) => (params: {
|
|
84
84
|
data: ContextConfigInsert;
|
|
85
85
|
}) => Promise<{
|
|
86
|
-
tenantId: string;
|
|
87
|
-
projectId: string;
|
|
88
|
-
agentId: string;
|
|
89
86
|
id: string;
|
|
90
87
|
createdAt: string;
|
|
91
88
|
updatedAt: string;
|
|
89
|
+
tenantId: string;
|
|
90
|
+
projectId: string;
|
|
91
|
+
agentId: string;
|
|
92
92
|
headersSchema: unknown;
|
|
93
93
|
contextVariables: Record<string, ContextFetchDefinition> | null;
|
|
94
94
|
}>;
|
|
@@ -65,12 +65,12 @@ declare const associateDataComponentWithAgent: (db: AgentsManageDatabaseClient)
|
|
|
65
65
|
scopes: SubAgentScopeConfig;
|
|
66
66
|
dataComponentId: string;
|
|
67
67
|
}) => Promise<{
|
|
68
|
+
id: string;
|
|
69
|
+
createdAt: string;
|
|
68
70
|
tenantId: string;
|
|
69
71
|
projectId: string;
|
|
70
72
|
agentId: string;
|
|
71
73
|
subAgentId: string;
|
|
72
|
-
id: string;
|
|
73
|
-
createdAt: string;
|
|
74
74
|
dataComponentId: string;
|
|
75
75
|
}>;
|
|
76
76
|
/**
|
|
@@ -107,12 +107,12 @@ declare const upsertAgentDataComponentRelation: (db: AgentsManageDatabaseClient)
|
|
|
107
107
|
scopes: SubAgentScopeConfig;
|
|
108
108
|
dataComponentId: string;
|
|
109
109
|
}) => Promise<{
|
|
110
|
+
id: string;
|
|
111
|
+
createdAt: string;
|
|
110
112
|
tenantId: string;
|
|
111
113
|
projectId: string;
|
|
112
114
|
agentId: string;
|
|
113
115
|
subAgentId: string;
|
|
114
|
-
id: string;
|
|
115
|
-
createdAt: string;
|
|
116
116
|
dataComponentId: string;
|
|
117
117
|
} | null>;
|
|
118
118
|
/**
|