jerob 1.0.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/CLI/cli.ts +42 -0
- package/README.md +137 -0
- package/SETUP.md +584 -0
- package/agent/action-tracker.ts +45 -0
- package/agent/agent-tools.ts +111 -0
- package/agent/approval.ts +137 -0
- package/agent/diff-view.ts +26 -0
- package/agent/orchestrator.ts +186 -0
- package/agent/tool-executor.ts +463 -0
- package/agent/types.ts +69 -0
- package/ask/orchestrator.ts +244 -0
- package/auth/auth.ts +567 -0
- package/auth/config-store.ts +77 -0
- package/auth/crypto.ts +51 -0
- package/auth/env-writer.ts +82 -0
- package/bin/jerob.js +28 -0
- package/config/ai.config.ts +163 -0
- package/email_ops/email-tools.ts +178 -0
- package/email_ops/email_functions.ts +443 -0
- package/email_ops/email_init.ts +92 -0
- package/email_ops/email_pass_store.ts +61 -0
- package/email_ops/email_server.ts +29 -0
- package/email_ops/types.ts +88 -0
- package/index.ts +176 -0
- package/package.json +88 -0
- package/plan/browser-agent/README.md +118 -0
- package/plan/browser-agent/USAGE.md +308 -0
- package/plan/browser-agent/evaluator.ts +353 -0
- package/plan/browser-agent/executor.ts +372 -0
- package/plan/browser-agent/index.ts +13 -0
- package/plan/browser-agent/orchestrator.ts +323 -0
- package/plan/browser-agent/planner.ts +200 -0
- package/plan/browser-agent/types.ts +62 -0
- package/plan/browser-tool.ts +128 -0
- package/plan/index.ts +12 -0
- package/plan/orchestrator.ts +214 -0
- package/plan/planner.ts +183 -0
- package/plan/selection.ts +50 -0
- package/plan/types.ts +13 -0
- package/plan/web-tools.ts +119 -0
- package/scheduler/ARCHITECTURE.md +263 -0
- package/scheduler/README.md +200 -0
- package/scheduler/SETUP-READY.sql +84 -0
- package/scheduler/check-status.sql +124 -0
- package/scheduler/config-sync.ts +91 -0
- package/scheduler/db-migrate.ts +271 -0
- package/scheduler/db.ts +162 -0
- package/scheduler/debug.ts +184 -0
- package/scheduler/orchestrator.ts +438 -0
- package/scheduler/planner.ts +170 -0
- package/scheduler/update-task-email.ts +70 -0
- package/supabase/.temp/cli-latest +1 -0
- package/supabase/.temp/gotrue-version +1 -0
- package/supabase/.temp/linked-project.json +1 -0
- package/supabase/.temp/pooler-url +1 -0
- package/supabase/.temp/postgres-version +1 -0
- package/supabase/.temp/project-ref +1 -0
- package/supabase/.temp/rest-version +1 -0
- package/supabase/.temp/storage-migration +1 -0
- package/supabase/.temp/storage-version +1 -0
- package/supabase/deploy.ps1 +50 -0
- package/supabase/functions/scheduler-tick/index.ts +496 -0
- package/supabase/supabase/.temp/linked-project.json +1 -0
- package/tsconfig.json +33 -0
- package/tui/spinner.ts +33 -0
- package/tui/spinup.ts +67 -0
- package/tui/terminal-render.ts +16 -0
- package/utils/llm-error.ts +185 -0
- package/utils/model-validator.ts +247 -0
package/CLI/cli.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import {select} from "@clack/prompts"
|
|
2
|
+
import chalk from "chalk"
|
|
3
|
+
import { runAgentMode } from "../agent/orchestrator"
|
|
4
|
+
import { runAskMode } from "../ask/orchestrator"
|
|
5
|
+
import { runPlanMode } from "../plan"
|
|
6
|
+
import { runBrowserAgentMode } from "../plan/browser-agent"
|
|
7
|
+
import { runSchedulerMode } from "../scheduler/orchestrator"
|
|
8
|
+
|
|
9
|
+
export const runCLIMode=async()=>{
|
|
10
|
+
|
|
11
|
+
while(true){
|
|
12
|
+
const subMode=await select({
|
|
13
|
+
message:"Choose CLI SubMode",
|
|
14
|
+
options:[
|
|
15
|
+
{value:"Agent",label:"Agent Mode"},
|
|
16
|
+
{value:"Plan",label:"Plan Mode"},
|
|
17
|
+
{value:"BrowserAgent",label:"Browser Agent Mode"},
|
|
18
|
+
{value:"Ask",label:"Ask Mode" },
|
|
19
|
+
{value:"Scheduler",label:"Scheduler Mode ⏰"},
|
|
20
|
+
{value:"Back",label:"Back"}
|
|
21
|
+
]
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
if(subMode=='Agent'){
|
|
25
|
+
await runAgentMode()
|
|
26
|
+
}else if(subMode=='Plan'){
|
|
27
|
+
await runPlanMode()
|
|
28
|
+
}else if(subMode=='BrowserAgent'){
|
|
29
|
+
await runBrowserAgentMode()
|
|
30
|
+
}else if(subMode=='Ask'){
|
|
31
|
+
await runAskMode()
|
|
32
|
+
}else if(subMode=='Scheduler'){
|
|
33
|
+
await runSchedulerMode()
|
|
34
|
+
}else if(subMode=='Back'){
|
|
35
|
+
|
|
36
|
+
return
|
|
37
|
+
}else{
|
|
38
|
+
console.log(chalk.green.bold("GoodBye!!!"))
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
package/README.md
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
# Jerob — Personal AI Agent CLI
|
|
2
|
+
|
|
3
|
+
A terminal-first AI agent that runs in your terminal. Five modes: autonomous code agent, structured planner, browser automation, conversational Q&A, and a serverless scheduler that runs 24/7 in Supabase — even when your machine is off.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Modes
|
|
8
|
+
|
|
9
|
+
| Mode | What it does |
|
|
10
|
+
|------|-------------|
|
|
11
|
+
| 🤖 Agent | Autonomous file/code operations with diff review and approval |
|
|
12
|
+
| 🧭 Plan | AI-generated multi-step plan — review, edit, execute |
|
|
13
|
+
| 🌐 Browser Agent | Playwright browser automation driven by Gemini |
|
|
14
|
+
| ❓ Ask | Chat with AI — workspace, web search, and Gmail access |
|
|
15
|
+
| ⏰ Scheduler | Serverless recurring tasks running in Supabase Edge Functions |
|
|
16
|
+
|
|
17
|
+
### 🤖 Agent Mode
|
|
18
|
+
Describe a goal in plain English. The agent plans each step, stages all file changes, shows you a diff, and waits for your approval before writing anything. Nothing touches your codebase without your sign-off.
|
|
19
|
+
|
|
20
|
+
### 🧭 Plan Mode
|
|
21
|
+
Generates a structured multi-step plan for any goal. You can review and toggle individual steps, then hand the plan off to Agent Mode for execution — or just use the plan as a reference.
|
|
22
|
+
|
|
23
|
+
### 🌐 Browser Agent Mode
|
|
24
|
+
Runs Playwright-based browser automation using Gemini for DOM understanding. Uses your existing Brave/Chrome profile so you're already signed into sites — no credentials needed in the automation. Iteratively refines its actions until the goal is complete.
|
|
25
|
+
|
|
26
|
+
### ❓ Ask Mode
|
|
27
|
+
Conversational AI with access to your workspace files, web search (via Firecrawl), and Gmail. Read-only — it never modifies files. Session history is maintained within a run.
|
|
28
|
+
|
|
29
|
+
### ⏰ Scheduler Mode
|
|
30
|
+
Define recurring tasks in plain English. Jerob's AI breaks them into steps (web search, web crawl, email send), you set a time, and they run every minute in Supabase Edge Functions — no local machine needed, 24/7.
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Quick Start
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
# 1. Install Bun
|
|
38
|
+
# Windows:
|
|
39
|
+
powershell -c "irm bun.sh/install.ps1 | iex"
|
|
40
|
+
# macOS/Linux:
|
|
41
|
+
curl -fsSL https://bun.sh/install | bash
|
|
42
|
+
|
|
43
|
+
# 2. Clone and install
|
|
44
|
+
git clone https://github.com/your-username/jerob
|
|
45
|
+
cd jerob
|
|
46
|
+
bun install
|
|
47
|
+
bun link
|
|
48
|
+
|
|
49
|
+
# 3. Launch — setup wizard runs automatically on first use
|
|
50
|
+
jerob jet
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
No `.env` needed. The setup wizard encrypts your keys and creates it automatically.
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## What You Need
|
|
58
|
+
|
|
59
|
+
**Minimum (to use Agent / Plan / Ask):**
|
|
60
|
+
- [OpenRouter](https://openrouter.ai/keys) API key — free tier available
|
|
61
|
+
- [Groq](https://console.groq.com) API key — completely free
|
|
62
|
+
|
|
63
|
+
**For Gmail / email features:**
|
|
64
|
+
- Google Cloud project with Gmail API + OAuth credentials ([setup guide](SETUP.md#8-gmail--email-setup))
|
|
65
|
+
|
|
66
|
+
**For Scheduler (24/7 serverless tasks):**
|
|
67
|
+
- [Supabase](https://supabase.com) project — free tier works
|
|
68
|
+
- Supabase personal access token (for one-time auto-setup)
|
|
69
|
+
- Supabase CLI: `npm i -g supabase`
|
|
70
|
+
|
|
71
|
+
**For Browser Agent:**
|
|
72
|
+
- Google Gemini API key ([aistudio.google.com](https://aistudio.google.com))
|
|
73
|
+
- Brave or Chrome browser
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## CLI Commands
|
|
78
|
+
|
|
79
|
+
| Command | Description |
|
|
80
|
+
|---------|-------------|
|
|
81
|
+
| `jerob jet` | Launch Jerob |
|
|
82
|
+
| `jerob set-key` | Update any API key |
|
|
83
|
+
| `jerob switch-model` | Change the active model for any provider |
|
|
84
|
+
| `jerob reset-auth` | Wipe credentials and start fresh |
|
|
85
|
+
| `jerob sync-credentials` | Push keys to Supabase for the scheduler |
|
|
86
|
+
| `jerob setup-db` | Re-run Supabase schema + Edge Function deploy |
|
|
87
|
+
| `jerob scheduler-debug` | Diagnose scheduler issues |
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## AI Providers
|
|
92
|
+
|
|
93
|
+
| Provider | Default model | Used for |
|
|
94
|
+
|----------|--------------|---------|
|
|
95
|
+
| OpenRouter (free) | `openrouter/free` | Agent, Plan, Ask |
|
|
96
|
+
| OpenRouter (paid) | `anthropic/claude-3.5-sonnet` | Agent, Plan, Ask |
|
|
97
|
+
| Google Gemini | `gemini-2.5-flash` | Browser Agent, fallback |
|
|
98
|
+
| Anthropic Claude | `claude-3-5-sonnet-20241022` | Agent, Plan, Ask |
|
|
99
|
+
| OpenAI | `gpt-4o-mini` | Agent, Plan, Ask |
|
|
100
|
+
| Groq | `llama-3.3-70b-versatile` | Scheduler, fast fallback |
|
|
101
|
+
|
|
102
|
+
During setup you pick a primary provider and optional fallbacks. Groq is always the last-resort fallback.
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## Scheduler
|
|
107
|
+
|
|
108
|
+
Define tasks in plain English. Jerob's AI plans the steps, you set a time, and they run in Supabase every minute — no local process needed.
|
|
109
|
+
|
|
110
|
+
```
|
|
111
|
+
Every morning at 9am, search for top AI news and email me a summary
|
|
112
|
+
Every Monday, crawl my competitor's pricing page and send me the changes
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
First-time setup is fully automated when you provide Supabase credentials during `jerob jet`. The wizard creates the tables, deploys the Edge Function, and schedules the cron job automatically.
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## Security
|
|
120
|
+
|
|
121
|
+
- All API keys encrypted with AES-256 using your password
|
|
122
|
+
- Password verified with bcrypt — never stored
|
|
123
|
+
- `.env` regenerated on each login, never committed to git
|
|
124
|
+
- Gmail refresh token stored in `~/.cccontrol/googleAuth/`
|
|
125
|
+
- Supabase `user_config` table RLS-protected (service role only)
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## Full Setup Guide
|
|
130
|
+
|
|
131
|
+
See **[SETUP.md](SETUP.md)** for complete step-by-step instructions for every mode.
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## License
|
|
136
|
+
|
|
137
|
+
MIT
|