@inkeep/agents-core 0.58.0 → 0.58.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/dist/auth/auth.d.ts +28 -28
  2. package/dist/auth/permissions.d.ts +13 -13
  3. package/dist/client-exports.d.ts +2 -2
  4. package/dist/constants/allowed-image-formats.d.ts +8 -0
  5. package/dist/constants/allowed-image-formats.js +38 -0
  6. package/dist/constants/models.d.ts +2 -0
  7. package/dist/constants/models.js +2 -0
  8. package/dist/constants/otel-attributes.d.ts +1 -0
  9. package/dist/constants/otel-attributes.js +1 -0
  10. package/dist/data-access/manage/agents.d.ts +16 -16
  11. package/dist/data-access/manage/artifactComponents.d.ts +4 -4
  12. package/dist/data-access/manage/dataComponents.d.ts +2 -2
  13. package/dist/data-access/manage/functionTools.d.ts +4 -4
  14. package/dist/data-access/manage/skills.d.ts +10 -10
  15. package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +12 -12
  16. package/dist/data-access/manage/subAgentRelations.d.ts +4 -4
  17. package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +12 -12
  18. package/dist/data-access/manage/subAgents.d.ts +12 -12
  19. package/dist/data-access/manage/tools.d.ts +12 -12
  20. package/dist/data-access/manage/triggers.d.ts +2 -2
  21. package/dist/data-access/runtime/apiKeys.d.ts +8 -8
  22. package/dist/data-access/runtime/conversations.d.ts +12 -12
  23. package/dist/data-access/runtime/messages.d.ts +6 -6
  24. package/dist/data-access/runtime/tasks.d.ts +3 -3
  25. package/dist/db/manage/manage-schema.d.ts +361 -361
  26. package/dist/db/utils.js +4 -0
  27. package/dist/dolt/migrate-all-branches.js +4 -1
  28. package/dist/dolt/migrate-dolt.js +20 -3
  29. package/dist/middleware/authz-meta.d.ts +2 -2
  30. package/dist/middleware/create-protected-route.d.ts +2 -2
  31. package/dist/middleware/no-auth.d.ts +2 -2
  32. package/dist/validation/drizzle-schema-helpers.d.ts +3 -3
  33. package/dist/validation/schemas.d.ts +1843 -1843
  34. package/package.json +5 -1
package/dist/db/utils.js CHANGED
@@ -27,6 +27,10 @@ const confirmMigration = async (connectionString) => {
27
27
  console.error("❌ Error: Database URL is not set.");
28
28
  process.exit(1);
29
29
  }
30
+ if (process.env.CI === "true") {
31
+ console.log("CI environment detected — skipping interactive confirmation.");
32
+ return true;
33
+ }
30
34
  if (!isLocalhostUrl(connectionString)) {
31
35
  console.warn("⚠️ Warning: Database URL is not pointing to localhost. This operation may modify a production database.");
32
36
  if (!await askConfirmation("Do you want to proceed? (y/n): ")) {
@@ -49,7 +49,7 @@ const main = async () => {
49
49
  await doltCheckout(db)({ branch: branch.name });
50
50
  console.log(format.ok("[OK]"));
51
51
  process.stdout.write(`${format.dim("Action ")} sync schema… `);
52
- const result = await syncSchemaFromMain(db)();
52
+ const result = await syncSchemaFromMain(db)({ autoCommitPending: true });
53
53
  if (result.synced) {
54
54
  syncedCount += 1;
55
55
  console.log(format.ok("[SYNCED]"));
@@ -59,6 +59,7 @@ const main = async () => {
59
59
  console.log(format.err("[FAILED]"));
60
60
  console.log(`${format.dim("Result ")} ${format.err("Error")} ${format.dim(`(${ms(branchStartedAt, Date.now())})`)}`);
61
61
  console.log(`${format.dim("Details")} ${result.error}`);
62
+ break;
62
63
  } else {
63
64
  upToDateCount += 1;
64
65
  console.log(format.warn("[NOOP]"));
@@ -70,12 +71,14 @@ const main = async () => {
70
71
  const message = error instanceof Error ? error.message : String(error);
71
72
  console.log(`${format.dim("Result ")} ${format.err("Error")} ${format.dim(`(${ms(branchStartedAt, Date.now())})`)}`);
72
73
  console.log(`${format.dim("Details")} ${message}`);
74
+ break;
73
75
  }
74
76
  console.log("");
75
77
  }
76
78
  console.log(format.bold("─".repeat(80)));
77
79
  console.log(`${format.bold("Summary")} ${format.ok(`${syncedCount} synced`)}, ${format.warn(`${upToDateCount} up to date`)}, ${errorCount > 0 ? format.err(`${errorCount} failed`) : format.ok("0 failed")}`);
78
80
  console.log(format.dim(`Total: ${ms(startedAt, Date.now())}`));
81
+ if (errorCount > 0) process.exit(1);
79
82
  };
80
83
  main();
81
84
 
@@ -1,7 +1,8 @@
1
1
  import { loadEnvironmentFiles } from "../env.js";
2
2
  import { createAgentsManageDatabaseClient } from "../db/manage/manage-client.js";
3
- import { doltAddAndCommit, doltStatus } from "./commit.js";
3
+ import { doltAddAndCommit, doltReset, doltStatus } from "./commit.js";
4
4
  import { confirmMigration } from "../db/utils.js";
5
+ import { appendFileSync } from "node:fs";
5
6
  import { execSync } from "node:child_process";
6
7
 
7
8
  //#region src/dolt/migrate-dolt.ts
@@ -16,8 +17,24 @@ const commitMigrations = async () => {
16
17
  process.exit(1);
17
18
  }
18
19
  const db = createAgentsManageDatabaseClient({ connectionString });
19
- if ((await doltStatus(db)()).length > 0) await doltAddAndCommit(db)({ message: "Applied database migrations" });
20
- else console.log("ℹ️ No changes to commit - database is up to date\n");
20
+ let migrationsApplied = false;
21
+ try {
22
+ migrationsApplied = (await doltStatus(db)()).length > 0;
23
+ if (migrationsApplied) await doltAddAndCommit(db)({ message: "Applied database migrations" });
24
+ else console.log("ℹ️ No changes to commit - database is up to date\n");
25
+ } catch (error) {
26
+ console.error("❌ Error committing migrations, reverting:", error);
27
+ try {
28
+ await doltReset(db)({ hard: true });
29
+ console.log("✓ Successfully reverted uncommitted changes.");
30
+ } catch (resetError) {
31
+ console.error("⚠️ Warning: Reset failed (connection may be dead):", resetError);
32
+ console.error("Manual cleanup may be required: run DOLT_RESET('--hard') on the database.");
33
+ }
34
+ process.exit(1);
35
+ }
36
+ const ghOutput = process.env.GITHUB_OUTPUT;
37
+ if (ghOutput) appendFileSync(ghOutput, `migrations_applied=${migrationsApplied}\n`);
21
38
  };
22
39
  commitMigrations();
23
40
 
@@ -1,4 +1,4 @@
1
- import { MiddlewareHandler } from "hono";
1
+ import { Env, Input, MiddlewareHandler } from "hono";
2
2
 
3
3
  //#region src/middleware/authz-meta.d.ts
4
4
  type AuthzMeta = {
@@ -6,7 +6,7 @@ type AuthzMeta = {
6
6
  permission?: string;
7
7
  description: string;
8
8
  };
9
- type ProjectScopedMiddleware = MiddlewareHandler & {
9
+ type ProjectScopedMiddleware<Env$1 extends Env = Env, Path extends string = string, Input$1 extends Input = Input> = MiddlewareHandler<Env$1, Path, Input$1> & {
10
10
  readonly __projectScoped: true;
11
11
  };
12
12
  declare function getAuthzMeta(mw: unknown): AuthzMeta | undefined;
@@ -6,7 +6,7 @@ import { MiddlewareHandler } from "hono";
6
6
  //#region src/middleware/create-protected-route.d.ts
7
7
  type CreateRouteParams = Parameters<typeof createRoute>[0];
8
8
  declare function createProtectedRoute<T extends CreateRouteParams>(config: T & {
9
- permission: ProjectScopedMiddleware;
9
+ permission: ProjectScopedMiddleware<any>;
10
10
  request: {
11
11
  params: ZodType<{
12
12
  projectId: string;
@@ -14,7 +14,7 @@ declare function createProtectedRoute<T extends CreateRouteParams>(config: T & {
14
14
  };
15
15
  }): T;
16
16
  declare function createProtectedRoute<T extends CreateRouteParams>(config: T & {
17
- permission: ProjectScopedMiddleware;
17
+ permission: ProjectScopedMiddleware<any>;
18
18
  request: {
19
19
  params: ZodType<{
20
20
  id: string;
@@ -1,6 +1,6 @@
1
- import * as hono3 from "hono";
1
+ import * as hono0 from "hono";
2
2
 
3
3
  //#region src/middleware/no-auth.d.ts
4
- declare const noAuth: () => hono3.MiddlewareHandler<any, string, {}, Response>;
4
+ declare const noAuth: () => hono0.MiddlewareHandler<any, string, {}, Response>;
5
5
  //#endregion
6
6
  export { noAuth };
@@ -1,10 +1,10 @@
1
1
  import { z } from "@hono/zod-openapi";
2
- import * as drizzle_zod15 from "drizzle-zod";
2
+ import * as drizzle_zod373 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>>): 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>;
6
+ declare function createSelectSchemaWithModifiers<T extends AnySQLiteTable>(table: T, overrides?: Partial<Record<keyof T['_']['columns'], (schema: z.ZodTypeAny) => z.ZodTypeAny>>): drizzle_zod373.BuildSchema<"select", T["_"]["columns"], drizzle_zod373.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_zod373.BuildSchema<"insert", T["_"]["columns"], drizzle_zod373.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
  /**