@axiom-lattice/local-stores 1.0.20 → 1.0.22
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 +16 -0
- package/dist/index.d.mts +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +44 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +44 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/stores/LocalConnectionStore.ts +7 -0
- package/src/stores/LocalEvalStore.ts +8 -0
- package/src/stores/LocalWorkflowTrackingStore.ts +31 -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.22 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[32m121.34 KB[39m
|
|
12
|
+
[32mESM[39m [1mdist/index.mjs.map [22m[32m230.45 KB[39m
|
|
13
|
+
[32mESM[39m ⚡️ Build success in 443ms
|
|
14
|
+
[32mCJS[39m [1mdist/index.js [22m[32m124.67 KB[39m
|
|
15
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m233.13 KB[39m
|
|
16
|
+
[32mCJS[39m ⚡️ Build success in 449ms
|
|
17
17
|
[34mDTS[39m Build start
|
|
18
|
-
[32mDTS[39m ⚡️ Build success in
|
|
19
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[32m27.
|
|
20
|
-
[32mDTS[39m [1mdist/index.d.mts [22m[32m27.
|
|
18
|
+
[32mDTS[39m ⚡️ Build success in 15081ms
|
|
19
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m27.96 KB[39m
|
|
20
|
+
[32mDTS[39m [1mdist/index.d.mts [22m[32m27.96 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @axiom-lattice/local-stores
|
|
2
2
|
|
|
3
|
+
## 1.0.22
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [2feab5c]
|
|
8
|
+
- @axiom-lattice/core@2.1.100
|
|
9
|
+
|
|
10
|
+
## 1.0.21
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- 2d1c9f4: enhance core
|
|
15
|
+
- Updated dependencies [2d1c9f4]
|
|
16
|
+
- @axiom-lattice/core@2.1.99
|
|
17
|
+
- @axiom-lattice/protocols@2.1.51
|
|
18
|
+
|
|
3
19
|
## 1.0.20
|
|
4
20
|
|
|
5
21
|
### 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, 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';
|
|
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, QueryWorkflowRunsOptions, QueryWorkflowRunsResult, 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
|
/**
|
|
@@ -315,6 +315,7 @@ declare class LocalDatabaseConfigStore implements DatabaseConfigStore {
|
|
|
315
315
|
declare class LocalConnectionStore implements ConnectionStore {
|
|
316
316
|
private db;
|
|
317
317
|
constructor(db: DatabaseWrapper);
|
|
318
|
+
listByTenant(tenantId: string): Promise<ConnectionEntry[]>;
|
|
318
319
|
listByType(tenantId: string, type: string): Promise<ConnectionEntry[]>;
|
|
319
320
|
getByKey(tenantId: string, type: string, key: string): Promise<ConnectionEntry | null>;
|
|
320
321
|
create(entry: Omit<ConnectionEntry, "id" | "createdAt" | "updatedAt">): Promise<ConnectionEntry>;
|
|
@@ -371,6 +372,7 @@ declare class LocalWorkflowTrackingStore implements WorkflowTrackingStore {
|
|
|
371
372
|
getWorkflowRunsByThreadId(tenantId: string, threadId: string): Promise<WorkflowRun[]>;
|
|
372
373
|
getWorkflowRunsByAssistantId(tenantId: string, assistantId: string): Promise<WorkflowRun[]>;
|
|
373
374
|
getWorkflowRunsByTenantId(tenantId: string): Promise<WorkflowRun[]>;
|
|
375
|
+
queryWorkflowRuns(tenantId: string, options?: QueryWorkflowRunsOptions): Promise<QueryWorkflowRunsResult>;
|
|
374
376
|
createRunStep(request: CreateRunStepRequest): Promise<RunStep>;
|
|
375
377
|
upsertRunStep(request: CreateRunStepRequest): Promise<RunStep>;
|
|
376
378
|
updateRunStep(runId: string, stepId: string, updates: UpdateRunStepRequest): Promise<RunStep | null>;
|
|
@@ -421,6 +423,7 @@ declare class LocalEvalStore implements EvalStore {
|
|
|
421
423
|
private getRunResultById;
|
|
422
424
|
createRunResult(tenantId: string, runId: string, id: string, data: Omit<EvalRunResult, "id" | "runId" | "createdAt">): Promise<EvalRunResult>;
|
|
423
425
|
updateRunResult(tenantId: string, id: string, updates: Partial<EvalRunResult>): Promise<EvalRunResult | null>;
|
|
426
|
+
deleteRunResult(tenantId: string, id: string): Promise<boolean>;
|
|
424
427
|
getProjectReport(tenantId: string, projectId: string): Promise<EvalProjectReport | null>;
|
|
425
428
|
private mapRowToProject;
|
|
426
429
|
private mapRowToSuite;
|
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, 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';
|
|
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, QueryWorkflowRunsOptions, QueryWorkflowRunsResult, 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
|
/**
|
|
@@ -315,6 +315,7 @@ declare class LocalDatabaseConfigStore implements DatabaseConfigStore {
|
|
|
315
315
|
declare class LocalConnectionStore implements ConnectionStore {
|
|
316
316
|
private db;
|
|
317
317
|
constructor(db: DatabaseWrapper);
|
|
318
|
+
listByTenant(tenantId: string): Promise<ConnectionEntry[]>;
|
|
318
319
|
listByType(tenantId: string, type: string): Promise<ConnectionEntry[]>;
|
|
319
320
|
getByKey(tenantId: string, type: string, key: string): Promise<ConnectionEntry | null>;
|
|
320
321
|
create(entry: Omit<ConnectionEntry, "id" | "createdAt" | "updatedAt">): Promise<ConnectionEntry>;
|
|
@@ -371,6 +372,7 @@ declare class LocalWorkflowTrackingStore implements WorkflowTrackingStore {
|
|
|
371
372
|
getWorkflowRunsByThreadId(tenantId: string, threadId: string): Promise<WorkflowRun[]>;
|
|
372
373
|
getWorkflowRunsByAssistantId(tenantId: string, assistantId: string): Promise<WorkflowRun[]>;
|
|
373
374
|
getWorkflowRunsByTenantId(tenantId: string): Promise<WorkflowRun[]>;
|
|
375
|
+
queryWorkflowRuns(tenantId: string, options?: QueryWorkflowRunsOptions): Promise<QueryWorkflowRunsResult>;
|
|
374
376
|
createRunStep(request: CreateRunStepRequest): Promise<RunStep>;
|
|
375
377
|
upsertRunStep(request: CreateRunStepRequest): Promise<RunStep>;
|
|
376
378
|
updateRunStep(runId: string, stepId: string, updates: UpdateRunStepRequest): Promise<RunStep | null>;
|
|
@@ -421,6 +423,7 @@ declare class LocalEvalStore implements EvalStore {
|
|
|
421
423
|
private getRunResultById;
|
|
422
424
|
createRunResult(tenantId: string, runId: string, id: string, data: Omit<EvalRunResult, "id" | "runId" | "createdAt">): Promise<EvalRunResult>;
|
|
423
425
|
updateRunResult(tenantId: string, id: string, updates: Partial<EvalRunResult>): Promise<EvalRunResult | null>;
|
|
426
|
+
deleteRunResult(tenantId: string, id: string): Promise<boolean>;
|
|
424
427
|
getProjectReport(tenantId: string, projectId: string): Promise<EvalProjectReport | null>;
|
|
425
428
|
private mapRowToProject;
|
|
426
429
|
private mapRowToSuite;
|
package/dist/index.js
CHANGED
|
@@ -1222,6 +1222,12 @@ var LocalConnectionStore = class {
|
|
|
1222
1222
|
this.db = db;
|
|
1223
1223
|
ensureTable(db, DDL9);
|
|
1224
1224
|
}
|
|
1225
|
+
async listByTenant(tenantId) {
|
|
1226
|
+
const rows = this.db.prepare(
|
|
1227
|
+
`SELECT * FROM connection_configs WHERE tenant_id = ? ORDER BY created_at`
|
|
1228
|
+
).all(tenantId);
|
|
1229
|
+
return rows.map((r) => this.mapRow(r));
|
|
1230
|
+
}
|
|
1225
1231
|
async listByType(tenantId, type) {
|
|
1226
1232
|
const rows = this.db.prepare(
|
|
1227
1233
|
`SELECT * FROM connection_configs WHERE tenant_id = ? AND type = ? ORDER BY created_at`
|
|
@@ -1622,6 +1628,7 @@ CREATE TABLE IF NOT EXISTS lt_workflow_runs (
|
|
|
1622
1628
|
);
|
|
1623
1629
|
CREATE INDEX IF NOT EXISTS idx_lt_wr_thread ON lt_workflow_runs(tenant_id, thread_id);
|
|
1624
1630
|
CREATE INDEX IF NOT EXISTS idx_lt_wr_assistant ON lt_workflow_runs(tenant_id, assistant_id);
|
|
1631
|
+
CREATE INDEX IF NOT EXISTS idx_lt_wr_tenant_status ON lt_workflow_runs(tenant_id, status, updated_at DESC);
|
|
1625
1632
|
|
|
1626
1633
|
CREATE TABLE IF NOT EXISTS lt_workflow_steps (
|
|
1627
1634
|
id TEXT NOT NULL,
|
|
@@ -1747,6 +1754,36 @@ var LocalWorkflowTrackingStore = class {
|
|
|
1747
1754
|
).all(tenantId);
|
|
1748
1755
|
return rows.map(mapRowToRun);
|
|
1749
1756
|
}
|
|
1757
|
+
async queryWorkflowRuns(tenantId, options = {}) {
|
|
1758
|
+
const conditions = ["tenant_id = ?"];
|
|
1759
|
+
const whereParams = [tenantId];
|
|
1760
|
+
if (options.status) {
|
|
1761
|
+
conditions.push("status = ?");
|
|
1762
|
+
whereParams.push(options.status);
|
|
1763
|
+
}
|
|
1764
|
+
if (options.assistantId) {
|
|
1765
|
+
conditions.push("assistant_id = ?");
|
|
1766
|
+
whereParams.push(options.assistantId);
|
|
1767
|
+
}
|
|
1768
|
+
const where = conditions.join(" AND ");
|
|
1769
|
+
const countRow = this.db.prepare(
|
|
1770
|
+
`SELECT COUNT(*) AS count FROM lt_workflow_runs WHERE ${where}`
|
|
1771
|
+
).get(...whereParams);
|
|
1772
|
+
const selectParams = [...whereParams];
|
|
1773
|
+
let sql = `SELECT * FROM lt_workflow_runs WHERE ${where} ORDER BY updated_at DESC, id DESC`;
|
|
1774
|
+
if (options.limit !== void 0) {
|
|
1775
|
+
sql += " LIMIT ?";
|
|
1776
|
+
selectParams.push(options.limit);
|
|
1777
|
+
} else if (options.offset !== void 0) {
|
|
1778
|
+
sql += " LIMIT -1";
|
|
1779
|
+
}
|
|
1780
|
+
if (options.offset !== void 0) {
|
|
1781
|
+
sql += " OFFSET ?";
|
|
1782
|
+
selectParams.push(options.offset);
|
|
1783
|
+
}
|
|
1784
|
+
const rows = this.db.prepare(sql).all(...selectParams);
|
|
1785
|
+
return { records: rows.map(mapRowToRun), total: countRow.count };
|
|
1786
|
+
}
|
|
1750
1787
|
async createRunStep(request) {
|
|
1751
1788
|
const now = nowISO();
|
|
1752
1789
|
const id = `step_${Date.now()}_${Math.random().toString(36).slice(2, 8)}`;
|
|
@@ -2382,6 +2419,13 @@ var LocalEvalStore = class {
|
|
|
2382
2419
|
).run(...vals);
|
|
2383
2420
|
return this.getRunResultById(tenantId, id);
|
|
2384
2421
|
}
|
|
2422
|
+
async deleteRunResult(tenantId, id) {
|
|
2423
|
+
const result = this.db.prepare(
|
|
2424
|
+
`DELETE FROM lt_eval_run_results
|
|
2425
|
+
WHERE id = ? AND run_id IN (SELECT id FROM lt_eval_runs WHERE tenant_id = ?)`
|
|
2426
|
+
).run(id, tenantId);
|
|
2427
|
+
return result.changes > 0;
|
|
2428
|
+
}
|
|
2385
2429
|
// -------------------------------------------------------------------------
|
|
2386
2430
|
// Reports
|
|
2387
2431
|
// -------------------------------------------------------------------------
|