zen-code 3.0.5 → 4.1.0

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,113 +0,0 @@
1
- import "micromatch";
2
- import "./client-D-FCM8pg.mjs";
3
- import "lowdb";
4
- import "lowdb/node";
5
- import "yaml";
6
- import { T as a } from "./graphBuilder-DGVR99NP.mjs";
7
- class r {
8
- store = null;
9
- projectRoot;
10
- constructor(t) {
11
- this.projectRoot = t;
12
- }
13
- /**
14
- * 初始化 Store
15
- */
16
- async initialize() {
17
- this.store || (this.store = new a(this.projectRoot), await this.store.initialize());
18
- }
19
- /**
20
- * 确保 Store 已初始化
21
- */
22
- ensureInitialized() {
23
- if (!this.store)
24
- throw new Error("TasksStore not initialized. Call initialize() first.");
25
- }
26
- /**
27
- * 获取所有任务
28
- */
29
- async getAllTasks() {
30
- return this.ensureInitialized(), await this.store.getAllTasks();
31
- }
32
- /**
33
- * 根据 status 获取任务
34
- */
35
- async getTasksByStatus(t) {
36
- return this.ensureInitialized(), await this.store.getTasksByStatus(t);
37
- }
38
- /**
39
- * 获取单个任务
40
- */
41
- async getTask(t) {
42
- return this.ensureInitialized(), await this.store.getTask(t);
43
- }
44
- /**
45
- * 更新任务状态
46
- */
47
- async updateTaskStatus(t, e) {
48
- return this.ensureInitialized(), await this.store.updateTask(t, { status: e });
49
- }
50
- /**
51
- * 删除任务
52
- */
53
- async deleteTask(t) {
54
- return this.ensureInitialized(), await this.store.deleteTask(t);
55
- }
56
- /**
57
- * 批量添加任务
58
- */
59
- async addTasks(t) {
60
- this.ensureInitialized(), await this.store.addTasks(t);
61
- }
62
- /**
63
- * 获取活跃 Plan ID
64
- */
65
- async getActivePlan() {
66
- return this.ensureInitialized(), await this.store.getActivePlan();
67
- }
68
- /**
69
- * 设置活跃 Plan ID
70
- */
71
- async setActivePlan(t) {
72
- this.ensureInitialized(), await this.store.setActivePlan(t);
73
- }
74
- /**
75
- * 获取任务统计
76
- */
77
- async getTaskStats() {
78
- const t = await this.getAllTasks();
79
- return {
80
- total: t.length,
81
- pickup: t.filter((e) => e.status === "pickup").length,
82
- running: t.filter((e) => e.status === "running").length,
83
- complete: t.filter((e) => e.status === "complete").length,
84
- error: t.filter((e) => e.status === "error").length,
85
- review: t.filter((e) => e.status === "review").length,
86
- feedback: t.filter((e) => e.status === "feedback").length
87
- };
88
- }
89
- /**
90
- * 获取执行历史
91
- */
92
- async getHistory(t) {
93
- return this.ensureInitialized(), await this.store.getHistory(t);
94
- }
95
- /**
96
- * 清空所有任务(慎用)
97
- */
98
- async clearAllTasks() {
99
- this.ensureInitialized(), await this.store.clearAllTasks();
100
- }
101
- }
102
- let i = null;
103
- function k(s) {
104
- if (!i) {
105
- if (!s)
106
- throw new Error("projectRoot is required for first initialization");
107
- i = new r(s);
108
- }
109
- return i;
110
- }
111
- export {
112
- k as getTasksStore
113
- };