Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/bugbot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Cursor BugBot

on:
pull_request:
types: [opened, reopened]

permissions:
pull-requests: write

jobs:
bugbot-review:
name: Trigger BugBot Review
runs-on: ubuntu-latest
steps:
- name: Request Cursor BugBot review
uses: actions/github-script@v7
with:
script: |
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number,
body: 'cursor review'
});
59 changes: 59 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Changelog

All notable changes to Infinite Monitor are documented here.

## Unreleased

### Added

- Infinite canvas dashboard replacing the fixed grid layout — pan, zoom, and freely position widgets
- BYOK (Bring Your Own Key) model selection with 12 providers and 35+ models
- Inline model picker and GitHub star button in the UI
- Vitest unit test suite with CI test job
- Cursor BugBot CI workflow to auto-review new pull requests
- GitHub CI workflows (lint, typecheck, test), issue templates, and PR template
- Pre-commit hooks via lint-staged

### Changed

- Consolidated 9 agent tools down to 6 using bash-tool
- Updated README tool list to reflect the 6-tool architecture

### Fixed

- Zustand hydration pattern restored for SSR compatibility
- Lint and type errors resolved for CI compliance
- CI lockfile compatibility across platforms (Node 20 with `npm install`)

## 0.1.0 — 2026-03-14

Initial open-source release.

### Added

- AI-powered widget builder — describe a widget in plain English and an agent writes, builds, and deploys it live
- Chat sidebar for creating and iterating on widgets with file upload support (drag-and-drop)
- Docker + Vite widget runtime replacing the original Vercel Sandbox approach
- Single container architecture serving all widgets
- SQLite persistence via Drizzle ORM
- Multi-dashboard support with sync and picker
- Dashboard template gallery on empty state
- Sandboxed bash tool for widget agents
- Thinking blocks and planning indicator in chat UX
- Static noise overlay shown while widgets rebuild
- README, MIT license, and `.env.example` for open-source release
- Demo GIF in README

### Fixed

- Widget file persistence, container stability, and dashboard-aware agents
- Proper cleanup of widget files from disk when container stops
- Dashboard and widget deletion from both client and server
- Config-based template registry instead of fragile name matching
- Native dependency handling for just-bash in Next.js config
- Sandbox root prefix stripping from file paths

### Changed

- Replaced Vercel Sandbox with Docker + Vite for widget isolation
- UI polish: thin scrollbars, reasoning block height, grid bottom padding
35 changes: 35 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
.PHONY: setup dev build docker clean test lint help

DOCKER_IMAGE := widget-base:latest
DOCKER_DIR := docker/widget-base

help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-12s\033[0m %s\n", $$1, $$2}'

setup: docker ## Install deps + build Docker image (first-time setup)
npm install

docker: ## Build the widget runtime Docker image
docker build -t $(DOCKER_IMAGE) $(DOCKER_DIR)

dev: ## Start the Next.js dev server
npm run dev

build: ## Production build
npm run build

start: ## Start production server
npm run start

test: ## Run tests
npm test

lint: ## Run linter
npm run lint

clean: ## Remove build artifacts, Docker container, and volume
rm -rf .next node_modules data/widgets.db
-docker rm -f widget-runtime 2>/dev/null
-docker volume rm widget-runtime-dist 2>/dev/null

all: setup dev ## Full bootstrap: install, build Docker, start dev server
40 changes: 29 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ The agent has 6 tools at its disposal:
- [Node.js](https://nodejs.org/) 20+
- [Docker](https://www.docker.com/) running locally
- An [Anthropic API key](https://console.anthropic.com/)
- [Make](https://www.gnu.org/software/make/) (pre-installed on macOS/Linux)

### Setup

```bash
git clone https://github.com/homanp/infinite-monitor.git
cd infinite-monitor
npm install
```

Create `.env.local`:
Expand All @@ -48,28 +48,43 @@ Create `.env.local`:
ANTHROPIC_API_KEY=your-api-key-here
```

Build the widget runtime Docker image:
Bootstrap everything (install deps + build Docker image + start dev server):

```bash
docker build -t widget-base:latest ./docker/widget-base
make all
```

Start the dev server:
Or step by step:

```bash
npm run dev
make setup # npm install + build widget-base Docker image
make dev # start Next.js dev server
```

Open [http://localhost:3000](http://localhost:3000).

### Available make targets

| Command | Description |
|---------|-------------|
| `make setup` | Install npm deps + build Docker image (first-time) |
| `make docker` | Rebuild the widget runtime Docker image |
| `make dev` | Start the Next.js dev server |
| `make build` | Production build |
| `make start` | Start production server |
| `make test` | Run tests |
| `make lint` | Run linter |
| `make clean` | Remove build artifacts, Docker container, and volume |
| `make all` | Full bootstrap: setup + dev |

## Architecture

```
┌─────────────────────────────────────────────────────────┐
│ Next.js App │
│ ┌──────────────────────┐ ┌─────────────────────────┐ │
│ │ Dashboard Grid │ │ Chat Sidebar │ │
│ │ (react-grid-layout) │ │ (AI conversation) │ │
│ │ Infinite Canvas │ │ Chat Sidebar │ │
│ │ (pan / zoom / grid) │ │ (AI conversation) │ │
│ │ │ │ │ │
│ │ ┌──────┐ ┌──────┐ │ │ User: "build a chart" │ │
│ │ │iframe│ │iframe│ │ │ Agent: writes code... │ │
Expand All @@ -91,7 +106,7 @@ Open [http://localhost:3000](http://localhost:3000).
└─────────┘ └──────────┘ └─────────────────┘
```

**Client** — Next.js 16 + React 19. Zustand store persisted to localStorage. Widgets rendered as iframes via `react-grid-layout`.
**Client** — Next.js 16 + React 19. Zustand store persisted to localStorage. Widgets rendered as iframes on an infinite canvas with pan, zoom, and grid-snapped placement.

**Server** — Next.js API routes. AI chat uses Vercel AI SDK with Claude. Widget files stored in SQLite via Drizzle ORM. CORS proxy for widget API calls.

Expand All @@ -111,7 +126,7 @@ Open [http://localhost:3000](http://localhost:3000).

**CORS proxy** — Widgets can fetch any external API through the built-in proxy at `/api/proxy?url=...`.

**Drag and resize** — Full `react-grid-layout` support. Drag widgets by their title bar, resize from any edge.
**Infinite canvas** — Pan, zoom, and place widgets anywhere on an unbounded grid. Drag widgets by their title bar, resize from the corner handle. Widgets snap to grid cells.

**Persistent builds** — Widget builds are stored on a Docker volume. Container restarts don't lose your built widgets.

Expand All @@ -127,7 +142,7 @@ Open [http://localhost:3000](http://localhost:3000).
| State | Zustand (persisted to localStorage) |
| Database | SQLite via Drizzle ORM |
| Container | Docker (Vite + serve) |
| Grid | react-grid-layout |
| Canvas | Custom infinite canvas (pan/zoom/grid-snap) |
| Charts | Recharts (in widgets) |
| Maps | MapLibre GL (in widgets) |

Expand All @@ -146,7 +161,10 @@ src/
├── components/
│ ├── ai-elements/ # Chat UI (messages, reasoning, code blocks)
│ ├── chat-sidebar.tsx # AI chat panel
│ ├── dashboard-grid.tsx # Widget grid layout
│ ├── dashboard-grid.tsx # Dashboard orchestrator
│ ├── infinite-canvas.tsx # Pan/zoom infinite canvas
│ ├── draggable-widget.tsx # Grid-snapped drag & resize
│ ├── zoom-controls.tsx # Canvas zoom UI
│ ├── widget-card.tsx # Widget iframe container
│ └── dashboard-picker.tsx
├── db/ # SQLite schema + queries
Expand Down
62 changes: 3 additions & 59 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
"next": "16.1.6",
"react": "19.2.3",
"react-dom": "19.2.3",
"react-grid-layout": "^2.2.2",
"shadcn": "^4.0.2",
"streamdown": "^2.4.0",
"tailwind-merge": "^3.5.0",
Expand Down
Loading
Loading