@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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @axiom-lattice/local-stores@1.0.20 build /home/runner/work/agentic/agentic/packages/local-stores
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
  CLI Building entry: src/index.ts
@@ -8,13 +8,13 @@
8
8
  CLI Target: es2020
9
9
  CJS Build start
10
10
  ESM Build start
11
- CJS dist/index.js 123.02 KB
12
- CJS dist/index.js.map 230.10 KB
13
- CJS ⚡️ Build success in 282ms
14
- ESM dist/index.mjs 119.69 KB
15
- ESM dist/index.mjs.map 227.42 KB
16
- ESM ⚡️ Build success in 286ms
11
+ ESM dist/index.mjs 121.34 KB
12
+ ESM dist/index.mjs.map 230.45 KB
13
+ ESM ⚡️ Build success in 443ms
14
+ CJS dist/index.js 124.67 KB
15
+ CJS dist/index.js.map 233.13 KB
16
+ CJS ⚡️ Build success in 449ms
17
17
  DTS Build start
18
- DTS ⚡️ Build success in 15829ms
19
- DTS dist/index.d.ts 27.67 KB
20
- DTS dist/index.d.mts 27.67 KB
18
+ DTS ⚡️ Build success in 15081ms
19
+ DTS dist/index.d.ts 27.96 KB
20
+ DTS dist/index.d.mts 27.96 KB
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
  // -------------------------------------------------------------------------