@inkeep/agents-core 0.58.17 → 0.58.18

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.
@@ -19,17 +19,17 @@ declare const createConversation: (db: AgentsRunDatabaseClient) => (params: Conv
19
19
  id: string;
20
20
  createdAt: string;
21
21
  updatedAt: string;
22
- agentId: string | null;
23
- projectId: string;
24
- tenantId: string;
25
- title: string | null;
26
- metadata: ConversationMetadata | null;
27
22
  ref: {
28
- type: "tag" | "commit" | "branch";
23
+ type: "commit" | "tag" | "branch";
29
24
  name: string;
30
25
  hash: string;
31
26
  } | null;
32
27
  userId: string | null;
28
+ metadata: ConversationMetadata | null;
29
+ title: string | null;
30
+ tenantId: string;
31
+ projectId: string;
32
+ agentId: string | null;
33
33
  activeSubAgentId: string;
34
34
  lastContextResolution: string | null;
35
35
  }>;
@@ -44,7 +44,7 @@ declare const updateConversation: (db: AgentsRunDatabaseClient) => (params: {
44
44
  agentId: string | null;
45
45
  activeSubAgentId: string;
46
46
  ref: {
47
- type: "tag" | "commit" | "branch";
47
+ type: "commit" | "tag" | "branch";
48
48
  name: string;
49
49
  hash: string;
50
50
  } | null;
@@ -70,7 +70,7 @@ declare const updateConversationActiveSubAgent: (db: AgentsRunDatabaseClient) =>
70
70
  agentId: string | null;
71
71
  activeSubAgentId: string;
72
72
  ref: {
73
- type: "tag" | "commit" | "branch";
73
+ type: "commit" | "tag" | "branch";
74
74
  name: string;
75
75
  hash: string;
76
76
  } | null;
@@ -88,17 +88,17 @@ declare const getConversation: (db: AgentsRunDatabaseClient) => (params: {
88
88
  id: string;
89
89
  createdAt: string;
90
90
  updatedAt: string;
91
- agentId: string | null;
92
- projectId: string;
93
- tenantId: string;
94
- title: string | null;
95
- metadata: ConversationMetadata | null;
96
91
  ref: {
97
- type: "tag" | "commit" | "branch";
92
+ type: "commit" | "tag" | "branch";
98
93
  name: string;
99
94
  hash: string;
100
95
  } | null;
101
96
  userId: string | null;
97
+ metadata: ConversationMetadata | null;
98
+ title: string | null;
99
+ tenantId: string;
100
+ projectId: string;
101
+ agentId: string | null;
102
102
  activeSubAgentId: string;
103
103
  lastContextResolution: string | null;
104
104
  } | undefined>;
@@ -108,7 +108,7 @@ declare const createOrGetConversation: (db: AgentsRunDatabaseClient) => (input:
108
108
  tenantId: string;
109
109
  id: string;
110
110
  ref: {
111
- type: "tag" | "commit" | "branch";
111
+ type: "commit" | "tag" | "branch";
112
112
  name: string;
113
113
  hash: string;
114
114
  };
@@ -124,17 +124,17 @@ declare const createOrGetConversation: (db: AgentsRunDatabaseClient) => (input:
124
124
  id: string;
125
125
  createdAt: string;
126
126
  updatedAt: string;
127
- agentId: string | null;
128
- projectId: string;
129
- tenantId: string;
130
- title: string | null;
131
- metadata: ConversationMetadata | null;
132
127
  ref: {
133
- type: "tag" | "commit" | "branch";
128
+ type: "commit" | "tag" | "branch";
134
129
  name: string;
135
130
  hash: string;
136
131
  } | null;
137
132
  userId: string | null;
133
+ metadata: ConversationMetadata | null;
134
+ title: string | null;
135
+ tenantId: string;
136
+ projectId: string;
137
+ agentId: string | null;
138
138
  activeSubAgentId: string;
139
139
  lastContextResolution: string | null;
140
140
  }>;
@@ -156,17 +156,17 @@ declare const getActiveAgentForConversation: (db: AgentsRunDatabaseClient) => (p
156
156
  id: string;
157
157
  createdAt: string;
158
158
  updatedAt: string;
159
- agentId: string | null;
160
- projectId: string;
161
- tenantId: string;
162
- title: string | null;
163
- metadata: ConversationMetadata | null;
164
159
  ref: {
165
- type: "tag" | "commit" | "branch";
160
+ type: "commit" | "tag" | "branch";
166
161
  name: string;
167
162
  hash: string;
168
163
  } | null;
169
164
  userId: string | null;
165
+ metadata: ConversationMetadata | null;
166
+ title: string | null;
167
+ tenantId: string;
168
+ projectId: string;
169
+ agentId: string | null;
170
170
  activeSubAgentId: string;
171
171
  lastContextResolution: string | null;
172
172
  } | undefined>;
@@ -13,23 +13,23 @@ declare const getMessageById: (db: AgentsRunDatabaseClient) => (params: {
13
13
  id: string;
14
14
  createdAt: string;
15
15
  updatedAt: string;
16
- projectId: string;
17
- tenantId: string;
18
16
  metadata: MessageMetadata | null;
19
- content: MessageContent;
20
17
  role: string;
18
+ tenantId: string;
19
+ projectId: string;
20
+ content: MessageContent;
21
+ conversationId: string;
21
22
  fromSubAgentId: string | null;
22
23
  toSubAgentId: string | null;
23
24
  fromExternalAgentId: string | null;
24
25
  toExternalAgentId: string | null;
25
- taskId: string | null;
26
- a2aTaskId: string | null;
27
- conversationId: string;
28
26
  fromTeamAgentId: string | null;
29
27
  toTeamAgentId: string | null;
30
28
  visibility: string;
31
29
  messageType: string;
30
+ taskId: string | null;
32
31
  parentMessageId: string | null;
32
+ a2aTaskId: string | null;
33
33
  a2aSessionId: string | null;
34
34
  } | undefined>;
35
35
  declare const listMessages: (db: AgentsRunDatabaseClient) => (params: {
@@ -140,27 +140,30 @@ declare const getVisibleMessages: (db: AgentsRunDatabaseClient) => (params: {
140
140
  tenantId: string;
141
141
  id: string;
142
142
  }[]>;
143
- declare const createMessage: (db: AgentsRunDatabaseClient) => (params: MessageInsert) => Promise<{
143
+ declare const createMessage: (db: AgentsRunDatabaseClient) => (params: {
144
+ scopes: ProjectScopeConfig;
145
+ data: Omit<MessageInsert, "tenantId" | "projectId">;
146
+ }) => Promise<{
144
147
  id: string;
145
148
  createdAt: string;
146
149
  updatedAt: string;
147
- projectId: string;
148
- tenantId: string;
149
150
  metadata: MessageMetadata | null;
150
- content: MessageContent;
151
151
  role: string;
152
+ tenantId: string;
153
+ projectId: string;
154
+ content: MessageContent;
155
+ conversationId: string;
152
156
  fromSubAgentId: string | null;
153
157
  toSubAgentId: string | null;
154
158
  fromExternalAgentId: string | null;
155
159
  toExternalAgentId: string | null;
156
- taskId: string | null;
157
- a2aTaskId: string | null;
158
- conversationId: string;
159
160
  fromTeamAgentId: string | null;
160
161
  toTeamAgentId: string | null;
161
162
  visibility: string;
162
163
  messageType: string;
164
+ taskId: string | null;
163
165
  parentMessageId: string | null;
166
+ a2aTaskId: string | null;
164
167
  a2aSessionId: string | null;
165
168
  }>;
166
169
  declare const updateMessage: (db: AgentsRunDatabaseClient) => (params: {
@@ -197,23 +200,23 @@ declare const deleteMessage: (db: AgentsRunDatabaseClient) => (params: {
197
200
  id: string;
198
201
  createdAt: string;
199
202
  updatedAt: string;
200
- projectId: string;
201
- tenantId: string;
202
203
  metadata: MessageMetadata | null;
203
- content: MessageContent;
204
204
  role: string;
205
+ tenantId: string;
206
+ projectId: string;
207
+ content: MessageContent;
208
+ conversationId: string;
205
209
  fromSubAgentId: string | null;
206
210
  toSubAgentId: string | null;
207
211
  fromExternalAgentId: string | null;
208
212
  toExternalAgentId: string | null;
209
- taskId: string | null;
210
- a2aTaskId: string | null;
211
- conversationId: string;
212
213
  fromTeamAgentId: string | null;
213
214
  toTeamAgentId: string | null;
214
215
  visibility: string;
215
216
  messageType: string;
217
+ taskId: string | null;
216
218
  parentMessageId: string | null;
219
+ a2aTaskId: string | null;
217
220
  a2aSessionId: string | null;
218
221
  }>;
219
222
  declare const countMessagesByConversation: (db: AgentsRunDatabaseClient) => (params: {
@@ -32,9 +32,12 @@ const getVisibleMessages = (db) => async (params) => {
32
32
  return await db.select().from(messages).where(and(projectScopedWhere(messages, params.scopes), eq(messages.conversationId, params.conversationId), inArray(messages.visibility, visibilityFilter))).limit(limit).offset(offset).orderBy(asc(messages.createdAt));
33
33
  };
34
34
  const createMessage = (db) => async (params) => {
35
+ const { scopes, data } = params;
35
36
  const now = (/* @__PURE__ */ new Date()).toISOString();
36
37
  const [created] = await db.insert(messages).values({
37
- ...params,
38
+ ...data,
39
+ tenantId: scopes.tenantId,
40
+ projectId: scopes.projectId,
38
41
  createdAt: now,
39
42
  updatedAt: now
40
43
  }).returning();
@@ -10,16 +10,16 @@ declare const createTask: (db: AgentsRunDatabaseClient) => (params: TaskInsert)
10
10
  id: string;
11
11
  createdAt: string;
12
12
  updatedAt: string;
13
- agentId: string;
14
- projectId: string;
15
- tenantId: string;
16
- metadata: TaskMetadataConfig | null;
17
13
  ref: {
18
- type: "tag" | "commit" | "branch";
14
+ type: "commit" | "tag" | "branch";
19
15
  name: string;
20
16
  hash: string;
21
17
  } | null;
18
+ metadata: TaskMetadataConfig | null;
22
19
  status: string;
20
+ tenantId: string;
21
+ projectId: string;
22
+ agentId: string;
23
23
  subAgentId: string;
24
24
  contextId: string;
25
25
  }>;
@@ -39,7 +39,7 @@ declare const updateTask: (db: AgentsRunDatabaseClient) => (params: {
39
39
  updatedAt: string;
40
40
  contextId: string;
41
41
  ref: {
42
- type: "tag" | "commit" | "branch";
42
+ type: "commit" | "tag" | "branch";
43
43
  name: string;
44
44
  hash: string;
45
45
  } | null;