@inkeep/agents-core 0.0.0-dev-20260122191720 → 0.0.0-dev-20260122200302

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.
@@ -11,12 +11,10 @@ declare const getSubAgentById: (db: AgentsManageDatabaseClient) => (params: {
11
11
  tenantId: string;
12
12
  projectId: string;
13
13
  id: string;
14
- name: string;
15
- description: string | null;
16
- prompt: string | null;
17
- agentId: string;
18
14
  createdAt: string;
15
+ name: string;
19
16
  updatedAt: string;
17
+ description: string | null;
20
18
  models: {
21
19
  base?: {
22
20
  model?: string | undefined;
@@ -34,6 +32,8 @@ declare const getSubAgentById: (db: AgentsManageDatabaseClient) => (params: {
34
32
  stopWhen: {
35
33
  stepCountIs?: number | undefined;
36
34
  } | null;
35
+ agentId: string;
36
+ prompt: string | null;
37
37
  conversationHistoryConfig: ConversationHistoryConfig | null;
38
38
  } | undefined>;
39
39
  declare const listSubAgents: (db: AgentsManageDatabaseClient) => (params: {
@@ -42,12 +42,10 @@ declare const listSubAgents: (db: AgentsManageDatabaseClient) => (params: {
42
42
  tenantId: string;
43
43
  projectId: string;
44
44
  id: string;
45
- name: string;
46
- description: string | null;
47
- prompt: string | null;
48
- agentId: string;
49
45
  createdAt: string;
46
+ name: string;
50
47
  updatedAt: string;
48
+ description: string | null;
51
49
  models: {
52
50
  base?: {
53
51
  model?: string | undefined;
@@ -65,6 +63,8 @@ declare const listSubAgents: (db: AgentsManageDatabaseClient) => (params: {
65
63
  stopWhen: {
66
64
  stepCountIs?: number | undefined;
67
65
  } | null;
66
+ agentId: string;
67
+ prompt: string | null;
68
68
  conversationHistoryConfig: ConversationHistoryConfig | null;
69
69
  }[]>;
70
70
  declare const listSubAgentsPaginated: (db: AgentsManageDatabaseClient) => (params: {
@@ -111,12 +111,10 @@ declare const createSubAgent: (db: AgentsManageDatabaseClient) => (params: SubAg
111
111
  tenantId: string;
112
112
  projectId: string;
113
113
  id: string;
114
- name: string;
115
- description: string | null;
116
- prompt: string | null;
117
- agentId: string;
118
114
  createdAt: string;
115
+ name: string;
119
116
  updatedAt: string;
117
+ description: string | null;
120
118
  models: {
121
119
  base?: {
122
120
  model?: string | undefined;
@@ -134,6 +132,8 @@ declare const createSubAgent: (db: AgentsManageDatabaseClient) => (params: SubAg
134
132
  stopWhen: {
135
133
  stepCountIs?: number | undefined;
136
134
  } | null;
135
+ agentId: string;
136
+ prompt: string | null;
137
137
  conversationHistoryConfig: ConversationHistoryConfig | null;
138
138
  }>;
139
139
  declare const updateSubAgent: (db: AgentsManageDatabaseClient) => (params: {
@@ -15,16 +15,16 @@ declare const getToolById: (db: AgentsManageDatabaseClient) => (params: {
15
15
  tenantId: string;
16
16
  projectId: string;
17
17
  id: string;
18
+ createdAt: string;
18
19
  name: string;
20
+ updatedAt: string;
19
21
  description: string | null;
22
+ headers: Record<string, string> | null;
20
23
  config: {
21
24
  type: "mcp";
22
25
  mcp: ToolMcpConfig;
23
26
  };
24
27
  credentialReferenceId: string | null;
25
- createdAt: string;
26
- updatedAt: string;
27
- headers: Record<string, string> | null;
28
28
  credentialScope: string;
29
29
  imageUrl: string | null;
30
30
  capabilities: ToolServerCapabilities | null;
@@ -71,16 +71,16 @@ declare const createTool: (db: AgentsManageDatabaseClient) => (params: ToolInser
71
71
  tenantId: string;
72
72
  projectId: string;
73
73
  id: string;
74
+ createdAt: string;
74
75
  name: string;
76
+ updatedAt: string;
75
77
  description: string | null;
78
+ headers: Record<string, string> | null;
76
79
  config: {
77
80
  type: "mcp";
78
81
  mcp: ToolMcpConfig;
79
82
  };
80
83
  credentialReferenceId: string | null;
81
- createdAt: string;
82
- updatedAt: string;
83
- headers: Record<string, string> | null;
84
84
  credentialScope: string;
85
85
  imageUrl: string | null;
86
86
  capabilities: ToolServerCapabilities | null;
@@ -126,16 +126,16 @@ declare const addToolToAgent: (db: AgentsManageDatabaseClient) => (params: {
126
126
  tenantId: string;
127
127
  projectId: string;
128
128
  id: string;
129
- agentId: string;
130
129
  createdAt: string;
131
130
  updatedAt: string;
132
- toolId: string;
133
131
  headers: Record<string, string> | null;
132
+ agentId: string;
133
+ subAgentId: string;
134
+ toolId: string;
135
+ selectedTools: string[] | null;
134
136
  toolPolicies: Record<string, {
135
137
  needsApproval?: boolean;
136
138
  }> | null;
137
- subAgentId: string;
138
- selectedTools: string[] | null;
139
139
  }>;
140
140
  declare const removeToolFromAgent: (db: AgentsManageDatabaseClient) => (params: {
141
141
  scopes: AgentScopeConfig;
@@ -145,16 +145,16 @@ declare const removeToolFromAgent: (db: AgentsManageDatabaseClient) => (params:
145
145
  tenantId: string;
146
146
  projectId: string;
147
147
  id: string;
148
- agentId: string;
149
148
  createdAt: string;
150
149
  updatedAt: string;
151
- toolId: string;
152
150
  headers: Record<string, string> | null;
151
+ agentId: string;
152
+ subAgentId: string;
153
+ toolId: string;
154
+ selectedTools: string[] | null;
153
155
  toolPolicies: Record<string, {
154
156
  needsApproval?: boolean;
155
157
  }> | null;
156
- subAgentId: string;
157
- selectedTools: string[] | null;
158
158
  }>;
159
159
  /**
160
160
  * Upsert agent-tool relation (create if it doesn't exist, update if it does)
@@ -173,16 +173,16 @@ declare const upsertSubAgentToolRelation: (db: AgentsManageDatabaseClient) => (p
173
173
  tenantId: string;
174
174
  projectId: string;
175
175
  id: string;
176
- agentId: string;
177
176
  createdAt: string;
178
177
  updatedAt: string;
179
- toolId: string;
180
178
  headers: Record<string, string> | null;
179
+ agentId: string;
180
+ subAgentId: string;
181
+ toolId: string;
182
+ selectedTools: string[] | null;
181
183
  toolPolicies: Record<string, {
182
184
  needsApproval?: boolean;
183
185
  }> | null;
184
- subAgentId: string;
185
- selectedTools: string[] | null;
186
186
  }>;
187
187
  /**
188
188
  * Upsert a tool (create if it doesn't exist, update if it does)
@@ -193,16 +193,16 @@ declare const upsertTool: (db: AgentsManageDatabaseClient) => (params: {
193
193
  tenantId: string;
194
194
  projectId: string;
195
195
  id: string;
196
+ createdAt: string;
196
197
  name: string;
198
+ updatedAt: string;
197
199
  description: string | null;
200
+ headers: Record<string, string> | null;
198
201
  config: {
199
202
  type: "mcp";
200
203
  mcp: ToolMcpConfig;
201
204
  };
202
205
  credentialReferenceId: string | null;
203
- createdAt: string;
204
- updatedAt: string;
205
- headers: Record<string, string> | null;
206
206
  credentialScope: string;
207
207
  imageUrl: string | null;
208
208
  capabilities: ToolServerCapabilities | null;
@@ -10,29 +10,29 @@ declare const getApiKeyById: (db: AgentsRunDatabaseClient) => (params: {
10
10
  tenantId: string;
11
11
  projectId: string;
12
12
  id: string;
13
+ createdAt: string;
13
14
  name: string | null;
15
+ updatedAt: string;
16
+ expiresAt: string | null;
14
17
  agentId: string;
15
18
  publicId: string;
16
19
  keyHash: string;
17
20
  keyPrefix: string;
18
21
  lastUsedAt: string | null;
19
- expiresAt: string | null;
20
- createdAt: string;
21
- updatedAt: string;
22
22
  } | undefined>;
23
23
  declare const getApiKeyByPublicId: (db: AgentsRunDatabaseClient) => (publicId: string) => Promise<{
24
24
  tenantId: string;
25
25
  projectId: string;
26
26
  id: string;
27
+ createdAt: string;
27
28
  name: string | null;
29
+ updatedAt: string;
30
+ expiresAt: string | null;
28
31
  agentId: string;
29
32
  publicId: string;
30
33
  keyHash: string;
31
34
  keyPrefix: string;
32
35
  lastUsedAt: string | null;
33
- expiresAt: string | null;
34
- createdAt: string;
35
- updatedAt: string;
36
36
  } | undefined>;
37
37
  declare const listApiKeys: (db: AgentsRunDatabaseClient) => (params: {
38
38
  scopes: ProjectScopeConfig;
@@ -41,15 +41,15 @@ declare const listApiKeys: (db: AgentsRunDatabaseClient) => (params: {
41
41
  tenantId: string;
42
42
  projectId: string;
43
43
  id: string;
44
+ createdAt: string;
44
45
  name: string | null;
46
+ updatedAt: string;
47
+ expiresAt: string | null;
45
48
  agentId: string;
46
49
  publicId: string;
47
50
  keyHash: string;
48
51
  keyPrefix: string;
49
52
  lastUsedAt: string | null;
50
- expiresAt: string | null;
51
- createdAt: string;
52
- updatedAt: string;
53
53
  }[]>;
54
54
  declare const listApiKeysPaginated: (db: AgentsRunDatabaseClient) => (params: {
55
55
  scopes: ProjectScopeConfig;
@@ -68,15 +68,15 @@ declare const createApiKey: (db: AgentsRunDatabaseClient) => (params: ApiKeyInse
68
68
  tenantId: string;
69
69
  projectId: string;
70
70
  id: string;
71
+ createdAt: string;
71
72
  name: string | null;
73
+ updatedAt: string;
74
+ expiresAt: string | null;
72
75
  agentId: string;
73
76
  publicId: string;
74
77
  keyHash: string;
75
78
  keyPrefix: string;
76
79
  lastUsedAt: string | null;
77
- expiresAt: string | null;
78
- createdAt: string;
79
- updatedAt: string;
80
80
  }>;
81
81
  declare const updateApiKey: (db: AgentsRunDatabaseClient) => (params: {
82
82
  scopes: ProjectScopeConfig;
@@ -18,17 +18,17 @@ declare const createConversation: (db: AgentsRunDatabaseClient) => (params: Conv
18
18
  tenantId: string;
19
19
  projectId: string;
20
20
  id: string;
21
- title: string | null;
22
- agentId: string | null;
23
21
  createdAt: string;
24
22
  updatedAt: string;
25
- userId: string | null;
23
+ title: string | null;
26
24
  metadata: ConversationMetadata | null;
27
25
  ref: {
28
- type: "commit" | "tag" | "branch";
26
+ type: "tag" | "commit" | "branch";
29
27
  name: string;
30
28
  hash: string;
31
29
  } | null;
30
+ userId: string | null;
31
+ agentId: string | null;
32
32
  activeSubAgentId: string;
33
33
  lastContextResolution: string | null;
34
34
  }>;
@@ -43,7 +43,7 @@ declare const updateConversation: (db: AgentsRunDatabaseClient) => (params: {
43
43
  agentId: string | null;
44
44
  activeSubAgentId: string;
45
45
  ref: {
46
- type: "commit" | "tag" | "branch";
46
+ type: "tag" | "commit" | "branch";
47
47
  name: string;
48
48
  hash: string;
49
49
  } | null;
@@ -69,7 +69,7 @@ declare const updateConversationActiveSubAgent: (db: AgentsRunDatabaseClient) =>
69
69
  agentId: string | null;
70
70
  activeSubAgentId: string;
71
71
  ref: {
72
- type: "commit" | "tag" | "branch";
72
+ type: "tag" | "commit" | "branch";
73
73
  name: string;
74
74
  hash: string;
75
75
  } | null;
@@ -87,17 +87,17 @@ declare const getConversation: (db: AgentsRunDatabaseClient) => (params: {
87
87
  tenantId: string;
88
88
  projectId: string;
89
89
  id: string;
90
- title: string | null;
91
- agentId: string | null;
92
90
  createdAt: string;
93
91
  updatedAt: string;
94
- userId: string | null;
92
+ title: string | null;
95
93
  metadata: ConversationMetadata | null;
96
94
  ref: {
97
- type: "commit" | "tag" | "branch";
95
+ type: "tag" | "commit" | "branch";
98
96
  name: string;
99
97
  hash: string;
100
98
  } | null;
99
+ userId: string | null;
100
+ agentId: string | null;
101
101
  activeSubAgentId: string;
102
102
  lastContextResolution: string | null;
103
103
  } | undefined>;
@@ -107,7 +107,7 @@ declare const createOrGetConversation: (db: AgentsRunDatabaseClient) => (input:
107
107
  tenantId: string;
108
108
  id: string;
109
109
  ref: {
110
- type: "commit" | "tag" | "branch";
110
+ type: "tag" | "commit" | "branch";
111
111
  name: string;
112
112
  hash: string;
113
113
  };
@@ -123,17 +123,17 @@ declare const createOrGetConversation: (db: AgentsRunDatabaseClient) => (input:
123
123
  tenantId: string;
124
124
  projectId: string;
125
125
  id: string;
126
- title: string | null;
127
- agentId: string | null;
128
126
  createdAt: string;
129
127
  updatedAt: string;
130
- userId: string | null;
128
+ title: string | null;
131
129
  metadata: ConversationMetadata | null;
132
130
  ref: {
133
- type: "commit" | "tag" | "branch";
131
+ type: "tag" | "commit" | "branch";
134
132
  name: string;
135
133
  hash: string;
136
134
  } | null;
135
+ userId: string | null;
136
+ agentId: string | null;
137
137
  activeSubAgentId: string;
138
138
  lastContextResolution: string | null;
139
139
  }>;
@@ -155,17 +155,17 @@ declare const getActiveAgentForConversation: (db: AgentsRunDatabaseClient) => (p
155
155
  tenantId: string;
156
156
  projectId: string;
157
157
  id: string;
158
- title: string | null;
159
- agentId: string | null;
160
158
  createdAt: string;
161
159
  updatedAt: string;
162
- userId: string | null;
160
+ title: string | null;
163
161
  metadata: ConversationMetadata | null;
164
162
  ref: {
165
- type: "commit" | "tag" | "branch";
163
+ type: "tag" | "commit" | "branch";
166
164
  name: string;
167
165
  hash: string;
168
166
  } | null;
167
+ userId: string | null;
168
+ agentId: string | null;
169
169
  activeSubAgentId: string;
170
170
  lastContextResolution: string | null;
171
171
  } | undefined>;
@@ -9,16 +9,16 @@ declare const createTask: (db: AgentsRunDatabaseClient) => (params: TaskInsert)
9
9
  tenantId: string;
10
10
  projectId: string;
11
11
  id: string;
12
- agentId: string;
13
12
  createdAt: string;
14
13
  updatedAt: string;
15
14
  metadata: TaskMetadataConfig | null;
16
15
  ref: {
17
- type: "commit" | "tag" | "branch";
16
+ type: "tag" | "commit" | "branch";
18
17
  name: string;
19
18
  hash: string;
20
19
  } | null;
21
20
  status: string;
21
+ agentId: string;
22
22
  subAgentId: string;
23
23
  contextId: string;
24
24
  }>;
@@ -36,7 +36,7 @@ declare const updateTask: (db: AgentsRunDatabaseClient) => (params: {
36
36
  updatedAt: string;
37
37
  contextId: string;
38
38
  ref: {
39
- type: "commit" | "tag" | "branch";
39
+ type: "tag" | "commit" | "branch";
40
40
  name: string;
41
41
  hash: string;
42
42
  } | null;
@@ -216,7 +216,7 @@ declare const conversations: drizzle_orm_pg_core1600.PgTableWithColumns<{
216
216
  dataType: "json";
217
217
  columnType: "PgJsonb";
218
218
  data: {
219
- type: "commit" | "tag" | "branch";
219
+ type: "tag" | "commit" | "branch";
220
220
  name: string;
221
221
  hash: string;
222
222
  };
@@ -232,7 +232,7 @@ declare const conversations: drizzle_orm_pg_core1600.PgTableWithColumns<{
232
232
  generated: undefined;
233
233
  }, {}, {
234
234
  $type: {
235
- type: "commit" | "tag" | "branch";
235
+ type: "tag" | "commit" | "branch";
236
236
  name: string;
237
237
  hash: string;
238
238
  };
@@ -413,7 +413,7 @@ declare const tasks: drizzle_orm_pg_core1600.PgTableWithColumns<{
413
413
  dataType: "json";
414
414
  columnType: "PgJsonb";
415
415
  data: {
416
- type: "commit" | "tag" | "branch";
416
+ type: "tag" | "commit" | "branch";
417
417
  name: string;
418
418
  hash: string;
419
419
  };
@@ -429,7 +429,7 @@ declare const tasks: drizzle_orm_pg_core1600.PgTableWithColumns<{
429
429
  generated: undefined;
430
430
  }, {}, {
431
431
  $type: {
432
- type: "commit" | "tag" | "branch";
432
+ type: "tag" | "commit" | "branch";
433
433
  name: string;
434
434
  hash: string;
435
435
  };
@@ -2011,7 +2011,7 @@ declare const contextCache: drizzle_orm_pg_core1600.PgTableWithColumns<{
2011
2011
  dataType: "json";
2012
2012
  columnType: "PgJsonb";
2013
2013
  data: {
2014
- type: "commit" | "tag" | "branch";
2014
+ type: "tag" | "commit" | "branch";
2015
2015
  name: string;
2016
2016
  hash: string;
2017
2017
  };
@@ -2027,7 +2027,7 @@ declare const contextCache: drizzle_orm_pg_core1600.PgTableWithColumns<{
2027
2027
  generated: undefined;
2028
2028
  }, {}, {
2029
2029
  $type: {
2030
- type: "commit" | "tag" | "branch";
2030
+ type: "tag" | "commit" | "branch";
2031
2031
  name: string;
2032
2032
  hash: string;
2033
2033
  };
@@ -0,0 +1,6 @@
1
+ //#region src/db/utils.d.ts
2
+ declare const isLocalhostUrl: (url: string | undefined) => boolean;
3
+ declare const askConfirmation: (question: string) => Promise<boolean>;
4
+ declare const confirmMigration: (connectionString: string | undefined) => Promise<boolean>;
5
+ //#endregion
6
+ export { askConfirmation, confirmMigration, isLocalhostUrl };
@@ -0,0 +1,42 @@
1
+ import * as readline from "node:readline";
2
+
3
+ //#region src/db/utils.ts
4
+ const isLocalhostUrl = (url) => {
5
+ if (!url) return false;
6
+ try {
7
+ const parsed = new URL(url);
8
+ return parsed.hostname === "localhost" || parsed.hostname === "127.0.0.1" || parsed.hostname === "::1";
9
+ } catch {
10
+ return url.includes("localhost") || url.includes("127.0.0.1");
11
+ }
12
+ };
13
+ const askConfirmation = (question) => {
14
+ const rl = readline.createInterface({
15
+ input: process.stdin,
16
+ output: process.stdout
17
+ });
18
+ return new Promise((resolve) => {
19
+ rl.question(question, (answer) => {
20
+ rl.close();
21
+ resolve(answer.toLowerCase() === "y" || answer.toLowerCase() === "yes");
22
+ });
23
+ });
24
+ };
25
+ const confirmMigration = async (connectionString) => {
26
+ if (!connectionString) {
27
+ console.error("❌ Error: Database URL is not set.");
28
+ process.exit(1);
29
+ }
30
+ if (!isLocalhostUrl(connectionString)) {
31
+ console.warn("⚠️ Warning: Database URL is not pointing to localhost. This operation may modify a production database.");
32
+ if (!await askConfirmation("Do you want to proceed? (y/n): ")) {
33
+ console.log("Migration cancelled.");
34
+ process.exit(0);
35
+ }
36
+ console.log("");
37
+ }
38
+ return true;
39
+ };
40
+
41
+ //#endregion
42
+ export { askConfirmation, confirmMigration, isLocalhostUrl };
@@ -6,5 +6,5 @@ import { doltAbortMerge, doltConflicts, doltMerge, doltMergeStatus, doltResolveC
6
6
  import { RefType, checkoutRef, getCurrentBranchOrCommit, getProjectMainResolvedRef, getProjectScopedRef, getTenantScopedRef, isRefWritable, isValidCommitHash, resolveRef } from "./ref-helpers.js";
7
7
  import { RefContext, RefMiddlewareOptions, createRefMiddleware, createWriteProtectionMiddleware, refMiddlewareFactory, writeProtectionMiddlewareFactory } from "./ref-middleware.js";
8
8
  import { NestedRefScopeError, WithRefOptions, getCurrentRefScope, getRefScopedDb, isInRefScope, withRef } from "./ref-scope.js";
9
- import { EnsureSchemaSyncOptions, SCHEMA_SOURCE_BRANCH, SchemaDiff, SchemaSyncOptions, SchemaSyncResult, areBranchesSchemaCompatible, ensureSchemaSync, formatSchemaDiffSummary, getActiveBranch, getSchemaDiff, hasSchemaDifferences, hasUncommittedChanges, syncSchemaFromMain } from "./schema-sync.js";
10
- export { CheckoutBranchParams, CheckoutBranchResult, CreateBranchParams, DeleteBranchParams, EnsureSchemaSyncOptions, GetBranchParams, MAIN_BRANCH_SUFFIX, NestedRefScopeError, RefContext, RefMiddlewareOptions, RefType, SCHEMA_SOURCE_BRANCH, SchemaDiff, SchemaSyncOptions, SchemaSyncResult, WithRefOptions, areBranchesSchemaCompatible, branchScopes, checkoutBranch, checkoutRef, createBranch, createRefMiddleware, createWriteProtectionMiddleware, deleteBranch, doltAbortMerge, doltActiveBranch, doltAdd, doltAddAndCommit, doltBranch, doltBranchExists, doltCheckout, doltCommit, doltConflicts, doltDeleteBranch, doltDeleteTag, doltDiff, doltDiffSummary, doltGetBranchNamespace, doltHashOf, doltListBranches, doltListTags, doltLog, doltMerge, doltMergeStatus, doltRenameBranch, doltReset, doltResolveConflicts, doltSchemaConflicts, doltStatus, doltTableConflicts, doltTag, ensureBranchExists, ensureSchemaSync, formatSchemaDiffSummary, getActiveBranch, getBranch, getCurrentBranchOrCommit, getCurrentRefScope, getProjectMainResolvedRef, getProjectScopedRef, getRefScopedDb, getSchemaDiff, getTenantMainBranch, getTenantScopedRef, hasSchemaDifferences, hasUncommittedChanges, isInRefScope, isProtectedBranchName, isRefWritable, isValidCommitHash, listBranches, listBranchesForAgent, refMiddlewareFactory, resolveRef, syncSchemaFromMain, withRef, writeProtectionMiddlewareFactory };
9
+ import { EnsureSchemaSyncOptions, SCHEMA_SOURCE_BRANCH, SchemaDiff, SchemaSyncOptions, SchemaSyncResult, areBranchesSchemaCompatible, ensureSchemaSync, formatSchemaDiffSummary, getActiveBranch, getSchemaDiff, hasSchemaDifferences, hasUncommittedChanges, isLocalhostUrl, syncSchemaFromMain } from "./schema-sync.js";
10
+ export { CheckoutBranchParams, CheckoutBranchResult, CreateBranchParams, DeleteBranchParams, EnsureSchemaSyncOptions, GetBranchParams, MAIN_BRANCH_SUFFIX, NestedRefScopeError, RefContext, RefMiddlewareOptions, RefType, SCHEMA_SOURCE_BRANCH, SchemaDiff, SchemaSyncOptions, SchemaSyncResult, WithRefOptions, areBranchesSchemaCompatible, branchScopes, checkoutBranch, checkoutRef, createBranch, createRefMiddleware, createWriteProtectionMiddleware, deleteBranch, doltAbortMerge, doltActiveBranch, doltAdd, doltAddAndCommit, doltBranch, doltBranchExists, doltCheckout, doltCommit, doltConflicts, doltDeleteBranch, doltDeleteTag, doltDiff, doltDiffSummary, doltGetBranchNamespace, doltHashOf, doltListBranches, doltListTags, doltLog, doltMerge, doltMergeStatus, doltRenameBranch, doltReset, doltResolveConflicts, doltSchemaConflicts, doltStatus, doltTableConflicts, doltTag, ensureBranchExists, ensureSchemaSync, formatSchemaDiffSummary, getActiveBranch, getBranch, getCurrentBranchOrCommit, getCurrentRefScope, getProjectMainResolvedRef, getProjectScopedRef, getRefScopedDb, getSchemaDiff, getTenantMainBranch, getTenantScopedRef, hasSchemaDifferences, hasUncommittedChanges, isInRefScope, isLocalhostUrl, isProtectedBranchName, isRefWritable, isValidCommitHash, listBranches, listBranchesForAgent, refMiddlewareFactory, resolveRef, syncSchemaFromMain, withRef, writeProtectionMiddlewareFactory };
@@ -1,6 +1,6 @@
1
1
  import { doltAdd, doltAddAndCommit, doltCommit, doltDeleteTag, doltHashOf, doltListTags, doltLog, doltReset, doltStatus, doltTag } from "./commit.js";
2
2
  import { doltAbortMerge, doltConflicts, doltMerge, doltMergeStatus, doltResolveConflicts, doltSchemaConflicts, doltTableConflicts } from "./merge.js";
3
- import { SCHEMA_SOURCE_BRANCH, areBranchesSchemaCompatible, ensureSchemaSync, formatSchemaDiffSummary, getActiveBranch, getSchemaDiff, hasSchemaDifferences, hasUncommittedChanges, syncSchemaFromMain } from "./schema-sync.js";
3
+ import { SCHEMA_SOURCE_BRANCH, areBranchesSchemaCompatible, ensureSchemaSync, formatSchemaDiffSummary, getActiveBranch, getSchemaDiff, hasSchemaDifferences, hasUncommittedChanges, isLocalhostUrl, syncSchemaFromMain } from "./schema-sync.js";
4
4
  import { MAIN_BRANCH_SUFFIX, checkoutBranch, createBranch, deleteBranch, getBranch, getTenantMainBranch, isProtectedBranchName, listBranches, listBranchesForAgent } from "./branches-api.js";
5
5
  import { checkoutRef, getCurrentBranchOrCommit, getProjectMainResolvedRef, getProjectScopedRef, getTenantScopedRef, isRefWritable, isValidCommitHash, resolveRef } from "./ref-helpers.js";
6
6
  import { doltActiveBranch, doltBranch, doltBranchExists, doltCheckout, doltDeleteBranch, doltGetBranchNamespace, doltListBranches, doltRenameBranch, ensureBranchExists } from "./branch.js";
@@ -8,4 +8,4 @@ import { doltDiff, doltDiffSummary } from "./diff.js";
8
8
  import { createRefMiddleware, createWriteProtectionMiddleware, refMiddlewareFactory, writeProtectionMiddlewareFactory } from "./ref-middleware.js";
9
9
  import { NestedRefScopeError, getCurrentRefScope, getRefScopedDb, isInRefScope, withRef } from "./ref-scope.js";
10
10
 
11
- export { MAIN_BRANCH_SUFFIX, NestedRefScopeError, SCHEMA_SOURCE_BRANCH, areBranchesSchemaCompatible, checkoutBranch, checkoutRef, createBranch, createRefMiddleware, createWriteProtectionMiddleware, deleteBranch, doltAbortMerge, doltActiveBranch, doltAdd, doltAddAndCommit, doltBranch, doltBranchExists, doltCheckout, doltCommit, doltConflicts, doltDeleteBranch, doltDeleteTag, doltDiff, doltDiffSummary, doltGetBranchNamespace, doltHashOf, doltListBranches, doltListTags, doltLog, doltMerge, doltMergeStatus, doltRenameBranch, doltReset, doltResolveConflicts, doltSchemaConflicts, doltStatus, doltTableConflicts, doltTag, ensureBranchExists, ensureSchemaSync, formatSchemaDiffSummary, getActiveBranch, getBranch, getCurrentBranchOrCommit, getCurrentRefScope, getProjectMainResolvedRef, getProjectScopedRef, getRefScopedDb, getSchemaDiff, getTenantMainBranch, getTenantScopedRef, hasSchemaDifferences, hasUncommittedChanges, isInRefScope, isProtectedBranchName, isRefWritable, isValidCommitHash, listBranches, listBranchesForAgent, refMiddlewareFactory, resolveRef, syncSchemaFromMain, withRef, writeProtectionMiddlewareFactory };
11
+ export { MAIN_BRANCH_SUFFIX, NestedRefScopeError, SCHEMA_SOURCE_BRANCH, areBranchesSchemaCompatible, checkoutBranch, checkoutRef, createBranch, createRefMiddleware, createWriteProtectionMiddleware, deleteBranch, doltAbortMerge, doltActiveBranch, doltAdd, doltAddAndCommit, doltBranch, doltBranchExists, doltCheckout, doltCommit, doltConflicts, doltDeleteBranch, doltDeleteTag, doltDiff, doltDiffSummary, doltGetBranchNamespace, doltHashOf, doltListBranches, doltListTags, doltLog, doltMerge, doltMergeStatus, doltRenameBranch, doltReset, doltResolveConflicts, doltSchemaConflicts, doltStatus, doltTableConflicts, doltTag, ensureBranchExists, ensureSchemaSync, formatSchemaDiffSummary, getActiveBranch, getBranch, getCurrentBranchOrCommit, getCurrentRefScope, getProjectMainResolvedRef, getProjectScopedRef, getRefScopedDb, getSchemaDiff, getTenantMainBranch, getTenantScopedRef, hasSchemaDifferences, hasUncommittedChanges, isInRefScope, isLocalhostUrl, isProtectedBranchName, isRefWritable, isValidCommitHash, listBranches, listBranchesForAgent, refMiddlewareFactory, resolveRef, syncSchemaFromMain, withRef, writeProtectionMiddlewareFactory };
@@ -1,6 +1,8 @@
1
+ import { loadEnvironmentFiles } from "../env.js";
1
2
  import { createAgentsManageDatabaseClient } from "../db/manage/manage-client.js";
2
3
  import { syncSchemaFromMain } from "./schema-sync.js";
3
4
  import { doltCheckout, doltListBranches } from "./branch.js";
5
+ import { confirmMigration } from "../db/utils.js";
4
6
 
5
7
  //#region src/dolt/migrate-all-branches.ts
6
8
  const ansi = {
@@ -22,6 +24,9 @@ const format = {
22
24
  };
23
25
  const ms = (start, end) => `${Math.max(0, end - start)}ms`;
24
26
  const main = async () => {
27
+ loadEnvironmentFiles();
28
+ const connectionString = process.env.INKEEP_AGENTS_MANAGE_DATABASE_URL;
29
+ await confirmMigration(connectionString);
25
30
  const startedAt = Date.now();
26
31
  const db = createAgentsManageDatabaseClient({});
27
32
  const branches = await doltListBranches(db)();
@@ -1,18 +1,21 @@
1
1
  import { loadEnvironmentFiles } from "../env.js";
2
2
  import { createAgentsManageDatabaseClient } from "../db/manage/manage-client.js";
3
3
  import { doltAddAndCommit, doltStatus } from "./commit.js";
4
+ import { confirmMigration } from "../db/utils.js";
4
5
  import { execSync } from "node:child_process";
5
6
 
6
7
  //#region src/dolt/migrate-dolt.ts
7
8
  const commitMigrations = async () => {
8
9
  loadEnvironmentFiles();
10
+ const connectionString = process.env.INKEEP_AGENTS_MANAGE_DATABASE_URL;
11
+ await confirmMigration(connectionString);
9
12
  try {
10
13
  execSync("drizzle-kit migrate --config=drizzle.manage.config.ts", { stdio: "inherit" });
11
14
  } catch (error) {
12
15
  console.error("❌ Error running migrations:", error);
13
16
  process.exit(1);
14
17
  }
15
- const db = createAgentsManageDatabaseClient({ connectionString: process.env.INKEEP_AGENTS_MANAGE_DATABASE_URL });
18
+ const db = createAgentsManageDatabaseClient({ connectionString });
16
19
  if ((await doltStatus(db)()).length > 0) await doltAddAndCommit(db)({ message: "Applied database migrations" });
17
20
  else console.log("ℹ️ No changes to commit - database is up to date\n");
18
21
  };
@@ -130,5 +130,6 @@ declare const areBranchesSchemaCompatible: (db: AgentsManageDatabaseClient) => (
130
130
  branchADifferences: SchemaDiff[];
131
131
  branchBDifferences: SchemaDiff[];
132
132
  }>;
133
+ declare const isLocalhostUrl: (url: string | undefined) => boolean;
133
134
  //#endregion
134
- export { EnsureSchemaSyncOptions, SCHEMA_SOURCE_BRANCH, SchemaDiff, SchemaSyncOptions, SchemaSyncResult, areBranchesSchemaCompatible, ensureSchemaSync, formatSchemaDiffSummary, getActiveBranch, getSchemaDiff, hasSchemaDifferences, hasUncommittedChanges, syncSchemaFromMain };
135
+ export { EnsureSchemaSyncOptions, SCHEMA_SOURCE_BRANCH, SchemaDiff, SchemaSyncOptions, SchemaSyncResult, areBranchesSchemaCompatible, ensureSchemaSync, formatSchemaDiffSummary, getActiveBranch, getSchemaDiff, hasSchemaDifferences, hasUncommittedChanges, isLocalhostUrl, syncSchemaFromMain };
@@ -241,6 +241,15 @@ const areBranchesSchemaCompatible = (db) => async (branchA, branchB) => {
241
241
  branchBDifferences: diffB
242
242
  };
243
243
  };
244
+ const isLocalhostUrl = (url) => {
245
+ if (!url) return false;
246
+ try {
247
+ const parsed = new URL(url);
248
+ return parsed.hostname === "localhost" || parsed.hostname === "127.0.0.1" || parsed.hostname === "::1";
249
+ } catch {
250
+ return url.includes("localhost") || url.includes("127.0.0.1");
251
+ }
252
+ };
244
253
 
245
254
  //#endregion
246
- export { SCHEMA_SOURCE_BRANCH, areBranchesSchemaCompatible, ensureSchemaSync, formatSchemaDiffSummary, getActiveBranch, getSchemaDiff, hasSchemaDifferences, hasUncommittedChanges, syncSchemaFromMain };
255
+ export { SCHEMA_SOURCE_BRANCH, areBranchesSchemaCompatible, ensureSchemaSync, formatSchemaDiffSummary, getActiveBranch, getSchemaDiff, hasSchemaDifferences, hasUncommittedChanges, isLocalhostUrl, syncSchemaFromMain };