@axiom-lattice/local-stores 3.1.8 → 3.1.10

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@3.1.8 build /home/runner/work/agentic/agentic/packages/local-stores
2
+ > @axiom-lattice/local-stores@3.1.10 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 221.77 KB
12
- CJS dist/index.js.map 401.85 KB
13
- CJS ⚡️ Build success in 495ms
14
- ESM dist/index.mjs 217.29 KB
15
- ESM dist/index.mjs.map 398.23 KB
16
- ESM ⚡️ Build success in 511ms
11
+ ESM dist/index.mjs 221.93 KB
12
+ ESM dist/index.mjs.map 407.36 KB
13
+ ESM ⚡️ Build success in 364ms
14
+ CJS dist/index.js 226.46 KB
15
+ CJS dist/index.js.map 411.03 KB
16
+ CJS ⚡️ Build success in 382ms
17
17
  DTS Build start
18
- DTS ⚡️ Build success in 17712ms
19
- DTS dist/index.d.ts 40.88 KB
20
- DTS dist/index.d.mts 40.88 KB
18
+ DTS ⚡️ Build success in 14061ms
19
+ DTS dist/index.d.ts 41.48 KB
20
+ DTS dist/index.d.mts 41.48 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @axiom-lattice/local-stores
2
2
 
3
+ ## 3.1.10
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [156032a]
8
+ - @axiom-lattice/core@4.2.10
9
+
10
+ ## 3.1.9
11
+
12
+ ### Patch Changes
13
+
14
+ - 20ec3c1: add webapp, mcps
15
+ - Updated dependencies [20ec3c1]
16
+ - @axiom-lattice/core@4.2.9
17
+ - @axiom-lattice/protocols@4.2.1
18
+
3
19
  ## 3.1.8
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, ProjectFilter, Project, CreateProjectRequest, UpdateProjectRequest, UpdateProjectCapabilityBundlesResult, ProjectRoomStore, ProjectRoom, ProjectMembershipStore, ProjectMembership, ProjectHumanRole, ProjectMembershipMutationResult, ProjectBotMembershipStore, ProjectBotMembership, ProjectRoomMessageStore, ProjectRoomMessage, ProjectRoomReadStateStore, ProjectRoomReadState, 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, BindingMutablePatch, BindingListParams, ChannelInstallationStore, ChannelInstallation, ChannelInstallationType, CreateChannelInstallationInput, UpdateChannelInstallationRequest, A2AApiKeyStore, A2AApiKeyRecord, CreateA2AApiKeyInput, A2AApiKeyEntry, SkillStore, SkillStoreContext, Skill, CreateSkillRequest, ScheduleStorage, ScheduledTaskDefinition, ScheduledTaskStatus, ScheduleExecutionType, TaskStore, CreateTaskRequest, TaskItem, TaskListFilter, TaskDependentListQuery, UpdateTaskRequest, TaskMutationSnapshot, TaskWorkItemStore, CreateWorkItemRequest, TaskWorkItem, CreateWorkItemIfAbsentRequest, TaskWorkItemListFilter, ProjectLifecycleEventQuery, CapabilityBundleStore, CapabilityBundle, InternalCreateCapabilityBundleInput, InternalUpdateCapabilityBundleInput, CapabilityBundleDeleteResult, IConversationStore, ConversationRecord, CreateConversationInput } from '@axiom-lattice/protocols';
3
+ import { ThreadStore, Thread, CreateThreadRequest, AssistantStore, Assistant, CreateAssistantRequest, WorkspaceStore, Workspace, CreateWorkspaceRequest, UpdateWorkspaceRequest, ProjectStore, ProjectFilter, Project, CreateProjectRequest, UpdateProjectRequest, UpdateProjectCapabilityBundlesResult, ProjectRoomStore, ProjectRoom, ProjectMembershipStore, ProjectMembership, ProjectHumanRole, ProjectMembershipMutationResult, ProjectBotMembershipStore, ProjectBotMembership, ProjectRoomMessageStore, ProjectRoomMessage, ProjectRoomReadStateStore, ProjectRoomReadState, 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, BindingMutablePatch, BindingListParams, ChannelInstallationStore, ChannelInstallation, ChannelInstallationType, CreateChannelInstallationInput, UpdateChannelInstallationRequest, A2AApiKeyStore, A2AApiKeyRecord, CreateA2AApiKeyInput, UpdateA2AApiKeyInput, A2AApiKeyEntry, OpenAuditStore, OpenAuditQuery, OpenAuditRecord, OpenAuditAppendInput, SkillStore, SkillStoreContext, Skill, CreateSkillRequest, ScheduleStorage, ScheduledTaskDefinition, ScheduledTaskStatus, ScheduleExecutionType, TaskStore, CreateTaskRequest, TaskItem, TaskListFilter, TaskDependentListQuery, UpdateTaskRequest, TaskMutationSnapshot, TaskWorkItemStore, CreateWorkItemRequest, TaskWorkItem, CreateWorkItemIfAbsentRequest, TaskWorkItemListFilter, ProjectLifecycleEventQuery, CapabilityBundleStore, CapabilityBundle, InternalCreateCapabilityBundleInput, InternalUpdateCapabilityBundleInput, CapabilityBundleDeleteResult, IConversationStore, ConversationRecord, CreateConversationInput } from '@axiom-lattice/protocols';
4
4
  import { IMessageQueueStore, AddMessageParams, PendingMessage, QueueScope, ThreadInfo } from '@axiom-lattice/core';
5
5
 
6
6
  /**
@@ -643,11 +643,24 @@ declare class LocalA2AApiKeyStore implements A2AApiKeyStore {
643
643
  create(input: CreateA2AApiKeyInput): Promise<A2AApiKeyRecord>;
644
644
  disable(id: string): Promise<A2AApiKeyRecord>;
645
645
  enable(id: string): Promise<A2AApiKeyRecord>;
646
+ update(id: string, input: UpdateA2AApiKeyInput): Promise<A2AApiKeyRecord>;
646
647
  rotate(id: string): Promise<A2AApiKeyRecord>;
647
648
  delete(id: string): Promise<void>;
648
649
  loadIntoMap(): Promise<Map<string, A2AApiKeyEntry>>;
649
650
  }
650
651
 
652
+ /**
653
+ * Local SQLite implementation of the Open audit store (append-only).
654
+ */
655
+
656
+ /** SQLite-backed append-only audit store for the Open API surface. */
657
+ declare class LocalOpenAuditStore implements OpenAuditStore {
658
+ private db;
659
+ constructor(db: DatabaseWrapper);
660
+ query(params: OpenAuditQuery): Promise<OpenAuditRecord[]>;
661
+ append(record: OpenAuditAppendInput): Promise<void>;
662
+ }
663
+
651
664
  /**
652
665
  * Local SQLite implementation of IMessageQueueStore.
653
666
  */
@@ -885,6 +898,7 @@ declare function createLocalStoreConfig(options?: LocalStoreConfigOptions): Prom
885
898
  channelBinding: LocalChannelBindingStore;
886
899
  channelInstallation: LocalChannelInstallationStore;
887
900
  a2aApiKey: LocalA2AApiKeyStore;
901
+ openAudit: LocalOpenAuditStore;
888
902
  threadMessageQueue: LocalThreadMessageQueueStore;
889
903
  skill: LocalSkillStore;
890
904
  schedule: LocalScheduleStorage;
@@ -910,4 +924,4 @@ declare class InMemoryConversationStore implements IConversationStore {
910
924
  deleteConversation(conversationId: string): Promise<void>;
911
925
  }
912
926
 
913
- export { DatabaseWrapper, DuplicateProjectMembershipError, DuplicateProjectRoomMessageIdempotencyKeyError, InMemoryConversationStore, LocalA2AApiKeyStore, LocalAssistantStore, LocalCapabilityBundleStore, LocalChannelBindingStore, LocalChannelInstallationStore, LocalConnectionStore, LocalDatabaseConfigStore, LocalEvalStore, LocalMcpServerConfigStore, LocalMetricsServerConfigStore, LocalProjectBotMembershipStore, LocalProjectMembershipStore, LocalProjectRoomMessageStore, LocalProjectRoomReadStateStore, LocalProjectRoomStore, LocalProjectStore, LocalScheduleStorage, LocalSkillStore, type LocalStoreConfigOptions, type LocalStoreOptions, LocalTaskStore, LocalTaskWorkItemStore, LocalTenantStore, LocalThreadMessageQueueStore, LocalThreadStore, LocalUserStore, LocalUserTenantLinkStore, LocalWorkflowTrackingStore, LocalWorkspaceStore, type Migration, MigrationManager, ProjectBotMembershipIdConflictError, ProjectMembershipIdConflictError, ProjectRoomMessageIdConflictError, RunResult, StatementWrapper, closeDatabase, createLocalStoreConfig, ensureTable, getDatabase, initDatabase, nowISO, parseISO };
927
+ export { DatabaseWrapper, DuplicateProjectMembershipError, DuplicateProjectRoomMessageIdempotencyKeyError, InMemoryConversationStore, LocalA2AApiKeyStore, LocalAssistantStore, LocalCapabilityBundleStore, LocalChannelBindingStore, LocalChannelInstallationStore, LocalConnectionStore, LocalDatabaseConfigStore, LocalEvalStore, LocalMcpServerConfigStore, LocalMetricsServerConfigStore, LocalOpenAuditStore, LocalProjectBotMembershipStore, LocalProjectMembershipStore, LocalProjectRoomMessageStore, LocalProjectRoomReadStateStore, LocalProjectRoomStore, LocalProjectStore, LocalScheduleStorage, LocalSkillStore, type LocalStoreConfigOptions, type LocalStoreOptions, LocalTaskStore, LocalTaskWorkItemStore, LocalTenantStore, LocalThreadMessageQueueStore, LocalThreadStore, LocalUserStore, LocalUserTenantLinkStore, LocalWorkflowTrackingStore, LocalWorkspaceStore, type Migration, MigrationManager, ProjectBotMembershipIdConflictError, ProjectMembershipIdConflictError, ProjectRoomMessageIdConflictError, 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, ProjectFilter, Project, CreateProjectRequest, UpdateProjectRequest, UpdateProjectCapabilityBundlesResult, ProjectRoomStore, ProjectRoom, ProjectMembershipStore, ProjectMembership, ProjectHumanRole, ProjectMembershipMutationResult, ProjectBotMembershipStore, ProjectBotMembership, ProjectRoomMessageStore, ProjectRoomMessage, ProjectRoomReadStateStore, ProjectRoomReadState, 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, BindingMutablePatch, BindingListParams, ChannelInstallationStore, ChannelInstallation, ChannelInstallationType, CreateChannelInstallationInput, UpdateChannelInstallationRequest, A2AApiKeyStore, A2AApiKeyRecord, CreateA2AApiKeyInput, A2AApiKeyEntry, SkillStore, SkillStoreContext, Skill, CreateSkillRequest, ScheduleStorage, ScheduledTaskDefinition, ScheduledTaskStatus, ScheduleExecutionType, TaskStore, CreateTaskRequest, TaskItem, TaskListFilter, TaskDependentListQuery, UpdateTaskRequest, TaskMutationSnapshot, TaskWorkItemStore, CreateWorkItemRequest, TaskWorkItem, CreateWorkItemIfAbsentRequest, TaskWorkItemListFilter, ProjectLifecycleEventQuery, CapabilityBundleStore, CapabilityBundle, InternalCreateCapabilityBundleInput, InternalUpdateCapabilityBundleInput, CapabilityBundleDeleteResult, IConversationStore, ConversationRecord, CreateConversationInput } from '@axiom-lattice/protocols';
3
+ import { ThreadStore, Thread, CreateThreadRequest, AssistantStore, Assistant, CreateAssistantRequest, WorkspaceStore, Workspace, CreateWorkspaceRequest, UpdateWorkspaceRequest, ProjectStore, ProjectFilter, Project, CreateProjectRequest, UpdateProjectRequest, UpdateProjectCapabilityBundlesResult, ProjectRoomStore, ProjectRoom, ProjectMembershipStore, ProjectMembership, ProjectHumanRole, ProjectMembershipMutationResult, ProjectBotMembershipStore, ProjectBotMembership, ProjectRoomMessageStore, ProjectRoomMessage, ProjectRoomReadStateStore, ProjectRoomReadState, 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, BindingMutablePatch, BindingListParams, ChannelInstallationStore, ChannelInstallation, ChannelInstallationType, CreateChannelInstallationInput, UpdateChannelInstallationRequest, A2AApiKeyStore, A2AApiKeyRecord, CreateA2AApiKeyInput, UpdateA2AApiKeyInput, A2AApiKeyEntry, OpenAuditStore, OpenAuditQuery, OpenAuditRecord, OpenAuditAppendInput, SkillStore, SkillStoreContext, Skill, CreateSkillRequest, ScheduleStorage, ScheduledTaskDefinition, ScheduledTaskStatus, ScheduleExecutionType, TaskStore, CreateTaskRequest, TaskItem, TaskListFilter, TaskDependentListQuery, UpdateTaskRequest, TaskMutationSnapshot, TaskWorkItemStore, CreateWorkItemRequest, TaskWorkItem, CreateWorkItemIfAbsentRequest, TaskWorkItemListFilter, ProjectLifecycleEventQuery, CapabilityBundleStore, CapabilityBundle, InternalCreateCapabilityBundleInput, InternalUpdateCapabilityBundleInput, CapabilityBundleDeleteResult, IConversationStore, ConversationRecord, CreateConversationInput } from '@axiom-lattice/protocols';
4
4
  import { IMessageQueueStore, AddMessageParams, PendingMessage, QueueScope, ThreadInfo } from '@axiom-lattice/core';
5
5
 
6
6
  /**
@@ -643,11 +643,24 @@ declare class LocalA2AApiKeyStore implements A2AApiKeyStore {
643
643
  create(input: CreateA2AApiKeyInput): Promise<A2AApiKeyRecord>;
644
644
  disable(id: string): Promise<A2AApiKeyRecord>;
645
645
  enable(id: string): Promise<A2AApiKeyRecord>;
646
+ update(id: string, input: UpdateA2AApiKeyInput): Promise<A2AApiKeyRecord>;
646
647
  rotate(id: string): Promise<A2AApiKeyRecord>;
647
648
  delete(id: string): Promise<void>;
648
649
  loadIntoMap(): Promise<Map<string, A2AApiKeyEntry>>;
649
650
  }
650
651
 
652
+ /**
653
+ * Local SQLite implementation of the Open audit store (append-only).
654
+ */
655
+
656
+ /** SQLite-backed append-only audit store for the Open API surface. */
657
+ declare class LocalOpenAuditStore implements OpenAuditStore {
658
+ private db;
659
+ constructor(db: DatabaseWrapper);
660
+ query(params: OpenAuditQuery): Promise<OpenAuditRecord[]>;
661
+ append(record: OpenAuditAppendInput): Promise<void>;
662
+ }
663
+
651
664
  /**
652
665
  * Local SQLite implementation of IMessageQueueStore.
653
666
  */
@@ -885,6 +898,7 @@ declare function createLocalStoreConfig(options?: LocalStoreConfigOptions): Prom
885
898
  channelBinding: LocalChannelBindingStore;
886
899
  channelInstallation: LocalChannelInstallationStore;
887
900
  a2aApiKey: LocalA2AApiKeyStore;
901
+ openAudit: LocalOpenAuditStore;
888
902
  threadMessageQueue: LocalThreadMessageQueueStore;
889
903
  skill: LocalSkillStore;
890
904
  schedule: LocalScheduleStorage;
@@ -910,4 +924,4 @@ declare class InMemoryConversationStore implements IConversationStore {
910
924
  deleteConversation(conversationId: string): Promise<void>;
911
925
  }
912
926
 
913
- export { DatabaseWrapper, DuplicateProjectMembershipError, DuplicateProjectRoomMessageIdempotencyKeyError, InMemoryConversationStore, LocalA2AApiKeyStore, LocalAssistantStore, LocalCapabilityBundleStore, LocalChannelBindingStore, LocalChannelInstallationStore, LocalConnectionStore, LocalDatabaseConfigStore, LocalEvalStore, LocalMcpServerConfigStore, LocalMetricsServerConfigStore, LocalProjectBotMembershipStore, LocalProjectMembershipStore, LocalProjectRoomMessageStore, LocalProjectRoomReadStateStore, LocalProjectRoomStore, LocalProjectStore, LocalScheduleStorage, LocalSkillStore, type LocalStoreConfigOptions, type LocalStoreOptions, LocalTaskStore, LocalTaskWorkItemStore, LocalTenantStore, LocalThreadMessageQueueStore, LocalThreadStore, LocalUserStore, LocalUserTenantLinkStore, LocalWorkflowTrackingStore, LocalWorkspaceStore, type Migration, MigrationManager, ProjectBotMembershipIdConflictError, ProjectMembershipIdConflictError, ProjectRoomMessageIdConflictError, RunResult, StatementWrapper, closeDatabase, createLocalStoreConfig, ensureTable, getDatabase, initDatabase, nowISO, parseISO };
927
+ export { DatabaseWrapper, DuplicateProjectMembershipError, DuplicateProjectRoomMessageIdempotencyKeyError, InMemoryConversationStore, LocalA2AApiKeyStore, LocalAssistantStore, LocalCapabilityBundleStore, LocalChannelBindingStore, LocalChannelInstallationStore, LocalConnectionStore, LocalDatabaseConfigStore, LocalEvalStore, LocalMcpServerConfigStore, LocalMetricsServerConfigStore, LocalOpenAuditStore, LocalProjectBotMembershipStore, LocalProjectMembershipStore, LocalProjectRoomMessageStore, LocalProjectRoomReadStateStore, LocalProjectRoomStore, LocalProjectStore, LocalScheduleStorage, LocalSkillStore, type LocalStoreConfigOptions, type LocalStoreOptions, LocalTaskStore, LocalTaskWorkItemStore, LocalTenantStore, LocalThreadMessageQueueStore, LocalThreadStore, LocalUserStore, LocalUserTenantLinkStore, LocalWorkflowTrackingStore, LocalWorkspaceStore, type Migration, MigrationManager, ProjectBotMembershipIdConflictError, ProjectMembershipIdConflictError, ProjectRoomMessageIdConflictError, RunResult, StatementWrapper, closeDatabase, createLocalStoreConfig, ensureTable, getDatabase, initDatabase, nowISO, parseISO };
package/dist/index.js CHANGED
@@ -44,6 +44,7 @@ __export(index_exports, {
44
44
  LocalEvalStore: () => LocalEvalStore,
45
45
  LocalMcpServerConfigStore: () => LocalMcpServerConfigStore,
46
46
  LocalMetricsServerConfigStore: () => LocalMetricsServerConfigStore,
47
+ LocalOpenAuditStore: () => LocalOpenAuditStore,
47
48
  LocalProjectBotMembershipStore: () => LocalProjectBotMembershipStore,
48
49
  LocalProjectMembershipStore: () => LocalProjectMembershipStore,
49
50
  LocalProjectRoomMessageStore: () => LocalProjectRoomMessageStore,
@@ -1460,6 +1461,22 @@ function mapRow4(row) {
1460
1461
  createdAt
1461
1462
  };
1462
1463
  }
1464
+ function mapRowsTolerant(rows2, scope) {
1465
+ const messages = [];
1466
+ for (const row of rows2) {
1467
+ try {
1468
+ messages.push(mapRow4(row));
1469
+ } catch (error) {
1470
+ console.warn("[ProjectRoomMessageStore] Skipping invalid message row", {
1471
+ tenantId: scope.tenantId,
1472
+ roomId: scope.roomId,
1473
+ rowId: typeof row.id === "string" ? row.id : void 0,
1474
+ reason: error instanceof Error ? error.message : String(error)
1475
+ });
1476
+ }
1477
+ }
1478
+ return messages;
1479
+ }
1463
1480
  var LocalProjectRoomMessageStore = class {
1464
1481
  constructor(db) {
1465
1482
  this.db = db;
@@ -1475,7 +1492,7 @@ var LocalProjectRoomMessageStore = class {
1475
1492
  if (input.before && !validDate(input.before.createdAt)) throw new RangeError("Project room message cursor date is invalid");
1476
1493
  const limit = Math.min(100, Math.max(1, Math.trunc(Number.isFinite(input.limit) ? input.limit : 1)));
1477
1494
  const rows2 = input.before ? this.db.prepare(`SELECT ${columns4} FROM lt_project_room_messages WHERE tenant_id = ? AND room_id = ? AND (created_at < ? OR (created_at = ? AND id < ?)) ORDER BY created_at DESC, id DESC LIMIT ?`).all(input.tenantId, input.roomId, input.before.createdAt.toISOString(), input.before.createdAt.toISOString(), input.before.id, limit) : this.db.prepare(`SELECT ${columns4} FROM lt_project_room_messages WHERE tenant_id = ? AND room_id = ? ORDER BY created_at DESC, id DESC LIMIT ?`).all(input.tenantId, input.roomId, limit);
1478
- return rows2.map(mapRow4);
1495
+ return mapRowsTolerant(rows2, { tenantId: input.tenantId, roomId: input.roomId });
1479
1496
  }
1480
1497
  async findById(tenantId, id) {
1481
1498
  const row = this.byId(tenantId, id);
@@ -3875,6 +3892,7 @@ CREATE TABLE IF NOT EXISTS lt_a2a_api_keys (
3875
3892
  tenant_id TEXT NOT NULL,
3876
3893
  project_id TEXT,
3877
3894
  assistant_ids TEXT,
3895
+ grants TEXT,
3878
3896
  label TEXT,
3879
3897
  enabled INTEGER NOT NULL DEFAULT 1,
3880
3898
  created_at TEXT NOT NULL,
@@ -3884,6 +3902,15 @@ CREATE TABLE IF NOT EXISTS lt_a2a_api_keys (
3884
3902
  function generateApiKey() {
3885
3903
  return `a2a_${(0, import_crypto3.randomUUID)().replace(/-/g, "")}`;
3886
3904
  }
3905
+ function parseGrants(raw) {
3906
+ if (!raw) return void 0;
3907
+ try {
3908
+ const parsed = JSON.parse(raw);
3909
+ return Array.isArray(parsed) ? parsed : void 0;
3910
+ } catch {
3911
+ return void 0;
3912
+ }
3913
+ }
3887
3914
  function parseAssistantIds(raw) {
3888
3915
  if (!raw) return void 0;
3889
3916
  try {
@@ -3898,6 +3925,7 @@ var LocalA2AApiKeyStore = class {
3898
3925
  this.db = db;
3899
3926
  ensureTable(db, DDL16);
3900
3927
  this.ensureColumn("lt_a2a_api_keys", "assistant_ids", "assistant_ids TEXT");
3928
+ this.ensureColumn("lt_a2a_api_keys", "grants", "grants TEXT");
3901
3929
  this.repairManagementIds();
3902
3930
  }
3903
3931
  /** Add a column if it does not exist (SQLite version compatible). */
@@ -3958,9 +3986,9 @@ var LocalA2AApiKeyStore = class {
3958
3986
  const key = generateApiKey();
3959
3987
  const now = nowISO();
3960
3988
  this.db.prepare(
3961
- `INSERT INTO lt_a2a_api_keys (id, key_value, tenant_id, project_id, assistant_ids, label, created_at, updated_at)
3962
- VALUES (?, ?, ?, ?, ?, ?, ?, ?)`
3963
- ).run(id, (0, import_core3.encrypt)(key), input.tenantId, input.projectId, input.assistantIds ? JSON.stringify(input.assistantIds) : null, input.label || null, now, now);
3989
+ `INSERT INTO lt_a2a_api_keys (id, key_value, tenant_id, project_id, assistant_ids, grants, label, created_at, updated_at)
3990
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)`
3991
+ ).run(id, (0, import_core3.encrypt)(key), input.tenantId, input.projectId, input.assistantIds ? JSON.stringify(input.assistantIds) : null, input.grants ? JSON.stringify(input.grants) : null, input.label || null, now, now);
3964
3992
  const record2 = {
3965
3993
  id,
3966
3994
  key,
@@ -3992,6 +4020,38 @@ var LocalA2AApiKeyStore = class {
3992
4020
  if (!row) throw new Error(`A2A API key not found: ${id}`);
3993
4021
  return mapRowToRecord(row);
3994
4022
  }
4023
+ async update(id, input) {
4024
+ const sets = [];
4025
+ const values = [];
4026
+ if (input.label !== void 0) {
4027
+ sets.push("label = ?");
4028
+ values.push(input.label || null);
4029
+ }
4030
+ if (input.projectId !== void 0) {
4031
+ sets.push("project_id = ?");
4032
+ values.push(input.projectId);
4033
+ }
4034
+ if (input.assistantIds !== void 0) {
4035
+ sets.push("assistant_ids = ?");
4036
+ values.push(input.assistantIds ? JSON.stringify(input.assistantIds) : null);
4037
+ }
4038
+ if (input.grants !== void 0) {
4039
+ sets.push("grants = ?");
4040
+ values.push(input.grants ? JSON.stringify(input.grants) : null);
4041
+ }
4042
+ if (sets.length === 0) {
4043
+ const row2 = this.db.prepare("SELECT * FROM lt_a2a_api_keys WHERE id = ?").get(id);
4044
+ if (!row2) throw new Error(`A2A API key not found: ${id}`);
4045
+ return mapRowToRecord(row2);
4046
+ }
4047
+ sets.push("updated_at = ?");
4048
+ values.push(nowISO());
4049
+ values.push(id);
4050
+ this.db.prepare(`UPDATE lt_a2a_api_keys SET ${sets.join(", ")} WHERE id = ?`).run(...values);
4051
+ const row = this.db.prepare("SELECT * FROM lt_a2a_api_keys WHERE id = ?").get(id);
4052
+ if (!row) throw new Error(`A2A API key not found: ${id}`);
4053
+ return mapRowToRecord(row);
4054
+ }
3995
4055
  async rotate(id) {
3996
4056
  const key = generateApiKey();
3997
4057
  const now = nowISO();
@@ -4040,6 +4100,7 @@ function mapRowToRecord(row) {
4040
4100
  tenantId: row.tenant_id,
4041
4101
  projectId: row.project_id,
4042
4102
  assistantIds: parseAssistantIds(row.assistant_ids),
4103
+ grants: parseGrants(row.grants),
4043
4104
  label: row.label || void 0,
4044
4105
  enabled: row.enabled === 1,
4045
4106
  createdAt: parseISO(row.created_at),
@@ -4047,10 +4108,100 @@ function mapRowToRecord(row) {
4047
4108
  };
4048
4109
  }
4049
4110
 
4050
- // src/stores/LocalThreadMessageQueueStore.ts
4051
- var import_protocols4 = require("@axiom-lattice/protocols");
4111
+ // src/stores/LocalOpenAuditStore.ts
4052
4112
  var import_crypto4 = require("crypto");
4053
4113
  var DDL17 = `
4114
+ CREATE TABLE IF NOT EXISTS lt_open_audit (
4115
+ id TEXT PRIMARY KEY,
4116
+ tenant_id TEXT NOT NULL,
4117
+ credential_id TEXT NOT NULL,
4118
+ credential_kind TEXT NOT NULL,
4119
+ project_id TEXT NOT NULL,
4120
+ domain TEXT NOT NULL,
4121
+ action TEXT NOT NULL,
4122
+ args TEXT,
4123
+ status TEXT NOT NULL,
4124
+ error_code TEXT,
4125
+ duration_ms INTEGER NOT NULL,
4126
+ created_at TEXT NOT NULL
4127
+ );
4128
+ `;
4129
+ var LocalOpenAuditStore = class {
4130
+ constructor(db) {
4131
+ this.db = db;
4132
+ ensureTable(db, DDL17);
4133
+ }
4134
+ async query(params) {
4135
+ const clauses = ["tenant_id = ?"];
4136
+ const values = [params.tenantId];
4137
+ if (params.credentialId) {
4138
+ clauses.push("credential_id = ?");
4139
+ values.push(params.credentialId);
4140
+ }
4141
+ if (params.domain) {
4142
+ clauses.push("domain = ?");
4143
+ values.push(params.domain);
4144
+ }
4145
+ if (params.status) {
4146
+ clauses.push("status = ?");
4147
+ values.push(params.status);
4148
+ }
4149
+ if (params.from) {
4150
+ clauses.push("created_at >= ?");
4151
+ values.push(params.from);
4152
+ }
4153
+ if (params.to) {
4154
+ clauses.push("created_at < ?");
4155
+ values.push(params.to);
4156
+ }
4157
+ const limit = params.limit ?? 100;
4158
+ const offset = params.offset ?? 0;
4159
+ values.push(limit, offset);
4160
+ const rows2 = this.db.prepare(
4161
+ `SELECT * FROM lt_open_audit WHERE ${clauses.join(" AND ")}
4162
+ ORDER BY created_at DESC LIMIT ? OFFSET ?`
4163
+ ).all(...values);
4164
+ return rows2.map((row) => ({
4165
+ id: row.id,
4166
+ tenantId: row.tenant_id,
4167
+ credentialId: row.credential_id,
4168
+ credentialKind: row.credential_kind,
4169
+ projectId: row.project_id,
4170
+ domain: row.domain,
4171
+ action: row.action,
4172
+ args: row.args ? JSON.parse(row.args) : void 0,
4173
+ status: row.status,
4174
+ errorCode: row.error_code ?? void 0,
4175
+ durationMs: row.duration_ms,
4176
+ createdAt: parseISO(row.created_at)
4177
+ }));
4178
+ }
4179
+ async append(record2) {
4180
+ this.db.prepare(
4181
+ `INSERT INTO lt_open_audit
4182
+ (id, tenant_id, credential_id, credential_kind, project_id, domain, action, args, status, error_code, duration_ms, created_at)
4183
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`
4184
+ ).run(
4185
+ (0, import_crypto4.randomUUID)(),
4186
+ record2.tenantId,
4187
+ record2.credentialId,
4188
+ record2.credentialKind,
4189
+ record2.projectId,
4190
+ record2.domain,
4191
+ record2.action,
4192
+ record2.args === void 0 ? null : JSON.stringify(record2.args),
4193
+ record2.status,
4194
+ record2.errorCode ?? null,
4195
+ Math.max(0, Math.round(record2.durationMs)),
4196
+ nowISO()
4197
+ );
4198
+ }
4199
+ };
4200
+
4201
+ // src/stores/LocalThreadMessageQueueStore.ts
4202
+ var import_protocols4 = require("@axiom-lattice/protocols");
4203
+ var import_crypto5 = require("crypto");
4204
+ var DDL18 = `
4054
4205
  CREATE TABLE IF NOT EXISTS lt_thread_message_queue (
4055
4206
  id TEXT PRIMARY KEY,
4056
4207
  thread_id TEXT NOT NULL,
@@ -4076,7 +4227,7 @@ var LocalThreadMessageQueueStore = class {
4076
4227
  constructor(db) {
4077
4228
  this.capacityTail = Promise.resolve();
4078
4229
  this.db = db;
4079
- ensureTable(db, DDL17);
4230
+ ensureTable(db, DDL18);
4080
4231
  const columns6 = db.prepare("PRAGMA table_info(lt_thread_message_queue)").all();
4081
4232
  const names = new Set(columns6.map(({ name }) => name));
4082
4233
  if (!names.has("trusted_run_context")) {
@@ -4089,7 +4240,7 @@ var LocalThreadMessageQueueStore = class {
4089
4240
  async addMessage(params) {
4090
4241
  const trusted = validateQueueTrust(params);
4091
4242
  const now = nowISO();
4092
- const id = params.id || (0, import_crypto4.randomUUID)();
4243
+ const id = params.id || (0, import_crypto5.randomUUID)();
4093
4244
  const seqRow = this.db.prepare(
4094
4245
  `SELECT COALESCE(MAX(sequence_order), 0) + 1 as next_seq FROM lt_thread_message_queue WHERE thread_id = ?`
4095
4246
  ).get(params.threadId);
@@ -4132,7 +4283,7 @@ var LocalThreadMessageQueueStore = class {
4132
4283
  projectId: params.projectId
4133
4284
  };
4134
4285
  const filter = scopeClause(scope);
4135
- const id = params.id || (0, import_crypto4.randomUUID)();
4286
+ const id = params.id || (0, import_crypto5.randomUUID)();
4136
4287
  const limit = maxSize === Infinity ? -1 : maxSize;
4137
4288
  const result = this.db.prepare(
4138
4289
  `INSERT INTO lt_thread_message_queue (id, thread_id, tenant_id, assistant_id, workspace_id, project_id, message_content, message_type, sequence_order, priority, command, custom_run_config, trusted_run_context, execution_mode, created_at)
@@ -4170,7 +4321,7 @@ var LocalThreadMessageQueueStore = class {
4170
4321
  async addMessageAtHead(params) {
4171
4322
  const trusted = validateQueueTrust(params);
4172
4323
  const now = nowISO();
4173
- const id = params.id || (0, import_crypto4.randomUUID)();
4324
+ const id = params.id || (0, import_crypto5.randomUUID)();
4174
4325
  const seqRow = this.db.prepare(
4175
4326
  `SELECT COALESCE(MAX(sequence_order), 0) + 1 as next_seq FROM lt_thread_message_queue WHERE thread_id = ?`
4176
4327
  ).get(params.threadId);
@@ -4289,7 +4440,7 @@ function rowToMessage(row) {
4289
4440
  }
4290
4441
 
4291
4442
  // src/stores/LocalSkillStore.ts
4292
- var DDL18 = `
4443
+ var DDL19 = `
4293
4444
  CREATE TABLE IF NOT EXISTS lt_skills (
4294
4445
  id TEXT NOT NULL,
4295
4446
  tenant_id TEXT NOT NULL,
@@ -4308,7 +4459,7 @@ CREATE TABLE IF NOT EXISTS lt_skills (
4308
4459
  var LocalSkillStore = class {
4309
4460
  constructor(db) {
4310
4461
  this.db = db;
4311
- ensureTable(db, DDL18);
4462
+ ensureTable(db, DDL19);
4312
4463
  }
4313
4464
  async getAllSkills(tenantId, _context) {
4314
4465
  const rows2 = this.db.prepare(
@@ -4458,7 +4609,7 @@ function mapRowToSkill(row) {
4458
4609
  }
4459
4610
 
4460
4611
  // src/stores/LocalScheduleStorage.ts
4461
- var DDL19 = `
4612
+ var DDL20 = `
4462
4613
  CREATE TABLE IF NOT EXISTS lt_scheduled_tasks (
4463
4614
  task_id TEXT PRIMARY KEY,
4464
4615
  task_type TEXT NOT NULL,
@@ -4491,7 +4642,7 @@ CREATE INDEX IF NOT EXISTS idx_lt_st_tenant ON lt_scheduled_tasks(tenant_id);
4491
4642
  var LocalScheduleStorage = class {
4492
4643
  constructor(db) {
4493
4644
  this.db = db;
4494
- ensureTable(db, DDL19);
4645
+ ensureTable(db, DDL20);
4495
4646
  }
4496
4647
  async save(task) {
4497
4648
  this.db.prepare(
@@ -4785,7 +4936,7 @@ function mapRowToTask(row) {
4785
4936
  }
4786
4937
 
4787
4938
  // src/stores/LocalTaskStore.ts
4788
- var import_crypto5 = require("crypto");
4939
+ var import_crypto6 = require("crypto");
4789
4940
  var MAX_CANONICAL_TASK_TIME = "9999-12-31T23:59:59.999Z";
4790
4941
  var TASK_STATUSES = /* @__PURE__ */ new Set([
4791
4942
  "pending",
@@ -4801,7 +4952,7 @@ var NEXT_UPDATED_AT_SQL = `updated_at = CASE
4801
4952
  THEN strftime('%Y-%m-%dT%H:%M:%fZ', updated_at, '+0.001 seconds')
4802
4953
  ELSE ?
4803
4954
  END`;
4804
- var DDL20 = `
4955
+ var DDL21 = `
4805
4956
  CREATE TABLE IF NOT EXISTS lt_tasks (
4806
4957
  id TEXT NOT NULL,
4807
4958
  tenant_id TEXT NOT NULL,
@@ -4874,7 +5025,7 @@ function assertPage(limit, offset = 0) {
4874
5025
  var LocalTaskStore = class {
4875
5026
  constructor(db) {
4876
5027
  this.db = db;
4877
- ensureTable(db, DDL20);
5028
+ ensureTable(db, DDL21);
4878
5029
  this.ensureColumn("lt_tasks", "require_review", "require_review INTEGER DEFAULT 0");
4879
5030
  this.ensureColumn("lt_tasks", "dependencies", "dependencies TEXT");
4880
5031
  this.ensureColumn("lt_tasks", "result", "result TEXT");
@@ -4891,7 +5042,7 @@ var LocalTaskStore = class {
4891
5042
  }
4892
5043
  }
4893
5044
  async create(params) {
4894
- const id = params.id ?? (0, import_crypto5.randomUUID)();
5045
+ const id = params.id ?? (0, import_crypto6.randomUUID)();
4895
5046
  const now = nowISO();
4896
5047
  this.db.prepare(
4897
5048
  `INSERT INTO lt_tasks (id, tenant_id, owner_type, owner_id, title, description, status, priority, due_date, metadata, parent_id, source_id, context, require_review, dependencies, result, failure_reason, workspace_id, project_id, files, created_at, updated_at)
@@ -5551,7 +5702,7 @@ var PROJECT_LIFECYCLE_ACTIONS = /* @__PURE__ */ new Set([
5551
5702
  "cancelled",
5552
5703
  "reassigned"
5553
5704
  ]);
5554
- var DDL21 = `
5705
+ var DDL22 = `
5555
5706
  CREATE TABLE IF NOT EXISTS lt_task_work_items (
5556
5707
  id TEXT NOT NULL,
5557
5708
  tenant_id TEXT NOT NULL,
@@ -5625,7 +5776,7 @@ function assertLifecyclePage(query) {
5625
5776
  var LocalTaskWorkItemStore = class {
5626
5777
  constructor(db) {
5627
5778
  this.db = db;
5628
- ensureTable(db, DDL21);
5779
+ ensureTable(db, DDL22);
5629
5780
  this.ensureColumn("lt_task_work_items", "workspace_id", "workspace_id TEXT");
5630
5781
  this.ensureColumn("lt_task_work_items", "project_id", "project_id TEXT");
5631
5782
  this.ensureColumn("lt_task_work_items", "event_key", "event_key TEXT");
@@ -5821,8 +5972,8 @@ var LocalTaskWorkItemStore = class {
5821
5972
  };
5822
5973
 
5823
5974
  // src/stores/LocalCapabilityBundleStore.ts
5824
- var import_crypto6 = require("crypto");
5825
- var DDL22 = `CREATE TABLE IF NOT EXISTS lt_capability_bundles (id TEXT NOT NULL, tenant_id TEXT NOT NULL, bundle_key TEXT NOT NULL, name TEXT NOT NULL, description TEXT, capabilities TEXT NOT NULL DEFAULT '[]', created_at TEXT NOT NULL, updated_at TEXT NOT NULL, PRIMARY KEY (tenant_id, id), UNIQUE (tenant_id, bundle_key)); CREATE INDEX IF NOT EXISTS idx_lt_capability_bundles_tenant ON lt_capability_bundles(tenant_id);`;
5975
+ var import_crypto7 = require("crypto");
5976
+ var DDL23 = `CREATE TABLE IF NOT EXISTS lt_capability_bundles (id TEXT NOT NULL, tenant_id TEXT NOT NULL, bundle_key TEXT NOT NULL, name TEXT NOT NULL, description TEXT, capabilities TEXT NOT NULL DEFAULT '[]', created_at TEXT NOT NULL, updated_at TEXT NOT NULL, PRIMARY KEY (tenant_id, id), UNIQUE (tenant_id, bundle_key)); CREATE INDEX IF NOT EXISTS idx_lt_capability_bundles_tenant ON lt_capability_bundles(tenant_id);`;
5826
5977
  var duplicateMessage = "Capability bundle key already exists for tenant";
5827
5978
  function map(row) {
5828
5979
  return { id: row.id, tenantId: row.tenant_id, key: row.bundle_key, name: row.name, description: row.description ?? void 0, capabilities: JSON.parse(row.capabilities), createdAt: parseISO(row.created_at).toISOString(), updatedAt: parseISO(row.updated_at).toISOString() };
@@ -5843,7 +5994,7 @@ var LocalCapabilityBundleStore = class {
5843
5994
  */
5844
5995
  constructor(db) {
5845
5996
  this.db = db;
5846
- ensureTable(db, DDL22);
5997
+ ensureTable(db, DDL23);
5847
5998
  }
5848
5999
  async listByTenant(tenantId) {
5849
6000
  return this.db.prepare("SELECT * FROM lt_capability_bundles WHERE tenant_id = ? ORDER BY created_at").all(tenantId).map(map);
@@ -5860,7 +6011,7 @@ var LocalCapabilityBundleStore = class {
5860
6011
  }
5861
6012
  async create(tenantId, input) {
5862
6013
  const now = nextTimestamp();
5863
- const id = (0, import_crypto6.randomUUID)();
6014
+ const id = (0, import_crypto7.randomUUID)();
5864
6015
  try {
5865
6016
  this.db.prepare("INSERT INTO lt_capability_bundles (id, tenant_id, bundle_key, name, description, capabilities, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?)").run(id, tenantId, input.key, input.name, input.description ?? null, JSON.stringify(input.capabilities), now, now);
5866
6017
  } catch (error) {
@@ -5942,6 +6093,7 @@ async function createLocalStoreConfig(options = {}) {
5942
6093
  channelBinding: new LocalChannelBindingStore(db),
5943
6094
  channelInstallation: new LocalChannelInstallationStore(db),
5944
6095
  a2aApiKey: new LocalA2AApiKeyStore(db),
6096
+ openAudit: new LocalOpenAuditStore(db),
5945
6097
  threadMessageQueue: new LocalThreadMessageQueueStore(db),
5946
6098
  skill: new LocalSkillStore(db),
5947
6099
  schedule: new LocalScheduleStorage(db),
@@ -6004,6 +6156,7 @@ var InMemoryConversationStore = class {
6004
6156
  LocalEvalStore,
6005
6157
  LocalMcpServerConfigStore,
6006
6158
  LocalMetricsServerConfigStore,
6159
+ LocalOpenAuditStore,
6007
6160
  LocalProjectBotMembershipStore,
6008
6161
  LocalProjectMembershipStore,
6009
6162
  LocalProjectRoomMessageStore,