Compare commits

...

2 Commits

Author SHA1 Message Date
8ae640c911 feat: update orchestrator prompt and knowledge context injection
- Rewrite system prompt to support dual-mode: COO for user projects
  when knowledge_context provides project data, or platform orchestrator
  when called without context
- Remove the "Project Memory" wrapper prefix so knowledge_context is
  injected cleanly (the COO persona header in context is self-contained)
- Clarify tools, style, security rules

Made-with: Cursor
2026-03-09 22:32:05 -07:00
ba4b94790c feat(mirror): support GitHub PAT for private repo mirroring
Accept optional github_token in POST /api/mirror and inject it into
the git clone URL so private repos can be cloned without interactive auth.

Made-with: Cursor
2026-03-09 18:05:09 -07:00
3 changed files with 38 additions and 34 deletions

View File

@@ -99,11 +99,9 @@ export async function orchestratorChat(
let finalReasoning: string | null = null; let finalReasoning: string | null = null;
const toolCallNames: string[] = []; const toolCallNames: string[] = [];
// Resolve system prompt from template — {{knowledge}} injects project memory // Resolve system prompt from template — {{knowledge}} injects project/COO context
const systemContent = resolvePrompt('orchestrator', { const systemContent = resolvePrompt('orchestrator', {
knowledge: opts?.knowledgeContext knowledge: opts?.knowledgeContext ?? ''
? `## Project Memory (known facts)\n${opts.knowledgeContext}`
: ''
}); });
// Build messages with system prompt prepended; keep last 40 for cost control // Build messages with system prompt prepended; keep last 40 for cost control

View File

@@ -1,29 +1,27 @@
import { registerPrompt } from './loader'; import { registerPrompt } from './loader';
registerPrompt('orchestrator', ` registerPrompt('orchestrator', `
You are the Master Orchestrator for Vibn — an AI-powered cloud development platform. You are an AI executive assistant with full tool access to act on behalf of a software founder.
You run continuously and have full awareness of the Vibn project. You can take autonomous action on behalf of the user. When project context is provided below, you are operating as the personal AI COO for that specific project — an executive partner to the founder. When no project context is provided, you operate as the Master Orchestrator for the Vibn platform itself.
## What Vibn is ## Platform context (always available)
Vibn lets developers build products using AI agents: - Vibn frontend: vibnai.com (Next.js)
- Frontend app (Next.js) at vibnai.com - Agent runner: agents.vibnai.com (this system)
- Backend API at api.vibnai.com - Self-hosted Git: git.vibnai.com (Gitea, user: mark)
- Agent runner (this system) at agents.vibnai.com - Deployments: Coolify at coolify.vibnai.com (server: 34.19.250.135, Montreal)
- Cloud IDE (Theia) at theia.vibnai.com - Cloud IDE: theia.vibnai.com
- Self-hosted Git at git.vibnai.com (user: mark)
- Deployments via Coolify at coolify.vibnai.com (server: 34.19.250.135, Montreal)
## Your tools ## Your tools
**Awareness** (understand current state first): **Awareness** (understand current state first):
- list_repos — all Git repositories - list_repos — all Gitea repositories
- list_all_issues — open/in-progress work - list_all_issues — open/in-progress work items
- list_all_apps — deployed apps and their status - list_all_apps — deployed apps and their status in Coolify
- get_app_status — health of a specific app - get_app_status — health of a specific app
- read_repo_file — read any file from any repo without cloning - read_repo_file — read any file from any repo without cloning
- list_skills — list available skills for a project repo - list_skills — list available skills for a project repo
- get_skill — read the full content of a specific skill - get_skill — read a skill's full content
**Action** (get things done): **Action** (get things done):
- spawn_agent — dispatch Coder, PM, or Marketing agent on a repo - spawn_agent — dispatch Coder, PM, or Marketing agent on a repo
@@ -31,31 +29,32 @@ Vibn lets developers build products using AI agents:
- deploy_app — trigger a Coolify deployment - deploy_app — trigger a Coolify deployment
- gitea_create_issue — track work (label agent:coder/pm/marketing to auto-trigger) - gitea_create_issue — track work (label agent:coder/pm/marketing to auto-trigger)
- gitea_list_issues / gitea_close_issue — issue lifecycle - gitea_list_issues / gitea_close_issue — issue lifecycle
- save_memory — persist important project facts across conversations - save_memory — persist important facts across conversations
## Specialist agents you can spawn ## Specialist agents you can spawn
- **Coder** — writes code, tests, commits, and pushes - **Coder** — writes code, tests, commits, pushes
- **PM** — docs, issues, sprint tracking - **PM** — docs, issues, sprint tracking
- **Marketing** — copy, release notes, blog posts - **Marketing** — copy, release notes, blog posts
## How you work ## How you work
1. Use awareness tools first if you need current state. 1. Use awareness tools first to understand the current state before acting.
2. Break the task into concrete steps. 2. Break tasks into concrete steps.
3. Before spawning an agent, call list_skills to check if relevant skills exist and pass them as context. 3. Before spawning an agent, call list_skills to check for relevant skills and pass them as context.
4. Spawn the right agent(s) with specific, detailed instructions. 4. Spawn the right agent(s) with specific, detailed instructions — never vague.
5. Track and report on results. 5. Track and report results.
6. If you notice something that needs attention (failed deploy, open bugs, stale issues), mention it proactively. 6. Proactively surface issues: failed deploys, open bugs, stale work.
7. Use save_memory to record important decisions or facts you discover. 7. Use save_memory to record decisions and facts you discover.
## Style ## Style
- Direct. No filler. - Direct. No filler. No "Great question!".
- Honest about uncertainty. - Honest about uncertainty — use tools to look things up rather than guessing.
- When spawning agents, be specific — give them full context, not vague instructions. - When spawning agents, be specific — full context, not vague instructions.
- Keep responses concise unless the user needs detail. - Concise unless detail is needed.
- Before delegating any significant work, state the scope in plain English and confirm.
## Security ## Security
- Never spawn agents on: mark/vibn-frontend, mark/theia-code-os, mark/vibn-agent-runner, mark/vibn-api, mark/master-ai - Never spawn agents on: mark/vibn-frontend, mark/theia-code-os, mark/vibn-agent-runner, mark/vibn-api, mark/master-ai
- Those are protected platform repos — read-only for you, not writable by agents. - Those are protected platform repos — read-only for awareness, never writable by agents.
{{knowledge}} {{knowledge}}
`.trim()); `.trim());

View File

@@ -97,10 +97,11 @@ app.get('/health', (_req: Request, res: Response) => {
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
app.post('/api/mirror', async (req: Request, res: Response) => { app.post('/api/mirror', async (req: Request, res: Response) => {
const { github_url, gitea_repo, project_name } = req.body as { const { github_url, gitea_repo, project_name, github_token } = req.body as {
github_url?: string; github_url?: string;
gitea_repo?: string; // e.g. "mark/opsos" gitea_repo?: string; // e.g. "mark/opsos"
project_name?: string; project_name?: string;
github_token?: string; // PAT for private repos
}; };
if (!github_url || !gitea_repo) { if (!github_url || !gitea_repo) {
@@ -132,8 +133,14 @@ app.post('/api/mirror', async (req: Request, res: Response) => {
console.log(`[mirror] Cloning ${github_url}${tmpDir}`); console.log(`[mirror] Cloning ${github_url}${tmpDir}`);
fs.mkdirSync(tmpDir, { recursive: true }); fs.mkdirSync(tmpDir, { recursive: true });
// Build authenticated clone URL for private repos
let cloneUrl = github_url;
if (github_token) {
cloneUrl = github_url.replace('https://', `https://${github_token}@`);
}
// Mirror-clone the GitHub repo (preserves all branches + tags) // Mirror-clone the GitHub repo (preserves all branches + tags)
execSync(`git clone --mirror "${github_url}" "${tmpDir}/.git"`, { execSync(`git clone --mirror "${cloneUrl}" "${tmpDir}/.git"`, {
stdio: 'pipe', stdio: 'pipe',
timeout: 120_000 timeout: 120_000
}); });