zen-code 4.9.1 → 4.10.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.
- package/dist/app.js +175 -166
- package/dist/chunk-075hks9v.js +1 -0
- package/dist/chunk-0fj768k4.js +112 -0
- package/dist/chunk-19mf2aa7.js +1 -0
- package/dist/chunk-1mq2jmfy.js +2 -0
- package/dist/chunk-1v863afn.js +278 -0
- package/dist/chunk-1vn8d8b8.js +1 -0
- package/dist/{chunk-mmq834zt.js → chunk-1w19w1bm.js} +1 -1
- package/dist/chunk-3dnayvgx.js +224 -0
- package/dist/chunk-4hg13vwj.js +1 -0
- package/dist/chunk-4scrkcqv.js +1 -0
- package/dist/chunk-54cdhhqm.js +1 -0
- package/dist/chunk-5m4yb9av.js +91 -0
- package/dist/chunk-5yd4ntp6.js +8 -0
- package/dist/{chunk-b52b0t16.js → chunk-6scjjkn3.js} +1 -1
- package/dist/chunk-7jatn15w.js +2 -0
- package/dist/{chunk-4nsg4vcd.js → chunk-7w9y11hj.js} +1 -1
- package/dist/chunk-7yzv6385.js +1 -0
- package/dist/{chunk-g377vrpj.js → chunk-875hayaj.js} +3 -3
- package/dist/chunk-8bs8r50r.js +1 -0
- package/dist/chunk-8waww0j9.js +6 -0
- package/dist/chunk-8ysg0rga.js +1 -0
- package/dist/chunk-9czhw5k6.js +4 -0
- package/dist/chunk-9tgp14v7.js +16 -0
- package/dist/chunk-a239dn0b.js +1 -0
- package/dist/chunk-arv4h3h1.js +2 -0
- package/dist/chunk-b2551zfb.js +2 -0
- package/dist/chunk-b9emn03n.js +1 -0
- package/dist/chunk-bm7578sn.js +1 -0
- package/dist/{chunk-1y82m5kn.js → chunk-bytq4kd1.js} +3 -125
- package/dist/chunk-c2wfgbj6.js +1 -0
- package/dist/{chunk-gcm4jp0d.js → chunk-cef4vbtb.js} +1 -1
- package/dist/chunk-cnzhxgn5.js +4 -0
- package/dist/chunk-d2770b2z.js +1 -0
- package/dist/chunk-d72063sm.js +2 -0
- package/dist/{chunk-9k5d9vf1.js → chunk-d988tv30.js} +1 -1
- package/dist/{chunk-va71tsw3.js → chunk-dx9k6sdd.js} +3 -3
- package/dist/chunk-e6ggkg36.js +2 -0
- package/dist/chunk-fjqtrakn.js +1 -0
- package/dist/chunk-gbfpab0j.js +1 -0
- package/dist/chunk-gkvx829z.js +1 -0
- package/dist/{chunk-9dahn9h7.js → chunk-gwf8b14k.js} +1 -1
- package/dist/chunk-gz7fz9fg.js +1 -0
- package/dist/chunk-h0q3dvnv.js +5 -0
- package/dist/chunk-h0qb9jk1.js +1 -0
- package/dist/chunk-h9y136h8.js +1 -0
- package/dist/chunk-hrcxdj3c.js +54 -0
- package/dist/chunk-hz9yw7cs.js +166 -0
- package/dist/chunk-j4y5rjne.js +79 -0
- package/dist/chunk-k12y05c3.js +3 -0
- package/dist/chunk-k6fxqssr.js +18 -0
- package/dist/{chunk-rncpxz1b.js → chunk-kmxdq21k.js} +2 -2
- package/dist/chunk-mcb8rewr.js +213 -0
- package/dist/{chunk-wn43r152.js → chunk-mm9w91rj.js} +1 -1
- package/dist/chunk-mv0xzmq8.js +2 -0
- package/dist/chunk-n849zsd3.js +1 -0
- package/dist/chunk-nm253hhf.js +81 -0
- package/dist/chunk-prg6489q.js +1 -0
- package/dist/{chunk-cggjws6a.js → chunk-pxdgy0vr.js} +1 -1
- package/dist/chunk-qhzm2qw9.js +2 -0
- package/dist/{chunk-98f6hg43.js → chunk-qmxtys9q.js} +1 -1
- package/dist/chunk-r0cfe5c1.js +294 -0
- package/dist/chunk-rtjytfhh.js +1 -0
- package/dist/chunk-s7ttf0pm.js +2 -0
- package/dist/chunk-t01t72t2.js +140 -0
- package/dist/{chunk-ns6tjjkq.js → chunk-t0f66x64.js} +1 -1
- package/dist/chunk-tn356gwf.js +93 -0
- package/dist/chunk-vd8kwzra.js +41 -0
- package/dist/chunk-vhn13anh.js +233 -0
- package/dist/chunk-vnewbtjy.js +1 -0
- package/dist/chunk-wbm7rn9w.js +2 -0
- package/dist/chunk-wd3gkd45.js +3 -0
- package/dist/chunk-whdf0vbb.js +1 -0
- package/dist/{chunk-j7a40ww9.js → chunk-ws232ksq.js} +2 -2
- package/dist/{chunk-8g2zdcy0.js → chunk-yerf10k7.js} +1 -1
- package/dist/{chunk-heasksrr.js → chunk-yzv3n8mw.js} +2 -2
- package/dist/chunk-z3e4c424.js +2 -0
- package/dist/chunk-znw7fpep.js +6 -0
- package/dist/chunk-zq2g4rfd.js +1 -0
- package/dist/cli.js +1 -1
- package/dist/nonInteractive.js +314 -4
- package/dist/zen-keyboard.js +1 -1
- package/package.json +37 -37
- package/dist/chunk-02vv5584.js +0 -1
- package/dist/chunk-13nyfrmm.js +0 -310
- package/dist/chunk-1edvf7b5.js +0 -1
- package/dist/chunk-1rmnbdef.js +0 -1
- package/dist/chunk-1ttywx0y.js +0 -6
- package/dist/chunk-30sq2w0d.js +0 -8
- package/dist/chunk-32ase1cw.js +0 -2
- package/dist/chunk-3490ntd8.js +0 -1
- package/dist/chunk-3pcybja5.js +0 -7
- package/dist/chunk-5rr85f28.js +0 -1
- package/dist/chunk-5x8nxw0t.js +0 -137
- package/dist/chunk-6rfc36jg.js +0 -1
- package/dist/chunk-76h8pe7x.js +0 -2
- package/dist/chunk-7kdvr78m.js +0 -31
- package/dist/chunk-8z38ybz7.js +0 -1
- package/dist/chunk-b8dxq9rq.js +0 -1
- package/dist/chunk-cjqarwdn.js +0 -1
- package/dist/chunk-cs73xbzz.js +0 -1
- package/dist/chunk-cyexd09c.js +0 -2
- package/dist/chunk-ep2es95e.js +0 -81
- package/dist/chunk-f8ewggk1.js +0 -1
- package/dist/chunk-g7pm00z7.js +0 -253
- package/dist/chunk-hfve7nf5.js +0 -2
- package/dist/chunk-j9aysaeb.js +0 -1
- package/dist/chunk-jbf8ve63.js +0 -3
- package/dist/chunk-jfhc5c0d.js +0 -1
- package/dist/chunk-jxsfzfac.js +0 -2
- package/dist/chunk-kba8akjs.js +0 -2
- package/dist/chunk-m76ya904.js +0 -1
- package/dist/chunk-mjzeawnq.js +0 -6
- package/dist/chunk-nwy6n6b6.js +0 -274
- package/dist/chunk-qd305hg1.js +0 -1
- package/dist/chunk-qez6ejd4.js +0 -1
- package/dist/chunk-r2h3x9zv.js +0 -2
- package/dist/chunk-rz3b356n.js +0 -1
- package/dist/chunk-trjpzw1n.js +0 -91
- package/dist/chunk-xhnvpygg.js +0 -2
- package/dist/chunk-xkz5z0zn.js +0 -1
- package/dist/chunk-zwxjkwqd.js +0 -26
- package/dist/chunk-zz32kgt2.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Gk as t}from"./chunk-tn356gwf.js";import{vl as e}from"./chunk-vd8kwzra.js";var s=e.object({content:e.string().min(1),status:e.enum(["pending","in_progress","completed"]),id:e.string()}),a=e.object({todos:e.array(s).describe("The updated todo list")}),n=t(async()=>{return"todo saved successfully"},{name:"todo_write",description:`Use this tool to create and manage a structured task list for your current coding session. This helps you track progress, organize complex tasks, and demonstrate thoroughness to the user.
|
|
2
2
|
It also helps the user understand the progress of the task and overall progress of their requests.
|
|
3
3
|
## When to Use This Tool
|
|
4
4
|
Use this tool proactively in these scenarios:
|
|
@@ -172,127 +172,5 @@ The assistant did not use the todo list because this is a single command executi
|
|
|
172
172
|
- Use clear, descriptive task names
|
|
173
173
|
|
|
174
174
|
When in doubt, use this tool. Being proactive with task management demonstrates attentiveness and ensures you complete all requirements successfully.
|
|
175
|
-
`,schema:
|
|
176
|
-
|
|
177
|
-
你是一位**任务派发架构师**,核心职责是将用户需求分析并拆解为子任务,然后委派给合适的子 agent 执行。
|
|
178
|
-
|
|
179
|
-
## 核心职责
|
|
180
|
-
|
|
181
|
-
**你的唯一任务**:
|
|
182
|
-
1. 理解用户需求
|
|
183
|
-
2. 拆解为可执行的子任务
|
|
184
|
-
3. 委派给合适的子 agent
|
|
185
|
-
4. 跟踪和汇总结果
|
|
186
|
-
|
|
187
|
-
**不要做的事**:
|
|
188
|
-
- ❌ 不要自己编写代码
|
|
189
|
-
- ❌ 不要自己读取文件或搜索代码
|
|
190
|
-
- ❌ 不要自己执行终端命令
|
|
191
|
-
- ❌ 不要做具体的架构分析或设计文档
|
|
192
|
-
|
|
193
|
-
## 工作流程
|
|
194
|
-
|
|
195
|
-
### 步骤 1:需求分析
|
|
196
|
-
|
|
197
|
-
当收到用户请求时,快速判断:
|
|
198
|
-
|
|
199
|
-
1. **任务类型**:
|
|
200
|
-
- 代码实现/修改 → 委派给 \`agents/default\`
|
|
201
|
-
- 任务规划/协调 → 委派给 \`agents/manager\`
|
|
202
|
-
- 复杂任务 → 先由 \`agents/manager\` 规划,再由 \`agents/default\` 执行
|
|
203
|
-
|
|
204
|
-
2. **任务规模**:
|
|
205
|
-
- 单一任务 → 直接委派
|
|
206
|
-
- 多任务 → 拆分后分别委派
|
|
207
|
-
|
|
208
|
-
### 步骤 2:任务拆解
|
|
209
|
-
|
|
210
|
-
使用 \`task\` 工具委派任务:
|
|
211
|
-
|
|
212
|
-
\`\`\`typescript
|
|
213
|
-
// 示例:委派代码实现任务
|
|
214
|
-
{
|
|
215
|
-
subagent_id: "agents/default",
|
|
216
|
-
task_description: "实现用户认证功能,包括登录、注册、登出三个接口",
|
|
217
|
-
data_transfer: {
|
|
218
|
-
requirements: "使用 JWT 认证,密码需要加密存储",
|
|
219
|
-
constraints: "使用现有的数据库连接池"
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
\`\`\`
|
|
223
|
-
|
|
224
|
-
### 步骤 3:结果汇总
|
|
225
|
-
|
|
226
|
-
子 agent 完成后:
|
|
227
|
-
1. 检查执行结果
|
|
228
|
-
2. 如果有多个子任务,协调依赖关系
|
|
229
|
-
3. 向用户汇报整体进度和结果
|
|
230
|
-
|
|
231
|
-
## 委派策略
|
|
232
|
-
|
|
233
|
-
### 简单任务
|
|
234
|
-
|
|
235
|
-
用户请求单一功能时,直接委派:
|
|
236
|
-
|
|
237
|
-
> 用户:添加一个日志工具函数
|
|
238
|
-
|
|
239
|
-
→ 委派给 \`agents/default\`,任务描述清晰完整
|
|
240
|
-
|
|
241
|
-
### 复杂任务
|
|
242
|
-
|
|
243
|
-
用户请求多功能时,拆分后委派:
|
|
244
|
-
|
|
245
|
-
> 用户:重构用户模块并添加测试
|
|
246
|
-
|
|
247
|
-
→ 拆分为:
|
|
248
|
-
1. 委派 \`agents/default\`:重构用户模块代码
|
|
249
|
-
2. 等第一步完成后,委派 \`agents/default\`:为用户模块编写测试
|
|
250
|
-
|
|
251
|
-
### 规划任务
|
|
252
|
-
|
|
253
|
-
用户需要方案设计时:
|
|
254
|
-
|
|
255
|
-
> 用户:设计一个新的权限系统
|
|
256
|
-
|
|
257
|
-
→ 委派 \`agents/manager\` 进行任务规划,然后按规划执行
|
|
258
|
-
|
|
259
|
-
## 输出格式
|
|
260
|
-
|
|
261
|
-
### 委派时
|
|
262
|
-
|
|
263
|
-
\`\`\`markdown
|
|
264
|
-
## 任务分析
|
|
265
|
-
|
|
266
|
-
**用户需求**:{用户原始请求}
|
|
267
|
-
|
|
268
|
-
**任务拆解**:
|
|
269
|
-
1. 任务 A → 委派给 agents/default
|
|
270
|
-
2. 任务 B → 委派给 agents/manager
|
|
271
|
-
|
|
272
|
-
**开始执行**...
|
|
273
|
-
\`\`\`
|
|
274
|
-
|
|
275
|
-
### 汇报时
|
|
276
|
-
|
|
277
|
-
\`\`\`markdown
|
|
278
|
-
## 执行结果
|
|
279
|
-
|
|
280
|
-
**已完成**:
|
|
281
|
-
- ✅ 任务 A:{简要结果}
|
|
282
|
-
- ✅ 任务 B:{简要结果}
|
|
283
|
-
|
|
284
|
-
**总结**:{整体结果摘要}
|
|
285
|
-
\`\`\`
|
|
286
|
-
|
|
287
|
-
## 重要约束
|
|
288
|
-
|
|
289
|
-
1. **立即委派**:收到任务后,不要犹豫,立即分析并委派
|
|
290
|
-
2. **清晰描述**:给子 agent 的任务描述要完整、清晰
|
|
291
|
-
3. **传递上下文**:使用 \`data_transfer\` 传递必要的背景信息
|
|
292
|
-
4. **不要插手**:相信子 agent 的能力,不要自己动手做具体工作
|
|
293
|
-
5. **保持简洁**:你的输出应该简短,重点是协调和汇总
|
|
294
|
-
|
|
295
|
-
---
|
|
296
|
-
|
|
297
|
-
**记住**:你是协调者,不是执行者。快速分析需求,立即委派任务,高效汇总结果。`;async function w(){let e=new L,t=new E(e);return await t.addModel({id:"glm-4.7",model_name:"glm-4.7",model_provider:process.env.MODEL_PROVIDER||"openai",stream_usage:!0,enable_thinking:!0,temperature:0.7,max_tokens:4096,top_p:1,frequency_penalty:0,presence_penalty:0}),await t.addPrompt({id:"prompts/default",name:"default",content:b}),await t.addPrompt({id:"prompts/manager",name:"manager",content:k}),await p(t),await y(t),await t.addAgent({id:"agents/default",name:"Jarvis",description:"代码实现助手",system_prompt:"prompts/default",model:"glm-4.7",tools:{ask_user_questions:!0,todo_write:!0},middleware:{filesystem:!0,terminal:!0,agents_md:!0,skills:!0,memories:!0,subagents:!0}}),await t.addAgent({id:"agents/manager",name:"Manager",description:"任务管理员",system_prompt:"prompts/manager",model:"glm-4.7",tools:{ask_user_questions:!0,todo_write:!0},middleware:{filesystem:!0,terminal:!0,agents_md:!0,skills:!0,memories:!0,subagents:!0}}),t}var T;try{T=await w()}catch(e){throw console.error("Failed to load agent package:",e),Error(`Failed to initialize agent package: ${e instanceof Error?e.message:String(e)}`)}var ae=T;
|
|
298
|
-
export{A as Da,ae as Ea};
|
|
175
|
+
`,schema:a});
|
|
176
|
+
export{a as te,n as ue};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ue as o}from"./chunk-bytq4kd1.js";import"./chunk-hrcxdj3c.js";import"./chunk-9tgp14v7.js";import"./chunk-hz9yw7cs.js";import"./chunk-tn356gwf.js";import"./chunk-n849zsd3.js";import"./chunk-b2551zfb.js";import"./chunk-vd8kwzra.js";import"./chunk-arv4h3h1.js";import"./chunk-z3e4c424.js";var a={name:"task",tools:[o]};export{a as taskMiddleware};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./chunk-
|
|
1
|
+
import{Gd as z}from"./chunk-cnzhxgn5.js";import"./chunk-z3e4c424.js";class I{db;pragmaPromise=null;constructor(x){this.db=x}ensurePragma(){if(!this.pragmaPromise)this.pragmaPromise=this.doEnsurePragma();return this.pragmaPromise}async doEnsurePragma(){await z`PRAGMA busy_timeout = 5000`.execute(this.db),await z`PRAGMA journal_mode = WAL`.execute(this.db),await z`PRAGMA synchronous = NORMAL`.execute(this.db),await z`PRAGMA wal_autocheckpoint = 1000`.execute(this.db)}dateToDb(x){return x.toISOString()}dbToDate(x){return new Date(x)}jsonToDb(x){return JSON.stringify(x)}dbToJson(x){if(typeof x==="string")try{return JSON.parse(x)}catch{return x}return x}buildJsonQuery(x,E,F,B){let G=`$.${JSON.stringify(F)}`;if(B===null)return z`
|
|
2
2
|
json_type(${z.ref(E)}, ${z.lit(G)}) = 'null'
|
|
3
3
|
`;let C;if(typeof B==="string")C=B;else if(typeof B==="number")C=B;else if(typeof B==="boolean")C=B?1:0;else C=JSON.stringify(B);return z`json_extract(${z.ref(E)}, ${z.lit(G)}) = ${z.lit(C)}`}now(){return new Date().toISOString()}async createTables(x){await this.ensurePragma(),await z`
|
|
4
4
|
CREATE TABLE IF NOT EXISTS threads (
|