@axiom-lattice/local-stores 1.0.22 → 1.0.24
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 +17 -0
- package/dist/index.d.mts +14 -2
- package/dist/index.d.ts +14 -2
- package/dist/index.js +149 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +148 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/createLocalStoreConfig.ts +2 -0
- package/src/index.ts +1 -0
- package/src/stores/LocalTaskStore.ts +46 -4
- package/src/stores/LocalTaskWorkItemStore.ts +113 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @axiom-lattice/local-stores@1.0.
|
|
2
|
+
> @axiom-lattice/local-stores@1.0.24 build /home/runner/work/agentic/agentic/packages/local-stores
|
|
3
3
|
> tsup src/index.ts --format cjs,esm --dts --sourcemap
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
[34mCLI[39m Target: es2020
|
|
9
9
|
[34mCJS[39m Build start
|
|
10
10
|
[34mESM[39m Build start
|
|
11
|
-
[
|
|
12
|
-
[
|
|
13
|
-
[
|
|
14
|
-
[
|
|
15
|
-
[
|
|
16
|
-
[
|
|
11
|
+
[32mCJS[39m [1mdist/index.js [22m[32m129.70 KB[39m
|
|
12
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m242.22 KB[39m
|
|
13
|
+
[32mCJS[39m ⚡️ Build success in 474ms
|
|
14
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m126.29 KB[39m
|
|
15
|
+
[32mESM[39m [1mdist/index.mjs.map [22m[32m239.46 KB[39m
|
|
16
|
+
[32mESM[39m ⚡️ Build success in 475ms
|
|
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 14405ms
|
|
19
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m28.41 KB[39m
|
|
20
|
+
[32mDTS[39m [1mdist/index.d.mts [22m[32m28.41 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @axiom-lattice/local-stores
|
|
2
2
|
|
|
3
|
+
## 1.0.24
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 075a384: add skill graph, tenant url
|
|
8
|
+
- Updated dependencies [075a384]
|
|
9
|
+
- @axiom-lattice/core@2.1.102
|
|
10
|
+
- @axiom-lattice/protocols@2.1.53
|
|
11
|
+
|
|
12
|
+
## 1.0.23
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies [acdaec8]
|
|
17
|
+
- @axiom-lattice/core@2.1.101
|
|
18
|
+
- @axiom-lattice/protocols@2.1.52
|
|
19
|
+
|
|
3
20
|
## 1.0.22
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SqlJsStatic, Database } from 'sql.js';
|
|
2
2
|
import { SqliteSaver } from '@langchain/langgraph-checkpoint-sqlite';
|
|
3
|
-
import { ThreadStore, Thread, CreateThreadRequest, AssistantStore, Assistant, CreateAssistantRequest, WorkspaceStore, Workspace, CreateWorkspaceRequest, UpdateWorkspaceRequest, ProjectStore, Project, CreateProjectRequest, UpdateProjectRequest, UserStore, User, CreateUserRequest, UpdateUserRequest, TenantStore, Tenant, CreateTenantRequest, UpdateTenantRequest, UserTenantLinkStore, UserTenantLink, CreateUserTenantLinkRequest, UpdateUserTenantLinkRequest, DatabaseConfigStore, DatabaseConfigEntry, CreateDatabaseConfigRequest, UpdateDatabaseConfigRequest, ConnectionStore, ConnectionEntry, MetricsServerConfigStore, MetricsServerConfigEntry, CreateMetricsServerConfigRequest, UpdateMetricsServerConfigRequest, McpServerConfigStore, McpServerConfigEntry, CreateMcpServerConfigRequest, UpdateMcpServerConfigRequest, WorkflowTrackingStore, CreateWorkflowRunRequest, WorkflowRun, UpdateWorkflowRunRequest, QueryWorkflowRunsOptions, QueryWorkflowRunsResult, CreateRunStepRequest, RunStep, UpdateRunStepRequest, StepType, EvalStore, EvalProject, CreateEvalProjectRequest, EvalSuite, CreateEvalSuiteRequest, EvalCase, CreateEvalCaseRequest, EvalRun, CreateEvalRunRequest, EvalRunResult, EvalProjectReport, BindingRegistry, Binding, CreateBindingInput, ChannelInstallationStore, ChannelInstallation, ChannelInstallationType, CreateChannelInstallationRequest, UpdateChannelInstallationRequest, A2AApiKeyStore, A2AApiKeyRecord, CreateA2AApiKeyInput, A2AApiKeyEntry, SkillStore, SkillStoreContext, Skill, CreateSkillRequest, ScheduleStorage, ScheduledTaskDefinition, ScheduledTaskStatus, ScheduleExecutionType, TaskStore, CreateTaskRequest, TaskItem, TaskListFilter, UpdateTaskRequest } from '@axiom-lattice/protocols';
|
|
3
|
+
import { ThreadStore, Thread, CreateThreadRequest, AssistantStore, Assistant, CreateAssistantRequest, WorkspaceStore, Workspace, CreateWorkspaceRequest, UpdateWorkspaceRequest, ProjectStore, Project, CreateProjectRequest, UpdateProjectRequest, UserStore, User, CreateUserRequest, UpdateUserRequest, TenantStore, Tenant, CreateTenantRequest, UpdateTenantRequest, UserTenantLinkStore, UserTenantLink, CreateUserTenantLinkRequest, UpdateUserTenantLinkRequest, DatabaseConfigStore, DatabaseConfigEntry, CreateDatabaseConfigRequest, UpdateDatabaseConfigRequest, ConnectionStore, ConnectionEntry, MetricsServerConfigStore, MetricsServerConfigEntry, CreateMetricsServerConfigRequest, UpdateMetricsServerConfigRequest, McpServerConfigStore, McpServerConfigEntry, CreateMcpServerConfigRequest, UpdateMcpServerConfigRequest, WorkflowTrackingStore, CreateWorkflowRunRequest, WorkflowRun, UpdateWorkflowRunRequest, QueryWorkflowRunsOptions, QueryWorkflowRunsResult, CreateRunStepRequest, RunStep, UpdateRunStepRequest, StepType, EvalStore, EvalProject, CreateEvalProjectRequest, EvalSuite, CreateEvalSuiteRequest, EvalCase, CreateEvalCaseRequest, EvalRun, CreateEvalRunRequest, EvalRunResult, EvalProjectReport, BindingRegistry, Binding, CreateBindingInput, ChannelInstallationStore, ChannelInstallation, ChannelInstallationType, CreateChannelInstallationRequest, UpdateChannelInstallationRequest, A2AApiKeyStore, A2AApiKeyRecord, CreateA2AApiKeyInput, A2AApiKeyEntry, SkillStore, SkillStoreContext, Skill, CreateSkillRequest, ScheduleStorage, ScheduledTaskDefinition, ScheduledTaskStatus, ScheduleExecutionType, TaskStore, CreateTaskRequest, TaskItem, TaskListFilter, UpdateTaskRequest, TaskWorkItemStore, CreateWorkItemRequest, TaskWorkItem, TaskWorkItemListFilter } from '@axiom-lattice/protocols';
|
|
4
4
|
import { IMessageQueueStore, AddMessageParams, PendingMessage, ThreadInfo } from '@axiom-lattice/core';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -596,6 +596,17 @@ declare class LocalTaskStore implements TaskStore {
|
|
|
596
596
|
delete(tenantId: string, id: string): Promise<boolean>;
|
|
597
597
|
}
|
|
598
598
|
|
|
599
|
+
/**
|
|
600
|
+
* Local SQLite implementation of TaskWorkItemStore.
|
|
601
|
+
*/
|
|
602
|
+
|
|
603
|
+
declare class LocalTaskWorkItemStore implements TaskWorkItemStore {
|
|
604
|
+
private db;
|
|
605
|
+
constructor(db: DatabaseWrapper);
|
|
606
|
+
create(params: CreateWorkItemRequest): Promise<TaskWorkItem>;
|
|
607
|
+
list(filter: TaskWorkItemListFilter): Promise<TaskWorkItem[]>;
|
|
608
|
+
}
|
|
609
|
+
|
|
599
610
|
/**
|
|
600
611
|
* createLocalStoreConfig
|
|
601
612
|
*
|
|
@@ -650,7 +661,8 @@ declare function createLocalStoreConfig(options?: LocalStoreConfigOptions): Prom
|
|
|
650
661
|
skill: LocalSkillStore;
|
|
651
662
|
schedule: LocalScheduleStorage;
|
|
652
663
|
task: LocalTaskStore;
|
|
664
|
+
taskWorkItem: LocalTaskWorkItemStore;
|
|
653
665
|
checkpoint: SqliteSaver;
|
|
654
666
|
}>;
|
|
655
667
|
|
|
656
|
-
export { DatabaseWrapper, LocalA2AApiKeyStore, LocalAssistantStore, LocalChannelBindingStore, LocalChannelInstallationStore, LocalConnectionStore, LocalDatabaseConfigStore, LocalEvalStore, LocalMcpServerConfigStore, LocalMetricsServerConfigStore, LocalProjectStore, LocalScheduleStorage, LocalSkillStore, type LocalStoreConfigOptions, type LocalStoreOptions, LocalTaskStore, LocalTenantStore, LocalThreadMessageQueueStore, LocalThreadStore, LocalUserStore, LocalUserTenantLinkStore, LocalWorkflowTrackingStore, LocalWorkspaceStore, type Migration, MigrationManager, RunResult, StatementWrapper, closeDatabase, createLocalStoreConfig, ensureTable, getDatabase, initDatabase, nowISO, parseISO };
|
|
668
|
+
export { DatabaseWrapper, LocalA2AApiKeyStore, LocalAssistantStore, 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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SqlJsStatic, Database } from 'sql.js';
|
|
2
2
|
import { SqliteSaver } from '@langchain/langgraph-checkpoint-sqlite';
|
|
3
|
-
import { ThreadStore, Thread, CreateThreadRequest, AssistantStore, Assistant, CreateAssistantRequest, WorkspaceStore, Workspace, CreateWorkspaceRequest, UpdateWorkspaceRequest, ProjectStore, Project, CreateProjectRequest, UpdateProjectRequest, UserStore, User, CreateUserRequest, UpdateUserRequest, TenantStore, Tenant, CreateTenantRequest, UpdateTenantRequest, UserTenantLinkStore, UserTenantLink, CreateUserTenantLinkRequest, UpdateUserTenantLinkRequest, DatabaseConfigStore, DatabaseConfigEntry, CreateDatabaseConfigRequest, UpdateDatabaseConfigRequest, ConnectionStore, ConnectionEntry, MetricsServerConfigStore, MetricsServerConfigEntry, CreateMetricsServerConfigRequest, UpdateMetricsServerConfigRequest, McpServerConfigStore, McpServerConfigEntry, CreateMcpServerConfigRequest, UpdateMcpServerConfigRequest, WorkflowTrackingStore, CreateWorkflowRunRequest, WorkflowRun, UpdateWorkflowRunRequest, QueryWorkflowRunsOptions, QueryWorkflowRunsResult, CreateRunStepRequest, RunStep, UpdateRunStepRequest, StepType, EvalStore, EvalProject, CreateEvalProjectRequest, EvalSuite, CreateEvalSuiteRequest, EvalCase, CreateEvalCaseRequest, EvalRun, CreateEvalRunRequest, EvalRunResult, EvalProjectReport, BindingRegistry, Binding, CreateBindingInput, ChannelInstallationStore, ChannelInstallation, ChannelInstallationType, CreateChannelInstallationRequest, UpdateChannelInstallationRequest, A2AApiKeyStore, A2AApiKeyRecord, CreateA2AApiKeyInput, A2AApiKeyEntry, SkillStore, SkillStoreContext, Skill, CreateSkillRequest, ScheduleStorage, ScheduledTaskDefinition, ScheduledTaskStatus, ScheduleExecutionType, TaskStore, CreateTaskRequest, TaskItem, TaskListFilter, UpdateTaskRequest } from '@axiom-lattice/protocols';
|
|
3
|
+
import { ThreadStore, Thread, CreateThreadRequest, AssistantStore, Assistant, CreateAssistantRequest, WorkspaceStore, Workspace, CreateWorkspaceRequest, UpdateWorkspaceRequest, ProjectStore, Project, CreateProjectRequest, UpdateProjectRequest, UserStore, User, CreateUserRequest, UpdateUserRequest, TenantStore, Tenant, CreateTenantRequest, UpdateTenantRequest, UserTenantLinkStore, UserTenantLink, CreateUserTenantLinkRequest, UpdateUserTenantLinkRequest, DatabaseConfigStore, DatabaseConfigEntry, CreateDatabaseConfigRequest, UpdateDatabaseConfigRequest, ConnectionStore, ConnectionEntry, MetricsServerConfigStore, MetricsServerConfigEntry, CreateMetricsServerConfigRequest, UpdateMetricsServerConfigRequest, McpServerConfigStore, McpServerConfigEntry, CreateMcpServerConfigRequest, UpdateMcpServerConfigRequest, WorkflowTrackingStore, CreateWorkflowRunRequest, WorkflowRun, UpdateWorkflowRunRequest, QueryWorkflowRunsOptions, QueryWorkflowRunsResult, CreateRunStepRequest, RunStep, UpdateRunStepRequest, StepType, EvalStore, EvalProject, CreateEvalProjectRequest, EvalSuite, CreateEvalSuiteRequest, EvalCase, CreateEvalCaseRequest, EvalRun, CreateEvalRunRequest, EvalRunResult, EvalProjectReport, BindingRegistry, Binding, CreateBindingInput, ChannelInstallationStore, ChannelInstallation, ChannelInstallationType, CreateChannelInstallationRequest, UpdateChannelInstallationRequest, A2AApiKeyStore, A2AApiKeyRecord, CreateA2AApiKeyInput, A2AApiKeyEntry, SkillStore, SkillStoreContext, Skill, CreateSkillRequest, ScheduleStorage, ScheduledTaskDefinition, ScheduledTaskStatus, ScheduleExecutionType, TaskStore, CreateTaskRequest, TaskItem, TaskListFilter, UpdateTaskRequest, TaskWorkItemStore, CreateWorkItemRequest, TaskWorkItem, TaskWorkItemListFilter } from '@axiom-lattice/protocols';
|
|
4
4
|
import { IMessageQueueStore, AddMessageParams, PendingMessage, ThreadInfo } from '@axiom-lattice/core';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -596,6 +596,17 @@ declare class LocalTaskStore implements TaskStore {
|
|
|
596
596
|
delete(tenantId: string, id: string): Promise<boolean>;
|
|
597
597
|
}
|
|
598
598
|
|
|
599
|
+
/**
|
|
600
|
+
* Local SQLite implementation of TaskWorkItemStore.
|
|
601
|
+
*/
|
|
602
|
+
|
|
603
|
+
declare class LocalTaskWorkItemStore implements TaskWorkItemStore {
|
|
604
|
+
private db;
|
|
605
|
+
constructor(db: DatabaseWrapper);
|
|
606
|
+
create(params: CreateWorkItemRequest): Promise<TaskWorkItem>;
|
|
607
|
+
list(filter: TaskWorkItemListFilter): Promise<TaskWorkItem[]>;
|
|
608
|
+
}
|
|
609
|
+
|
|
599
610
|
/**
|
|
600
611
|
* createLocalStoreConfig
|
|
601
612
|
*
|
|
@@ -650,7 +661,8 @@ declare function createLocalStoreConfig(options?: LocalStoreConfigOptions): Prom
|
|
|
650
661
|
skill: LocalSkillStore;
|
|
651
662
|
schedule: LocalScheduleStorage;
|
|
652
663
|
task: LocalTaskStore;
|
|
664
|
+
taskWorkItem: LocalTaskWorkItemStore;
|
|
653
665
|
checkpoint: SqliteSaver;
|
|
654
666
|
}>;
|
|
655
667
|
|
|
656
|
-
export { DatabaseWrapper, LocalA2AApiKeyStore, LocalAssistantStore, LocalChannelBindingStore, LocalChannelInstallationStore, LocalConnectionStore, LocalDatabaseConfigStore, LocalEvalStore, LocalMcpServerConfigStore, LocalMetricsServerConfigStore, LocalProjectStore, LocalScheduleStorage, LocalSkillStore, type LocalStoreConfigOptions, type LocalStoreOptions, LocalTaskStore, LocalTenantStore, LocalThreadMessageQueueStore, LocalThreadStore, LocalUserStore, LocalUserTenantLinkStore, LocalWorkflowTrackingStore, LocalWorkspaceStore, type Migration, MigrationManager, RunResult, StatementWrapper, closeDatabase, createLocalStoreConfig, ensureTable, getDatabase, initDatabase, nowISO, parseISO };
|
|
668
|
+
export { DatabaseWrapper, LocalA2AApiKeyStore, LocalAssistantStore, 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 };
|
package/dist/index.js
CHANGED
|
@@ -44,6 +44,7 @@ __export(index_exports, {
|
|
|
44
44
|
LocalScheduleStorage: () => LocalScheduleStorage,
|
|
45
45
|
LocalSkillStore: () => LocalSkillStore,
|
|
46
46
|
LocalTaskStore: () => LocalTaskStore,
|
|
47
|
+
LocalTaskWorkItemStore: () => LocalTaskWorkItemStore,
|
|
47
48
|
LocalTenantStore: () => LocalTenantStore,
|
|
48
49
|
LocalThreadMessageQueueStore: () => LocalThreadMessageQueueStore,
|
|
49
50
|
LocalThreadStore: () => LocalThreadStore,
|
|
@@ -3634,6 +3635,12 @@ CREATE TABLE IF NOT EXISTS lt_tasks (
|
|
|
3634
3635
|
parent_id TEXT,
|
|
3635
3636
|
source_id TEXT,
|
|
3636
3637
|
context TEXT,
|
|
3638
|
+
require_review INTEGER DEFAULT 0,
|
|
3639
|
+
dependencies TEXT,
|
|
3640
|
+
result TEXT,
|
|
3641
|
+
failure_reason TEXT,
|
|
3642
|
+
workspace_id TEXT,
|
|
3643
|
+
project_id TEXT,
|
|
3637
3644
|
created_at TEXT NOT NULL,
|
|
3638
3645
|
updated_at TEXT NOT NULL,
|
|
3639
3646
|
PRIMARY KEY (tenant_id, id)
|
|
@@ -3654,6 +3661,12 @@ function mapRowToTask2(row) {
|
|
|
3654
3661
|
parentId: row.parent_id ?? void 0,
|
|
3655
3662
|
sourceId: row.source_id ?? void 0,
|
|
3656
3663
|
context: row.context ? JSON.parse(row.context) : void 0,
|
|
3664
|
+
requireReview: row.require_review === 1 ? true : row.require_review ? true : void 0,
|
|
3665
|
+
dependencies: row.dependencies ? JSON.parse(row.dependencies) : void 0,
|
|
3666
|
+
result: row.result || void 0,
|
|
3667
|
+
failureReason: row.failure_reason || void 0,
|
|
3668
|
+
workspaceId: row.workspace_id ?? void 0,
|
|
3669
|
+
projectId: row.project_id ?? void 0,
|
|
3657
3670
|
createdAt: parseISO(row.created_at),
|
|
3658
3671
|
updatedAt: parseISO(row.updated_at)
|
|
3659
3672
|
};
|
|
@@ -3662,13 +3675,19 @@ var LocalTaskStore = class {
|
|
|
3662
3675
|
constructor(db) {
|
|
3663
3676
|
this.db = db;
|
|
3664
3677
|
ensureTable(db, DDL20);
|
|
3678
|
+
this.db.exec(`ALTER TABLE lt_tasks ADD COLUMN require_review INTEGER DEFAULT 0;`);
|
|
3679
|
+
this.db.exec(`ALTER TABLE lt_tasks ADD COLUMN dependencies TEXT;`);
|
|
3680
|
+
this.db.exec(`ALTER TABLE lt_tasks ADD COLUMN result TEXT;`);
|
|
3681
|
+
this.db.exec(`ALTER TABLE lt_tasks ADD COLUMN failure_reason TEXT;`);
|
|
3682
|
+
this.db.exec(`ALTER TABLE lt_tasks ADD COLUMN workspace_id TEXT;`);
|
|
3683
|
+
this.db.exec(`ALTER TABLE lt_tasks ADD COLUMN project_id TEXT;`);
|
|
3665
3684
|
}
|
|
3666
3685
|
async create(params) {
|
|
3667
3686
|
const id = (0, import_crypto5.randomUUID)();
|
|
3668
3687
|
const now = nowISO();
|
|
3669
3688
|
this.db.prepare(
|
|
3670
|
-
`INSERT INTO lt_tasks (id, tenant_id, owner_type, owner_id, title, description, status, priority, due_date, metadata, parent_id, source_id, context, created_at, updated_at)
|
|
3671
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`
|
|
3689
|
+
`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, created_at, updated_at)
|
|
3690
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`
|
|
3672
3691
|
).run(
|
|
3673
3692
|
id,
|
|
3674
3693
|
params.tenantId,
|
|
@@ -3683,6 +3702,12 @@ var LocalTaskStore = class {
|
|
|
3683
3702
|
params.parentId || null,
|
|
3684
3703
|
params.sourceId || null,
|
|
3685
3704
|
params.context ? JSON.stringify(params.context) : null,
|
|
3705
|
+
params.requireReview ? 1 : 0,
|
|
3706
|
+
params.dependencies ? JSON.stringify(params.dependencies) : null,
|
|
3707
|
+
params.result || null,
|
|
3708
|
+
params.failureReason || null,
|
|
3709
|
+
params.workspaceId || null,
|
|
3710
|
+
params.projectId || null,
|
|
3686
3711
|
now,
|
|
3687
3712
|
now
|
|
3688
3713
|
);
|
|
@@ -3706,13 +3731,23 @@ var LocalTaskStore = class {
|
|
|
3706
3731
|
params.push(filter.ownerId);
|
|
3707
3732
|
}
|
|
3708
3733
|
if (filter.status) {
|
|
3709
|
-
|
|
3710
|
-
|
|
3734
|
+
const statuses = filter.status.split(",").map((s) => s.trim()).filter(Boolean);
|
|
3735
|
+
const placeholders = statuses.map(() => "?").join(", ");
|
|
3736
|
+
conditions.push(`status IN (${placeholders})`);
|
|
3737
|
+
params.push(...statuses);
|
|
3711
3738
|
}
|
|
3712
3739
|
if (filter.priority) {
|
|
3713
3740
|
conditions.push("priority = ?");
|
|
3714
3741
|
params.push(filter.priority);
|
|
3715
3742
|
}
|
|
3743
|
+
if (filter.workspaceId) {
|
|
3744
|
+
conditions.push("workspace_id = ?");
|
|
3745
|
+
params.push(filter.workspaceId);
|
|
3746
|
+
}
|
|
3747
|
+
if (filter.projectId) {
|
|
3748
|
+
conditions.push("project_id = ?");
|
|
3749
|
+
params.push(filter.projectId);
|
|
3750
|
+
}
|
|
3716
3751
|
if (filter.parentId) {
|
|
3717
3752
|
conditions.push("parent_id = ?");
|
|
3718
3753
|
params.push(filter.parentId);
|
|
@@ -3788,6 +3823,30 @@ var LocalTaskStore = class {
|
|
|
3788
3823
|
setClauses.push("owner_id = ?");
|
|
3789
3824
|
values.push(updates.ownerId);
|
|
3790
3825
|
}
|
|
3826
|
+
if (updates.requireReview !== void 0) {
|
|
3827
|
+
setClauses.push("require_review = ?");
|
|
3828
|
+
values.push(updates.requireReview ? 1 : 0);
|
|
3829
|
+
}
|
|
3830
|
+
if (updates.dependencies !== void 0) {
|
|
3831
|
+
setClauses.push("dependencies = ?");
|
|
3832
|
+
values.push(JSON.stringify(updates.dependencies));
|
|
3833
|
+
}
|
|
3834
|
+
if (updates.result !== void 0) {
|
|
3835
|
+
setClauses.push("result = ?");
|
|
3836
|
+
values.push(updates.result);
|
|
3837
|
+
}
|
|
3838
|
+
if (updates.failureReason !== void 0) {
|
|
3839
|
+
setClauses.push("failure_reason = ?");
|
|
3840
|
+
values.push(updates.failureReason);
|
|
3841
|
+
}
|
|
3842
|
+
if (updates.workspaceId !== void 0) {
|
|
3843
|
+
setClauses.push("workspace_id = ?");
|
|
3844
|
+
values.push(updates.workspaceId);
|
|
3845
|
+
}
|
|
3846
|
+
if (updates.projectId !== void 0) {
|
|
3847
|
+
setClauses.push("project_id = ?");
|
|
3848
|
+
values.push(updates.projectId);
|
|
3849
|
+
}
|
|
3791
3850
|
if (setClauses.length === 1) return existing;
|
|
3792
3851
|
values.push(tenantId, id);
|
|
3793
3852
|
this.db.prepare(
|
|
@@ -3803,6 +3862,90 @@ var LocalTaskStore = class {
|
|
|
3803
3862
|
}
|
|
3804
3863
|
};
|
|
3805
3864
|
|
|
3865
|
+
// src/stores/LocalTaskWorkItemStore.ts
|
|
3866
|
+
var import_uuid2 = require("uuid");
|
|
3867
|
+
var DDL21 = `
|
|
3868
|
+
CREATE TABLE IF NOT EXISTS lt_task_work_items (
|
|
3869
|
+
id TEXT NOT NULL,
|
|
3870
|
+
tenant_id TEXT NOT NULL,
|
|
3871
|
+
task_id TEXT NOT NULL,
|
|
3872
|
+
action TEXT NOT NULL,
|
|
3873
|
+
actor TEXT NOT NULL,
|
|
3874
|
+
thread_id TEXT,
|
|
3875
|
+
summary TEXT,
|
|
3876
|
+
detail TEXT,
|
|
3877
|
+
attempt INTEGER,
|
|
3878
|
+
workspace_id TEXT,
|
|
3879
|
+
project_id TEXT,
|
|
3880
|
+
created_at TEXT NOT NULL,
|
|
3881
|
+
PRIMARY KEY (tenant_id, id)
|
|
3882
|
+
);
|
|
3883
|
+
`;
|
|
3884
|
+
function mapRowToWorkItem(row) {
|
|
3885
|
+
return {
|
|
3886
|
+
id: row.id,
|
|
3887
|
+
tenantId: row.tenant_id,
|
|
3888
|
+
taskId: row.task_id,
|
|
3889
|
+
action: row.action,
|
|
3890
|
+
actor: row.actor,
|
|
3891
|
+
threadId: row.thread_id ?? void 0,
|
|
3892
|
+
summary: row.summary ?? void 0,
|
|
3893
|
+
detail: row.detail ? JSON.parse(row.detail) : void 0,
|
|
3894
|
+
attempt: row.attempt ?? void 0,
|
|
3895
|
+
workspaceId: row.workspace_id ?? void 0,
|
|
3896
|
+
projectId: row.project_id ?? void 0,
|
|
3897
|
+
createdAt: parseISO(row.created_at)
|
|
3898
|
+
};
|
|
3899
|
+
}
|
|
3900
|
+
var LocalTaskWorkItemStore = class {
|
|
3901
|
+
constructor(db) {
|
|
3902
|
+
this.db = db;
|
|
3903
|
+
ensureTable(db, DDL21);
|
|
3904
|
+
this.db.exec(`ALTER TABLE lt_task_work_items ADD COLUMN workspace_id TEXT;`);
|
|
3905
|
+
this.db.exec(`ALTER TABLE lt_task_work_items ADD COLUMN project_id TEXT;`);
|
|
3906
|
+
}
|
|
3907
|
+
async create(params) {
|
|
3908
|
+
const id = (0, import_uuid2.v4)();
|
|
3909
|
+
const now = nowISO();
|
|
3910
|
+
this.db.prepare(
|
|
3911
|
+
`INSERT INTO lt_task_work_items (id, tenant_id, task_id, action, actor, thread_id, summary, detail, attempt, workspace_id, project_id, created_at)
|
|
3912
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`
|
|
3913
|
+
).run(
|
|
3914
|
+
id,
|
|
3915
|
+
params.tenantId,
|
|
3916
|
+
params.taskId,
|
|
3917
|
+
params.action,
|
|
3918
|
+
params.actor,
|
|
3919
|
+
params.threadId || null,
|
|
3920
|
+
params.summary || null,
|
|
3921
|
+
params.detail ? JSON.stringify(params.detail) : null,
|
|
3922
|
+
params.attempt ?? null,
|
|
3923
|
+
params.workspaceId || null,
|
|
3924
|
+
params.projectId || null,
|
|
3925
|
+
now
|
|
3926
|
+
);
|
|
3927
|
+
const row = this.db.prepare(
|
|
3928
|
+
`SELECT * FROM lt_task_work_items WHERE tenant_id = ? AND id = ?`
|
|
3929
|
+
).get(params.tenantId, id);
|
|
3930
|
+
return mapRowToWorkItem(row);
|
|
3931
|
+
}
|
|
3932
|
+
async list(filter) {
|
|
3933
|
+
const conditions = ["tenant_id = ?", "task_id = ?"];
|
|
3934
|
+
const params = [filter.tenantId, filter.taskId];
|
|
3935
|
+
if (filter.action) {
|
|
3936
|
+
conditions.push("action = ?");
|
|
3937
|
+
params.push(filter.action);
|
|
3938
|
+
}
|
|
3939
|
+
const where = conditions.join(" AND ");
|
|
3940
|
+
const limit = filter.limit || 100;
|
|
3941
|
+
const offset = filter.offset || 0;
|
|
3942
|
+
const rows = this.db.prepare(
|
|
3943
|
+
`SELECT * FROM lt_task_work_items WHERE ${where} ORDER BY created_at DESC LIMIT ? OFFSET ?`
|
|
3944
|
+
).all(...params, limit, offset);
|
|
3945
|
+
return rows.map(mapRowToWorkItem);
|
|
3946
|
+
}
|
|
3947
|
+
};
|
|
3948
|
+
|
|
3806
3949
|
// src/createLocalStoreConfig.ts
|
|
3807
3950
|
async function createLocalStoreConfig(options = {}) {
|
|
3808
3951
|
const dbPath = options.dbPath || "~/.axiom/lattice.db";
|
|
@@ -3828,6 +3971,7 @@ async function createLocalStoreConfig(options = {}) {
|
|
|
3828
3971
|
skill: new LocalSkillStore(db),
|
|
3829
3972
|
schedule: new LocalScheduleStorage(db),
|
|
3830
3973
|
task: new LocalTaskStore(db),
|
|
3974
|
+
taskWorkItem: new LocalTaskWorkItemStore(db),
|
|
3831
3975
|
checkpoint: import_langgraph_checkpoint_sqlite.SqliteSaver.fromConnString(dbPath)
|
|
3832
3976
|
};
|
|
3833
3977
|
}
|
|
@@ -3847,6 +3991,7 @@ async function createLocalStoreConfig(options = {}) {
|
|
|
3847
3991
|
LocalScheduleStorage,
|
|
3848
3992
|
LocalSkillStore,
|
|
3849
3993
|
LocalTaskStore,
|
|
3994
|
+
LocalTaskWorkItemStore,
|
|
3850
3995
|
LocalTenantStore,
|
|
3851
3996
|
LocalThreadMessageQueueStore,
|
|
3852
3997
|
LocalThreadStore,
|