Commit Graph

14 Commits

Author SHA1 Message Date
Alex Netsch
b0b8560350 Fix NPX CLI corrupted cache and false update message (Vibe Kanban) (#1586)
* Both bugs have been fixed:

**Bug 1 - Corrupted Cache from Interrupted Downloads:**
- `download.js:33-91`: Downloads now write to a `.tmp` file first, verify the checksum, then atomically rename to the final path using `fs.renameSync()`. If anything fails (network error, checksum mismatch, rename error), the temp file is cleaned up.

**Bug 2 - False "Update Available" Message:**
- `download.js:117`: `getLatestVersion()` now returns `manifest.latestVersion` (the npm version like `0.0.137`) instead of `manifest.latest` (the full tag)
- `pre-release.yml:557-559`: The global manifest now includes both `latest` (full tag) and `latestVersion` (npm version), e.g., `{"latest": "v0.0.137-20251216142426", "latestVersion": "0.0.137"}`

* Now you can test:

```bash
# 1. Go to npx-cli directory
cd /private/var/folders/v2/8cnj633d15l3ckfh4445tk5h0000gn/T/vibe-kanban/worktrees/0ade-fix-corrupted-bi/vibe-kanban/npx-cli

# 2. Install dependencies
npm install

# 3. Clear the cache for this version to force re-download
rm -rf ~/.vibe-kanban/bin/v0.0.137-20251216142426

# 4. Corrupt the MCP zip mid-download simulation - create a partial file
mkdir -p ~/.vibe-kanban/bin/v0.0.137-20251216142426/macos-arm64
echo "corrupted partial download" > ~/.vibe-kanban/bin/v0.0.137-20251216142426/macos-arm64/vibe-kanban-mcp.zip

# 5. Run in MCP mode - should fail on corrupt zip, then delete it
node bin/cli.js --mcp

# 6. Run again - should re-download successfully
node bin/cli.js --mcp
```

To test the atomic download fix specifically (interrupted download leaves no corrupt file):

```bash
# Clear cache
rm -rf ~/.vibe-kanban/bin/v0.0.137-20251216142426

# Start download and Ctrl+C quickly
node bin/cli.js --mcp
# Press Ctrl+C during "Downloading..."

# Check that NO .zip file exists, only possibly a .zip.tmp
ls -la ~/.vibe-kanban/bin/v0.0.137-20251216142426/macos-arm64/
# Should see either nothing or vibe-kanban-mcp.zip.tmp (not .zip)
```

* Tests passed:
- **Bug 1 fix verified**: Corrupt zip is detected, deleted on extraction failure, and re-downloaded on next run
- **Atomic download**: Downloads now go to `.tmp` file first, then get renamed to final path only after checksum verification

The code is ready for PR with placeholders restored.

RM package-lock

* Remove update available message from mcp (vibe-kanban c20cecfd)

```javascript

```

Update available: 0.0.137 -> v0.0.137-20251216142426
Run: npx vibe-kanban@latest

```

violates the mcp protocol accoring to https://github.com/BloopAI/vibe-kanban/issues/1585.
Double check this is true and fix appropriately

```

* Done. Now download progress and messages go to stderr instead of stdout. This keeps the MCP protocol clean on first run when binaries need to be downloaded.

Should I update the PR description to include this fix as well?

* Done. Now:
- Global manifest: `{"latest": "0.0.138"}` (just the version, no tag)
- `getLatestVersion()` returns `manifest.latest` (the clean version)

The comparison will be `"0.0.137" !== "0.0.138"` which works correctly.
2025-12-17 14:17:26 +00:00
Louis Knight-Webb
7f9f1433af Store binaries in Cloudflare R2 instead of bundling in npm package (Vibe Kanban) (#1554)
* All changes are complete. Let me provide a summary of what was implemented:

## Summary

I've implemented the Cloudflare R2 binary storage feature. Here are the changes:

### Files Created
- **`npx-cli/bin/download.js`** - New module that handles downloading binaries from R2 with:
  - SHA-256 checksum verification
  - Progress reporting
  - Redirect handling
  - Local caching in `~/.vibe-kanban/bin/{version}/{platform}/`

### Files Modified

1. **`npx-cli/bin/cli.js`**
   - Converted to async for on-demand downloads
   - Downloads binaries from R2 instead of using bundled files
   - Non-blocking update check shows notice if newer version available
   - Caches binaries locally per version/platform

2. **`npx-cli/package.json`**
   - Removed `"dist"` from `files` array (package now ~15KB instead of ~150MB)

3. **`.github/workflows/pre-release.yml`**
   - Added new `upload-to-r2` job that:
     - Downloads all platform packages from artifacts
     - Generates manifest.json with SHA-256 checksums for each binary
     - Uploads binaries to R2 at `binaries/v{version}/{platform}/{binary}.zip`
     - Updates global manifest with latest version
   - Modified `create-prerelease` job to:
     - Depend on `upload-to-r2` instead of `package-npx-cli`
     - Inject R2 public URL into download.js via `sed`
     - No longer download/bundle binaries in the npm package

### Required GitHub Secrets

You'll need to add these secrets to your repository:
- `R2_BINARIES_ACCESS_KEY_ID`
- `R2_BINARIES_SECRET_ACCESS_KEY`
- `R2_BINARIES_ENDPOINT` (e.g., `https://<account_id>.r2.cloudflarestorage.com`)
- `R2_BINARIES_BUCKET`
- `R2_BINARIES_PUBLIC_URL` (the public URL for your R2 bucket, e.g., custom domain or public R2 URL)

### R2 Bucket Structure
```
binaries/
  manifest.json                    # {"latest": "0.0.135"}
  v0.0.135/
    manifest.json                  # Per-version manifest with checksums
    linux-x64/
      vibe-kanban.zip
      vibe-kanban-mcp.zip
      vibe-kanban-review.zip
    ...
```

* Done! I've updated the implementation to use full tags (with timestamps) instead of just version numbers. Here's a summary of what changed:

## Changes Made

1. **`npx-cli/bin/download.js`**:
   - Added `BINARY_TAG` constant (placeholder `__BINARY_TAG__`)
   - Changed `ensureBinary()` to use `BINARY_TAG` instead of accepting version as parameter
   - Cache paths now use the tag: `~/.vibe-kanban/bin/{tag}/{platform}/`

2. **`npx-cli/bin/cli.js`**:
   - Updated to import `BINARY_TAG` from download.js
   - Cache directory now uses `BINARY_TAG` instead of `CLI_VERSION`
   - Updated `ensureBinary()` call to not pass version

3. **`.github/workflows/pre-release.yml`**:
   - `upload-to-r2` job now uses `new_tag` instead of `new_version` for R2 paths
   - Binaries are stored at `binaries/{tag}/{platform}/{binary}.zip`
   - Global manifest stores the full tag: `{"latest": "v0.0.135-20251215122030"}`
   - `create-prerelease` job now injects both `__R2_PUBLIC_URL__` and `__BINARY_TAG__`

This allows multiple pre-releases to coexist in R2 (e.g., `v0.0.135-20251215122030` and `v0.0.135-20251215100000`), making rollbacks easy.

* chore: bump version to 0.0.136

---------

Co-authored-by: GitHub Action <action@github.com>
2025-12-15 23:48:27 +00:00
Louis Knight-Webb
fd9e5e5d79 Remote review (#1521) 2025-12-15 19:42:13 +00:00
René Simonsen
037302c62f Improved multi-process support of --mcp command (#1343) 2025-11-20 14:52:22 +00:00
Solomon
3493503602 Reduce npx platform-specific unzip issues (#973) 2025-10-09 12:37:22 +01:00
Solomon
603e70215f Relax OS architecture detection (#804) 2025-09-22 17:14:03 +01:00
Solomon
493ee43621 Fix MCP server output (#474) 2025-08-14 15:35:59 +01:00
Gabriel Gordon-Hall
8037946500 feat: easy vibe_kanban MCP config (#26)
* inject project_id into prompt; remove create_project tool

* path hack for vibe-kanban mcp button

* update mcp name

* update mcp configuration

* merge stderr into stdout for mcp process

* add -y to mcp server config

* fmt

* fmt

* revert reversion of cli.js

* rename mcp server to vibe-kanban

* improve tool descriptions
2025-07-07 10:39:12 +01:00
Louis Knight-Webb
7817a4fc9e Update arch checm (#32) 2025-07-01 00:32:18 +01:00
Solomon
0988f0b146 Fix multi-platform packaging (#14)
* Fix multi-platform packaging

* Add arm64 windows and linux targets

* Speedup windows msvc linking

* Improve cargo cache

* fix arm64 linux build
2025-06-30 12:25:57 +01:00
Gabriel Gordon-Hall
0514d437a2 feat: ticket ingestion MCP server (#1)
* basic ticket uploading

* take project_id in request params instead of env

* add an endpoint to list all available projects

* add mcp server bin to npx

* add missing scripts to package and publish to npm

* fix rmcp version

* Use utils::asset_dir

* Don't run migrations or create DB from MCP

* a fix for the first dev run when no frontend/dist/index.html exists

* Add more MCP endpoints (#8)

* add new endpoints for project and task management

* add simpler more focused endpoints to improve agent understanding on this MCP

* improve test script

* combine npm binaries and allow passing --mcp as an arg

* cargo fmt

* fixes after rebase

* clippy fixes

* Script tweaks

---------

Co-authored-by: couscous <couscous@runner.com>
Co-authored-by: anastasiya1155 <anastasiya1155@gmail.com>
Co-authored-by: Louis Knight-Webb <louis@bloop.ai>
Co-authored-by: Anastasiia Solop <35258279+anastasiya1155@users.noreply.github.com>
2025-06-27 18:14:25 +01:00
Solomon
1416a12712 Builds for linux, windows, and macOS intel (#7)
* Builds for linux, windows, and macOS intel

* Add context to spawn errors

* Use shell to execute agent
2025-06-27 16:18:35 +01:00
Louis Knight-Webb
11327ab346 Imporve CLI 2025-06-20 21:05:30 +01:00
Louis Knight-Webb
2c4a7f7f4b Squashed commit of the following:
commit 67a4068a7fe7834e7335a9f4c22ab7f91588b1bc
Author: Louis Knight-Webb <louis@bloop.ai>
Date:   Fri Jun 20 16:09:04 2025 +0100

    Update CLI

commit 0c3f38c90133970d5016712056dbcc6daffb138b
Author: Louis Knight-Webb <louis@bloop.ai>
Date:   Fri Jun 20 15:54:58 2025 +0100

    Boilerplate
2025-06-20 16:10:07 +01:00