@vibeflow-tools/cli 0.6.0 → 0.7.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/CHANGELOG.md +25 -0
- package/README.md +200 -80
- package/dist/chunk-D6KVQU62.js +7 -0
- package/dist/cli/chunk-D6KVQU62.js +7 -0
- package/dist/cli/{files-LTK2TDC2.js → files-TKEFFLPI.js} +1 -1
- package/dist/cli/index.js +118 -27952
- package/dist/client/kanban-browser.js +14 -14
- package/dist/client/kanban.css +1 -1
- package/dist/client/overlay-browser.js +34 -4
- package/dist/{cli/files-MEEV7E6V.js → files-TKEFFLPI.js} +1 -1
- package/dist/index.js +118 -27952
- package/dist/overlay.css +31 -0
- package/package.json +2 -2
- package/dist/chunk-GEQ64RVF.js +0 -7
- package/dist/chunk-IUZWZWMW.js +0 -7
- package/dist/chunk-PCPVP4ZD.js +0 -7
- package/dist/chunk-XO547RIH.js +0 -7
- package/dist/cli/chunk-GEQ64RVF.js +0 -7
- package/dist/cli/chunk-IUZWZWMW.js +0 -7
- package/dist/cli/chunk-PCPVP4ZD.js +0 -7
- package/dist/cli/chunk-XO547RIH.js +0 -7
- package/dist/cli/files-R6YCYMTI.js +0 -2
- package/dist/cli/files-SUCOSQAO.js +0 -2
- package/dist/files-LTK2TDC2.js +0 -2
- package/dist/files-MEEV7E6V.js +0 -2
- package/dist/files-R6YCYMTI.js +0 -2
- package/dist/files-SUCOSQAO.js +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.7.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 8065d50: Use default agent from settings in the agent picker dropdown, pre-selecting the configured default agent when opening the Agent tab.
|
|
8
|
+
- 8065d50: Persist overlay burger icon position to localStorage so it appears at the last dragged position after page reload.
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- 2e7a840: Change CLI console log prefix from [Proto] to [Vibeflow]
|
|
13
|
+
|
|
14
|
+
All console.log and console.error calls in the server now use
|
|
15
|
+
`[Vibeflow]` as the prefix instead of the legacy `[Proto]` name.
|
|
16
|
+
|
|
17
|
+
- 8065d50: Fix kanban agent runs: dispatch webapp agent runs to local CLI server, show agent badge only when agent has actually run (commits exist), add optimistic agent run entry to prevent empty UI on agent start, and ensure board icon container has consistent dimensions for dual mode.
|
|
18
|
+
- 8065d50: Remove the agent badge from task cards, list view rows, and detail panel metadata. Agent status badges (running/queued/done) for active runs remain.
|
|
19
|
+
- 8065d50: Increase file preview modal max-width from 700px to 1100px for better readability of large screenshots and code previews.
|
|
20
|
+
|
|
21
|
+
## 0.6.1
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- 52d796e: Add current git branch name display in kanban header, reorder workflow settings toggles, and fix agent instruction step numbering for createBranch workflow. Also add 'editing' state to collaborative editing event types.
|
|
26
|
+
- 52d796e: Improve CLI README with comprehensive command documentation, browser overlay injection methods, prototype writing guide, API reference, and agent integration details.
|
|
27
|
+
|
|
3
28
|
## 0.6.0
|
|
4
29
|
|
|
5
30
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -1,145 +1,265 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Vibeflow
|
|
2
2
|
|
|
3
|
-
> **
|
|
3
|
+
> **Tell your AI agent exactly what to fix — by clicking on it.**
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
[](https://www.apache.org/licenses/LICENSE-2.0)
|
|
7
|
-
[](https://nodejs.org)
|
|
5
|
+
Vibeflow eliminates the back-and-forth of describing UI bugs in words. Click any element on a page to create a task with its exact CSS selector, URL, and source location. Your agent gets precise, actionable context — no "the button in the top right" needed.
|
|
8
6
|
|
|
9
|
-
|
|
7
|
+
🌐 [Website](https://vibeflow.tools) · 📖 [Tutorial](https://vibeflow.tools/tutorial)
|
|
10
8
|
|
|
11
9
|
```bash
|
|
12
|
-
npm install -g vibeflow
|
|
13
|
-
|
|
10
|
+
npm install -g @vibeflow-tools/cli
|
|
11
|
+
vibeflow kanban
|
|
14
12
|
```
|
|
15
13
|
|
|
16
|
-
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Why It Matters
|
|
17
|
+
|
|
18
|
+
AI agents write code fast, but **understanding what to change is slow**. Describing a UI issue in prose wastes tokens and produces wrong fixes.
|
|
19
|
+
|
|
20
|
+
Vibeflow turns visual feedback into structured tasks:
|
|
17
21
|
|
|
18
|
-
-
|
|
19
|
-
-
|
|
22
|
+
- **Click any element** → instant task with CSS selector, URL, and source file location
|
|
23
|
+
- **Track on a Kanban board** → see everything at a glance, drag between columns
|
|
24
|
+
- **Agents implement with context** → no guessing, no wrong elements, no wasted iterations
|
|
25
|
+
|
|
26
|
+
Perfect for small UI fixes, broken layouts, spacing issues, and anything where pointing is faster than explaining.
|
|
20
27
|
|
|
21
28
|
---
|
|
22
29
|
|
|
23
|
-
##
|
|
30
|
+
## Quick Start
|
|
24
31
|
|
|
25
|
-
|
|
32
|
+
```bash
|
|
33
|
+
# 1. Embed the overlay into your app (bookmarklet, script tag, or devtools)
|
|
34
|
+
# Visit /inject on your running server for ready-to-use snippets
|
|
26
35
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
- **"I described it to the AI but it got confused"** — prose descriptions lose precision. Agents work best with structured, reproducible context.
|
|
36
|
+
# 2. Open the Kanban board
|
|
37
|
+
vibeflow kanban
|
|
30
38
|
|
|
31
|
-
|
|
39
|
+
# 3. Click elements in your app to annotate, or create tasks on the board
|
|
32
40
|
|
|
33
|
-
|
|
41
|
+
# 4. Your agent picks the next task with full context executing following command
|
|
42
|
+
vibeflow tasks --next
|
|
34
43
|
|
|
35
|
-
|
|
44
|
+
```
|
|
36
45
|
|
|
37
|
-
|
|
46
|
+
---
|
|
38
47
|
|
|
39
|
-
|
|
48
|
+
## Commands
|
|
40
49
|
|
|
41
|
-
|
|
50
|
+
| Command | Description |
|
|
51
|
+
|---------|-------------|
|
|
52
|
+
| `vibeflow kanban [dir]` | Start the server and open the live Kanban board in your browser |
|
|
53
|
+
| `vibeflow serve [target]` | Serve HTML files with live annotation overlay, or run API-only task server for existing apps |
|
|
54
|
+
| `vibeflow tasks` | List, filter, create, edit, and comment on tasks |
|
|
55
|
+
| `vibeflow telemetry` | Manage CLI usage telemetry (opt-out at any time) |
|
|
56
|
+
|
|
57
|
+
### `vibeflow kanban [dir]`
|
|
42
58
|
|
|
43
59
|
```bash
|
|
44
|
-
vibeflow
|
|
60
|
+
vibeflow kanban # open Kanban board for current directory
|
|
61
|
+
vibeflow kanban ./my-project # open Kanban for a specific project
|
|
45
62
|
```
|
|
46
63
|
|
|
47
|
-
|
|
64
|
+
The Kanban board provides a visual task tracker with drag-and-drop columns, agent status display, and file attachments. Create tasks directly on the board or import them from annotated prototypes.
|
|
48
65
|
|
|
49
|
-
|
|
66
|
+
### `vibeflow serve [target]`
|
|
50
67
|
|
|
51
68
|
```bash
|
|
52
|
-
vibeflow
|
|
69
|
+
vibeflow serve . # serve all HTML files in current directory
|
|
70
|
+
vibeflow serve dashboard.html # serve a single file
|
|
71
|
+
vibeflow serve -p 4000 . # custom port
|
|
72
|
+
vibeflow serve --no-open . # don't open browser automatically
|
|
73
|
+
vibeflow serve # API-only mode — connects to an existing hosted app
|
|
53
74
|
```
|
|
54
75
|
|
|
55
|
-
|
|
76
|
+
Serve HTML prototypes with the annotation overlay — click any element to create a task with its CSS selector, URL, and source location.
|
|
77
|
+
|
|
78
|
+
### `vibeflow tasks`
|
|
56
79
|
|
|
57
|
-
|
|
80
|
+
Full task management from the command line — designed to be agent-friendly.
|
|
58
81
|
|
|
59
82
|
```bash
|
|
60
|
-
|
|
83
|
+
# Pick the next task (auto-claims a todo task)
|
|
84
|
+
vibeflow tasks --next # picks highest-priority todo task
|
|
85
|
+
vibeflow tasks --next --type Bug # next bug task only
|
|
86
|
+
|
|
87
|
+
# List tasks
|
|
88
|
+
vibeflow tasks # all tasks (default: 20 most recent)
|
|
89
|
+
vibeflow tasks --limit 0 # show all tasks (no limit)
|
|
90
|
+
vibeflow tasks --json # machine-readable JSON output
|
|
91
|
+
|
|
92
|
+
# Filter
|
|
93
|
+
vibeflow tasks --status todo # by status
|
|
94
|
+
vibeflow tasks --type Bug # by type (Task, Bug, Feature, Enhancement, Research)
|
|
95
|
+
vibeflow tasks --user dev@example.com # by author email
|
|
96
|
+
vibeflow tasks --tag frontend --tag urgent # by tags (AND matching)
|
|
97
|
+
|
|
98
|
+
# Get full details of a single task
|
|
99
|
+
vibeflow tasks --get <id> # supports partial ID prefix
|
|
100
|
+
|
|
101
|
+
# Create a task
|
|
102
|
+
vibeflow tasks --add --title "Fix header" --description "Button overflows on mobile"
|
|
103
|
+
|
|
104
|
+
# Edit a task
|
|
105
|
+
vibeflow tasks --edit <id> --set-status in-progress
|
|
106
|
+
vibeflow tasks --edit <id> --title "Updated title" --description "More detail"
|
|
107
|
+
|
|
108
|
+
# Mark as review (requires implementation report)
|
|
109
|
+
vibeflow tasks --edit <id> --set-status review \
|
|
110
|
+
--commit-message "fix: header layout" \
|
|
111
|
+
--comment "Fixed the alignment issue by adjusting flex-wrap"
|
|
61
112
|
```
|
|
62
113
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
114
|
+
**Task types:** Task · Bug · Feature · Enhancement · Research
|
|
115
|
+
**Task statuses:** backlog → todo → in-progress → review → done
|
|
116
|
+
**Priorities:** Critical · High · Medium · Low
|
|
117
|
+
|
|
118
|
+
### `vibeflow telemetry`
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
vibeflow telemetry # show current status
|
|
122
|
+
vibeflow telemetry --disable # opt out of usage tracking
|
|
123
|
+
vibeflow telemetry --enable # opt back in
|
|
124
|
+
```
|
|
66
125
|
|
|
67
|
-
|
|
126
|
+
No PII is ever collected. User identity is hashed.
|
|
68
127
|
|
|
69
128
|
---
|
|
70
129
|
|
|
71
|
-
##
|
|
130
|
+
## Browser Overlay
|
|
72
131
|
|
|
73
|
-
|
|
132
|
+
The overlay is a Shadow DOM panel injected into any page — HTML prototypes or live apps:
|
|
74
133
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
134
|
+
- **Click-to-annotate** — click any element to open a task form, pre-filled with CSS selector, URL, and source location
|
|
135
|
+
- **Task sidebar** — lists open tasks with status badges; click to jump to the annotated element
|
|
136
|
+
- **Task indicators** — numbered markers on annotated elements
|
|
137
|
+
- **Real-time sync** — over WebSocket with live file watching
|
|
138
|
+
- **Screenshot capture** — attach screenshots to tasks via the overlay
|
|
139
|
+
- **Dark theme** — polished dark UI, no configuration needed
|
|
140
|
+
- **Keyboard shortcut** — `Alt+A` to toggle annotation mode
|
|
141
|
+
- **CSP-safe injection** — bookmarklet bypasses `script-src` restrictions
|
|
79
142
|
|
|
80
|
-
###
|
|
143
|
+
### Injection Methods
|
|
81
144
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
|
85
|
-
|
|
86
|
-
|
|
|
87
|
-
|
|
|
88
|
-
|
|
|
89
|
-
| `vibeflow tasks --add --title "..." --description "..."` | Create a new task |
|
|
90
|
-
| `vibeflow tasks --edit <id> --set-status review --commit-message "..." --comment "..."` | Mark task as review, auto-commit staged files, add report |
|
|
91
|
-
| `vibeflow tasks --json` | Machine-readable JSON output |
|
|
145
|
+
The overlay can be injected into any page three ways:
|
|
146
|
+
|
|
147
|
+
| Method | Best for | CSP-safe |
|
|
148
|
+
|--------|----------|----------|
|
|
149
|
+
| **Bookmarklet** (recommended) | Any page, including production apps | Yes |
|
|
150
|
+
| **Script tag** | Pages you control the HTML of | No |
|
|
151
|
+
| **DevTools console** | Quick one-off sessions | Yes |
|
|
92
152
|
|
|
93
|
-
|
|
153
|
+
Visit `/inject` on your running server for ready-to-use bookmarklets and snippets.
|
|
94
154
|
|
|
95
155
|
---
|
|
96
156
|
|
|
97
|
-
##
|
|
157
|
+
## How It Works
|
|
98
158
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
159
|
+
```
|
|
160
|
+
You browse your app → click to annotate → task created with context
|
|
161
|
+
↑ ↓
|
|
162
|
+
browser reloads ← agent implements ← vibeflow tasks --next
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
1. **Overlay** — embed the bookmarklet or script into your app, click any element to annotate
|
|
166
|
+
2. **Kanban** — open the board to see all tasks at a glance, create new ones directly
|
|
167
|
+
3. **Tasks** — `vibeflow tasks --next` picks the highest-priority task with full context for your agent
|
|
168
|
+
4. **Iterate** — agent implements, browser reloads, annotate again
|
|
109
169
|
|
|
110
170
|
---
|
|
111
171
|
|
|
112
|
-
##
|
|
172
|
+
## Writing Prototypes
|
|
173
|
+
|
|
174
|
+
Each HTML file is one screen. Use Tailwind CSS, Lucide icons, and Google Fonts via CDN — the annotation contract tells your LLM to use exactly these libraries.
|
|
175
|
+
|
|
176
|
+
**Rules:**
|
|
177
|
+
- One file per screen — name after the route (`login.html`, `dashboard.html`)
|
|
178
|
+
- Every meaningful element gets a `data-vibeflow-id` — kebab-case, globally unique
|
|
179
|
+
- Navigate between pages with relative links: `<a href="./page.html">`
|
|
180
|
+
- Repeat navigation on every page (no shared includes)
|
|
181
|
+
|
|
182
|
+
```html
|
|
183
|
+
<!DOCTYPE html>
|
|
184
|
+
<html lang="en">
|
|
185
|
+
<head>
|
|
186
|
+
<meta charset="UTF-8">
|
|
187
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
188
|
+
<title>App — Dashboard</title>
|
|
189
|
+
<script src="https://cdn.tailwindcss.com"></script>
|
|
190
|
+
<script src="https://unpkg.com/lucide@latest/dist/umd/lucide.min.js"></script>
|
|
191
|
+
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
|
|
192
|
+
<style>body { font-family: 'Inter', sans-serif; }</style>
|
|
193
|
+
</head>
|
|
194
|
+
<body class="bg-gray-50 text-gray-900 min-h-screen">
|
|
195
|
+
<main data-vibeflow-id="main-content" class="max-w-4xl mx-auto px-6 py-8">
|
|
196
|
+
<h1 data-vibeflow-id="page-title" class="text-2xl font-semibold">Dashboard</h1>
|
|
197
|
+
</main>
|
|
198
|
+
<script>lucide.createIcons();</script>
|
|
199
|
+
</body>
|
|
200
|
+
</html>
|
|
201
|
+
```
|
|
113
202
|
|
|
114
|
-
|
|
115
|
-
# Open the Kanban board
|
|
116
|
-
npx vibeflow kanban
|
|
203
|
+
---
|
|
117
204
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
205
|
+
## Agent Integration
|
|
206
|
+
|
|
207
|
+
Vibeflow tasks are formatted for AI agents with full context:
|
|
208
|
+
|
|
209
|
+
- **CSS selectors** — exact element targeting, no guesswork
|
|
210
|
+
- **Source locations** — file, line, and column where the element is defined
|
|
211
|
+
- **Screenshots** — visual context attached to tasks
|
|
212
|
+
- **Comments** — threaded discussions on each task
|
|
213
|
+
- **File attachments** — research reports, specs, and reference materials
|
|
214
|
+
- **Git commits** — changes linked back to tasks via `[proto:task-id]` in commit messages
|
|
215
|
+
|
|
216
|
+
Agents can also run directly from the Kanban board via `POST /api/agent/run`, which spawns [opencode](https://github.com/opencode-ai/opencode) with full task context.
|
|
217
|
+
|
|
218
|
+
---
|
|
219
|
+
|
|
220
|
+
## API
|
|
221
|
+
|
|
222
|
+
A REST API and tRPC router are available at `http://localhost:3700` for integrations and the browser overlay. Key endpoints:
|
|
223
|
+
|
|
224
|
+
- `/kanban` — live Kanban board
|
|
225
|
+
- `GET/POST /api/tasks` — list and create tasks
|
|
226
|
+
- `GET/PATCH/DELETE /api/tasks/:id` — manage individual tasks
|
|
227
|
+
- `GET/POST /api/tasks/:id/comments` — task comments
|
|
228
|
+
- `GET/POST/DELETE /api/tasks/:id/files` — file attachments
|
|
229
|
+
- `POST /api/agent/run` — spawn an AI agent for a task
|
|
230
|
+
- `/inject` — overlay injection helper page
|
|
231
|
+
|
|
232
|
+
See [src/server/server.ts](https://github.com/zorcec/vibeflow/blob/main/packages/cli/src/server/server.ts) for the full API.
|
|
121
233
|
|
|
122
234
|
---
|
|
123
235
|
|
|
124
|
-
##
|
|
236
|
+
## Installation
|
|
125
237
|
|
|
126
|
-
|
|
238
|
+
```bash
|
|
239
|
+
npm install -g @vibeflow-tools/cli
|
|
240
|
+
```
|
|
127
241
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
242
|
+
Or run without installing:
|
|
243
|
+
|
|
244
|
+
```bash
|
|
245
|
+
npx @vibeflow-tools/cli kanban
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
**Requirements:** Node.js >= 22
|
|
133
249
|
|
|
134
250
|
---
|
|
135
251
|
|
|
136
|
-
##
|
|
252
|
+
## Contributing
|
|
137
253
|
|
|
138
|
-
|
|
139
|
-
|
|
254
|
+
```bash
|
|
255
|
+
pnpm install # install dependencies
|
|
256
|
+
pnpm build:cli # build CLI
|
|
257
|
+
pnpm test # unit tests
|
|
258
|
+
pnpm test:e2e # end-to-end tests
|
|
259
|
+
```
|
|
140
260
|
|
|
141
261
|
---
|
|
142
262
|
|
|
143
263
|
## License
|
|
144
264
|
|
|
145
|
-
[Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0)
|
|
265
|
+
[Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0) — see [NOTICE](https://github.com/zorcec/vibeflow/blob/main/NOTICE) for third-party attributions.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{readdirSync as W,writeFileSync as J,readFileSync as V,unlinkSync as b,statSync as v,mkdirSync as q,existsSync as c}from"fs";import{join as m,basename as R}from"path";var g=".vibeflow",C="tasks",k="tasks/files",A="tasks/screenshots",Z="config.json";import{existsSync as f,readFileSync as O,writeFileSync as _,mkdirSync as p,readdirSync as h,unlinkSync as D,renameSync as F}from"fs";import{join as u,extname as I}from"path";import{randomBytes as z}from"crypto";var j=["backlog","todo","in-progress","review","done"];function K(){return z(15).toString("hex")}function S(e){return u(e,g,C)}function M(e){let i=u(e,g),n=u(i,"files"),s=u(i,k),r=u(i,"screenshots"),t=u(i,A);if(f(n)){p(s,{recursive:!0});for(let o of h(n)){let a=u(n,o),l=u(s,o);if(!f(l))try{F(a,l)}catch{}}}if(f(r)){p(t,{recursive:!0});for(let o of h(r)){let a=u(r,o),l=u(t,o);if(!f(l))try{F(a,l)}catch{}}}}function re(e){M(e),p(S(e),{recursive:!0}),p(u(e,g,A),{recursive:!0})}function w(e){return e.slice(0,10)}function U(e,i,n){let s=S(e);return n?u(s,w(n),`${i}.json`):u(s,`${i}.json`)}function T(e,i){let n=S(e);if(!f(n))return null;for(let s of h(n,{withFileTypes:!0}))if(s.isDirectory()){let r=u(n,s.name,`${i}.json`);if(f(r))return r}else if(s.name===`${i}.json`)return u(n,s.name);return null}function H(e){let i=(()=>{if(typeof e.type!="string")return;let n=e.type.trim();if(!(!n||n==="[object Object]"))return n})();return{id:String(e.id??""),title:String(e.title??"Untitled"),description:String(e.description??""),status:j.includes(e.status)?e.status:"todo",url:e.url?String(e.url):void 0,selector:(()=>{let n=String(e.selector??"/");return e.file&&!e.cssSelector&&n.startsWith(String(e.file))?e.url?String(e.url):"/":n})(),cssSelector:e.cssSelector&&String(e.cssSelector)!==String(e.selector??"/")?String(e.cssSelector):void 0,file:e.file?String(e.file):void 0,line:e.line!=null?Number(e.line):void 0,col:e.col!=null?Number(e.col):void 0,component:e.component?String(e.component):void 0,type:i,priority:e.priority?String(e.priority):void 0,...e.reportBack===!0&&{reportBack:!0},agent:e.agent?String(e.agent):void 0,model:e.model?String(e.model):void 0,author:e.author?String(e.author):void 0,commits:Array.isArray(e.commits)?e.commits.map(n=>({sha:String(n.sha??""),message:String(n.message??""),timestamp:String(n.timestamp??new Date().toISOString())})):void 0,created:String(e.created??new Date().toISOString()),updated:e.updated?String(e.updated):void 0,comments:Array.isArray(e.comments)?e.comments.map(n=>({...n,text:n.text??n.content??""})):[],files:Array.isArray(e.files)?e.files.map(n=>typeof n=="string"?{name:n,addedAt:new Date().toISOString()}:{name:String(n.name??""),addedAt:String(n.addedAt??new Date().toISOString()),linkedPath:n.linkedPath?String(n.linkedPath):void 0,mimeType:n.mimeType?String(n.mimeType):void 0}).filter(n=>n.name):[],screenshot:e.screenshot?String(e.screenshot):void 0,annotatedElementText:e.annotatedElementText?String(e.annotatedElementText):void 0,tags:Array.isArray(e.tags)?e.tags.filter(n=>typeof n=="string"&&n.length>0):void 0,sortKey:e.sortKey?String(e.sortKey):void 0}}function E(e,i){let n=u(S(e),w(i.created));p(n,{recursive:!0});let s=u(n,`${i.id}.json`),r=s+".tmp";_(r,JSON.stringify(i,null,2),"utf-8"),F(r,s)}function oe(e,i){let n=(()=>{let r=(i.priority??"").trim().toLowerCase();return r==="critical"?"Critical":r==="high"?"High":r==="low"?"Low":"Medium"})(),s={...i,priority:n,id:K(),created:new Date().toISOString(),comments:[],files:[]};return E(e,s),s}function y(e){try{let i=O(e,"utf-8");if(e.endsWith(".json")){let n=JSON.parse(i);return!n||typeof n!="object"||!("id"in n)?null:H(n)}return null}catch{return null}}function L(e){let i=S(e);if(!f(i))return[];let n=[];for(let s of h(i,{withFileTypes:!0}))if(s.isDirectory()){let r=u(i,s.name);for(let t of h(r))if(I(t)===".json"){let o=u(r,t),a=y(o);a&&n.push({task:a,filePath:o})}}else if(I(s.name)===".json"){let r=u(i,s.name),t=y(r);t&&n.push({task:t,filePath:r})}return n}function ae(e){return L(e).map(({task:i})=>i)}function ue(e){return L(e).map(({task:i,filePath:n})=>({...i,filePath:n}))}function N(e,i,n){let s=T(e,i),r=s?y(s):null;if(!r)return null;let t={...r,...n,updated:new Date().toISOString()};if(E(e,t),s&&s!==U(e,i,t.created))try{D(s)}catch{}return t}function le(e,i){let n=T(e,i);return n?(D(n),!0):!1}function ce(e,i,n){return{id:e.id,status:e.status,title:e.title,description:e.description,...e.url&&{url:e.url},selector:e.selector,...e.file&&{file:e.file},...e.line!=null&&{line:e.line},...e.col!=null&&{col:e.col},...e.component&&{component:e.component},...e.type&&{type:e.type},...e.priority&&{priority:e.priority},...i&&i.length>0&&{structuredComments:i},...n&&n.length>0&&{linkedFiles:n},...e.reportBack&&{reportBack:!0},created:e.created}}function me(e,i,n,s,r){let t=[];if(t.push(`[${e.status}] ${e.title}`),t.push(` id: ${e.id}`),t.push(` file: ${i}`),e.file&&t.push(` source: ${e.file}${e.line!=null?`:${e.line}`:""}${e.col!=null?`:${e.col}`:""}`),e.component&&t.push(` component: ${e.component}`),t.push(` selector: ${e.selector??"/"}`),e.cssSelector&&t.push(` css: ${e.cssSelector}`),e.url&&t.push(` url: ${e.url}`),e.commits&&e.commits.length>0)if(e.commits.length===1)t.push(` commit: ${e.commits[0].sha}`);else{t.push(` commits (${e.commits.length}):`);for(let o of e.commits)t.push(` ${o.sha.slice(0,8)} ${o.timestamp} ${o.message.slice(0,60)}`)}if(t.push(` created: ${e.created}`),e.type&&t.push(` type: ${e.type}`),e.priority&&t.push(` priority: ${e.priority}`),e.author&&t.push(` author: ${e.author}`),e.description){t.push(" description:");for(let o of e.description.split(`
|
|
3
|
+
`))t.push(` ${o}`)}if(e.annotatedElementText&&t.push(` element text: ${e.annotatedElementText}`),n.length>0){t.push(` comments (${n.length}):`);for(let o of n){let a=o.updatedAt?` (edited ${o.updatedAt})`:"";t.push(` [${o.author??"user"}] ${o.createdAt}${a}`);for(let l of o.text.split(`
|
|
4
|
+
`))t.push(` ${l}`)}}if(s.length>0){t.push(` linked files (${s.length}):`);for(let o of s){t.push(` - ${o.name} ${o.url}`);let a=o.linkedPath??u(r,".vibeflow","files",e.id,o.name);if(/\.(md|txt)$/i.test(o.name)&&o.size<1e5&&f(a))try{let l=O(a,"utf-8");t.push(" \u250C\u2500\u2500 content \u2500\u2500");for(let B of l.split(`
|
|
5
|
+
`))t.push(` \u2502 ${B}`);t.push(" \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500")}catch{}}}return t.join(`
|
|
6
|
+
`)}function fe(e){let{autoCommit:i,autoPush:n,autoComment:s,createBranch:r}=e,t=[];if(t.push("Agent instructions (concise):"),t.push(" Discover: vibeflow tasks --status todo | vibeflow tasks --type Research | vibeflow tasks --user <email> | vibeflow tasks --tag <tag>"),t.push(" Details: vibeflow tasks --get <id> (full task info with comments and files)"),t.push(' Create: vibeflow tasks --add --title "..." --description "..."'),t.push(""),t.push(" Workflow:"),r?(t.push(" \u26A0 Create a branch FIRST, before any implementation:"),t.push(" 1. git checkout -b <short-name> (e.g. fix/annotation-errors, feat/eye-toggle, chore/cleanup-extension)"),t.push(" Branch name rules: lowercase, kebab-case, 2-5 words, prefix fix/feat/chore/docs."),t.push(" Describe the WORK done (not dates). Bad: agent/2026-04-16. Good: fix/bug-errors-visibility."),t.push(" 2. vibeflow tasks --edit <id> --set-status in-progress \u2190 CLAIM TASK"),t.push(" 3. <implement the change>")):(t.push(" \u26A0 IMMEDIATELY set in-progress BEFORE any implementation work:"),t.push(" 1. vibeflow tasks --edit <id> --set-status in-progress \u2190 DO THIS FIRST"),t.push(" 2. <implement the change>")),i){t.push(r?" 4. git add <files> (stage your changes first)":" 3. git add <files> (stage your changes first)");let o=["--set-status review"];i&&o.push('--commit-message "<one-line summary>"'),s&&o.push('--comment "<report>"'),t.push(` ${r?"5":"4"}. vibeflow tasks --edit <id> ${o.join(" ")}`),t.push(" CLI will commit staged changes and link the commit SHA automatically.")}else{t.push(r?' 4. git add <files> && vibeflow tasks --commit --task <id> --message "<one-line summary>"':' 3. git add <files> && vibeflow tasks --commit --task <id> --message "<one-line summary>"');let o=["--set-status review"];s&&o.push('--comment "<report>"'),t.push(` ${r?"5":"4"}. vibeflow tasks --edit <id> ${o.join(" ")}`)}return s&&(t.push(""),t.push(" Comment format (--comment):"),t.push(" \xB7 Plain text for concise one-liners."),t.push(" \xB7 Markdown for multi-section reports. Use **bold**, bullet lists, code fences."),t.push(" \xB7 Must cover: what changed, why, key decisions, anything future agents should know."),t.push(" \xB7 For long reports, attach a .md file and reference it in the comment.")),t.push(""),i&&t.push(" [setting] Auto-commit ON: provide --commit-message when setting status to review; CLI commits."),n&&t.push(" [setting] Auto-push ON: CLI pushes after the commit automatically."),s&&t.push(" [setting] Auto-comment ON: --comment is required when setting status to review."),r&&t.push(" [setting] Create branch ON: all work goes on a dedicated branch created before implementation."),e.hasResearchTasks&&(t.push(" Research tasks: NEVER generate code \u2014 research only."),t.push(" Attach a .md report before marking Research tasks as review."),t.push(" CLI ENFORCES: cannot mark Research as review without an attached .md report."),t.push(" Use --report-file <path> to upload your .md report when marking as review:"),t.push(' vibeflow tasks --edit <id> --set-status review --report-file ./report.md --comment "..."'),t.push(" The file is uploaded to the task and deleted from the local filesystem automatically.")),e.hasBugTasks&&(t.push(" Bug tasks: Include error logs / stack traces in the commit comment."),t.push(" Describe: the symptom, the console error, what triggered it, and how it was fixed.")),t.push(" CRITICAL: NEVER edit .vibeflow/ task files directly."),t.push(" All task operations (status, comments, commits) must go through CLI commands."),t.push(" CRITICAL: Set in-progress BEFORE reading/planning. Other agents may pick the same task."),t.push(" The in-progress transition signals ownership. Skip it and another agent may duplicate your work."),t.push(" Sequence: discover tasks \u2192 pick one \u2192 set in-progress \u2192 THEN read details and implement."),t.push(' CRITICAL: NEVER set a task status to "done".'),t.push(' When your implementation is complete, set the status to "review" \u2014 not "done".'),t.push(" Only humans can mark tasks as done after reviewing the work."),t.push(" The CLI will warn you and still allow the change \u2014 but agents must not use it."),t.push(""),t.join(`
|
|
7
|
+
`)}var P=".linked.json";function d(e,i){return m(e,g,k,i)}function G(e,i){q(d(e,i),{recursive:!0})}function Y(e,i){let n=m(d(e,i),P);if(!c(n))return[];try{return JSON.parse(V(n,"utf-8"))}catch{return[]}}function Q(e,i){let n=T(e,i),s=n?y(n):null;return!s?.files||s.files.length===0?[]:s.files}function $(e,i,n){N(e,i,{files:n})}function x(e,i){let n=Q(e,i),s=m(d(e,i),P);if(!c(s))return n;let r=Y(e,i);if(r.length===0){try{b(s)}catch{}return n}let t=n.slice(),o=!1;for(let a of r)t.find(l=>l.linkedPath===a.path||l.name===a.name&&l.linkedPath)||(t.push({name:a.name,linkedPath:a.path,addedAt:new Date().toISOString()}),o=!0);o&&$(e,i,t);try{b(s)}catch{}return t}function X(e,i){let n=d(e,i),s=x(e,i),r=new Map;for(let t of s){if(t.linkedPath&&c(t.linkedPath)){let a=v(t.linkedPath);r.set(t.name,{name:t.name,size:a.size,url:`/api/tasks/${i}/files/${encodeURIComponent(t.name)}`,linkedPath:t.linkedPath,createdAt:a.mtime.toISOString()});continue}let o=m(n,t.name);if(c(o)){let a=v(o);r.set(t.name,{name:t.name,size:a.size,url:`/api/tasks/${i}/files/${encodeURIComponent(t.name)}`,createdAt:a.mtime.toISOString()})}}if(c(n))for(let t of W(n,{withFileTypes:!0})){if(!t.isFile()||t.name===P||r.has(t.name))continue;let o=m(n,t.name),a=v(o);r.set(t.name,{name:t.name,size:a.size,url:`/api/tasks/${i}/files/${encodeURIComponent(t.name)}`,createdAt:a.mtime.toISOString()})}return Array.from(r.values())}function ke(e,i,n,s){let r=R(n);G(e,i),J(m(d(e,i),r),s);let t=x(e,i);return t.find(o=>o.name===r&&!o.linkedPath)||(t.push({name:r,addedAt:new Date().toISOString()}),$(e,i,t)),{name:r,size:s.length,url:`/api/tasks/${i}/files/${encodeURIComponent(r)}`}}function Te(e,i,n){let s=R(n),r=x(e,i),t=r.findIndex(a=>a.name===s);if(t!==-1){let[a]=r.splice(t,1);if($(e,i,r),a&&!a.linkedPath){let l=m(d(e,i),s);c(l)&&b(l)}return!0}let o=m(d(e,i),s);return c(o)?(b(o),!0):!1}function be(e,i,n){let s=R(n),r=x(e,i).find(o=>o.name===s&&o.linkedPath);if(r?.linkedPath&&c(r.linkedPath))return r.linkedPath;let t=m(d(e,i),s);return c(t)?t:null}function xe(e,i){return X(e,i).length}export{g as a,C as b,A as c,Z as d,K as e,re as f,U as g,T as h,oe as i,y as j,ae as k,ue as l,N as m,le as n,ce as o,me as p,fe as q,d as r,G as s,X as t,ke as u,Te as v,be as w,xe as x};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{readdirSync as W,writeFileSync as J,readFileSync as V,unlinkSync as b,statSync as v,mkdirSync as q,existsSync as c}from"fs";import{join as m,basename as R}from"path";var g=".vibeflow",C="tasks",k="tasks/files",A="tasks/screenshots",Z="config.json";import{existsSync as f,readFileSync as O,writeFileSync as _,mkdirSync as p,readdirSync as h,unlinkSync as D,renameSync as F}from"fs";import{join as u,extname as I}from"path";import{randomBytes as z}from"crypto";var j=["backlog","todo","in-progress","review","done"];function K(){return z(15).toString("hex")}function S(e){return u(e,g,C)}function M(e){let i=u(e,g),n=u(i,"files"),s=u(i,k),r=u(i,"screenshots"),t=u(i,A);if(f(n)){p(s,{recursive:!0});for(let o of h(n)){let a=u(n,o),l=u(s,o);if(!f(l))try{F(a,l)}catch{}}}if(f(r)){p(t,{recursive:!0});for(let o of h(r)){let a=u(r,o),l=u(t,o);if(!f(l))try{F(a,l)}catch{}}}}function re(e){M(e),p(S(e),{recursive:!0}),p(u(e,g,A),{recursive:!0})}function w(e){return e.slice(0,10)}function U(e,i,n){let s=S(e);return n?u(s,w(n),`${i}.json`):u(s,`${i}.json`)}function T(e,i){let n=S(e);if(!f(n))return null;for(let s of h(n,{withFileTypes:!0}))if(s.isDirectory()){let r=u(n,s.name,`${i}.json`);if(f(r))return r}else if(s.name===`${i}.json`)return u(n,s.name);return null}function H(e){let i=(()=>{if(typeof e.type!="string")return;let n=e.type.trim();if(!(!n||n==="[object Object]"))return n})();return{id:String(e.id??""),title:String(e.title??"Untitled"),description:String(e.description??""),status:j.includes(e.status)?e.status:"todo",url:e.url?String(e.url):void 0,selector:(()=>{let n=String(e.selector??"/");return e.file&&!e.cssSelector&&n.startsWith(String(e.file))?e.url?String(e.url):"/":n})(),cssSelector:e.cssSelector&&String(e.cssSelector)!==String(e.selector??"/")?String(e.cssSelector):void 0,file:e.file?String(e.file):void 0,line:e.line!=null?Number(e.line):void 0,col:e.col!=null?Number(e.col):void 0,component:e.component?String(e.component):void 0,type:i,priority:e.priority?String(e.priority):void 0,...e.reportBack===!0&&{reportBack:!0},agent:e.agent?String(e.agent):void 0,model:e.model?String(e.model):void 0,author:e.author?String(e.author):void 0,commits:Array.isArray(e.commits)?e.commits.map(n=>({sha:String(n.sha??""),message:String(n.message??""),timestamp:String(n.timestamp??new Date().toISOString())})):void 0,created:String(e.created??new Date().toISOString()),updated:e.updated?String(e.updated):void 0,comments:Array.isArray(e.comments)?e.comments.map(n=>({...n,text:n.text??n.content??""})):[],files:Array.isArray(e.files)?e.files.map(n=>typeof n=="string"?{name:n,addedAt:new Date().toISOString()}:{name:String(n.name??""),addedAt:String(n.addedAt??new Date().toISOString()),linkedPath:n.linkedPath?String(n.linkedPath):void 0,mimeType:n.mimeType?String(n.mimeType):void 0}).filter(n=>n.name):[],screenshot:e.screenshot?String(e.screenshot):void 0,annotatedElementText:e.annotatedElementText?String(e.annotatedElementText):void 0,tags:Array.isArray(e.tags)?e.tags.filter(n=>typeof n=="string"&&n.length>0):void 0,sortKey:e.sortKey?String(e.sortKey):void 0}}function E(e,i){let n=u(S(e),w(i.created));p(n,{recursive:!0});let s=u(n,`${i.id}.json`),r=s+".tmp";_(r,JSON.stringify(i,null,2),"utf-8"),F(r,s)}function oe(e,i){let n=(()=>{let r=(i.priority??"").trim().toLowerCase();return r==="critical"?"Critical":r==="high"?"High":r==="low"?"Low":"Medium"})(),s={...i,priority:n,id:K(),created:new Date().toISOString(),comments:[],files:[]};return E(e,s),s}function y(e){try{let i=O(e,"utf-8");if(e.endsWith(".json")){let n=JSON.parse(i);return!n||typeof n!="object"||!("id"in n)?null:H(n)}return null}catch{return null}}function L(e){let i=S(e);if(!f(i))return[];let n=[];for(let s of h(i,{withFileTypes:!0}))if(s.isDirectory()){let r=u(i,s.name);for(let t of h(r))if(I(t)===".json"){let o=u(r,t),a=y(o);a&&n.push({task:a,filePath:o})}}else if(I(s.name)===".json"){let r=u(i,s.name),t=y(r);t&&n.push({task:t,filePath:r})}return n}function ae(e){return L(e).map(({task:i})=>i)}function ue(e){return L(e).map(({task:i,filePath:n})=>({...i,filePath:n}))}function N(e,i,n){let s=T(e,i),r=s?y(s):null;if(!r)return null;let t={...r,...n,updated:new Date().toISOString()};if(E(e,t),s&&s!==U(e,i,t.created))try{D(s)}catch{}return t}function le(e,i){let n=T(e,i);return n?(D(n),!0):!1}function ce(e,i,n){return{id:e.id,status:e.status,title:e.title,description:e.description,...e.url&&{url:e.url},selector:e.selector,...e.file&&{file:e.file},...e.line!=null&&{line:e.line},...e.col!=null&&{col:e.col},...e.component&&{component:e.component},...e.type&&{type:e.type},...e.priority&&{priority:e.priority},...i&&i.length>0&&{structuredComments:i},...n&&n.length>0&&{linkedFiles:n},...e.reportBack&&{reportBack:!0},created:e.created}}function me(e,i,n,s,r){let t=[];if(t.push(`[${e.status}] ${e.title}`),t.push(` id: ${e.id}`),t.push(` file: ${i}`),e.file&&t.push(` source: ${e.file}${e.line!=null?`:${e.line}`:""}${e.col!=null?`:${e.col}`:""}`),e.component&&t.push(` component: ${e.component}`),t.push(` selector: ${e.selector??"/"}`),e.cssSelector&&t.push(` css: ${e.cssSelector}`),e.url&&t.push(` url: ${e.url}`),e.commits&&e.commits.length>0)if(e.commits.length===1)t.push(` commit: ${e.commits[0].sha}`);else{t.push(` commits (${e.commits.length}):`);for(let o of e.commits)t.push(` ${o.sha.slice(0,8)} ${o.timestamp} ${o.message.slice(0,60)}`)}if(t.push(` created: ${e.created}`),e.type&&t.push(` type: ${e.type}`),e.priority&&t.push(` priority: ${e.priority}`),e.author&&t.push(` author: ${e.author}`),e.description){t.push(" description:");for(let o of e.description.split(`
|
|
3
|
+
`))t.push(` ${o}`)}if(e.annotatedElementText&&t.push(` element text: ${e.annotatedElementText}`),n.length>0){t.push(` comments (${n.length}):`);for(let o of n){let a=o.updatedAt?` (edited ${o.updatedAt})`:"";t.push(` [${o.author??"user"}] ${o.createdAt}${a}`);for(let l of o.text.split(`
|
|
4
|
+
`))t.push(` ${l}`)}}if(s.length>0){t.push(` linked files (${s.length}):`);for(let o of s){t.push(` - ${o.name} ${o.url}`);let a=o.linkedPath??u(r,".vibeflow","files",e.id,o.name);if(/\.(md|txt)$/i.test(o.name)&&o.size<1e5&&f(a))try{let l=O(a,"utf-8");t.push(" \u250C\u2500\u2500 content \u2500\u2500");for(let B of l.split(`
|
|
5
|
+
`))t.push(` \u2502 ${B}`);t.push(" \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500")}catch{}}}return t.join(`
|
|
6
|
+
`)}function fe(e){let{autoCommit:i,autoPush:n,autoComment:s,createBranch:r}=e,t=[];if(t.push("Agent instructions (concise):"),t.push(" Discover: vibeflow tasks --status todo | vibeflow tasks --type Research | vibeflow tasks --user <email> | vibeflow tasks --tag <tag>"),t.push(" Details: vibeflow tasks --get <id> (full task info with comments and files)"),t.push(' Create: vibeflow tasks --add --title "..." --description "..."'),t.push(""),t.push(" Workflow:"),r?(t.push(" \u26A0 Create a branch FIRST, before any implementation:"),t.push(" 1. git checkout -b <short-name> (e.g. fix/annotation-errors, feat/eye-toggle, chore/cleanup-extension)"),t.push(" Branch name rules: lowercase, kebab-case, 2-5 words, prefix fix/feat/chore/docs."),t.push(" Describe the WORK done (not dates). Bad: agent/2026-04-16. Good: fix/bug-errors-visibility."),t.push(" 2. vibeflow tasks --edit <id> --set-status in-progress \u2190 CLAIM TASK"),t.push(" 3. <implement the change>")):(t.push(" \u26A0 IMMEDIATELY set in-progress BEFORE any implementation work:"),t.push(" 1. vibeflow tasks --edit <id> --set-status in-progress \u2190 DO THIS FIRST"),t.push(" 2. <implement the change>")),i){t.push(r?" 4. git add <files> (stage your changes first)":" 3. git add <files> (stage your changes first)");let o=["--set-status review"];i&&o.push('--commit-message "<one-line summary>"'),s&&o.push('--comment "<report>"'),t.push(` ${r?"5":"4"}. vibeflow tasks --edit <id> ${o.join(" ")}`),t.push(" CLI will commit staged changes and link the commit SHA automatically.")}else{t.push(r?' 4. git add <files> && vibeflow tasks --commit --task <id> --message "<one-line summary>"':' 3. git add <files> && vibeflow tasks --commit --task <id> --message "<one-line summary>"');let o=["--set-status review"];s&&o.push('--comment "<report>"'),t.push(` ${r?"5":"4"}. vibeflow tasks --edit <id> ${o.join(" ")}`)}return s&&(t.push(""),t.push(" Comment format (--comment):"),t.push(" \xB7 Plain text for concise one-liners."),t.push(" \xB7 Markdown for multi-section reports. Use **bold**, bullet lists, code fences."),t.push(" \xB7 Must cover: what changed, why, key decisions, anything future agents should know."),t.push(" \xB7 For long reports, attach a .md file and reference it in the comment.")),t.push(""),i&&t.push(" [setting] Auto-commit ON: provide --commit-message when setting status to review; CLI commits."),n&&t.push(" [setting] Auto-push ON: CLI pushes after the commit automatically."),s&&t.push(" [setting] Auto-comment ON: --comment is required when setting status to review."),r&&t.push(" [setting] Create branch ON: all work goes on a dedicated branch created before implementation."),e.hasResearchTasks&&(t.push(" Research tasks: NEVER generate code \u2014 research only."),t.push(" Attach a .md report before marking Research tasks as review."),t.push(" CLI ENFORCES: cannot mark Research as review without an attached .md report."),t.push(" Use --report-file <path> to upload your .md report when marking as review:"),t.push(' vibeflow tasks --edit <id> --set-status review --report-file ./report.md --comment "..."'),t.push(" The file is uploaded to the task and deleted from the local filesystem automatically.")),e.hasBugTasks&&(t.push(" Bug tasks: Include error logs / stack traces in the commit comment."),t.push(" Describe: the symptom, the console error, what triggered it, and how it was fixed.")),t.push(" CRITICAL: NEVER edit .vibeflow/ task files directly."),t.push(" All task operations (status, comments, commits) must go through CLI commands."),t.push(" CRITICAL: Set in-progress BEFORE reading/planning. Other agents may pick the same task."),t.push(" The in-progress transition signals ownership. Skip it and another agent may duplicate your work."),t.push(" Sequence: discover tasks \u2192 pick one \u2192 set in-progress \u2192 THEN read details and implement."),t.push(' CRITICAL: NEVER set a task status to "done".'),t.push(' When your implementation is complete, set the status to "review" \u2014 not "done".'),t.push(" Only humans can mark tasks as done after reviewing the work."),t.push(" The CLI will warn you and still allow the change \u2014 but agents must not use it."),t.push(""),t.join(`
|
|
7
|
+
`)}var P=".linked.json";function d(e,i){return m(e,g,k,i)}function G(e,i){q(d(e,i),{recursive:!0})}function Y(e,i){let n=m(d(e,i),P);if(!c(n))return[];try{return JSON.parse(V(n,"utf-8"))}catch{return[]}}function Q(e,i){let n=T(e,i),s=n?y(n):null;return!s?.files||s.files.length===0?[]:s.files}function $(e,i,n){N(e,i,{files:n})}function x(e,i){let n=Q(e,i),s=m(d(e,i),P);if(!c(s))return n;let r=Y(e,i);if(r.length===0){try{b(s)}catch{}return n}let t=n.slice(),o=!1;for(let a of r)t.find(l=>l.linkedPath===a.path||l.name===a.name&&l.linkedPath)||(t.push({name:a.name,linkedPath:a.path,addedAt:new Date().toISOString()}),o=!0);o&&$(e,i,t);try{b(s)}catch{}return t}function X(e,i){let n=d(e,i),s=x(e,i),r=new Map;for(let t of s){if(t.linkedPath&&c(t.linkedPath)){let a=v(t.linkedPath);r.set(t.name,{name:t.name,size:a.size,url:`/api/tasks/${i}/files/${encodeURIComponent(t.name)}`,linkedPath:t.linkedPath,createdAt:a.mtime.toISOString()});continue}let o=m(n,t.name);if(c(o)){let a=v(o);r.set(t.name,{name:t.name,size:a.size,url:`/api/tasks/${i}/files/${encodeURIComponent(t.name)}`,createdAt:a.mtime.toISOString()})}}if(c(n))for(let t of W(n,{withFileTypes:!0})){if(!t.isFile()||t.name===P||r.has(t.name))continue;let o=m(n,t.name),a=v(o);r.set(t.name,{name:t.name,size:a.size,url:`/api/tasks/${i}/files/${encodeURIComponent(t.name)}`,createdAt:a.mtime.toISOString()})}return Array.from(r.values())}function ke(e,i,n,s){let r=R(n);G(e,i),J(m(d(e,i),r),s);let t=x(e,i);return t.find(o=>o.name===r&&!o.linkedPath)||(t.push({name:r,addedAt:new Date().toISOString()}),$(e,i,t)),{name:r,size:s.length,url:`/api/tasks/${i}/files/${encodeURIComponent(r)}`}}function Te(e,i,n){let s=R(n),r=x(e,i),t=r.findIndex(a=>a.name===s);if(t!==-1){let[a]=r.splice(t,1);if($(e,i,r),a&&!a.linkedPath){let l=m(d(e,i),s);c(l)&&b(l)}return!0}let o=m(d(e,i),s);return c(o)?(b(o),!0):!1}function be(e,i,n){let s=R(n),r=x(e,i).find(o=>o.name===s&&o.linkedPath);if(r?.linkedPath&&c(r.linkedPath))return r.linkedPath;let t=m(d(e,i),s);return c(t)?t:null}function xe(e,i){return X(e,i).length}export{g as a,C as b,A as c,Z as d,K as e,re as f,U as g,T as h,oe as i,y as j,ae as k,ue as l,N as m,le as n,ce as o,me as p,fe as q,d as r,G as s,X as t,ke as u,Te as v,be as w,xe as x};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{r as a,s as b,t as c,u as d,v as e,w as f,x as g}from"./chunk-
|
|
2
|
+
import{r as a,s as b,t as c,u as d,v as e,w as f,x as g}from"./chunk-D6KVQU62.js";export{e as deleteFile,b as ensureFilesDir,g as getFileCount,f as getFilePath,a as getFilesDir,c as listFiles,d as saveFile};
|