@axiom-lattice/local-stores 3.1.1 → 3.1.2

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.1 build /home/runner/work/agentic/agentic/packages/local-stores
2
+ > @axiom-lattice/local-stores@3.1.2 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 166.21 KB
12
- CJS dist/index.js.map 304.24 KB
13
- CJS ⚡️ Build success in 510ms
14
- ESM dist/index.mjs 162.55 KB
15
- ESM dist/index.mjs.map 301.30 KB
16
- ESM ⚡️ Build success in 510ms
11
+ CJS dist/index.js 216.48 KB
12
+ CJS dist/index.js.map 392.76 KB
13
+ CJS ⚡️ Build success in 555ms
14
+ ESM dist/index.mjs 212.10 KB
15
+ ESM dist/index.mjs.map 389.23 KB
16
+ ESM ⚡️ Build success in 556ms
17
17
  DTS Build start
18
- DTS ⚡️ Build success in 15859ms
19
- DTS dist/index.d.ts 33.90 KB
20
- DTS dist/index.d.mts 33.90 KB
18
+ DTS ⚡️ Build success in 16355ms
19
+ DTS dist/index.d.ts 39.86 KB
20
+ DTS dist/index.d.mts 39.86 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @axiom-lattice/local-stores
2
2
 
3
+ ## 3.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 08bf26a: update metric builder
8
+ - Updated dependencies [08bf26a]
9
+ - @axiom-lattice/core@4.2.2
10
+ - @axiom-lattice/protocols@4.1.2
11
+
3
12
  ## 3.1.1
4
13
 
5
14
  ### 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, 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, TaskWorkItemStore, CreateWorkItemRequest, TaskWorkItem, CreateWorkItemIfAbsentRequest, TaskWorkItemListFilter, 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, 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';
4
4
  import { IMessageQueueStore, AddMessageParams, PendingMessage, QueueScope, ThreadInfo } from '@axiom-lattice/core';
5
5
 
6
6
  /**
@@ -250,6 +250,120 @@ declare class LocalProjectStore implements ProjectStore {
250
250
  private ensureColumn;
251
251
  }
252
252
 
253
+ /** Persists canonical project main rooms in local SQLite. */
254
+ declare class LocalProjectRoomStore implements ProjectRoomStore {
255
+ private readonly db;
256
+ constructor(db: DatabaseWrapper);
257
+ ensureMainRoom(input: {
258
+ id: string;
259
+ tenantId: string;
260
+ workspaceId: string;
261
+ projectId: string;
262
+ name: string;
263
+ }): Promise<ProjectRoom>;
264
+ getMainRoom(tenantId: string, projectId: string): Promise<ProjectRoom | null>;
265
+ private getRow;
266
+ }
267
+
268
+ declare class DuplicateProjectMembershipError extends Error {
269
+ constructor();
270
+ }
271
+ declare class ProjectMembershipIdConflictError extends Error {
272
+ constructor();
273
+ }
274
+ /** Persists human project memberships in local SQLite. */
275
+ declare class LocalProjectMembershipStore implements ProjectMembershipStore {
276
+ private readonly db;
277
+ constructor(db: DatabaseWrapper);
278
+ list(tenantId: string, projectId: string): Promise<ProjectMembership[]>;
279
+ findByUser(tenantId: string, projectId: string, userId: string): Promise<ProjectMembership | null>;
280
+ create(input: Omit<ProjectMembership, "joinedAt" | "updatedAt">): Promise<ProjectMembership>;
281
+ createInitialOwner(input: Omit<ProjectMembership, "role" | "status" | "joinedAt" | "updatedAt">): Promise<{
282
+ kind: "created" | "existing";
283
+ membership: ProjectMembership;
284
+ } | {
285
+ kind: "already_initialized";
286
+ }>;
287
+ updateRole(input: {
288
+ tenantId: string;
289
+ id: string;
290
+ role: ProjectHumanRole;
291
+ expectedUpdatedAt: Date;
292
+ }): Promise<ProjectMembershipMutationResult>;
293
+ remove(input: {
294
+ tenantId: string;
295
+ id: string;
296
+ expectedUpdatedAt: Date;
297
+ }): Promise<ProjectMembershipMutationResult>;
298
+ private mutate;
299
+ private byId;
300
+ private classifyUnique;
301
+ }
302
+
303
+ type Conflict = "coordinator_conflict" | "mention_conflict";
304
+ declare class ProjectBotMembershipIdConflictError extends Error {
305
+ constructor(tenantId: string, id: string);
306
+ }
307
+ /** Persists durable project bot roster memberships in local SQLite. */
308
+ declare class LocalProjectBotMembershipStore implements ProjectBotMembershipStore {
309
+ private readonly db;
310
+ constructor(db: DatabaseWrapper);
311
+ list(tenantId: string, projectId: string): Promise<ProjectBotMembership[]>;
312
+ findById(tenantId: string, id: string): Promise<ProjectBotMembership | null>;
313
+ findByAssistant(tenantId: string, projectId: string, assistantId: string): Promise<ProjectBotMembership | null>;
314
+ save(input: Omit<ProjectBotMembership, "joinedAt" | "updatedAt">): Promise<{
315
+ kind: "created" | "updated" | "reactivated";
316
+ membership: ProjectBotMembership;
317
+ } | {
318
+ kind: Conflict;
319
+ }>;
320
+ update(input: {
321
+ tenantId: string;
322
+ id: string;
323
+ patch: Partial<Pick<ProjectBotMembership, "role" | "title" | "responsibility" | "mentionName" | "status">>;
324
+ expectedUpdatedAt: Date;
325
+ }): Promise<{
326
+ kind: "updated";
327
+ membership: ProjectBotMembership;
328
+ } | {
329
+ kind: "not_found" | "conflict" | Conflict;
330
+ }>;
331
+ private byId;
332
+ private byAssistant;
333
+ private reactivate;
334
+ private preflight;
335
+ private conflict;
336
+ }
337
+
338
+ declare class ProjectRoomMessageIdConflictError extends Error {
339
+ constructor(tenantId: string, id: string);
340
+ }
341
+ declare class DuplicateProjectRoomMessageIdempotencyKeyError extends Error {
342
+ constructor(tenantId: string, roomId: string, key: string);
343
+ }
344
+ /** Persists validated project room messages in local SQLite. */
345
+ declare class LocalProjectRoomMessageStore implements ProjectRoomMessageStore {
346
+ private readonly db;
347
+ constructor(db: DatabaseWrapper);
348
+ create(input: Omit<ProjectRoomMessage, "createdAt">): Promise<ProjectRoomMessage>;
349
+ createIdempotent(input: Omit<ProjectRoomMessage, "createdAt"> & {
350
+ idempotencyKey: string;
351
+ }): Promise<ProjectRoomMessage>;
352
+ list(input: {
353
+ tenantId: string;
354
+ roomId: string;
355
+ before?: {
356
+ createdAt: Date;
357
+ id: string;
358
+ };
359
+ limit: number;
360
+ }): Promise<ProjectRoomMessage[]>;
361
+ findById(tenantId: string, id: string): Promise<ProjectRoomMessage | null>;
362
+ private insert;
363
+ private byId;
364
+ private byKey;
365
+ }
366
+
253
367
  /**
254
368
  * Local SQLite implementation of UserStore.
255
369
  */
@@ -446,6 +560,13 @@ declare class LocalEvalStore implements EvalStore {
446
560
  declare class LocalChannelBindingStore implements BindingRegistry {
447
561
  private db;
448
562
  constructor(db: DatabaseWrapper);
563
+ findById(tenantId: string, id: string): Promise<Binding | null>;
564
+ findBySubject(params: {
565
+ tenantId: string;
566
+ channel: string;
567
+ channelInstallationId: string;
568
+ senderId: string;
569
+ }): Promise<Binding | null>;
449
570
  resolve(params: {
450
571
  channel: string;
451
572
  senderId: string;
@@ -453,17 +574,10 @@ declare class LocalChannelBindingStore implements BindingRegistry {
453
574
  tenantId: string;
454
575
  }): Promise<Binding | null>;
455
576
  create(input: CreateBindingInput): Promise<Binding>;
456
- update(id: string, patch: Partial<Binding>): Promise<Binding>;
457
- delete(id: string): Promise<void>;
458
- list(params: {
459
- channel?: string;
460
- agentId?: string;
461
- tenantId: string;
462
- channelInstallationId?: string;
463
- limit?: number;
464
- offset?: number;
465
- }): Promise<Binding[]>;
466
- import(bindings: CreateBindingInput[]): Promise<Binding[]>;
577
+ update(tenantId: string, id: string, patch: BindingMutablePatch): Promise<Binding>;
578
+ delete(tenantId: string, id: string): Promise<void>;
579
+ list(params: BindingListParams): Promise<Binding[]>;
580
+ import(tenantId: string, bindings: CreateBindingInput[]): Promise<Binding[]>;
467
581
  export(params: {
468
582
  tenantId: string;
469
583
  }): Promise<Binding[]>;
@@ -480,7 +594,7 @@ declare class LocalChannelInstallationStore implements ChannelInstallationStore
480
594
  getInstallationById(installationId: string): Promise<ChannelInstallation | null>;
481
595
  getInstallationsByTenant(tenantId: string, channel?: ChannelInstallationType): Promise<ChannelInstallation[]>;
482
596
  getAllInstallations(channel?: ChannelInstallationType): Promise<ChannelInstallation[]>;
483
- createInstallation(tenantId: string, installationId: string, data: CreateChannelInstallationRequest): Promise<ChannelInstallation>;
597
+ createInstallation(tenantId: string, installationId: string, data: CreateChannelInstallationInput): Promise<ChannelInstallation>;
484
598
  updateInstallation(tenantId: string, installationId: string, updates: UpdateChannelInstallationRequest): Promise<ChannelInstallation | null>;
485
599
  deleteInstallation(tenantId: string, installationId: string): Promise<boolean>;
486
600
  }
@@ -608,6 +722,8 @@ declare class LocalTaskStore implements TaskStore {
608
722
  }): Promise<TaskItem>;
609
723
  getById(tenantId: string, id: string): Promise<TaskItem | null>;
610
724
  list(filter: TaskListFilter): Promise<TaskItem[]>;
725
+ /** Lists exact project tasks containing a string dependency. */
726
+ listDependents(query: TaskDependentListQuery): Promise<TaskItem[]>;
611
727
  update(tenantId: string, id: string, updates: UpdateTaskRequest): Promise<TaskItem | null>;
612
728
  /**
613
729
  * Atomically update a task unless its current status is blocked.
@@ -623,9 +739,13 @@ declare class LocalTaskStore implements TaskStore {
623
739
  updateIfStatusIn(tenantId: string, id: string, updates: UpdateTaskRequest, expectedStatuses: TaskItem["status"][]): Promise<TaskItem | null>;
624
740
  /** Atomically update a task only when status and updatedAt match a read snapshot. */
625
741
  updateIfStatusAndUpdatedAt(tenantId: string, id: string, updates: UpdateTaskRequest, expectedStatuses: TaskItem["status"][], expectedUpdatedAt: Date | string): Promise<TaskItem | null>;
742
+ /** Atomically update only while status, timestamp, owner, and Project scope match. */
743
+ updateIfSnapshot(tenantId: string, id: string, updates: UpdateTaskRequest, snapshot: TaskMutationSnapshot): Promise<TaskItem | null>;
626
744
  /** Atomically update a child only when both child and parent snapshots match. */
627
745
  updateIfStatusUpdatedAtAndParentUpdatedAt(tenantId: string, id: string, updates: UpdateTaskRequest, expectedStatuses: TaskItem["status"][], expectedUpdatedAt: Date | string, parentId: string, expectedParentUpdatedAt: Date | string): Promise<TaskItem | null>;
628
746
  delete(tenantId: string, id: string): Promise<boolean>;
747
+ /** Atomically delete only while status, timestamp, owner, and Project scope match. */
748
+ deleteIfSnapshot(tenantId: string, id: string, snapshot: TaskMutationSnapshot): Promise<boolean>;
629
749
  }
630
750
 
631
751
  /**
@@ -638,6 +758,8 @@ declare class LocalTaskWorkItemStore implements TaskWorkItemStore {
638
758
  /** Add a column if it does not exist (SQLite version compatible). */
639
759
  private ensureColumn;
640
760
  create(params: CreateWorkItemRequest): Promise<TaskWorkItem>;
761
+ /** Atomically inserts a work item by selecting one exact task snapshot. */
762
+ createIfTaskSnapshot(params: CreateWorkItemRequest, snapshot: TaskMutationSnapshot): Promise<TaskWorkItem | null>;
641
763
  /** Find an event by its tenant- and task-scoped key without pagination. */
642
764
  findByEventKey(tenantId: string, taskId: string, eventKey: string): Promise<TaskWorkItem | null>;
643
765
  /** Atomically return an existing event or create it once. */
@@ -649,6 +771,8 @@ declare class LocalTaskWorkItemStore implements TaskWorkItemStore {
649
771
  taskId: string;
650
772
  limit: number;
651
773
  }): Promise<TaskWorkItem[]>;
774
+ /** Lists canonical project lifecycle events with an exclusive cursor. */
775
+ listProjectLifecycleEvents(query: ProjectLifecycleEventQuery): Promise<TaskWorkItem[]>;
652
776
  }
653
777
 
654
778
  /**
@@ -721,6 +845,10 @@ declare function createLocalStoreConfig(options?: LocalStoreConfigOptions): Prom
721
845
  assistant: LocalAssistantStore;
722
846
  workspace: LocalWorkspaceStore;
723
847
  project: LocalProjectStore;
848
+ projectRoom: LocalProjectRoomStore;
849
+ projectMembership: LocalProjectMembershipStore;
850
+ projectBotMembership: LocalProjectBotMembershipStore;
851
+ projectRoomMessage: LocalProjectRoomMessageStore;
724
852
  user: LocalUserStore;
725
853
  tenant: LocalTenantStore;
726
854
  userTenantLink: LocalUserTenantLinkStore;
@@ -758,4 +886,4 @@ declare class InMemoryConversationStore implements IConversationStore {
758
886
  deleteConversation(conversationId: string): Promise<void>;
759
887
  }
760
888
 
761
- export { DatabaseWrapper, InMemoryConversationStore, LocalA2AApiKeyStore, LocalAssistantStore, LocalCapabilityBundleStore, LocalChannelBindingStore, LocalChannelInstallationStore, LocalConnectionStore, LocalDatabaseConfigStore, LocalEvalStore, LocalMcpServerConfigStore, LocalMetricsServerConfigStore, LocalProjectStore, LocalScheduleStorage, LocalSkillStore, type LocalStoreConfigOptions, type LocalStoreOptions, LocalTaskStore, LocalTaskWorkItemStore, LocalTenantStore, LocalThreadMessageQueueStore, LocalThreadStore, LocalUserStore, LocalUserTenantLinkStore, LocalWorkflowTrackingStore, LocalWorkspaceStore, type Migration, MigrationManager, RunResult, StatementWrapper, closeDatabase, createLocalStoreConfig, ensureTable, getDatabase, initDatabase, nowISO, parseISO };
889
+ export { DatabaseWrapper, DuplicateProjectMembershipError, DuplicateProjectRoomMessageIdempotencyKeyError, InMemoryConversationStore, LocalA2AApiKeyStore, LocalAssistantStore, LocalCapabilityBundleStore, LocalChannelBindingStore, LocalChannelInstallationStore, LocalConnectionStore, LocalDatabaseConfigStore, LocalEvalStore, LocalMcpServerConfigStore, LocalMetricsServerConfigStore, LocalProjectBotMembershipStore, LocalProjectMembershipStore, LocalProjectRoomMessageStore, 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, 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, TaskWorkItemStore, CreateWorkItemRequest, TaskWorkItem, CreateWorkItemIfAbsentRequest, TaskWorkItemListFilter, 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, 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';
4
4
  import { IMessageQueueStore, AddMessageParams, PendingMessage, QueueScope, ThreadInfo } from '@axiom-lattice/core';
5
5
 
6
6
  /**
@@ -250,6 +250,120 @@ declare class LocalProjectStore implements ProjectStore {
250
250
  private ensureColumn;
251
251
  }
252
252
 
253
+ /** Persists canonical project main rooms in local SQLite. */
254
+ declare class LocalProjectRoomStore implements ProjectRoomStore {
255
+ private readonly db;
256
+ constructor(db: DatabaseWrapper);
257
+ ensureMainRoom(input: {
258
+ id: string;
259
+ tenantId: string;
260
+ workspaceId: string;
261
+ projectId: string;
262
+ name: string;
263
+ }): Promise<ProjectRoom>;
264
+ getMainRoom(tenantId: string, projectId: string): Promise<ProjectRoom | null>;
265
+ private getRow;
266
+ }
267
+
268
+ declare class DuplicateProjectMembershipError extends Error {
269
+ constructor();
270
+ }
271
+ declare class ProjectMembershipIdConflictError extends Error {
272
+ constructor();
273
+ }
274
+ /** Persists human project memberships in local SQLite. */
275
+ declare class LocalProjectMembershipStore implements ProjectMembershipStore {
276
+ private readonly db;
277
+ constructor(db: DatabaseWrapper);
278
+ list(tenantId: string, projectId: string): Promise<ProjectMembership[]>;
279
+ findByUser(tenantId: string, projectId: string, userId: string): Promise<ProjectMembership | null>;
280
+ create(input: Omit<ProjectMembership, "joinedAt" | "updatedAt">): Promise<ProjectMembership>;
281
+ createInitialOwner(input: Omit<ProjectMembership, "role" | "status" | "joinedAt" | "updatedAt">): Promise<{
282
+ kind: "created" | "existing";
283
+ membership: ProjectMembership;
284
+ } | {
285
+ kind: "already_initialized";
286
+ }>;
287
+ updateRole(input: {
288
+ tenantId: string;
289
+ id: string;
290
+ role: ProjectHumanRole;
291
+ expectedUpdatedAt: Date;
292
+ }): Promise<ProjectMembershipMutationResult>;
293
+ remove(input: {
294
+ tenantId: string;
295
+ id: string;
296
+ expectedUpdatedAt: Date;
297
+ }): Promise<ProjectMembershipMutationResult>;
298
+ private mutate;
299
+ private byId;
300
+ private classifyUnique;
301
+ }
302
+
303
+ type Conflict = "coordinator_conflict" | "mention_conflict";
304
+ declare class ProjectBotMembershipIdConflictError extends Error {
305
+ constructor(tenantId: string, id: string);
306
+ }
307
+ /** Persists durable project bot roster memberships in local SQLite. */
308
+ declare class LocalProjectBotMembershipStore implements ProjectBotMembershipStore {
309
+ private readonly db;
310
+ constructor(db: DatabaseWrapper);
311
+ list(tenantId: string, projectId: string): Promise<ProjectBotMembership[]>;
312
+ findById(tenantId: string, id: string): Promise<ProjectBotMembership | null>;
313
+ findByAssistant(tenantId: string, projectId: string, assistantId: string): Promise<ProjectBotMembership | null>;
314
+ save(input: Omit<ProjectBotMembership, "joinedAt" | "updatedAt">): Promise<{
315
+ kind: "created" | "updated" | "reactivated";
316
+ membership: ProjectBotMembership;
317
+ } | {
318
+ kind: Conflict;
319
+ }>;
320
+ update(input: {
321
+ tenantId: string;
322
+ id: string;
323
+ patch: Partial<Pick<ProjectBotMembership, "role" | "title" | "responsibility" | "mentionName" | "status">>;
324
+ expectedUpdatedAt: Date;
325
+ }): Promise<{
326
+ kind: "updated";
327
+ membership: ProjectBotMembership;
328
+ } | {
329
+ kind: "not_found" | "conflict" | Conflict;
330
+ }>;
331
+ private byId;
332
+ private byAssistant;
333
+ private reactivate;
334
+ private preflight;
335
+ private conflict;
336
+ }
337
+
338
+ declare class ProjectRoomMessageIdConflictError extends Error {
339
+ constructor(tenantId: string, id: string);
340
+ }
341
+ declare class DuplicateProjectRoomMessageIdempotencyKeyError extends Error {
342
+ constructor(tenantId: string, roomId: string, key: string);
343
+ }
344
+ /** Persists validated project room messages in local SQLite. */
345
+ declare class LocalProjectRoomMessageStore implements ProjectRoomMessageStore {
346
+ private readonly db;
347
+ constructor(db: DatabaseWrapper);
348
+ create(input: Omit<ProjectRoomMessage, "createdAt">): Promise<ProjectRoomMessage>;
349
+ createIdempotent(input: Omit<ProjectRoomMessage, "createdAt"> & {
350
+ idempotencyKey: string;
351
+ }): Promise<ProjectRoomMessage>;
352
+ list(input: {
353
+ tenantId: string;
354
+ roomId: string;
355
+ before?: {
356
+ createdAt: Date;
357
+ id: string;
358
+ };
359
+ limit: number;
360
+ }): Promise<ProjectRoomMessage[]>;
361
+ findById(tenantId: string, id: string): Promise<ProjectRoomMessage | null>;
362
+ private insert;
363
+ private byId;
364
+ private byKey;
365
+ }
366
+
253
367
  /**
254
368
  * Local SQLite implementation of UserStore.
255
369
  */
@@ -446,6 +560,13 @@ declare class LocalEvalStore implements EvalStore {
446
560
  declare class LocalChannelBindingStore implements BindingRegistry {
447
561
  private db;
448
562
  constructor(db: DatabaseWrapper);
563
+ findById(tenantId: string, id: string): Promise<Binding | null>;
564
+ findBySubject(params: {
565
+ tenantId: string;
566
+ channel: string;
567
+ channelInstallationId: string;
568
+ senderId: string;
569
+ }): Promise<Binding | null>;
449
570
  resolve(params: {
450
571
  channel: string;
451
572
  senderId: string;
@@ -453,17 +574,10 @@ declare class LocalChannelBindingStore implements BindingRegistry {
453
574
  tenantId: string;
454
575
  }): Promise<Binding | null>;
455
576
  create(input: CreateBindingInput): Promise<Binding>;
456
- update(id: string, patch: Partial<Binding>): Promise<Binding>;
457
- delete(id: string): Promise<void>;
458
- list(params: {
459
- channel?: string;
460
- agentId?: string;
461
- tenantId: string;
462
- channelInstallationId?: string;
463
- limit?: number;
464
- offset?: number;
465
- }): Promise<Binding[]>;
466
- import(bindings: CreateBindingInput[]): Promise<Binding[]>;
577
+ update(tenantId: string, id: string, patch: BindingMutablePatch): Promise<Binding>;
578
+ delete(tenantId: string, id: string): Promise<void>;
579
+ list(params: BindingListParams): Promise<Binding[]>;
580
+ import(tenantId: string, bindings: CreateBindingInput[]): Promise<Binding[]>;
467
581
  export(params: {
468
582
  tenantId: string;
469
583
  }): Promise<Binding[]>;
@@ -480,7 +594,7 @@ declare class LocalChannelInstallationStore implements ChannelInstallationStore
480
594
  getInstallationById(installationId: string): Promise<ChannelInstallation | null>;
481
595
  getInstallationsByTenant(tenantId: string, channel?: ChannelInstallationType): Promise<ChannelInstallation[]>;
482
596
  getAllInstallations(channel?: ChannelInstallationType): Promise<ChannelInstallation[]>;
483
- createInstallation(tenantId: string, installationId: string, data: CreateChannelInstallationRequest): Promise<ChannelInstallation>;
597
+ createInstallation(tenantId: string, installationId: string, data: CreateChannelInstallationInput): Promise<ChannelInstallation>;
484
598
  updateInstallation(tenantId: string, installationId: string, updates: UpdateChannelInstallationRequest): Promise<ChannelInstallation | null>;
485
599
  deleteInstallation(tenantId: string, installationId: string): Promise<boolean>;
486
600
  }
@@ -608,6 +722,8 @@ declare class LocalTaskStore implements TaskStore {
608
722
  }): Promise<TaskItem>;
609
723
  getById(tenantId: string, id: string): Promise<TaskItem | null>;
610
724
  list(filter: TaskListFilter): Promise<TaskItem[]>;
725
+ /** Lists exact project tasks containing a string dependency. */
726
+ listDependents(query: TaskDependentListQuery): Promise<TaskItem[]>;
611
727
  update(tenantId: string, id: string, updates: UpdateTaskRequest): Promise<TaskItem | null>;
612
728
  /**
613
729
  * Atomically update a task unless its current status is blocked.
@@ -623,9 +739,13 @@ declare class LocalTaskStore implements TaskStore {
623
739
  updateIfStatusIn(tenantId: string, id: string, updates: UpdateTaskRequest, expectedStatuses: TaskItem["status"][]): Promise<TaskItem | null>;
624
740
  /** Atomically update a task only when status and updatedAt match a read snapshot. */
625
741
  updateIfStatusAndUpdatedAt(tenantId: string, id: string, updates: UpdateTaskRequest, expectedStatuses: TaskItem["status"][], expectedUpdatedAt: Date | string): Promise<TaskItem | null>;
742
+ /** Atomically update only while status, timestamp, owner, and Project scope match. */
743
+ updateIfSnapshot(tenantId: string, id: string, updates: UpdateTaskRequest, snapshot: TaskMutationSnapshot): Promise<TaskItem | null>;
626
744
  /** Atomically update a child only when both child and parent snapshots match. */
627
745
  updateIfStatusUpdatedAtAndParentUpdatedAt(tenantId: string, id: string, updates: UpdateTaskRequest, expectedStatuses: TaskItem["status"][], expectedUpdatedAt: Date | string, parentId: string, expectedParentUpdatedAt: Date | string): Promise<TaskItem | null>;
628
746
  delete(tenantId: string, id: string): Promise<boolean>;
747
+ /** Atomically delete only while status, timestamp, owner, and Project scope match. */
748
+ deleteIfSnapshot(tenantId: string, id: string, snapshot: TaskMutationSnapshot): Promise<boolean>;
629
749
  }
630
750
 
631
751
  /**
@@ -638,6 +758,8 @@ declare class LocalTaskWorkItemStore implements TaskWorkItemStore {
638
758
  /** Add a column if it does not exist (SQLite version compatible). */
639
759
  private ensureColumn;
640
760
  create(params: CreateWorkItemRequest): Promise<TaskWorkItem>;
761
+ /** Atomically inserts a work item by selecting one exact task snapshot. */
762
+ createIfTaskSnapshot(params: CreateWorkItemRequest, snapshot: TaskMutationSnapshot): Promise<TaskWorkItem | null>;
641
763
  /** Find an event by its tenant- and task-scoped key without pagination. */
642
764
  findByEventKey(tenantId: string, taskId: string, eventKey: string): Promise<TaskWorkItem | null>;
643
765
  /** Atomically return an existing event or create it once. */
@@ -649,6 +771,8 @@ declare class LocalTaskWorkItemStore implements TaskWorkItemStore {
649
771
  taskId: string;
650
772
  limit: number;
651
773
  }): Promise<TaskWorkItem[]>;
774
+ /** Lists canonical project lifecycle events with an exclusive cursor. */
775
+ listProjectLifecycleEvents(query: ProjectLifecycleEventQuery): Promise<TaskWorkItem[]>;
652
776
  }
653
777
 
654
778
  /**
@@ -721,6 +845,10 @@ declare function createLocalStoreConfig(options?: LocalStoreConfigOptions): Prom
721
845
  assistant: LocalAssistantStore;
722
846
  workspace: LocalWorkspaceStore;
723
847
  project: LocalProjectStore;
848
+ projectRoom: LocalProjectRoomStore;
849
+ projectMembership: LocalProjectMembershipStore;
850
+ projectBotMembership: LocalProjectBotMembershipStore;
851
+ projectRoomMessage: LocalProjectRoomMessageStore;
724
852
  user: LocalUserStore;
725
853
  tenant: LocalTenantStore;
726
854
  userTenantLink: LocalUserTenantLinkStore;
@@ -758,4 +886,4 @@ declare class InMemoryConversationStore implements IConversationStore {
758
886
  deleteConversation(conversationId: string): Promise<void>;
759
887
  }
760
888
 
761
- export { DatabaseWrapper, InMemoryConversationStore, LocalA2AApiKeyStore, LocalAssistantStore, LocalCapabilityBundleStore, LocalChannelBindingStore, LocalChannelInstallationStore, LocalConnectionStore, LocalDatabaseConfigStore, LocalEvalStore, LocalMcpServerConfigStore, LocalMetricsServerConfigStore, LocalProjectStore, LocalScheduleStorage, LocalSkillStore, type LocalStoreConfigOptions, type LocalStoreOptions, LocalTaskStore, LocalTaskWorkItemStore, LocalTenantStore, LocalThreadMessageQueueStore, LocalThreadStore, LocalUserStore, LocalUserTenantLinkStore, LocalWorkflowTrackingStore, LocalWorkspaceStore, type Migration, MigrationManager, RunResult, StatementWrapper, closeDatabase, createLocalStoreConfig, ensureTable, getDatabase, initDatabase, nowISO, parseISO };
889
+ export { DatabaseWrapper, DuplicateProjectMembershipError, DuplicateProjectRoomMessageIdempotencyKeyError, InMemoryConversationStore, LocalA2AApiKeyStore, LocalAssistantStore, LocalCapabilityBundleStore, LocalChannelBindingStore, LocalChannelInstallationStore, LocalConnectionStore, LocalDatabaseConfigStore, LocalEvalStore, LocalMcpServerConfigStore, LocalMetricsServerConfigStore, LocalProjectBotMembershipStore, LocalProjectMembershipStore, LocalProjectRoomMessageStore, 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 };