Skip to content

Commit 57da55c

Browse files
authored
Merge pull request #72 from nathfavour/master
Release: Sync master to release
2 parents d421e8b + 2efcbb5 commit 57da55c

116 files changed

Lines changed: 10455 additions & 1146 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/agents/vibeauracle.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Agent skills for vibeauracle
2+
3+
## Mission
4+
Assist engineers by deeply understanding the modular monolith, the Plan-Execute-Reflect brain, and the TUI-first experience. Provide actionable guidance that respects system intimacy, modular boundaries, and the existing tooling (Bubble Tea, Cobra, MCP, Copilot SDK bridge, etc.).
5+
6+
## Know when to ask
7+
- When a feature touches multiple modules (`cmd/vibeaura`, `internal/brain`, `internal/model`, `vibes/`), pause and summarize the required cross-module changes before editing.
8+
- When unsafe actions (network calls, secrets) are required, explain the rationale and ensure the user explicitly approves any CLI operations.
9+
10+
## Preferred workflow
11+
- Identify affected Go modules with `go list ./...` or by referencing `go.work`.
12+
- Suggest concise plans referencing key docs (README, ARCHITECTURE, TODO.SDK.md, TODO.GH.md) before implementing.
13+
- Verify changes with targeted `go test` commands; if tests are too heavy, explain which module-level tests you would run and why.
14+
15+
## Communication
16+
- Always mention the architecture theme (modular monolith, hexagonal core, Plan-Execute-Reflect) when justifying design choices.
17+
- When summarizing work, highlight how it respects safety, system intimacy, and the CLI/TUI expectations.

.github/copilot-instructions.md

Lines changed: 10 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,13 @@
1-
# Copilot Instructions for vibeauracle
1+
# GitHub Copilot instructions for vibeauracle
22

3-
## 🌌 The Big Picture
4-
**vibeauracle** is a Distributed, System-Intimate AI Engineering Ecosystem. It uses a **Modular Monolith** architecture coordinated via **Go Workspaces**.
3+
vibeauracle is a distributed, system-intimate AI engineering ecosystem built as a Go workspace with a Bubble Tea CLI (`cmd/vibeaura`), a cognitive `internal/brain`, and supporting modules for model providers, tools, system monitoring, and extensions. The Copilot agent should treat the repo as a cohesive whole: plan-change-verify via the brain's Plan-Execute-Reflect loop, respect the modular boundaries, and keep the TUI-first workflow and tooling integrations in mind.
54

6-
- **Core Module (`internal/brain`)**: The cognitive orchestrator managing the Plan-Execute-Reflect loop.
7-
- **Entry Point (`cmd/vibeaura`)**: Unified CLI/TUI built with `bubbletea` and `lipgloss`.
8-
- **System Layer (`internal/sys`)**: Hardware-aware monitoring and virtual FS operations.
9-
- **Providers (`internal/model`)**: Abstraction for local (Ollama) and cloud (OpenAI) LLMs.
5+
## What to prioritize
6+
- Learn and honor the Hexagonal / Go workspace structure: `go.work` governs the modules, and each package has a distinct responsibility (brain, sys, context, model, etc.).
7+
- Favor `vibeaura` commands and Go tooling for tasks; when in doubt, prefer `go test ./...` scoped to the touched module, run `go work sync` if dependencies change, and mention `vibeaura` helpers when describing behavior.
8+
- Document discoveries via README/ARCHITECTURE cues; link to `docs/`, `VIBES.md`, and `FLOW.txt` when relevant.
109

11-
### 🏗️ Architecture Conventions
12-
- **Go Workspaces**: The project uses `go.work`. Each directory in `internal/` and `pkg/` is its own Go module.
13-
- **Hexagonal Design**: Keep logic in `internal/` decoupled. Use interfaces from `pkg/vibe` or within modules to interact between layers.
14-
- **Error Handling**: Always wrap errors with context.
15-
```go
16-
return fmt.Errorf("starting brain session: %w", err)
17-
```
18-
19-
## 🛠️ Developer Workflow
20-
- **Syncing Workspace**: After adding dependencies to any module, run:
21-
```bash
22-
go work sync
23-
```
24-
- **Testing**: Run tests for specific modules to ensure hardware/system intimacy remains intact:
25-
```bash
26-
go test ./internal/brain/... ./internal/sys/...
27-
```
28-
- **Rolling Releases**:
29-
- `master`: Rolling development branch (untested/bleeding edge).
30-
- `release`: Stable branch (triggers production builds).
31-
- Version Tags: `v*` triggers a GitHub Release.
32-
33-
## 🗝️ Critical Patterns
34-
### System Intimacy
35-
When modifying `internal/sys`, ensure compatibility with **Termux (Android)** and **Arch Linux**. Check for environment markers like `/data/data/com.termux/files/usr/bin/bash` or the `TERMUX_VERSION` env var.
36-
37-
### Vibes & Plugins
38-
Community modules live in `vibes/`.
39-
- New vibes should implement the `Vibe` interface from `pkg/vibe`.
40-
- Register new vibes in the root `go.work` using `go work use ./vibes/your-vibe`.
41-
42-
### Update Pipeline
43-
The `update` command supports binary updates and source builds.
44-
- **Binary**: Fetches from GitHub Releases.
45-
- **Source**: Clones to `~/.vibeauracle/source`, builds with `GOTOOLCHAIN=local`, and replaces the current executable.
46-
- Use `vibeaura update --list-assets` to verify release assets before manual troubleshooting.
47-
48-
### The Brain Loop
49-
The `vibe-brain` implements a recursive agentic loop:
50-
1. **Perceive**: Snapshot system resources (VRAM/CPU).
51-
2. **Plan**: Generate a Chain of Thought.
52-
3. **Execute**: Delegate to MCP or Sys tools.
53-
4. **Reflect**: Analyze stderr/results and self-correct.
54-
55-
## 🎨 TUI Design (Bubble Tea)
56-
- Use `lipgloss` for all styling.
57-
- Follow the **Elm Architecture**: `Init()`, `Update()`, `View()`.
58-
- Ensure the TUI is responsive to terminal resizing.
10+
## Style & guardrails
11+
- Keep explanations concise, structured, and system-aware. Mention hardware-awareness expectations (e.g., Termux, Arch focus) when they influence decisions.
12+
- Do not assume external systems beyond the repo; rely on the provided vector/KV store conventions and keep secrets out of outputs.
13+
- Encourage users to test with module-specific `go test` commands and reiterate the cognitive loop when proposing multi-step solutions.

.github/workflows/deploy-docs.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ on:
88
- 'docs/**'
99
workflow_dispatch:
1010

11+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
12+
# However, do NOT cancel in-progress runs as we want to allow every deployment to complete.
13+
concurrency:
14+
group: "pages"
15+
cancel-in-progress: false
16+
1117
permissions:
1218
contents: write
1319

@@ -25,7 +31,7 @@ jobs:
2531
uses: actions/setup-node@v4
2632
with:
2733
node-version: 20
28-
cache: npm
34+
cache: 'npm'
2935
cache-dependency-path: docs/package-lock.json
3036

3137
- name: Install dependencies
@@ -37,9 +43,11 @@ jobs:
3743
working-directory: docs
3844

3945
- name: Deploy to GitHub Pages
40-
uses: peaceiris/actions-gh-pages@v3
46+
uses: peaceiris/actions-gh-pages@v4
4147
with:
4248
github_token: ${{ secrets.GITHUB_TOKEN }}
4349
publish_dir: ./docs/build
50+
force_notifier: true
4451
user_name: 'github-actions[bot]'
4552
user_email: 'github-actions[bot]@users.noreply.github.com'
53+
commit_message: "docs: deploy to GitHub Pages [skip ci]"

COPILOT.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Copilot guidance for vibeauracle
2+
3+
This file records the GitHub Copilot CLI behavioral guardrails for the project.
4+
5+
## Core themes
6+
- Treat the repo as a modular monolith governed by `go.work`, with a Bubble Tea CLI entry point (`cmd/vibeaura`) and dedicated modules for brain, model, sys, context, MCP, daemon, vault, and community vibes.
7+
- Follow the Plan-Execute-Reflect loop, respect the Hexagonal layering, and keep explanations concise, system-aware, and tied back to README/ARCHITECTURE/FLOW when recommending changes.
8+
- Prefer `vibeaura` and Go tooling (`go test ./...`, `go work sync`) for operations, and mention testing plans when touching multiple modules.
9+
10+
## Agent skill reminders
11+
- Pause before editing when work spans multiple modules; summarize cross-module impact first.
12+
- Request explicit approval for risky network, secret, or environment-impacting actions.
13+
- Highlight the architecture (system intimacy, TUI-first, brain loop) when describing how solutions align with the project.
14+
- Suggest module-scoped tests, citing specific commands, and link to docs (TODO.SDK.md, TODO.GH.md, docs/) when relevant.

FLOW.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
# vibe auracle
55
**Distributed, System-Intimate AI Engineering Ecosystem**
66

7+
<img src="./assets/shot.png" width="100%" alt="Vibe Auracle TUI Screenshot" />
8+
79
[![Stable](https://img.shields.io/badge/Stable-ec1de87-10B981?style=for-the-badge&logo=git&logoColor=white)](https://github.com/nathfavour/vibeauracle/tree/release)
810
[![Beta](https://img.shields.io/badge/Beta-7ebb650-7C3AED?style=for-the-badge&logo=git&logoColor=white)](https://github.com/nathfavour/vibeauracle/tree/master)
911
[![Go Version](https://img.shields.io/badge/Go-1.25+-00ADD8?style=for-the-badge&logo=go&logoColor=white)](https://go.dev)
@@ -15,6 +17,15 @@
1517
## 🌌 The Vision
1618
**vibe auracle** unifies the terminal, the IDE, and the AI assistant into a single, keyboard-centric interface. It's built for engineers who value **system-intimacy**—where the AI isn't just a chatbot, but a co-pilot with deep access to your hardware, configuration, and environment.
1719

20+
## 🤖 Modular Agentic Runtimes
21+
VibeAuracle is a multi-engine orchestrator. Choose the runtime that fits your task:
22+
23+
- **🎨 Vibe Agent (`/agent /vibe`)**: Our artisan internal loop. Highly transparent, uses custom heuristic loop-detection, and optimized for system-intimate tasks.
24+
- **🚀 Copilot SDK Agent (`/agent /sdk`)**: Native GitHub Copilot SDK runtime. Delegates multi-step reasoning to the official GitHub agentic engine for deep tool-intimacy and secure, high-stakes engineering.
25+
- **👤 Custom Agent (`/agent /custom`)**: User-defined agent personas. Register specialized agents with custom system prompts and restricted toolsets to create focused experts for specific workflows.
26+
27+
Use the `/agent` command in the TUI to toggle between engines on the fly.
28+
1829
## ⚡ Core Features
1930
- **Keyboard-Centric**: Designed for speed and fluid terminal workflows.
2031
- **Deep Integration**: Real-time awareness of system stats, files, and Git state.

TODO.GH.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# 🐙 GitHub CLI Leverage Roadmap (TODO.GH.md)
2+
3+
Objective: Transform VibeAuracle into a "Claude Code" competitor by leveraging technical patterns and installed instances of the GitHub CLI.
4+
5+
## 1. Technical Leverage: Infrastructure Resilience
6+
- [x] **Custom GitHub Transport**: Implement a specialized `http.RoundTripper` in `internal/model` to mirror `gh`'s `capiTransport`.
7+
- Inject `Copilot-Integration-Id: copilot-4-cli` and `X-GitHub-Api-Version` headers.
8+
- Add user-agent strings matching the official CLI for better API compatibility.
9+
- [x] **Robust Backoff Strategy**: Port the `cenkalti/backoff` patterns from `gh` into the `vibe-brain` execution loop to handle rate limits and transient network failures during long-running agent tasks.
10+
11+
## 2. Contextual Intelligence: Project-Native Instructions
12+
- [x] **Agent Instruction Discovery**: Update the prompt system to automatically scan for and ingest `.github/agents/*.md` or `.github/vibeaura/*.md` files.
13+
- This allows teams to define project-specific coding standards, architecture rules, and "vibes" that the agent respects by default.
14+
- [x] **Repository Identity**: Use `gh repo view --json` to populate the agent's initial context with accurate repository metadata (visibility, license, primary language, topics).
15+
16+
## 3. Operational Leverage: Tooling Orchestration
17+
- [x] **Advanced PR Visibility**: Expand the `gh_pr_manage` tool to fetch PR diffs and conversation history via `gh pr diff` and `gh pr view --json comments`.
18+
- This gives VibeAuracle the ability to "read" code reviews and fix requested changes autonomously.
19+
- [x] **Extension Awareness**: Add a tool to detect and potentially invoke installed `gh` extensions, allowing VibeAuracle to inherit custom organizational workflows.
20+
21+
## 4. Hybrid Workflow: Remote Execution
22+
- [x] **Cloud Hand-off**: Implement `gh_remote_task` to trigger `gh agent-task create`.
23+
- Allows the user to hand off heavy or long-running tasks from the local VibeAuracle session to GitHub's remote agent infrastructure.

TODO.SDK.md

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# 🤖 Copilot SDK Integration Roadmap (TODO.SDK.md)
2+
3+
Objective: Integrate the official GitHub Copilot SDK to provide native, streaming LLM capabilities with proper session management and tool bridging.
4+
5+
## Prerequisites
6+
- [x] Analyze `copilot-sdk/go` architecture and types
7+
- [x] Ensure `copilot` CLI is detectable/installable (graceful fallback if missing)
8+
9+
---
10+
11+
## Phase 1: Foundation (SDK Provider) ✅
12+
- [x] **Create `internal/copilot/` package**
13+
- [x] `provider.go` - Implement `model.Provider` interface wrapping SDK
14+
- [x] `bridge.go` - Bridge VibeAuracle `tooling.Tool` → Copilot SDK `Tool`
15+
- [x] `events.go` - Handle streaming events (`assistant.message_delta`, etc.)
16+
- [x] `mcp.go` - Bridge for Model Context Protocol servers
17+
18+
- [x] **Add SDK dependency**
19+
- [x] Add `github.com/github/copilot-sdk/go` to workspace (`internal/copilot-sdk-go`)
20+
- [x] Configure local replace directive pointing to `./internal/copilot-sdk-go`
21+
22+
- [x] **Graceful Detection**
23+
- [x] Check if `copilot` CLI exists in PATH
24+
- [x] Fall back to existing `langchaingo` OpenAI provider if missing
25+
- [x] Log clear message about degraded mode
26+
27+
---
28+
29+
## Phase 2: Brain Integration ✅
30+
- [x] **Wire into Cognitive Loop**
31+
- [x] Import copilot package in brain
32+
- [x] Auto-select `copilot-sdk` when CLI available and gh auth present
33+
- [x] Dual generation path (SDK or standard model)
34+
- [x] Graceful shutdown via `Brain.Shutdown()`
35+
36+
- [x] **System Message Customization**
37+
- [x] Use `SystemMessageConfig.Mode = "append"` to inject VibeAuracle personality
38+
- [x] Preserve SDK guardrails while adding our prompt layers
39+
40+
---
41+
42+
## Phase 3: Tool Bridge ✅
43+
- [x] **Export VibeAuracle Tools to Copilot**
44+
- [x] Convert `tooling.ToolMetadata``copilot.Tool`
45+
- [x] Auto-generate JSON schema from our `Parameters` field
46+
- [x] Implement `ToolHandler` that routes to our `Tool.Execute()`
47+
- [x] Register core tools with SDK on startup
48+
49+
- [ ] **Bi-directional Tool Awareness**
50+
- [ ] Allow Copilot's native tools (file, bash, etc.) to coexist
51+
- [ ] Use `AvailableTools`/`ExcludedTools` for fine-grained control
52+
53+
---
54+
55+
## Phase 4: Streaming & Events ✅
56+
- [x] **Replace Blocking Generation**
57+
- [x] Use `session.On()` event handler for callbacks
58+
- [x] Emit `assistant.message_delta` to provider callbacks
59+
- [x] Handle `session.idle` to know when response is complete
60+
61+
- [x] **TUI Integration**
62+
- [x] Add `streamDeltaMsg` and `streamDoneMsg` message types
63+
- [x] Add streaming content state to model struct
64+
- [x] Real-time viewport updates with cursor indicator
65+
66+
---
67+
68+
## Phase 5: BYOK (Bring Your Own Key) ✅
69+
- [x] **Custom Provider Passthrough**
70+
- [x] Add `ProviderOptions` struct with BYOK fields
71+
- [x] Check vault for `openai_api_key` and `anthropic_api_key`
72+
- [x] Configure `sdk.ProviderConfig` with custom credentials
73+
- [x] Allow `BaseURL` override for local models (Ollama via OpenAI-compat)
74+
75+
---
76+
77+
## Phase 6: MCP Integration ✅
78+
- [x] **Model Context Protocol**
79+
- [x] Create `MCPBridge` in `internal/copilot/mcp.go`
80+
- [x] Support local/stdio and remote HTTP/SSE servers
81+
- [x] `RegisterMCPServers()` for SDK session config
82+
- [x] Common MCP server presets (filesystem, github, memory)
83+
84+
---
85+
86+
## Implementation Status
87+
✅ Phase 1 Complete - Foundation SDK provider with streaming and tool bridge
88+
✅ Phase 2 Complete - Brain integration with dual-path generation
89+
✅ Phase 3 Complete - Core tools registered with Copilot SDK
90+
✅ Phase 4 Complete - Streaming events and TUI integration
91+
✅ Phase 5 Complete - BYOK support for OpenAI/Anthropic/Ollama
92+
✅ Phase 6 Complete - MCP server bridge
93+
94+
## Build Status
95+
```
96+
✅ internal/copilot - builds successfully
97+
✅ internal/brain - builds successfully
98+
✅ internal/model - builds successfully
99+
✅ cmd/vibeaura - builds successfully
100+
```
101+
102+
## Files Created/Modified
103+
- `internal/copilot/provider.go` - Main SDK provider with BYOK
104+
- `internal/copilot/bridge.go` - VibeAuracle tool → SDK tool bridge
105+
- `internal/copilot/events.go` - Event routing for streaming
106+
- `internal/copilot/mcp.go` - MCP server integration
107+
- `internal/brain/brain.go` - Dual-path generation, tool registration
108+
- `cmd/vibeaura/chat.go` - TUI streaming support

TODO.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# VibeAuracle Roadmap & Competitive Edge
2+
3+
Objective: To be the most system-intimate, high-performance, and secure AI engineering companion.
4+
5+
## 🚀 Competitive Analysis: VibeAuracle vs. OpenCode
6+
7+
| Feature | VibeAuracle (Edge) | OpenCode (Edge) | Learnings for VibeAuracle |
8+
|---------|-------------------|-----------------|---------------------------|
9+
| **Platform** | Go (Native, Fast, Single Binary) | Node.js (Web-Ready, Monorepo) | Maintain native performance while matching UI polish. |
10+
| **Auth** | Zero-Config (Inherits from `gh` CLI) | Built-in OAuth Device Flow | Add built-in OAuth as fallback if `gh` is missing. |
11+
| **SDK** | Official Copilot SDK (Stable) | Manual OpenAI-Compat Layer | Leverage SDK for stability but keep header control for betas. |
12+
| **Context** | Hardware/System Monitor (`sys.Monitor`) | Web/Console Integration | Deepen system intimacy (process tracking, memory usage). |
13+
| **Enterprise** | Secondary Focus | First-Class GHE Flow | Implement `/auth enterprise` for corporate users. |
14+
15+
---
16+
17+
## 🛠️ Immediate TODOs (Learned from OpenCode)
18+
19+
- [ ] **Native OAuth Fallback**: Implement standalone Device Flow for Copilot auth (using `CLIENT_ID`). *Essential for users without `gh` CLI.*
20+
- [ ] **Enterprise Support**: Allow custom GitHub Enterprise domains in `/auth login`.
21+
- [ ] **Vision Support**: Add attachment handling for images in the TUI & SDK bridge.
22+
- [ ] **LSP Bridge**: Integrate language servers (e.g., `gopls`, `pyright`) to give the agent "Go to Definition" and "Find References" capabilities.
23+
- [ ] **Safe Shell Execution**: Parse shell commands (potentially using a Go tree-sitter binding) to detect dangerous operations before execution.
24+
- [ ] **Patch-based Editing**: Implement a `patch` tool for more efficient, token-saving file modifications.
25+
- [ ] **Dynamic Model Discovery**: Fetch model capabilities from a remote JSON (like `models.dev`) instead of hardcoding.
26+
- [ ] **Intent Header Control**: Ensure we set `Openai-Intent: conversation-edits` and `X-Initiator` in the Copilot bridge for parity with "Official" behavior.
27+
- [ ] **Cost & Token Tracking**: Monitor per-session token usage and estimated costs.
28+
- [ ] **Plugin/Skill Ecosystem**: Expand `/skill` to support external plugins similar to OpenCode's architecture.
29+
30+
---
31+
32+
## 🗺️ Long-Term Roadmap
33+
34+
### 1. 🧠 Deep Project Context (RAG 2.0)
35+
- [ ] Local vector DB for project-wide semantic search.
36+
- [ ] Native AST parsing (using tree-sitter) for language-aware code navigation.
37+
- [ ] Contextual "Project Rules" injection (Auto-detecting `.cursorrules`, `.github/copilot-instructions.md`).
38+
39+
### 2. ⚡ Autonomous Self-Healing
40+
- [ ] Loop that runs tests and fixes failures automatically.
41+
- [ ] Real-time error capture from system logs/background processes.
42+
43+
### 3. 🛡️ Hardware-Agentic Security
44+
- [ ] Secure Enclave integration for secret management (beyond simple vault).
45+
- [ ] Sandboxed execution for risky shell commands.
46+
47+
### 4. 🌐 MCP Bridge
48+
- [ ] Native support for connecting to external MCP servers (Model Context Protocol).
49+
- [ ] Expose VibeAuracle tools *as* an MCP server for other agents.
50+
51+
### 5. 🎨 UI/UX Refinement
52+
- [ ] Streaming viewport rendering (Incremental TUI updates).
53+
- [ ] Keybinding customization engine.
54+
- [ ] Integrated file diff viewer in the TUI.

assets/shot.png

123 KB
Loading

0 commit comments

Comments
 (0)