@axiom-lattice/local-stores 1.0.17 → 1.0.19
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/.turbo/turbo-build.log +10 -10
- package/CHANGELOG.md +15 -0
- package/dist/index.d.mts +18 -2
- package/dist/index.d.ts +18 -2
- package/dist/index.js +117 -22
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +116 -22
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -3
- package/src/createLocalStoreConfig.ts +2 -0
- package/src/index.ts +1 -0
- package/src/stores/LocalConnectionStore.ts +127 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @axiom-lattice/local-stores@1.0.
|
|
2
|
+
> @axiom-lattice/local-stores@1.0.19 build /home/runner/work/agentic/agentic/packages/local-stores
|
|
3
3
|
> tsup src/index.ts --format cjs,esm --dts --sourcemap
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
[34mCLI[39m Target: es2020
|
|
9
9
|
[34mCJS[39m Build start
|
|
10
10
|
[34mESM[39m Build start
|
|
11
|
-
[
|
|
12
|
-
[
|
|
13
|
-
[
|
|
14
|
-
[
|
|
15
|
-
[
|
|
16
|
-
[
|
|
11
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m119.69 KB[39m
|
|
12
|
+
[32mESM[39m [1mdist/index.mjs.map [22m[32m227.42 KB[39m
|
|
13
|
+
[32mESM[39m ⚡️ Build success in 434ms
|
|
14
|
+
[32mCJS[39m [1mdist/index.js [22m[32m123.02 KB[39m
|
|
15
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m230.10 KB[39m
|
|
16
|
+
[32mCJS[39m ⚡️ Build success in 439ms
|
|
17
17
|
[34mDTS[39m Build start
|
|
18
|
-
[32mDTS[39m ⚡️ Build success in
|
|
19
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[
|
|
20
|
-
[32mDTS[39m [1mdist/index.d.mts [22m[
|
|
18
|
+
[32mDTS[39m ⚡️ Build success in 15267ms
|
|
19
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m27.67 KB[39m
|
|
20
|
+
[32mDTS[39m [1mdist/index.d.mts [22m[32m27.67 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @axiom-lattice/local-stores
|
|
2
2
|
|
|
3
|
+
## 1.0.19
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [576443a]
|
|
8
|
+
- @axiom-lattice/core@2.1.97
|
|
9
|
+
|
|
10
|
+
## 1.0.18
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies [aeb0bbd]
|
|
15
|
+
- @axiom-lattice/core@2.1.96
|
|
16
|
+
- @axiom-lattice/protocols@2.1.50
|
|
17
|
+
|
|
3
18
|
## 1.0.17
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SqlJsStatic, Database } from 'sql.js';
|
|
2
2
|
import { SqliteSaver } from '@langchain/langgraph-checkpoint-sqlite';
|
|
3
|
-
import { ThreadStore, Thread, CreateThreadRequest, AssistantStore, Assistant, CreateAssistantRequest, WorkspaceStore, Workspace, CreateWorkspaceRequest, UpdateWorkspaceRequest, ProjectStore, Project, CreateProjectRequest, UpdateProjectRequest, UserStore, User, CreateUserRequest, UpdateUserRequest, TenantStore, Tenant, CreateTenantRequest, UpdateTenantRequest, UserTenantLinkStore, UserTenantLink, CreateUserTenantLinkRequest, UpdateUserTenantLinkRequest, DatabaseConfigStore, DatabaseConfigEntry, CreateDatabaseConfigRequest, UpdateDatabaseConfigRequest, MetricsServerConfigStore, MetricsServerConfigEntry, CreateMetricsServerConfigRequest, UpdateMetricsServerConfigRequest, McpServerConfigStore, McpServerConfigEntry, CreateMcpServerConfigRequest, UpdateMcpServerConfigRequest, WorkflowTrackingStore, CreateWorkflowRunRequest, WorkflowRun, UpdateWorkflowRunRequest, CreateRunStepRequest, RunStep, UpdateRunStepRequest, StepType, EvalStore, EvalProject, CreateEvalProjectRequest, EvalSuite, CreateEvalSuiteRequest, EvalCase, CreateEvalCaseRequest, EvalRun, CreateEvalRunRequest, EvalRunResult, EvalProjectReport, BindingRegistry, Binding, CreateBindingInput, ChannelInstallationStore, ChannelInstallation, ChannelInstallationType, CreateChannelInstallationRequest, UpdateChannelInstallationRequest, A2AApiKeyStore, A2AApiKeyRecord, CreateA2AApiKeyInput, A2AApiKeyEntry, SkillStore, SkillStoreContext, Skill, CreateSkillRequest, ScheduleStorage, ScheduledTaskDefinition, ScheduledTaskStatus, ScheduleExecutionType, TaskStore, CreateTaskRequest, TaskItem, TaskListFilter, UpdateTaskRequest } from '@axiom-lattice/protocols';
|
|
3
|
+
import { ThreadStore, Thread, CreateThreadRequest, AssistantStore, Assistant, CreateAssistantRequest, WorkspaceStore, Workspace, CreateWorkspaceRequest, UpdateWorkspaceRequest, ProjectStore, Project, CreateProjectRequest, UpdateProjectRequest, UserStore, User, CreateUserRequest, UpdateUserRequest, TenantStore, Tenant, CreateTenantRequest, UpdateTenantRequest, UserTenantLinkStore, UserTenantLink, CreateUserTenantLinkRequest, UpdateUserTenantLinkRequest, DatabaseConfigStore, DatabaseConfigEntry, CreateDatabaseConfigRequest, UpdateDatabaseConfigRequest, ConnectionStore, ConnectionEntry, MetricsServerConfigStore, MetricsServerConfigEntry, CreateMetricsServerConfigRequest, UpdateMetricsServerConfigRequest, McpServerConfigStore, McpServerConfigEntry, CreateMcpServerConfigRequest, UpdateMcpServerConfigRequest, WorkflowTrackingStore, CreateWorkflowRunRequest, WorkflowRun, UpdateWorkflowRunRequest, CreateRunStepRequest, RunStep, UpdateRunStepRequest, StepType, EvalStore, EvalProject, CreateEvalProjectRequest, EvalSuite, CreateEvalSuiteRequest, EvalCase, CreateEvalCaseRequest, EvalRun, CreateEvalRunRequest, EvalRunResult, EvalProjectReport, BindingRegistry, Binding, CreateBindingInput, ChannelInstallationStore, ChannelInstallation, ChannelInstallationType, CreateChannelInstallationRequest, UpdateChannelInstallationRequest, A2AApiKeyStore, A2AApiKeyRecord, CreateA2AApiKeyInput, A2AApiKeyEntry, SkillStore, SkillStoreContext, Skill, CreateSkillRequest, ScheduleStorage, ScheduledTaskDefinition, ScheduledTaskStatus, ScheduleExecutionType, TaskStore, CreateTaskRequest, TaskItem, TaskListFilter, UpdateTaskRequest } from '@axiom-lattice/protocols';
|
|
4
4
|
import { IMessageQueueStore, AddMessageParams, PendingMessage, ThreadInfo } from '@axiom-lattice/core';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -308,6 +308,21 @@ declare class LocalDatabaseConfigStore implements DatabaseConfigStore {
|
|
|
308
308
|
hasConfig(tenantId: string, id: string): Promise<boolean>;
|
|
309
309
|
}
|
|
310
310
|
|
|
311
|
+
/**
|
|
312
|
+
* Local SQLite implementation of ConnectionStore.
|
|
313
|
+
*/
|
|
314
|
+
|
|
315
|
+
declare class LocalConnectionStore implements ConnectionStore {
|
|
316
|
+
private db;
|
|
317
|
+
constructor(db: DatabaseWrapper);
|
|
318
|
+
listByType(tenantId: string, type: string): Promise<ConnectionEntry[]>;
|
|
319
|
+
getByKey(tenantId: string, type: string, key: string): Promise<ConnectionEntry | null>;
|
|
320
|
+
create(entry: Omit<ConnectionEntry, "id" | "createdAt" | "updatedAt">): Promise<ConnectionEntry>;
|
|
321
|
+
update(tenantId: string, type: string, key: string, updates: Partial<ConnectionEntry>): Promise<ConnectionEntry | null>;
|
|
322
|
+
delete(tenantId: string, type: string, key: string): Promise<boolean>;
|
|
323
|
+
private mapRow;
|
|
324
|
+
}
|
|
325
|
+
|
|
311
326
|
/**
|
|
312
327
|
* Local SQLite implementation of MetricsServerConfigStore.
|
|
313
328
|
*/
|
|
@@ -620,6 +635,7 @@ declare function createLocalStoreConfig(options?: LocalStoreConfigOptions): Prom
|
|
|
620
635
|
tenant: LocalTenantStore;
|
|
621
636
|
userTenantLink: LocalUserTenantLinkStore;
|
|
622
637
|
database: LocalDatabaseConfigStore;
|
|
638
|
+
connection: LocalConnectionStore;
|
|
623
639
|
metrics: LocalMetricsServerConfigStore;
|
|
624
640
|
mcp: LocalMcpServerConfigStore;
|
|
625
641
|
workflowTracking: LocalWorkflowTrackingStore;
|
|
@@ -634,4 +650,4 @@ declare function createLocalStoreConfig(options?: LocalStoreConfigOptions): Prom
|
|
|
634
650
|
checkpoint: SqliteSaver;
|
|
635
651
|
}>;
|
|
636
652
|
|
|
637
|
-
export { DatabaseWrapper, LocalA2AApiKeyStore, LocalAssistantStore, LocalChannelBindingStore, LocalChannelInstallationStore, LocalDatabaseConfigStore, LocalEvalStore, LocalMcpServerConfigStore, LocalMetricsServerConfigStore, LocalProjectStore, LocalScheduleStorage, LocalSkillStore, type LocalStoreConfigOptions, type LocalStoreOptions, LocalTaskStore, LocalTenantStore, LocalThreadMessageQueueStore, LocalThreadStore, LocalUserStore, LocalUserTenantLinkStore, LocalWorkflowTrackingStore, LocalWorkspaceStore, type Migration, MigrationManager, RunResult, StatementWrapper, closeDatabase, createLocalStoreConfig, ensureTable, getDatabase, initDatabase, nowISO, parseISO };
|
|
653
|
+
export { DatabaseWrapper, LocalA2AApiKeyStore, LocalAssistantStore, LocalChannelBindingStore, LocalChannelInstallationStore, LocalConnectionStore, LocalDatabaseConfigStore, LocalEvalStore, LocalMcpServerConfigStore, LocalMetricsServerConfigStore, LocalProjectStore, LocalScheduleStorage, LocalSkillStore, type LocalStoreConfigOptions, type LocalStoreOptions, LocalTaskStore, LocalTenantStore, LocalThreadMessageQueueStore, LocalThreadStore, LocalUserStore, LocalUserTenantLinkStore, LocalWorkflowTrackingStore, LocalWorkspaceStore, type Migration, MigrationManager, RunResult, StatementWrapper, closeDatabase, createLocalStoreConfig, ensureTable, getDatabase, initDatabase, nowISO, parseISO };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SqlJsStatic, Database } from 'sql.js';
|
|
2
2
|
import { SqliteSaver } from '@langchain/langgraph-checkpoint-sqlite';
|
|
3
|
-
import { ThreadStore, Thread, CreateThreadRequest, AssistantStore, Assistant, CreateAssistantRequest, WorkspaceStore, Workspace, CreateWorkspaceRequest, UpdateWorkspaceRequest, ProjectStore, Project, CreateProjectRequest, UpdateProjectRequest, UserStore, User, CreateUserRequest, UpdateUserRequest, TenantStore, Tenant, CreateTenantRequest, UpdateTenantRequest, UserTenantLinkStore, UserTenantLink, CreateUserTenantLinkRequest, UpdateUserTenantLinkRequest, DatabaseConfigStore, DatabaseConfigEntry, CreateDatabaseConfigRequest, UpdateDatabaseConfigRequest, MetricsServerConfigStore, MetricsServerConfigEntry, CreateMetricsServerConfigRequest, UpdateMetricsServerConfigRequest, McpServerConfigStore, McpServerConfigEntry, CreateMcpServerConfigRequest, UpdateMcpServerConfigRequest, WorkflowTrackingStore, CreateWorkflowRunRequest, WorkflowRun, UpdateWorkflowRunRequest, CreateRunStepRequest, RunStep, UpdateRunStepRequest, StepType, EvalStore, EvalProject, CreateEvalProjectRequest, EvalSuite, CreateEvalSuiteRequest, EvalCase, CreateEvalCaseRequest, EvalRun, CreateEvalRunRequest, EvalRunResult, EvalProjectReport, BindingRegistry, Binding, CreateBindingInput, ChannelInstallationStore, ChannelInstallation, ChannelInstallationType, CreateChannelInstallationRequest, UpdateChannelInstallationRequest, A2AApiKeyStore, A2AApiKeyRecord, CreateA2AApiKeyInput, A2AApiKeyEntry, SkillStore, SkillStoreContext, Skill, CreateSkillRequest, ScheduleStorage, ScheduledTaskDefinition, ScheduledTaskStatus, ScheduleExecutionType, TaskStore, CreateTaskRequest, TaskItem, TaskListFilter, UpdateTaskRequest } from '@axiom-lattice/protocols';
|
|
3
|
+
import { ThreadStore, Thread, CreateThreadRequest, AssistantStore, Assistant, CreateAssistantRequest, WorkspaceStore, Workspace, CreateWorkspaceRequest, UpdateWorkspaceRequest, ProjectStore, Project, CreateProjectRequest, UpdateProjectRequest, UserStore, User, CreateUserRequest, UpdateUserRequest, TenantStore, Tenant, CreateTenantRequest, UpdateTenantRequest, UserTenantLinkStore, UserTenantLink, CreateUserTenantLinkRequest, UpdateUserTenantLinkRequest, DatabaseConfigStore, DatabaseConfigEntry, CreateDatabaseConfigRequest, UpdateDatabaseConfigRequest, ConnectionStore, ConnectionEntry, MetricsServerConfigStore, MetricsServerConfigEntry, CreateMetricsServerConfigRequest, UpdateMetricsServerConfigRequest, McpServerConfigStore, McpServerConfigEntry, CreateMcpServerConfigRequest, UpdateMcpServerConfigRequest, WorkflowTrackingStore, CreateWorkflowRunRequest, WorkflowRun, UpdateWorkflowRunRequest, CreateRunStepRequest, RunStep, UpdateRunStepRequest, StepType, EvalStore, EvalProject, CreateEvalProjectRequest, EvalSuite, CreateEvalSuiteRequest, EvalCase, CreateEvalCaseRequest, EvalRun, CreateEvalRunRequest, EvalRunResult, EvalProjectReport, BindingRegistry, Binding, CreateBindingInput, ChannelInstallationStore, ChannelInstallation, ChannelInstallationType, CreateChannelInstallationRequest, UpdateChannelInstallationRequest, A2AApiKeyStore, A2AApiKeyRecord, CreateA2AApiKeyInput, A2AApiKeyEntry, SkillStore, SkillStoreContext, Skill, CreateSkillRequest, ScheduleStorage, ScheduledTaskDefinition, ScheduledTaskStatus, ScheduleExecutionType, TaskStore, CreateTaskRequest, TaskItem, TaskListFilter, UpdateTaskRequest } from '@axiom-lattice/protocols';
|
|
4
4
|
import { IMessageQueueStore, AddMessageParams, PendingMessage, ThreadInfo } from '@axiom-lattice/core';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -308,6 +308,21 @@ declare class LocalDatabaseConfigStore implements DatabaseConfigStore {
|
|
|
308
308
|
hasConfig(tenantId: string, id: string): Promise<boolean>;
|
|
309
309
|
}
|
|
310
310
|
|
|
311
|
+
/**
|
|
312
|
+
* Local SQLite implementation of ConnectionStore.
|
|
313
|
+
*/
|
|
314
|
+
|
|
315
|
+
declare class LocalConnectionStore implements ConnectionStore {
|
|
316
|
+
private db;
|
|
317
|
+
constructor(db: DatabaseWrapper);
|
|
318
|
+
listByType(tenantId: string, type: string): Promise<ConnectionEntry[]>;
|
|
319
|
+
getByKey(tenantId: string, type: string, key: string): Promise<ConnectionEntry | null>;
|
|
320
|
+
create(entry: Omit<ConnectionEntry, "id" | "createdAt" | "updatedAt">): Promise<ConnectionEntry>;
|
|
321
|
+
update(tenantId: string, type: string, key: string, updates: Partial<ConnectionEntry>): Promise<ConnectionEntry | null>;
|
|
322
|
+
delete(tenantId: string, type: string, key: string): Promise<boolean>;
|
|
323
|
+
private mapRow;
|
|
324
|
+
}
|
|
325
|
+
|
|
311
326
|
/**
|
|
312
327
|
* Local SQLite implementation of MetricsServerConfigStore.
|
|
313
328
|
*/
|
|
@@ -620,6 +635,7 @@ declare function createLocalStoreConfig(options?: LocalStoreConfigOptions): Prom
|
|
|
620
635
|
tenant: LocalTenantStore;
|
|
621
636
|
userTenantLink: LocalUserTenantLinkStore;
|
|
622
637
|
database: LocalDatabaseConfigStore;
|
|
638
|
+
connection: LocalConnectionStore;
|
|
623
639
|
metrics: LocalMetricsServerConfigStore;
|
|
624
640
|
mcp: LocalMcpServerConfigStore;
|
|
625
641
|
workflowTracking: LocalWorkflowTrackingStore;
|
|
@@ -634,4 +650,4 @@ declare function createLocalStoreConfig(options?: LocalStoreConfigOptions): Prom
|
|
|
634
650
|
checkpoint: SqliteSaver;
|
|
635
651
|
}>;
|
|
636
652
|
|
|
637
|
-
export { DatabaseWrapper, LocalA2AApiKeyStore, LocalAssistantStore, LocalChannelBindingStore, LocalChannelInstallationStore, LocalDatabaseConfigStore, LocalEvalStore, LocalMcpServerConfigStore, LocalMetricsServerConfigStore, LocalProjectStore, LocalScheduleStorage, LocalSkillStore, type LocalStoreConfigOptions, type LocalStoreOptions, LocalTaskStore, LocalTenantStore, LocalThreadMessageQueueStore, LocalThreadStore, LocalUserStore, LocalUserTenantLinkStore, LocalWorkflowTrackingStore, LocalWorkspaceStore, type Migration, MigrationManager, RunResult, StatementWrapper, closeDatabase, createLocalStoreConfig, ensureTable, getDatabase, initDatabase, nowISO, parseISO };
|
|
653
|
+
export { DatabaseWrapper, LocalA2AApiKeyStore, LocalAssistantStore, LocalChannelBindingStore, LocalChannelInstallationStore, LocalConnectionStore, LocalDatabaseConfigStore, LocalEvalStore, LocalMcpServerConfigStore, LocalMetricsServerConfigStore, LocalProjectStore, LocalScheduleStorage, LocalSkillStore, type LocalStoreConfigOptions, type LocalStoreOptions, LocalTaskStore, LocalTenantStore, LocalThreadMessageQueueStore, LocalThreadStore, LocalUserStore, LocalUserTenantLinkStore, LocalWorkflowTrackingStore, LocalWorkspaceStore, type Migration, MigrationManager, RunResult, StatementWrapper, closeDatabase, createLocalStoreConfig, ensureTable, getDatabase, initDatabase, nowISO, parseISO };
|
package/dist/index.js
CHANGED
|
@@ -35,6 +35,7 @@ __export(index_exports, {
|
|
|
35
35
|
LocalAssistantStore: () => LocalAssistantStore,
|
|
36
36
|
LocalChannelBindingStore: () => LocalChannelBindingStore,
|
|
37
37
|
LocalChannelInstallationStore: () => LocalChannelInstallationStore,
|
|
38
|
+
LocalConnectionStore: () => LocalConnectionStore,
|
|
38
39
|
LocalDatabaseConfigStore: () => LocalDatabaseConfigStore,
|
|
39
40
|
LocalEvalStore: () => LocalEvalStore,
|
|
40
41
|
LocalMcpServerConfigStore: () => LocalMcpServerConfigStore,
|
|
@@ -1198,8 +1199,100 @@ function encryptPasswordInConfig(config) {
|
|
|
1198
1199
|
return config;
|
|
1199
1200
|
}
|
|
1200
1201
|
|
|
1201
|
-
// src/stores/
|
|
1202
|
+
// src/stores/LocalConnectionStore.ts
|
|
1203
|
+
var import_uuid = require("uuid");
|
|
1202
1204
|
var DDL9 = `
|
|
1205
|
+
CREATE TABLE IF NOT EXISTS connection_configs (
|
|
1206
|
+
id TEXT NOT NULL,
|
|
1207
|
+
tenant_id TEXT NOT NULL,
|
|
1208
|
+
type TEXT NOT NULL,
|
|
1209
|
+
key TEXT NOT NULL,
|
|
1210
|
+
name TEXT NOT NULL,
|
|
1211
|
+
description TEXT,
|
|
1212
|
+
config TEXT NOT NULL,
|
|
1213
|
+
created_at TEXT NOT NULL,
|
|
1214
|
+
updated_at TEXT NOT NULL,
|
|
1215
|
+
PRIMARY KEY (tenant_id, id),
|
|
1216
|
+
UNIQUE (tenant_id, type, key)
|
|
1217
|
+
);
|
|
1218
|
+
CREATE INDEX IF NOT EXISTS idx_conn_type ON connection_configs(tenant_id, type);
|
|
1219
|
+
`;
|
|
1220
|
+
var LocalConnectionStore = class {
|
|
1221
|
+
constructor(db) {
|
|
1222
|
+
this.db = db;
|
|
1223
|
+
ensureTable(db, DDL9);
|
|
1224
|
+
}
|
|
1225
|
+
async listByType(tenantId, type) {
|
|
1226
|
+
const rows = this.db.prepare(
|
|
1227
|
+
`SELECT * FROM connection_configs WHERE tenant_id = ? AND type = ? ORDER BY created_at`
|
|
1228
|
+
).all(tenantId, type);
|
|
1229
|
+
return rows.map((r) => this.mapRow(r));
|
|
1230
|
+
}
|
|
1231
|
+
async getByKey(tenantId, type, key) {
|
|
1232
|
+
const row = this.db.prepare(
|
|
1233
|
+
`SELECT * FROM connection_configs WHERE tenant_id = ? AND type = ? AND key = ?`
|
|
1234
|
+
).get(tenantId, type, key);
|
|
1235
|
+
return row ? this.mapRow(row) : null;
|
|
1236
|
+
}
|
|
1237
|
+
async create(entry) {
|
|
1238
|
+
const id = (0, import_uuid.v4)();
|
|
1239
|
+
const now = nowISO();
|
|
1240
|
+
this.db.prepare(
|
|
1241
|
+
`INSERT INTO connection_configs (id, tenant_id, type, key, name, description, config, created_at, updated_at)
|
|
1242
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)`
|
|
1243
|
+
).run(id, entry.tenantId, entry.type, entry.key, entry.name, entry.description || null, JSON.stringify(entry.config), now, now);
|
|
1244
|
+
return { id, ...entry, createdAt: now, updatedAt: now };
|
|
1245
|
+
}
|
|
1246
|
+
async update(tenantId, type, key, updates) {
|
|
1247
|
+
const existing = await this.getByKey(tenantId, type, key);
|
|
1248
|
+
if (!existing) return null;
|
|
1249
|
+
const setClauses = [];
|
|
1250
|
+
const values = [];
|
|
1251
|
+
if (updates.name !== void 0) {
|
|
1252
|
+
setClauses.push("name = ?");
|
|
1253
|
+
values.push(updates.name);
|
|
1254
|
+
}
|
|
1255
|
+
if (updates.description !== void 0) {
|
|
1256
|
+
setClauses.push("description = ?");
|
|
1257
|
+
values.push(updates.description || null);
|
|
1258
|
+
}
|
|
1259
|
+
if (updates.config !== void 0) {
|
|
1260
|
+
setClauses.push("config = ?");
|
|
1261
|
+
values.push(JSON.stringify(updates.config));
|
|
1262
|
+
}
|
|
1263
|
+
if (setClauses.length === 0) return existing;
|
|
1264
|
+
const now = nowISO();
|
|
1265
|
+
setClauses.push("updated_at = ?");
|
|
1266
|
+
values.push(now);
|
|
1267
|
+
values.push(tenantId, type, key);
|
|
1268
|
+
this.db.prepare(
|
|
1269
|
+
`UPDATE connection_configs SET ${setClauses.join(", ")} WHERE tenant_id = ? AND type = ? AND key = ?`
|
|
1270
|
+
).run(...values);
|
|
1271
|
+
return this.getByKey(tenantId, type, key);
|
|
1272
|
+
}
|
|
1273
|
+
async delete(tenantId, type, key) {
|
|
1274
|
+
const result = this.db.prepare(
|
|
1275
|
+
`DELETE FROM connection_configs WHERE tenant_id = ? AND type = ? AND key = ?`
|
|
1276
|
+
).run(tenantId, type, key);
|
|
1277
|
+
return result.changes > 0;
|
|
1278
|
+
}
|
|
1279
|
+
mapRow(row) {
|
|
1280
|
+
return {
|
|
1281
|
+
id: row.id,
|
|
1282
|
+
tenantId: row.tenant_id,
|
|
1283
|
+
type: row.type,
|
|
1284
|
+
key: row.key,
|
|
1285
|
+
name: row.name,
|
|
1286
|
+
description: row.description || void 0,
|
|
1287
|
+
config: JSON.parse(row.config),
|
|
1288
|
+
createdAt: row.created_at,
|
|
1289
|
+
updatedAt: row.updated_at
|
|
1290
|
+
};
|
|
1291
|
+
}
|
|
1292
|
+
};
|
|
1293
|
+
|
|
1294
|
+
// src/stores/LocalMetricsServerConfigStore.ts
|
|
1295
|
+
var DDL10 = `
|
|
1203
1296
|
CREATE TABLE IF NOT EXISTS lt_metrics_configs (
|
|
1204
1297
|
id TEXT NOT NULL,
|
|
1205
1298
|
tenant_id TEXT NOT NULL,
|
|
@@ -1216,7 +1309,7 @@ CREATE UNIQUE INDEX IF NOT EXISTS idx_lt_metrics_key ON lt_metrics_configs(tenan
|
|
|
1216
1309
|
var LocalMetricsServerConfigStore = class {
|
|
1217
1310
|
constructor(db) {
|
|
1218
1311
|
this.db = db;
|
|
1219
|
-
ensureTable(db,
|
|
1312
|
+
ensureTable(db, DDL10);
|
|
1220
1313
|
}
|
|
1221
1314
|
async getAllConfigs(tenantId) {
|
|
1222
1315
|
const rows = this.db.prepare(
|
|
@@ -1324,7 +1417,7 @@ function mapRowToEntry2(row) {
|
|
|
1324
1417
|
|
|
1325
1418
|
// src/stores/LocalMcpServerConfigStore.ts
|
|
1326
1419
|
var import_core2 = require("@axiom-lattice/core");
|
|
1327
|
-
var
|
|
1420
|
+
var DDL11 = `
|
|
1328
1421
|
CREATE TABLE IF NOT EXISTS lt_mcp_configs (
|
|
1329
1422
|
id TEXT NOT NULL,
|
|
1330
1423
|
tenant_id TEXT NOT NULL,
|
|
@@ -1344,7 +1437,7 @@ CREATE UNIQUE INDEX IF NOT EXISTS idx_lt_mcp_key ON lt_mcp_configs(tenant_id, ke
|
|
|
1344
1437
|
var LocalMcpServerConfigStore = class {
|
|
1345
1438
|
constructor(db) {
|
|
1346
1439
|
this.db = db;
|
|
1347
|
-
ensureTable(db,
|
|
1440
|
+
ensureTable(db, DDL11);
|
|
1348
1441
|
}
|
|
1349
1442
|
async getAllConfigs(tenantId) {
|
|
1350
1443
|
const rows = this.db.prepare(
|
|
@@ -1510,7 +1603,7 @@ function encryptEnvInConfig(config) {
|
|
|
1510
1603
|
}
|
|
1511
1604
|
|
|
1512
1605
|
// src/stores/LocalWorkflowTrackingStore.ts
|
|
1513
|
-
var
|
|
1606
|
+
var DDL12 = `
|
|
1514
1607
|
CREATE TABLE IF NOT EXISTS lt_workflow_runs (
|
|
1515
1608
|
id TEXT PRIMARY KEY,
|
|
1516
1609
|
tenant_id TEXT NOT NULL,
|
|
@@ -1558,7 +1651,7 @@ ALTER TABLE lt_workflow_steps ADD COLUMN IF NOT EXISTS thread_id TEXT;
|
|
|
1558
1651
|
var LocalWorkflowTrackingStore = class {
|
|
1559
1652
|
constructor(db) {
|
|
1560
1653
|
this.db = db;
|
|
1561
|
-
ensureTable(db,
|
|
1654
|
+
ensureTable(db, DDL12);
|
|
1562
1655
|
}
|
|
1563
1656
|
async createWorkflowRun(request) {
|
|
1564
1657
|
const now = nowISO();
|
|
@@ -1819,7 +1912,7 @@ function mapRowToStep(row) {
|
|
|
1819
1912
|
|
|
1820
1913
|
// src/stores/LocalEvalStore.ts
|
|
1821
1914
|
var import_crypto = require("crypto");
|
|
1822
|
-
var
|
|
1915
|
+
var DDL13 = `
|
|
1823
1916
|
CREATE TABLE IF NOT EXISTS lt_eval_projects (
|
|
1824
1917
|
id TEXT NOT NULL,
|
|
1825
1918
|
tenant_id TEXT NOT NULL,
|
|
@@ -1922,7 +2015,7 @@ function parseOptionalJson(val) {
|
|
|
1922
2015
|
var LocalEvalStore = class {
|
|
1923
2016
|
constructor(db) {
|
|
1924
2017
|
this.db = db;
|
|
1925
|
-
ensureTable(db,
|
|
2018
|
+
ensureTable(db, DDL13);
|
|
1926
2019
|
}
|
|
1927
2020
|
// -------------------------------------------------------------------------
|
|
1928
2021
|
// Projects
|
|
@@ -2383,7 +2476,7 @@ var LocalEvalStore = class {
|
|
|
2383
2476
|
|
|
2384
2477
|
// src/stores/LocalChannelBindingStore.ts
|
|
2385
2478
|
var import_crypto2 = require("crypto");
|
|
2386
|
-
var
|
|
2479
|
+
var DDL14 = `
|
|
2387
2480
|
CREATE TABLE IF NOT EXISTS lt_channel_bindings (
|
|
2388
2481
|
id TEXT PRIMARY KEY,
|
|
2389
2482
|
channel TEXT NOT NULL,
|
|
@@ -2406,7 +2499,7 @@ CREATE INDEX IF NOT EXISTS idx_lt_cb_resolve ON lt_channel_bindings(channel, sen
|
|
|
2406
2499
|
var LocalChannelBindingStore = class {
|
|
2407
2500
|
constructor(db) {
|
|
2408
2501
|
this.db = db;
|
|
2409
|
-
ensureTable(db,
|
|
2502
|
+
ensureTable(db, DDL14);
|
|
2410
2503
|
}
|
|
2411
2504
|
async resolve(params) {
|
|
2412
2505
|
const row = this.db.prepare(
|
|
@@ -2548,7 +2641,7 @@ function mapRowToBinding(row) {
|
|
|
2548
2641
|
}
|
|
2549
2642
|
|
|
2550
2643
|
// src/stores/LocalChannelInstallationStore.ts
|
|
2551
|
-
var
|
|
2644
|
+
var DDL15 = `
|
|
2552
2645
|
CREATE TABLE IF NOT EXISTS lt_channel_installations (
|
|
2553
2646
|
id TEXT PRIMARY KEY,
|
|
2554
2647
|
tenant_id TEXT NOT NULL,
|
|
@@ -2566,7 +2659,7 @@ CREATE INDEX IF NOT EXISTS idx_lt_ci_tenant ON lt_channel_installations(tenant_i
|
|
|
2566
2659
|
var LocalChannelInstallationStore = class {
|
|
2567
2660
|
constructor(db) {
|
|
2568
2661
|
this.db = db;
|
|
2569
|
-
ensureTable(db,
|
|
2662
|
+
ensureTable(db, DDL15);
|
|
2570
2663
|
}
|
|
2571
2664
|
async getInstallationById(installationId) {
|
|
2572
2665
|
const row = this.db.prepare(
|
|
@@ -2699,7 +2792,7 @@ function mapRow(row) {
|
|
|
2699
2792
|
// src/stores/LocalA2AApiKeyStore.ts
|
|
2700
2793
|
var import_core3 = require("@axiom-lattice/core");
|
|
2701
2794
|
var import_crypto3 = require("crypto");
|
|
2702
|
-
var
|
|
2795
|
+
var DDL16 = `
|
|
2703
2796
|
CREATE TABLE IF NOT EXISTS lt_a2a_api_keys (
|
|
2704
2797
|
id TEXT PRIMARY KEY,
|
|
2705
2798
|
key_value TEXT NOT NULL,
|
|
@@ -2718,7 +2811,7 @@ function generateApiKey() {
|
|
|
2718
2811
|
var LocalA2AApiKeyStore = class {
|
|
2719
2812
|
constructor(db) {
|
|
2720
2813
|
this.db = db;
|
|
2721
|
-
ensureTable(db,
|
|
2814
|
+
ensureTable(db, DDL16);
|
|
2722
2815
|
}
|
|
2723
2816
|
async findByKey(key) {
|
|
2724
2817
|
const rows = this.db.prepare(
|
|
@@ -2843,7 +2936,7 @@ function mapRowToRecord(row) {
|
|
|
2843
2936
|
|
|
2844
2937
|
// src/stores/LocalThreadMessageQueueStore.ts
|
|
2845
2938
|
var import_crypto4 = require("crypto");
|
|
2846
|
-
var
|
|
2939
|
+
var DDL17 = `
|
|
2847
2940
|
CREATE TABLE IF NOT EXISTS lt_thread_message_queue (
|
|
2848
2941
|
id TEXT PRIMARY KEY,
|
|
2849
2942
|
thread_id TEXT NOT NULL,
|
|
@@ -2866,7 +2959,7 @@ CREATE INDEX IF NOT EXISTS idx_lt_tmq_pending ON lt_thread_message_queue(status,
|
|
|
2866
2959
|
var LocalThreadMessageQueueStore = class {
|
|
2867
2960
|
constructor(db) {
|
|
2868
2961
|
this.db = db;
|
|
2869
|
-
ensureTable(db,
|
|
2962
|
+
ensureTable(db, DDL17);
|
|
2870
2963
|
}
|
|
2871
2964
|
async addMessage(params) {
|
|
2872
2965
|
const now = nowISO();
|
|
@@ -2985,7 +3078,7 @@ function rowToMessage(row) {
|
|
|
2985
3078
|
}
|
|
2986
3079
|
|
|
2987
3080
|
// src/stores/LocalSkillStore.ts
|
|
2988
|
-
var
|
|
3081
|
+
var DDL18 = `
|
|
2989
3082
|
CREATE TABLE IF NOT EXISTS lt_skills (
|
|
2990
3083
|
id TEXT NOT NULL,
|
|
2991
3084
|
tenant_id TEXT NOT NULL,
|
|
@@ -3004,7 +3097,7 @@ CREATE TABLE IF NOT EXISTS lt_skills (
|
|
|
3004
3097
|
var LocalSkillStore = class {
|
|
3005
3098
|
constructor(db) {
|
|
3006
3099
|
this.db = db;
|
|
3007
|
-
ensureTable(db,
|
|
3100
|
+
ensureTable(db, DDL18);
|
|
3008
3101
|
}
|
|
3009
3102
|
async getAllSkills(tenantId, _context) {
|
|
3010
3103
|
const rows = this.db.prepare(
|
|
@@ -3154,7 +3247,7 @@ function mapRowToSkill(row) {
|
|
|
3154
3247
|
}
|
|
3155
3248
|
|
|
3156
3249
|
// src/stores/LocalScheduleStorage.ts
|
|
3157
|
-
var
|
|
3250
|
+
var DDL19 = `
|
|
3158
3251
|
CREATE TABLE IF NOT EXISTS lt_scheduled_tasks (
|
|
3159
3252
|
task_id TEXT PRIMARY KEY,
|
|
3160
3253
|
task_type TEXT NOT NULL,
|
|
@@ -3187,7 +3280,7 @@ CREATE INDEX IF NOT EXISTS idx_lt_st_tenant ON lt_scheduled_tasks(tenant_id);
|
|
|
3187
3280
|
var LocalScheduleStorage = class {
|
|
3188
3281
|
constructor(db) {
|
|
3189
3282
|
this.db = db;
|
|
3190
|
-
ensureTable(db,
|
|
3283
|
+
ensureTable(db, DDL19);
|
|
3191
3284
|
}
|
|
3192
3285
|
async save(task) {
|
|
3193
3286
|
this.db.prepare(
|
|
@@ -3482,7 +3575,7 @@ function mapRowToTask(row) {
|
|
|
3482
3575
|
|
|
3483
3576
|
// src/stores/LocalTaskStore.ts
|
|
3484
3577
|
var import_crypto5 = require("crypto");
|
|
3485
|
-
var
|
|
3578
|
+
var DDL20 = `
|
|
3486
3579
|
CREATE TABLE IF NOT EXISTS lt_tasks (
|
|
3487
3580
|
id TEXT NOT NULL,
|
|
3488
3581
|
tenant_id TEXT NOT NULL,
|
|
@@ -3524,7 +3617,7 @@ function mapRowToTask2(row) {
|
|
|
3524
3617
|
var LocalTaskStore = class {
|
|
3525
3618
|
constructor(db) {
|
|
3526
3619
|
this.db = db;
|
|
3527
|
-
ensureTable(db,
|
|
3620
|
+
ensureTable(db, DDL20);
|
|
3528
3621
|
}
|
|
3529
3622
|
async create(params) {
|
|
3530
3623
|
const id = (0, import_crypto5.randomUUID)();
|
|
@@ -3679,6 +3772,7 @@ async function createLocalStoreConfig(options = {}) {
|
|
|
3679
3772
|
tenant: new LocalTenantStore(db),
|
|
3680
3773
|
userTenantLink: new LocalUserTenantLinkStore(db),
|
|
3681
3774
|
database: new LocalDatabaseConfigStore(db),
|
|
3775
|
+
connection: new LocalConnectionStore(db),
|
|
3682
3776
|
metrics: new LocalMetricsServerConfigStore(db),
|
|
3683
3777
|
mcp: new LocalMcpServerConfigStore(db),
|
|
3684
3778
|
workflowTracking: new LocalWorkflowTrackingStore(db),
|
|
@@ -3700,6 +3794,7 @@ async function createLocalStoreConfig(options = {}) {
|
|
|
3700
3794
|
LocalAssistantStore,
|
|
3701
3795
|
LocalChannelBindingStore,
|
|
3702
3796
|
LocalChannelInstallationStore,
|
|
3797
|
+
LocalConnectionStore,
|
|
3703
3798
|
LocalDatabaseConfigStore,
|
|
3704
3799
|
LocalEvalStore,
|
|
3705
3800
|
LocalMcpServerConfigStore,
|