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
|
@@ -0,0 +1,449 @@
|
|
|
1
|
+
import f from "micromatch";
|
|
2
|
+
import { z as i } from "zod";
|
|
3
|
+
import "lowdb";
|
|
4
|
+
import "lowdb/node";
|
|
5
|
+
import "yaml";
|
|
6
|
+
var o = /* @__PURE__ */ ((s) => (s.ALLOW = "allow", s.ASK = "ask", s.DENY = "deny", s))(o || {});
|
|
7
|
+
i.object({
|
|
8
|
+
tool: i.string(),
|
|
9
|
+
specifier: i.string().optional(),
|
|
10
|
+
action: i.nativeEnum(o)
|
|
11
|
+
});
|
|
12
|
+
i.object({
|
|
13
|
+
allow: i.array(i.string()).optional(),
|
|
14
|
+
ask: i.array(i.string()).optional(),
|
|
15
|
+
deny: i.array(i.string()).optional(),
|
|
16
|
+
defaultMode: i.nativeEnum(o).optional()
|
|
17
|
+
});
|
|
18
|
+
i.object({
|
|
19
|
+
name: i.string(),
|
|
20
|
+
args: i.record(i.string(), i.any())
|
|
21
|
+
});
|
|
22
|
+
class u {
|
|
23
|
+
rules;
|
|
24
|
+
defaultMode;
|
|
25
|
+
patternCache = /* @__PURE__ */ new Map();
|
|
26
|
+
constructor(t) {
|
|
27
|
+
this.rules = t.rules, this.defaultMode = t.defaultMode || o.ASK, this.rules.sort((e, a) => {
|
|
28
|
+
const n = { deny: 0, ask: 1, allow: 2 }, r = n[e.action] - n[a.action];
|
|
29
|
+
if (r !== 0)
|
|
30
|
+
return r;
|
|
31
|
+
const l = e.specifier == null ? 1 : 0, h = a.specifier == null ? 1 : 0;
|
|
32
|
+
return l - h;
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Check if a tool call is permitted
|
|
37
|
+
*/
|
|
38
|
+
checkPermission(t) {
|
|
39
|
+
for (const e of this.rules)
|
|
40
|
+
if (this.matchRule(e, t))
|
|
41
|
+
return {
|
|
42
|
+
allowed: e.action === "allow" || e.action === "ask",
|
|
43
|
+
requiresApproval: e.action === "ask",
|
|
44
|
+
matchedRule: e,
|
|
45
|
+
reason: this.getReason(e)
|
|
46
|
+
};
|
|
47
|
+
return {
|
|
48
|
+
allowed: this.defaultMode === "allow" || this.defaultMode === "ask",
|
|
49
|
+
requiresApproval: this.defaultMode === "ask",
|
|
50
|
+
reason: `No matching rule, using default mode: ${this.defaultMode}`
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Check if a rule matches a tool call
|
|
55
|
+
*/
|
|
56
|
+
matchRule(t, e) {
|
|
57
|
+
if (t.tool !== e.name)
|
|
58
|
+
return !1;
|
|
59
|
+
if (!t.specifier)
|
|
60
|
+
return !0;
|
|
61
|
+
const a = this.argsToString(e.args);
|
|
62
|
+
return e.name === "Bash" ? this.matchBashCommand(t.specifier, a) : t.specifier.endsWith(" ") && !/[*?[\\]/.test(t.specifier) ? a.startsWith(t.specifier) : this.matchGlob(t.specifier, a);
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Match Bash commands with shell operator awareness
|
|
66
|
+
*/
|
|
67
|
+
matchBashCommand(t, e) {
|
|
68
|
+
if (/[;&|]/.test(e))
|
|
69
|
+
return !1;
|
|
70
|
+
const n = /[<>()]/;
|
|
71
|
+
if (n.test(e)) {
|
|
72
|
+
const r = e.split(n)[0].trim();
|
|
73
|
+
return this.matchBashPattern(t, r);
|
|
74
|
+
}
|
|
75
|
+
return this.matchBashPattern(t, e);
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Match Bash command patterns with support for prefix and glob matching
|
|
79
|
+
*/
|
|
80
|
+
matchBashPattern(t, e) {
|
|
81
|
+
return t.endsWith(" ") ? e.startsWith(t) : this.matchGlob(t, e);
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Glob pattern matching using micromatch with caching
|
|
85
|
+
*/
|
|
86
|
+
matchGlob(t, e) {
|
|
87
|
+
try {
|
|
88
|
+
const a = t.replace(/^\.\//, ""), n = e.replace(/^\.\//, ""), r = `${t}::${e}`, l = this.patternCache.get(r);
|
|
89
|
+
if (l !== void 0)
|
|
90
|
+
return l;
|
|
91
|
+
const h = f.isMatch(n, a, {
|
|
92
|
+
nocase: !1,
|
|
93
|
+
dot: !0
|
|
94
|
+
});
|
|
95
|
+
return this.cacheResult(r, h), h;
|
|
96
|
+
} catch {
|
|
97
|
+
return e === t;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Cache matching result with LRU-style size limit
|
|
102
|
+
*/
|
|
103
|
+
cacheResult(t, e) {
|
|
104
|
+
if (this.patternCache.size > 1e3) {
|
|
105
|
+
const a = this.patternCache.keys().next().value;
|
|
106
|
+
a && this.patternCache.delete(a);
|
|
107
|
+
}
|
|
108
|
+
this.patternCache.set(t, e);
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Convert tool arguments to string representation
|
|
112
|
+
*/
|
|
113
|
+
argsToString(t) {
|
|
114
|
+
return typeof t == "object" && t !== null ? "command" in t && t.command ? String(t.command) : "file_path" in t && t.file_path ? String(t.file_path) : Object.values(t).flat().join(" ") : String(t);
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Get human-readable reason for permission decision
|
|
118
|
+
*/
|
|
119
|
+
getReason(t) {
|
|
120
|
+
const e = t.action.toUpperCase(), a = t.tool, n = t.specifier ? `(${t.specifier})` : "";
|
|
121
|
+
return `${e} rule matched: ${a}${n}`;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Parse permission rule from string format
|
|
125
|
+
* Examples:
|
|
126
|
+
* - "Bash" -> { tool: "Bash", action: "allow" }
|
|
127
|
+
* - "Bash(git commit )" -> { tool: "Bash", specifier: "git commit ", action: "allow" }
|
|
128
|
+
*/
|
|
129
|
+
static parseRule(t, e) {
|
|
130
|
+
const a = t.match(/^(\w+)(?:\((.*)\))?$/);
|
|
131
|
+
if (!a)
|
|
132
|
+
throw new Error(`Invalid permission rule format: ${t}`);
|
|
133
|
+
const [, n, r] = a;
|
|
134
|
+
return {
|
|
135
|
+
tool: n,
|
|
136
|
+
specifier: r,
|
|
137
|
+
// MODIFIED: Don't trim - preserve trailing spaces which are significant for glob patterns
|
|
138
|
+
action: e
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Create matcher from configuration object
|
|
143
|
+
*/
|
|
144
|
+
static fromConfig(t) {
|
|
145
|
+
const e = [];
|
|
146
|
+
for (const a of t.allow || [])
|
|
147
|
+
e.push(u.parseRule(a, o.ALLOW));
|
|
148
|
+
for (const a of t.ask || [])
|
|
149
|
+
e.push(u.parseRule(a, o.ASK));
|
|
150
|
+
for (const a of t.deny || [])
|
|
151
|
+
e.push(u.parseRule(a, o.DENY));
|
|
152
|
+
return new u({
|
|
153
|
+
rules: e,
|
|
154
|
+
defaultMode: t.defaultMode || o.ASK
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Clear cache (useful for testing or config reload)
|
|
159
|
+
*/
|
|
160
|
+
clearCache() {
|
|
161
|
+
this.patternCache.clear();
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Get current cache size
|
|
165
|
+
*/
|
|
166
|
+
getCacheSize() {
|
|
167
|
+
return this.patternCache.size;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
class c {
|
|
171
|
+
configStore;
|
|
172
|
+
/** 工具名称映射 */
|
|
173
|
+
toolNameMapper = {};
|
|
174
|
+
constructor(t) {
|
|
175
|
+
this.configStore = t;
|
|
176
|
+
}
|
|
177
|
+
// ========== 单例模式 ==========
|
|
178
|
+
static instance = null;
|
|
179
|
+
/**
|
|
180
|
+
* 获取单例实例
|
|
181
|
+
* @param configStore 配置存储实例(仅首次调用需要)
|
|
182
|
+
*/
|
|
183
|
+
static getInstance(t) {
|
|
184
|
+
if (!c.instance) {
|
|
185
|
+
if (!t)
|
|
186
|
+
throw new Error("PermissionStore not initialized. Provide configStore on first call.");
|
|
187
|
+
c.instance = new c(t);
|
|
188
|
+
}
|
|
189
|
+
return c.instance;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* 重置单例(测试用)
|
|
193
|
+
*/
|
|
194
|
+
static resetInstance() {
|
|
195
|
+
c.instance = null;
|
|
196
|
+
}
|
|
197
|
+
// ========== 业务方法 ==========
|
|
198
|
+
/**
|
|
199
|
+
* 获取权限匹配器实例
|
|
200
|
+
*/
|
|
201
|
+
async getPermissions() {
|
|
202
|
+
const t = await this.configStore.getConfig();
|
|
203
|
+
if (t.permissions)
|
|
204
|
+
return u.fromConfig(t.permissions);
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* 检查 Bash 命令权限
|
|
208
|
+
*/
|
|
209
|
+
async checkBashPermission(t, e) {
|
|
210
|
+
return (await this.getPermissions())?.checkPermission({
|
|
211
|
+
name: "Bash",
|
|
212
|
+
args: { command: t, cwd: e }
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* 检查读取文件权限
|
|
217
|
+
*/
|
|
218
|
+
async checkReadPermission(t) {
|
|
219
|
+
return (await this.getPermissions())?.checkPermission({
|
|
220
|
+
name: "Read",
|
|
221
|
+
args: { file_path: t }
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* 检查写入文件权限
|
|
226
|
+
*/
|
|
227
|
+
async checkWritePermission(t) {
|
|
228
|
+
return (await this.getPermissions())?.checkPermission({
|
|
229
|
+
name: "Write",
|
|
230
|
+
args: { file_path: t }
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
class S {
|
|
235
|
+
configStore;
|
|
236
|
+
skillStore;
|
|
237
|
+
pluginStore;
|
|
238
|
+
remoteStore;
|
|
239
|
+
permissionStore;
|
|
240
|
+
_initialized = !1;
|
|
241
|
+
constructor(t, e, a, n) {
|
|
242
|
+
this.configStore = t, this.skillStore = e, this.pluginStore = a, this.remoteStore = n, this.permissionStore = c.getInstance(t);
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* 初始化管理器(延迟初始化)
|
|
246
|
+
* 必须在使用其他方法前调用
|
|
247
|
+
*/
|
|
248
|
+
async initialize() {
|
|
249
|
+
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);
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* 确保已初始化(内部使用)
|
|
253
|
+
*/
|
|
254
|
+
async ensureInitialized() {
|
|
255
|
+
if (!this._initialized)
|
|
256
|
+
throw new Error("ConfigManager not initialized. Call await manager.initialize() first.");
|
|
257
|
+
}
|
|
258
|
+
// 配置相关
|
|
259
|
+
async getConfig() {
|
|
260
|
+
return await this.ensureInitialized(), await this.configStore.getConfig();
|
|
261
|
+
}
|
|
262
|
+
async updateConfig(t) {
|
|
263
|
+
return await this.ensureInitialized(), await this.configStore.updateConfig(t);
|
|
264
|
+
}
|
|
265
|
+
// Skills 相关
|
|
266
|
+
async listSkills() {
|
|
267
|
+
return await this.ensureInitialized(), await this.skillStore.listSkills();
|
|
268
|
+
}
|
|
269
|
+
async getSkill(t) {
|
|
270
|
+
return await this.ensureInitialized(), await this.skillStore.getSkill(t);
|
|
271
|
+
}
|
|
272
|
+
async saveSkill(t, e) {
|
|
273
|
+
return await this.ensureInitialized(), await this.skillStore.saveSkill(t, e);
|
|
274
|
+
}
|
|
275
|
+
async deleteSkill(t) {
|
|
276
|
+
return await this.ensureInitialized(), await this.skillStore.deleteSkill(t);
|
|
277
|
+
}
|
|
278
|
+
async syncSkillsFromRemote() {
|
|
279
|
+
if (await this.ensureInitialized(), !this.remoteStore)
|
|
280
|
+
throw new Error("Remote store not configured");
|
|
281
|
+
return await this.skillStore.syncFromRemote(this.remoteStore);
|
|
282
|
+
}
|
|
283
|
+
// Plugins 相关
|
|
284
|
+
async listPlugins() {
|
|
285
|
+
return await this.ensureInitialized(), await this.pluginStore.listPlugins();
|
|
286
|
+
}
|
|
287
|
+
async getPluginConfig(t) {
|
|
288
|
+
return await this.ensureInitialized(), await this.pluginStore.getPluginConfig(t);
|
|
289
|
+
}
|
|
290
|
+
async updatePluginConfig(t, e) {
|
|
291
|
+
return await this.ensureInitialized(), await this.pluginStore.updatePluginConfig(t, e);
|
|
292
|
+
}
|
|
293
|
+
async installPlugin(t, e) {
|
|
294
|
+
return await this.ensureInitialized(), await this.pluginStore.installPlugin(t, e);
|
|
295
|
+
}
|
|
296
|
+
async uninstallPlugin(t) {
|
|
297
|
+
return await this.ensureInitialized(), await this.pluginStore.uninstallPlugin(t);
|
|
298
|
+
}
|
|
299
|
+
// Permissions 相关
|
|
300
|
+
/**
|
|
301
|
+
* 检查 Bash 命令权限
|
|
302
|
+
*/
|
|
303
|
+
async checkBashPermission(t, e) {
|
|
304
|
+
return await this.ensureInitialized(), await this.permissionStore.checkBashPermission(t, e);
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* 检查读取文件权限
|
|
308
|
+
*/
|
|
309
|
+
async checkReadPermission(t) {
|
|
310
|
+
return await this.ensureInitialized(), await this.permissionStore.checkReadPermission(t);
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* 检查写入文件权限
|
|
314
|
+
*/
|
|
315
|
+
async checkWritePermission(t) {
|
|
316
|
+
return await this.ensureInitialized(), await this.permissionStore.checkWritePermission(t);
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* 获取权限匹配器(用于高级操作)
|
|
320
|
+
*/
|
|
321
|
+
async getPermissionMatcher() {
|
|
322
|
+
return await this.ensureInitialized(), await this.permissionStore.getPermissions();
|
|
323
|
+
}
|
|
324
|
+
/** fs 专用 */
|
|
325
|
+
getConfigPath() {
|
|
326
|
+
return this.configStore?.dbPath;
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
async function w() {
|
|
330
|
+
const { FileSystemConfigStore: s } = await import("./FileSystemConfigStore-Bog5vylu.mjs"), { FileSystemSkillStore: t } = await import("./FileSystemSkillStore-yvEvcRxB.mjs"), { FileSystemPluginStore: e } = await import("./FileSystemPluginStore-ChortK7z.mjs"), a = new s(), n = new t(), r = new e(), l = new S(a, n, r);
|
|
331
|
+
return await l.initialize(), l;
|
|
332
|
+
}
|
|
333
|
+
const y = i.enum(["idea", "bug_report", "feature", "refactor"]), k = i.enum(["low", "medium", "high", "critical"]), z = i.enum(["pending", "planned", "archived"]), C = i.enum(["user_input", "ai_suggestion", "conversation_derived"]), P = i.object({
|
|
334
|
+
id: i.string().uuid(),
|
|
335
|
+
type: y,
|
|
336
|
+
title: i.string().min(1).max(200),
|
|
337
|
+
description: i.string(),
|
|
338
|
+
priority: k.default("medium"),
|
|
339
|
+
source: C,
|
|
340
|
+
status: z.default("pending"),
|
|
341
|
+
createdAt: i.string().datetime(),
|
|
342
|
+
tags: i.array(i.string()).default([]),
|
|
343
|
+
metadata: i.object({
|
|
344
|
+
relatedFiles: i.array(i.string()).optional(),
|
|
345
|
+
conversationContext: i.string().optional(),
|
|
346
|
+
estimatedComplexity: i.enum(["simple", "medium", "complex"]).optional()
|
|
347
|
+
}).optional()
|
|
348
|
+
});
|
|
349
|
+
i.object({
|
|
350
|
+
version: i.literal("1.0"),
|
|
351
|
+
sparks: i.array(P),
|
|
352
|
+
lastUpdated: i.string().datetime()
|
|
353
|
+
});
|
|
354
|
+
const d = i.enum([
|
|
355
|
+
"pickup",
|
|
356
|
+
// 待领取(新任务,未被 agent 接管)
|
|
357
|
+
"running",
|
|
358
|
+
// 运行中(agent 正在执行)
|
|
359
|
+
"complete",
|
|
360
|
+
// 已完成(成功完成)
|
|
361
|
+
"error",
|
|
362
|
+
// 已失败(失败,暂停中)
|
|
363
|
+
"review",
|
|
364
|
+
// 待审核(完成,等待人工确认)
|
|
365
|
+
"feedback"
|
|
366
|
+
// 待反馈(agent 卡住,需要人工输入)
|
|
367
|
+
]), m = i.enum([
|
|
368
|
+
"default",
|
|
369
|
+
"planner",
|
|
370
|
+
"reviewer",
|
|
371
|
+
"refactor",
|
|
372
|
+
"finder",
|
|
373
|
+
"debugger"
|
|
374
|
+
]), b = i.enum(["serial", "parallel"]), g = i.lazy(
|
|
375
|
+
() => i.object({
|
|
376
|
+
// 基本信息
|
|
377
|
+
id: i.string(),
|
|
378
|
+
title: i.string().min(1).max(200),
|
|
379
|
+
description: i.string(),
|
|
380
|
+
// 执行控制
|
|
381
|
+
execution: b.optional(),
|
|
382
|
+
children: i.array(i.lazy(() => g)).optional(),
|
|
383
|
+
// Agent 分配
|
|
384
|
+
agentType: m.optional(),
|
|
385
|
+
threadId: i.string().optional(),
|
|
386
|
+
// 元数据
|
|
387
|
+
estimatedTime: i.string().optional(),
|
|
388
|
+
complexity: i.enum(["simple", "medium", "complex"]).optional(),
|
|
389
|
+
dependencies: i.array(i.string()).optional(),
|
|
390
|
+
acceptanceCriteria: i.array(i.string()).optional(),
|
|
391
|
+
// 状态相关(运行时)
|
|
392
|
+
status: d.optional(),
|
|
393
|
+
startedAt: i.string().datetime().optional(),
|
|
394
|
+
completedAt: i.string().datetime().optional(),
|
|
395
|
+
assignedTo: m.optional(),
|
|
396
|
+
error: i.object({
|
|
397
|
+
message: i.string(),
|
|
398
|
+
stack: i.string().optional(),
|
|
399
|
+
retryCount: i.number().optional()
|
|
400
|
+
}).optional()
|
|
401
|
+
})
|
|
402
|
+
), I = i.object({
|
|
403
|
+
taskId: i.string(),
|
|
404
|
+
planId: i.string(),
|
|
405
|
+
threadId: i.string(),
|
|
406
|
+
// 关联的 LangGraph thread ID
|
|
407
|
+
agentType: m,
|
|
408
|
+
// 改为类型安全的 AgentType
|
|
409
|
+
status: d,
|
|
410
|
+
startedAt: i.string().datetime(),
|
|
411
|
+
completedAt: i.string().datetime().optional(),
|
|
412
|
+
output: i.string().optional(),
|
|
413
|
+
error: i.string().optional(),
|
|
414
|
+
changedFiles: i.array(i.string()).optional()
|
|
415
|
+
});
|
|
416
|
+
i.object({
|
|
417
|
+
version: i.literal("1.0"),
|
|
418
|
+
lastUpdated: i.string().datetime(),
|
|
419
|
+
// 活跃的任务树
|
|
420
|
+
activePlanId: i.string().optional(),
|
|
421
|
+
tasks: i.record(i.string(), g),
|
|
422
|
+
// 执行历史
|
|
423
|
+
history: i.array(I),
|
|
424
|
+
// 全局配置
|
|
425
|
+
config: i.object({
|
|
426
|
+
maxConcurrentAgents: i.number().min(1).max(10).default(3),
|
|
427
|
+
retryLimit: i.number().min(0).max(10).default(3),
|
|
428
|
+
autoResume: i.boolean().default(!1)
|
|
429
|
+
})
|
|
430
|
+
});
|
|
431
|
+
const p = await w(), v = async () => {
|
|
432
|
+
await p.initialize();
|
|
433
|
+
}, R = async () => await p.getConfig(), j = async (s) => {
|
|
434
|
+
await p.updateConfig(s);
|
|
435
|
+
}, E = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
436
|
+
__proto__: null,
|
|
437
|
+
configStore: p,
|
|
438
|
+
getConfig: R,
|
|
439
|
+
initDb: v,
|
|
440
|
+
updateConfig: j
|
|
441
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
442
|
+
export {
|
|
443
|
+
g as T,
|
|
444
|
+
E as a,
|
|
445
|
+
p as c,
|
|
446
|
+
R as g,
|
|
447
|
+
v as i,
|
|
448
|
+
j as u
|
|
449
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { u as C } from "./id-
|
|
2
|
-
import { B as v, c as x, T as $, m as I } from "./app-
|
|
3
|
-
import "./graphBuilder-
|
|
1
|
+
import { u as C } from "./id-BclYO3iE.mjs";
|
|
2
|
+
import { B as v, c as x, T as $, m as I } from "./app-D748EsP_.mjs";
|
|
3
|
+
import "./graphBuilder-B6OHvcgJ.mjs";
|
|
4
4
|
import { createClient as O, createCluster as N } from "redis";
|
|
5
5
|
const W = [
|
|
6
6
|
{
|
package/dist/nonInteractive.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { HumanMessage as c } from "langchain";
|
|
2
|
-
import { g as m } from "./graphBuilder-
|
|
2
|
+
import { g as m } from "./graphBuilder-B6OHvcgJ.mjs";
|
|
3
3
|
import "@langchain/langgraph";
|
|
4
4
|
import "zod";
|
|
5
5
|
import "@langchain/openai";
|
|
6
6
|
import "@langchain/anthropic";
|
|
7
7
|
import "yaml";
|
|
8
|
-
import { i as l, g } from "./index-
|
|
8
|
+
import { i as l, g } from "./index-BG-c4_r3.mjs";
|
|
9
9
|
async function d() {
|
|
10
10
|
return new Promise((t, r) => {
|
|
11
11
|
let n = "";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { u as $ } from "./id-
|
|
2
|
-
import { B as g } from "./app-
|
|
3
|
-
import "./graphBuilder-
|
|
1
|
+
import { u as $ } from "./id-BclYO3iE.mjs";
|
|
2
|
+
import { B as g } from "./app-D748EsP_.mjs";
|
|
3
|
+
import "./graphBuilder-B6OHvcgJ.mjs";
|
|
4
4
|
import { createClient as T } from "redis";
|
|
5
5
|
function k(u) {
|
|
6
6
|
if (u === null || typeof u != "object") return JSON.stringify(u);
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import "micromatch";
|
|
2
|
+
import "./index-BG-c4_r3.mjs";
|
|
1
3
|
import "lowdb";
|
|
2
4
|
import "lowdb/node";
|
|
3
5
|
import "yaml";
|
|
4
|
-
import "./
|
|
5
|
-
import { T as a } from "./graphBuilder-BIhxVliV.mjs";
|
|
6
|
+
import { T as a } from "./graphBuilder-B6OHvcgJ.mjs";
|
|
6
7
|
class r {
|
|
7
8
|
store = null;
|
|
8
9
|
projectRoot;
|
|
@@ -99,7 +100,7 @@ class r {
|
|
|
99
100
|
}
|
|
100
101
|
}
|
|
101
102
|
let i = null;
|
|
102
|
-
function
|
|
103
|
+
function k(s) {
|
|
103
104
|
if (!i) {
|
|
104
105
|
if (!s)
|
|
105
106
|
throw new Error("projectRoot is required for first initialization");
|
|
@@ -108,5 +109,5 @@ function c(s) {
|
|
|
108
109
|
return i;
|
|
109
110
|
}
|
|
110
111
|
export {
|
|
111
|
-
|
|
112
|
+
k as getTasksStore
|
|
112
113
|
};
|
package/dist/zen-code.mjs
CHANGED
package/dist/zen-init.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as t, j as e, B as o, T as r, r as U } from "./use-input-1eSjZocJ.mjs";
|
|
2
2
|
import "chalk";
|
|
3
3
|
import { u as A, S as O, M as T, a as B, b as R, g as K } from "./get_allowed_models-tD7oPVgc.mjs";
|
|
4
|
-
import { c as M, u as v, i as L } from "./index-
|
|
4
|
+
import { c as M, u as v, i as L } from "./index-BG-c4_r3.mjs";
|
|
5
5
|
const N = ({ onNext: l, onExit: i }) => {
|
|
6
6
|
A((c, p) => {
|
|
7
7
|
p.return ? l() : p.ctrl && c === "c" && i();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zen-code",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/cli.mjs",
|
|
6
6
|
"bin": "./dist/cli.mjs",
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"lowdb": "^7.0.1",
|
|
26
26
|
"marked": "^16.4.2",
|
|
27
27
|
"marked-terminal": "^7.3.0",
|
|
28
|
+
"micromatch": "^4.0.8",
|
|
28
29
|
"node-notifier": "^10.0.1",
|
|
29
30
|
"node-sqlite3-wasm": "^0.8.53",
|
|
30
31
|
"openai": "^6.16.0",
|