@inkeep/agents-core 0.0.0-dev-20260223201736 → 0.0.0-dev-20260223221253
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 +4 -4
- package/dist/data-access/manage/agents.d.ts +25 -25
- package/dist/data-access/manage/artifactComponents.d.ts +6 -6
- package/dist/data-access/manage/contextConfigs.d.ts +4 -4
- package/dist/data-access/manage/dataComponents.d.ts +4 -4
- package/dist/data-access/manage/functionTools.d.ts +8 -8
- package/dist/data-access/manage/skills.d.ts +6 -6
- package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +12 -12
- package/dist/data-access/manage/subAgentRelations.d.ts +12 -12
- package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +12 -12
- package/dist/data-access/manage/subAgents.d.ts +15 -15
- package/dist/data-access/manage/tools.d.ts +12 -12
- package/dist/data-access/manage/triggers.d.ts +1 -1
- package/dist/data-access/runtime/apiKeys.d.ts +8 -8
- package/dist/data-access/runtime/conversations.d.ts +23 -23
- package/dist/data-access/runtime/messages.d.ts +15 -15
- package/dist/data-access/runtime/tasks.d.ts +7 -7
- package/dist/db/manage/manage-schema.d.ts +447 -447
- package/dist/db/runtime/runtime-schema.d.ts +296 -296
- package/dist/index.d.ts +3 -2
- package/dist/index.js +3 -2
- package/dist/utils/error.d.ts +3 -1
- package/dist/utils/error.js +11 -1
- package/dist/utils/index.d.ts +3 -2
- package/dist/utils/index.js +3 -2
- package/dist/utils/retry.d.ts +8 -0
- package/dist/utils/retry.js +30 -0
- package/dist/validation/dolt-schemas.d.ts +1 -1
- package/dist/validation/drizzle-schema-helpers.d.ts +3 -3
- package/dist/validation/schemas.d.ts +1818 -1818
- package/package.json +1 -1
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { getLogger } from "./logger.js";
|
|
2
|
+
|
|
3
|
+
//#region src/utils/retry.ts
|
|
4
|
+
const logger = getLogger("retry");
|
|
5
|
+
async function retryWithBackoff(fn, opts = {}) {
|
|
6
|
+
const { maxAttempts = 3, maxDelayMs = 4e3, label = "operation" } = opts;
|
|
7
|
+
for (let attempt = 1; attempt <= maxAttempts; attempt++) try {
|
|
8
|
+
return await fn();
|
|
9
|
+
} catch (error) {
|
|
10
|
+
const isTimeout = error.name === "AbortError";
|
|
11
|
+
const status = error.status;
|
|
12
|
+
if (!isTimeout && !(typeof status === "number" && status >= 500) && !(status === 429) || attempt === maxAttempts) throw error;
|
|
13
|
+
const retryAfter = error.headers?.get?.("Retry-After");
|
|
14
|
+
const retryAfterMs = retryAfter ? (Number(retryAfter) || 0) * 1e3 : 0;
|
|
15
|
+
const baseDelay = Math.min(500 * 2 ** (attempt - 1), maxDelayMs);
|
|
16
|
+
const delay = Math.max(baseDelay, retryAfterMs) + Math.random() * 100;
|
|
17
|
+
logger.warn({
|
|
18
|
+
attempt,
|
|
19
|
+
maxAttempts,
|
|
20
|
+
status,
|
|
21
|
+
delay: Math.round(delay),
|
|
22
|
+
label
|
|
23
|
+
}, `Retrying ${label} after transient failure`);
|
|
24
|
+
await new Promise((resolve) => setTimeout(resolve, delay));
|
|
25
|
+
}
|
|
26
|
+
throw new Error("Unreachable");
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
//#endregion
|
|
30
|
+
export { retryWithBackoff };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { z } from "@hono/zod-openapi";
|
|
2
|
-
import * as
|
|
2
|
+
import * as drizzle_zod0 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_zod0.BuildSchema<"select", T["_"]["columns"], drizzle_zod0.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_zod0.BuildSchema<"insert", T["_"]["columns"], drizzle_zod0.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
|
/**
|