@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.
- package/.turbo/turbo-build.log +10 -10
- package/CHANGELOG.md +9 -0
- package/dist/index.d.mts +142 -14
- package/dist/index.d.ts +142 -14
- package/dist/index.js +1194 -206
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1189 -203
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/__tests__/LocalCapabilityBundleStore.test.ts +1 -2
- package/src/__tests__/LocalChannelBindingStore.test.ts +183 -0
- package/src/__tests__/LocalChannelInstallationStore.test.ts +23 -0
- package/src/__tests__/LocalProjectRoomStores.test.ts +356 -0
- package/src/__tests__/LocalTaskStore.test.ts +58 -0
- package/src/__tests__/LocalTaskWorkItemStore.test.ts +92 -0
- package/src/__tests__/LocalThreadMessageQueueStore.test.ts +126 -3
- package/src/createLocalStoreConfig.ts +8 -0
- package/src/index.ts +4 -0
- package/src/migrations/migration.ts +1 -1
- package/src/stores/LocalChannelBindingStore.ts +75 -41
- package/src/stores/LocalChannelInstallationStore.ts +6 -5
- package/src/stores/LocalProjectBotMembershipStore.ts +105 -0
- package/src/stores/LocalProjectMembershipStore.ts +72 -0
- package/src/stores/LocalProjectRoomMessageStore.ts +63 -0
- package/src/stores/LocalProjectRoomStore.ts +37 -0
- package/src/stores/LocalTaskStore.ts +82 -2
- package/src/stores/LocalTaskWorkItemStore.ts +91 -1
- package/src/stores/LocalThreadMessageQueueStore.ts +52 -6
- package/src/stores/project-room-schema.ts +243 -0
- package/src/stores/room-channel-binding-index.ts +60 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @axiom-lattice/local-stores@3.1.
|
|
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
|
[34mCLI[39m Building entry: src/index.ts
|
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
[34mCLI[39m Target: es2020
|
|
9
9
|
[34mCJS[39m Build start
|
|
10
10
|
[34mESM[39m Build start
|
|
11
|
-
[32mCJS[39m [1mdist/index.js [22m[
|
|
12
|
-
[32mCJS[39m [1mdist/index.js.map [22m[
|
|
13
|
-
[32mCJS[39m ⚡️ Build success in
|
|
14
|
-
[32mESM[39m [1mdist/index.mjs [22m[
|
|
15
|
-
[32mESM[39m [1mdist/index.mjs.map [22m[
|
|
16
|
-
[32mESM[39m ⚡️ Build success in
|
|
11
|
+
[32mCJS[39m [1mdist/index.js [22m[32m216.48 KB[39m
|
|
12
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m392.76 KB[39m
|
|
13
|
+
[32mCJS[39m ⚡️ Build success in 555ms
|
|
14
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m212.10 KB[39m
|
|
15
|
+
[32mESM[39m [1mdist/index.mjs.map [22m[32m389.23 KB[39m
|
|
16
|
+
[32mESM[39m ⚡️ Build success in 556ms
|
|
17
17
|
[34mDTS[39m Build start
|
|
18
|
-
[32mDTS[39m ⚡️ Build success in
|
|
19
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[
|
|
20
|
-
[32mDTS[39m [1mdist/index.d.mts [22m[
|
|
18
|
+
[32mDTS[39m ⚡️ Build success in 16355ms
|
|
19
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m39.86 KB[39m
|
|
20
|
+
[32mDTS[39m [1mdist/index.d.mts [22m[32m39.86 KB[39m
|
package/CHANGELOG.md
CHANGED
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,
|
|
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:
|
|
457
|
-
delete(id: string): Promise<void>;
|
|
458
|
-
list(params:
|
|
459
|
-
|
|
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:
|
|
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,
|
|
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:
|
|
457
|
-
delete(id: string): Promise<void>;
|
|
458
|
-
list(params:
|
|
459
|
-
|
|
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:
|
|
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 };
|