zen-code 3.0.2 → 3.0.4
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/dist/app-D748EsP_.mjs +18686 -0
- package/dist/{checkpoint-1sAx_j1E-DNrygV7Q.mjs → checkpoint-1sAx_j1E-DddugKQb.mjs} +2 -2
- package/dist/{checkpoint-DxiUsHMy-DHFvv2Vn.mjs → checkpoint-DxiUsHMy-B5V5-cLZ.mjs} +2 -2
- package/dist/{graphBuilder-BIhxVliV.mjs → graphBuilder-B6OHvcgJ.mjs} +33572 -16137
- package/dist/{id-DSgIWJsu.mjs → id-BclYO3iE.mjs} +1 -1
- package/dist/index-BG-c4_r3.mjs +449 -0
- package/dist/{index-betxkqLW.mjs → index-CnZgr5T4.mjs} +3 -3
- package/dist/nonInteractive.mjs +2 -2
- package/dist/{queue-D6tEGCGs-DyRh7Gp2.mjs → queue-D6tEGCGs-dM7Qa7Il.mjs} +1 -1
- package/dist/{shallow-in1-XXeE.mjs → shallow-VHsFXFdT.mjs} +3 -3
- package/dist/{tasks-D9VxaG3A.mjs → tasks-Clf8LhHz.mjs} +5 -4
- package/dist/zen-code.mjs +1 -1
- package/dist/zen-init.mjs +1 -1
- package/package.json +2 -1
- package/dist/app-DRVd6cDQ.mjs +0 -11749
- package/dist/index-P-c4tqBO.mjs +0 -194
package/dist/index-P-c4tqBO.mjs
DELETED
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
import "lowdb";
|
|
2
|
-
import "lowdb/node";
|
|
3
|
-
import "yaml";
|
|
4
|
-
import { z as i } from "zod";
|
|
5
|
-
class d {
|
|
6
|
-
configStore;
|
|
7
|
-
skillStore;
|
|
8
|
-
pluginStore;
|
|
9
|
-
remoteStore;
|
|
10
|
-
_initialized = !1;
|
|
11
|
-
constructor(t, e, r, o) {
|
|
12
|
-
this.configStore = t, this.skillStore = e, this.pluginStore = r, this.remoteStore = o;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* 初始化管理器(延迟初始化)
|
|
16
|
-
* 必须在使用其他方法前调用
|
|
17
|
-
*/
|
|
18
|
-
async initialize() {
|
|
19
|
-
this._initialized || ("initialize" in this.configStore && typeof this.configStore.initialize == "function" && await this.configStore.initialize(), "initialize" in this.skillStore && typeof this.skillStore.initialize == "function" && await this.skillStore.initialize(), "initialize" in this.pluginStore && typeof this.pluginStore.initialize == "function" && await this.pluginStore.initialize(), this._initialized = !0);
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* 确保已初始化(内部使用)
|
|
23
|
-
*/
|
|
24
|
-
async ensureInitialized() {
|
|
25
|
-
if (!this._initialized)
|
|
26
|
-
throw new Error("ConfigManager not initialized. Call await manager.initialize() first.");
|
|
27
|
-
}
|
|
28
|
-
// 配置相关
|
|
29
|
-
async getConfig() {
|
|
30
|
-
return await this.ensureInitialized(), await this.configStore.getConfig();
|
|
31
|
-
}
|
|
32
|
-
async updateConfig(t) {
|
|
33
|
-
return await this.ensureInitialized(), await this.configStore.updateConfig(t);
|
|
34
|
-
}
|
|
35
|
-
// Skills 相关
|
|
36
|
-
async listSkills() {
|
|
37
|
-
return await this.ensureInitialized(), await this.skillStore.listSkills();
|
|
38
|
-
}
|
|
39
|
-
async getSkill(t) {
|
|
40
|
-
return await this.ensureInitialized(), await this.skillStore.getSkill(t);
|
|
41
|
-
}
|
|
42
|
-
async saveSkill(t, e) {
|
|
43
|
-
return await this.ensureInitialized(), await this.skillStore.saveSkill(t, e);
|
|
44
|
-
}
|
|
45
|
-
async deleteSkill(t) {
|
|
46
|
-
return await this.ensureInitialized(), await this.skillStore.deleteSkill(t);
|
|
47
|
-
}
|
|
48
|
-
async syncSkillsFromRemote() {
|
|
49
|
-
if (await this.ensureInitialized(), !this.remoteStore)
|
|
50
|
-
throw new Error("Remote store not configured");
|
|
51
|
-
return await this.skillStore.syncFromRemote(this.remoteStore);
|
|
52
|
-
}
|
|
53
|
-
// Plugins 相关
|
|
54
|
-
async listPlugins() {
|
|
55
|
-
return await this.ensureInitialized(), await this.pluginStore.listPlugins();
|
|
56
|
-
}
|
|
57
|
-
async getPluginConfig(t) {
|
|
58
|
-
return await this.ensureInitialized(), await this.pluginStore.getPluginConfig(t);
|
|
59
|
-
}
|
|
60
|
-
async updatePluginConfig(t, e) {
|
|
61
|
-
return await this.ensureInitialized(), await this.pluginStore.updatePluginConfig(t, e);
|
|
62
|
-
}
|
|
63
|
-
async installPlugin(t, e) {
|
|
64
|
-
return await this.ensureInitialized(), await this.pluginStore.installPlugin(t, e);
|
|
65
|
-
}
|
|
66
|
-
async uninstallPlugin(t) {
|
|
67
|
-
return await this.ensureInitialized(), await this.pluginStore.uninstallPlugin(t);
|
|
68
|
-
}
|
|
69
|
-
/** fs 专用 */
|
|
70
|
-
getConfigPath() {
|
|
71
|
-
return this.configStore?.dbPath;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
async function p() {
|
|
75
|
-
const { FileSystemConfigStore: n } = await import("./FileSystemConfigStore-Bog5vylu.mjs"), { FileSystemSkillStore: t } = await import("./FileSystemSkillStore-yvEvcRxB.mjs"), { FileSystemPluginStore: e } = await import("./FileSystemPluginStore-ChortK7z.mjs"), r = new n(), o = new t(), g = new e(), l = new d(r, o, g);
|
|
76
|
-
return await l.initialize(), l;
|
|
77
|
-
}
|
|
78
|
-
const m = i.enum(["idea", "bug_report", "feature", "refactor"]), S = i.enum(["low", "medium", "high", "critical"]), h = i.enum(["pending", "planned", "archived"]), f = i.enum(["user_input", "ai_suggestion", "conversation_derived"]), y = i.object({
|
|
79
|
-
id: i.string().uuid(),
|
|
80
|
-
type: m,
|
|
81
|
-
title: i.string().min(1).max(200),
|
|
82
|
-
description: i.string(),
|
|
83
|
-
priority: S.default("medium"),
|
|
84
|
-
source: f,
|
|
85
|
-
status: h.default("pending"),
|
|
86
|
-
createdAt: i.string().datetime(),
|
|
87
|
-
tags: i.array(i.string()).default([]),
|
|
88
|
-
metadata: i.object({
|
|
89
|
-
relatedFiles: i.array(i.string()).optional(),
|
|
90
|
-
conversationContext: i.string().optional(),
|
|
91
|
-
estimatedComplexity: i.enum(["simple", "medium", "complex"]).optional()
|
|
92
|
-
}).optional()
|
|
93
|
-
});
|
|
94
|
-
i.object({
|
|
95
|
-
version: i.literal("1.0"),
|
|
96
|
-
sparks: i.array(y),
|
|
97
|
-
lastUpdated: i.string().datetime()
|
|
98
|
-
});
|
|
99
|
-
const u = i.enum([
|
|
100
|
-
"pickup",
|
|
101
|
-
// 待领取(新任务,未被 agent 接管)
|
|
102
|
-
"running",
|
|
103
|
-
// 运行中(agent 正在执行)
|
|
104
|
-
"complete",
|
|
105
|
-
// 已完成(成功完成)
|
|
106
|
-
"error",
|
|
107
|
-
// 已失败(失败,暂停中)
|
|
108
|
-
"review",
|
|
109
|
-
// 待审核(完成,等待人工确认)
|
|
110
|
-
"feedback"
|
|
111
|
-
// 待反馈(agent 卡住,需要人工输入)
|
|
112
|
-
]), s = i.enum([
|
|
113
|
-
"default",
|
|
114
|
-
"planner",
|
|
115
|
-
"reviewer",
|
|
116
|
-
"refactor",
|
|
117
|
-
"finder",
|
|
118
|
-
"debugger"
|
|
119
|
-
]), w = i.enum(["serial", "parallel"]), c = i.lazy(
|
|
120
|
-
() => i.object({
|
|
121
|
-
// 基本信息
|
|
122
|
-
id: i.string(),
|
|
123
|
-
title: i.string().min(1).max(200),
|
|
124
|
-
description: i.string(),
|
|
125
|
-
// 执行控制
|
|
126
|
-
execution: w.optional(),
|
|
127
|
-
children: i.array(i.lazy(() => c)).optional(),
|
|
128
|
-
// Agent 分配
|
|
129
|
-
agentType: s.optional(),
|
|
130
|
-
threadId: i.string().optional(),
|
|
131
|
-
// 元数据
|
|
132
|
-
estimatedTime: i.string().optional(),
|
|
133
|
-
complexity: i.enum(["simple", "medium", "complex"]).optional(),
|
|
134
|
-
dependencies: i.array(i.string()).optional(),
|
|
135
|
-
acceptanceCriteria: i.array(i.string()).optional(),
|
|
136
|
-
// 状态相关(运行时)
|
|
137
|
-
status: u.optional(),
|
|
138
|
-
startedAt: i.string().datetime().optional(),
|
|
139
|
-
completedAt: i.string().datetime().optional(),
|
|
140
|
-
assignedTo: s.optional(),
|
|
141
|
-
error: i.object({
|
|
142
|
-
message: i.string(),
|
|
143
|
-
stack: i.string().optional(),
|
|
144
|
-
retryCount: i.number().optional()
|
|
145
|
-
}).optional()
|
|
146
|
-
})
|
|
147
|
-
), k = i.object({
|
|
148
|
-
taskId: i.string(),
|
|
149
|
-
planId: i.string(),
|
|
150
|
-
threadId: i.string(),
|
|
151
|
-
// 关联的 LangGraph thread ID
|
|
152
|
-
agentType: s,
|
|
153
|
-
// 改为类型安全的 AgentType
|
|
154
|
-
status: u,
|
|
155
|
-
startedAt: i.string().datetime(),
|
|
156
|
-
completedAt: i.string().datetime().optional(),
|
|
157
|
-
output: i.string().optional(),
|
|
158
|
-
error: i.string().optional(),
|
|
159
|
-
changedFiles: i.array(i.string()).optional()
|
|
160
|
-
});
|
|
161
|
-
i.object({
|
|
162
|
-
version: i.literal("1.0"),
|
|
163
|
-
lastUpdated: i.string().datetime(),
|
|
164
|
-
// 活跃的任务树
|
|
165
|
-
activePlanId: i.string().optional(),
|
|
166
|
-
tasks: i.record(i.string(), c),
|
|
167
|
-
// 执行历史
|
|
168
|
-
history: i.array(k),
|
|
169
|
-
// 全局配置
|
|
170
|
-
config: i.object({
|
|
171
|
-
maxConcurrentAgents: i.number().min(1).max(10).default(3),
|
|
172
|
-
retryLimit: i.number().min(0).max(10).default(3),
|
|
173
|
-
autoResume: i.boolean().default(!1)
|
|
174
|
-
})
|
|
175
|
-
});
|
|
176
|
-
const a = await p(), z = async () => {
|
|
177
|
-
await a.initialize();
|
|
178
|
-
}, C = async () => await a.getConfig(), b = async (n) => {
|
|
179
|
-
await a.updateConfig(n);
|
|
180
|
-
}, T = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
181
|
-
__proto__: null,
|
|
182
|
-
configStore: a,
|
|
183
|
-
getConfig: C,
|
|
184
|
-
initDb: z,
|
|
185
|
-
updateConfig: b
|
|
186
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
187
|
-
export {
|
|
188
|
-
c as T,
|
|
189
|
-
T as a,
|
|
190
|
-
a as c,
|
|
191
|
-
C as g,
|
|
192
|
-
z as i,
|
|
193
|
-
b as u
|
|
194
|
-
};
|