@inkeep/agents-core 0.52.0 → 0.53.0
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 +107 -107
- package/dist/auth/auth-validation-schemas.d.ts +152 -152
- package/dist/auth/auth.d.ts +57 -57
- package/dist/auth/permissions.d.ts +13 -13
- package/dist/client-exports.d.ts +2 -2
- package/dist/data-access/manage/agents.d.ts +25 -25
- 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 +6 -6
- package/dist/data-access/manage/functionTools.d.ts +16 -16
- package/dist/data-access/manage/skills.d.ts +17 -17
- package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +24 -24
- package/dist/data-access/manage/subAgentRelations.d.ts +22 -22
- package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +24 -24
- package/dist/data-access/manage/subAgents.d.ts +15 -15
- 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 +16 -16
- package/dist/data-access/runtime/conversations.d.ts +24 -24
- package/dist/data-access/runtime/messages.d.ts +18 -18
- package/dist/data-access/runtime/tasks.d.ts +7 -7
- package/dist/db/manage/manage-schema.d.ts +449 -449
- package/dist/db/runtime/runtime-schema.d.ts +290 -290
- package/dist/middleware/no-auth.d.ts +2 -2
- package/dist/setup/setup.js +52 -14
- package/dist/validation/drizzle-schema-helpers.d.ts +3 -3
- package/dist/validation/schemas.d.ts +1827 -1827
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as hono3 from "hono";
|
|
2
2
|
|
|
3
3
|
//#region src/middleware/no-auth.d.ts
|
|
4
|
-
declare const noAuth: () =>
|
|
4
|
+
declare const noAuth: () => hono3.MiddlewareHandler<any, string, {}, Response>;
|
|
5
5
|
//#endregion
|
|
6
6
|
export { noAuth };
|
package/dist/setup/setup.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { loadEnvironmentFiles } from "../env.js";
|
|
2
2
|
import { copyFileSync, existsSync, writeFileSync } from "node:fs";
|
|
3
3
|
import dotenv from "dotenv";
|
|
4
|
-
import { generateKeyPairSync } from "node:crypto";
|
|
4
|
+
import { generateKeyPairSync, randomBytes } from "node:crypto";
|
|
5
5
|
import { promisify } from "node:util";
|
|
6
6
|
import { exec, spawn } from "node:child_process";
|
|
7
7
|
import { readFile, writeFile } from "node:fs/promises";
|
|
@@ -187,16 +187,11 @@ async function ensureEnvFile() {
|
|
|
187
187
|
logSuccess("Created .env from .env.example");
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
|
-
async function
|
|
190
|
+
async function generateSecrets() {
|
|
191
191
|
const envContent = await readFile(".env", "utf-8").catch(() => "");
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
logInfo("JWT keys already configured, skipping generation");
|
|
196
|
-
return;
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
try {
|
|
192
|
+
const lines = envContent.split("\n");
|
|
193
|
+
let modified = false;
|
|
194
|
+
if (!(envContent.includes("INKEEP_AGENTS_TEMP_JWT_PRIVATE_KEY=") && !envContent.includes("# INKEEP_AGENTS_TEMP_JWT_PRIVATE_KEY=") && !!envContent.match(/INKEEP_AGENTS_TEMP_JWT_PRIVATE_KEY=(.+)/)?.[1]?.trim())) try {
|
|
200
195
|
const { privateKey, publicKey } = generateKeyPairSync("rsa", {
|
|
201
196
|
modulusLength: 2048,
|
|
202
197
|
privateKeyEncoding: {
|
|
@@ -210,7 +205,6 @@ async function generateJwtKeys() {
|
|
|
210
205
|
});
|
|
211
206
|
const privateKeyBase64 = Buffer.from(privateKey).toString("base64");
|
|
212
207
|
const publicKeyBase64 = Buffer.from(publicKey).toString("base64");
|
|
213
|
-
const lines = envContent.split("\n");
|
|
214
208
|
let privateKeyFound = false;
|
|
215
209
|
let publicKeyFound = false;
|
|
216
210
|
for (let i = 0; i < lines.length; i++) {
|
|
@@ -225,12 +219,56 @@ async function generateJwtKeys() {
|
|
|
225
219
|
}
|
|
226
220
|
if (!privateKeyFound) lines.push(`INKEEP_AGENTS_TEMP_JWT_PRIVATE_KEY=${privateKeyBase64}`);
|
|
227
221
|
if (!publicKeyFound) lines.push(`INKEEP_AGENTS_TEMP_JWT_PUBLIC_KEY=${publicKeyBase64}`);
|
|
228
|
-
|
|
222
|
+
modified = true;
|
|
229
223
|
logSuccess("JWT keys generated and added to .env");
|
|
230
224
|
} catch (error) {
|
|
231
225
|
logError("Failed to generate JWT keys - playground may not work", error);
|
|
232
226
|
logInfo("You can manually run: pnpm run generate-jwt-keys");
|
|
233
227
|
}
|
|
228
|
+
else logInfo("JWT keys already configured, skipping generation");
|
|
229
|
+
const secretDefs = [
|
|
230
|
+
{
|
|
231
|
+
varName: "INKEEP_AGENTS_JWT_SIGNING_SECRET",
|
|
232
|
+
placeholders: [],
|
|
233
|
+
generate: () => randomBytes(32).toString("hex")
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
varName: "BETTER_AUTH_SECRET",
|
|
237
|
+
placeholders: ["your-secret-key-change-in-production"],
|
|
238
|
+
generate: () => randomBytes(32).toString("hex")
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
varName: "INKEEP_AGENTS_MANAGE_UI_PASSWORD",
|
|
242
|
+
placeholders: ["adminADMIN!@12"],
|
|
243
|
+
generate: () => randomBytes(6).toString("base64url")
|
|
244
|
+
}
|
|
245
|
+
];
|
|
246
|
+
for (const { varName, placeholders, generate } of secretDefs) {
|
|
247
|
+
let found = false;
|
|
248
|
+
for (let i = 0; i < lines.length; i++) if (lines[i].startsWith(`# ${varName}=`) || lines[i].startsWith(`${varName}=`)) {
|
|
249
|
+
found = true;
|
|
250
|
+
if (lines[i].startsWith(`# ${varName}=`)) {
|
|
251
|
+
lines[i] = `${varName}=${generate()}`;
|
|
252
|
+
modified = true;
|
|
253
|
+
break;
|
|
254
|
+
}
|
|
255
|
+
const eqIdx = lines[i].indexOf("=");
|
|
256
|
+
const currentValue = lines[i].substring(eqIdx + 1).trim();
|
|
257
|
+
if (currentValue === "" || placeholders.includes(currentValue)) {
|
|
258
|
+
lines[i] = `${varName}=${generate()}`;
|
|
259
|
+
modified = true;
|
|
260
|
+
}
|
|
261
|
+
break;
|
|
262
|
+
}
|
|
263
|
+
if (!found) {
|
|
264
|
+
lines.push(`${varName}=${generate()}`);
|
|
265
|
+
modified = true;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
if (modified) {
|
|
269
|
+
await writeFile(".env", lines.join("\n"));
|
|
270
|
+
logSuccess("Secrets generated and added to .env");
|
|
271
|
+
}
|
|
234
272
|
}
|
|
235
273
|
async function waitForDockerHealth(composeFile, serviceName, composeCmd, timeout = 3e4) {
|
|
236
274
|
const start = Date.now();
|
|
@@ -461,8 +499,8 @@ async function runSetup(config) {
|
|
|
461
499
|
process.exit(1);
|
|
462
500
|
}
|
|
463
501
|
}
|
|
464
|
-
logStep(2, "Checking
|
|
465
|
-
await
|
|
502
|
+
logStep(2, "Checking secrets");
|
|
503
|
+
await generateSecrets();
|
|
466
504
|
if (config.isCloud) logStep(3, "Cloud setup: Skipping Docker database startup");
|
|
467
505
|
else {
|
|
468
506
|
logStep(3, "Starting databases with Docker");
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { z } from "@hono/zod-openapi";
|
|
2
|
-
import * as
|
|
2
|
+
import * as drizzle_zod15 from "drizzle-zod";
|
|
3
3
|
import { AnySQLiteTable } from "drizzle-orm/sqlite-core";
|
|
4
4
|
|
|
5
5
|
//#region src/validation/drizzle-schema-helpers.d.ts
|
|
6
|
-
declare function createSelectSchemaWithModifiers<T extends AnySQLiteTable>(table: T, overrides?: Partial<Record<keyof T['_']['columns'], (schema: z.ZodTypeAny) => z.ZodTypeAny>>):
|
|
7
|
-
declare function createInsertSchemaWithModifiers<T extends AnySQLiteTable>(table: T, overrides?: Partial<Record<keyof T['_']['columns'], (schema: z.ZodTypeAny) => z.ZodTypeAny>>):
|
|
6
|
+
declare function createSelectSchemaWithModifiers<T extends AnySQLiteTable>(table: T, overrides?: Partial<Record<keyof T['_']['columns'], (schema: z.ZodTypeAny) => z.ZodTypeAny>>): drizzle_zod15.BuildSchema<"select", T["_"]["columns"], drizzle_zod15.BuildRefine<T["_"]["columns"], undefined>, undefined>;
|
|
7
|
+
declare function createInsertSchemaWithModifiers<T extends AnySQLiteTable>(table: T, overrides?: Partial<Record<keyof T['_']['columns'], (schema: z.ZodTypeAny) => z.ZodTypeAny>>): drizzle_zod15.BuildSchema<"insert", T["_"]["columns"], drizzle_zod15.BuildRefine<Pick<T["_"]["columns"], keyof T["$inferInsert"]>, undefined>, undefined>;
|
|
8
8
|
declare const createSelectSchema: typeof createSelectSchemaWithModifiers;
|
|
9
9
|
declare const createInsertSchema: typeof createInsertSchemaWithModifiers;
|
|
10
10
|
/**
|