@axiom-lattice/local-stores 1.0.21 → 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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @axiom-lattice/local-stores@1.0.21 build /home/runner/work/agentic/agentic/packages/local-stores
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
  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
- ESM dist/index.mjs 120.87 KB
12
- ESM dist/index.mjs.map 229.59 KB
13
- ESM ⚡️ Build success in 323ms
14
- CJS dist/index.js 124.21 KB
15
- CJS dist/index.js.map 232.26 KB
16
- CJS ⚡️ Build success in 350ms
11
+ CJS dist/index.js 129.70 KB
12
+ CJS dist/index.js.map 242.22 KB
13
+ CJS ⚡️ Build success in 474ms
14
+ ESM dist/index.mjs 126.29 KB
15
+ ESM dist/index.mjs.map 239.46 KB
16
+ ESM ⚡️ Build success in 475ms
17
17
  DTS Build start
18
- DTS ⚡️ Build success in 13776ms
19
- DTS dist/index.d.ts 27.83 KB
20
- DTS dist/index.d.mts 27.83 KB
18
+ DTS ⚡️ Build success in 14405ms
19
+ DTS dist/index.d.ts 28.41 KB
20
+ DTS dist/index.d.mts 28.41 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,29 @@
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
+
20
+ ## 1.0.22
21
+
22
+ ### Patch Changes
23
+
24
+ - Updated dependencies [2feab5c]
25
+ - @axiom-lattice/core@2.1.100
26
+
3
27
  ## 1.0.21
4
28
 
5
29
  ### 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
  /**
@@ -315,6 +315,7 @@ declare class LocalDatabaseConfigStore implements DatabaseConfigStore {
315
315
  declare class LocalConnectionStore implements ConnectionStore {
316
316
  private db;
317
317
  constructor(db: DatabaseWrapper);
318
+ listByTenant(tenantId: string): Promise<ConnectionEntry[]>;
318
319
  listByType(tenantId: string, type: string): Promise<ConnectionEntry[]>;
319
320
  getByKey(tenantId: string, type: string, key: string): Promise<ConnectionEntry | null>;
320
321
  create(entry: Omit<ConnectionEntry, "id" | "createdAt" | "updatedAt">): Promise<ConnectionEntry>;
@@ -422,6 +423,7 @@ declare class LocalEvalStore implements EvalStore {
422
423
  private getRunResultById;
423
424
  createRunResult(tenantId: string, runId: string, id: string, data: Omit<EvalRunResult, "id" | "runId" | "createdAt">): Promise<EvalRunResult>;
424
425
  updateRunResult(tenantId: string, id: string, updates: Partial<EvalRunResult>): Promise<EvalRunResult | null>;
426
+ deleteRunResult(tenantId: string, id: string): Promise<boolean>;
425
427
  getProjectReport(tenantId: string, projectId: string): Promise<EvalProjectReport | null>;
426
428
  private mapRowToProject;
427
429
  private mapRowToSuite;
@@ -594,6 +596,17 @@ declare class LocalTaskStore implements TaskStore {
594
596
  delete(tenantId: string, id: string): Promise<boolean>;
595
597
  }
596
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
+
597
610
  /**
598
611
  * createLocalStoreConfig
599
612
  *
@@ -648,7 +661,8 @@ declare function createLocalStoreConfig(options?: LocalStoreConfigOptions): Prom
648
661
  skill: LocalSkillStore;
649
662
  schedule: LocalScheduleStorage;
650
663
  task: LocalTaskStore;
664
+ taskWorkItem: LocalTaskWorkItemStore;
651
665
  checkpoint: SqliteSaver;
652
666
  }>;
653
667
 
654
- 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
  /**
@@ -315,6 +315,7 @@ declare class LocalDatabaseConfigStore implements DatabaseConfigStore {
315
315
  declare class LocalConnectionStore implements ConnectionStore {
316
316
  private db;
317
317
  constructor(db: DatabaseWrapper);
318
+ listByTenant(tenantId: string): Promise<ConnectionEntry[]>;
318
319
  listByType(tenantId: string, type: string): Promise<ConnectionEntry[]>;
319
320
  getByKey(tenantId: string, type: string, key: string): Promise<ConnectionEntry | null>;
320
321
  create(entry: Omit<ConnectionEntry, "id" | "createdAt" | "updatedAt">): Promise<ConnectionEntry>;
@@ -422,6 +423,7 @@ declare class LocalEvalStore implements EvalStore {
422
423
  private getRunResultById;
423
424
  createRunResult(tenantId: string, runId: string, id: string, data: Omit<EvalRunResult, "id" | "runId" | "createdAt">): Promise<EvalRunResult>;
424
425
  updateRunResult(tenantId: string, id: string, updates: Partial<EvalRunResult>): Promise<EvalRunResult | null>;
426
+ deleteRunResult(tenantId: string, id: string): Promise<boolean>;
425
427
  getProjectReport(tenantId: string, projectId: string): Promise<EvalProjectReport | null>;
426
428
  private mapRowToProject;
427
429
  private mapRowToSuite;
@@ -594,6 +596,17 @@ declare class LocalTaskStore implements TaskStore {
594
596
  delete(tenantId: string, id: string): Promise<boolean>;
595
597
  }
596
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
+
597
610
  /**
598
611
  * createLocalStoreConfig
599
612
  *
@@ -648,7 +661,8 @@ declare function createLocalStoreConfig(options?: LocalStoreConfigOptions): Prom
648
661
  skill: LocalSkillStore;
649
662
  schedule: LocalScheduleStorage;
650
663
  task: LocalTaskStore;
664
+ taskWorkItem: LocalTaskWorkItemStore;
651
665
  checkpoint: SqliteSaver;
652
666
  }>;
653
667
 
654
- 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,
@@ -1222,6 +1223,12 @@ var LocalConnectionStore = class {
1222
1223
  this.db = db;
1223
1224
  ensureTable(db, DDL9);
1224
1225
  }
1226
+ async listByTenant(tenantId) {
1227
+ const rows = this.db.prepare(
1228
+ `SELECT * FROM connection_configs WHERE tenant_id = ? ORDER BY created_at`
1229
+ ).all(tenantId);
1230
+ return rows.map((r) => this.mapRow(r));
1231
+ }
1225
1232
  async listByType(tenantId, type) {
1226
1233
  const rows = this.db.prepare(
1227
1234
  `SELECT * FROM connection_configs WHERE tenant_id = ? AND type = ? ORDER BY created_at`
@@ -2413,6 +2420,13 @@ var LocalEvalStore = class {
2413
2420
  ).run(...vals);
2414
2421
  return this.getRunResultById(tenantId, id);
2415
2422
  }
2423
+ async deleteRunResult(tenantId, id) {
2424
+ const result = this.db.prepare(
2425
+ `DELETE FROM lt_eval_run_results
2426
+ WHERE id = ? AND run_id IN (SELECT id FROM lt_eval_runs WHERE tenant_id = ?)`
2427
+ ).run(id, tenantId);
2428
+ return result.changes > 0;
2429
+ }
2416
2430
  // -------------------------------------------------------------------------
2417
2431
  // Reports
2418
2432
  // -------------------------------------------------------------------------
@@ -3621,6 +3635,12 @@ CREATE TABLE IF NOT EXISTS lt_tasks (
3621
3635
  parent_id TEXT,
3622
3636
  source_id TEXT,
3623
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,
3624
3644
  created_at TEXT NOT NULL,
3625
3645
  updated_at TEXT NOT NULL,
3626
3646
  PRIMARY KEY (tenant_id, id)
@@ -3641,6 +3661,12 @@ function mapRowToTask2(row) {
3641
3661
  parentId: row.parent_id ?? void 0,
3642
3662
  sourceId: row.source_id ?? void 0,
3643
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,
3644
3670
  createdAt: parseISO(row.created_at),
3645
3671
  updatedAt: parseISO(row.updated_at)
3646
3672
  };
@@ -3649,13 +3675,19 @@ var LocalTaskStore = class {
3649
3675
  constructor(db) {
3650
3676
  this.db = db;
3651
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;`);
3652
3684
  }
3653
3685
  async create(params) {
3654
3686
  const id = (0, import_crypto5.randomUUID)();
3655
3687
  const now = nowISO();
3656
3688
  this.db.prepare(
3657
- `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)
3658
- 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 (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`
3659
3691
  ).run(
3660
3692
  id,
3661
3693
  params.tenantId,
@@ -3670,6 +3702,12 @@ var LocalTaskStore = class {
3670
3702
  params.parentId || null,
3671
3703
  params.sourceId || null,
3672
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,
3673
3711
  now,
3674
3712
  now
3675
3713
  );
@@ -3693,13 +3731,23 @@ var LocalTaskStore = class {
3693
3731
  params.push(filter.ownerId);
3694
3732
  }
3695
3733
  if (filter.status) {
3696
- conditions.push("status = ?");
3697
- params.push(filter.status);
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);
3698
3738
  }
3699
3739
  if (filter.priority) {
3700
3740
  conditions.push("priority = ?");
3701
3741
  params.push(filter.priority);
3702
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
+ }
3703
3751
  if (filter.parentId) {
3704
3752
  conditions.push("parent_id = ?");
3705
3753
  params.push(filter.parentId);
@@ -3775,6 +3823,30 @@ var LocalTaskStore = class {
3775
3823
  setClauses.push("owner_id = ?");
3776
3824
  values.push(updates.ownerId);
3777
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
+ }
3778
3850
  if (setClauses.length === 1) return existing;
3779
3851
  values.push(tenantId, id);
3780
3852
  this.db.prepare(
@@ -3790,6 +3862,90 @@ var LocalTaskStore = class {
3790
3862
  }
3791
3863
  };
3792
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
+
3793
3949
  // src/createLocalStoreConfig.ts
3794
3950
  async function createLocalStoreConfig(options = {}) {
3795
3951
  const dbPath = options.dbPath || "~/.axiom/lattice.db";
@@ -3815,6 +3971,7 @@ async function createLocalStoreConfig(options = {}) {
3815
3971
  skill: new LocalSkillStore(db),
3816
3972
  schedule: new LocalScheduleStorage(db),
3817
3973
  task: new LocalTaskStore(db),
3974
+ taskWorkItem: new LocalTaskWorkItemStore(db),
3818
3975
  checkpoint: import_langgraph_checkpoint_sqlite.SqliteSaver.fromConnString(dbPath)
3819
3976
  };
3820
3977
  }
@@ -3834,6 +3991,7 @@ async function createLocalStoreConfig(options = {}) {
3834
3991
  LocalScheduleStorage,
3835
3992
  LocalSkillStore,
3836
3993
  LocalTaskStore,
3994
+ LocalTaskWorkItemStore,
3837
3995
  LocalTenantStore,
3838
3996
  LocalThreadMessageQueueStore,
3839
3997
  LocalThreadStore,