zen-code 4.10.0 → 4.10.1

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.
Files changed (83) hide show
  1. package/dist/app.js +2615 -157
  2. package/dist/cli.js +3116 -1
  3. package/dist/nonInteractive.js +1950 -180
  4. package/dist/zen-keyboard.js +358 -3
  5. package/package.json +1 -1
  6. package/dist/chunk-075hks9v.js +0 -1
  7. package/dist/chunk-0fj768k4.js +0 -112
  8. package/dist/chunk-19mf2aa7.js +0 -1
  9. package/dist/chunk-1mq2jmfy.js +0 -2
  10. package/dist/chunk-1v863afn.js +0 -278
  11. package/dist/chunk-1vn8d8b8.js +0 -1
  12. package/dist/chunk-1w19w1bm.js +0 -2
  13. package/dist/chunk-3dnayvgx.js +0 -224
  14. package/dist/chunk-4hg13vwj.js +0 -1
  15. package/dist/chunk-4scrkcqv.js +0 -1
  16. package/dist/chunk-54cdhhqm.js +0 -1
  17. package/dist/chunk-5m4yb9av.js +0 -91
  18. package/dist/chunk-5yd4ntp6.js +0 -8
  19. package/dist/chunk-6scjjkn3.js +0 -23
  20. package/dist/chunk-7jatn15w.js +0 -2
  21. package/dist/chunk-7w9y11hj.js +0 -88
  22. package/dist/chunk-7yzv6385.js +0 -1
  23. package/dist/chunk-875hayaj.js +0 -3
  24. package/dist/chunk-8bs8r50r.js +0 -1
  25. package/dist/chunk-8waww0j9.js +0 -6
  26. package/dist/chunk-8ysg0rga.js +0 -1
  27. package/dist/chunk-9czhw5k6.js +0 -4
  28. package/dist/chunk-9tgp14v7.js +0 -16
  29. package/dist/chunk-a239dn0b.js +0 -1
  30. package/dist/chunk-arv4h3h1.js +0 -2
  31. package/dist/chunk-b2551zfb.js +0 -2
  32. package/dist/chunk-b9emn03n.js +0 -1
  33. package/dist/chunk-bm7578sn.js +0 -1
  34. package/dist/chunk-bytq4kd1.js +0 -176
  35. package/dist/chunk-c2wfgbj6.js +0 -1
  36. package/dist/chunk-cef4vbtb.js +0 -26
  37. package/dist/chunk-cnzhxgn5.js +0 -4
  38. package/dist/chunk-d2770b2z.js +0 -1
  39. package/dist/chunk-d72063sm.js +0 -2
  40. package/dist/chunk-d988tv30.js +0 -1
  41. package/dist/chunk-dx9k6sdd.js +0 -7
  42. package/dist/chunk-e6ggkg36.js +0 -2
  43. package/dist/chunk-fjqtrakn.js +0 -1
  44. package/dist/chunk-gbfpab0j.js +0 -1
  45. package/dist/chunk-gkvx829z.js +0 -1
  46. package/dist/chunk-gwf8b14k.js +0 -3
  47. package/dist/chunk-gz7fz9fg.js +0 -1
  48. package/dist/chunk-h0q3dvnv.js +0 -5
  49. package/dist/chunk-h0qb9jk1.js +0 -1
  50. package/dist/chunk-h9y136h8.js +0 -1
  51. package/dist/chunk-hrcxdj3c.js +0 -54
  52. package/dist/chunk-hz9yw7cs.js +0 -166
  53. package/dist/chunk-j4y5rjne.js +0 -79
  54. package/dist/chunk-k12y05c3.js +0 -3
  55. package/dist/chunk-k6fxqssr.js +0 -18
  56. package/dist/chunk-kmxdq21k.js +0 -2
  57. package/dist/chunk-mcb8rewr.js +0 -213
  58. package/dist/chunk-mm9w91rj.js +0 -4
  59. package/dist/chunk-mv0xzmq8.js +0 -2
  60. package/dist/chunk-n849zsd3.js +0 -1
  61. package/dist/chunk-nm253hhf.js +0 -81
  62. package/dist/chunk-prg6489q.js +0 -1
  63. package/dist/chunk-pxdgy0vr.js +0 -2
  64. package/dist/chunk-qhzm2qw9.js +0 -2
  65. package/dist/chunk-qmxtys9q.js +0 -2
  66. package/dist/chunk-r0cfe5c1.js +0 -294
  67. package/dist/chunk-rtjytfhh.js +0 -1
  68. package/dist/chunk-s7ttf0pm.js +0 -2
  69. package/dist/chunk-t01t72t2.js +0 -140
  70. package/dist/chunk-t0f66x64.js +0 -1
  71. package/dist/chunk-tn356gwf.js +0 -93
  72. package/dist/chunk-vd8kwzra.js +0 -41
  73. package/dist/chunk-vhn13anh.js +0 -233
  74. package/dist/chunk-vnewbtjy.js +0 -1
  75. package/dist/chunk-wbm7rn9w.js +0 -2
  76. package/dist/chunk-wd3gkd45.js +0 -3
  77. package/dist/chunk-whdf0vbb.js +0 -1
  78. package/dist/chunk-ws232ksq.js +0 -2
  79. package/dist/chunk-yerf10k7.js +0 -6
  80. package/dist/chunk-yzv3n8mw.js +0 -2
  81. package/dist/chunk-z3e4c424.js +0 -2
  82. package/dist/chunk-znw7fpep.js +0 -6
  83. package/dist/chunk-zq2g4rfd.js +0 -1
@@ -1,176 +0,0 @@
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
- It also helps the user understand the progress of the task and overall progress of their requests.
3
- ## When to Use This Tool
4
- Use this tool proactively in these scenarios:
5
-
6
- 1. Complex multi-step tasks - When a task requires 3 or more distinct steps or actions
7
- 2. Non-trivial and complex tasks - Tasks that require careful planning or multiple operations
8
- 3. User explicitly requests todo list - When the user directly asks you to use the todo list
9
- 4. User provides multiple tasks - When users provide a list of things to be done (numbered or comma-separated)
10
- 5. After receiving new instructions - Immediately capture user requirements as todos
11
- 6. When you start working on a task - Mark it as in_progress BEFORE beginning work. Ideally you should only have one todo as in_progress at a time
12
- 7. After completing a task - Mark it as completed and add any new follow-up tasks discovered during implementation
13
-
14
- ## When NOT to Use This Tool
15
-
16
- Skip using this tool when:
17
- 1. There is only a single, straightforward task
18
- 2. The task is trivial and tracking it provides no organizational benefit
19
- 3. The task can be completed in less than 3 trivial steps
20
- 4. The task is purely conversational or informational
21
-
22
- NOTE that you should not use this tool if there is only one trivial task to do. In this case you are better off just doing the task directly.
23
-
24
- ## Examples of When to Use the Todo List
25
-
26
- <example>
27
- User: I want to add a dark mode toggle to the application settings. Make sure you run the tests and build when you're done!
28
- Assistant: I'll help add a dark mode toggle to your application settings. Let me create a todo list to track this implementation.
29
- *Creates todo list with the following items:*
30
- 1. Create dark mode toggle component in Settings page
31
- 2. Add dark mode state management (context/store)
32
- 3. Implement CSS-in-JS styles for dark theme
33
- 4. Update existing components to support theme switching
34
- 5. Run tests and build process, addressing any failures or errors that occur
35
- *Begins working on the first task*
36
-
37
- <reasoning>
38
- The assistant used the todo list because:
39
- 1. Adding dark mode is a multi-step feature requiring UI, state management, and styling changes
40
- 2. The user explicitly requested tests and build be run afterward
41
- 3. The assistant inferred that tests and build need to pass by adding "Ensure tests and build succeed" as the final task
42
- </reasoning>
43
- </example>
44
-
45
- <example>
46
- User: Help me rename the function getCwd to getCurrentWorkingDirectory across my project
47
- Assistant: Let me first search through your codebase to find all occurrences of 'getCwd'.
48
- *Uses grep or search tools to locate all instances of getCwd in the codebase*
49
- Assistant: I've found 15 instances of 'getCwd' across 8 different files. Let me create a todo list to track these changes.
50
- *Creates todo list with specific items for each file that needs updating*
51
-
52
- <reasoning>
53
- The assistant used the todo list because:
54
- 1. First, the assistant searched to understand the scope of the task
55
- 2. Upon finding multiple occurrences across different files, it determined this was a complex task with multiple steps
56
- 3. The todo list helps ensure every instance is tracked and updated systematically
57
- 4. This approach prevents missing any occurrences and maintains code consistency
58
- </reasoning>
59
- </example>
60
-
61
-
62
- <example>
63
- User: I need to implement these features for my e-commerce site: user registration, product catalog, shopping cart, and checkout flow.
64
- Assistant: I'll help implement these features. First, let's add all the features to the todo list.
65
- *Creates a todo list breaking down each feature into specific tasks based on the project architecture*
66
- Assistant: Let's start with user registration. This will involve creating database models, API endpoints, and frontend forms that integrate with your existing authentication system.
67
-
68
- <reasoning>
69
- The assistant used the todo list because:
70
- 1. The user provided multiple complex features to implement in a comma separated list
71
- 2. The todo list helps organize these large features into manageable tasks
72
- 3. This approach allows for tracking progress across the entire implementation
73
- </reasoning>
74
- </example>
75
-
76
- <example>
77
- User: Can you help optimize my React application? It's rendering slowly and has performance issues.</user>
78
- Assistant: I'll help optimize your React application. First, let me examine your codebase to identify potential performance bottlenecks.
79
- *Reviews component structure, render patterns, state management, and data fetching*
80
- Assistant: After analyzing your codebase, I've identified several performance issues. Let me create a todo list to track our optimization efforts.
81
- *Creates todo list with items like: 1) Implement memoization for expensive calculations in ProductList, 2) Add virtualization for long lists in Dashboard, 3) Optimize image loading in Gallery component, 4) Fix state update loops in ShoppingCart, 5) Review bundle size and implement code splitting*
82
- Let's start by implementing memoization for the expensive calculations in your ProductList component.</assistant>
83
-
84
- <reasoning>
85
- The assistant used the todo list because:
86
- 1. First, the assistant examined the codebase to identify specific performance issues
87
- 2. Based on this analysis, it identified multiple optimization opportunities
88
- 3. Performance optimization is a non-trivial task requiring multiple steps
89
- 4. The todo list helps methodically track improvements across different components
90
- 5. This systematic approach ensures all performance bottlenecks are addressed
91
- </reasoning>
92
- </example>
93
-
94
- ## Examples of When NOT to Use the Todo List
95
-
96
- <example>
97
- User: How do I print 'Hello World' in Python?
98
- Assistant: In Python, you can print "Hello World" with this simple code:
99
-
100
- python
101
- print("Hello World")
102
-
103
- This will output the text "Hello World" to the console when executed.</assistant>
104
-
105
- <reasoning>
106
- The assistant did not use the todo list because this is a single, trivial task that can be completed in one step. There's no need to track multiple tasks or steps for such a straightforward request.
107
- </reasoning>
108
- </example>
109
-
110
- <example>
111
- User: What does the git status command do?
112
- Assistant: The git status command shows the current state of your working directory and staging area. It displays which changes have been staged, which haven't, and which files aren't being tracked by Git. This is a fundamental command for understanding the current state of your repository before making commits.
113
-
114
- <reasoning>
115
- The assistant did not use the todo list because this is an informational request with no actual coding task to complete. The user is simply asking for an explanation, not for the assistant to perform multiple steps or tasks.
116
- </reasoning>
117
- </example>
118
-
119
- <example>
120
- User: Can you add a comment to the calculateTotal function to explain what it does?
121
- Assistant: Sure, let me add a comment to the calculateTotal function to explain what it does.
122
- * Uses the Edit tool to add a comment to the calculateTotal function *
123
-
124
- <reasoning>
125
- The assistant did not use the todo list because this is a single, straightforward task confined to one location in the code. Adding a comment doesn't require tracking multiple steps or systematic organization.
126
- </reasoning>
127
- </example>
128
-
129
- <example>
130
- User: Run npm install for me and tell me what happens.
131
- Assistant: I'll run the npm install command for you.
132
-
133
- *Executes: npm install*
134
-
135
- The command completed successfully. Here's the output:
136
- [Output of npm install command]
137
-
138
- All dependencies have been installed according to your package.json file.
139
-
140
- <reasoning>
141
- The assistant did not use the todo list because this is a single command execution with immediate results. There are no multiple steps to track or organize, making the todo list unnecessary for this straightforward task.
142
- </reasoning>
143
- </example>
144
-
145
- ## Task States and Management
146
-
147
- 1. **Task States**: Use these states to track progress:
148
- - pending: Task not yet started
149
- - in_progress: Currently working on (limit to ONE task at a time)
150
- - completed: Task finished successfully
151
-
152
- 2. **Task Management**:
153
- - Update task status in real-time as you work
154
- - Mark tasks complete IMMEDIATELY after finishing (don't batch completions)
155
- - Only have ONE task in_progress at any time
156
- - Complete current tasks before starting new ones
157
- - Remove tasks that are no longer relevant from the list entirely
158
-
159
- 3. **Task Completion Requirements**:
160
- - ONLY mark a task as completed when you have FULLY accomplished it
161
- - If you encounter errors, blockers, or cannot finish, keep the task as in_progress
162
- - When blocked, create a new task describing what needs to be resolved
163
- - Never mark a task as completed if:
164
- - Tests are failing
165
- - Implementation is partial
166
- - You encountered unresolved errors
167
- - You couldn't find necessary files or dependencies
168
-
169
- 4. **Task Breakdown**:
170
- - Create specific, actionable items
171
- - Break complex tasks into smaller, manageable steps
172
- - Use clear, descriptive task names
173
-
174
- When in doubt, use this tool. Being proactive with task management demonstrates attentiveness and ensures you complete all requirements successfully.
175
- `,schema:a});
176
- export{a as te,n as ue};
@@ -1 +0,0 @@
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,26 +0,0 @@
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
- json_type(${z.ref(E)}, ${z.lit(G)}) = 'null'
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
- CREATE TABLE IF NOT EXISTS threads (
5
- thread_id TEXT PRIMARY KEY,
6
- created_at TEXT NOT NULL,
7
- updated_at TEXT NOT NULL,
8
- metadata TEXT NOT NULL DEFAULT '{}',
9
- status TEXT NOT NULL DEFAULT 'idle',
10
- "values" TEXT,
11
- interrupts TEXT NOT NULL DEFAULT '{}',
12
- title TEXT
13
- )
14
- `.execute(x),await this.addColumnIfNotExists(x,"threads","title","TEXT"),await z`
15
- CREATE TABLE IF NOT EXISTS runs (
16
- run_id TEXT PRIMARY KEY,
17
- thread_id TEXT NOT NULL,
18
- assistant_id TEXT NOT NULL,
19
- created_at TEXT NOT NULL,
20
- updated_at TEXT NOT NULL,
21
- status TEXT NOT NULL DEFAULT 'pending',
22
- metadata TEXT NOT NULL DEFAULT '{}',
23
- multitask_strategy TEXT NOT NULL DEFAULT 'reject',
24
- FOREIGN KEY (thread_id) REFERENCES threads(thread_id) ON DELETE CASCADE
25
- )
26
- `.execute(x)}async addColumnIfNotExists(x,E,F,B){if(!(await z`PRAGMA table_info(${z.raw(E)})`.execute(x)).rows.map((H)=>H.name).includes(F))await z`ALTER TABLE ${z.raw(E)} ADD COLUMN ${z.raw(F)} ${z.raw(B)}`.execute(x)}async createIndexes(x){await z`CREATE INDEX IF NOT EXISTS idx_threads_status ON threads(status)`.execute(x),await z`CREATE INDEX IF NOT EXISTS idx_threads_created_at ON threads(created_at)`.execute(x),await z`CREATE INDEX IF NOT EXISTS idx_threads_updated_at ON threads(updated_at)`.execute(x),await z`CREATE INDEX IF NOT EXISTS idx_runs_thread_id ON runs(thread_id)`.execute(x),await z`CREATE INDEX IF NOT EXISTS idx_runs_status ON runs(status)`.execute(x)}}export{I as SQLiteAdapter};