@inkeep/agents-core 0.14.5 → 0.14.7
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/client-exports.d.cts +7 -7
- package/dist/client-exports.d.ts +7 -7
- package/dist/db/schema.d.cts +2 -2
- package/dist/db/schema.d.ts +2 -2
- package/dist/index.cjs +12 -7
- package/dist/index.d.cts +272 -256
- package/dist/index.d.ts +272 -256
- package/dist/index.js +12 -8
- package/dist/{schema-CFoAzEjh.d.ts → schema-BUMYiuQO.d.cts} +1 -1
- package/dist/{schema-Cb-8k7aM.d.cts → schema-iVTOUsW8.d.ts} +1 -1
- package/dist/types/index.d.cts +2 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/validation/index.d.cts +2 -2
- package/dist/validation/index.d.ts +2 -2
- package/package.json +1 -1
- package/dist/{utility-POey8vOB.d.cts → utility-COYxGpY5.d.cts} +186 -186
- package/dist/{utility-POey8vOB.d.ts → utility-COYxGpY5.d.ts} +186 -186
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { C as ConversationHistoryConfig, A as ApiKeyApiUpdateSchema, F as FullGraphAgentInsertSchema } from './utility-
|
|
3
|
-
export { d as AgentStopWhen, a as AgentStopWhenSchema, e as CredentialStoreType, c as GraphStopWhen, G as GraphStopWhenSchema, M as MCPTransportType, b as StopWhen, S as StopWhenSchema } from './utility-
|
|
2
|
+
import { C as ConversationHistoryConfig, A as ApiKeyApiUpdateSchema, F as FullGraphAgentInsertSchema } from './utility-COYxGpY5.cjs';
|
|
3
|
+
export { d as AgentStopWhen, a as AgentStopWhenSchema, e as CredentialStoreType, c as GraphStopWhen, G as GraphStopWhenSchema, M as MCPTransportType, b as StopWhen, S as StopWhenSchema } from './utility-COYxGpY5.cjs';
|
|
4
4
|
import 'drizzle-zod';
|
|
5
5
|
import 'drizzle-orm/sqlite-core';
|
|
6
6
|
import '@hono/zod-openapi';
|
|
@@ -67,8 +67,8 @@ declare const AgentApiInsertSchema: z.ZodObject<{
|
|
|
67
67
|
canTransferTo: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
68
68
|
canDelegateTo: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
69
69
|
type: z.ZodOptional<z.ZodEnum<{
|
|
70
|
-
external: "external";
|
|
71
70
|
internal: "internal";
|
|
71
|
+
external: "external";
|
|
72
72
|
}>>;
|
|
73
73
|
}, z.core.$strip>;
|
|
74
74
|
declare const ToolApiInsertSchema: z.ZodObject<{
|
|
@@ -168,11 +168,13 @@ declare const FullGraphDefinitionSchema: z.ZodObject<{
|
|
|
168
168
|
description: z.ZodOptional<z.ZodString>;
|
|
169
169
|
defaultAgentId: z.ZodOptional<z.ZodString>;
|
|
170
170
|
agents: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
171
|
-
name: z.ZodString;
|
|
172
171
|
id: z.ZodString;
|
|
172
|
+
name: z.ZodString;
|
|
173
|
+
description: z.ZodString;
|
|
174
|
+
prompt: z.ZodString;
|
|
173
175
|
createdAt: z.ZodOptional<z.ZodString>;
|
|
174
176
|
updatedAt: z.ZodOptional<z.ZodString>;
|
|
175
|
-
|
|
177
|
+
conversationHistoryConfig: z.ZodOptional<z.ZodNullable<z.ZodType<ConversationHistoryConfig, ConversationHistoryConfig, z.core.$ZodTypeInternals<ConversationHistoryConfig, ConversationHistoryConfig>>>>;
|
|
176
178
|
models: z.ZodOptional<z.ZodObject<{
|
|
177
179
|
base: z.ZodOptional<z.ZodObject<{
|
|
178
180
|
model: z.ZodOptional<z.ZodString>;
|
|
@@ -196,8 +198,6 @@ declare const FullGraphDefinitionSchema: z.ZodObject<{
|
|
|
196
198
|
}, {
|
|
197
199
|
stepCountIs?: number | undefined;
|
|
198
200
|
}>>>>;
|
|
199
|
-
prompt: z.ZodString;
|
|
200
|
-
conversationHistoryConfig: z.ZodOptional<z.ZodNullable<z.ZodType<ConversationHistoryConfig, ConversationHistoryConfig, z.core.$ZodTypeInternals<ConversationHistoryConfig, ConversationHistoryConfig>>>>;
|
|
201
201
|
type: z.ZodLiteral<"internal">;
|
|
202
202
|
canUse: z.ZodArray<z.ZodObject<{
|
|
203
203
|
agentToolRelationId: z.ZodOptional<z.ZodString>;
|
package/dist/client-exports.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { C as ConversationHistoryConfig, A as ApiKeyApiUpdateSchema, F as FullGraphAgentInsertSchema } from './utility-
|
|
3
|
-
export { d as AgentStopWhen, a as AgentStopWhenSchema, e as CredentialStoreType, c as GraphStopWhen, G as GraphStopWhenSchema, M as MCPTransportType, b as StopWhen, S as StopWhenSchema } from './utility-
|
|
2
|
+
import { C as ConversationHistoryConfig, A as ApiKeyApiUpdateSchema, F as FullGraphAgentInsertSchema } from './utility-COYxGpY5.js';
|
|
3
|
+
export { d as AgentStopWhen, a as AgentStopWhenSchema, e as CredentialStoreType, c as GraphStopWhen, G as GraphStopWhenSchema, M as MCPTransportType, b as StopWhen, S as StopWhenSchema } from './utility-COYxGpY5.js';
|
|
4
4
|
import 'drizzle-zod';
|
|
5
5
|
import 'drizzle-orm/sqlite-core';
|
|
6
6
|
import '@hono/zod-openapi';
|
|
@@ -67,8 +67,8 @@ declare const AgentApiInsertSchema: z.ZodObject<{
|
|
|
67
67
|
canTransferTo: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
68
68
|
canDelegateTo: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
69
69
|
type: z.ZodOptional<z.ZodEnum<{
|
|
70
|
-
external: "external";
|
|
71
70
|
internal: "internal";
|
|
71
|
+
external: "external";
|
|
72
72
|
}>>;
|
|
73
73
|
}, z.core.$strip>;
|
|
74
74
|
declare const ToolApiInsertSchema: z.ZodObject<{
|
|
@@ -168,11 +168,13 @@ declare const FullGraphDefinitionSchema: z.ZodObject<{
|
|
|
168
168
|
description: z.ZodOptional<z.ZodString>;
|
|
169
169
|
defaultAgentId: z.ZodOptional<z.ZodString>;
|
|
170
170
|
agents: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
171
|
-
name: z.ZodString;
|
|
172
171
|
id: z.ZodString;
|
|
172
|
+
name: z.ZodString;
|
|
173
|
+
description: z.ZodString;
|
|
174
|
+
prompt: z.ZodString;
|
|
173
175
|
createdAt: z.ZodOptional<z.ZodString>;
|
|
174
176
|
updatedAt: z.ZodOptional<z.ZodString>;
|
|
175
|
-
|
|
177
|
+
conversationHistoryConfig: z.ZodOptional<z.ZodNullable<z.ZodType<ConversationHistoryConfig, ConversationHistoryConfig, z.core.$ZodTypeInternals<ConversationHistoryConfig, ConversationHistoryConfig>>>>;
|
|
176
178
|
models: z.ZodOptional<z.ZodObject<{
|
|
177
179
|
base: z.ZodOptional<z.ZodObject<{
|
|
178
180
|
model: z.ZodOptional<z.ZodString>;
|
|
@@ -196,8 +198,6 @@ declare const FullGraphDefinitionSchema: z.ZodObject<{
|
|
|
196
198
|
}, {
|
|
197
199
|
stepCountIs?: number | undefined;
|
|
198
200
|
}>>>>;
|
|
199
|
-
prompt: z.ZodString;
|
|
200
|
-
conversationHistoryConfig: z.ZodOptional<z.ZodNullable<z.ZodType<ConversationHistoryConfig, ConversationHistoryConfig, z.core.$ZodTypeInternals<ConversationHistoryConfig, ConversationHistoryConfig>>>>;
|
|
201
201
|
type: z.ZodLiteral<"internal">;
|
|
202
202
|
canUse: z.ZodArray<z.ZodObject<{
|
|
203
203
|
agentToolRelationId: z.ZodOptional<z.ZodString>;
|
package/dist/db/schema.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import 'drizzle-orm';
|
|
2
2
|
import 'drizzle-orm/sqlite-core';
|
|
3
|
-
import '../utility-
|
|
4
|
-
export { k as agentArtifactComponents, K as agentArtifactComponentsRelations, i as agentDataComponents, M as agentDataComponentsRelations, a as agentGraph, B as agentGraphRelations, e as agentRelations, O as agentRelationsRelations, m as agentToolRelations, E as agentToolRelationsRelations, d as agents, A as agentsRelations, r as apiKeys, D as apiKeysRelations, j as artifactComponents, J as artifactComponentsRelations, b as contextCache, z as contextCacheRelations, c as contextConfigs, y as contextConfigsRelations, n as conversations, H as conversationsRelations, u as credentialReferences, F as credentialReferencesRelations, h as dataComponents, L as dataComponentsRelations, f as externalAgents, C as externalAgentsRelations, q as ledgerArtifacts, N as ledgerArtifactsRelations, o as messages, I as messagesRelations, p as projects, w as projectsRelations, g as taskRelations, x as taskRelationsRelations, t as tasks, v as tasksRelations, l as tools, G as toolsRelations } from '../schema-
|
|
3
|
+
import '../utility-COYxGpY5.cjs';
|
|
4
|
+
export { k as agentArtifactComponents, K as agentArtifactComponentsRelations, i as agentDataComponents, M as agentDataComponentsRelations, a as agentGraph, B as agentGraphRelations, e as agentRelations, O as agentRelationsRelations, m as agentToolRelations, E as agentToolRelationsRelations, d as agents, A as agentsRelations, r as apiKeys, D as apiKeysRelations, j as artifactComponents, J as artifactComponentsRelations, b as contextCache, z as contextCacheRelations, c as contextConfigs, y as contextConfigsRelations, n as conversations, H as conversationsRelations, u as credentialReferences, F as credentialReferencesRelations, h as dataComponents, L as dataComponentsRelations, f as externalAgents, C as externalAgentsRelations, q as ledgerArtifacts, N as ledgerArtifactsRelations, o as messages, I as messagesRelations, p as projects, w as projectsRelations, g as taskRelations, x as taskRelationsRelations, t as tasks, v as tasksRelations, l as tools, G as toolsRelations } from '../schema-BUMYiuQO.cjs';
|
|
5
5
|
import 'zod';
|
|
6
6
|
import 'drizzle-zod';
|
|
7
7
|
import '@hono/zod-openapi';
|
package/dist/db/schema.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import 'drizzle-orm';
|
|
2
2
|
import 'drizzle-orm/sqlite-core';
|
|
3
|
-
import '../utility-
|
|
4
|
-
export { k as agentArtifactComponents, K as agentArtifactComponentsRelations, i as agentDataComponents, M as agentDataComponentsRelations, a as agentGraph, B as agentGraphRelations, e as agentRelations, O as agentRelationsRelations, m as agentToolRelations, E as agentToolRelationsRelations, d as agents, A as agentsRelations, r as apiKeys, D as apiKeysRelations, j as artifactComponents, J as artifactComponentsRelations, b as contextCache, z as contextCacheRelations, c as contextConfigs, y as contextConfigsRelations, n as conversations, H as conversationsRelations, u as credentialReferences, F as credentialReferencesRelations, h as dataComponents, L as dataComponentsRelations, f as externalAgents, C as externalAgentsRelations, q as ledgerArtifacts, N as ledgerArtifactsRelations, o as messages, I as messagesRelations, p as projects, w as projectsRelations, g as taskRelations, x as taskRelationsRelations, t as tasks, v as tasksRelations, l as tools, G as toolsRelations } from '../schema-
|
|
3
|
+
import '../utility-COYxGpY5.js';
|
|
4
|
+
export { k as agentArtifactComponents, K as agentArtifactComponentsRelations, i as agentDataComponents, M as agentDataComponentsRelations, a as agentGraph, B as agentGraphRelations, e as agentRelations, O as agentRelationsRelations, m as agentToolRelations, E as agentToolRelationsRelations, d as agents, A as agentsRelations, r as apiKeys, D as apiKeysRelations, j as artifactComponents, J as artifactComponentsRelations, b as contextCache, z as contextCacheRelations, c as contextConfigs, y as contextConfigsRelations, n as conversations, H as conversationsRelations, u as credentialReferences, F as credentialReferencesRelations, h as dataComponents, L as dataComponentsRelations, f as externalAgents, C as externalAgentsRelations, q as ledgerArtifacts, N as ledgerArtifactsRelations, o as messages, I as messagesRelations, p as projects, w as projectsRelations, g as taskRelations, x as taskRelationsRelations, t as tasks, v as tasksRelations, l as tools, G as toolsRelations } from '../schema-iVTOUsW8.js';
|
|
5
5
|
import 'zod';
|
|
6
6
|
import 'drizzle-zod';
|
|
7
7
|
import '@hono/zod-openapi';
|
package/dist/index.cjs
CHANGED
|
@@ -1788,18 +1788,16 @@ var ContextConfigBuilder = class {
|
|
|
1788
1788
|
);
|
|
1789
1789
|
}
|
|
1790
1790
|
/**
|
|
1791
|
-
* Set the context (tenantId, projectId,
|
|
1791
|
+
* Set the context (tenantId, projectId, graphId) for this context config
|
|
1792
1792
|
* Called by graph.setConfig() when the graph is configured
|
|
1793
1793
|
*/
|
|
1794
|
-
setContext(tenantId, projectId, graphId
|
|
1794
|
+
setContext(tenantId, projectId, graphId) {
|
|
1795
1795
|
this.tenantId = tenantId;
|
|
1796
1796
|
this.projectId = projectId;
|
|
1797
1797
|
this.graphId = graphId;
|
|
1798
|
-
if (baseURL) {
|
|
1799
|
-
this.baseURL = baseURL;
|
|
1800
|
-
}
|
|
1801
1798
|
this.config.tenantId = tenantId;
|
|
1802
1799
|
this.config.projectId = projectId;
|
|
1800
|
+
this.config.graphId = graphId;
|
|
1803
1801
|
logger.info(
|
|
1804
1802
|
{
|
|
1805
1803
|
contextConfigId: this.config.id,
|
|
@@ -4466,6 +4464,12 @@ var getContextConfigCacheEntries = (db) => async (params) => {
|
|
|
4466
4464
|
value: entry.value
|
|
4467
4465
|
}));
|
|
4468
4466
|
};
|
|
4467
|
+
var generateId = nanoid.customAlphabet("abcdefghijklmnopqrstuvwxyz0123456789", 21);
|
|
4468
|
+
function getConversationId() {
|
|
4469
|
+
return generateId();
|
|
4470
|
+
}
|
|
4471
|
+
|
|
4472
|
+
// src/data-access/conversations.ts
|
|
4469
4473
|
var listConversations = (db) => async (params) => {
|
|
4470
4474
|
const { userId, pagination } = params;
|
|
4471
4475
|
const page = pagination?.page || 1;
|
|
@@ -4550,7 +4554,7 @@ var getConversation = (db) => async (params) => {
|
|
|
4550
4554
|
});
|
|
4551
4555
|
};
|
|
4552
4556
|
var createOrGetConversation = (db) => async (input) => {
|
|
4553
|
-
const conversationId = input.id ||
|
|
4557
|
+
const conversationId = input.id || getConversationId();
|
|
4554
4558
|
if (input.id) {
|
|
4555
4559
|
const existing = await db.query.conversations.findFirst({
|
|
4556
4560
|
where: drizzleOrm.and(drizzleOrm.eq(conversations.tenantId, input.tenantId), drizzleOrm.eq(conversations.id, input.id))
|
|
@@ -4604,7 +4608,7 @@ function applyContextWindowManagement(messageHistory, maxTokens) {
|
|
|
4604
4608
|
} else {
|
|
4605
4609
|
if (i > 0) {
|
|
4606
4610
|
const summaryMessage = {
|
|
4607
|
-
id: `summary-${
|
|
4611
|
+
id: `summary-${getConversationId()}`,
|
|
4608
4612
|
role: "system",
|
|
4609
4613
|
content: {
|
|
4610
4614
|
text: `[Previous conversation history truncated - ${i + 1} earlier messages]`
|
|
@@ -11125,6 +11129,7 @@ exports.getContextConfigsByName = getContextConfigsByName;
|
|
|
11125
11129
|
exports.getConversation = getConversation;
|
|
11126
11130
|
exports.getConversationCacheEntries = getConversationCacheEntries;
|
|
11127
11131
|
exports.getConversationHistory = getConversationHistory;
|
|
11132
|
+
exports.getConversationId = getConversationId;
|
|
11128
11133
|
exports.getCredentialReference = getCredentialReference;
|
|
11129
11134
|
exports.getCredentialReferenceById = getCredentialReferenceById;
|
|
11130
11135
|
exports.getCredentialReferenceWithTools = getCredentialReferenceWithTools;
|