feat: migrate agents to monorepo and update federation configs
This commit is contained in:
@@ -0,0 +1,24 @@
|
|||||||
|
# Agent Rules
|
||||||
|
|
||||||
|
## Model Selection Advisor
|
||||||
|
|
||||||
|
Whenever you receive a new user request or begin a new task, you MUST invoke the `model_advisor` skill to evaluate the optimal model and tool strategy before proceeding with any significant planning or code modifications.
|
||||||
|
## OKF Knowledge Base Access
|
||||||
|
|
||||||
|
Whenever the user asks you to search, query, access, or update their "knowledge", "OKF", or "Wissensdatenbank", you MUST use the custom `ctx-guard` CLI tool.
|
||||||
|
The tool is executed from the Orchestrator's virtual environment: `/home/andre/coden/Orchestrator/.venv/bin/ctx-guard knowledge`.
|
||||||
|
|
||||||
|
**Available commands:**
|
||||||
|
- `search`: e.g., `/home/andre/coden/Orchestrator/.venv/bin/ctx-guard knowledge search "query" --limit 5`
|
||||||
|
- `capture`: e.g., `/home/andre/coden/Orchestrator/.venv/bin/ctx-guard knowledge capture "Note" --context privat`
|
||||||
|
- `status`: e.g., `/home/andre/coden/Orchestrator/.venv/bin/ctx-guard knowledge status`
|
||||||
|
- `ingest`: e.g., `/home/andre/coden/Orchestrator/.venv/bin/ctx-guard knowledge ingest`
|
||||||
|
|
||||||
|
Always run this command directly using your `run_command` tool to retrieve or update knowledge before answering the user's queries.
|
||||||
|
|
||||||
|
## PR Workflow Rule
|
||||||
|
|
||||||
|
All code changes or configurations made by agents MUST go through a Pull Request / Merge Request.
|
||||||
|
- You are not allowed to do quicksaves directly to the main branch.
|
||||||
|
- You must create a new branch, commit your changes, push to the remote, and open a PR.
|
||||||
|
- After creating the PR, you must review it for viability and only merge it once confirmed.
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"last_updated": "2026-07-16T20:12:30Z",
|
||||||
|
"providers": {
|
||||||
|
"codex": {
|
||||||
|
"models": []
|
||||||
|
},
|
||||||
|
"antigravity": {
|
||||||
|
"models": []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Executable
+22
@@ -0,0 +1,22 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# check_quotas.sh - Modular script to check quotas
|
||||||
|
export PATH="$HOME/.local/bin:$PATH"
|
||||||
|
|
||||||
|
check_codex_quota() {
|
||||||
|
if command -v codex &> /dev/null; then
|
||||||
|
echo "[Codex Quota]"
|
||||||
|
codex quota || echo "Failed to fetch Codex quota"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
check_agy_quota() {
|
||||||
|
if command -v agy &> /dev/null; then
|
||||||
|
echo "[Antigravity Quota]"
|
||||||
|
agy quota || echo "Failed to fetch Antigravity quota"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "--- Current Quotas ---"
|
||||||
|
check_codex_quota
|
||||||
|
check_agy_quota
|
||||||
|
echo "----------------------"
|
||||||
Executable
+23
@@ -0,0 +1,23 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# install_clis.sh - Install configured CLIs
|
||||||
|
set -e
|
||||||
|
|
||||||
|
echo "Starting CLI installations..."
|
||||||
|
|
||||||
|
echo "Checking codex..."
|
||||||
|
if command -v codex &> /dev/null; then
|
||||||
|
echo "codex is already installed. Version: $(codex --version 2>/dev/null || echo 'unknown')"
|
||||||
|
else
|
||||||
|
echo "Installing codex via curl..."
|
||||||
|
curl -fsSL https://chatgpt.com/codex/install.sh | sh
|
||||||
|
echo "codex installed successfully."
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Checking agy (antigravity)..."
|
||||||
|
if command -v agy &> /dev/null; then
|
||||||
|
echo "agy is already installed."
|
||||||
|
else
|
||||||
|
echo "Warning: agy is not installed. Please install it manually."
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "All CLIs are set up."
|
||||||
Executable
+23
@@ -0,0 +1,23 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# setup_apis.sh - Trigger browser login flows
|
||||||
|
set -e
|
||||||
|
export PATH="$HOME/.local/bin:$PATH"
|
||||||
|
|
||||||
|
CLIS=("codex" "agy")
|
||||||
|
|
||||||
|
echo "Starting API Configuration via Browser Login..."
|
||||||
|
|
||||||
|
for cli in "${CLIS[@]}"; do
|
||||||
|
echo "Configuring $cli..."
|
||||||
|
if command -v "$cli" &> /dev/null; then
|
||||||
|
if [ "$cli" == "agy" ]; then
|
||||||
|
"$cli" auth
|
||||||
|
else
|
||||||
|
"$cli" login
|
||||||
|
fi
|
||||||
|
echo "$cli configured."
|
||||||
|
else
|
||||||
|
echo "Warning: $cli not installed. Please run install_clis.sh first."
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
echo "API setup complete."
|
||||||
Executable
+35
@@ -0,0 +1,35 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# update_models_config.sh - Fetches latest models and quotas
|
||||||
|
export PATH="$HOME/.local/bin:$PATH"
|
||||||
|
|
||||||
|
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
|
CONFIG_FILE="$DIR/../models_config.json"
|
||||||
|
|
||||||
|
echo "{" > "$CONFIG_FILE"
|
||||||
|
echo " \"last_updated\": \"$(date -u +%Y-%m-%dT%H:%M:%SZ)\"," >> "$CONFIG_FILE"
|
||||||
|
|
||||||
|
# Logic to update config
|
||||||
|
echo " \"providers\": {" >> "$CONFIG_FILE"
|
||||||
|
|
||||||
|
# Codex Models
|
||||||
|
echo " \"codex\": {" >> "$CONFIG_FILE"
|
||||||
|
if command -v codex &> /dev/null; then
|
||||||
|
echo " \"models\": $(codex models --json 2>/dev/null || echo '[]')" >> "$CONFIG_FILE"
|
||||||
|
else
|
||||||
|
echo " \"models\": []" >> "$CONFIG_FILE"
|
||||||
|
fi
|
||||||
|
echo " }," >> "$CONFIG_FILE"
|
||||||
|
|
||||||
|
# Antigravity Models
|
||||||
|
echo " \"antigravity\": {" >> "$CONFIG_FILE"
|
||||||
|
if command -v agy &> /dev/null; then
|
||||||
|
echo " \"models\": $(agy models --json 2>/dev/null || echo '[]')" >> "$CONFIG_FILE"
|
||||||
|
else
|
||||||
|
echo " \"models\": []" >> "$CONFIG_FILE"
|
||||||
|
fi
|
||||||
|
echo " }" >> "$CONFIG_FILE"
|
||||||
|
|
||||||
|
echo " }" >> "$CONFIG_FILE"
|
||||||
|
echo "}" >> "$CONFIG_FILE"
|
||||||
|
|
||||||
|
echo "Models config updated at $CONFIG_FILE"
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
---
|
||||||
|
name: model_advisor
|
||||||
|
description: Evaluates a task and orchestrates execution across available CLI models based on cost, quotas, and strengths.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Instructions
|
||||||
|
|
||||||
|
You have been invoked to act as a central orchestrator. You must evaluate the task, check available models and quotas, and delegate the work via CLI.
|
||||||
|
|
||||||
|
## Step 1: Check Quotas & Models
|
||||||
|
Run the following scripts from your workspace:
|
||||||
|
- `.agents/scripts/check_quotas.sh`
|
||||||
|
- Review `.agents/models_config.json` to see currently available models.
|
||||||
|
|
||||||
|
## Step 2: Evaluate the Task
|
||||||
|
Consider the following criteria:
|
||||||
|
1. **Complexity & Context**: Does it require massive context (Gemini Pro) or deep nuance (Claude Sonnet)?
|
||||||
|
2. **Cost & Quota**: Are quotas low? Use cheaper models if the task is simple.
|
||||||
|
|
||||||
|
## Step 3: Output a Recommendation & Delegate
|
||||||
|
If the task is best suited for a CLI-driven model (e.g., Codex or Antigravity with a specific model), you MUST proactively write and execute the terminal command to delegate the task.
|
||||||
|
|
||||||
|
Example output:
|
||||||
|
> [!TIP]
|
||||||
|
> **Model Advisor Recommendation**: The quota for Antigravity is healthy. I am delegating this refactoring task to Claude 3.5 Sonnet via the CLI.
|
||||||
|
|
||||||
|
Example command you might run:
|
||||||
|
```bash
|
||||||
|
agy run --model claude-3-5-sonnet "refactor the payment gateway"
|
||||||
|
```
|
||||||
|
|
||||||
|
If the task is best suited for the *current* IDE model, advise the user to proceed normally without CLI delegation. If it's suited for an IDE model you are *not* currently using, advise the user to switch models manually in the IDE.
|
||||||
|
|
||||||
|
## Step 4: Proceed
|
||||||
|
Once the CLI command completes, or if you decided to handle it locally, complete the user's request.
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
# New Device Setup Guide
|
||||||
|
|
||||||
|
This guide explains how to get your full Monorepo, AI Orchestrator, CLI agents, and Knowledge Base (`ctx-guard`) up and running on a brand new device.
|
||||||
|
|
||||||
|
## Prerequisites
|
||||||
|
|
||||||
|
Ensure the following tools are installed on your new device:
|
||||||
|
- `git`
|
||||||
|
- `python3.12` or newer
|
||||||
|
- `pipx`
|
||||||
|
- `curl`
|
||||||
|
|
||||||
|
## Step 1: Clone the Monorepo
|
||||||
|
|
||||||
|
Clone the Orchestrator to your preferred workspace directory (e.g., `~/coden`):
|
||||||
|
```bash
|
||||||
|
mkdir -p ~/coden
|
||||||
|
cd ~/coden
|
||||||
|
git clone https://git.d-hive.de/ankn/Orchestrator.git
|
||||||
|
cd Orchestrator
|
||||||
|
```
|
||||||
|
|
||||||
|
## Step 2: Set up the Knowledge CLI (`ctx-guard`)
|
||||||
|
|
||||||
|
The `ctx-guard` tool requires a Python virtual environment.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd ~/coden/Orchestrator
|
||||||
|
python3 -m venv .venv
|
||||||
|
source .venv/bin/activate
|
||||||
|
|
||||||
|
# Install the monorepo-cli package in editable mode
|
||||||
|
cd shared/tools/monorepo-cli
|
||||||
|
pip install -e .
|
||||||
|
```
|
||||||
|
|
||||||
|
To register the new machine to your federation topology, run the built-in onboard command:
|
||||||
|
```bash
|
||||||
|
# Replace <machine_name> with your device name
|
||||||
|
ctx-guard onboard <machine_name> "privat,dhive,bahn,shared"
|
||||||
|
```
|
||||||
|
|
||||||
|
## Step 3: Install the AI CLIs
|
||||||
|
|
||||||
|
Install the Codex CLI:
|
||||||
|
```bash
|
||||||
|
curl -fsSL https://chatgpt.com/codex/install.sh | sh
|
||||||
|
```
|
||||||
|
|
||||||
|
Install the Antigravity CLI:
|
||||||
|
```bash
|
||||||
|
curl -fsSL https://antigravity.google/cli/install.sh | bash
|
||||||
|
```
|
||||||
|
|
||||||
|
Run `codex login` and `agy login` in your terminal to authenticate via the browser.
|
||||||
|
|
||||||
|
## Step 4: AI Agent Customizations
|
||||||
|
|
||||||
|
Because the `.agents` folder is now version-controlled inside the Orchestrator monorepo (`~/coden/Orchestrator/.agents`), your AI agents will *automatically* discover your custom skills (like `model_advisor`) and rules (like strictly using `ctx-guard` for knowledge tasks).
|
||||||
|
|
||||||
|
To ensure your models catalog is kept up to date, you can manually run the updater script:
|
||||||
|
```bash
|
||||||
|
cd ~/coden/Orchestrator
|
||||||
|
./.agents/scripts/update_models_config.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
*(Note: In your primary environment, an agent has scheduled this as a daily cron job. You can instruct the agent to set up the same schedule on the new device by typing `/schedule daily run .agents/scripts/update_models_config.sh` in the chat).*
|
||||||
|
|
||||||
|
## Step 5: Sync Federation Repositories
|
||||||
|
|
||||||
|
Finally, pull down the rest of your private and shared federation repositories from the `dhive` GitLab:
|
||||||
|
```bash
|
||||||
|
ctx-guard fed-sync --context dhive
|
||||||
|
```
|
||||||
|
|
||||||
|
Your environment is now fully identical to your original machine!
|
||||||
@@ -5,31 +5,20 @@ federation:
|
|||||||
conflict_strategy: "team-wins"
|
conflict_strategy: "team-wins"
|
||||||
|
|
||||||
team_repos:
|
team_repos:
|
||||||
- context: privat
|
|
||||||
url: "https://github.com/andreknie/privat-team.git"
|
|
||||||
branch: main
|
|
||||||
sync_direction: bidirectional
|
|
||||||
sync_frequency: "on-push"
|
|
||||||
shared_mirror:
|
|
||||||
enabled: true
|
|
||||||
paths:
|
|
||||||
- "shared/tools/common-scripts/"
|
|
||||||
- "shared/config/base-config.yaml"
|
|
||||||
mode: read-only
|
|
||||||
|
|
||||||
- context: dhive
|
- context: dhive
|
||||||
url: "https://gitlab.dhive.io/team/dhive-mono.git"
|
url: "https://git.d-hive.de/team/dhive-mono.git"
|
||||||
branch: main
|
branch: main
|
||||||
sync_direction: bidirectional
|
sync_direction: bidirectional
|
||||||
sync_frequency: "on-push"
|
sync_frequency: "on-push"
|
||||||
shared_mirror:
|
shared_mirror:
|
||||||
enabled: true
|
enabled: true
|
||||||
paths:
|
paths:
|
||||||
- "shared/tools/"
|
- "privat/"
|
||||||
- "shared/powers/db-dxp-platform/"
|
- "shared/AI-Orchestrator/"
|
||||||
- "shared/mcp-servers/"
|
|
||||||
- "shared/OrgMyLife/"
|
- "shared/OrgMyLife/"
|
||||||
mode: read-only
|
- "shared/config/"
|
||||||
|
- "shared/tools/"
|
||||||
|
mode: bidirectional
|
||||||
|
|
||||||
- context: bahn
|
- context: bahn
|
||||||
url: "https://gitlab.2700.2db.it/team/bahn-workspace.git"
|
url: "https://gitlab.2700.2db.it/team/bahn-workspace.git"
|
||||||
|
|||||||
@@ -218,7 +218,7 @@ class SharedMirrorConfig:
|
|||||||
|
|
||||||
enabled: bool
|
enabled: bool
|
||||||
paths: list[str] = field(default_factory=list)
|
paths: list[str] = field(default_factory=list)
|
||||||
mode: Literal["read-only"] = "read-only"
|
mode: Literal["read-only", "bidirectional"] = "read-only"
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
|
|||||||
Reference in New Issue
Block a user