@kw-yeh/vibeflow 4.0.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.
- package/LICENSE +21 -0
- package/README.md +146 -0
- package/dist/vibeflow.mjs +6103 -0
- package/dist/web/404/index.html +1 -0
- package/dist/web/404.html +1 -0
- package/dist/web/_next/static/-9MMnQDtlhk8JcEq6dTBS/_buildManifest.js +1 -0
- package/dist/web/_next/static/-9MMnQDtlhk8JcEq6dTBS/_ssgManifest.js +1 -0
- package/dist/web/_next/static/chunks/02e71eac.0250f42685eae210.js +18 -0
- package/dist/web/_next/static/chunks/043de7d2.3a6733c82bc2409f.js +160 -0
- package/dist/web/_next/static/chunks/1201.011a689cd95a4983.js +1 -0
- package/dist/web/_next/static/chunks/1282.d0e740390a16bb90.js +1 -0
- package/dist/web/_next/static/chunks/1396.cb165487d4bf0f35.js +1 -0
- package/dist/web/_next/static/chunks/167.98f928ccaed44837.js +1 -0
- package/dist/web/_next/static/chunks/1672.82392f784373fc1a.js +149 -0
- package/dist/web/_next/static/chunks/1776.9ad96593642a32f0.js +36 -0
- package/dist/web/_next/static/chunks/1840.fa1f1878af23fd9f.js +41 -0
- package/dist/web/_next/static/chunks/1886.22db355b96ff3e38.js +7 -0
- package/dist/web/_next/static/chunks/2039.461f2ac8bbfeb1cf.js +90 -0
- package/dist/web/_next/static/chunks/2107.2540b21d69c927d0.js +1 -0
- package/dist/web/_next/static/chunks/2205.fe6639ba89aebb99.js +1 -0
- package/dist/web/_next/static/chunks/2271.8d52a83cf1b02b3e.js +1 -0
- package/dist/web/_next/static/chunks/2396.a4c1620b6d217c02.js +1 -0
- package/dist/web/_next/static/chunks/260.7db9b90987032402.js +1 -0
- package/dist/web/_next/static/chunks/2806.c2a6f6733f2b439b.js +32 -0
- package/dist/web/_next/static/chunks/2817.a82d851ccf215c35.js +1 -0
- package/dist/web/_next/static/chunks/3082.5086ba86ade06629.js +1 -0
- package/dist/web/_next/static/chunks/3110.db844baaab453716.js +287 -0
- package/dist/web/_next/static/chunks/3289.04108f17cdf795e3.js +1 -0
- package/dist/web/_next/static/chunks/3618.418bfeef9a735cc6.js +148 -0
- package/dist/web/_next/static/chunks/3711.7f07235c9e8ae090.js +1 -0
- package/dist/web/_next/static/chunks/3746.81e4d62ebdb395eb.js +1 -0
- package/dist/web/_next/static/chunks/3846.d63d31d2de9a159c.js +1 -0
- package/dist/web/_next/static/chunks/3927.8202e4c7eeb07487.js +74 -0
- package/dist/web/_next/static/chunks/39a04069.9dd71f191712d3fa.js +62 -0
- package/dist/web/_next/static/chunks/4012.440934d750758d59.js +1 -0
- package/dist/web/_next/static/chunks/4109.f1de572405aa3b2b.js +309 -0
- package/dist/web/_next/static/chunks/4224.c5c8af77fc9b6c44.js +286 -0
- package/dist/web/_next/static/chunks/4270-6c9c75303137e3a5.js +9 -0
- package/dist/web/_next/static/chunks/4292.70e0a2a99b20e418.js +1 -0
- package/dist/web/_next/static/chunks/4459.814d84742e06267c.js +1 -0
- package/dist/web/_next/static/chunks/4485.e209e1d39502d049.js +226 -0
- package/dist/web/_next/static/chunks/4802.6f5a5e00488db074.js +1 -0
- package/dist/web/_next/static/chunks/5432.3349240a8cd1114c.js +94 -0
- package/dist/web/_next/static/chunks/5468.7440c698079f7f79.js +1 -0
- package/dist/web/_next/static/chunks/5469.5e1555e411d9c96b.js +1 -0
- package/dist/web/_next/static/chunks/5695.45dd981e66074a89.js +1 -0
- package/dist/web/_next/static/chunks/5785.01c97ed45f552929.js +8 -0
- package/dist/web/_next/static/chunks/59.a9be2f8a75bc42e9.js +1 -0
- package/dist/web/_next/static/chunks/5918.7a18726fa96ba97d.js +1 -0
- package/dist/web/_next/static/chunks/621.7f06a4c57845924d.js +27 -0
- package/dist/web/_next/static/chunks/6232.4ebeb2a3e3fde2f9.js +1 -0
- package/dist/web/_next/static/chunks/6390.df979849e0b82b10.js +1 -0
- package/dist/web/_next/static/chunks/6747.fe4ace8428cf57b8.js +1 -0
- package/dist/web/_next/static/chunks/67584bf0.bcc252f93280fffc.js +1 -0
- package/dist/web/_next/static/chunks/6848.18adf63b76b43ce0.js +1 -0
- package/dist/web/_next/static/chunks/6863.7c16f1cf40adc214.js +77 -0
- package/dist/web/_next/static/chunks/6981.db8f1cd11466723b.js +1 -0
- package/dist/web/_next/static/chunks/7045.7cf0eb88acb1ee65.js +1 -0
- package/dist/web/_next/static/chunks/7266.5fc4e54a82b394a3.js +23 -0
- package/dist/web/_next/static/chunks/7271.3e11a6c675bba517.js +1 -0
- package/dist/web/_next/static/chunks/7443.de45a50460ec02b4.js +217 -0
- package/dist/web/_next/static/chunks/7449.be3a97c644b086d6.js +86 -0
- package/dist/web/_next/static/chunks/7835.eaf45d5554820d67.js +104 -0
- package/dist/web/_next/static/chunks/7869.b407f42eca1ddf4d.js +1 -0
- package/dist/web/_next/static/chunks/7913.3de14c31f63521fd.js +193 -0
- package/dist/web/_next/static/chunks/7915.e23554d5280c643a.js +1 -0
- package/dist/web/_next/static/chunks/7992.5dde103489d49ad1.js +24 -0
- package/dist/web/_next/static/chunks/8057.16633338493802bd.js +24 -0
- package/dist/web/_next/static/chunks/8244.0a0a340eddcff9ce.js +1 -0
- package/dist/web/_next/static/chunks/8259.62f5c49f967282f1.js +64 -0
- package/dist/web/_next/static/chunks/8372.eb7c979688ab1442.js +62 -0
- package/dist/web/_next/static/chunks/8590.c7e1c62b00e799ea.js +1 -0
- package/dist/web/_next/static/chunks/8655.1a55ea833e35b289.js +115 -0
- package/dist/web/_next/static/chunks/8687.cbb5d2e055f2a05f.js +1 -0
- package/dist/web/_next/static/chunks/8704.bb5e916a22041380.js +1 -0
- package/dist/web/_next/static/chunks/88492ad4.406f106f686c2ea4.js +82 -0
- package/dist/web/_next/static/chunks/898.a636c29260da655a.js +93 -0
- package/dist/web/_next/static/chunks/9371.f52b19a630591b42.js +34 -0
- package/dist/web/_next/static/chunks/94.c653beceaa62934f.js +1 -0
- package/dist/web/_next/static/chunks/9516.3d1f5c6a23f298e9.js +1 -0
- package/dist/web/_next/static/chunks/9525.c2f5e990d374aeb6.js +38 -0
- package/dist/web/_next/static/chunks/9540.9cc4cb31dd3a0d0a.js +1 -0
- package/dist/web/_next/static/chunks/9612.d9f1b4d3209e70dc.js +79 -0
- package/dist/web/_next/static/chunks/9759.ddd2794ce95b458c.js +1 -0
- package/dist/web/_next/static/chunks/b02c773b.2d61cc590e6c1c58.js +1 -0
- package/dist/web/_next/static/chunks/b9dacbaa.d2b59af18cc80870.js +1 -0
- package/dist/web/_next/static/chunks/d94f238e.ed1acca9cb2f0773.js +122 -0
- package/dist/web/_next/static/chunks/f24717c3.caadd8481abaaae2.js +1 -0
- package/dist/web/_next/static/chunks/framework-b92a367cf1ad4bf7.js +1 -0
- package/dist/web/_next/static/chunks/main-ec7fd4c371d06729.js +5 -0
- package/dist/web/_next/static/chunks/pages/_app-320afeed07d86516.js +1 -0
- package/dist/web/_next/static/chunks/pages/_error-8f65b0f8749f42d2.js +1 -0
- package/dist/web/_next/static/chunks/pages/home-efefddd4b88b018d.js +11 -0
- package/dist/web/_next/static/chunks/polyfills-42372ed130431b0a.js +1 -0
- package/dist/web/_next/static/chunks/webpack-c8aa5df0425f6b7b.js +1 -0
- package/dist/web/_next/static/css/edcc6abb24dfd492.css +2 -0
- package/dist/web/apple-touch-icon.png +0 -0
- package/dist/web/favicon.ico +0 -0
- package/dist/web/home/index.html +1 -0
- package/dist/web/logo.svg +17 -0
- package/package.json +37 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 KW Yeh
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
# VibeFlow
|
|
2
|
+
|
|
3
|
+
VibeFlow 是一款專為本地開發設計的「意圖驅動」看板平台。它將 Claude Code CLI 的強大生成能力與 Git Worktree 的多工隔離機制結合,讓開發者能透過視覺化看板同時管理多個開發任務,並在獨立的工作區中安全地進行代碼實驗與自動化實作。
|
|
4
|
+
|
|
5
|
+
## 🛠 核心技術棧 (Tech Stack)
|
|
6
|
+
|
|
7
|
+
* **核心**: `packages/core` — 任務、git worktree、agent 指令組裝、session 管理,不依賴任何 UI
|
|
8
|
+
* **前端**: 本機 Web UI(Next.js 靜態輸出,由 core 提供)· 終端機 TUI(Ink)
|
|
9
|
+
* **看板**: `@hello-pangea/dnd`
|
|
10
|
+
* **終端**: `xterm.js` ↔ WebSocket ↔ core;session 由 tmux(macOS / Linux)或 `node-pty` 持有
|
|
11
|
+
* **儲存**: core 自有的 JSON store(`packages/core/src/json-store.ts`,沿用舊版桌面 App 的 electron-store 檔案,舊看板會直接接上)
|
|
12
|
+
|
|
13
|
+
## 📦 安裝與執行
|
|
14
|
+
|
|
15
|
+
| 方式 | 指令 | 適合對象 |
|
|
16
|
+
|---|---|---|
|
|
17
|
+
| 免安裝試用 | `npx @kw-yeh/vibeflow` | 第一次接觸的人 |
|
|
18
|
+
| 全域安裝 | `npm i -g @kw-yeh/vibeflow`,之後執行 `vibeflow` | 日常使用者 |
|
|
19
|
+
| 從原始碼執行 | `git clone` → `npm install` → `npm start` | 貢獻者、想改程式的人 |
|
|
20
|
+
| 從原始碼一鍵啟動 | macOS / Linux:雙擊 `start.command`(或執行 `./start.command`);Windows:雙擊 `start.cmd` | 用 clone 下來的版本日常使用:自動安裝相依、建置 Web UI 並開啟網頁 |
|
|
21
|
+
|
|
22
|
+
`vibeflow` 會在本機啟動 core,並用瀏覽器開啟 Web UI。它不是需要簽章的 App,所以不會被 Gatekeeper 或 SmartScreen 攔下。
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
vibeflow # 啟動(或沿用已在執行的)core,開啟 Web UI
|
|
26
|
+
vibeflow tui # 終端機介面,和 Web UI 操作同一份看板與 session
|
|
27
|
+
vibeflow status # host、執行中的 session、看板摘要
|
|
28
|
+
vibeflow stop <id> | --all # 停止 agent session
|
|
29
|
+
vibeflow shutdown # 停止 host(tmux 裡的 agent 會繼續執行)
|
|
30
|
+
vibeflow open <path> # 把專案資料夾加入最近使用清單,再開啟 Web UI
|
|
31
|
+
vibeflow doctor # 檢查前置需求,並列出修正指令
|
|
32
|
+
vibeflow task create … # 不開 UI 直接建卡(vibeflow task --help)
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
同一台機器同時只會有一個 core(`<appData>/vibeflow/core.lock`)。再次執行 `vibeflow` 或 `vibeflow tui` 時,會連到已在執行的那一個。
|
|
36
|
+
|
|
37
|
+
**任務不綁 UI**:有 tmux 時,每張卡片的 agent 跑在 `tmux -L vibeflow` 的 session 裡。關掉瀏覽器、TUI,甚至 core 本身,agent 都會繼續執行,重新開啟即可接回。沒有 tmux 時(包括 Windows),agent 由 core 直接持有,會隨 core 一起結束。
|
|
38
|
+
|
|
39
|
+
### ✅ 前置需求
|
|
40
|
+
|
|
41
|
+
1. **Node.js 22 以上**。
|
|
42
|
+
2. **Git 2.30 以上**,且要操作的專案必須是 Git repository。若要使用「Approve & Push」,推送認證(SSH key 或 credential helper)需事先設定好。
|
|
43
|
+
3. **tmux**(建議;macOS 用 `brew install tmux`)。沒有時會自動改用 node-pty,並在 `vibeflow doctor` 裡提示。
|
|
44
|
+
4. **claude 或 codex CLI 至少一個,已登入**:
|
|
45
|
+
```bash
|
|
46
|
+
npm install -g @anthropic-ai/claude-code # 或官方 installer:curl -fsSL https://claude.ai/install.sh | bash
|
|
47
|
+
```
|
|
48
|
+
5. **Windows**:需要 Git for Windows 的 Git Bash(agent 的啟動指令是 POSIX sh)。
|
|
49
|
+
|
|
50
|
+
有問題時先執行 `vibeflow doctor`。第一次啟動若偵測到問題,也會自動檢查一次。
|
|
51
|
+
|
|
52
|
+
### 🔒 本機伺服器的安全性
|
|
53
|
+
|
|
54
|
+
core 的 Web 伺服器能啟動 agent 和寫入終端機,因此:
|
|
55
|
+
|
|
56
|
+
- 只綁定 `127.0.0.1` / `::1`,使用隨機 port。
|
|
57
|
+
- 必須帶每次啟動時產生的 token 才能進入。`vibeflow` 開啟的網址會帶上 token,載入後換成 HttpOnly、SameSite=Strict 的 cookie,並從網址列移除。
|
|
58
|
+
- WebSocket 握手會同時檢查 cookie 與 `Origin`,其他網頁無法從你的瀏覽器連進來。
|
|
59
|
+
- `Host` 標頭必須是 loopback,用來防範 DNS rebinding。
|
|
60
|
+
- 鎖檔權限為 0600。
|
|
61
|
+
- API 只接受 core 認得的 task id,不接受任意路徑或指令。
|
|
62
|
+
|
|
63
|
+
## 🚢 發佈新版本(Maintainers)
|
|
64
|
+
|
|
65
|
+
CI(`.github/workflows/release.yml`)在每個 PR 上只跑第 1 步;推送 `v*` tag 時會:
|
|
66
|
+
|
|
67
|
+
1. 在 Ubuntu、macOS、Windows 上跑 typecheck、`npm test`、Web UI 端對端測試與 `vibeflow doctor`。
|
|
68
|
+
2. `npm pack` 後以全域安裝方式驗證能啟動,再執行 `npm publish --provenance`(需要 `NPM_TOKEN` secret)。
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
# 1. 更新 package.json 的 version 並 commit
|
|
72
|
+
# 2. 上 tag 並推送
|
|
73
|
+
git tag v4.0.0
|
|
74
|
+
git push origin v4.0.0
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
本地驗證:`npm run build:npm && npm pack ./dist-npm`。
|
|
78
|
+
|
|
79
|
+
## 📂 專案資料結構與 Worktree 隔離設計
|
|
80
|
+
|
|
81
|
+
VibeFlow 會在您開啟的專案中建立一個隱藏的暫存空間,確保主目錄程式碼在開發過程中保持乾淨:
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
[專案目錄] /
|
|
85
|
+
├── .vibeflow/ <-- 自動加入 .gitignore
|
|
86
|
+
│ ├── task-uuid-1/ <-- 卡片 A 的獨立 Worktree (分支: vf-task-1)
|
|
87
|
+
│ └── task-uuid-2/ <-- 卡片 B 的獨立 Worktree (分支: vf-task-2)
|
|
88
|
+
├── src/
|
|
89
|
+
└── package.json
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## 🚀 核心工作流
|
|
93
|
+
|
|
94
|
+
### 1. 任務初始化 (Task Creation)
|
|
95
|
+
|
|
96
|
+
* **路徑偵測**: 使用者選擇本地專案資料夾,App 自動檢查 Git 狀態與 Remote 資訊。
|
|
97
|
+
* **分支策略**: 若有 Remote,彈窗讓使用者選擇基準分支(Base Branch)。
|
|
98
|
+
* **背景準備**:
|
|
99
|
+
1. 自動將 `.vibeflow/` 寫入 `.gitignore`。
|
|
100
|
+
2. 執行 `git worktree add -b vf-[id] .vibeflow/vf-[id] origin/[選定分支]`。
|
|
101
|
+
3. 執行 `git push -u origin vf-[id]` 將工作分支同步至雲端。
|
|
102
|
+
|
|
103
|
+
### 2. 交互執行 (Execution & Live Terminal)
|
|
104
|
+
|
|
105
|
+
* **PTY 整合**: 當卡片拖入 `In Progress` 或點擊執行,core 在該 Worktree 路徑啟動 `claude` CLI(tmux session,或沒有 tmux 時的 `node-pty`)。
|
|
106
|
+
* **互動模式 (Type A)**:
|
|
107
|
+
* 卡片展開為 **互動式終端機**。
|
|
108
|
+
* 使用者可直接在畫面上回答 Claude 的提問(例如:`y/n` 或確認指令)。
|
|
109
|
+
* **多工並行**: 支援同時啟動多張卡片,每張卡片擁有獨立的 PTY 進程與 Worktree 環境,互不干擾。
|
|
110
|
+
|
|
111
|
+
### 3. 審查與清理 (Review & Finalize)
|
|
112
|
+
|
|
113
|
+
* **視覺化 Diff**: 任務完成後,讀取該 Worktree 的 `git diff` 並以 Side-by-side 模式呈現。
|
|
114
|
+
* **一鍵合併**: 使用者點擊 Approve 後,App 在 Worktree 執行 `git commit` 與 `git push`。
|
|
115
|
+
* **自動清理**: 卡片移至 `Done` 後,App 自動執行 `git worktree remove`,徹底刪除 `.vibeflow/` 下的暫存資料夾,保持硬碟整潔。
|
|
116
|
+
|
|
117
|
+
## 📅 開發階段 (Milestones)
|
|
118
|
+
|
|
119
|
+
### 第一階段:基礎架構 (Day 1-2)
|
|
120
|
+
|
|
121
|
+
* [x] 搭建 Electron + Next.js 環境。
|
|
122
|
+
* [x] 實作看板拖曳介面。
|
|
123
|
+
* [x] 整合 `electron-store` 紀錄本地專案路徑與卡片狀態。
|
|
124
|
+
|
|
125
|
+
### 第二階段:Git 自動化 (Day 3-4)
|
|
126
|
+
|
|
127
|
+
* [x] 實作 `git remote` 偵測與分支選擇彈窗。
|
|
128
|
+
* [x] 實作自動建立 Worktree 與分支推送的後端邏輯。
|
|
129
|
+
* [x] 確保 `.vibeflow/` 資料夾被正確忽略。
|
|
130
|
+
|
|
131
|
+
### 第三階段:互動終端 (Day 5-7)
|
|
132
|
+
|
|
133
|
+
* [x] 在主進程封裝 `node-pty` 與 `claude` CLI。
|
|
134
|
+
* [x] 前端整合 `xterm.js`,達成雙向串流(輸出顯示 + 鍵盤輸入)。
|
|
135
|
+
* [x] 實作多卡片並行的 PTY 進程管理。
|
|
136
|
+
|
|
137
|
+
### 第四階段:Review & Cleanup (Day 8-10)
|
|
138
|
+
|
|
139
|
+
* [x] 整合 `react-diff-viewer` 呈現程式碼變更。
|
|
140
|
+
* [x] 實作 Approve 後的自動提交與 Worktree 清理機制。
|
|
141
|
+
|
|
142
|
+
## ⚠️ 開發提醒
|
|
143
|
+
|
|
144
|
+
1. **Native Modules**: `node-pty` uses packaged prebuilt binaries where available; use `npm run check:node-pty` to confirm the installed binary loads.
|
|
145
|
+
2. **互動處理**: 確保 `xterm.js` 的輸入能即時傳回 PTY,這對於 Claude Code 的互動式提問(Type A)至關重要。
|
|
146
|
+
3. **環境變數**: core 呼叫 `claude` 時需手動注入使用者的 `PATH`(`packages/core/src/env.ts`),否則會找不到指令。
|